@wordpress/api-fetch 6.7.0 → 6.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 6.10.0 (2022-07-13)
6
+
7
+ ## 6.9.0 (2022-06-29)
8
+
9
+ ## 6.8.0 (2022-06-15)
10
+
5
11
  ## 6.7.0 (2022-06-01)
6
12
 
7
13
  ## 6.6.0 (2022-05-18)
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/api-fetch/src/index.js"],"names":["DEFAULT_HEADERS","Accept","DEFAULT_OPTIONS","credentials","middlewares","userLocaleMiddleware","namespaceEndpointMiddleware","httpV1Middleware","fetchAllMiddleware","registerMiddleware","middleware","unshift","checkStatus","response","status","defaultFetchHandler","nextOptions","url","path","data","parse","remainingOptions","body","headers","JSON","stringify","responsePromise","window","fetch","location","href","then","value","Promise","resolve","catch","err","name","code","message","fetchHandler","setFetchHandler","newFetchHandler","apiFetch","options","enhancedHandler","reduceRight","next","workingOptions","error","reject","nonceEndpoint","text","nonceMiddleware","nonce","use","createNonceMiddleware","createPreloadingMiddleware","createRootURLMiddleware","mediaUploadMiddleware"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAhBA;AACA;AACA;;AAGA;AACA;AACA;;AAcA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,eAAe,GAAG;AACvB;AACA;AACA;AACA;AACAC,EAAAA,MAAM,EAAE;AALe,CAAxB;AAQA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMC,eAAe,GAAG;AACvBC,EAAAA,WAAW,EAAE;AADU,CAAxB;AAIA;;AACA;;AAEA;AACA;AACA;;AACA,MAAMC,WAAW,GAAG,CACnBC,mBADmB,EAEnBC,0BAFmB,EAGnBC,cAHmB,EAInBC,2BAJmB,CAApB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IAAF,IAAY;AAClB;AACAT,MAAAA,QAAQ,CAACU,eAAT,CAAyBC,KAAzB,GAAiCF,IAAjC;AACA,aAAOT,QAAQ,CAAEC,OAAF,CAAf;AACA,KATF,CADD;AAYA,GAlBM,CAAP;AAmBA;;AAEDD,QAAQ,CAACY,GAAT,GAAe9C,kBAAf;AACAkC,QAAQ,CAACF,eAAT,GAA2BA,eAA3B;AAEAE,QAAQ,CAACa,qBAAT,GAAiCA,cAAjC;AACAb,QAAQ,CAACc,0BAAT,GAAsCA,mBAAtC;AACAd,QAAQ,CAACe,uBAAT,GAAmCA,gBAAnC;AACAf,QAAQ,CAACnC,kBAAT,GAA8BA,2BAA9B;AACAmC,QAAQ,CAACgB,qBAAT,GAAiCA,oBAAjC;eAEehB,Q","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport createNonceMiddleware from './middlewares/nonce';\nimport createRootURLMiddleware from './middlewares/root-url';\nimport createPreloadingMiddleware from './middlewares/preloading';\nimport fetchAllMiddleware from './middlewares/fetch-all-middleware';\nimport namespaceEndpointMiddleware from './middlewares/namespace-endpoint';\nimport httpV1Middleware from './middlewares/http-v1';\nimport userLocaleMiddleware from './middlewares/user-locale';\nimport mediaUploadMiddleware from './middlewares/media-upload';\nimport {\n\tparseResponseAndNormalizeError,\n\tparseAndThrowError,\n} from './utils/response';\n\n/**\n * Default set of header values which should be sent with every request unless\n * explicitly provided through apiFetch options.\n *\n * @type {Record<string, string>}\n */\nconst DEFAULT_HEADERS = {\n\t// The backend uses the Accept header as a condition for considering an\n\t// incoming request as a REST request.\n\t//\n\t// See: https://core.trac.wordpress.org/ticket/44534\n\tAccept: 'application/json, */*;q=0.1',\n};\n\n/**\n * Default set of fetch option values which should be sent with every request\n * unless explicitly provided through apiFetch options.\n *\n * @type {Object}\n */\nconst DEFAULT_OPTIONS = {\n\tcredentials: 'include',\n};\n\n/** @typedef {import('./types').APIFetchMiddleware} APIFetchMiddleware */\n/** @typedef {import('./types').APIFetchOptions} APIFetchOptions */\n\n/**\n * @type {import('./types').APIFetchMiddleware[]}\n */\nconst middlewares = [\n\tuserLocaleMiddleware,\n\tnamespaceEndpointMiddleware,\n\thttpV1Middleware,\n\tfetchAllMiddleware,\n];\n\n/**\n * Register a middleware\n *\n * @param {import('./types').APIFetchMiddleware} middleware\n */\nfunction registerMiddleware( middleware ) {\n\tmiddlewares.unshift( middleware );\n}\n\n/**\n * Checks the status of a response, throwing the Response as an error if\n * it is outside the 200 range.\n *\n * @param {Response} response\n * @return {Response} The response if the status is in the 200 range.\n */\nconst checkStatus = ( response ) => {\n\tif ( response.status >= 200 && response.status < 300 ) {\n\t\treturn response;\n\t}\n\n\tthrow response;\n};\n\n/** @typedef {(options: import('./types').APIFetchOptions) => Promise<any>} FetchHandler*/\n\n/**\n * @type {FetchHandler}\n */\nconst defaultFetchHandler = ( nextOptions ) => {\n\tconst { url, path, data, parse = true, ...remainingOptions } = nextOptions;\n\tlet { body, headers } = nextOptions;\n\n\t// Merge explicitly-provided headers with default values.\n\theaders = { ...DEFAULT_HEADERS, ...headers };\n\n\t// The `data` property is a shorthand for sending a JSON body.\n\tif ( data ) {\n\t\tbody = JSON.stringify( data );\n\t\theaders[ 'Content-Type' ] = 'application/json';\n\t}\n\n\tconst responsePromise = window.fetch(\n\t\t// Fall back to explicitly passing `window.location` which is the behavior if `undefined` is passed.\n\t\turl || path || window.location.href,\n\t\t{\n\t\t\t...DEFAULT_OPTIONS,\n\t\t\t...remainingOptions,\n\t\t\tbody,\n\t\t\theaders,\n\t\t}\n\t);\n\n\treturn responsePromise.then(\n\t\t( value ) =>\n\t\t\tPromise.resolve( value )\n\t\t\t\t.then( checkStatus )\n\t\t\t\t.catch( ( response ) => parseAndThrowError( response, parse ) )\n\t\t\t\t.then( ( response ) =>\n\t\t\t\t\tparseResponseAndNormalizeError( response, parse )\n\t\t\t\t),\n\t\t( err ) => {\n\t\t\t// Re-throw AbortError for the users to handle it themselves.\n\t\t\tif ( err && err.name === 'AbortError' ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\n\t\t\t// Otherwise, there is most likely no network connection.\n\t\t\t// Unfortunately the message might depend on the browser.\n\t\t\tthrow {\n\t\t\t\tcode: 'fetch_error',\n\t\t\t\tmessage: __( 'You are probably offline.' ),\n\t\t\t};\n\t\t}\n\t);\n};\n\n/** @type {FetchHandler} */\nlet fetchHandler = defaultFetchHandler;\n\n/**\n * Defines a custom fetch handler for making the requests that will override\n * the default one using window.fetch\n *\n * @param {FetchHandler} newFetchHandler The new fetch handler\n */\nfunction setFetchHandler( newFetchHandler ) {\n\tfetchHandler = newFetchHandler;\n}\n\n/**\n * @template T\n * @param {import('./types').APIFetchOptions} options\n * @return {Promise<T>} A promise representing the request processed via the registered middlewares.\n */\nfunction apiFetch( options ) {\n\t// creates a nested function chain that calls all middlewares and finally the `fetchHandler`,\n\t// converting `middlewares = [ m1, m2, m3 ]` into:\n\t// ```\n\t// opts1 => m1( opts1, opts2 => m2( opts2, opts3 => m3( opts3, fetchHandler ) ) );\n\t// ```\n\tconst enhancedHandler = middlewares.reduceRight( (\n\t\t/** @type {FetchHandler} */ next,\n\t\tmiddleware\n\t) => {\n\t\treturn ( workingOptions ) => middleware( workingOptions, next );\n\t}, fetchHandler );\n\n\treturn enhancedHandler( options ).catch( ( error ) => {\n\t\tif ( error.code !== 'rest_cookie_invalid_nonce' ) {\n\t\t\treturn Promise.reject( error );\n\t\t}\n\n\t\t// If the nonce is invalid, refresh it and try again.\n\t\treturn (\n\t\t\twindow\n\t\t\t\t// @ts-ignore\n\t\t\t\t.fetch( apiFetch.nonceEndpoint )\n\t\t\t\t.then( checkStatus )\n\t\t\t\t.then( ( data ) => data.text() )\n\t\t\t\t.then( ( text ) => {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tapiFetch.nonceMiddleware.nonce = text;\n\t\t\t\t\treturn apiFetch( options );\n\t\t\t\t} )\n\t\t);\n\t} );\n}\n\napiFetch.use = registerMiddleware;\napiFetch.setFetchHandler = setFetchHandler;\n\napiFetch.createNonceMiddleware = createNonceMiddleware;\napiFetch.createPreloadingMiddleware = createPreloadingMiddleware;\napiFetch.createRootURLMiddleware = createRootURLMiddleware;\napiFetch.fetchAllMiddleware = fetchAllMiddleware;\napiFetch.mediaUploadMiddleware = mediaUploadMiddleware;\n\nexport default apiFetch;\n"]}
1
+ {"version":3,"sources":["@wordpress/api-fetch/src/index.js"],"names":["DEFAULT_HEADERS","Accept","DEFAULT_OPTIONS","credentials","middlewares","userLocaleMiddleware","namespaceEndpointMiddleware","httpV1Middleware","fetchAllMiddleware","registerMiddleware","middleware","unshift","checkStatus","response","status","defaultFetchHandler","nextOptions","url","path","data","parse","remainingOptions","body","headers","JSON","stringify","responsePromise","window","fetch","location","href","then","value","Promise","resolve","catch","err","name","code","message","fetchHandler","setFetchHandler","newFetchHandler","apiFetch","options","enhancedHandler","reduceRight","next","workingOptions","error","reject","nonceEndpoint","text","nonceMiddleware","nonce","use","createNonceMiddleware","createPreloadingMiddleware","createRootURLMiddleware","mediaUploadMiddleware"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAhBA;AACA;AACA;;AAGA;AACA;AACA;;AAcA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,eAAe,GAAG;AACvB;AACA;AACA;AACA;AACAC,EAAAA,MAAM,EAAE;AALe,CAAxB;AAQA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMC,eAAe,GAAG;AACvBC,EAAAA,WAAW,EAAE;AADU,CAAxB;AAIA;;AACA;;AAEA;AACA;AACA;;AACA,MAAMC,WAAW,GAAG,CACnBC,mBADmB,EAEnBC,0BAFmB,EAGnBC,cAHmB,EAInBC,2BAJmB,CAApB;AAOA;AACA;AACA;AACA;AACA;;AACA,SAASC,kBAAT,CAA6BC,UAA7B,EAA0C;AACzCN,EAAAA,WAAW,CAACO,OAAZ,CAAqB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,OAAF,CAAf;AACA,KATF,CADD;AAYA,GAlBM,CAAP;AAmBA;;AAEDD,QAAQ,CAACY,GAAT,GAAe9C,kBAAf;AACAkC,QAAQ,CAACF,eAAT,GAA2BA,eAA3B;AAEAE,QAAQ,CAACa,qBAAT,GAAiCA,cAAjC;AACAb,QAAQ,CAACc,0BAAT,GAAsCA,mBAAtC;AACAd,QAAQ,CAACe,uBAAT,GAAmCA,gBAAnC;AACAf,QAAQ,CAACnC,kBAAT,GAA8BA,2BAA9B;AACAmC,QAAQ,CAACgB,qBAAT,GAAiCA,oBAAjC;eAEehB,Q","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport createNonceMiddleware from './middlewares/nonce';\nimport createRootURLMiddleware from './middlewares/root-url';\nimport createPreloadingMiddleware from './middlewares/preloading';\nimport fetchAllMiddleware from './middlewares/fetch-all-middleware';\nimport namespaceEndpointMiddleware from './middlewares/namespace-endpoint';\nimport httpV1Middleware from './middlewares/http-v1';\nimport userLocaleMiddleware from './middlewares/user-locale';\nimport mediaUploadMiddleware from './middlewares/media-upload';\nimport {\n\tparseResponseAndNormalizeError,\n\tparseAndThrowError,\n} from './utils/response';\n\n/**\n * Default set of header values which should be sent with every request unless\n * explicitly provided through apiFetch options.\n *\n * @type {Record<string, string>}\n */\nconst DEFAULT_HEADERS = {\n\t// The backend uses the Accept header as a condition for considering an\n\t// incoming request as a REST request.\n\t//\n\t// See: https://core.trac.wordpress.org/ticket/44534\n\tAccept: 'application/json, */*;q=0.1',\n};\n\n/**\n * Default set of fetch option values which should be sent with every request\n * unless explicitly provided through apiFetch options.\n *\n * @type {Object}\n */\nconst DEFAULT_OPTIONS = {\n\tcredentials: 'include',\n};\n\n/** @typedef {import('./types').APIFetchMiddleware} APIFetchMiddleware */\n/** @typedef {import('./types').APIFetchOptions} APIFetchOptions */\n\n/**\n * @type {import('./types').APIFetchMiddleware[]}\n */\nconst middlewares = [\n\tuserLocaleMiddleware,\n\tnamespaceEndpointMiddleware,\n\thttpV1Middleware,\n\tfetchAllMiddleware,\n];\n\n/**\n * Register a middleware\n *\n * @param {import('./types').APIFetchMiddleware} middleware\n */\nfunction registerMiddleware( middleware ) {\n\tmiddlewares.unshift( middleware );\n}\n\n/**\n * Checks the status of a response, throwing the Response as an error if\n * it is outside the 200 range.\n *\n * @param {Response} response\n * @return {Response} The response if the status is in the 200 range.\n */\nconst checkStatus = ( response ) => {\n\tif ( response.status >= 200 && response.status < 300 ) {\n\t\treturn response;\n\t}\n\n\tthrow response;\n};\n\n/** @typedef {(options: import('./types').APIFetchOptions) => Promise<any>} FetchHandler*/\n\n/**\n * @type {FetchHandler}\n */\nconst defaultFetchHandler = ( nextOptions ) => {\n\tconst { url, path, data, parse = true, ...remainingOptions } = nextOptions;\n\tlet { body, headers } = nextOptions;\n\n\t// Merge explicitly-provided headers with default values.\n\theaders = { ...DEFAULT_HEADERS, ...headers };\n\n\t// The `data` property is a shorthand for sending a JSON body.\n\tif ( data ) {\n\t\tbody = JSON.stringify( data );\n\t\theaders[ 'Content-Type' ] = 'application/json';\n\t}\n\n\tconst responsePromise = window.fetch(\n\t\t// Fall back to explicitly passing `window.location` which is the behavior if `undefined` is passed.\n\t\turl || path || window.location.href,\n\t\t{\n\t\t\t...DEFAULT_OPTIONS,\n\t\t\t...remainingOptions,\n\t\t\tbody,\n\t\t\theaders,\n\t\t}\n\t);\n\n\treturn responsePromise.then(\n\t\t( value ) =>\n\t\t\tPromise.resolve( value )\n\t\t\t\t.then( checkStatus )\n\t\t\t\t.catch( ( response ) => parseAndThrowError( response, parse ) )\n\t\t\t\t.then( ( response ) =>\n\t\t\t\t\tparseResponseAndNormalizeError( response, parse )\n\t\t\t\t),\n\t\t( err ) => {\n\t\t\t// Re-throw AbortError for the users to handle it themselves.\n\t\t\tif ( err && err.name === 'AbortError' ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\n\t\t\t// Otherwise, there is most likely no network connection.\n\t\t\t// Unfortunately the message might depend on the browser.\n\t\t\tthrow {\n\t\t\t\tcode: 'fetch_error',\n\t\t\t\tmessage: __( 'You are probably offline.' ),\n\t\t\t};\n\t\t}\n\t);\n};\n\n/** @type {FetchHandler} */\nlet fetchHandler = defaultFetchHandler;\n\n/**\n * Defines a custom fetch handler for making the requests that will override\n * the default one using window.fetch\n *\n * @param {FetchHandler} newFetchHandler The new fetch handler\n */\nfunction setFetchHandler( newFetchHandler ) {\n\tfetchHandler = newFetchHandler;\n}\n\n/**\n * @template T\n * @param {import('./types').APIFetchOptions} options\n * @return {Promise<T>} A promise representing the request processed via the registered middlewares.\n */\nfunction apiFetch( options ) {\n\t// creates a nested function chain that calls all middlewares and finally the `fetchHandler`,\n\t// converting `middlewares = [ m1, m2, m3 ]` into:\n\t// ```\n\t// opts1 => m1( opts1, opts2 => m2( opts2, opts3 => m3( opts3, fetchHandler ) ) );\n\t// ```\n\tconst enhancedHandler = middlewares.reduceRight(\n\t\t( /** @type {FetchHandler} */ next, middleware ) => {\n\t\t\treturn ( workingOptions ) => middleware( workingOptions, next );\n\t\t},\n\t\tfetchHandler\n\t);\n\n\treturn enhancedHandler( options ).catch( ( error ) => {\n\t\tif ( error.code !== 'rest_cookie_invalid_nonce' ) {\n\t\t\treturn Promise.reject( error );\n\t\t}\n\n\t\t// If the nonce is invalid, refresh it and try again.\n\t\treturn (\n\t\t\twindow\n\t\t\t\t// @ts-ignore\n\t\t\t\t.fetch( apiFetch.nonceEndpoint )\n\t\t\t\t.then( checkStatus )\n\t\t\t\t.then( ( data ) => data.text() )\n\t\t\t\t.then( ( text ) => {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tapiFetch.nonceMiddleware.nonce = text;\n\t\t\t\t\treturn apiFetch( options );\n\t\t\t\t} )\n\t\t);\n\t} );\n}\n\napiFetch.use = registerMiddleware;\napiFetch.setFetchHandler = setFetchHandler;\n\napiFetch.createNonceMiddleware = createNonceMiddleware;\napiFetch.createPreloadingMiddleware = createPreloadingMiddleware;\napiFetch.createRootURLMiddleware = createRootURLMiddleware;\napiFetch.fetchAllMiddleware = fetchAllMiddleware;\napiFetch.mediaUploadMiddleware = mediaUploadMiddleware;\n\nexport default apiFetch;\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/api-fetch/src/index.js"],"names":["__","createNonceMiddleware","createRootURLMiddleware","createPreloadingMiddleware","fetchAllMiddleware","namespaceEndpointMiddleware","httpV1Middleware","userLocaleMiddleware","mediaUploadMiddleware","parseResponseAndNormalizeError","parseAndThrowError","DEFAULT_HEADERS","Accept","DEFAULT_OPTIONS","credentials","middlewares","registerMiddleware","middleware","unshift","checkStatus","response","status","defaultFetchHandler","nextOptions","url","path","data","parse","remainingOptions","body","headers","JSON","stringify","responsePromise","window","fetch","location","href","then","value","Promise","resolve","catch","err","name","code","message","fetchHandler","setFetchHandler","newFetchHandler","apiFetch","options","enhancedHandler","reduceRight","next","workingOptions","error","reject","nonceEndpoint","text","nonceMiddleware","nonce","use"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,OAAOC,qBAAP,MAAkC,qBAAlC;AACA,OAAOC,uBAAP,MAAoC,wBAApC;AACA,OAAOC,0BAAP,MAAuC,0BAAvC;AACA,OAAOC,kBAAP,MAA+B,oCAA/B;AACA,OAAOC,2BAAP,MAAwC,kCAAxC;AACA,OAAOC,gBAAP,MAA6B,uBAA7B;AACA,OAAOC,oBAAP,MAAiC,2BAAjC;AACA,OAAOC,qBAAP,MAAkC,4BAAlC;AACA,SACCC,8BADD,EAECC,kBAFD,QAGO,kBAHP;AAKA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMC,eAAe,GAAG;AACvB;AACA;AACA;AACA;AACAC,EAAAA,MAAM,EAAE;AALe,CAAxB;AAQA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMC,eAAe,GAAG;AACvBC,EAAAA,WAAW,EAAE;AADU,CAAxB;AAIA;;AACA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,CAACQ,aAFlB,EAGEpB,IAHF,CAGQnB,WAHR,EAIEmB,IAJF,CAIUZ,IAAF,IAAYA,IAAI,CAACiC,IAAL,EAJpB,EAKErB,IALF,CAKUqB,IAAF,IAAY;AAClB;AACAT,MAAAA,QAAQ,CAACU,eAAT,CAAyBC,KAAzB,GAAiCF,IAAjC;AACA,aAAOT,QAAQ,CAAEC,OAAF,CAAf;AACA,KATF,CADD;AAYA,GAlBM,CAAP;AAmBA;;AAEDD,QAAQ,CAACY,GAAT,GAAe9C,kBAAf;AACAkC,QAAQ,CAACF,eAAT,GAA2BA,eAA3B;AAEAE,QAAQ,CAACjD,qBAAT,GAAiCA,qBAAjC;AACAiD,QAAQ,CAAC/C,0BAAT,GAAsCA,0BAAtC;AACA+C,QAAQ,CAAChD,uBAAT,GAAmCA,uBAAnC;AACAgD,QAAQ,CAAC9C,kBAAT,GAA8BA,kBAA9B;AACA8C,QAAQ,CAAC1C,qBAAT,GAAiCA,qBAAjC;AAEA,eAAe0C,QAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport createNonceMiddleware from './middlewares/nonce';\nimport createRootURLMiddleware from './middlewares/root-url';\nimport createPreloadingMiddleware from './middlewares/preloading';\nimport fetchAllMiddleware from './middlewares/fetch-all-middleware';\nimport namespaceEndpointMiddleware from './middlewares/namespace-endpoint';\nimport httpV1Middleware from './middlewares/http-v1';\nimport userLocaleMiddleware from './middlewares/user-locale';\nimport mediaUploadMiddleware from './middlewares/media-upload';\nimport {\n\tparseResponseAndNormalizeError,\n\tparseAndThrowError,\n} from './utils/response';\n\n/**\n * Default set of header values which should be sent with every request unless\n * explicitly provided through apiFetch options.\n *\n * @type {Record<string, string>}\n */\nconst DEFAULT_HEADERS = {\n\t// The backend uses the Accept header as a condition for considering an\n\t// incoming request as a REST request.\n\t//\n\t// See: https://core.trac.wordpress.org/ticket/44534\n\tAccept: 'application/json, */*;q=0.1',\n};\n\n/**\n * Default set of fetch option values which should be sent with every request\n * unless explicitly provided through apiFetch options.\n *\n * @type {Object}\n */\nconst DEFAULT_OPTIONS = {\n\tcredentials: 'include',\n};\n\n/** @typedef {import('./types').APIFetchMiddleware} APIFetchMiddleware */\n/** @typedef {import('./types').APIFetchOptions} APIFetchOptions */\n\n/**\n * @type {import('./types').APIFetchMiddleware[]}\n */\nconst middlewares = [\n\tuserLocaleMiddleware,\n\tnamespaceEndpointMiddleware,\n\thttpV1Middleware,\n\tfetchAllMiddleware,\n];\n\n/**\n * Register a middleware\n *\n * @param {import('./types').APIFetchMiddleware} middleware\n */\nfunction registerMiddleware( middleware ) {\n\tmiddlewares.unshift( middleware );\n}\n\n/**\n * Checks the status of a response, throwing the Response as an error if\n * it is outside the 200 range.\n *\n * @param {Response} response\n * @return {Response} The response if the status is in the 200 range.\n */\nconst checkStatus = ( response ) => {\n\tif ( response.status >= 200 && response.status < 300 ) {\n\t\treturn response;\n\t}\n\n\tthrow response;\n};\n\n/** @typedef {(options: import('./types').APIFetchOptions) => Promise<any>} FetchHandler*/\n\n/**\n * @type {FetchHandler}\n */\nconst defaultFetchHandler = ( nextOptions ) => {\n\tconst { url, path, data, parse = true, ...remainingOptions } = nextOptions;\n\tlet { body, headers } = nextOptions;\n\n\t// Merge explicitly-provided headers with default values.\n\theaders = { ...DEFAULT_HEADERS, ...headers };\n\n\t// The `data` property is a shorthand for sending a JSON body.\n\tif ( data ) {\n\t\tbody = JSON.stringify( data );\n\t\theaders[ 'Content-Type' ] = 'application/json';\n\t}\n\n\tconst responsePromise = window.fetch(\n\t\t// Fall back to explicitly passing `window.location` which is the behavior if `undefined` is passed.\n\t\turl || path || window.location.href,\n\t\t{\n\t\t\t...DEFAULT_OPTIONS,\n\t\t\t...remainingOptions,\n\t\t\tbody,\n\t\t\theaders,\n\t\t}\n\t);\n\n\treturn responsePromise.then(\n\t\t( value ) =>\n\t\t\tPromise.resolve( value )\n\t\t\t\t.then( checkStatus )\n\t\t\t\t.catch( ( response ) => parseAndThrowError( response, parse ) )\n\t\t\t\t.then( ( response ) =>\n\t\t\t\t\tparseResponseAndNormalizeError( response, parse )\n\t\t\t\t),\n\t\t( err ) => {\n\t\t\t// Re-throw AbortError for the users to handle it themselves.\n\t\t\tif ( err && err.name === 'AbortError' ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\n\t\t\t// Otherwise, there is most likely no network connection.\n\t\t\t// Unfortunately the message might depend on the browser.\n\t\t\tthrow {\n\t\t\t\tcode: 'fetch_error',\n\t\t\t\tmessage: __( 'You are probably offline.' ),\n\t\t\t};\n\t\t}\n\t);\n};\n\n/** @type {FetchHandler} */\nlet fetchHandler = defaultFetchHandler;\n\n/**\n * Defines a custom fetch handler for making the requests that will override\n * the default one using window.fetch\n *\n * @param {FetchHandler} newFetchHandler The new fetch handler\n */\nfunction setFetchHandler( newFetchHandler ) {\n\tfetchHandler = newFetchHandler;\n}\n\n/**\n * @template T\n * @param {import('./types').APIFetchOptions} options\n * @return {Promise<T>} A promise representing the request processed via the registered middlewares.\n */\nfunction apiFetch( options ) {\n\t// creates a nested function chain that calls all middlewares and finally the `fetchHandler`,\n\t// converting `middlewares = [ m1, m2, m3 ]` into:\n\t// ```\n\t// opts1 => m1( opts1, opts2 => m2( opts2, opts3 => m3( opts3, fetchHandler ) ) );\n\t// ```\n\tconst enhancedHandler = middlewares.reduceRight( (\n\t\t/** @type {FetchHandler} */ next,\n\t\tmiddleware\n\t) => {\n\t\treturn ( workingOptions ) => middleware( workingOptions, next );\n\t}, fetchHandler );\n\n\treturn enhancedHandler( options ).catch( ( error ) => {\n\t\tif ( error.code !== 'rest_cookie_invalid_nonce' ) {\n\t\t\treturn Promise.reject( error );\n\t\t}\n\n\t\t// If the nonce is invalid, refresh it and try again.\n\t\treturn (\n\t\t\twindow\n\t\t\t\t// @ts-ignore\n\t\t\t\t.fetch( apiFetch.nonceEndpoint )\n\t\t\t\t.then( checkStatus )\n\t\t\t\t.then( ( data ) => data.text() )\n\t\t\t\t.then( ( text ) => {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tapiFetch.nonceMiddleware.nonce = text;\n\t\t\t\t\treturn apiFetch( options );\n\t\t\t\t} )\n\t\t);\n\t} );\n}\n\napiFetch.use = registerMiddleware;\napiFetch.setFetchHandler = setFetchHandler;\n\napiFetch.createNonceMiddleware = createNonceMiddleware;\napiFetch.createPreloadingMiddleware = createPreloadingMiddleware;\napiFetch.createRootURLMiddleware = createRootURLMiddleware;\napiFetch.fetchAllMiddleware = fetchAllMiddleware;\napiFetch.mediaUploadMiddleware = mediaUploadMiddleware;\n\nexport default apiFetch;\n"]}
1
+ {"version":3,"sources":["@wordpress/api-fetch/src/index.js"],"names":["__","createNonceMiddleware","createRootURLMiddleware","createPreloadingMiddleware","fetchAllMiddleware","namespaceEndpointMiddleware","httpV1Middleware","userLocaleMiddleware","mediaUploadMiddleware","parseResponseAndNormalizeError","parseAndThrowError","DEFAULT_HEADERS","Accept","DEFAULT_OPTIONS","credentials","middlewares","registerMiddleware","middleware","unshift","checkStatus","response","status","defaultFetchHandler","nextOptions","url","path","data","parse","remainingOptions","body","headers","JSON","stringify","responsePromise","window","fetch","location","href","then","value","Promise","resolve","catch","err","name","code","message","fetchHandler","setFetchHandler","newFetchHandler","apiFetch","options","enhancedHandler","reduceRight","next","workingOptions","error","reject","nonceEndpoint","text","nonceMiddleware","nonce","use"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,OAAOC,qBAAP,MAAkC,qBAAlC;AACA,OAAOC,uBAAP,MAAoC,wBAApC;AACA,OAAOC,0BAAP,MAAuC,0BAAvC;AACA,OAAOC,kBAAP,MAA+B,oCAA/B;AACA,OAAOC,2BAAP,MAAwC,kCAAxC;AACA,OAAOC,gBAAP,MAA6B,uBAA7B;AACA,OAAOC,oBAAP,MAAiC,2BAAjC;AACA,OAAOC,qBAAP,MAAkC,4BAAlC;AACA,SACCC,8BADD,EA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OK,eAAe,CAAED,OAAF,CAAf,CAA2BT,KAA3B,CAAoCc,KAAF,IAAa;AACrD,QAAKA,KAAK,CAACX,IAAN,KAAe,2BAApB,EAAkD;AACjD,aAAOL,OAAO,CAACiB,MAAR,CAAgBD,KAAhB,CAAP;AACA,KAHoD,CAKrD;;;AACA,WACCtB,MAAM,CACL;AADK,KAEJC,KAFF,CAESe,QAAQ,CAACQ,aAFlB,EAGEpB,IAHF,CAGQnB,WAHR,EAIEmB,IAJF,CAIUZ,IAAF,IAAYA,IAAI,CAACiC,IAAL,EAJpB,EAKErB,IALF,CAKUqB,IAAF,IAAY;AAClB;AACAT,MAAAA,QAAQ,CAACU,eAAT,CAAyBC,KAAzB,GAAiCF,IAAjC;AACA,aAAOT,QAAQ,CAAEC,OAAF,CAAf;AACA,KATF,CADD;AAYA,GAlBM,CAAP;AAmBA;;AAEDD,QAAQ,CAACY,GAAT,GAAe9C,kBAAf;AACAkC,QAAQ,CAACF,eAAT,GAA2BA,eAA3B;AAEAE,QAAQ,CAACjD,qBAAT,GAAiCA,qBAAjC;AACAiD,QAAQ,CAAC/C,0BAAT,GAAsCA,0BAAtC;AACA+C,QAAQ,CAAChD,uBAAT,GAAmCA,uBAAnC;AACAgD,QAAQ,CAAC9C,kBAAT,GAA8BA,kBAA9B;AACA8C,QAAQ,CAAC1C,qBAAT,GAAiCA,qBAAjC;AAEA,eAAe0C,QAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport createNonceMiddleware from './middlewares/nonce';\nimport createRootURLMiddleware from './middlewares/root-url';\nimport createPreloadingMiddleware from './middlewares/preloading';\nimport fetchAllMiddleware from './middlewares/fetch-all-middleware';\nimport namespaceEndpointMiddleware from './middlewares/namespace-endpoint';\nimport httpV1Middleware from './middlewares/http-v1';\nimport userLocaleMiddleware from './middlewares/user-locale';\nimport mediaUploadMiddleware from './middlewares/media-upload';\nimport {\n\tparseResponseAndNormalizeError,\n\tparseAndThrowError,\n} from './utils/response';\n\n/**\n * Default set of header values which should be sent with every request unless\n * explicitly provided through apiFetch options.\n *\n * @type {Record<string, string>}\n */\nconst DEFAULT_HEADERS = {\n\t// The backend uses the Accept header as a condition for considering an\n\t// incoming request as a REST request.\n\t//\n\t// See: https://core.trac.wordpress.org/ticket/44534\n\tAccept: 'application/json, */*;q=0.1',\n};\n\n/**\n * Default set of fetch option values which should be sent with every request\n * unless explicitly provided through apiFetch options.\n *\n * @type {Object}\n */\nconst DEFAULT_OPTIONS = {\n\tcredentials: 'include',\n};\n\n/** @typedef {import('./types').APIFetchMiddleware} APIFetchMiddleware */\n/** @typedef {import('./types').APIFetchOptions} APIFetchOptions */\n\n/**\n * @type {import('./types').APIFetchMiddleware[]}\n */\nconst middlewares = [\n\tuserLocaleMiddleware,\n\tnamespaceEndpointMiddleware,\n\thttpV1Middleware,\n\tfetchAllMiddleware,\n];\n\n/**\n * Register a middleware\n *\n * @param {import('./types').APIFetchMiddleware} middleware\n */\nfunction registerMiddleware( middleware ) {\n\tmiddlewares.unshift( middleware );\n}\n\n/**\n * Checks the status of a response, throwing the Response as an error if\n * it is outside the 200 range.\n *\n * @param {Response} response\n * @return {Response} The response if the status is in the 200 range.\n */\nconst checkStatus = ( response ) => {\n\tif ( response.status >= 200 && response.status < 300 ) {\n\t\treturn response;\n\t}\n\n\tthrow response;\n};\n\n/** @typedef {(options: import('./types').APIFetchOptions) => Promise<any>} FetchHandler*/\n\n/**\n * @type {FetchHandler}\n */\nconst defaultFetchHandler = ( nextOptions ) => {\n\tconst { url, path, data, parse = true, ...remainingOptions } = nextOptions;\n\tlet { body, headers } = nextOptions;\n\n\t// Merge explicitly-provided headers with default values.\n\theaders = { ...DEFAULT_HEADERS, ...headers };\n\n\t// The `data` property is a shorthand for sending a JSON body.\n\tif ( data ) {\n\t\tbody = JSON.stringify( data );\n\t\theaders[ 'Content-Type' ] = 'application/json';\n\t}\n\n\tconst responsePromise = window.fetch(\n\t\t// Fall back to explicitly passing `window.location` which is the behavior if `undefined` is passed.\n\t\turl || path || window.location.href,\n\t\t{\n\t\t\t...DEFAULT_OPTIONS,\n\t\t\t...remainingOptions,\n\t\t\tbody,\n\t\t\theaders,\n\t\t}\n\t);\n\n\treturn responsePromise.then(\n\t\t( value ) =>\n\t\t\tPromise.resolve( value )\n\t\t\t\t.then( checkStatus )\n\t\t\t\t.catch( ( response ) => parseAndThrowError( response, parse ) )\n\t\t\t\t.then( ( response ) =>\n\t\t\t\t\tparseResponseAndNormalizeError( response, parse )\n\t\t\t\t),\n\t\t( err ) => {\n\t\t\t// Re-throw AbortError for the users to handle it themselves.\n\t\t\tif ( err && err.name === 'AbortError' ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\n\t\t\t// Otherwise, there is most likely no network connection.\n\t\t\t// Unfortunately the message might depend on the browser.\n\t\t\tthrow {\n\t\t\t\tcode: 'fetch_error',\n\t\t\t\tmessage: __( 'You are probably offline.' ),\n\t\t\t};\n\t\t}\n\t);\n};\n\n/** @type {FetchHandler} */\nlet fetchHandler = defaultFetchHandler;\n\n/**\n * Defines a custom fetch handler for making the requests that will override\n * the default one using window.fetch\n *\n * @param {FetchHandler} newFetchHandler The new fetch handler\n */\nfunction setFetchHandler( newFetchHandler ) {\n\tfetchHandler = newFetchHandler;\n}\n\n/**\n * @template T\n * @param {import('./types').APIFetchOptions} options\n * @return {Promise<T>} A promise representing the request processed via the registered middlewares.\n */\nfunction apiFetch( options ) {\n\t// creates a nested function chain that calls all middlewares and finally the `fetchHandler`,\n\t// converting `middlewares = [ m1, m2, m3 ]` into:\n\t// ```\n\t// opts1 => m1( opts1, opts2 => m2( opts2, opts3 => m3( opts3, fetchHandler ) ) );\n\t// ```\n\tconst enhancedHandler = middlewares.reduceRight(\n\t\t( /** @type {FetchHandler} */ next, middleware ) => {\n\t\t\treturn ( workingOptions ) => middleware( workingOptions, next );\n\t\t},\n\t\tfetchHandler\n\t);\n\n\treturn enhancedHandler( options ).catch( ( error ) => {\n\t\tif ( error.code !== 'rest_cookie_invalid_nonce' ) {\n\t\t\treturn Promise.reject( error );\n\t\t}\n\n\t\t// If the nonce is invalid, refresh it and try again.\n\t\treturn (\n\t\t\twindow\n\t\t\t\t// @ts-ignore\n\t\t\t\t.fetch( apiFetch.nonceEndpoint )\n\t\t\t\t.then( checkStatus )\n\t\t\t\t.then( ( data ) => data.text() )\n\t\t\t\t.then( ( text ) => {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tapiFetch.nonceMiddleware.nonce = text;\n\t\t\t\t\treturn apiFetch( options );\n\t\t\t\t} )\n\t\t);\n\t} );\n}\n\napiFetch.use = registerMiddleware;\napiFetch.setFetchHandler = setFetchHandler;\n\napiFetch.createNonceMiddleware = createNonceMiddleware;\napiFetch.createPreloadingMiddleware = createPreloadingMiddleware;\napiFetch.createRootURLMiddleware = createRootURLMiddleware;\napiFetch.fetchAllMiddleware = fetchAllMiddleware;\napiFetch.mediaUploadMiddleware = mediaUploadMiddleware;\n\nexport default apiFetch;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/api-fetch",
3
- "version": "6.7.0",
3
+ "version": "6.10.0",
4
4
  "description": "Utility to make WordPress REST API requests.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -28,11 +28,11 @@
28
28
  "types": "build-types",
29
29
  "dependencies": {
30
30
  "@babel/runtime": "^7.16.0",
31
- "@wordpress/i18n": "^4.10.0",
32
- "@wordpress/url": "^3.11.0"
31
+ "@wordpress/i18n": "^4.13.0",
32
+ "@wordpress/url": "^3.14.0"
33
33
  },
34
34
  "publishConfig": {
35
35
  "access": "public"
36
36
  },
37
- "gitHead": "a3e0b62091e8a8bdf5e2518e42d60d7098af48cc"
37
+ "gitHead": "9d9d33bbdf317a4381b8ca1713e43bb50df653b3"
38
38
  }
package/src/index.js CHANGED
@@ -157,12 +157,12 @@ function apiFetch( options ) {
157
157
  // ```
158
158
  // opts1 => m1( opts1, opts2 => m2( opts2, opts3 => m3( opts3, fetchHandler ) ) );
159
159
  // ```
160
- const enhancedHandler = middlewares.reduceRight( (
161
- /** @type {FetchHandler} */ next,
162
- middleware
163
- ) => {
164
- return ( workingOptions ) => middleware( workingOptions, next );
165
- }, fetchHandler );
160
+ const enhancedHandler = middlewares.reduceRight(
161
+ ( /** @type {FetchHandler} */ next, middleware ) => {
162
+ return ( workingOptions ) => middleware( workingOptions, next );
163
+ },
164
+ fetchHandler
165
+ );
166
166
 
167
167
  return enhancedHandler( options ).catch( ( error ) => {
168
168
  if ( error.code !== 'rest_cookie_invalid_nonce' ) {
@@ -16,9 +16,8 @@ describe( 'Preloading Middleware', () => {
16
16
  body,
17
17
  },
18
18
  };
19
- const preloadingMiddleware = createPreloadingMiddleware(
20
- preloadedData
21
- );
19
+ const preloadingMiddleware =
20
+ createPreloadingMiddleware( preloadedData );
22
21
  const requestOptions = {
23
22
  method: 'GET',
24
23
  path: 'wp/v2/posts',
@@ -41,9 +40,8 @@ describe( 'Preloading Middleware', () => {
41
40
  body,
42
41
  },
43
42
  };
44
- const preloadingMiddleware = createPreloadingMiddleware(
45
- preloadedData
46
- );
43
+ const preloadingMiddleware =
44
+ createPreloadingMiddleware( preloadedData );
47
45
  const requestOptions = {
48
46
  method: 'GET',
49
47
  path: 'wp/v2/posts',
@@ -85,9 +83,8 @@ describe( 'Preloading Middleware', () => {
85
83
  },
86
84
  };
87
85
 
88
- const preloadingMiddleware = createPreloadingMiddleware(
89
- preloadedData
90
- );
86
+ const preloadingMiddleware =
87
+ createPreloadingMiddleware( preloadedData );
91
88
 
92
89
  const requestOptions = {
93
90
  method: 'OPTIONS',
@@ -120,9 +117,8 @@ describe( 'Preloading Middleware', () => {
120
117
  },
121
118
  };
122
119
 
123
- const preloadingMiddleware = createPreloadingMiddleware(
124
- preloadedData
125
- );
120
+ const preloadingMiddleware =
121
+ createPreloadingMiddleware( preloadedData );
126
122
 
127
123
  const requestOptions = {
128
124
  method: 'OPTIONS',
@@ -148,9 +144,8 @@ describe( 'Preloading Middleware', () => {
148
144
  body,
149
145
  },
150
146
  };
151
- const preloadingMiddleware = createPreloadingMiddleware(
152
- preloadedData
153
- );
147
+ const preloadingMiddleware =
148
+ createPreloadingMiddleware( preloadedData );
154
149
  const requestOptions = {
155
150
  method: 'GET',
156
151
  path: 'wp/v2/fake_resource',
@@ -169,9 +164,8 @@ describe( 'Preloading Middleware', () => {
169
164
  'wp/v2/demo-reverse-alphabetical?foo=bar&baz=quux': { body },
170
165
  'wp/v2/demo-alphabetical?baz=quux&foo=bar': { body },
171
166
  };
172
- const preloadingMiddleware = createPreloadingMiddleware(
173
- preloadedData
174
- );
167
+ const preloadingMiddleware =
168
+ createPreloadingMiddleware( preloadedData );
175
169
 
176
170
  let requestOptions = {
177
171
  method: 'GET',
@@ -252,9 +246,8 @@ describe( 'Preloading Middleware', () => {
252
246
  },
253
247
  };
254
248
 
255
- const preloadingMiddleware = createPreloadingMiddleware(
256
- preloadedData
257
- );
249
+ const preloadingMiddleware =
250
+ createPreloadingMiddleware( preloadedData );
258
251
 
259
252
  const requestOptions = {
260
253
  method: 'OPTIONS',
@@ -278,9 +271,8 @@ describe( 'Preloading Middleware', () => {
278
271
  [ 'method empty', { [ method ]: {} } ],
279
272
  ] )( '%s', ( label, preloadedData ) => {
280
273
  it( 'should move to the next middleware if no preloaded data', () => {
281
- const preloadingMiddleware = createPreloadingMiddleware(
282
- preloadedData
283
- );
274
+ const preloadingMiddleware =
275
+ createPreloadingMiddleware( preloadedData );
284
276
  const requestOptions = {
285
277
  method,
286
278
  path: 'wp/v2/posts',
@@ -1 +1 @@
1
- {"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../i18n/build-types/sprintf.d.ts","../hooks/build-types/createAddHook.d.ts","../hooks/build-types/createRemoveHook.d.ts","../hooks/build-types/createHasHook.d.ts","../hooks/build-types/createDoingHook.d.ts","../hooks/build-types/createDidHook.d.ts","../hooks/build-types/index.d.ts","../hooks/build-types/createHooks.d.ts","../i18n/build-types/create-i18n.d.ts","../i18n/build-types/default-i18n.d.ts","../i18n/build-types/index.d.ts","./src/types.ts","./src/middlewares/nonce.js","./src/middlewares/namespace-endpoint.js","./src/middlewares/root-url.js","../url/build-types/is-url.d.ts","../url/build-types/is-email.d.ts","../url/build-types/get-protocol.d.ts","../url/build-types/is-valid-protocol.d.ts","../url/build-types/get-authority.d.ts","../url/build-types/is-valid-authority.d.ts","../url/build-types/get-path.d.ts","../url/build-types/is-valid-path.d.ts","../url/build-types/get-query-string.d.ts","../url/build-types/build-query-string.d.ts","../url/build-types/is-valid-query-string.d.ts","../url/build-types/get-path-and-query-string.d.ts","../url/build-types/get-fragment.d.ts","../url/build-types/is-valid-fragment.d.ts","../url/build-types/add-query-args.d.ts","../url/build-types/get-query-arg.d.ts","../url/build-types/get-query-args.d.ts","../url/build-types/has-query-arg.d.ts","../url/build-types/remove-query-args.d.ts","../url/build-types/prepend-http.d.ts","../url/build-types/safe-decode-uri.d.ts","../url/build-types/safe-decode-uri-component.d.ts","../url/build-types/filter-url-for-display.d.ts","../url/build-types/clean-for-slug.d.ts","../url/build-types/get-filename.d.ts","../url/build-types/normalize-path.d.ts","../url/build-types/index.d.ts","./src/middlewares/preloading.js","./src/middlewares/fetch-all-middleware.js","./src/middlewares/http-v1.js","./src/middlewares/user-locale.js","./src/utils/response.js","./src/middlewares/media-upload.js","./src/index.js"],"fileInfos":[{"version":"aa9fb4c70f369237c2f45f9d969c9a59e0eae9a192962eb48581fe864aa609db","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","e21c071ca3e1b4a815d5f04a7475adcaeea5d64367e840dd0154096d705c3940","eb75e89d63b3b72dd9ca8b0cac801cecae5be352307c004adeaa60bc9d6df51f","2cc028cd0bdb35b1b5eb723d84666a255933fffbea607f72cbd0c7c7b4bee144",{"version":"e54c8715a4954cfdc66cd69489f2b725c09ebf37492dbd91cff0a1688b1159e8","affectsGlobalScope":true},{"version":"51b8b27c21c066bf877646e320bf6a722b80d1ade65e686923cd9d4494aef1ca","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"2c8c5ee58f30e7c944e04ab1fb5506fdbb4dd507c9efa6972cf4b91cec90c503","affectsGlobalScope":true},{"version":"2bb4b3927299434052b37851a47bf5c39764f2ba88a888a107b32262e9292b7c","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"df9c8a72ca8b0ed62f5470b41208a0587f0f73f0a7db28e5a1272cf92537518e","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"93544ca2f26a48716c1b6c5091842cad63129daac422dfa4bc52460465f22bb1","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"1b3fe904465430e030c93239a348f05e1be80640d91f2f004c3512c2c2c89f34","affectsGlobalScope":true},{"version":"7435b75fdf3509622e79622dbe5091cf4b09688410ee2034e4fc17d0c99d0862","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"9f1817f7c3f02f6d56e0f403b927e90bb133f371dcebc36fa7d6d208ef6899da","affectsGlobalScope":true},{"version":"cd6efb9467a8b6338ece2e2855e37765700f2cd061ca54b01b33878cf5c7677e","affectsGlobalScope":true},{"version":"fb4416144c1bf0323ccbc9afb0ab289c07312214e8820ad17d709498c865a3fe","affectsGlobalScope":true},{"version":"5b0ca94ec819d68d33da516306c15297acec88efeb0ae9e2b39f71dbd9685ef7","affectsGlobalScope":true},{"version":"4632665b87204bb1caa8b44d165bce0c50dfab177df5b561b345a567cabacf9a","affectsGlobalScope":true},"762bc52248d3fab9873c7af564caf622358312cb35de42a4393b71cc36e14621","d02ec79cefaf292fae64b3be5a4416e64b4e420a6429fd458fac6e1bb4c7950e","27abed653f600ea0d5c86e94181beb42824e0f3f16337e2f9e7e9e9c2c392edf","d7871e0e653aa7197fee88886db5678bee6d42164c1f36e4bce9421ddfa7ca49","11ed10bdb3bcc99893570507eac8fece4840add97ee1d4f5a7fbf41cbfdea0d4","429fb571d3db07d3eaa2e74d43eb4190ece3e0de832ed564aeeaf08873e598eb","406d52bf33d618d846aa0d831ee004290567e328edcd4517bbff2937cc977abf","d3060e0810fc0d0dc009e6f086ef413d3c8aeaaf07da25c8d25fd4e181646acf","c0306658efb85764bb6d8d55097007c68a70539b24d0e18fb6edd6eb1778f632","08f7e6ffa66c66a636aecc5acbeb998215d9d09ccba0c558afb7df7e218edeaf","f829eb39aea4487f0ff94a42c56a1a73bc5202bbdeb03f7a638e4ab3e290d017","d8c4f047684abe4a04c0f6bfc2dfca7b191c4bc7856f2bf63c0b8c04d3c3c59c","cea174bd7165f6473e9251e89b77677cc6fb980a0329964499ff39d7049941a9","3601498a0b299615d2b1871518f4e512837afa1ec33c10e5787c31297dba0e6b","b85af6a2052b84fadbe8e760359bec9d2cb765c404bab048d4bd20477c02bd89","91265e9c2705df9edc7d912afe177cb9dbe4bd4fe254cc43466885544c065013","81e7db9916d6ce0323656530cb9aba444450454e5a8f3d0108f04931abb36258","7858aa21ac91fef2c9cdf96b3ae00e025efed2920ffca40a75df452d4f5a9576","eb80dedcd92c17d93f403e736e1c3e2aef39379841070221a353a7c13b57369f","029f3a1e2534e85a7cd00f3e79781003e0bcf5147d96db93594ace839803c6cf","2eea9984a7ea08e576d2970ba65a65ebba02699bccdbd0d3a08bb141e15972a1","308246446616acc5397747f35fa8788de7e6ba6cd5dc0ec2752bd75eafefcdb9","9677ef56e52539a73f1d9b89c692cf866d05017b05d9d2fe8cd35a30b42c2d47","6048b5c50d6486b1084b036a7f7d6c76c032d90cc2186f79b344a12ceb488511","26885abe66e07fd38da599d5fc9b4fa8b2df803c56e9bba99a2505e0b982c042","507dc7647a71c90e8cce85259c624b355c22e0dee1833aa4ba20c15a4f5bd21a","c30aaf3d189be8c29b2d3a7761e94b5b532fec6ba0caa74d07a4c1056469acf0","454217fe7beba4cb5497d4bc7fd3116437ce85e5217eb66f3b367fbcbfd45861","65e1ffb7b2343a1814c5cb85164f7d26bce1477b2cf04e6736f37732bc4801d6","3f810d7cac3e3729241d52d667538dc4ca27687f5d40d91f4cb5bce955df5f94","a2bedf5636ce572e507823229c9b7d4e87d97830497822d76e95a971fee78c92","17ab13eba7cde42ca7c95110c7eda405ba6aba7471437d912078d67dfada98eb","f7e734ca25cb0e8c52247b9a7d98f81ffd6ac52485bf9d8938fdbd4d828f469c","5261283f0b521fc1f255a060dcd86986985bd516822b69bb5504392462962899","44e20ca481bcc2abec1f4fcf54139caa4389f1bc16e3ee9d19a10e522903e9ab","a31eda6fcbf86596f69f7c18e6d13af58191fdc9c9620bcc67595fd9e49043ab","c93085fa9e5e568c0a45f64caa05e713fd5438e93d32f5970753e44910bdd540","1e442333978b5864818023d54d4f2e2aa0cbdfb2b486a0d43c900a7a87d61d1d","f215ce6766668f37f5e4652d0facdf55816f24aa5fc6f68c5e33754dbe5219fb","e900ec60297a15c4de70ddaade026ea4fe635e27c286fedd82dd5e963daa1930","e4e975c7339a9579209f12246e95f95216aa3558b8e7719fea2fbadaf28c574b","178efee8d4335cb61ec45c10e6de6d7afe48028963c5633f5937f25eaffa2387","48a326d1451f44489b52557d2e9fee89dd6ba054c83be6b4c6ddd17c3765f347","73df30672e4cf303ecaa5bd1c0a228aec9bd972305b227ac47e53600b88eeb09","86113173dcf3a28562ae7493a30168e671b54a413095025d40eb462ebc55a4b5","e2ca321ccf84538d48bc2b24db351997d607695d37b6d6d50440385c8bffa7bc","b24db76807128fad060ace7e8dda79b87a1cbc3879e67e15f8255e788a8ebfaa","8947b5182e734afd1d79ac20b1a0856f6ece9924fe1c6a5163d4a117384c7b35","c90a745ef86f674ac4b11752fa32303c9cee3f870768384fb88203ac07182e13"],"options":{"allowSyntheticDefaultImports":true,"composite":true,"declaration":true,"declarationDir":"./build-types","declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":false,"importsNotUsedAsValues":2,"jsx":1,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"rootDir":"./src","strict":true,"target":99},"fileIdsList":[[55,56,57,58,59,87,88,89,90,91,92],[56,86,93],[56],[55,56,91],[56,86],[56,58],[55],[51],[46,47,48,49,50,51],[46,47,48,49,50,52],[51,52],[53],[45,53,54],[75],[60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85]],"referencedMap":[[93,1],[88,2],[89,3],[92,4],[58,3],[57,3],[87,5],[59,6],[90,5],[91,7],[46,8],[50,8],[49,8],[48,8],[52,9],[47,8],[51,10],[53,11],[54,12],[55,13],[76,14],[86,15]],"exportedModulesMap":[[93,1],[88,2],[89,3],[92,4],[58,3],[57,3],[87,5],[59,6],[90,5],[91,7],[46,8],[50,8],[49,8],[48,8],[52,9],[47,8],[51,10],[53,11],[54,12],[55,13],[76,14],[86,15]],"semanticDiagnosticsPerFile":[10,12,11,2,13,14,15,16,17,18,19,20,3,4,24,21,22,23,25,26,27,5,28,29,30,31,6,32,33,34,35,7,40,36,37,38,39,8,41,42,43,1,9,44,93,88,89,92,58,57,87,59,90,56,91,46,50,49,48,52,47,51,53,54,55,45,74,69,83,82,64,84,72,71,66,62,75,76,68,77,86,61,60,65,73,67,63,70,85,79,78,81,80]},"version":"4.4.2"}
1
+ {"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../i18n/build-types/sprintf.d.ts","../hooks/build-types/createAddHook.d.ts","../hooks/build-types/createRemoveHook.d.ts","../hooks/build-types/createHasHook.d.ts","../hooks/build-types/createDoingHook.d.ts","../hooks/build-types/createDidHook.d.ts","../hooks/build-types/index.d.ts","../hooks/build-types/createHooks.d.ts","../i18n/build-types/create-i18n.d.ts","../i18n/build-types/default-i18n.d.ts","../i18n/build-types/index.d.ts","./src/types.ts","./src/middlewares/nonce.js","./src/middlewares/namespace-endpoint.js","./src/middlewares/root-url.js","../url/build-types/is-url.d.ts","../url/build-types/is-email.d.ts","../url/build-types/get-protocol.d.ts","../url/build-types/is-valid-protocol.d.ts","../url/build-types/get-authority.d.ts","../url/build-types/is-valid-authority.d.ts","../url/build-types/get-path.d.ts","../url/build-types/is-valid-path.d.ts","../url/build-types/get-query-string.d.ts","../url/build-types/build-query-string.d.ts","../url/build-types/is-valid-query-string.d.ts","../url/build-types/get-path-and-query-string.d.ts","../url/build-types/get-fragment.d.ts","../url/build-types/is-valid-fragment.d.ts","../url/build-types/add-query-args.d.ts","../url/build-types/get-query-arg.d.ts","../url/build-types/get-query-args.d.ts","../url/build-types/has-query-arg.d.ts","../url/build-types/remove-query-args.d.ts","../url/build-types/prepend-http.d.ts","../url/build-types/safe-decode-uri.d.ts","../url/build-types/safe-decode-uri-component.d.ts","../url/build-types/filter-url-for-display.d.ts","../url/build-types/clean-for-slug.d.ts","../url/build-types/get-filename.d.ts","../url/build-types/normalize-path.d.ts","../url/build-types/index.d.ts","./src/middlewares/preloading.js","./src/middlewares/fetch-all-middleware.js","./src/middlewares/http-v1.js","./src/middlewares/user-locale.js","./src/utils/response.js","./src/middlewares/media-upload.js","./src/index.js"],"fileInfos":[{"version":"aa9fb4c70f369237c2f45f9d969c9a59e0eae9a192962eb48581fe864aa609db","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","e21c071ca3e1b4a815d5f04a7475adcaeea5d64367e840dd0154096d705c3940","eb75e89d63b3b72dd9ca8b0cac801cecae5be352307c004adeaa60bc9d6df51f","2cc028cd0bdb35b1b5eb723d84666a255933fffbea607f72cbd0c7c7b4bee144",{"version":"e54c8715a4954cfdc66cd69489f2b725c09ebf37492dbd91cff0a1688b1159e8","affectsGlobalScope":true},{"version":"51b8b27c21c066bf877646e320bf6a722b80d1ade65e686923cd9d4494aef1ca","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"2c8c5ee58f30e7c944e04ab1fb5506fdbb4dd507c9efa6972cf4b91cec90c503","affectsGlobalScope":true},{"version":"2bb4b3927299434052b37851a47bf5c39764f2ba88a888a107b32262e9292b7c","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"df9c8a72ca8b0ed62f5470b41208a0587f0f73f0a7db28e5a1272cf92537518e","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"93544ca2f26a48716c1b6c5091842cad63129daac422dfa4bc52460465f22bb1","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"1b3fe904465430e030c93239a348f05e1be80640d91f2f004c3512c2c2c89f34","affectsGlobalScope":true},{"version":"7435b75fdf3509622e79622dbe5091cf4b09688410ee2034e4fc17d0c99d0862","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"9f1817f7c3f02f6d56e0f403b927e90bb133f371dcebc36fa7d6d208ef6899da","affectsGlobalScope":true},{"version":"cd6efb9467a8b6338ece2e2855e37765700f2cd061ca54b01b33878cf5c7677e","affectsGlobalScope":true},{"version":"fb4416144c1bf0323ccbc9afb0ab289c07312214e8820ad17d709498c865a3fe","affectsGlobalScope":true},{"version":"5b0ca94ec819d68d33da516306c15297acec88efeb0ae9e2b39f71dbd9685ef7","affectsGlobalScope":true},{"version":"4632665b87204bb1caa8b44d165bce0c50dfab177df5b561b345a567cabacf9a","affectsGlobalScope":true},"762bc52248d3fab9873c7af564caf622358312cb35de42a4393b71cc36e14621","d02ec79cefaf292fae64b3be5a4416e64b4e420a6429fd458fac6e1bb4c7950e","27abed653f600ea0d5c86e94181beb42824e0f3f16337e2f9e7e9e9c2c392edf","d7871e0e653aa7197fee88886db5678bee6d42164c1f36e4bce9421ddfa7ca49","11ed10bdb3bcc99893570507eac8fece4840add97ee1d4f5a7fbf41cbfdea0d4","429fb571d3db07d3eaa2e74d43eb4190ece3e0de832ed564aeeaf08873e598eb","406d52bf33d618d846aa0d831ee004290567e328edcd4517bbff2937cc977abf","d3060e0810fc0d0dc009e6f086ef413d3c8aeaaf07da25c8d25fd4e181646acf","c0306658efb85764bb6d8d55097007c68a70539b24d0e18fb6edd6eb1778f632","08f7e6ffa66c66a636aecc5acbeb998215d9d09ccba0c558afb7df7e218edeaf","f829eb39aea4487f0ff94a42c56a1a73bc5202bbdeb03f7a638e4ab3e290d017","d8c4f047684abe4a04c0f6bfc2dfca7b191c4bc7856f2bf63c0b8c04d3c3c59c","cea174bd7165f6473e9251e89b77677cc6fb980a0329964499ff39d7049941a9","3601498a0b299615d2b1871518f4e512837afa1ec33c10e5787c31297dba0e6b","b85af6a2052b84fadbe8e760359bec9d2cb765c404bab048d4bd20477c02bd89","91265e9c2705df9edc7d912afe177cb9dbe4bd4fe254cc43466885544c065013","81e7db9916d6ce0323656530cb9aba444450454e5a8f3d0108f04931abb36258","7858aa21ac91fef2c9cdf96b3ae00e025efed2920ffca40a75df452d4f5a9576","eb80dedcd92c17d93f403e736e1c3e2aef39379841070221a353a7c13b57369f","029f3a1e2534e85a7cd00f3e79781003e0bcf5147d96db93594ace839803c6cf","2eea9984a7ea08e576d2970ba65a65ebba02699bccdbd0d3a08bb141e15972a1","308246446616acc5397747f35fa8788de7e6ba6cd5dc0ec2752bd75eafefcdb9","9677ef56e52539a73f1d9b89c692cf866d05017b05d9d2fe8cd35a30b42c2d47","6048b5c50d6486b1084b036a7f7d6c76c032d90cc2186f79b344a12ceb488511","26885abe66e07fd38da599d5fc9b4fa8b2df803c56e9bba99a2505e0b982c042","507dc7647a71c90e8cce85259c624b355c22e0dee1833aa4ba20c15a4f5bd21a","c30aaf3d189be8c29b2d3a7761e94b5b532fec6ba0caa74d07a4c1056469acf0","454217fe7beba4cb5497d4bc7fd3116437ce85e5217eb66f3b367fbcbfd45861","65e1ffb7b2343a1814c5cb85164f7d26bce1477b2cf04e6736f37732bc4801d6","3f810d7cac3e3729241d52d667538dc4ca27687f5d40d91f4cb5bce955df5f94","a2bedf5636ce572e507823229c9b7d4e87d97830497822d76e95a971fee78c92","17ab13eba7cde42ca7c95110c7eda405ba6aba7471437d912078d67dfada98eb","f7e734ca25cb0e8c52247b9a7d98f81ffd6ac52485bf9d8938fdbd4d828f469c","5261283f0b521fc1f255a060dcd86986985bd516822b69bb5504392462962899","44e20ca481bcc2abec1f4fcf54139caa4389f1bc16e3ee9d19a10e522903e9ab","a31eda6fcbf86596f69f7c18e6d13af58191fdc9c9620bcc67595fd9e49043ab","c93085fa9e5e568c0a45f64caa05e713fd5438e93d32f5970753e44910bdd540","1e442333978b5864818023d54d4f2e2aa0cbdfb2b486a0d43c900a7a87d61d1d","f215ce6766668f37f5e4652d0facdf55816f24aa5fc6f68c5e33754dbe5219fb","e900ec60297a15c4de70ddaade026ea4fe635e27c286fedd82dd5e963daa1930","e4e975c7339a9579209f12246e95f95216aa3558b8e7719fea2fbadaf28c574b","178efee8d4335cb61ec45c10e6de6d7afe48028963c5633f5937f25eaffa2387","48a326d1451f44489b52557d2e9fee89dd6ba054c83be6b4c6ddd17c3765f347","73df30672e4cf303ecaa5bd1c0a228aec9bd972305b227ac47e53600b88eeb09","86113173dcf3a28562ae7493a30168e671b54a413095025d40eb462ebc55a4b5","e2ca321ccf84538d48bc2b24db351997d607695d37b6d6d50440385c8bffa7bc","b24db76807128fad060ace7e8dda79b87a1cbc3879e67e15f8255e788a8ebfaa","8947b5182e734afd1d79ac20b1a0856f6ece9924fe1c6a5163d4a117384c7b35","634d94f969451da95688acdfc9d8588f8690a7dd3939d8ca6404e2f9bd298fd3"],"options":{"allowSyntheticDefaultImports":true,"composite":true,"declaration":true,"declarationDir":"./build-types","declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":false,"importsNotUsedAsValues":2,"jsx":1,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"rootDir":"./src","strict":true,"target":99},"fileIdsList":[[55,56,57,58,59,87,88,89,90,91,92],[56,86,93],[56],[55,56,91],[56,86],[56,58],[55],[51],[46,47,48,49,50,51],[46,47,48,49,50,52],[51,52],[53],[45,53,54],[75],[60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85]],"referencedMap":[[93,1],[88,2],[89,3],[92,4],[58,3],[57,3],[87,5],[59,6],[90,5],[91,7],[46,8],[50,8],[49,8],[48,8],[52,9],[47,8],[51,10],[53,11],[54,12],[55,13],[76,14],[86,15]],"exportedModulesMap":[[93,1],[88,2],[89,3],[92,4],[58,3],[57,3],[87,5],[59,6],[90,5],[91,7],[46,8],[50,8],[49,8],[48,8],[52,9],[47,8],[51,10],[53,11],[54,12],[55,13],[76,14],[86,15]],"semanticDiagnosticsPerFile":[10,12,11,2,13,14,15,16,17,18,19,20,3,4,24,21,22,23,25,26,27,5,28,29,30,31,6,32,33,34,35,7,40,36,37,38,39,8,41,42,43,1,9,44,93,88,89,92,58,57,87,59,90,56,91,46,50,49,48,52,47,51,53,54,55,45,74,69,83,82,64,84,72,71,66,62,75,76,68,77,86,61,60,65,73,67,63,70,85,79,78,81,80]},"version":"4.4.2"}