@wordpress/api-fetch 6.31.0 → 6.33.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,10 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 6.33.0 (2023-06-23)
6
+
7
+ ## 6.32.0 (2023-06-07)
8
+
5
9
  ## 6.31.0 (2023-05-24)
6
10
 
7
11
  ## 6.30.0 (2023-05-10)
@@ -26,17 +26,14 @@ var _ = _interopRequireDefault(require(".."));
26
26
  * @param {Record<string, string | number>} queryArgs
27
27
  * @return {import('../types').APIFetchOptions} The request with the modified query args
28
28
  */
29
- const modifyQuery = (_ref, queryArgs) => {
30
- let {
31
- path,
32
- url,
33
- ...options
34
- } = _ref;
35
- return { ...options,
36
- url: url && (0, _url.addQueryArgs)(url, queryArgs),
37
- path: path && (0, _url.addQueryArgs)(path, queryArgs)
38
- };
39
- };
29
+ const modifyQuery = ({
30
+ path,
31
+ url,
32
+ ...options
33
+ }, queryArgs) => ({ ...options,
34
+ url: url && (0, _url.addQueryArgs)(url, queryArgs),
35
+ path: path && (0, _url.addQueryArgs)(path, queryArgs)
36
+ });
40
37
  /**
41
38
  * Duplicates parsing functionality from apiFetch.
42
39
  *
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/api-fetch/src/middlewares/fetch-all-middleware.js"],"names":["modifyQuery","queryArgs","path","url","options","parseResponse","response","json","Promise","reject","parseLinkHeader","linkHeader","match","next","getNextPageUrl","headers","get","requestContainsUnboundedQuery","pathIsUnbounded","indexOf","urlIsUnbounded","fetchAllMiddleware","parse","per_page","results","Array","isArray","nextPage","mergedResults","concat","nextResponse","undefined","nextResults"],"mappings":";;;;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,WAAW,GAAG,OAA6BC,SAA7B;AAAA,MAAE;AAAEC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a,CAACC,MAAd,CAAsBG,WAAtB,CAAhB;AACAL,IAAAA,QAAQ,GAAGb,cAAc,CAAEgB,YAAF,CAAzB;AACA;;AACD,SAAOF,aAAP;AACA,CAjDD;;eAmDeP,kB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport apiFetch from '..';\n\n/**\n * Apply query arguments to both URL and Path, whichever is present.\n *\n * @param {import('../types').APIFetchOptions} props\n * @param {Record<string, string | number>} queryArgs\n * @return {import('../types').APIFetchOptions} The request with the modified query args\n */\nconst modifyQuery = ( { path, url, ...options }, queryArgs ) => ( {\n\t...options,\n\turl: url && addQueryArgs( url, queryArgs ),\n\tpath: path && addQueryArgs( path, queryArgs ),\n} );\n\n/**\n * Duplicates parsing functionality from apiFetch.\n *\n * @param {Response} response\n * @return {Promise<any>} Parsed response json.\n */\nconst parseResponse = ( response ) =>\n\tresponse.json ? response.json() : Promise.reject( response );\n\n/**\n * @param {string | null} linkHeader\n * @return {{ next?: string }} The parsed link header.\n */\nconst parseLinkHeader = ( linkHeader ) => {\n\tif ( ! linkHeader ) {\n\t\treturn {};\n\t}\n\tconst match = linkHeader.match( /<([^>]+)>; rel=\"next\"/ );\n\treturn match\n\t\t? {\n\t\t\t\tnext: match[ 1 ],\n\t\t }\n\t\t: {};\n};\n\n/**\n * @param {Response} response\n * @return {string | undefined} The next page URL.\n */\nconst getNextPageUrl = ( response ) => {\n\tconst { next } = parseLinkHeader( response.headers.get( 'link' ) );\n\treturn next;\n};\n\n/**\n * @param {import('../types').APIFetchOptions} options\n * @return {boolean} True if the request contains an unbounded query.\n */\nconst requestContainsUnboundedQuery = ( options ) => {\n\tconst pathIsUnbounded =\n\t\t!! options.path && options.path.indexOf( 'per_page=-1' ) !== -1;\n\tconst urlIsUnbounded =\n\t\t!! options.url && options.url.indexOf( 'per_page=-1' ) !== -1;\n\treturn pathIsUnbounded || urlIsUnbounded;\n};\n\n/**\n * The REST API enforces an upper limit on the per_page option. To handle large\n * collections, apiFetch consumers can pass `per_page=-1`; this middleware will\n * then recursively assemble a full response array from all available pages.\n *\n * @type {import('../types').APIFetchMiddleware}\n */\nconst fetchAllMiddleware = async ( options, next ) => {\n\tif ( options.parse === false ) {\n\t\t// If a consumer has opted out of parsing, do not apply middleware.\n\t\treturn next( options );\n\t}\n\tif ( ! requestContainsUnboundedQuery( options ) ) {\n\t\t// If neither url nor path is requesting all items, do not apply middleware.\n\t\treturn next( options );\n\t}\n\n\t// Retrieve requested page of results.\n\tconst response = await apiFetch( {\n\t\t...modifyQuery( options, {\n\t\t\tper_page: 100,\n\t\t} ),\n\t\t// Ensure headers are returned for page 1.\n\t\tparse: false,\n\t} );\n\n\tconst results = await parseResponse( response );\n\n\tif ( ! Array.isArray( results ) ) {\n\t\t// We have no reliable way of merging non-array results.\n\t\treturn results;\n\t}\n\n\tlet nextPage = getNextPageUrl( response );\n\n\tif ( ! nextPage ) {\n\t\t// There are no further pages to request.\n\t\treturn results;\n\t}\n\n\t// Iteratively fetch all remaining pages until no \"next\" header is found.\n\tlet mergedResults = /** @type {any[]} */ ( [] ).concat( results );\n\twhile ( nextPage ) {\n\t\tconst nextResponse = await apiFetch( {\n\t\t\t...options,\n\t\t\t// Ensure the URL for the next page is used instead of any provided path.\n\t\t\tpath: undefined,\n\t\t\turl: nextPage,\n\t\t\t// Ensure we still get headers so we can identify the next page.\n\t\t\tparse: false,\n\t\t} );\n\t\tconst nextResults = await parseResponse( nextResponse );\n\t\tmergedResults = mergedResults.concat( nextResults );\n\t\tnextPage = getNextPageUrl( nextResponse );\n\t}\n\treturn mergedResults;\n};\n\nexport default fetchAllMiddleware;\n"]}
1
+ {"version":3,"sources":["@wordpress/api-fetch/src/middlewares/fetch-all-middleware.js"],"names":["modifyQuery","path","url","options","queryArgs","parseResponse","response","json","Promise","reject","parseLinkHeader","linkHeader","match","next","getNextPageUrl","headers","get","requestContainsUnboundedQuery","pathIsUnbounded","indexOf","urlIsUnbounded","fetchAllMiddleware","parse","per_page","results","Array","isArray","nextPage","mergedResults","concat","nextResponse","undefined","nextResults"],"mappings":";;;;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,WAAW,GAAG,CAAE;AAAEC,EAAAA,IAAF;AAAQC,EAAAA,GAAR;AAAa,KAAGC;AAAhB,CAAF,EAA6BC,SAA7B,MAA8C,EACjE,GAAGD,OAD8D;AAEjED,EAAAA,GAAG,EAAEA,GAAG,IAAI,uBAAcA,GAAd,EAAmBE,SAAnB,CAFqD;AAGjEH,EAAAA,IAAI,EAAEA,IAAI,IAAI,uBAAcA,IAAd,EAAoBG,SAApB;AAHmD,CAA9C,CAApB;AAMA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMC,aAAa,GAAKC,QAAF,IACrBA,QAAQ,CAACC,IAAT,GAAgBD,QAAQ,CAACC,IAAT,EAAhB,GAAkCC,OAAO,CAACC,MAAR,CAAgBH,QAAhB,CADnC;AAGA;AACA;AACA;AACA;;;AACA,MAAMI,eAAe,GAAKC,UAAF,IAAkB;AACzC,MAAK,CAAEA,UAAP,EAAoB;AACnB,WAAO,EAAP;AACA;;AACD,QAAMC,KAAK,GAAGD,UAAU,CAACC,KAAX,CAAkB,uBAAlB,CAAd;AACA,SAAOA,KAAK,GACT;AACAC,IAAAA,IAAI,EAAED,KAAK,CAAE,CAAF;AADX,GADS,GAIT,EAJH;AAKA,CAVD;AAYA;AACA;AACA;AACA;;;AACA,MAAME,cAAc,GAAKR,QAAF,IAAgB;AACtC,QAAM;AAAEO,IAAAA;AAAF,MAAWH,eAAe,CAAEJ,QAAQ,CAACS,OAAT,CAAiBC,GAAjB,CAAsB,MAAtB,CAAF,CAAhC;AACA,SAAOH,IAAP;AACA,CAHD;AAKA;AACA;AACA;AACA;;;AACA,MAAMI,6BAA6B,GAAKd,OAAF,IAAe;AACpD,QAAMe,eAAe,GACpB,C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F,MAAAA,IAAI,EAAE8B,SAH8B;AAIpC7B,MAAAA,GAAG,EAAEyB,QAJ+B;AAKpC;AACAL,MAAAA,KAAK,EAAE;AAN6B,KAAV,CAA3B;AAQA,UAAMU,WAAW,GAAG,MAAM3B,aAAa,CAAEyB,YAAF,CAAvC;AACAF,IAAAA,aAAa,GAAGA,aAAa,CAACC,MAAd,CAAsBG,WAAtB,CAAhB;AACAL,IAAAA,QAAQ,GAAGb,cAAc,CAAEgB,YAAF,CAAzB;AACA;;AACD,SAAOF,aAAP;AACA,CAjDD;;eAmDeP,kB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport apiFetch from '..';\n\n/**\n * Apply query arguments to both URL and Path, whichever is present.\n *\n * @param {import('../types').APIFetchOptions} props\n * @param {Record<string, string | number>} queryArgs\n * @return {import('../types').APIFetchOptions} The request with the modified query args\n */\nconst modifyQuery = ( { path, url, ...options }, queryArgs ) => ( {\n\t...options,\n\turl: url && addQueryArgs( url, queryArgs ),\n\tpath: path && addQueryArgs( path, queryArgs ),\n} );\n\n/**\n * Duplicates parsing functionality from apiFetch.\n *\n * @param {Response} response\n * @return {Promise<any>} Parsed response json.\n */\nconst parseResponse = ( response ) =>\n\tresponse.json ? response.json() : Promise.reject( response );\n\n/**\n * @param {string | null} linkHeader\n * @return {{ next?: string }} The parsed link header.\n */\nconst parseLinkHeader = ( linkHeader ) => {\n\tif ( ! linkHeader ) {\n\t\treturn {};\n\t}\n\tconst match = linkHeader.match( /<([^>]+)>; rel=\"next\"/ );\n\treturn match\n\t\t? {\n\t\t\t\tnext: match[ 1 ],\n\t\t }\n\t\t: {};\n};\n\n/**\n * @param {Response} response\n * @return {string | undefined} The next page URL.\n */\nconst getNextPageUrl = ( response ) => {\n\tconst { next } = parseLinkHeader( response.headers.get( 'link' ) );\n\treturn next;\n};\n\n/**\n * @param {import('../types').APIFetchOptions} options\n * @return {boolean} True if the request contains an unbounded query.\n */\nconst requestContainsUnboundedQuery = ( options ) => {\n\tconst pathIsUnbounded =\n\t\t!! options.path && options.path.indexOf( 'per_page=-1' ) !== -1;\n\tconst urlIsUnbounded =\n\t\t!! options.url && options.url.indexOf( 'per_page=-1' ) !== -1;\n\treturn pathIsUnbounded || urlIsUnbounded;\n};\n\n/**\n * The REST API enforces an upper limit on the per_page option. To handle large\n * collections, apiFetch consumers can pass `per_page=-1`; this middleware will\n * then recursively assemble a full response array from all available pages.\n *\n * @type {import('../types').APIFetchMiddleware}\n */\nconst fetchAllMiddleware = async ( options, next ) => {\n\tif ( options.parse === false ) {\n\t\t// If a consumer has opted out of parsing, do not apply middleware.\n\t\treturn next( options );\n\t}\n\tif ( ! requestContainsUnboundedQuery( options ) ) {\n\t\t// If neither url nor path is requesting all items, do not apply middleware.\n\t\treturn next( options );\n\t}\n\n\t// Retrieve requested page of results.\n\tconst response = await apiFetch( {\n\t\t...modifyQuery( options, {\n\t\t\tper_page: 100,\n\t\t} ),\n\t\t// Ensure headers are returned for page 1.\n\t\tparse: false,\n\t} );\n\n\tconst results = await parseResponse( response );\n\n\tif ( ! Array.isArray( results ) ) {\n\t\t// We have no reliable way of merging non-array results.\n\t\treturn results;\n\t}\n\n\tlet nextPage = getNextPageUrl( response );\n\n\tif ( ! nextPage ) {\n\t\t// There are no further pages to request.\n\t\treturn results;\n\t}\n\n\t// Iteratively fetch all remaining pages until no \"next\" header is found.\n\tlet mergedResults = /** @type {any[]} */ ( [] ).concat( results );\n\twhile ( nextPage ) {\n\t\tconst nextResponse = await apiFetch( {\n\t\t\t...options,\n\t\t\t// Ensure the URL for the next page is used instead of any provided path.\n\t\t\tpath: undefined,\n\t\t\turl: nextPage,\n\t\t\t// Ensure we still get headers so we can identify the next page.\n\t\t\tparse: false,\n\t\t} );\n\t\tconst nextResults = await parseResponse( nextResponse );\n\t\tmergedResults = mergedResults.concat( nextResults );\n\t\tnextPage = getNextPageUrl( nextResponse );\n\t}\n\treturn mergedResults;\n};\n\nexport default fetchAllMiddleware;\n"]}
@@ -16,10 +16,7 @@ var _url = require("@wordpress/url");
16
16
  * @return {import('../types').APIFetchMiddleware} Preloading middleware.
17
17
  */
18
18
  function createPreloadingMiddleware(preloadedData) {
19
- const cache = Object.fromEntries(Object.entries(preloadedData).map(_ref => {
20
- let [path, data] = _ref;
21
- return [(0, _url.normalizePath)(path), data];
22
- }));
19
+ const cache = Object.fromEntries(Object.entries(preloadedData).map(([path, data]) => [(0, _url.normalizePath)(path), data]));
23
20
  return (options, next) => {
24
21
  const {
25
22
  parse = true
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/api-fetch/src/middlewares/preloading.js"],"names":["createPreloadingMiddleware","preloadedData","cache","Object","fromEntries","entries","map","path","data","options","next","parse","rawPath","url","rest_route","pathFromQuery","queryArgs","method","cacheData","prepareResponse","responseData","Promise","resolve","body","window","Response","JSON","stringify","status","statusText","headers"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA,SAASA,0BAAT,CAAqCC,aAArC,EAAqD;AACpD,QAAMC,KAAK,GAAGC,MAAM,CAACC,WAAP,CACbD,MAAM,CAACE,OAAP,CAAgBJ,aAAhB,EAAgCK,GAAhC,CAAqC;AAAA,QAAE,CAAEC,IAAF,EAAQC,IAAR,CAAF;AAAA,WAAsB,CAC1D,wBAAeD,IAAf,CAD0D,EAE1DC,IAF0D,CAAtB;AAAA,GAArC,CADa,CAAd;AAOA,SAAO,CAAEC,OAAF,EAAWC,IAAX,KAAqB;AAC3B,UAAM;AAAEC,MAAAA,KAAK,GAAG;AAAV,QAAmBF,OAAzB;AACA;;AACA,QAAIG,OAAO,GAAGH,OAAO,CAACF,IAAtB;;AACA,QAAK,CAAEK,OAAF,IAAaH,OAAO,CAACI,GAA1B,EAAgC;AAC/B,YAAM;AAAEC,QAAAA,UAAU,EAAEC,aAAd;AAA6B,WAAGC;AAAhC,UAA8C,uBACnDP,OAAO,CAACI,GAD2C,CAApD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M,EAAE,GADkD;AAE1DC,IAAAA,UAAU,EAAE,IAF8C;AAG1DC,IAAAA,OAAO,EAAEV,YAAY,CAACU;AAHoC,GAA1D,CAHG,CAAP;AASA;;eAEc9B,0B","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addQueryArgs, getQueryArgs, normalizePath } from '@wordpress/url';\n\n/**\n * @param {Record<string, any>} preloadedData\n * @return {import('../types').APIFetchMiddleware} Preloading middleware.\n */\nfunction createPreloadingMiddleware( preloadedData ) {\n\tconst cache = Object.fromEntries(\n\t\tObject.entries( preloadedData ).map( ( [ path, data ] ) => [\n\t\t\tnormalizePath( path ),\n\t\t\tdata,\n\t\t] )\n\t);\n\n\treturn ( options, next ) => {\n\t\tconst { parse = true } = options;\n\t\t/** @type {string | void} */\n\t\tlet rawPath = options.path;\n\t\tif ( ! rawPath && options.url ) {\n\t\t\tconst { rest_route: pathFromQuery, ...queryArgs } = getQueryArgs(\n\t\t\t\toptions.url\n\t\t\t);\n\n\t\t\tif ( typeof pathFromQuery === 'string' ) {\n\t\t\t\trawPath = addQueryArgs( pathFromQuery, queryArgs );\n\t\t\t}\n\t\t}\n\n\t\tif ( typeof rawPath !== 'string' ) {\n\t\t\treturn next( options );\n\t\t}\n\n\t\tconst method = options.method || 'GET';\n\t\tconst path = normalizePath( rawPath );\n\n\t\tif ( 'GET' === method && cache[ path ] ) {\n\t\t\tconst cacheData = cache[ path ];\n\n\t\t\t// Unsetting the cache key ensures that the data is only used a single time.\n\t\t\tdelete cache[ path ];\n\n\t\t\treturn prepareResponse( cacheData, !! parse );\n\t\t} else if (\n\t\t\t'OPTIONS' === method &&\n\t\t\tcache[ method ] &&\n\t\t\tcache[ method ][ path ]\n\t\t) {\n\t\t\tconst cacheData = cache[ method ][ path ];\n\n\t\t\t// Unsetting the cache key ensures that the data is only used a single time.\n\t\t\tdelete cache[ method ][ path ];\n\n\t\t\treturn prepareResponse( cacheData, !! parse );\n\t\t}\n\n\t\treturn next( options );\n\t};\n}\n\n/**\n * This is a helper function that sends a success response.\n *\n * @param {Record<string, any>} responseData\n * @param {boolean} parse\n * @return {Promise<any>} Promise with the response.\n */\nfunction prepareResponse( responseData, parse ) {\n\treturn Promise.resolve(\n\t\tparse\n\t\t\t? responseData.body\n\t\t\t: new window.Response( JSON.stringify( responseData.body ), {\n\t\t\t\t\tstatus: 200,\n\t\t\t\t\tstatusText: 'OK',\n\t\t\t\t\theaders: responseData.headers,\n\t\t\t } )\n\t);\n}\n\nexport default createPreloadingMiddleware;\n"]}
1
+ {"version":3,"sources":["@wordpress/api-fetch/src/middlewares/preloading.js"],"names":["createPreloadingMiddleware","preloadedData","cache","Object","fromEntries","entries","map","path","data","options","next","parse","rawPath","url","rest_route","pathFromQuery","queryArgs","method","cacheData","prepareResponse","responseData","Promise","resolve","body","window","Response","JSON","stringify","status","statusText","headers"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA,SAASA,0BAAT,CAAqCC,aAArC,EAAqD;AACpD,QAAMC,KAAK,GAAGC,MAAM,CAACC,WAAP,CACbD,MAAM,CAACE,OAAP,CAAgBJ,aAAhB,EAAgCK,GAAhC,CAAqC,CAAE,CAAEC,IAAF,EAAQC,IAAR,CAAF,KAAsB,CAC1D,wBAAeD,IAAf,CAD0D,EAE1DC,IAF0D,CAA3D,CADa,CAAd;AAOA,SAAO,CAAEC,OAAF,EAAWC,IAAX,KAAqB;AAC3B,UAAM;AAAEC,MAAAA,KAAK,GAAG;AAAV,QAAmBF,OAAzB;AACA;;AACA,QAAIG,OAAO,GAAGH,OAAO,CAACF,IAAtB;;AACA,QAAK,CAAEK,OAAF,IAAaH,OAAO,CAACI,GAA1B,EAAgC;AAC/B,YAAM;AAAEC,QAAAA,UAAU,EAAEC,aAAd;AAA6B,WAAGC;AAAhC,UAA8C,uBACnDP,OAAO,CAACI,GAD2C,CAApD;;AAIA,UAAK,OAAOE,aAAP,KAAyB,QAA9B,EAAyC;AACxCH,QAAAA,OAAO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O,EAAEV,YAAY,CAACU;AAHoC,GAA1D,CAHG,CAAP;AASA;;eAEc9B,0B","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addQueryArgs, getQueryArgs, normalizePath } from '@wordpress/url';\n\n/**\n * @param {Record<string, any>} preloadedData\n * @return {import('../types').APIFetchMiddleware} Preloading middleware.\n */\nfunction createPreloadingMiddleware( preloadedData ) {\n\tconst cache = Object.fromEntries(\n\t\tObject.entries( preloadedData ).map( ( [ path, data ] ) => [\n\t\t\tnormalizePath( path ),\n\t\t\tdata,\n\t\t] )\n\t);\n\n\treturn ( options, next ) => {\n\t\tconst { parse = true } = options;\n\t\t/** @type {string | void} */\n\t\tlet rawPath = options.path;\n\t\tif ( ! rawPath && options.url ) {\n\t\t\tconst { rest_route: pathFromQuery, ...queryArgs } = getQueryArgs(\n\t\t\t\toptions.url\n\t\t\t);\n\n\t\t\tif ( typeof pathFromQuery === 'string' ) {\n\t\t\t\trawPath = addQueryArgs( pathFromQuery, queryArgs );\n\t\t\t}\n\t\t}\n\n\t\tif ( typeof rawPath !== 'string' ) {\n\t\t\treturn next( options );\n\t\t}\n\n\t\tconst method = options.method || 'GET';\n\t\tconst path = normalizePath( rawPath );\n\n\t\tif ( 'GET' === method && cache[ path ] ) {\n\t\t\tconst cacheData = cache[ path ];\n\n\t\t\t// Unsetting the cache key ensures that the data is only used a single time.\n\t\t\tdelete cache[ path ];\n\n\t\t\treturn prepareResponse( cacheData, !! parse );\n\t\t} else if (\n\t\t\t'OPTIONS' === method &&\n\t\t\tcache[ method ] &&\n\t\t\tcache[ method ][ path ]\n\t\t) {\n\t\t\tconst cacheData = cache[ method ][ path ];\n\n\t\t\t// Unsetting the cache key ensures that the data is only used a single time.\n\t\t\tdelete cache[ method ][ path ];\n\n\t\t\treturn prepareResponse( cacheData, !! parse );\n\t\t}\n\n\t\treturn next( options );\n\t};\n}\n\n/**\n * This is a helper function that sends a success response.\n *\n * @param {Record<string, any>} responseData\n * @param {boolean} parse\n * @return {Promise<any>} Promise with the response.\n */\nfunction prepareResponse( responseData, parse ) {\n\treturn Promise.resolve(\n\t\tparse\n\t\t\t? responseData.body\n\t\t\t: new window.Response( JSON.stringify( responseData.body ), {\n\t\t\t\t\tstatus: 200,\n\t\t\t\t\tstatusText: 'OK',\n\t\t\t\t\theaders: responseData.headers,\n\t\t\t } )\n\t);\n}\n\nexport default createPreloadingMiddleware;\n"]}
@@ -12,22 +12,22 @@ var _url = require("@wordpress/url");
12
12
  */
13
13
 
14
14
  /**
15
- * This appends a `theme_preview` parameter to the REST API request URL if
15
+ * This appends a `wp_theme_preview` parameter to the REST API request URL if
16
16
  * the admin URL contains a `theme` GET parameter.
17
17
  *
18
18
  * @param {Record<string, any>} themePath
19
19
  * @return {import('../types').APIFetchMiddleware} Preloading middleware.
20
20
  */
21
21
  const createThemePreviewMiddleware = themePath => (options, next) => {
22
- if (typeof options.url === 'string' && !(0, _url.hasQueryArg)(options.url, 'theme_preview')) {
22
+ if (typeof options.url === 'string' && !(0, _url.hasQueryArg)(options.url, 'wp_theme_preview')) {
23
23
  options.url = (0, _url.addQueryArgs)(options.url, {
24
- theme_preview: themePath
24
+ wp_theme_preview: themePath
25
25
  });
26
26
  }
27
27
 
28
- if (typeof options.path === 'string' && !(0, _url.hasQueryArg)(options.path, 'theme_preview')) {
28
+ if (typeof options.path === 'string' && !(0, _url.hasQueryArg)(options.path, 'wp_theme_preview')) {
29
29
  options.path = (0, _url.addQueryArgs)(options.path, {
30
- theme_preview: themePath
30
+ wp_theme_preview: themePath
31
31
  });
32
32
  }
33
33
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/api-fetch/src/middlewares/theme-preview.js"],"names":["createThemePreviewMiddleware","themePath","options","next","url","theme_preview","path"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,4BAA4B,GAAKC,SAAF,IAAiB,CAAEC,OAAF,EAAWC,IAAX,KAAqB;AAC1E,MACC,OAAOD,OAAO,CAACE,GAAf,KAAuB,QAAvB,IACA,CAAE,sBAAaF,OAAO,CAACE,GAArB,EAA0B,eAA1B,CAFH,EAGE;AACDF,IAAAA,OAAO,CAACE,GAAR,GAAc,uBAAcF,OAAO,CAACE,GAAtB,EAA2B;AACxCC,MAAAA,aAAa,EAAEJ;AADyB,KAA3B,CAAd;AAGA;;AAED,MACC,OAAOC,OAAO,CAACI,IAAf,KAAwB,QAAxB,IACA,CAAE,sBAAaJ,OAAO,CAACI,IAArB,EAA2B,eAA3B,CAFH,EAGE;AACDJ,IAAAA,OAAO,CAACI,IAAR,GAAe,uBAAcJ,OAAO,CAACI,IAAtB,EAA4B;AAC1CD,MAAAA,aAAa,EAAEJ;AAD2B,KAA5B,CAAf;AAGA;;AAED,SAAOE,IAAI,CAAED,OAAF,CAAX;AACA,CApBD;;eAsBeF,4B","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addQueryArgs, hasQueryArg } from '@wordpress/url';\n\n/**\n * This appends a `theme_preview` parameter to the REST API request URL if\n * the admin URL contains a `theme` GET parameter.\n *\n * @param {Record<string, any>} themePath\n * @return {import('../types').APIFetchMiddleware} Preloading middleware.\n */\nconst createThemePreviewMiddleware = ( themePath ) => ( options, next ) => {\n\tif (\n\t\ttypeof options.url === 'string' &&\n\t\t! hasQueryArg( options.url, 'theme_preview' )\n\t) {\n\t\toptions.url = addQueryArgs( options.url, {\n\t\t\ttheme_preview: themePath,\n\t\t} );\n\t}\n\n\tif (\n\t\ttypeof options.path === 'string' &&\n\t\t! hasQueryArg( options.path, 'theme_preview' )\n\t) {\n\t\toptions.path = addQueryArgs( options.path, {\n\t\t\ttheme_preview: themePath,\n\t\t} );\n\t}\n\n\treturn next( options );\n};\n\nexport default createThemePreviewMiddleware;\n"]}
1
+ {"version":3,"sources":["@wordpress/api-fetch/src/middlewares/theme-preview.js"],"names":["createThemePreviewMiddleware","themePath","options","next","url","wp_theme_preview","path"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,4BAA4B,GAAKC,SAAF,IAAiB,CAAEC,OAAF,EAAWC,IAAX,KAAqB;AAC1E,MACC,OAAOD,OAAO,CAACE,GAAf,KAAuB,QAAvB,IACA,CAAE,sBAAaF,OAAO,CAACE,GAArB,EAA0B,kBAA1B,CAFH,EAGE;AACDF,IAAAA,OAAO,CAACE,GAAR,GAAc,uBAAcF,OAAO,CAACE,GAAtB,EAA2B;AACxCC,MAAAA,gBAAgB,EAAEJ;AADsB,KAA3B,CAAd;AAGA;;AAED,MACC,OAAOC,OAAO,CAACI,IAAf,KAAwB,QAAxB,IACA,CAAE,sBAAaJ,OAAO,CAACI,IAArB,EAA2B,kBAA3B,CAFH,EAGE;AACDJ,IAAAA,OAAO,CAACI,IAAR,GAAe,uBAAcJ,OAAO,CAACI,IAAtB,EAA4B;AAC1CD,MAAAA,gBAAgB,EAAEJ;AADwB,KAA5B,CAAf;AAGA;;AAED,SAAOE,IAAI,CAAED,OAAF,CAAX;AACA,CApBD;;eAsBeF,4B","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addQueryArgs, hasQueryArg } from '@wordpress/url';\n\n/**\n * This appends a `wp_theme_preview` parameter to the REST API request URL if\n * the admin URL contains a `theme` GET parameter.\n *\n * @param {Record<string, any>} themePath\n * @return {import('../types').APIFetchMiddleware} Preloading middleware.\n */\nconst createThemePreviewMiddleware = ( themePath ) => ( options, next ) => {\n\tif (\n\t\ttypeof options.url === 'string' &&\n\t\t! hasQueryArg( options.url, 'wp_theme_preview' )\n\t) {\n\t\toptions.url = addQueryArgs( options.url, {\n\t\t\twp_theme_preview: themePath,\n\t\t} );\n\t}\n\n\tif (\n\t\ttypeof options.path === 'string' &&\n\t\t! hasQueryArg( options.path, 'wp_theme_preview' )\n\t) {\n\t\toptions.path = addQueryArgs( options.path, {\n\t\t\twp_theme_preview: themePath,\n\t\t} );\n\t}\n\n\treturn next( options );\n};\n\nexport default createThemePreviewMiddleware;\n"]}
@@ -20,9 +20,7 @@ var _i18n = require("@wordpress/i18n");
20
20
  *
21
21
  * @return {Promise<any> | null | Response} Parsed response.
22
22
  */
23
- const parseResponse = function (response) {
24
- let shouldParseResponse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
25
-
23
+ const parseResponse = (response, shouldParseResponse = true) => {
26
24
  if (shouldParseResponse) {
27
25
  if (response.status === 204) {
28
26
  return null;
@@ -66,8 +64,7 @@ const parseJsonAndNormalizeError = response => {
66
64
  */
67
65
 
68
66
 
69
- const parseResponseAndNormalizeError = function (response) {
70
- let shouldParseResponse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
67
+ const parseResponseAndNormalizeError = (response, shouldParseResponse = true) => {
71
68
  return Promise.resolve(parseResponse(response, shouldParseResponse)).catch(res => parseAndThrowError(res, shouldParseResponse));
72
69
  };
73
70
  /**
@@ -81,9 +78,7 @@ const parseResponseAndNormalizeError = function (response) {
81
78
 
82
79
  exports.parseResponseAndNormalizeError = parseResponseAndNormalizeError;
83
80
 
84
- function parseAndThrowError(response) {
85
- let shouldParseResponse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
86
-
81
+ function parseAndThrowError(response, shouldParseResponse = true) {
87
82
  if (!shouldParseResponse) {
88
83
  throw response;
89
84
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/api-fetch/src/utils/response.js"],"names":["parseResponse","response","shouldParseResponse","status","json","Promise","reject","parseJsonAndNormalizeError","invalidJsonError","code","message","catch","parseResponseAndNormalizeError","resolve","res","parseAndThrowError","then","error","unknownError"],"mappings":";;;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,aAAa,GAAG,UAAEC,QAAF,EAA4C;AAAA,MAAhCC,mBAAgC,uEAAV,IAAU;;AACjE,MAAKA,mBAAL,EAA2B;AAC1B,QAAKD,QAAQ,CAACE,MAAT,KAA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AAJ;AAFW,KAArB;AAKA,UAAMO,KAAK,IAAIC,YAAf;AACA,GAPM,CAAP;AAQA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Parses the apiFetch response.\n *\n * @param {Response} response\n * @param {boolean} shouldParseResponse\n *\n * @return {Promise<any> | null | Response} Parsed response.\n */\nconst parseResponse = ( response, shouldParseResponse = true ) => {\n\tif ( shouldParseResponse ) {\n\t\tif ( response.status === 204 ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn response.json ? response.json() : Promise.reject( response );\n\t}\n\n\treturn response;\n};\n\n/**\n * Calls the `json` function on the Response, throwing an error if the response\n * doesn't have a json function or if parsing the json itself fails.\n *\n * @param {Response} response\n * @return {Promise<any>} Parsed response.\n */\nconst parseJsonAndNormalizeError = ( response ) => {\n\tconst invalidJsonError = {\n\t\tcode: 'invalid_json',\n\t\tmessage: __( 'The response is not a valid JSON response.' ),\n\t};\n\n\tif ( ! response || ! response.json ) {\n\t\tthrow invalidJsonError;\n\t}\n\n\treturn response.json().catch( () => {\n\t\tthrow invalidJsonError;\n\t} );\n};\n\n/**\n * Parses the apiFetch response properly and normalize response errors.\n *\n * @param {Response} response\n * @param {boolean} shouldParseResponse\n *\n * @return {Promise<any>} Parsed response.\n */\nexport const parseResponseAndNormalizeError = (\n\tresponse,\n\tshouldParseResponse = true\n) => {\n\treturn Promise.resolve(\n\t\tparseResponse( response, shouldParseResponse )\n\t).catch( ( res ) => parseAndThrowError( res, shouldParseResponse ) );\n};\n\n/**\n * Parses a response, throwing an error if parsing the response fails.\n *\n * @param {Response} response\n * @param {boolean} shouldParseResponse\n * @return {Promise<any>} Parsed response.\n */\nexport function parseAndThrowError( response, shouldParseResponse = true ) {\n\tif ( ! shouldParseResponse ) {\n\t\tthrow response;\n\t}\n\n\treturn parseJsonAndNormalizeError( response ).then( ( error ) => {\n\t\tconst unknownError = {\n\t\t\tcode: 'unknown_error',\n\t\t\tmessage: __( 'An unknown error occurred.' ),\n\t\t};\n\n\t\tthrow error || unknownError;\n\t} );\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/api-fetch/src/utils/response.js"],"names":["parseResponse","response","shouldParseResponse","status","json","Promise","reject","parseJsonAndNormalizeError","invalidJsonError","code","message","catch","parseResponseAndNormalizeError","resolve","res","parseAndThrowError","then","error","unknownError"],"mappings":";;;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,aAAa,GAAG,CAAEC,QAAF,EAAYC,mBAAmB,GAAG,IAAlC,KAA4C;AACjE,MAAKA,mBAAL,EAA2B;AAC1B,QAAKD,QAAQ,CAACE,MAAT,KAAoB,GAAzB,EAA+B;AAC9B,aAAO,IAAP;AACA;;AAED,WAAOF,QAAQ,CAACG,IAAT,GAAgBH,QAAQ,CAACG,IAAT,EAAhB,GAAkCC,OAAO,CAACC,MAAR,CAAgBL,QAAhB,CAAzC;AACA;;AAED,SAAOA,QAAP;AACA,CAVD;AAYA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMM,0BAA0B,GAAKN,QAAF,IAAgB;AAClD,QAAMO,gBAAgB,GAAG;AACxBC,IAAAA,IAAI,EAAE,cADkB;AAExBC,IAAAA,OAAO,EAAE,cAAI,4CAAJ;AAFe,GAAzB;;AAKA,MAAK,CAAET,QAAF,IAAc,CAAEA,QAAQ,CAACG,IAA9B,EAAqC;AACpC,UAAMI,gBAAN;AACA;;AAED,SAAOP,QAAQ,CAACG,IAAT,GAAgBO,KAAhB,CAAuB,MAAM;AACnC,UAAMH,gBAAN;AACA,GAFM,CAAP;AAGA,CAbD;AAeA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAMI,8BAA8B,GAAG,CAC7CX,QAD6C,EAE7CC,mBAAmB,GAAG,IAFuB,KAGzC;AACJ,SAAOG,OAAO,CAACQ,OAAR,CACNb,aAAa,CAAEC,QAAF,EAAYC,mBAAZ,CADP,EAELS,KAFK,CAEIG,GAAF,IAAWC,kBAAkB,CAAED,GAAF,EAAOZ,mBAAP,CAF/B,CAAP;AAGA,CAPM;AASP;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AACO,SAASa,kBAAT,CAA6Bd,QAA7B,EAAuCC,mBAAmB,GAAG,IAA7D,EAAoE;AAC1E,MAAK,CAAEA,mBAAP,EAA6B;AAC5B,UAAMD,QAAN;AACA;;AAED,SAAOM,0BAA0B,CAAEN,QAAF,CAA1B,CAAuCe,IAAvC,CAA+CC,KAAF,IAAa;AAChE,UAAMC,YAAY,GAAG;AACpBT,MAAAA,IAAI,EAAE,eADc;AAEpBC,MAAAA,OAAO,EAAE,cAAI,4BAAJ;AAFW,KAArB;AAKA,UAAMO,KAAK,IAAIC,YAAf;AACA,GAPM,CAAP;AAQA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Parses the apiFetch response.\n *\n * @param {Response} response\n * @param {boolean} shouldParseResponse\n *\n * @return {Promise<any> | null | Response} Parsed response.\n */\nconst parseResponse = ( response, shouldParseResponse = true ) => {\n\tif ( shouldParseResponse ) {\n\t\tif ( response.status === 204 ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn response.json ? response.json() : Promise.reject( response );\n\t}\n\n\treturn response;\n};\n\n/**\n * Calls the `json` function on the Response, throwing an error if the response\n * doesn't have a json function or if parsing the json itself fails.\n *\n * @param {Response} response\n * @return {Promise<any>} Parsed response.\n */\nconst parseJsonAndNormalizeError = ( response ) => {\n\tconst invalidJsonError = {\n\t\tcode: 'invalid_json',\n\t\tmessage: __( 'The response is not a valid JSON response.' ),\n\t};\n\n\tif ( ! response || ! response.json ) {\n\t\tthrow invalidJsonError;\n\t}\n\n\treturn response.json().catch( () => {\n\t\tthrow invalidJsonError;\n\t} );\n};\n\n/**\n * Parses the apiFetch response properly and normalize response errors.\n *\n * @param {Response} response\n * @param {boolean} shouldParseResponse\n *\n * @return {Promise<any>} Parsed response.\n */\nexport const parseResponseAndNormalizeError = (\n\tresponse,\n\tshouldParseResponse = true\n) => {\n\treturn Promise.resolve(\n\t\tparseResponse( response, shouldParseResponse )\n\t).catch( ( res ) => parseAndThrowError( res, shouldParseResponse ) );\n};\n\n/**\n * Parses a response, throwing an error if parsing the response fails.\n *\n * @param {Response} response\n * @param {boolean} shouldParseResponse\n * @return {Promise<any>} Parsed response.\n */\nexport function parseAndThrowError( response, shouldParseResponse = true ) {\n\tif ( ! shouldParseResponse ) {\n\t\tthrow response;\n\t}\n\n\treturn parseJsonAndNormalizeError( response ).then( ( error ) => {\n\t\tconst unknownError = {\n\t\t\tcode: 'unknown_error',\n\t\t\tmessage: __( 'An unknown error occurred.' ),\n\t\t};\n\n\t\tthrow error || unknownError;\n\t} );\n}\n"]}
@@ -15,17 +15,14 @@ import apiFetch from '..';
15
15
  * @return {import('../types').APIFetchOptions} The request with the modified query args
16
16
  */
17
17
 
18
- const modifyQuery = (_ref, queryArgs) => {
19
- let {
20
- path,
21
- url,
22
- ...options
23
- } = _ref;
24
- return { ...options,
25
- url: url && addQueryArgs(url, queryArgs),
26
- path: path && addQueryArgs(path, queryArgs)
27
- };
28
- };
18
+ const modifyQuery = ({
19
+ path,
20
+ url,
21
+ ...options
22
+ }, queryArgs) => ({ ...options,
23
+ url: url && addQueryArgs(url, queryArgs),
24
+ path: path && addQueryArgs(path, queryArgs)
25
+ });
29
26
  /**
30
27
  * Duplicates parsing functionality from apiFetch.
31
28
  *
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/api-fetch/src/middlewares/fetch-all-middleware.js"],"names":["addQueryArgs","apiFetch","modifyQuery","queryArgs","path","url","options","parseResponse","response","json","Promise","reject","parseLinkHeader","linkHeader","match","next","getNextPageUrl","headers","get","requestContainsUnboundedQuery","pathIsUnbounded","indexOf","urlIsUnbounded","fetchAllMiddleware","parse","per_page","results","Array","isArray","nextPage","mergedResults","concat","nextResponse","undefined","nextResults"],"mappings":"AAAA;AACA;AACA;A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EAAE6B,SAH8B;AAIpC5B,MAAAA,GAAG,EAAEwB,QAJ+B;AAKpC;AACAL,MAAAA,KAAK,EAAE;AAN6B,KAAF,CAAnC;AAQA,UAAMU,WAAW,GAAG,MAAM3B,aAAa,CAAEyB,YAAF,CAAvC;AACAF,IAAAA,aAAa,GAAGA,aAAa,CAACC,MAAd,CAAsBG,WAAtB,CAAhB;AACAL,IAAAA,QAAQ,GAAGb,cAAc,CAAEgB,YAAF,CAAzB;AACA;;AACD,SAAOF,aAAP;AACA,CAjDD;;AAmDA,eAAeP,kBAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport apiFetch from '..';\n\n/**\n * Apply query arguments to both URL and Path, whichever is present.\n *\n * @param {import('../types').APIFetchOptions} props\n * @param {Record<string, string | number>} queryArgs\n * @return {import('../types').APIFetchOptions} The request with the modified query args\n */\nconst modifyQuery = ( { path, url, ...options }, queryArgs ) => ( {\n\t...options,\n\turl: url && addQueryArgs( url, queryArgs ),\n\tpath: path && addQueryArgs( path, queryArgs ),\n} );\n\n/**\n * Duplicates parsing functionality from apiFetch.\n *\n * @param {Response} response\n * @return {Promise<any>} Parsed response json.\n */\nconst parseResponse = ( response ) =>\n\tresponse.json ? response.json() : Promise.reject( response );\n\n/**\n * @param {string | null} linkHeader\n * @return {{ next?: string }} The parsed link header.\n */\nconst parseLinkHeader = ( linkHeader ) => {\n\tif ( ! linkHeader ) {\n\t\treturn {};\n\t}\n\tconst match = linkHeader.match( /<([^>]+)>; rel=\"next\"/ );\n\treturn match\n\t\t? {\n\t\t\t\tnext: match[ 1 ],\n\t\t }\n\t\t: {};\n};\n\n/**\n * @param {Response} response\n * @return {string | undefined} The next page URL.\n */\nconst getNextPageUrl = ( response ) => {\n\tconst { next } = parseLinkHeader( response.headers.get( 'link' ) );\n\treturn next;\n};\n\n/**\n * @param {import('../types').APIFetchOptions} options\n * @return {boolean} True if the request contains an unbounded query.\n */\nconst requestContainsUnboundedQuery = ( options ) => {\n\tconst pathIsUnbounded =\n\t\t!! options.path && options.path.indexOf( 'per_page=-1' ) !== -1;\n\tconst urlIsUnbounded =\n\t\t!! options.url && options.url.indexOf( 'per_page=-1' ) !== -1;\n\treturn pathIsUnbounded || urlIsUnbounded;\n};\n\n/**\n * The REST API enforces an upper limit on the per_page option. To handle large\n * collections, apiFetch consumers can pass `per_page=-1`; this middleware will\n * then recursively assemble a full response array from all available pages.\n *\n * @type {import('../types').APIFetchMiddleware}\n */\nconst fetchAllMiddleware = async ( options, next ) => {\n\tif ( options.parse === false ) {\n\t\t// If a consumer has opted out of parsing, do not apply middleware.\n\t\treturn next( options );\n\t}\n\tif ( ! requestContainsUnboundedQuery( options ) ) {\n\t\t// If neither url nor path is requesting all items, do not apply middleware.\n\t\treturn next( options );\n\t}\n\n\t// Retrieve requested page of results.\n\tconst response = await apiFetch( {\n\t\t...modifyQuery( options, {\n\t\t\tper_page: 100,\n\t\t} ),\n\t\t// Ensure headers are returned for page 1.\n\t\tparse: false,\n\t} );\n\n\tconst results = await parseResponse( response );\n\n\tif ( ! Array.isArray( results ) ) {\n\t\t// We have no reliable way of merging non-array results.\n\t\treturn results;\n\t}\n\n\tlet nextPage = getNextPageUrl( response );\n\n\tif ( ! nextPage ) {\n\t\t// There are no further pages to request.\n\t\treturn results;\n\t}\n\n\t// Iteratively fetch all remaining pages until no \"next\" header is found.\n\tlet mergedResults = /** @type {any[]} */ ( [] ).concat( results );\n\twhile ( nextPage ) {\n\t\tconst nextResponse = await apiFetch( {\n\t\t\t...options,\n\t\t\t// Ensure the URL for the next page is used instead of any provided path.\n\t\t\tpath: undefined,\n\t\t\turl: nextPage,\n\t\t\t// Ensure we still get headers so we can identify the next page.\n\t\t\tparse: false,\n\t\t} );\n\t\tconst nextResults = await parseResponse( nextResponse );\n\t\tmergedResults = mergedResults.concat( nextResults );\n\t\tnextPage = getNextPageUrl( nextResponse );\n\t}\n\treturn mergedResults;\n};\n\nexport default fetchAllMiddleware;\n"]}
1
+ {"version":3,"sources":["@wordpress/api-fetch/src/middlewares/fetch-all-middleware.js"],"names":["addQueryArgs","apiFetch","modifyQuery","path","url","options","queryArgs","parseResponse","response","json","Promise","reject","parseLinkHeader","linkHeader","match","next","getNextPageUrl","headers","get","requestContainsUnboundedQuery","pathIsUnbounded","indexOf","urlIsUnbounded","fetchAllMiddleware","parse","per_page","results","Array","isArray","nextPage","mergedResults","concat","nextResponse","undefined","nextResults"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,YAAT,QAA6B,gBAA7B;AAEA;AACA;AACA;;AACA,OAAOC,QAAP,MAAqB,IAArB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMC,WAAW,GAAG,CAAE;AAAEC,EAAAA,IAAF;AAAQC,EAAAA,GAAR;AAAa,KAAGC;AAAhB,CAAF,EAA6BC,SAA7B,MAA8C,EACjE,GAAGD,OAD8D;AAEjED,EAAAA,GAAG,EAAEA,GAAG,IAAIJ,YAAY,CAAEI,GAAF,EAAOE,SAAP,CAFyC;AAGjEH,EAAAA,IAAI,EAAEA,IAAI,IAAIH,YAAY,CAAEG,IAAF,EAAQG,SAAR;AAHuC,CAA9C,CAApB;AAMA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMC,aAAa,GAAKC,QAAF,IACrBA,QAAQ,CAACC,IAAT,GAAgBD,QAAQ,CAACC,IAAT,EAAhB,GAAkCC,OAAO,CAACC,MAAR,CAAgBH,QAAhB,CADnC;AAGA;AACA;AACA;AACA;;;AACA,MAAMI,eAAe,GAAKC,UAAF,IAAkB;AACzC,MAAK,CAAEA,UAAP,EAAoB;AACnB,WAAO,EAAP;AACA;;AACD,QAAMC,KAAK,GAAGD,UAAU,CAACC,KAAX,CAAkB,uBAAlB,CAAd;AACA,SAAOA,KAAK,GACT;AACAC,IAAAA,IAAI,EAAED,KAAK,CAAE,CAAF;AADX,GADS,GAIT,EAJH;AAKA,CAVD;AAYA;AACA;AACA;AAC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AQ,GAAGb,cAAc,CAAER,QAAF,CAA7B;;AAEA,MAAK,CAAEqB,QAAP,EAAkB;AACjB;AACA,WAAOH,OAAP;AACA,GA/BoD,CAiCrD;;;AACA,MAAII,aAAa;AAAG;AAAuB,IAAF,CAAOC,MAAP,CAAeL,OAAf,CAAzC;;AACA,SAAQG,QAAR,EAAmB;AAClB,UAAMG,YAAY,GAAG,MAAM/B,QAAQ,CAAE,EACpC,GAAGI,OADiC;AAEpC;AACAF,MAAAA,IAAI,EAAE8B,SAH8B;AAIpC7B,MAAAA,GAAG,EAAEyB,QAJ+B;AAKpC;AACAL,MAAAA,KAAK,EAAE;AAN6B,KAAF,CAAnC;AAQA,UAAMU,WAAW,GAAG,MAAM3B,aAAa,CAAEyB,YAAF,CAAvC;AACAF,IAAAA,aAAa,GAAGA,aAAa,CAACC,MAAd,CAAsBG,WAAtB,CAAhB;AACAL,IAAAA,QAAQ,GAAGb,cAAc,CAAEgB,YAAF,CAAzB;AACA;;AACD,SAAOF,aAAP;AACA,CAjDD;;AAmDA,eAAeP,kBAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport apiFetch from '..';\n\n/**\n * Apply query arguments to both URL and Path, whichever is present.\n *\n * @param {import('../types').APIFetchOptions} props\n * @param {Record<string, string | number>} queryArgs\n * @return {import('../types').APIFetchOptions} The request with the modified query args\n */\nconst modifyQuery = ( { path, url, ...options }, queryArgs ) => ( {\n\t...options,\n\turl: url && addQueryArgs( url, queryArgs ),\n\tpath: path && addQueryArgs( path, queryArgs ),\n} );\n\n/**\n * Duplicates parsing functionality from apiFetch.\n *\n * @param {Response} response\n * @return {Promise<any>} Parsed response json.\n */\nconst parseResponse = ( response ) =>\n\tresponse.json ? response.json() : Promise.reject( response );\n\n/**\n * @param {string | null} linkHeader\n * @return {{ next?: string }} The parsed link header.\n */\nconst parseLinkHeader = ( linkHeader ) => {\n\tif ( ! linkHeader ) {\n\t\treturn {};\n\t}\n\tconst match = linkHeader.match( /<([^>]+)>; rel=\"next\"/ );\n\treturn match\n\t\t? {\n\t\t\t\tnext: match[ 1 ],\n\t\t }\n\t\t: {};\n};\n\n/**\n * @param {Response} response\n * @return {string | undefined} The next page URL.\n */\nconst getNextPageUrl = ( response ) => {\n\tconst { next } = parseLinkHeader( response.headers.get( 'link' ) );\n\treturn next;\n};\n\n/**\n * @param {import('../types').APIFetchOptions} options\n * @return {boolean} True if the request contains an unbounded query.\n */\nconst requestContainsUnboundedQuery = ( options ) => {\n\tconst pathIsUnbounded =\n\t\t!! options.path && options.path.indexOf( 'per_page=-1' ) !== -1;\n\tconst urlIsUnbounded =\n\t\t!! options.url && options.url.indexOf( 'per_page=-1' ) !== -1;\n\treturn pathIsUnbounded || urlIsUnbounded;\n};\n\n/**\n * The REST API enforces an upper limit on the per_page option. To handle large\n * collections, apiFetch consumers can pass `per_page=-1`; this middleware will\n * then recursively assemble a full response array from all available pages.\n *\n * @type {import('../types').APIFetchMiddleware}\n */\nconst fetchAllMiddleware = async ( options, next ) => {\n\tif ( options.parse === false ) {\n\t\t// If a consumer has opted out of parsing, do not apply middleware.\n\t\treturn next( options );\n\t}\n\tif ( ! requestContainsUnboundedQuery( options ) ) {\n\t\t// If neither url nor path is requesting all items, do not apply middleware.\n\t\treturn next( options );\n\t}\n\n\t// Retrieve requested page of results.\n\tconst response = await apiFetch( {\n\t\t...modifyQuery( options, {\n\t\t\tper_page: 100,\n\t\t} ),\n\t\t// Ensure headers are returned for page 1.\n\t\tparse: false,\n\t} );\n\n\tconst results = await parseResponse( response );\n\n\tif ( ! Array.isArray( results ) ) {\n\t\t// We have no reliable way of merging non-array results.\n\t\treturn results;\n\t}\n\n\tlet nextPage = getNextPageUrl( response );\n\n\tif ( ! nextPage ) {\n\t\t// There are no further pages to request.\n\t\treturn results;\n\t}\n\n\t// Iteratively fetch all remaining pages until no \"next\" header is found.\n\tlet mergedResults = /** @type {any[]} */ ( [] ).concat( results );\n\twhile ( nextPage ) {\n\t\tconst nextResponse = await apiFetch( {\n\t\t\t...options,\n\t\t\t// Ensure the URL for the next page is used instead of any provided path.\n\t\t\tpath: undefined,\n\t\t\turl: nextPage,\n\t\t\t// Ensure we still get headers so we can identify the next page.\n\t\t\tparse: false,\n\t\t} );\n\t\tconst nextResults = await parseResponse( nextResponse );\n\t\tmergedResults = mergedResults.concat( nextResults );\n\t\tnextPage = getNextPageUrl( nextResponse );\n\t}\n\treturn mergedResults;\n};\n\nexport default fetchAllMiddleware;\n"]}
@@ -8,10 +8,7 @@ import { addQueryArgs, getQueryArgs, normalizePath } from '@wordpress/url';
8
8
  */
9
9
 
10
10
  function createPreloadingMiddleware(preloadedData) {
11
- const cache = Object.fromEntries(Object.entries(preloadedData).map(_ref => {
12
- let [path, data] = _ref;
13
- return [normalizePath(path), data];
14
- }));
11
+ const cache = Object.fromEntries(Object.entries(preloadedData).map(([path, data]) => [normalizePath(path), data]));
15
12
  return (options, next) => {
16
13
  const {
17
14
  parse = true
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/api-fetch/src/middlewares/preloading.js"],"names":["addQueryArgs","getQueryArgs","normalizePath","createPreloadingMiddleware","preloadedData","cache","Object","fromEntries","entries","map","path","data","options","next","parse","rawPath","url","rest_route","pathFromQuery","queryArgs","method","cacheData","prepareResponse","responseData","Promise","resolve","body","window","Response","JSON","stringify","status","statusText","headers"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,YAAT,EAAuBC,YAAvB,EAAqCC,aAArC,QAA0D,gBAA1D;AAEA;AACA;AACA;AACA;;AACA,SAASC,0BAAT,CAAqCC,aAArC,EAAqD;AACpD,QAAMC,KAAK,GAAGC,MAAM,CAACC,WAAP,CACbD,MAAM,CAACE,OAAP,CAAgBJ,aAAhB,EAAgCK,GAAhC,CAAqC;AAAA,QAAE,CAAEC,IAAF,EAAQC,IAAR,CAAF;AAAA,WAAsB,CAC1DT,aAAa,CAAEQ,IAAF,CAD6C,EAE1DC,IAF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AAED,SAAF,EAAa,CAAC,CAAEP,KAAhB,CAAtB;AACA;;AAED,WAAOD,IAAI,CAAED,OAAF,CAAX;AACA,GA1CD;AA2CA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASU,eAAT,CAA0BC,YAA1B,EAAwCT,KAAxC,EAAgD;AAC/C,SAAOU,OAAO,CAACC,OAAR,CACNX,KAAK,GACFS,YAAY,CAACG,IADX,GAEF,IAAIC,MAAM,CAACC,QAAX,CAAqBC,IAAI,CAACC,SAAL,CAAgBP,YAAY,CAACG,IAA7B,CAArB,EAA0D;AAC1DK,IAAAA,MAAM,EAAE,GADkD;AAE1DC,IAAAA,UAAU,EAAE,IAF8C;AAG1DC,IAAAA,OAAO,EAAEV,YAAY,CAACU;AAHoC,GAA1D,CAHG,CAAP;AASA;;AAED,eAAe9B,0BAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addQueryArgs, getQueryArgs, normalizePath } from '@wordpress/url';\n\n/**\n * @param {Record<string, any>} preloadedData\n * @return {import('../types').APIFetchMiddleware} Preloading middleware.\n */\nfunction createPreloadingMiddleware( preloadedData ) {\n\tconst cache = Object.fromEntries(\n\t\tObject.entries( preloadedData ).map( ( [ path, data ] ) => [\n\t\t\tnormalizePath( path ),\n\t\t\tdata,\n\t\t] )\n\t);\n\n\treturn ( options, next ) => {\n\t\tconst { parse = true } = options;\n\t\t/** @type {string | void} */\n\t\tlet rawPath = options.path;\n\t\tif ( ! rawPath && options.url ) {\n\t\t\tconst { rest_route: pathFromQuery, ...queryArgs } = getQueryArgs(\n\t\t\t\toptions.url\n\t\t\t);\n\n\t\t\tif ( typeof pathFromQuery === 'string' ) {\n\t\t\t\trawPath = addQueryArgs( pathFromQuery, queryArgs );\n\t\t\t}\n\t\t}\n\n\t\tif ( typeof rawPath !== 'string' ) {\n\t\t\treturn next( options );\n\t\t}\n\n\t\tconst method = options.method || 'GET';\n\t\tconst path = normalizePath( rawPath );\n\n\t\tif ( 'GET' === method && cache[ path ] ) {\n\t\t\tconst cacheData = cache[ path ];\n\n\t\t\t// Unsetting the cache key ensures that the data is only used a single time.\n\t\t\tdelete cache[ path ];\n\n\t\t\treturn prepareResponse( cacheData, !! parse );\n\t\t} else if (\n\t\t\t'OPTIONS' === method &&\n\t\t\tcache[ method ] &&\n\t\t\tcache[ method ][ path ]\n\t\t) {\n\t\t\tconst cacheData = cache[ method ][ path ];\n\n\t\t\t// Unsetting the cache key ensures that the data is only used a single time.\n\t\t\tdelete cache[ method ][ path ];\n\n\t\t\treturn prepareResponse( cacheData, !! parse );\n\t\t}\n\n\t\treturn next( options );\n\t};\n}\n\n/**\n * This is a helper function that sends a success response.\n *\n * @param {Record<string, any>} responseData\n * @param {boolean} parse\n * @return {Promise<any>} Promise with the response.\n */\nfunction prepareResponse( responseData, parse ) {\n\treturn Promise.resolve(\n\t\tparse\n\t\t\t? responseData.body\n\t\t\t: new window.Response( JSON.stringify( responseData.body ), {\n\t\t\t\t\tstatus: 200,\n\t\t\t\t\tstatusText: 'OK',\n\t\t\t\t\theaders: responseData.headers,\n\t\t\t } )\n\t);\n}\n\nexport default createPreloadingMiddleware;\n"]}
1
+ {"version":3,"sources":["@wordpress/api-fetch/src/middlewares/preloading.js"],"names":["addQueryArgs","getQueryArgs","normalizePath","createPreloadingMiddleware","preloadedData","cache","Object","fromEntries","entries","map","path","data","options","next","parse","rawPath","url","rest_route","pathFromQuery","queryArgs","method","cacheData","prepareResponse","responseData","Promise","resolve","body","window","Response","JSON","stringify","status","statusText","headers"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,YAAT,EAAuBC,YAAvB,EAAqCC,aAArC,QAA0D,gBAA1D;AAEA;AACA;AACA;AACA;;AACA,SAASC,0BAAT,CAAqCC,aAArC,EAAqD;AACpD,QAAMC,KAAK,GAAGC,MAAM,CAACC,WAAP,CACbD,MAAM,CAACE,OAAP,CAAgBJ,aAAhB,EAAgCK,GAAhC,CAAqC,CAAE,CAAEC,IAAF,EAAQC,IAAR,CAA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AL,CAAiBV,IAAjB,CAAP;AAEA,aAAOY,eAAe,CAAED,SAAF,EAAa,CAAC,CAAEP,KAAhB,CAAtB;AACA;;AAED,WAAOD,IAAI,CAAED,OAAF,CAAX;AACA,GA1CD;AA2CA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASU,eAAT,CAA0BC,YAA1B,EAAwCT,KAAxC,EAAgD;AAC/C,SAAOU,OAAO,CAACC,OAAR,CACNX,KAAK,GACFS,YAAY,CAACG,IADX,GAEF,IAAIC,MAAM,CAACC,QAAX,CAAqBC,IAAI,CAACC,SAAL,CAAgBP,YAAY,CAACG,IAA7B,CAArB,EAA0D;AAC1DK,IAAAA,MAAM,EAAE,GADkD;AAE1DC,IAAAA,UAAU,EAAE,IAF8C;AAG1DC,IAAAA,OAAO,EAAEV,YAAY,CAACU;AAHoC,GAA1D,CAHG,CAAP;AASA;;AAED,eAAe9B,0BAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addQueryArgs, getQueryArgs, normalizePath } from '@wordpress/url';\n\n/**\n * @param {Record<string, any>} preloadedData\n * @return {import('../types').APIFetchMiddleware} Preloading middleware.\n */\nfunction createPreloadingMiddleware( preloadedData ) {\n\tconst cache = Object.fromEntries(\n\t\tObject.entries( preloadedData ).map( ( [ path, data ] ) => [\n\t\t\tnormalizePath( path ),\n\t\t\tdata,\n\t\t] )\n\t);\n\n\treturn ( options, next ) => {\n\t\tconst { parse = true } = options;\n\t\t/** @type {string | void} */\n\t\tlet rawPath = options.path;\n\t\tif ( ! rawPath && options.url ) {\n\t\t\tconst { rest_route: pathFromQuery, ...queryArgs } = getQueryArgs(\n\t\t\t\toptions.url\n\t\t\t);\n\n\t\t\tif ( typeof pathFromQuery === 'string' ) {\n\t\t\t\trawPath = addQueryArgs( pathFromQuery, queryArgs );\n\t\t\t}\n\t\t}\n\n\t\tif ( typeof rawPath !== 'string' ) {\n\t\t\treturn next( options );\n\t\t}\n\n\t\tconst method = options.method || 'GET';\n\t\tconst path = normalizePath( rawPath );\n\n\t\tif ( 'GET' === method && cache[ path ] ) {\n\t\t\tconst cacheData = cache[ path ];\n\n\t\t\t// Unsetting the cache key ensures that the data is only used a single time.\n\t\t\tdelete cache[ path ];\n\n\t\t\treturn prepareResponse( cacheData, !! parse );\n\t\t} else if (\n\t\t\t'OPTIONS' === method &&\n\t\t\tcache[ method ] &&\n\t\t\tcache[ method ][ path ]\n\t\t) {\n\t\t\tconst cacheData = cache[ method ][ path ];\n\n\t\t\t// Unsetting the cache key ensures that the data is only used a single time.\n\t\t\tdelete cache[ method ][ path ];\n\n\t\t\treturn prepareResponse( cacheData, !! parse );\n\t\t}\n\n\t\treturn next( options );\n\t};\n}\n\n/**\n * This is a helper function that sends a success response.\n *\n * @param {Record<string, any>} responseData\n * @param {boolean} parse\n * @return {Promise<any>} Promise with the response.\n */\nfunction prepareResponse( responseData, parse ) {\n\treturn Promise.resolve(\n\t\tparse\n\t\t\t? responseData.body\n\t\t\t: new window.Response( JSON.stringify( responseData.body ), {\n\t\t\t\t\tstatus: 200,\n\t\t\t\t\tstatusText: 'OK',\n\t\t\t\t\theaders: responseData.headers,\n\t\t\t } )\n\t);\n}\n\nexport default createPreloadingMiddleware;\n"]}
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import { addQueryArgs, hasQueryArg } from '@wordpress/url';
5
5
  /**
6
- * This appends a `theme_preview` parameter to the REST API request URL if
6
+ * This appends a `wp_theme_preview` parameter to the REST API request URL if
7
7
  * the admin URL contains a `theme` GET parameter.
8
8
  *
9
9
  * @param {Record<string, any>} themePath
@@ -11,15 +11,15 @@ import { addQueryArgs, hasQueryArg } from '@wordpress/url';
11
11
  */
12
12
 
13
13
  const createThemePreviewMiddleware = themePath => (options, next) => {
14
- if (typeof options.url === 'string' && !hasQueryArg(options.url, 'theme_preview')) {
14
+ if (typeof options.url === 'string' && !hasQueryArg(options.url, 'wp_theme_preview')) {
15
15
  options.url = addQueryArgs(options.url, {
16
- theme_preview: themePath
16
+ wp_theme_preview: themePath
17
17
  });
18
18
  }
19
19
 
20
- if (typeof options.path === 'string' && !hasQueryArg(options.path, 'theme_preview')) {
20
+ if (typeof options.path === 'string' && !hasQueryArg(options.path, 'wp_theme_preview')) {
21
21
  options.path = addQueryArgs(options.path, {
22
- theme_preview: themePath
22
+ wp_theme_preview: themePath
23
23
  });
24
24
  }
25
25
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/api-fetch/src/middlewares/theme-preview.js"],"names":["addQueryArgs","hasQueryArg","createThemePreviewMiddleware","themePath","options","next","url","theme_preview","path"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,YAAT,EAAuBC,WAAvB,QAA0C,gBAA1C;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMC,4BAA4B,GAAKC,SAAF,IAAiB,CAAEC,OAAF,EAAWC,IAAX,KAAqB;AAC1E,MACC,OAAOD,OAAO,CAACE,GAAf,KAAuB,QAAvB,IACA,CAAEL,WAAW,CAAEG,OAAO,CAACE,GAAV,EAAe,eAAf,CAFd,EAGE;AACDF,IAAAA,OAAO,CAACE,GAAR,GAAcN,YAAY,CAAEI,OAAO,CAACE,GAAV,EAAe;AACxCC,MAAAA,aAAa,EAAEJ;AADyB,KAAf,CAA1B;AAGA;;AAED,MACC,OAAOC,OAAO,CAACI,IAAf,KAAwB,QAAxB,IACA,CAAEP,WAAW,CAAEG,OAAO,CAACI,IAAV,EAAgB,eAAhB,CAFd,EAGE;AACDJ,IAAAA,OAAO,CAACI,IAAR,GAAeR,YAAY,CAAEI,OAAO,CAACI,IAAV,EAAgB;AAC1CD,MAAAA,aAAa,EAAEJ;AAD2B,KAAhB,CAA3B;AAGA;;AAED,SAAOE,IAAI,CAAED,OAAF,CAAX;AACA,CApBD;;AAsBA,eAAeF,4BAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addQueryArgs, hasQueryArg } from '@wordpress/url';\n\n/**\n * This appends a `theme_preview` parameter to the REST API request URL if\n * the admin URL contains a `theme` GET parameter.\n *\n * @param {Record<string, any>} themePath\n * @return {import('../types').APIFetchMiddleware} Preloading middleware.\n */\nconst createThemePreviewMiddleware = ( themePath ) => ( options, next ) => {\n\tif (\n\t\ttypeof options.url === 'string' &&\n\t\t! hasQueryArg( options.url, 'theme_preview' )\n\t) {\n\t\toptions.url = addQueryArgs( options.url, {\n\t\t\ttheme_preview: themePath,\n\t\t} );\n\t}\n\n\tif (\n\t\ttypeof options.path === 'string' &&\n\t\t! hasQueryArg( options.path, 'theme_preview' )\n\t) {\n\t\toptions.path = addQueryArgs( options.path, {\n\t\t\ttheme_preview: themePath,\n\t\t} );\n\t}\n\n\treturn next( options );\n};\n\nexport default createThemePreviewMiddleware;\n"]}
1
+ {"version":3,"sources":["@wordpress/api-fetch/src/middlewares/theme-preview.js"],"names":["addQueryArgs","hasQueryArg","createThemePreviewMiddleware","themePath","options","next","url","wp_theme_preview","path"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,YAAT,EAAuBC,WAAvB,QAA0C,gBAA1C;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMC,4BAA4B,GAAKC,SAAF,IAAiB,CAAEC,OAAF,EAAWC,IAAX,KAAqB;AAC1E,MACC,OAAOD,OAAO,CAACE,GAAf,KAAuB,QAAvB,IACA,CAAEL,WAAW,CAAEG,OAAO,CAACE,GAAV,EAAe,kBAAf,CAFd,EAGE;AACDF,IAAAA,OAAO,CAACE,GAAR,GAAcN,YAAY,CAAEI,OAAO,CAACE,GAAV,EAAe;AACxCC,MAAAA,gBAAgB,EAAEJ;AADsB,KAAf,CAA1B;AAGA;;AAED,MACC,OAAOC,OAAO,CAACI,IAAf,KAAwB,QAAxB,IACA,CAAEP,WAAW,CAAEG,OAAO,CAACI,IAAV,EAAgB,kBAAhB,CAFd,EAGE;AACDJ,IAAAA,OAAO,CAACI,IAAR,GAAeR,YAAY,CAAEI,OAAO,CAACI,IAAV,EAAgB;AAC1CD,MAAAA,gBAAgB,EAAEJ;AADwB,KAAhB,CAA3B;AAGA;;AAED,SAAOE,IAAI,CAAED,OAAF,CAAX;AACA,CApBD;;AAsBA,eAAeF,4BAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addQueryArgs, hasQueryArg } from '@wordpress/url';\n\n/**\n * This appends a `wp_theme_preview` parameter to the REST API request URL if\n * the admin URL contains a `theme` GET parameter.\n *\n * @param {Record<string, any>} themePath\n * @return {import('../types').APIFetchMiddleware} Preloading middleware.\n */\nconst createThemePreviewMiddleware = ( themePath ) => ( options, next ) => {\n\tif (\n\t\ttypeof options.url === 'string' &&\n\t\t! hasQueryArg( options.url, 'wp_theme_preview' )\n\t) {\n\t\toptions.url = addQueryArgs( options.url, {\n\t\t\twp_theme_preview: themePath,\n\t\t} );\n\t}\n\n\tif (\n\t\ttypeof options.path === 'string' &&\n\t\t! hasQueryArg( options.path, 'wp_theme_preview' )\n\t) {\n\t\toptions.path = addQueryArgs( options.path, {\n\t\t\twp_theme_preview: themePath,\n\t\t} );\n\t}\n\n\treturn next( options );\n};\n\nexport default createThemePreviewMiddleware;\n"]}
@@ -11,9 +11,7 @@ import { __ } from '@wordpress/i18n';
11
11
  * @return {Promise<any> | null | Response} Parsed response.
12
12
  */
13
13
 
14
- const parseResponse = function (response) {
15
- let shouldParseResponse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
16
-
14
+ const parseResponse = (response, shouldParseResponse = true) => {
17
15
  if (shouldParseResponse) {
18
16
  if (response.status === 204) {
19
17
  return null;
@@ -57,8 +55,7 @@ const parseJsonAndNormalizeError = response => {
57
55
  */
58
56
 
59
57
 
60
- export const parseResponseAndNormalizeError = function (response) {
61
- let shouldParseResponse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
58
+ export const parseResponseAndNormalizeError = (response, shouldParseResponse = true) => {
62
59
  return Promise.resolve(parseResponse(response, shouldParseResponse)).catch(res => parseAndThrowError(res, shouldParseResponse));
63
60
  };
64
61
  /**
@@ -69,9 +66,7 @@ export const parseResponseAndNormalizeError = function (response) {
69
66
  * @return {Promise<any>} Parsed response.
70
67
  */
71
68
 
72
- export function parseAndThrowError(response) {
73
- let shouldParseResponse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
74
-
69
+ export function parseAndThrowError(response, shouldParseResponse = true) {
75
70
  if (!shouldParseResponse) {
76
71
  throw response;
77
72
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/api-fetch/src/utils/response.js"],"names":["__","parseResponse","response","shouldParseResponse","status","json","Promise","reject","parseJsonAndNormalizeError","invalidJsonError","code","message","catch","parseResponseAndNormalizeError","resolve","res","parseAndThrowError","then","error","unknownError"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMC,aAAa,GAAG,UAAEC,QAAF,EAA4C;AAAA,MAAhCC,mBAAgC,uEAAV,IAAU;;AACjE,MAAKA,mBAAL,EAA2B;AAC1B,QAAKD,QAAQ,CAACE,MAAT,KAAoB,GAAzB,EAA+B;AAC9B,aAAO,IAAP;AACA;;AAED,WAAOF,QAAQ,CAACG,IAAT,GAAgBH,QAAQ,CAACG,IAAT,EAAhB,GAAkCC,OAAO,CAACC,MAAR,CAAgBL,QAAhB,CAAzC;AACA;;AAED,SAAOA,QAAP;AACA,CAVD;AAYA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMM,0BAA0B,GAAKN,QAAF,IAAgB;AAClD,QAAMO,gBAAgB,GAAG;AACxBC,IAAAA,IAAI,EAAE,cADkB;AAExBC,IAAAA,OAAO,EAAEX,EAAE,CAAE,4CAAF;AAFa,GAAzB;;AAKA,MAAK,CAAEE,QAAF,IAAc,CAAEA,QAAQ,CAACG,IAA9B,EAAqC;AACpC,UAAMI,gBAAN;AACA;;AAED,SAAOP,QAAQ,CAACG,IAAT,GAAgBO,KAAhB,CAAuB,MAAM;AACnC,UAAMH,gBAAN;AACA,GAFM,CAAP;AAGA,CAbD;AAeA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,OAAO,MAAMI,8BAA8B,GAAG,UAC7CX,QAD6C,EAGzC;AAAA,MADJC,mBACI,uEADkB,IAClB;AACJ,SAAOG,OAAO,CAACQ,OAAR,CACNb,aAAa,CAAEC,QAAF,EAAYC,mBAAZ,CADP,EAELS,KAFK,CAEIG,GAAF,IAAWC,kBAAkB,CAAED,GAAF,EAAOZ,mBAAP,CAF/B,CAAP;AAGA,CAPM;AASP;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASa,kBAAT,CAA6Bd,QAA7B,EAAoE;AAAA,MAA7BC,mBAA6B,uEAAP,IAAO;;AAC1E,MAAK,CAAEA,mBAAP,EAA6B;AAC5B,UAAMD,QAAN;AACA;;AAED,SAAOM,0BAA0B,CAAEN,QAAF,CAA1B,CAAuCe,IAAvC,CAA+CC,KAAF,IAAa;AAChE,UAAMC,YAAY,GAAG;AACpBT,MAAAA,IAAI,EAAE,eADc;AAEpBC,MAAAA,OAAO,EAAEX,EAAE,CAAE,4BAAF;AAFS,KAArB;AAKA,UAAMkB,KAAK,IAAIC,YAAf;AACA,GAPM,CAAP;AAQA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Parses the apiFetch response.\n *\n * @param {Response} response\n * @param {boolean} shouldParseResponse\n *\n * @return {Promise<any> | null | Response} Parsed response.\n */\nconst parseResponse = ( response, shouldParseResponse = true ) => {\n\tif ( shouldParseResponse ) {\n\t\tif ( response.status === 204 ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn response.json ? response.json() : Promise.reject( response );\n\t}\n\n\treturn response;\n};\n\n/**\n * Calls the `json` function on the Response, throwing an error if the response\n * doesn't have a json function or if parsing the json itself fails.\n *\n * @param {Response} response\n * @return {Promise<any>} Parsed response.\n */\nconst parseJsonAndNormalizeError = ( response ) => {\n\tconst invalidJsonError = {\n\t\tcode: 'invalid_json',\n\t\tmessage: __( 'The response is not a valid JSON response.' ),\n\t};\n\n\tif ( ! response || ! response.json ) {\n\t\tthrow invalidJsonError;\n\t}\n\n\treturn response.json().catch( () => {\n\t\tthrow invalidJsonError;\n\t} );\n};\n\n/**\n * Parses the apiFetch response properly and normalize response errors.\n *\n * @param {Response} response\n * @param {boolean} shouldParseResponse\n *\n * @return {Promise<any>} Parsed response.\n */\nexport const parseResponseAndNormalizeError = (\n\tresponse,\n\tshouldParseResponse = true\n) => {\n\treturn Promise.resolve(\n\t\tparseResponse( response, shouldParseResponse )\n\t).catch( ( res ) => parseAndThrowError( res, shouldParseResponse ) );\n};\n\n/**\n * Parses a response, throwing an error if parsing the response fails.\n *\n * @param {Response} response\n * @param {boolean} shouldParseResponse\n * @return {Promise<any>} Parsed response.\n */\nexport function parseAndThrowError( response, shouldParseResponse = true ) {\n\tif ( ! shouldParseResponse ) {\n\t\tthrow response;\n\t}\n\n\treturn parseJsonAndNormalizeError( response ).then( ( error ) => {\n\t\tconst unknownError = {\n\t\t\tcode: 'unknown_error',\n\t\t\tmessage: __( 'An unknown error occurred.' ),\n\t\t};\n\n\t\tthrow error || unknownError;\n\t} );\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/api-fetch/src/utils/response.js"],"names":["__","parseResponse","response","shouldParseResponse","status","json","Promise","reject","parseJsonAndNormalizeError","invalidJsonError","code","message","catch","parseResponseAndNormalizeError","resolve","res","parseAndThrowError","then","error","unknownError"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMC,aAAa,GAAG,CAAEC,QAAF,EAAYC,mBAAmB,GAAG,IAAlC,KAA4C;AACjE,MAAKA,mBAAL,EAA2B;AAC1B,QAAKD,QAAQ,CAACE,MAAT,KAAoB,GAAzB,EAA+B;AAC9B,aAAO,IAAP;AACA;;AAED,WAAOF,QAAQ,CAACG,IAAT,GAAgBH,QAAQ,C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esContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Parses the apiFetch response.\n *\n * @param {Response} response\n * @param {boolean} shouldParseResponse\n *\n * @return {Promise<any> | null | Response} Parsed response.\n */\nconst parseResponse = ( response, shouldParseResponse = true ) => {\n\tif ( shouldParseResponse ) {\n\t\tif ( response.status === 204 ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn response.json ? response.json() : Promise.reject( response );\n\t}\n\n\treturn response;\n};\n\n/**\n * Calls the `json` function on the Response, throwing an error if the response\n * doesn't have a json function or if parsing the json itself fails.\n *\n * @param {Response} response\n * @return {Promise<any>} Parsed response.\n */\nconst parseJsonAndNormalizeError = ( response ) => {\n\tconst invalidJsonError = {\n\t\tcode: 'invalid_json',\n\t\tmessage: __( 'The response is not a valid JSON response.' ),\n\t};\n\n\tif ( ! response || ! response.json ) {\n\t\tthrow invalidJsonError;\n\t}\n\n\treturn response.json().catch( () => {\n\t\tthrow invalidJsonError;\n\t} );\n};\n\n/**\n * Parses the apiFetch response properly and normalize response errors.\n *\n * @param {Response} response\n * @param {boolean} shouldParseResponse\n *\n * @return {Promise<any>} Parsed response.\n */\nexport const parseResponseAndNormalizeError = (\n\tresponse,\n\tshouldParseResponse = true\n) => {\n\treturn Promise.resolve(\n\t\tparseResponse( response, shouldParseResponse )\n\t).catch( ( res ) => parseAndThrowError( res, shouldParseResponse ) );\n};\n\n/**\n * Parses a response, throwing an error if parsing the response fails.\n *\n * @param {Response} response\n * @param {boolean} shouldParseResponse\n * @return {Promise<any>} Parsed response.\n */\nexport function parseAndThrowError( response, shouldParseResponse = true ) {\n\tif ( ! shouldParseResponse ) {\n\t\tthrow response;\n\t}\n\n\treturn parseJsonAndNormalizeError( response ).then( ( error ) => {\n\t\tconst unknownError = {\n\t\t\tcode: 'unknown_error',\n\t\t\tmessage: __( 'An unknown error occurred.' ),\n\t\t};\n\n\t\tthrow error || unknownError;\n\t} );\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  export default createThemePreviewMiddleware;
2
2
  /**
3
- * This appends a `theme_preview` parameter to the REST API request URL if
3
+ * This appends a `wp_theme_preview` parameter to the REST API request URL if
4
4
  * the admin URL contains a `theme` GET parameter.
5
5
  *
6
6
  * @param {Record<string, any>} themePath
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/api-fetch",
3
- "version": "6.31.0",
3
+ "version": "6.33.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.34.0",
32
- "@wordpress/url": "^3.35.0"
31
+ "@wordpress/i18n": "^4.36.0",
32
+ "@wordpress/url": "^3.37.0"
33
33
  },
34
34
  "publishConfig": {
35
35
  "access": "public"
36
36
  },
37
- "gitHead": "c7c79cb11b677adcbf06cf5f8cfb6c5ec1699f19"
37
+ "gitHead": "d47d8069e1aae05d4a16dc287902eb90edcbff50"
38
38
  }
@@ -4,7 +4,7 @@
4
4
  import { addQueryArgs, hasQueryArg } from '@wordpress/url';
5
5
 
6
6
  /**
7
- * This appends a `theme_preview` parameter to the REST API request URL if
7
+ * This appends a `wp_theme_preview` parameter to the REST API request URL if
8
8
  * the admin URL contains a `theme` GET parameter.
9
9
  *
10
10
  * @param {Record<string, any>} themePath
@@ -13,19 +13,19 @@ import { addQueryArgs, hasQueryArg } from '@wordpress/url';
13
13
  const createThemePreviewMiddleware = ( themePath ) => ( options, next ) => {
14
14
  if (
15
15
  typeof options.url === 'string' &&
16
- ! hasQueryArg( options.url, 'theme_preview' )
16
+ ! hasQueryArg( options.url, 'wp_theme_preview' )
17
17
  ) {
18
18
  options.url = addQueryArgs( options.url, {
19
- theme_preview: themePath,
19
+ wp_theme_preview: themePath,
20
20
  } );
21
21
  }
22
22
 
23
23
  if (
24
24
  typeof options.path === 'string' &&
25
- ! hasQueryArg( options.path, 'theme_preview' )
25
+ ! hasQueryArg( options.path, 'wp_theme_preview' )
26
26
  ) {
27
27
  options.path = addQueryArgs( options.path, {
28
- theme_preview: themePath,
28
+ wp_theme_preview: themePath,
29
29
  } );
30
30
  }
31
31
 
@@ -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.es2022.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.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.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.es2020.number.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.es2021.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2022.string.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/prepend-https.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/middlewares/theme-preview.js","./src/index.js"],"fileInfos":[{"version":"8730f4bf322026ff5229336391a18bcaa1f94d4f82416c8b2f3954e2ccaae2ba","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","4b421cbfb3a38a27c279dec1e9112c3d1da296f77a1a85ddadf7e7a425d45d18","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9","746d62152361558ea6d6115cf0da4dd10ede041d14882ede3568bce5dc4b4f1f","d11a03592451da2d1065e09e61f4e2a9bf68f780f4f6623c18b57816a9679d17","aea179452def8a6152f98f63b191b84e7cbd69b0e248c91e61fb2e52328abe8c",{"version":"3aafcb693fe5b5c3bd277bd4c3a617b53db474fe498fc5df067c5603b1eebde7","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"8cc8c5a3bac513368b0157f3d8b31cfdcfe78b56d3724f30f80ed9715e404af8","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"5f406584aef28a331c36523df688ca3650288d14f39c5d2e555c95f0d2ff8f6f","affectsGlobalScope":true},{"version":"22f230e544b35349cfb3bd9110b6ef37b41c6d6c43c3314a31bd0d9652fcec72","affectsGlobalScope":true},{"version":"7ea0b55f6b315cf9ac2ad622b0a7813315bb6e97bf4bb3fbf8f8affbca7dc695","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"eb26de841c52236d8222f87e9e6a235332e0788af8c87a71e9e210314300410a","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"81cac4cbc92c0c839c70f8ffb94eb61e2d32dc1c3cf6d95844ca099463cf37ea","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"5e5e095c4470c8bab227dbbc61374878ecead104c74ab9960d3adcccfee23205","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"d7f680a43f8cd12a6b6122c07c54ba40952b0c8aa140dcfcf32eb9e6cb028596","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"2768ef564cfc0689a1b76106c421a2909bdff0acbe87da010785adab80efdd5c","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"6c55633c733c8378db65ac3da7a767c3cf2cf3057f0565a9124a16a3a2019e87","affectsGlobalScope":true},{"version":"fb4416144c1bf0323ccbc9afb0ab289c07312214e8820ad17d709498c865a3fe","affectsGlobalScope":true},{"version":"5b0ca94ec819d68d33da516306c15297acec88efeb0ae9e2b39f71dbd9685ef7","affectsGlobalScope":true},{"version":"34c839eaaa6d78c8674ae2c37af2236dee6831b13db7b4ef4df3ec889a04d4f2","affectsGlobalScope":true},{"version":"34478567f8a80171f88f2f30808beb7da15eac0538ae91282dd33dce928d98ed","affectsGlobalScope":true},{"version":"ab7d58e6161a550ff92e5aff755dc37fe896245348332cd5f1e1203479fe0ed1","affectsGlobalScope":true},{"version":"6bda95ea27a59a276e46043b7065b55bd4b316c25e70e29b572958fa77565d43","affectsGlobalScope":true},{"version":"aedb8de1abb2ff1095c153854a6df7deae4a5709c37297f9d6e9948b6806fa66","affectsGlobalScope":true},{"version":"a4da0551fd39b90ca7ce5f68fb55d4dc0c1396d589b612e1902f68ee090aaada","affectsGlobalScope":true},{"version":"11ffe3c281f375fff9ffdde8bbec7669b4dd671905509079f866f2354a788064","affectsGlobalScope":true},{"version":"52d1bb7ab7a3306fd0375c8bff560feed26ed676a5b0457fa8027b563aecb9a4","affectsGlobalScope":true},"762bc52248d3fab9873c7af564caf622358312cb35de42a4393b71cc36e14621","d02ec79cefaf292fae64b3be5a4416e64b4e420a6429fd458fac6e1bb4c7950e","27abed653f600ea0d5c86e94181beb42824e0f3f16337e2f9e7e9e9c2c392edf","d7871e0e653aa7197fee88886db5678bee6d42164c1f36e4bce9421ddfa7ca49","11ed10bdb3bcc99893570507eac8fece4840add97ee1d4f5a7fbf41cbfdea0d4","429fb571d3db07d3eaa2e74d43eb4190ece3e0de832ed564aeeaf08873e598eb","406d52bf33d618d846aa0d831ee004290567e328edcd4517bbff2937cc977abf","d3060e0810fc0d0dc009e6f086ef413d3c8aeaaf07da25c8d25fd4e181646acf","023747bf4162d5f675dbee1acbfb409a33e70d2358fd218b6a1b22dee8706c1a","08f7e6ffa66c66a636aecc5acbeb998215d9d09ccba0c558afb7df7e218edeaf","f829eb39aea4487f0ff94a42c56a1a73bc5202bbdeb03f7a638e4ab3e290d017",{"version":"d8c4f047684abe4a04c0f6bfc2dfca7b191c4bc7856f2bf63c0b8c04d3c3c59c","signature":"3482d13bc405611566ba123aad79452857745448142396834295f9180c256698"},{"version":"cea174bd7165f6473e9251e89b77677cc6fb980a0329964499ff39d7049941a9","signature":"89ec8efb8bd16e76d4f77f4ffe49749cb9854d0ec874db5d4392a8972924127c"},{"version":"3601498a0b299615d2b1871518f4e512837afa1ec33c10e5787c31297dba0e6b","signature":"a47154390b69beb9d6a1a56788133b4d5424338d06f1e0ee1f12d361f83f774e"},{"version":"b85af6a2052b84fadbe8e760359bec9d2cb765c404bab048d4bd20477c02bd89","signature":"a0952bc986c0c127094c5e5611e7af5e82ab9540c5662aea9bcaf9c83d16f0f4"},"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","f6ba45fc4f91ec75fa2b0841978666d497a0856bdefd60e30005265b8e23d3a0","ec0ccb9f611eb5d98a974590d631e4256eae34893a07037381f3d116fe9f31ee",{"version":"48a326d1451f44489b52557d2e9fee89dd6ba054c83be6b4c6ddd17c3765f347","signature":"dd8612883aedd9ec530174db17706eb1fe8f57abc5dd7b480757fc651234d4f1"},{"version":"73df30672e4cf303ecaa5bd1c0a228aec9bd972305b227ac47e53600b88eeb09","signature":"37d00f4939331930ee37cb9a4031839c06f0deabe2f4a8eaa5e373ff98bb2489"},{"version":"86113173dcf3a28562ae7493a30168e671b54a413095025d40eb462ebc55a4b5","signature":"9d82c5b3c5b183973de0cc260e0dc975b03d60b3d26614e2c626f795bcb3d189"},{"version":"e2ca321ccf84538d48bc2b24db351997d607695d37b6d6d50440385c8bffa7bc","signature":"8c6be9f322dc6b37b65c3afd34116cff345945a64b7793ab7215c5e975bff2d2"},{"version":"b24db76807128fad060ace7e8dda79b87a1cbc3879e67e15f8255e788a8ebfaa","signature":"62389e8c882b794d13d033108a2d0c50955e95cc86a81af85e49214458608c6f"},{"version":"8947b5182e734afd1d79ac20b1a0856f6ece9924fe1c6a5163d4a117384c7b35","signature":"757e4a0f32fe3adcc37171a44992106924e344c921b7b8ab5cc14905a1201d68"},{"version":"28b4ebfd998f1ade700f29b74ee59d005ef64919bcc26969edabd6fcf365a3b5","signature":"d2a875eb1b4a3d03d748234b5ae82eb91ec2701a77b1ed63d7fa9e5807a61935"},{"version":"6ab86b30959d8c2b792164002011ca5b70c7bbd9059e83193d28db5b234d961c","signature":"6337414865266294f9ccba173d60820aa592b1492526752cba4a610b93647df4"}],"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":[[66,67,68,69,70,99,100,101,102,103,104,105],[67,98,106],[67],[66,67,103],[67,98],[67,69],[66],[62],[57,58,59,60,61,62],[57,58,59,60,61,63],[62,63],[64],[56,64,65],[86],[71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97]],"referencedMap":[[106,1],[100,2],[101,3],[104,4],[69,3],[68,3],[99,5],[70,6],[105,5],[102,5],[103,7],[57,8],[61,8],[60,8],[59,8],[63,9],[58,8],[62,10],[64,11],[65,12],[66,13],[87,14],[98,15]],"exportedModulesMap":[[106,3],[100,3],[101,3],[104,3],[69,3],[68,3],[99,3],[70,3],[105,3],[102,3],[57,8],[61,8],[60,8],[59,8],[63,9],[58,8],[62,10],[64,11],[65,12],[66,13],[87,14],[98,15]],"semanticDiagnosticsPerFile":[11,13,12,2,14,15,16,17,18,19,20,21,3,4,25,22,23,24,26,27,28,5,29,30,31,32,6,36,33,34,35,37,7,38,43,44,39,40,41,42,8,48,45,46,47,49,9,50,51,52,53,54,1,10,55,106,100,101,104,69,68,99,70,105,102,67,103,57,61,60,59,63,58,62,64,65,66,56,85,80,94,93,75,95,83,82,77,73,86,87,79,88,98,72,71,76,84,78,74,81,96,90,97,89,92,91],"latestChangedDtsFile":"./build-types/index.d.ts"},"version":"4.9.5"}
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.es2022.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.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.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.es2020.number.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.es2021.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2022.string.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/prepend-https.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/middlewares/theme-preview.js","./src/index.js"],"fileInfos":[{"version":"8730f4bf322026ff5229336391a18bcaa1f94d4f82416c8b2f3954e2ccaae2ba","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","4b421cbfb3a38a27c279dec1e9112c3d1da296f77a1a85ddadf7e7a425d45d18","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9","746d62152361558ea6d6115cf0da4dd10ede041d14882ede3568bce5dc4b4f1f","d11a03592451da2d1065e09e61f4e2a9bf68f780f4f6623c18b57816a9679d17","aea179452def8a6152f98f63b191b84e7cbd69b0e248c91e61fb2e52328abe8c",{"version":"3aafcb693fe5b5c3bd277bd4c3a617b53db474fe498fc5df067c5603b1eebde7","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"8cc8c5a3bac513368b0157f3d8b31cfdcfe78b56d3724f30f80ed9715e404af8","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"5f406584aef28a331c36523df688ca3650288d14f39c5d2e555c95f0d2ff8f6f","affectsGlobalScope":true},{"version":"22f230e544b35349cfb3bd9110b6ef37b41c6d6c43c3314a31bd0d9652fcec72","affectsGlobalScope":true},{"version":"7ea0b55f6b315cf9ac2ad622b0a7813315bb6e97bf4bb3fbf8f8affbca7dc695","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"eb26de841c52236d8222f87e9e6a235332e0788af8c87a71e9e210314300410a","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"81cac4cbc92c0c839c70f8ffb94eb61e2d32dc1c3cf6d95844ca099463cf37ea","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"5e5e095c4470c8bab227dbbc61374878ecead104c74ab9960d3adcccfee23205","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"d7f680a43f8cd12a6b6122c07c54ba40952b0c8aa140dcfcf32eb9e6cb028596","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"2768ef564cfc0689a1b76106c421a2909bdff0acbe87da010785adab80efdd5c","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"6c55633c733c8378db65ac3da7a767c3cf2cf3057f0565a9124a16a3a2019e87","affectsGlobalScope":true},{"version":"fb4416144c1bf0323ccbc9afb0ab289c07312214e8820ad17d709498c865a3fe","affectsGlobalScope":true},{"version":"5b0ca94ec819d68d33da516306c15297acec88efeb0ae9e2b39f71dbd9685ef7","affectsGlobalScope":true},{"version":"34c839eaaa6d78c8674ae2c37af2236dee6831b13db7b4ef4df3ec889a04d4f2","affectsGlobalScope":true},{"version":"34478567f8a80171f88f2f30808beb7da15eac0538ae91282dd33dce928d98ed","affectsGlobalScope":true},{"version":"ab7d58e6161a550ff92e5aff755dc37fe896245348332cd5f1e1203479fe0ed1","affectsGlobalScope":true},{"version":"6bda95ea27a59a276e46043b7065b55bd4b316c25e70e29b572958fa77565d43","affectsGlobalScope":true},{"version":"aedb8de1abb2ff1095c153854a6df7deae4a5709c37297f9d6e9948b6806fa66","affectsGlobalScope":true},{"version":"a4da0551fd39b90ca7ce5f68fb55d4dc0c1396d589b612e1902f68ee090aaada","affectsGlobalScope":true},{"version":"11ffe3c281f375fff9ffdde8bbec7669b4dd671905509079f866f2354a788064","affectsGlobalScope":true},{"version":"52d1bb7ab7a3306fd0375c8bff560feed26ed676a5b0457fa8027b563aecb9a4","affectsGlobalScope":true},"762bc52248d3fab9873c7af564caf622358312cb35de42a4393b71cc36e14621","d02ec79cefaf292fae64b3be5a4416e64b4e420a6429fd458fac6e1bb4c7950e","27abed653f600ea0d5c86e94181beb42824e0f3f16337e2f9e7e9e9c2c392edf","d7871e0e653aa7197fee88886db5678bee6d42164c1f36e4bce9421ddfa7ca49","11ed10bdb3bcc99893570507eac8fece4840add97ee1d4f5a7fbf41cbfdea0d4","429fb571d3db07d3eaa2e74d43eb4190ece3e0de832ed564aeeaf08873e598eb","406d52bf33d618d846aa0d831ee004290567e328edcd4517bbff2937cc977abf","d3060e0810fc0d0dc009e6f086ef413d3c8aeaaf07da25c8d25fd4e181646acf","023747bf4162d5f675dbee1acbfb409a33e70d2358fd218b6a1b22dee8706c1a","08f7e6ffa66c66a636aecc5acbeb998215d9d09ccba0c558afb7df7e218edeaf","f829eb39aea4487f0ff94a42c56a1a73bc5202bbdeb03f7a638e4ab3e290d017",{"version":"d8c4f047684abe4a04c0f6bfc2dfca7b191c4bc7856f2bf63c0b8c04d3c3c59c","signature":"3482d13bc405611566ba123aad79452857745448142396834295f9180c256698"},{"version":"cea174bd7165f6473e9251e89b77677cc6fb980a0329964499ff39d7049941a9","signature":"89ec8efb8bd16e76d4f77f4ffe49749cb9854d0ec874db5d4392a8972924127c"},{"version":"3601498a0b299615d2b1871518f4e512837afa1ec33c10e5787c31297dba0e6b","signature":"a47154390b69beb9d6a1a56788133b4d5424338d06f1e0ee1f12d361f83f774e"},{"version":"b85af6a2052b84fadbe8e760359bec9d2cb765c404bab048d4bd20477c02bd89","signature":"a0952bc986c0c127094c5e5611e7af5e82ab9540c5662aea9bcaf9c83d16f0f4"},"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","f6ba45fc4f91ec75fa2b0841978666d497a0856bdefd60e30005265b8e23d3a0","ec0ccb9f611eb5d98a974590d631e4256eae34893a07037381f3d116fe9f31ee",{"version":"48a326d1451f44489b52557d2e9fee89dd6ba054c83be6b4c6ddd17c3765f347","signature":"dd8612883aedd9ec530174db17706eb1fe8f57abc5dd7b480757fc651234d4f1"},{"version":"73df30672e4cf303ecaa5bd1c0a228aec9bd972305b227ac47e53600b88eeb09","signature":"37d00f4939331930ee37cb9a4031839c06f0deabe2f4a8eaa5e373ff98bb2489"},{"version":"86113173dcf3a28562ae7493a30168e671b54a413095025d40eb462ebc55a4b5","signature":"9d82c5b3c5b183973de0cc260e0dc975b03d60b3d26614e2c626f795bcb3d189"},{"version":"e2ca321ccf84538d48bc2b24db351997d607695d37b6d6d50440385c8bffa7bc","signature":"8c6be9f322dc6b37b65c3afd34116cff345945a64b7793ab7215c5e975bff2d2"},{"version":"b24db76807128fad060ace7e8dda79b87a1cbc3879e67e15f8255e788a8ebfaa","signature":"62389e8c882b794d13d033108a2d0c50955e95cc86a81af85e49214458608c6f"},{"version":"8947b5182e734afd1d79ac20b1a0856f6ece9924fe1c6a5163d4a117384c7b35","signature":"757e4a0f32fe3adcc37171a44992106924e344c921b7b8ab5cc14905a1201d68"},{"version":"b84f12a72882cdaf857ee1493c2c0f83f71cc73ccf6dbd4943cb97d3a261ead2","signature":"d8174de05d01964ea16ceee47604679fca6b610cad7fdd3d53791c7ebc44f017"},{"version":"6ab86b30959d8c2b792164002011ca5b70c7bbd9059e83193d28db5b234d961c","signature":"6337414865266294f9ccba173d60820aa592b1492526752cba4a610b93647df4"}],"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":[[66,67,68,69,70,99,100,101,102,103,104,105],[67,98,106],[67],[66,67,103],[67,98],[67,69],[66],[62],[57,58,59,60,61,62],[57,58,59,60,61,63],[62,63],[64],[56,64,65],[86],[71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97]],"referencedMap":[[106,1],[100,2],[101,3],[104,4],[69,3],[68,3],[99,5],[70,6],[105,5],[102,5],[103,7],[57,8],[61,8],[60,8],[59,8],[63,9],[58,8],[62,10],[64,11],[65,12],[66,13],[87,14],[98,15]],"exportedModulesMap":[[106,3],[100,3],[101,3],[104,3],[69,3],[68,3],[99,3],[70,3],[105,3],[102,3],[57,8],[61,8],[60,8],[59,8],[63,9],[58,8],[62,10],[64,11],[65,12],[66,13],[87,14],[98,15]],"semanticDiagnosticsPerFile":[11,13,12,2,14,15,16,17,18,19,20,21,3,4,25,22,23,24,26,27,28,5,29,30,31,32,6,36,33,34,35,37,7,38,43,44,39,40,41,42,8,48,45,46,47,49,9,50,51,52,53,54,1,10,55,106,100,101,104,69,68,99,70,105,102,67,103,57,61,60,59,63,58,62,64,65,66,56,85,80,94,93,75,95,83,82,77,73,86,87,79,88,98,72,71,76,84,78,74,81,96,90,97,89,92,91],"latestChangedDtsFile":"./build-types/index.d.ts"},"version":"4.9.5"}