PluginProbe
Gutenberg / 12.6.0
Gutenberg v12.6.0
23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 12.6.0 7.4.0 All 402 releases
gutenberg / build / api-fetch / index.js

index.js in Gutenberg 12.6.0, at build/api-fetch/index.js

783 lines 21.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /******/ (function() { // webpackBootstrap
2 /******/ "use strict";
3 /******/ // The require scope
4 /******/ var __webpack_require__ = {};
5 /******/
6 /************************************************************************/
7 /******/ /* webpack/runtime/define property getters */
8 /******/ !function() {
9 /******/ // define getter functions for harmony exports
10 /******/ __webpack_require__.d = function(exports, definition) {
11 /******/ for(var key in definition) {
12 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
13 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
14 /******/ }
15 /******/ }
16 /******/ };
17 /******/ }();
18 /******/
19 /******/ /* webpack/runtime/hasOwnProperty shorthand */
20 /******/ !function() {
21 /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
22 /******/ }();
23 /******/
24 /************************************************************************/
25 var __webpack_exports__ = {};
26
27 // EXPORTS
28 __webpack_require__.d(__webpack_exports__, {
29 "default": function() { return /* binding */ build_module; }
30 });
31
32 ;// CONCATENATED MODULE: external ["wp","i18n"]
33 var external_wp_i18n_namespaceObject = window["wp"]["i18n"];
34 ;// CONCATENATED MODULE: ./packages/api-fetch/build-module/middlewares/nonce.js
35 /**
36 * @param {string} nonce
37 * @return {import('../types').APIFetchMiddleware & { nonce: string }} A middleware to enhance a request with a nonce.
38 */
39 function createNonceMiddleware(nonce) {
40 /**
41 * @type {import('../types').APIFetchMiddleware & { nonce: string }}
42 */
43 const middleware = (options, next) => {
44 const {
45 headers = {}
46 } = options; // If an 'X-WP-Nonce' header (or any case-insensitive variation
47 // thereof) was specified, no need to add a nonce header.
48
49 for (const headerName in headers) {
50 if (headerName.toLowerCase() === 'x-wp-nonce' && headers[headerName] === middleware.nonce) {
51 return next(options);
52 }
53 }
54
55 return next({ ...options,
56 headers: { ...headers,
57 'X-WP-Nonce': middleware.nonce
58 }
59 });
60 };
61
62 middleware.nonce = nonce;
63 return middleware;
64 }
65
66 /* harmony default export */ var nonce = (createNonceMiddleware);
67 //# sourceMappingURL=nonce.js.map
68 ;// CONCATENATED MODULE: ./packages/api-fetch/build-module/middlewares/namespace-endpoint.js
69 /**
70 * @type {import('../types').APIFetchMiddleware}
71 */
72 const namespaceAndEndpointMiddleware = (options, next) => {
73 let path = options.path;
74 let namespaceTrimmed, endpointTrimmed;
75
76 if (typeof options.namespace === 'string' && typeof options.endpoint === 'string') {
77 namespaceTrimmed = options.namespace.replace(/^\/|\/$/g, '');
78 endpointTrimmed = options.endpoint.replace(/^\//, '');
79
80 if (endpointTrimmed) {
81 path = namespaceTrimmed + '/' + endpointTrimmed;
82 } else {
83 path = namespaceTrimmed;
84 }
85 }
86
87 delete options.namespace;
88 delete options.endpoint;
89 return next({ ...options,
90 path
91 });
92 };
93
94 /* harmony default export */ var namespace_endpoint = (namespaceAndEndpointMiddleware);
95 //# sourceMappingURL=namespace-endpoint.js.map
96 ;// CONCATENATED MODULE: ./packages/api-fetch/build-module/middlewares/root-url.js
97 /**
98 * Internal dependencies
99 */
100
101 /**
102 * @param {string} rootURL
103 * @return {import('../types').APIFetchMiddleware} Root URL middleware.
104 */
105
106 const createRootURLMiddleware = rootURL => (options, next) => {
107 return namespace_endpoint(options, optionsWithPath => {
108 let url = optionsWithPath.url;
109 let path = optionsWithPath.path;
110 let apiRoot;
111
112 if (typeof path === 'string') {
113 apiRoot = rootURL;
114
115 if (-1 !== rootURL.indexOf('?')) {
116 path = path.replace('?', '&');
117 }
118
119 path = path.replace(/^\//, ''); // API root may already include query parameter prefix if site is
120 // configured to use plain permalinks.
121
122 if ('string' === typeof apiRoot && -1 !== apiRoot.indexOf('?')) {
123 path = path.replace('?', '&');
124 }
125
126 url = apiRoot + path;
127 }
128
129 return next({ ...optionsWithPath,
130 url
131 });
132 });
133 };
134
135 /* harmony default export */ var root_url = (createRootURLMiddleware);
136 //# sourceMappingURL=root-url.js.map
137 ;// CONCATENATED MODULE: external ["wp","url"]
138 var external_wp_url_namespaceObject = window["wp"]["url"];
139 ;// CONCATENATED MODULE: ./packages/api-fetch/build-module/middlewares/preloading.js
140 /**
141 * WordPress dependencies
142 */
143
144 /**
145 * @param {Record<string, any>} preloadedData
146 * @return {import('../types').APIFetchMiddleware} Preloading middleware.
147 */
148
149 function createPreloadingMiddleware(preloadedData) {
150 const cache = Object.keys(preloadedData).reduce((result, path) => {
151 result[(0,external_wp_url_namespaceObject.normalizePath)(path)] = preloadedData[path];
152 return result;
153 },
154 /** @type {Record<string, any>} */
155 {});
156 return (options, next) => {
157 const {
158 parse = true
159 } = options;
160 /** @type {string | void} */
161
162 let rawPath = options.path;
163
164 if (!rawPath && options.url) {
165 const pathFromQuery = (0,external_wp_url_namespaceObject.getQueryArg)(options.url, 'rest_route');
166
167 if (typeof pathFromQuery === 'string') {
168 rawPath = pathFromQuery;
169 }
170 }
171
172 if (typeof rawPath !== 'string') {
173 return next(options);
174 }
175
176 const method = options.method || 'GET';
177 const path = (0,external_wp_url_namespaceObject.normalizePath)(rawPath);
178
179 if ('GET' === method && cache[path]) {
180 const cacheData = cache[path]; // Unsetting the cache key ensures that the data is only used a single time
181
182 delete cache[path];
183 return prepareResponse(cacheData, !!parse);
184 } else if ('OPTIONS' === method && cache[method] && cache[method][path]) {
185 const cacheData = cache[method][path]; // Unsetting the cache key ensures that the data is only used a single time
186
187 delete cache[method][path];
188 return prepareResponse(cacheData, !!parse);
189 }
190
191 return next(options);
192 };
193 }
194 /**
195 * This is a helper function that sends a success response.
196 *
197 * @param {Record<string, any>} responseData
198 * @param {boolean} parse
199 * @return {Promise<any>} Promise with the response.
200 */
201
202
203 function prepareResponse(responseData, parse) {
204 return Promise.resolve(parse ? responseData.body : new window.Response(JSON.stringify(responseData.body), {
205 status: 200,
206 statusText: 'OK',
207 headers: responseData.headers
208 }));
209 }
210
211 /* harmony default export */ var preloading = (createPreloadingMiddleware);
212 //# sourceMappingURL=preloading.js.map
213 ;// CONCATENATED MODULE: ./packages/api-fetch/build-module/middlewares/fetch-all-middleware.js
214 /**
215 * WordPress dependencies
216 */
217
218 /**
219 * Internal dependencies
220 */
221
222
223 /**
224 * Apply query arguments to both URL and Path, whichever is present.
225 *
226 * @param {import('../types').APIFetchOptions} props
227 * @param {Record<string, string | number>} queryArgs
228 * @return {import('../types').APIFetchOptions} The request with the modified query args
229 */
230
231 const modifyQuery = (_ref, queryArgs) => {
232 let {
233 path,
234 url,
235 ...options
236 } = _ref;
237 return { ...options,
238 url: url && (0,external_wp_url_namespaceObject.addQueryArgs)(url, queryArgs),
239 path: path && (0,external_wp_url_namespaceObject.addQueryArgs)(path, queryArgs)
240 };
241 };
242 /**
243 * Duplicates parsing functionality from apiFetch.
244 *
245 * @param {Response} response
246 * @return {Promise<any>} Parsed response json.
247 */
248
249
250 const parseResponse = response => response.json ? response.json() : Promise.reject(response);
251 /**
252 * @param {string | null} linkHeader
253 * @return {{ next?: string }} The parsed link header.
254 */
255
256
257 const parseLinkHeader = linkHeader => {
258 if (!linkHeader) {
259 return {};
260 }
261
262 const match = linkHeader.match(/<([^>]+)>; rel="next"/);
263 return match ? {
264 next: match[1]
265 } : {};
266 };
267 /**
268 * @param {Response} response
269 * @return {string | undefined} The next page URL.
270 */
271
272
273 const getNextPageUrl = response => {
274 const {
275 next
276 } = parseLinkHeader(response.headers.get('link'));
277 return next;
278 };
279 /**
280 * @param {import('../types').APIFetchOptions} options
281 * @return {boolean} True if the request contains an unbounded query.
282 */
283
284
285 const requestContainsUnboundedQuery = options => {
286 const pathIsUnbounded = !!options.path && options.path.indexOf('per_page=-1') !== -1;
287 const urlIsUnbounded = !!options.url && options.url.indexOf('per_page=-1') !== -1;
288 return pathIsUnbounded || urlIsUnbounded;
289 };
290 /**
291 * The REST API enforces an upper limit on the per_page option. To handle large
292 * collections, apiFetch consumers can pass `per_page=-1`; this middleware will
293 * then recursively assemble a full response array from all available pages.
294 *
295 * @type {import('../types').APIFetchMiddleware}
296 */
297
298
299 const fetchAllMiddleware = async (options, next) => {
300 if (options.parse === false) {
301 // If a consumer has opted out of parsing, do not apply middleware.
302 return next(options);
303 }
304
305 if (!requestContainsUnboundedQuery(options)) {
306 // If neither url nor path is requesting all items, do not apply middleware.
307 return next(options);
308 } // Retrieve requested page of results.
309
310
311 const response = await build_module({ ...modifyQuery(options, {
312 per_page: 100
313 }),
314 // Ensure headers are returned for page 1.
315 parse: false
316 });
317 const results = await parseResponse(response);
318
319 if (!Array.isArray(results)) {
320 // We have no reliable way of merging non-array results.
321 return results;
322 }
323
324 let nextPage = getNextPageUrl(response);
325
326 if (!nextPage) {
327 // There are no further pages to request.
328 return results;
329 } // Iteratively fetch all remaining pages until no "next" header is found.
330
331
332 let mergedResults =
333 /** @type {any[]} */
334 [].concat(results);
335
336 while (nextPage) {
337 const nextResponse = await build_module({ ...options,
338 // Ensure the URL for the next page is used instead of any provided path.
339 path: undefined,
340 url: nextPage,
341 // Ensure we still get headers so we can identify the next page.
342 parse: false
343 });
344 const nextResults = await parseResponse(nextResponse);
345 mergedResults = mergedResults.concat(nextResults);
346 nextPage = getNextPageUrl(nextResponse);
347 }
348
349 return mergedResults;
350 };
351
352 /* harmony default export */ var fetch_all_middleware = (fetchAllMiddleware);
353 //# sourceMappingURL=fetch-all-middleware.js.map
354 ;// CONCATENATED MODULE: ./packages/api-fetch/build-module/middlewares/http-v1.js
355 /**
356 * Set of HTTP methods which are eligible to be overridden.
357 *
358 * @type {Set<string>}
359 */
360 const OVERRIDE_METHODS = new Set(['PATCH', 'PUT', 'DELETE']);
361 /**
362 * Default request method.
363 *
364 * "A request has an associated method (a method). Unless stated otherwise it
365 * is `GET`."
366 *
367 * @see https://fetch.spec.whatwg.org/#requests
368 *
369 * @type {string}
370 */
371
372 const DEFAULT_METHOD = 'GET';
373 /**
374 * API Fetch middleware which overrides the request method for HTTP v1
375 * compatibility leveraging the REST API X-HTTP-Method-Override header.
376 *
377 * @type {import('../types').APIFetchMiddleware}
378 */
379
380 const httpV1Middleware = (options, next) => {
381 const {
382 method = DEFAULT_METHOD
383 } = options;
384
385 if (OVERRIDE_METHODS.has(method.toUpperCase())) {
386 options = { ...options,
387 headers: { ...options.headers,
388 'X-HTTP-Method-Override': method,
389 'Content-Type': 'application/json'
390 },
391 method: 'POST'
392 };
393 }
394
395 return next(options);
396 };
397
398 /* harmony default export */ var http_v1 = (httpV1Middleware);
399 //# sourceMappingURL=http-v1.js.map
400 ;// CONCATENATED MODULE: ./packages/api-fetch/build-module/middlewares/user-locale.js
401 /**
402 * WordPress dependencies
403 */
404
405 /**
406 * @type {import('../types').APIFetchMiddleware}
407 */
408
409 const userLocaleMiddleware = (options, next) => {
410 if (typeof options.url === 'string' && !(0,external_wp_url_namespaceObject.hasQueryArg)(options.url, '_locale')) {
411 options.url = (0,external_wp_url_namespaceObject.addQueryArgs)(options.url, {
412 _locale: 'user'
413 });
414 }
415
416 if (typeof options.path === 'string' && !(0,external_wp_url_namespaceObject.hasQueryArg)(options.path, '_locale')) {
417 options.path = (0,external_wp_url_namespaceObject.addQueryArgs)(options.path, {
418 _locale: 'user'
419 });
420 }
421
422 return next(options);
423 };
424
425 /* harmony default export */ var user_locale = (userLocaleMiddleware);
426 //# sourceMappingURL=user-locale.js.map
427 ;// CONCATENATED MODULE: ./packages/api-fetch/build-module/utils/response.js
428 /**
429 * WordPress dependencies
430 */
431
432 /**
433 * Parses the apiFetch response.
434 *
435 * @param {Response} response
436 * @param {boolean} shouldParseResponse
437 *
438 * @return {Promise<any> | null | Response} Parsed response.
439 */
440
441 const response_parseResponse = function (response) {
442 let shouldParseResponse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
443
444 if (shouldParseResponse) {
445 if (response.status === 204) {
446 return null;
447 }
448
449 return response.json ? response.json() : Promise.reject(response);
450 }
451
452 return response;
453 };
454 /**
455 * Calls the `json` function on the Response, throwing an error if the response
456 * doesn't have a json function or if parsing the json itself fails.
457 *
458 * @param {Response} response
459 * @return {Promise<any>} Parsed response.
460 */
461
462
463 const parseJsonAndNormalizeError = response => {
464 const invalidJsonError = {
465 code: 'invalid_json',
466 message: (0,external_wp_i18n_namespaceObject.__)('The response is not a valid JSON response.')
467 };
468
469 if (!response || !response.json) {
470 throw invalidJsonError;
471 }
472
473 return response.json().catch(() => {
474 throw invalidJsonError;
475 });
476 };
477 /**
478 * Parses the apiFetch response properly and normalize response errors.
479 *
480 * @param {Response} response
481 * @param {boolean} shouldParseResponse
482 *
483 * @return {Promise<any>} Parsed response.
484 */
485
486
487 const parseResponseAndNormalizeError = function (response) {
488 let shouldParseResponse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
489 return Promise.resolve(response_parseResponse(response, shouldParseResponse)).catch(res => parseAndThrowError(res, shouldParseResponse));
490 };
491 /**
492 * Parses a response, throwing an error if parsing the response fails.
493 *
494 * @param {Response} response
495 * @param {boolean} shouldParseResponse
496 * @return {Promise<any>} Parsed response.
497 */
498
499 function parseAndThrowError(response) {
500 let shouldParseResponse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
501
502 if (!shouldParseResponse) {
503 throw response;
504 }
505
506 return parseJsonAndNormalizeError(response).then(error => {
507 const unknownError = {
508 code: 'unknown_error',
509 message: (0,external_wp_i18n_namespaceObject.__)('An unknown error occurred.')
510 };
511 throw error || unknownError;
512 });
513 }
514 //# sourceMappingURL=response.js.map
515 ;// CONCATENATED MODULE: ./packages/api-fetch/build-module/middlewares/media-upload.js
516 /**
517 * WordPress dependencies
518 */
519
520 /**
521 * Internal dependencies
522 */
523
524
525 /**
526 * @param {import('../types').APIFetchOptions} options
527 * @return {boolean} True if the request is for media upload.
528 */
529
530 function isMediaUploadRequest(options) {
531 const isCreateMethod = !!options.method && options.method === 'POST';
532 const isMediaEndpoint = !!options.path && options.path.indexOf('/wp/v2/media') !== -1 || !!options.url && options.url.indexOf('/wp/v2/media') !== -1;
533 return isMediaEndpoint && isCreateMethod;
534 }
535 /**
536 * Middleware handling media upload failures and retries.
537 *
538 * @type {import('../types').APIFetchMiddleware}
539 */
540
541
542 const mediaUploadMiddleware = (options, next) => {
543 if (!isMediaUploadRequest(options)) {
544 return next(options);
545 }
546
547 let retries = 0;
548 const maxRetries = 5;
549 /**
550 * @param {string} attachmentId
551 * @return {Promise<any>} Processed post response.
552 */
553
554 const postProcess = attachmentId => {
555 retries++;
556 return next({
557 path: `/wp/v2/media/${attachmentId}/post-process`,
558 method: 'POST',
559 data: {
560 action: 'create-image-subsizes'
561 },
562 parse: false
563 }).catch(() => {
564 if (retries < maxRetries) {
565 return postProcess(attachmentId);
566 }
567
568 next({
569 path: `/wp/v2/media/${attachmentId}?force=true`,
570 method: 'DELETE'
571 });
572 return Promise.reject();
573 });
574 };
575
576 return next({ ...options,
577 parse: false
578 }).catch(response => {
579 const attachmentId = response.headers.get('x-wp-upload-attachment-id');
580
581 if (response.status >= 500 && response.status < 600 && attachmentId) {
582 return postProcess(attachmentId).catch(() => {
583 if (options.parse !== false) {
584 return Promise.reject({
585 code: 'post_process',
586 message: (0,external_wp_i18n_namespaceObject.__)('Media upload failed. If this is a photo or a large image, please scale it down and try again.')
587 });
588 }
589
590 return Promise.reject(response);
591 });
592 }
593
594 return parseAndThrowError(response, options.parse);
595 }).then(response => parseResponseAndNormalizeError(response, options.parse));
596 };
597
598 /* harmony default export */ var media_upload = (mediaUploadMiddleware);
599 //# sourceMappingURL=media-upload.js.map
600 ;// CONCATENATED MODULE: ./packages/api-fetch/build-module/index.js
601 /**
602 * WordPress dependencies
603 */
604
605 /**
606 * Internal dependencies
607 */
608
609
610
611
612
613
614
615
616
617
618 /**
619 * Default set of header values which should be sent with every request unless
620 * explicitly provided through apiFetch options.
621 *
622 * @type {Record<string, string>}
623 */
624
625 const DEFAULT_HEADERS = {
626 // The backend uses the Accept header as a condition for considering an
627 // incoming request as a REST request.
628 //
629 // See: https://core.trac.wordpress.org/ticket/44534
630 Accept: 'application/json, */*;q=0.1'
631 };
632 /**
633 * Default set of fetch option values which should be sent with every request
634 * unless explicitly provided through apiFetch options.
635 *
636 * @type {Object}
637 */
638
639 const DEFAULT_OPTIONS = {
640 credentials: 'include'
641 };
642 /** @typedef {import('./types').APIFetchMiddleware} APIFetchMiddleware */
643
644 /** @typedef {import('./types').APIFetchOptions} APIFetchOptions */
645
646 /**
647 * @type {import('./types').APIFetchMiddleware[]}
648 */
649
650 const middlewares = [user_locale, namespace_endpoint, http_v1, fetch_all_middleware];
651 /**
652 * Register a middleware
653 *
654 * @param {import('./types').APIFetchMiddleware} middleware
655 */
656
657 function registerMiddleware(middleware) {
658 middlewares.unshift(middleware);
659 }
660 /**
661 * Checks the status of a response, throwing the Response as an error if
662 * it is outside the 200 range.
663 *
664 * @param {Response} response
665 * @return {Response} The response if the status is in the 200 range.
666 */
667
668
669 const checkStatus = response => {
670 if (response.status >= 200 && response.status < 300) {
671 return response;
672 }
673
674 throw response;
675 };
676 /** @typedef {(options: import('./types').APIFetchOptions) => Promise<any>} FetchHandler*/
677
678 /**
679 * @type {FetchHandler}
680 */
681
682
683 const defaultFetchHandler = nextOptions => {
684 const {
685 url,
686 path,
687 data,
688 parse = true,
689 ...remainingOptions
690 } = nextOptions;
691 let {
692 body,
693 headers
694 } = nextOptions; // Merge explicitly-provided headers with default values.
695
696 headers = { ...DEFAULT_HEADERS,
697 ...headers
698 }; // The `data` property is a shorthand for sending a JSON body.
699
700 if (data) {
701 body = JSON.stringify(data);
702 headers['Content-Type'] = 'application/json';
703 }
704
705 const responsePromise = window.fetch( // fall back to explicitly passing `window.location` which is the behavior if `undefined` is passed
706 url || path || window.location.href, { ...DEFAULT_OPTIONS,
707 ...remainingOptions,
708 body,
709 headers
710 });
711 return responsePromise.then(value => Promise.resolve(value).then(checkStatus).catch(response => parseAndThrowError(response, parse)).then(response => parseResponseAndNormalizeError(response, parse)), err => {
712 // Re-throw AbortError for the users to handle it themselves.
713 if (err && err.name === 'AbortError') {
714 throw err;
715 } // Otherwise, there is most likely no network connection.
716 // Unfortunately the message might depend on the browser.
717
718
719 throw {
720 code: 'fetch_error',
721 message: (0,external_wp_i18n_namespaceObject.__)('You are probably offline.')
722 };
723 });
724 };
725 /** @type {FetchHandler} */
726
727
728 let fetchHandler = defaultFetchHandler;
729 /**
730 * Defines a custom fetch handler for making the requests that will override
731 * the default one using window.fetch
732 *
733 * @param {FetchHandler} newFetchHandler The new fetch handler
734 */
735
736 function setFetchHandler(newFetchHandler) {
737 fetchHandler = newFetchHandler;
738 }
739 /**
740 * @template T
741 * @param {import('./types').APIFetchOptions} options
742 * @return {Promise<T>} A promise representing the request processed via the registered middlewares.
743 */
744
745
746 function apiFetch(options) {
747 // creates a nested function chain that calls all middlewares and finally the `fetchHandler`,
748 // converting `middlewares = [ m1, m2, m3 ]` into:
749 // ```
750 // opts1 => m1( opts1, opts2 => m2( opts2, opts3 => m3( opts3, fetchHandler ) ) );
751 // ```
752 const enhancedHandler = middlewares.reduceRight((
753 /** @type {FetchHandler} */
754 next, middleware) => {
755 return workingOptions => middleware(workingOptions, next);
756 }, fetchHandler);
757 return enhancedHandler(options).catch(error => {
758 if (error.code !== 'rest_cookie_invalid_nonce') {
759 return Promise.reject(error);
760 } // If the nonce is invalid, refresh it and try again.
761
762
763 return window // @ts-ignore
764 .fetch(apiFetch.nonceEndpoint).then(checkStatus).then(data => data.text()).then(text => {
765 // @ts-ignore
766 apiFetch.nonceMiddleware.nonce = text;
767 return apiFetch(options);
768 });
769 });
770 }
771
772 apiFetch.use = registerMiddleware;
773 apiFetch.setFetchHandler = setFetchHandler;
774 apiFetch.createNonceMiddleware = nonce;
775 apiFetch.createPreloadingMiddleware = preloading;
776 apiFetch.createRootURLMiddleware = root_url;
777 apiFetch.fetchAllMiddleware = fetch_all_middleware;
778 apiFetch.mediaUploadMiddleware = media_upload;
779 /* harmony default export */ var build_module = (apiFetch);
780 //# sourceMappingURL=index.js.map
781 (window.wp = window.wp || {}).apiFetch = __webpack_exports__["default"];
782 /******/ })()
783 ;