UNPKG

10.3 kBSource Map (JSON)View Raw
1{"version":3,"sources":["../../src/utils/api-node-helpers-docs.js"],"names":["GatsbyReporter","info","warn","error","panic","panicOnBuild","verbose","GatsbyCache","get","set","GatsbyTracing","tracer","parentSpan","startSpan","GatsbyNodeHelpers","cache","getCache","createContentDigest","boundActionCreators","actions","loadNodeContent","store","emitter","getNodes","getNode","getNodesByType","hasNodeChanged","reporter","getNodeAndSavePathDependency","createNodeId","tracing","pathPrefix","module","exports"],"mappings":";;AAAA;;AAEA;AACA,MAAMA,cAAc,GAAG;AACrB;;;;;;AAMA;;;;;;;AAOA;;;;;AAKAC,EAAAA,IAAI,EAAE,IAnBe;;AAqBrB;;;;;AAKAC,EAAAA,IAAI,EAAE,IA1Be;;AA4BrB;;;;;AAKAC,EAAAA,KAAK,EAAE,IAjCc;;AAmCrB;;;;;AAKAC,EAAAA,KAAK,EAAE,IAxCc;;AA0CrB;;;;;AAKAC,EAAAA,YAAY,EAAE,IA/CO;;AAiDrB;;;;;;;AAOAC,EAAAA,OAAO,EAAE;AAxDY,CAAvB;AA2DA;;AACA,MAAMC,WAAW,GAAG;AAClB;;;;;;;AAOAC,EAAAA,GAAG,EAAE,IARa;;AAUlB;;;;;;;;AAQAC,EAAAA,GAAG,EAAE;AAlBa,CAApB;AAqBA;;AACA,MAAMC,aAAa,GAAG;AACpB;;;;;;AAMAC,EAAAA,MAAM,EAAE,IAPY;;AASpB;;;;;;AAMAC,EAAAA,UAAU,EAAE,IAfQ;;AAiBpB;;;;;;AAMA;;;;;;;;;;;;;;;;;;;AAmBAC,EAAAA,SAAS,EAAE;AA1CS,CAAtB;AA6CA;;AACA,MAAMC,iBAAiB,GAAG;AACxB;;;;;AAKAC,EAAAA,KAAK,EAAE,IANiB;;AAQxB;;;;;;AAMAC,EAAAA,QAAQ,EAAE,IAdc;;AAgBxB;;;;;;;;;;;;;;;;AAgBAC,EAAAA,mBAAmB,EAAE,IAhCG;;AAkCxB;;;;;;;;AAQAC,EAAAA,mBAAmB,EAAE,IA1CG;;AA4CxB;;;;;;AAMAC,EAAAA,OAAO,EAAE,IAlDe;;AAoDxB;;;;;;;;;;;;;;;AAeAC,EAAAA,eAAe,EAAE,IAnEO;;AAqExB;;;;;;AAMAC,EAAAA,KAAK,EAAE,IA3EiB;;AA6ExB;;;;;AAKAC,EAAAA,OAAO,EAAE,IAlFe;;AAoFxB;;;;;;AAMAC,EAAAA,QAAQ,EAAE,IA1Fc;;AA4FxB;;;;;;;;;AASAC,EAAAA,OAAO,EAAE,IArGe;;AAuGxB;;;;;;;AAOAC,EAAAA,cAAc,EAAE,IA9GQ;;AAgHxB;;;;;;;;;AASAC,EAAAA,cAAc,EAAE,IAzHQ;;AA2HxB;;;;AAIAC,EAAAA,QAAQ,EAAE,IA/Hc;;AAiIxB;;;;;;;;;;;AAWAC,EAAAA,4BAA4B,EAAE,IA5IN;;AA8IxB;;;;;;;;;;;;;AAaAC,EAAAA,YAAY,EAAE,IA3JU;;AA6JxB;;;;;;;AAOAC,EAAAA,OAAO,EAAE,IApKe;;AAsKxB;;;;;;;AAOAC,EAAAA,UAAU,EAAE;AA7KY,CAA1B;AAgLAC,MAAM,CAACC,OAAP,GAAiBnB,iBAAjB","sourcesContent":["/* eslint-disable no-unused-vars */\n\n/** */\nconst GatsbyReporter = {\n /**\n * @callback GatsbyReporterFn\n * @param {string} message Message to display\n * @returns {void}\n */\n\n /**\n * @callback GatsbyReporterFnWithError\n * @param {string} message Message to display\n * @param {Error}[error] Optional error object\n * @returns {void}\n */\n\n /**\n * @type {GatsbyReporterFn}\n * @example\n * reporter.info(`text`)\n */\n info: true,\n\n /**\n * @type {GatsbyReporterFn}\n * @example\n * reporter.warn(`text`)\n */\n warn: true,\n\n /**\n * @type {GatsbyReporterFnWithError}\n * @example\n * reporter.error(`text`, new Error('something'))\n */\n error: true,\n\n /**\n * @type {GatsbyReporterFnWithError}\n * @example\n * reporter.panic(`text`, new Error('something'))\n */\n panic: true,\n\n /**\n * @type {GatsbyReporterFnWithError}\n * @example\n * reporter.panicOnBuild(`text`, new Error('something'))\n */\n panicOnBuild: true,\n\n /**\n * Note that this method only works if the --verbose option has\n * been passed to the CLI\n * @type {GatsbyReporterFn}\n * @example\n * reporter.verbose(`text`)\n */\n verbose: true,\n};\n\n/** */\nconst GatsbyCache = {\n /**\n * Retrieve cached value\n * @param {string} key Cache key\n * @returns {Promise<any>} Promise resolving to cached value\n * @example\n * const value = await cache.get(`unique-key`)\n */\n get: true,\n\n /**\n * Cache value\n * @param {string} key Cache key\n * @param {any} value Value to be cached\n * @returns {Promise<any>} Promise resolving to cached value\n * @example\n * await cache.set(`unique-key`, value)\n */\n set: true,\n};\n\n/** */\nconst GatsbyTracing = {\n /**\n * Global tracer instance. Check\n * [opentracing Tracer documentation](https://opentracing-javascript.surge.sh/classes/tracer.html)\n * for more details.\n * @type {Opentracing.Tracer}\n */\n tracer: true,\n\n /**\n * Tracer span representing API run. Check\n * [opentracing Span documentation](https://opentracing-javascript.surge.sh/classes/span.html)\n * for more details.\n * @type {Opentracing.Span}\n */\n parentSpan: true,\n\n /**\n * @callback GatsbyTracing.StartSpan\n * @param {string} spanName name of the span\n * @returns {Opentracing.Span}\n */\n\n /**\n * Start a tracing span. The span will be created as a child of the currently\n * running API span. This is a convenience wrapper for\n * ```js\n * tracing.tracer.startSpan(`span-name`, { childOf: tracing.parentSpan}).\n * ```\n * @type {GatsbyTracing.StartSpan}\n * @example\n * exports.sourceNodes = async ({ actions, tracing }) => {\n * const span = tracing.startSpan(`foo`)\n *\n * // Perform any span operations. E.g. add a tag to your span\n * span.setTag(`bar`, `baz`)\n *\n * // Rest of your plugin code\n *\n * span.finish()\n * }\n */\n startSpan: true,\n};\n\n/** */\nconst GatsbyNodeHelpers = {\n /**\n * Key-value store used to persist results of time/memory/cpu intensive\n * tasks. All functions are async and return promises.\n * @type {GatsbyCache}\n */\n cache: true,\n\n /**\n * Get cache instance by name - this should only be used by plugins that\n * accept subplugins.\n * @param {string} id Test\n * @returns {GatsbyCache} See [`cache`](#cache) section for reference.\n */\n getCache: true,\n\n /**\n * Create a stable content digest from a string or object, you can use the\n * result of this function to set the `internal.contentDigest` field\n * on nodes. Gatsby uses the value of this field to invalidate stale data\n * when your content changes.\n * @param {(string|object)} input\n * @returns {string} Hash string\n * @example\n * const node = {\n * ...nodeData,\n * internal: {\n * type: `TypeOfNode`,\n * contentDigest: createContentDigest(nodeData)\n * }\n * }\n */\n createContentDigest: true,\n\n /**\n * Collection of functions used to programmatically modify Gatsby’s internal state.\n *\n * See [`actions`](/docs/actions/) reference.\n * @type {Actions}\n * @deprecated Will be removed in gatsby 3.0. Use [actions](#actions)\n * instead.\n */\n boundActionCreators: true,\n\n /**\n * Collection of functions used to programmatically modify Gatsby’s internal state.\n *\n * See [`actions`](/docs/actions/) reference.\n * @type {Actions}\n */\n actions: true,\n\n /**\n * Get content for a node from the plugin that created it.\n * @param {Node} node\n * @returns {Promise<string>}\n * @example\n * module.exports = async function onCreateNode(\n * { node, loadNodeContent, actions, createNodeId }\n * ) {\n * if (node.internal.mediaType === 'text/markdown') {\n * const { createNode, createParentChildLink } = actions\n * const textContent = await loadNodeContent(node)\n * // process textContent and create child nodes\n * }\n * }\n */\n loadNodeContent: true,\n\n /**\n * Internal redux state used for application state. Do not use, unless you\n * absolutely must. Store is considered a private API and can change with\n * any version.\n * @type {Redux.Store}\n */\n store: true,\n\n /**\n * Internal event emitter / listener. Do not use, unless you absolutely\n * must. Emitter is considered a private API and can change with any version.\n * @type {Emitter}\n */\n emitter: true,\n\n /**\n * Get array of all nodes.\n * @returns {Node[]} Array of nodes.\n * @example\n * const allNodes = getNodes()\n */\n getNodes: true,\n\n /**\n * Get single node by given ID.\n * Don't use this in graphql resolvers - see\n * [`getNodeAndSavePathDependency`](#getNodeAndSavePathDependency).\n * @param {string} ID id of the node.\n * @returns {Node} Single node instance.\n * @example\n * const node = getNode(id)\n */\n getNode: true,\n\n /**\n * Get array of nodes of given type.\n * @param {string} Type of nodes\n * @returns {Node[]} Array of nodes.\n * @example\n * const markdownNodes = getNodesByType(`MarkdownRemark`)\n */\n getNodesByType: true,\n\n /**\n * Compares `contentDigest` of cached node with passed value\n * to determine if node has changed.\n *\n * @param {string} id of node\n * @param {string} contentDigest of node\n * @returns {boolean}\n * @deprecated This check is done internally in Gatsby and it's not necessary to use it in plugins. Will be removed in gatsby 3.0.\n */\n hasNodeChanged: true,\n\n /**\n * Set of utilities to output information to user\n * @type {GatsbyReporter}\n */\n reporter: true,\n\n /**\n * Get single node by given ID and create dependency for given path.\n * This should be used instead of `getNode` in graphql resolvers to enable\n * tracking dependencies for query results. If it's not used Gatsby will\n * not rerun query if node changes leading to stale query results. See\n * [Page -> Node Dependency Tracking](/docs/page-node-dependencies/)\n * for more details.\n * @param {string} ID id of the node.\n * @param {string} path of the node.\n * @returns {Node} Single node instance.\n */\n getNodeAndSavePathDependency: true,\n\n /**\n * Utility function useful to generate globally unique and stable node IDs.\n * It will generate different IDs for different plugins if they use same\n * input.\n *\n * @param {string} input\n * @returns {string} UUIDv5 ID string\n * @example\n * const node = {\n * id: createNodeId(`${backendData.type}${backendData.id}`),\n * ...restOfNodeData\n * }\n */\n createNodeId: true,\n\n /**\n * Set of utilities that allow adding more detailed tracing for plugins.\n * Check\n * [Performance tracing](https://www.gatsbyjs.org/docs/performance-tracing)\n * page for more details.\n * @type {GatsbyTracing}\n */\n tracing: true,\n\n /**\n * Use to prefix resources URLs. `pathPrefix` will be either empty string or\n * path that starts with slash and doesn't end with slash. Check\n * [Adding a Path Prefix](https://www.gatsbyjs.org/docs/path-prefix/)\n * page for details about path prefixing.\n * @type {string}\n */\n pathPrefix: true,\n};\n\nmodule.exports = GatsbyNodeHelpers;\n"],"file":"api-node-helpers-docs.js"}
\No newline at end of file