UNPKG

437 kBJavaScriptView Raw
1(function webpackUniversalModuleDefinition(root, factory) {
2 if(typeof exports === 'object' && typeof module === 'object')
3 module.exports = factory();
4 else if(typeof define === 'function' && define.amd)
5 define([], factory);
6 else if(typeof exports === 'object')
7 exports["contentfulManagement"] = factory();
8 else
9 root["contentfulManagement"] = factory();
10})(window, function() {
11return /******/ (function(modules) { // webpackBootstrap
12/******/ // The module cache
13/******/ var installedModules = {};
14/******/
15/******/ // The require function
16/******/ function __webpack_require__(moduleId) {
17/******/
18/******/ // Check if module is in cache
19/******/ if(installedModules[moduleId]) {
20/******/ return installedModules[moduleId].exports;
21/******/ }
22/******/ // Create a new module (and put it into the cache)
23/******/ var module = installedModules[moduleId] = {
24/******/ i: moduleId,
25/******/ l: false,
26/******/ exports: {}
27/******/ };
28/******/
29/******/ // Execute the module function
30/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
31/******/
32/******/ // Flag the module as loaded
33/******/ module.l = true;
34/******/
35/******/ // Return the exports of the module
36/******/ return module.exports;
37/******/ }
38/******/
39/******/
40/******/ // expose the modules object (__webpack_modules__)
41/******/ __webpack_require__.m = modules;
42/******/
43/******/ // expose the module cache
44/******/ __webpack_require__.c = installedModules;
45/******/
46/******/ // define getter function for harmony exports
47/******/ __webpack_require__.d = function(exports, name, getter) {
48/******/ if(!__webpack_require__.o(exports, name)) {
49/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
50/******/ }
51/******/ };
52/******/
53/******/ // define __esModule on exports
54/******/ __webpack_require__.r = function(exports) {
55/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
56/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
57/******/ }
58/******/ Object.defineProperty(exports, '__esModule', { value: true });
59/******/ };
60/******/
61/******/ // create a fake namespace object
62/******/ // mode & 1: value is a module id, require it
63/******/ // mode & 2: merge all properties of value into the ns
64/******/ // mode & 4: return value when already ns object
65/******/ // mode & 8|1: behave like require
66/******/ __webpack_require__.t = function(value, mode) {
67/******/ if(mode & 1) value = __webpack_require__(value);
68/******/ if(mode & 8) return value;
69/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
70/******/ var ns = Object.create(null);
71/******/ __webpack_require__.r(ns);
72/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
73/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
74/******/ return ns;
75/******/ };
76/******/
77/******/ // getDefaultExport function for compatibility with non-harmony modules
78/******/ __webpack_require__.n = function(module) {
79/******/ var getter = module && module.__esModule ?
80/******/ function getDefault() { return module['default']; } :
81/******/ function getModuleExports() { return module; };
82/******/ __webpack_require__.d(getter, 'a', getter);
83/******/ return getter;
84/******/ };
85/******/
86/******/ // Object.prototype.hasOwnProperty.call
87/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
88/******/
89/******/ // __webpack_public_path__
90/******/ __webpack_require__.p = "";
91/******/
92/******/
93/******/ // Load entry module and return exports
94/******/ return __webpack_require__(__webpack_require__.s = 0);
95/******/ })
96/************************************************************************/
97/******/ ({
98
99/***/ "../node_modules/axios/index.js":
100/*!**************************************!*\
101 !*** ../node_modules/axios/index.js ***!
102 \**************************************/
103/*! no static exports found */
104/***/ (function(module, exports, __webpack_require__) {
105
106module.exports = __webpack_require__(/*! ./lib/axios */ "../node_modules/axios/lib/axios.js");
107
108/***/ }),
109
110/***/ "../node_modules/axios/lib/adapters/xhr.js":
111/*!*************************************************!*\
112 !*** ../node_modules/axios/lib/adapters/xhr.js ***!
113 \*************************************************/
114/*! no static exports found */
115/***/ (function(module, exports, __webpack_require__) {
116
117"use strict";
118
119
120var utils = __webpack_require__(/*! ./../utils */ "../node_modules/axios/lib/utils.js");
121var settle = __webpack_require__(/*! ./../core/settle */ "../node_modules/axios/lib/core/settle.js");
122var buildURL = __webpack_require__(/*! ./../helpers/buildURL */ "../node_modules/axios/lib/helpers/buildURL.js");
123var buildFullPath = __webpack_require__(/*! ../core/buildFullPath */ "../node_modules/axios/lib/core/buildFullPath.js");
124var parseHeaders = __webpack_require__(/*! ./../helpers/parseHeaders */ "../node_modules/axios/lib/helpers/parseHeaders.js");
125var isURLSameOrigin = __webpack_require__(/*! ./../helpers/isURLSameOrigin */ "../node_modules/axios/lib/helpers/isURLSameOrigin.js");
126var createError = __webpack_require__(/*! ../core/createError */ "../node_modules/axios/lib/core/createError.js");
127
128module.exports = function xhrAdapter(config) {
129 return new Promise(function dispatchXhrRequest(resolve, reject) {
130 var requestData = config.data;
131 var requestHeaders = config.headers;
132
133 if (utils.isFormData(requestData)) {
134 delete requestHeaders['Content-Type']; // Let the browser set it
135 }
136
137 var request = new XMLHttpRequest();
138
139 // HTTP basic authentication
140 if (config.auth) {
141 var username = config.auth.username || '';
142 var password = config.auth.password || '';
143 requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
144 }
145
146 var fullPath = buildFullPath(config.baseURL, config.url);
147 request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
148
149 // Set the request timeout in MS
150 request.timeout = config.timeout;
151
152 // Listen for ready state
153 request.onreadystatechange = function handleLoad() {
154 if (!request || request.readyState !== 4) {
155 return;
156 }
157
158 // The request errored out and we didn't get a response, this will be
159 // handled by onerror instead
160 // With one exception: request that using file: protocol, most browsers
161 // will return status as 0 even though it's a successful request
162 if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
163 return;
164 }
165
166 // Prepare the response
167 var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;
168 var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;
169 var response = {
170 data: responseData,
171 status: request.status,
172 statusText: request.statusText,
173 headers: responseHeaders,
174 config: config,
175 request: request
176 };
177
178 settle(resolve, reject, response);
179
180 // Clean up request
181 request = null;
182 };
183
184 // Handle browser request cancellation (as opposed to a manual cancellation)
185 request.onabort = function handleAbort() {
186 if (!request) {
187 return;
188 }
189
190 reject(createError('Request aborted', config, 'ECONNABORTED', request));
191
192 // Clean up request
193 request = null;
194 };
195
196 // Handle low level network errors
197 request.onerror = function handleError() {
198 // Real errors are hidden from us by the browser
199 // onerror should only fire if it's a network error
200 reject(createError('Network Error', config, null, request));
201
202 // Clean up request
203 request = null;
204 };
205
206 // Handle timeout
207 request.ontimeout = function handleTimeout() {
208 var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';
209 if (config.timeoutErrorMessage) {
210 timeoutErrorMessage = config.timeoutErrorMessage;
211 }
212 reject(createError(timeoutErrorMessage, config, 'ECONNABORTED',
213 request));
214
215 // Clean up request
216 request = null;
217 };
218
219 // Add xsrf header
220 // This is only done if running in a standard browser environment.
221 // Specifically not if we're in a web worker, or react-native.
222 if (utils.isStandardBrowserEnv()) {
223 var cookies = __webpack_require__(/*! ./../helpers/cookies */ "../node_modules/axios/lib/helpers/cookies.js");
224
225 // Add xsrf header
226 var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?
227 cookies.read(config.xsrfCookieName) :
228 undefined;
229
230 if (xsrfValue) {
231 requestHeaders[config.xsrfHeaderName] = xsrfValue;
232 }
233 }
234
235 // Add headers to the request
236 if ('setRequestHeader' in request) {
237 utils.forEach(requestHeaders, function setRequestHeader(val, key) {
238 if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {
239 // Remove Content-Type if data is undefined
240 delete requestHeaders[key];
241 } else {
242 // Otherwise add header to the request
243 request.setRequestHeader(key, val);
244 }
245 });
246 }
247
248 // Add withCredentials to request if needed
249 if (!utils.isUndefined(config.withCredentials)) {
250 request.withCredentials = !!config.withCredentials;
251 }
252
253 // Add responseType to request if needed
254 if (config.responseType) {
255 try {
256 request.responseType = config.responseType;
257 } catch (e) {
258 // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.
259 // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.
260 if (config.responseType !== 'json') {
261 throw e;
262 }
263 }
264 }
265
266 // Handle progress if needed
267 if (typeof config.onDownloadProgress === 'function') {
268 request.addEventListener('progress', config.onDownloadProgress);
269 }
270
271 // Not all browsers support upload events
272 if (typeof config.onUploadProgress === 'function' && request.upload) {
273 request.upload.addEventListener('progress', config.onUploadProgress);
274 }
275
276 if (config.cancelToken) {
277 // Handle cancellation
278 config.cancelToken.promise.then(function onCanceled(cancel) {
279 if (!request) {
280 return;
281 }
282
283 request.abort();
284 reject(cancel);
285 // Clean up request
286 request = null;
287 });
288 }
289
290 if (requestData === undefined) {
291 requestData = null;
292 }
293
294 // Send the request
295 request.send(requestData);
296 });
297};
298
299
300/***/ }),
301
302/***/ "../node_modules/axios/lib/axios.js":
303/*!******************************************!*\
304 !*** ../node_modules/axios/lib/axios.js ***!
305 \******************************************/
306/*! no static exports found */
307/***/ (function(module, exports, __webpack_require__) {
308
309"use strict";
310
311
312var utils = __webpack_require__(/*! ./utils */ "../node_modules/axios/lib/utils.js");
313var bind = __webpack_require__(/*! ./helpers/bind */ "../node_modules/axios/lib/helpers/bind.js");
314var Axios = __webpack_require__(/*! ./core/Axios */ "../node_modules/axios/lib/core/Axios.js");
315var mergeConfig = __webpack_require__(/*! ./core/mergeConfig */ "../node_modules/axios/lib/core/mergeConfig.js");
316var defaults = __webpack_require__(/*! ./defaults */ "../node_modules/axios/lib/defaults.js");
317
318/**
319 * Create an instance of Axios
320 *
321 * @param {Object} defaultConfig The default config for the instance
322 * @return {Axios} A new instance of Axios
323 */
324function createInstance(defaultConfig) {
325 var context = new Axios(defaultConfig);
326 var instance = bind(Axios.prototype.request, context);
327
328 // Copy axios.prototype to instance
329 utils.extend(instance, Axios.prototype, context);
330
331 // Copy context to instance
332 utils.extend(instance, context);
333
334 return instance;
335}
336
337// Create the default instance to be exported
338var axios = createInstance(defaults);
339
340// Expose Axios class to allow class inheritance
341axios.Axios = Axios;
342
343// Factory for creating new instances
344axios.create = function create(instanceConfig) {
345 return createInstance(mergeConfig(axios.defaults, instanceConfig));
346};
347
348// Expose Cancel & CancelToken
349axios.Cancel = __webpack_require__(/*! ./cancel/Cancel */ "../node_modules/axios/lib/cancel/Cancel.js");
350axios.CancelToken = __webpack_require__(/*! ./cancel/CancelToken */ "../node_modules/axios/lib/cancel/CancelToken.js");
351axios.isCancel = __webpack_require__(/*! ./cancel/isCancel */ "../node_modules/axios/lib/cancel/isCancel.js");
352
353// Expose all/spread
354axios.all = function all(promises) {
355 return Promise.all(promises);
356};
357axios.spread = __webpack_require__(/*! ./helpers/spread */ "../node_modules/axios/lib/helpers/spread.js");
358
359module.exports = axios;
360
361// Allow use of default import syntax in TypeScript
362module.exports.default = axios;
363
364
365/***/ }),
366
367/***/ "../node_modules/axios/lib/cancel/Cancel.js":
368/*!**************************************************!*\
369 !*** ../node_modules/axios/lib/cancel/Cancel.js ***!
370 \**************************************************/
371/*! no static exports found */
372/***/ (function(module, exports, __webpack_require__) {
373
374"use strict";
375
376
377/**
378 * A `Cancel` is an object that is thrown when an operation is canceled.
379 *
380 * @class
381 * @param {string=} message The message.
382 */
383function Cancel(message) {
384 this.message = message;
385}
386
387Cancel.prototype.toString = function toString() {
388 return 'Cancel' + (this.message ? ': ' + this.message : '');
389};
390
391Cancel.prototype.__CANCEL__ = true;
392
393module.exports = Cancel;
394
395
396/***/ }),
397
398/***/ "../node_modules/axios/lib/cancel/CancelToken.js":
399/*!*******************************************************!*\
400 !*** ../node_modules/axios/lib/cancel/CancelToken.js ***!
401 \*******************************************************/
402/*! no static exports found */
403/***/ (function(module, exports, __webpack_require__) {
404
405"use strict";
406
407
408var Cancel = __webpack_require__(/*! ./Cancel */ "../node_modules/axios/lib/cancel/Cancel.js");
409
410/**
411 * A `CancelToken` is an object that can be used to request cancellation of an operation.
412 *
413 * @class
414 * @param {Function} executor The executor function.
415 */
416function CancelToken(executor) {
417 if (typeof executor !== 'function') {
418 throw new TypeError('executor must be a function.');
419 }
420
421 var resolvePromise;
422 this.promise = new Promise(function promiseExecutor(resolve) {
423 resolvePromise = resolve;
424 });
425
426 var token = this;
427 executor(function cancel(message) {
428 if (token.reason) {
429 // Cancellation has already been requested
430 return;
431 }
432
433 token.reason = new Cancel(message);
434 resolvePromise(token.reason);
435 });
436}
437
438/**
439 * Throws a `Cancel` if cancellation has been requested.
440 */
441CancelToken.prototype.throwIfRequested = function throwIfRequested() {
442 if (this.reason) {
443 throw this.reason;
444 }
445};
446
447/**
448 * Returns an object that contains a new `CancelToken` and a function that, when called,
449 * cancels the `CancelToken`.
450 */
451CancelToken.source = function source() {
452 var cancel;
453 var token = new CancelToken(function executor(c) {
454 cancel = c;
455 });
456 return {
457 token: token,
458 cancel: cancel
459 };
460};
461
462module.exports = CancelToken;
463
464
465/***/ }),
466
467/***/ "../node_modules/axios/lib/cancel/isCancel.js":
468/*!****************************************************!*\
469 !*** ../node_modules/axios/lib/cancel/isCancel.js ***!
470 \****************************************************/
471/*! no static exports found */
472/***/ (function(module, exports, __webpack_require__) {
473
474"use strict";
475
476
477module.exports = function isCancel(value) {
478 return !!(value && value.__CANCEL__);
479};
480
481
482/***/ }),
483
484/***/ "../node_modules/axios/lib/core/Axios.js":
485/*!***********************************************!*\
486 !*** ../node_modules/axios/lib/core/Axios.js ***!
487 \***********************************************/
488/*! no static exports found */
489/***/ (function(module, exports, __webpack_require__) {
490
491"use strict";
492
493
494var utils = __webpack_require__(/*! ./../utils */ "../node_modules/axios/lib/utils.js");
495var buildURL = __webpack_require__(/*! ../helpers/buildURL */ "../node_modules/axios/lib/helpers/buildURL.js");
496var InterceptorManager = __webpack_require__(/*! ./InterceptorManager */ "../node_modules/axios/lib/core/InterceptorManager.js");
497var dispatchRequest = __webpack_require__(/*! ./dispatchRequest */ "../node_modules/axios/lib/core/dispatchRequest.js");
498var mergeConfig = __webpack_require__(/*! ./mergeConfig */ "../node_modules/axios/lib/core/mergeConfig.js");
499
500/**
501 * Create a new instance of Axios
502 *
503 * @param {Object} instanceConfig The default config for the instance
504 */
505function Axios(instanceConfig) {
506 this.defaults = instanceConfig;
507 this.interceptors = {
508 request: new InterceptorManager(),
509 response: new InterceptorManager()
510 };
511}
512
513/**
514 * Dispatch a request
515 *
516 * @param {Object} config The config specific for this request (merged with this.defaults)
517 */
518Axios.prototype.request = function request(config) {
519 /*eslint no-param-reassign:0*/
520 // Allow for axios('example/url'[, config]) a la fetch API
521 if (typeof config === 'string') {
522 config = arguments[1] || {};
523 config.url = arguments[0];
524 } else {
525 config = config || {};
526 }
527
528 config = mergeConfig(this.defaults, config);
529
530 // Set config.method
531 if (config.method) {
532 config.method = config.method.toLowerCase();
533 } else if (this.defaults.method) {
534 config.method = this.defaults.method.toLowerCase();
535 } else {
536 config.method = 'get';
537 }
538
539 // Hook up interceptors middleware
540 var chain = [dispatchRequest, undefined];
541 var promise = Promise.resolve(config);
542
543 this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
544 chain.unshift(interceptor.fulfilled, interceptor.rejected);
545 });
546
547 this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
548 chain.push(interceptor.fulfilled, interceptor.rejected);
549 });
550
551 while (chain.length) {
552 promise = promise.then(chain.shift(), chain.shift());
553 }
554
555 return promise;
556};
557
558Axios.prototype.getUri = function getUri(config) {
559 config = mergeConfig(this.defaults, config);
560 return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, '');
561};
562
563// Provide aliases for supported request methods
564utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
565 /*eslint func-names:0*/
566 Axios.prototype[method] = function(url, config) {
567 return this.request(utils.merge(config || {}, {
568 method: method,
569 url: url
570 }));
571 };
572});
573
574utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
575 /*eslint func-names:0*/
576 Axios.prototype[method] = function(url, data, config) {
577 return this.request(utils.merge(config || {}, {
578 method: method,
579 url: url,
580 data: data
581 }));
582 };
583});
584
585module.exports = Axios;
586
587
588/***/ }),
589
590/***/ "../node_modules/axios/lib/core/InterceptorManager.js":
591/*!************************************************************!*\
592 !*** ../node_modules/axios/lib/core/InterceptorManager.js ***!
593 \************************************************************/
594/*! no static exports found */
595/***/ (function(module, exports, __webpack_require__) {
596
597"use strict";
598
599
600var utils = __webpack_require__(/*! ./../utils */ "../node_modules/axios/lib/utils.js");
601
602function InterceptorManager() {
603 this.handlers = [];
604}
605
606/**
607 * Add a new interceptor to the stack
608 *
609 * @param {Function} fulfilled The function to handle `then` for a `Promise`
610 * @param {Function} rejected The function to handle `reject` for a `Promise`
611 *
612 * @return {Number} An ID used to remove interceptor later
613 */
614InterceptorManager.prototype.use = function use(fulfilled, rejected) {
615 this.handlers.push({
616 fulfilled: fulfilled,
617 rejected: rejected
618 });
619 return this.handlers.length - 1;
620};
621
622/**
623 * Remove an interceptor from the stack
624 *
625 * @param {Number} id The ID that was returned by `use`
626 */
627InterceptorManager.prototype.eject = function eject(id) {
628 if (this.handlers[id]) {
629 this.handlers[id] = null;
630 }
631};
632
633/**
634 * Iterate over all the registered interceptors
635 *
636 * This method is particularly useful for skipping over any
637 * interceptors that may have become `null` calling `eject`.
638 *
639 * @param {Function} fn The function to call for each interceptor
640 */
641InterceptorManager.prototype.forEach = function forEach(fn) {
642 utils.forEach(this.handlers, function forEachHandler(h) {
643 if (h !== null) {
644 fn(h);
645 }
646 });
647};
648
649module.exports = InterceptorManager;
650
651
652/***/ }),
653
654/***/ "../node_modules/axios/lib/core/buildFullPath.js":
655/*!*******************************************************!*\
656 !*** ../node_modules/axios/lib/core/buildFullPath.js ***!
657 \*******************************************************/
658/*! no static exports found */
659/***/ (function(module, exports, __webpack_require__) {
660
661"use strict";
662
663
664var isAbsoluteURL = __webpack_require__(/*! ../helpers/isAbsoluteURL */ "../node_modules/axios/lib/helpers/isAbsoluteURL.js");
665var combineURLs = __webpack_require__(/*! ../helpers/combineURLs */ "../node_modules/axios/lib/helpers/combineURLs.js");
666
667/**
668 * Creates a new URL by combining the baseURL with the requestedURL,
669 * only when the requestedURL is not already an absolute URL.
670 * If the requestURL is absolute, this function returns the requestedURL untouched.
671 *
672 * @param {string} baseURL The base URL
673 * @param {string} requestedURL Absolute or relative URL to combine
674 * @returns {string} The combined full path
675 */
676module.exports = function buildFullPath(baseURL, requestedURL) {
677 if (baseURL && !isAbsoluteURL(requestedURL)) {
678 return combineURLs(baseURL, requestedURL);
679 }
680 return requestedURL;
681};
682
683
684/***/ }),
685
686/***/ "../node_modules/axios/lib/core/createError.js":
687/*!*****************************************************!*\
688 !*** ../node_modules/axios/lib/core/createError.js ***!
689 \*****************************************************/
690/*! no static exports found */
691/***/ (function(module, exports, __webpack_require__) {
692
693"use strict";
694
695
696var enhanceError = __webpack_require__(/*! ./enhanceError */ "../node_modules/axios/lib/core/enhanceError.js");
697
698/**
699 * Create an Error with the specified message, config, error code, request and response.
700 *
701 * @param {string} message The error message.
702 * @param {Object} config The config.
703 * @param {string} [code] The error code (for example, 'ECONNABORTED').
704 * @param {Object} [request] The request.
705 * @param {Object} [response] The response.
706 * @returns {Error} The created error.
707 */
708module.exports = function createError(message, config, code, request, response) {
709 var error = new Error(message);
710 return enhanceError(error, config, code, request, response);
711};
712
713
714/***/ }),
715
716/***/ "../node_modules/axios/lib/core/dispatchRequest.js":
717/*!*********************************************************!*\
718 !*** ../node_modules/axios/lib/core/dispatchRequest.js ***!
719 \*********************************************************/
720/*! no static exports found */
721/***/ (function(module, exports, __webpack_require__) {
722
723"use strict";
724
725
726var utils = __webpack_require__(/*! ./../utils */ "../node_modules/axios/lib/utils.js");
727var transformData = __webpack_require__(/*! ./transformData */ "../node_modules/axios/lib/core/transformData.js");
728var isCancel = __webpack_require__(/*! ../cancel/isCancel */ "../node_modules/axios/lib/cancel/isCancel.js");
729var defaults = __webpack_require__(/*! ../defaults */ "../node_modules/axios/lib/defaults.js");
730
731/**
732 * Throws a `Cancel` if cancellation has been requested.
733 */
734function throwIfCancellationRequested(config) {
735 if (config.cancelToken) {
736 config.cancelToken.throwIfRequested();
737 }
738}
739
740/**
741 * Dispatch a request to the server using the configured adapter.
742 *
743 * @param {object} config The config that is to be used for the request
744 * @returns {Promise} The Promise to be fulfilled
745 */
746module.exports = function dispatchRequest(config) {
747 throwIfCancellationRequested(config);
748
749 // Ensure headers exist
750 config.headers = config.headers || {};
751
752 // Transform request data
753 config.data = transformData(
754 config.data,
755 config.headers,
756 config.transformRequest
757 );
758
759 // Flatten headers
760 config.headers = utils.merge(
761 config.headers.common || {},
762 config.headers[config.method] || {},
763 config.headers
764 );
765
766 utils.forEach(
767 ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
768 function cleanHeaderConfig(method) {
769 delete config.headers[method];
770 }
771 );
772
773 var adapter = config.adapter || defaults.adapter;
774
775 return adapter(config).then(function onAdapterResolution(response) {
776 throwIfCancellationRequested(config);
777
778 // Transform response data
779 response.data = transformData(
780 response.data,
781 response.headers,
782 config.transformResponse
783 );
784
785 return response;
786 }, function onAdapterRejection(reason) {
787 if (!isCancel(reason)) {
788 throwIfCancellationRequested(config);
789
790 // Transform response data
791 if (reason && reason.response) {
792 reason.response.data = transformData(
793 reason.response.data,
794 reason.response.headers,
795 config.transformResponse
796 );
797 }
798 }
799
800 return Promise.reject(reason);
801 });
802};
803
804
805/***/ }),
806
807/***/ "../node_modules/axios/lib/core/enhanceError.js":
808/*!******************************************************!*\
809 !*** ../node_modules/axios/lib/core/enhanceError.js ***!
810 \******************************************************/
811/*! no static exports found */
812/***/ (function(module, exports, __webpack_require__) {
813
814"use strict";
815
816
817/**
818 * Update an Error with the specified config, error code, and response.
819 *
820 * @param {Error} error The error to update.
821 * @param {Object} config The config.
822 * @param {string} [code] The error code (for example, 'ECONNABORTED').
823 * @param {Object} [request] The request.
824 * @param {Object} [response] The response.
825 * @returns {Error} The error.
826 */
827module.exports = function enhanceError(error, config, code, request, response) {
828 error.config = config;
829 if (code) {
830 error.code = code;
831 }
832
833 error.request = request;
834 error.response = response;
835 error.isAxiosError = true;
836
837 error.toJSON = function() {
838 return {
839 // Standard
840 message: this.message,
841 name: this.name,
842 // Microsoft
843 description: this.description,
844 number: this.number,
845 // Mozilla
846 fileName: this.fileName,
847 lineNumber: this.lineNumber,
848 columnNumber: this.columnNumber,
849 stack: this.stack,
850 // Axios
851 config: this.config,
852 code: this.code
853 };
854 };
855 return error;
856};
857
858
859/***/ }),
860
861/***/ "../node_modules/axios/lib/core/mergeConfig.js":
862/*!*****************************************************!*\
863 !*** ../node_modules/axios/lib/core/mergeConfig.js ***!
864 \*****************************************************/
865/*! no static exports found */
866/***/ (function(module, exports, __webpack_require__) {
867
868"use strict";
869
870
871var utils = __webpack_require__(/*! ../utils */ "../node_modules/axios/lib/utils.js");
872
873/**
874 * Config-specific merge-function which creates a new config-object
875 * by merging two configuration objects together.
876 *
877 * @param {Object} config1
878 * @param {Object} config2
879 * @returns {Object} New object resulting from merging config2 to config1
880 */
881module.exports = function mergeConfig(config1, config2) {
882 // eslint-disable-next-line no-param-reassign
883 config2 = config2 || {};
884 var config = {};
885
886 var valueFromConfig2Keys = ['url', 'method', 'params', 'data'];
887 var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy'];
888 var defaultToConfig2Keys = [
889 'baseURL', 'url', 'transformRequest', 'transformResponse', 'paramsSerializer',
890 'timeout', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',
891 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress',
892 'maxContentLength', 'validateStatus', 'maxRedirects', 'httpAgent',
893 'httpsAgent', 'cancelToken', 'socketPath'
894 ];
895
896 utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {
897 if (typeof config2[prop] !== 'undefined') {
898 config[prop] = config2[prop];
899 }
900 });
901
902 utils.forEach(mergeDeepPropertiesKeys, function mergeDeepProperties(prop) {
903 if (utils.isObject(config2[prop])) {
904 config[prop] = utils.deepMerge(config1[prop], config2[prop]);
905 } else if (typeof config2[prop] !== 'undefined') {
906 config[prop] = config2[prop];
907 } else if (utils.isObject(config1[prop])) {
908 config[prop] = utils.deepMerge(config1[prop]);
909 } else if (typeof config1[prop] !== 'undefined') {
910 config[prop] = config1[prop];
911 }
912 });
913
914 utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {
915 if (typeof config2[prop] !== 'undefined') {
916 config[prop] = config2[prop];
917 } else if (typeof config1[prop] !== 'undefined') {
918 config[prop] = config1[prop];
919 }
920 });
921
922 var axiosKeys = valueFromConfig2Keys
923 .concat(mergeDeepPropertiesKeys)
924 .concat(defaultToConfig2Keys);
925
926 var otherKeys = Object
927 .keys(config2)
928 .filter(function filterAxiosKeys(key) {
929 return axiosKeys.indexOf(key) === -1;
930 });
931
932 utils.forEach(otherKeys, function otherKeysDefaultToConfig2(prop) {
933 if (typeof config2[prop] !== 'undefined') {
934 config[prop] = config2[prop];
935 } else if (typeof config1[prop] !== 'undefined') {
936 config[prop] = config1[prop];
937 }
938 });
939
940 return config;
941};
942
943
944/***/ }),
945
946/***/ "../node_modules/axios/lib/core/settle.js":
947/*!************************************************!*\
948 !*** ../node_modules/axios/lib/core/settle.js ***!
949 \************************************************/
950/*! no static exports found */
951/***/ (function(module, exports, __webpack_require__) {
952
953"use strict";
954
955
956var createError = __webpack_require__(/*! ./createError */ "../node_modules/axios/lib/core/createError.js");
957
958/**
959 * Resolve or reject a Promise based on response status.
960 *
961 * @param {Function} resolve A function that resolves the promise.
962 * @param {Function} reject A function that rejects the promise.
963 * @param {object} response The response.
964 */
965module.exports = function settle(resolve, reject, response) {
966 var validateStatus = response.config.validateStatus;
967 if (!validateStatus || validateStatus(response.status)) {
968 resolve(response);
969 } else {
970 reject(createError(
971 'Request failed with status code ' + response.status,
972 response.config,
973 null,
974 response.request,
975 response
976 ));
977 }
978};
979
980
981/***/ }),
982
983/***/ "../node_modules/axios/lib/core/transformData.js":
984/*!*******************************************************!*\
985 !*** ../node_modules/axios/lib/core/transformData.js ***!
986 \*******************************************************/
987/*! no static exports found */
988/***/ (function(module, exports, __webpack_require__) {
989
990"use strict";
991
992
993var utils = __webpack_require__(/*! ./../utils */ "../node_modules/axios/lib/utils.js");
994
995/**
996 * Transform the data for a request or a response
997 *
998 * @param {Object|String} data The data to be transformed
999 * @param {Array} headers The headers for the request or response
1000 * @param {Array|Function} fns A single function or Array of functions
1001 * @returns {*} The resulting transformed data
1002 */
1003module.exports = function transformData(data, headers, fns) {
1004 /*eslint no-param-reassign:0*/
1005 utils.forEach(fns, function transform(fn) {
1006 data = fn(data, headers);
1007 });
1008
1009 return data;
1010};
1011
1012
1013/***/ }),
1014
1015/***/ "../node_modules/axios/lib/defaults.js":
1016/*!*********************************************!*\
1017 !*** ../node_modules/axios/lib/defaults.js ***!
1018 \*********************************************/
1019/*! no static exports found */
1020/***/ (function(module, exports, __webpack_require__) {
1021
1022"use strict";
1023/* WEBPACK VAR INJECTION */(function(process) {
1024
1025var utils = __webpack_require__(/*! ./utils */ "../node_modules/axios/lib/utils.js");
1026var normalizeHeaderName = __webpack_require__(/*! ./helpers/normalizeHeaderName */ "../node_modules/axios/lib/helpers/normalizeHeaderName.js");
1027
1028var DEFAULT_CONTENT_TYPE = {
1029 'Content-Type': 'application/x-www-form-urlencoded'
1030};
1031
1032function setContentTypeIfUnset(headers, value) {
1033 if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {
1034 headers['Content-Type'] = value;
1035 }
1036}
1037
1038function getDefaultAdapter() {
1039 var adapter;
1040 if (typeof XMLHttpRequest !== 'undefined') {
1041 // For browsers use XHR adapter
1042 adapter = __webpack_require__(/*! ./adapters/xhr */ "../node_modules/axios/lib/adapters/xhr.js");
1043 } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {
1044 // For node use HTTP adapter
1045 adapter = __webpack_require__(/*! ./adapters/http */ "../node_modules/axios/lib/adapters/xhr.js");
1046 }
1047 return adapter;
1048}
1049
1050var defaults = {
1051 adapter: getDefaultAdapter(),
1052
1053 transformRequest: [function transformRequest(data, headers) {
1054 normalizeHeaderName(headers, 'Accept');
1055 normalizeHeaderName(headers, 'Content-Type');
1056 if (utils.isFormData(data) ||
1057 utils.isArrayBuffer(data) ||
1058 utils.isBuffer(data) ||
1059 utils.isStream(data) ||
1060 utils.isFile(data) ||
1061 utils.isBlob(data)
1062 ) {
1063 return data;
1064 }
1065 if (utils.isArrayBufferView(data)) {
1066 return data.buffer;
1067 }
1068 if (utils.isURLSearchParams(data)) {
1069 setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
1070 return data.toString();
1071 }
1072 if (utils.isObject(data)) {
1073 setContentTypeIfUnset(headers, 'application/json;charset=utf-8');
1074 return JSON.stringify(data);
1075 }
1076 return data;
1077 }],
1078
1079 transformResponse: [function transformResponse(data) {
1080 /*eslint no-param-reassign:0*/
1081 if (typeof data === 'string') {
1082 try {
1083 data = JSON.parse(data);
1084 } catch (e) { /* Ignore */ }
1085 }
1086 return data;
1087 }],
1088
1089 /**
1090 * A timeout in milliseconds to abort a request. If set to 0 (default) a
1091 * timeout is not created.
1092 */
1093 timeout: 0,
1094
1095 xsrfCookieName: 'XSRF-TOKEN',
1096 xsrfHeaderName: 'X-XSRF-TOKEN',
1097
1098 maxContentLength: -1,
1099
1100 validateStatus: function validateStatus(status) {
1101 return status >= 200 && status < 300;
1102 }
1103};
1104
1105defaults.headers = {
1106 common: {
1107 'Accept': 'application/json, text/plain, */*'
1108 }
1109};
1110
1111utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
1112 defaults.headers[method] = {};
1113});
1114
1115utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
1116 defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
1117});
1118
1119module.exports = defaults;
1120
1121/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ "../node_modules/process/browser.js")))
1122
1123/***/ }),
1124
1125/***/ "../node_modules/axios/lib/helpers/bind.js":
1126/*!*************************************************!*\
1127 !*** ../node_modules/axios/lib/helpers/bind.js ***!
1128 \*************************************************/
1129/*! no static exports found */
1130/***/ (function(module, exports, __webpack_require__) {
1131
1132"use strict";
1133
1134
1135module.exports = function bind(fn, thisArg) {
1136 return function wrap() {
1137 var args = new Array(arguments.length);
1138 for (var i = 0; i < args.length; i++) {
1139 args[i] = arguments[i];
1140 }
1141 return fn.apply(thisArg, args);
1142 };
1143};
1144
1145
1146/***/ }),
1147
1148/***/ "../node_modules/axios/lib/helpers/buildURL.js":
1149/*!*****************************************************!*\
1150 !*** ../node_modules/axios/lib/helpers/buildURL.js ***!
1151 \*****************************************************/
1152/*! no static exports found */
1153/***/ (function(module, exports, __webpack_require__) {
1154
1155"use strict";
1156
1157
1158var utils = __webpack_require__(/*! ./../utils */ "../node_modules/axios/lib/utils.js");
1159
1160function encode(val) {
1161 return encodeURIComponent(val).
1162 replace(/%40/gi, '@').
1163 replace(/%3A/gi, ':').
1164 replace(/%24/g, '$').
1165 replace(/%2C/gi, ',').
1166 replace(/%20/g, '+').
1167 replace(/%5B/gi, '[').
1168 replace(/%5D/gi, ']');
1169}
1170
1171/**
1172 * Build a URL by appending params to the end
1173 *
1174 * @param {string} url The base of the url (e.g., http://www.google.com)
1175 * @param {object} [params] The params to be appended
1176 * @returns {string} The formatted url
1177 */
1178module.exports = function buildURL(url, params, paramsSerializer) {
1179 /*eslint no-param-reassign:0*/
1180 if (!params) {
1181 return url;
1182 }
1183
1184 var serializedParams;
1185 if (paramsSerializer) {
1186 serializedParams = paramsSerializer(params);
1187 } else if (utils.isURLSearchParams(params)) {
1188 serializedParams = params.toString();
1189 } else {
1190 var parts = [];
1191
1192 utils.forEach(params, function serialize(val, key) {
1193 if (val === null || typeof val === 'undefined') {
1194 return;
1195 }
1196
1197 if (utils.isArray(val)) {
1198 key = key + '[]';
1199 } else {
1200 val = [val];
1201 }
1202
1203 utils.forEach(val, function parseValue(v) {
1204 if (utils.isDate(v)) {
1205 v = v.toISOString();
1206 } else if (utils.isObject(v)) {
1207 v = JSON.stringify(v);
1208 }
1209 parts.push(encode(key) + '=' + encode(v));
1210 });
1211 });
1212
1213 serializedParams = parts.join('&');
1214 }
1215
1216 if (serializedParams) {
1217 var hashmarkIndex = url.indexOf('#');
1218 if (hashmarkIndex !== -1) {
1219 url = url.slice(0, hashmarkIndex);
1220 }
1221
1222 url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
1223 }
1224
1225 return url;
1226};
1227
1228
1229/***/ }),
1230
1231/***/ "../node_modules/axios/lib/helpers/combineURLs.js":
1232/*!********************************************************!*\
1233 !*** ../node_modules/axios/lib/helpers/combineURLs.js ***!
1234 \********************************************************/
1235/*! no static exports found */
1236/***/ (function(module, exports, __webpack_require__) {
1237
1238"use strict";
1239
1240
1241/**
1242 * Creates a new URL by combining the specified URLs
1243 *
1244 * @param {string} baseURL The base URL
1245 * @param {string} relativeURL The relative URL
1246 * @returns {string} The combined URL
1247 */
1248module.exports = function combineURLs(baseURL, relativeURL) {
1249 return relativeURL
1250 ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
1251 : baseURL;
1252};
1253
1254
1255/***/ }),
1256
1257/***/ "../node_modules/axios/lib/helpers/cookies.js":
1258/*!****************************************************!*\
1259 !*** ../node_modules/axios/lib/helpers/cookies.js ***!
1260 \****************************************************/
1261/*! no static exports found */
1262/***/ (function(module, exports, __webpack_require__) {
1263
1264"use strict";
1265
1266
1267var utils = __webpack_require__(/*! ./../utils */ "../node_modules/axios/lib/utils.js");
1268
1269module.exports = (
1270 utils.isStandardBrowserEnv() ?
1271
1272 // Standard browser envs support document.cookie
1273 (function standardBrowserEnv() {
1274 return {
1275 write: function write(name, value, expires, path, domain, secure) {
1276 var cookie = [];
1277 cookie.push(name + '=' + encodeURIComponent(value));
1278
1279 if (utils.isNumber(expires)) {
1280 cookie.push('expires=' + new Date(expires).toGMTString());
1281 }
1282
1283 if (utils.isString(path)) {
1284 cookie.push('path=' + path);
1285 }
1286
1287 if (utils.isString(domain)) {
1288 cookie.push('domain=' + domain);
1289 }
1290
1291 if (secure === true) {
1292 cookie.push('secure');
1293 }
1294
1295 document.cookie = cookie.join('; ');
1296 },
1297
1298 read: function read(name) {
1299 var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
1300 return (match ? decodeURIComponent(match[3]) : null);
1301 },
1302
1303 remove: function remove(name) {
1304 this.write(name, '', Date.now() - 86400000);
1305 }
1306 };
1307 })() :
1308
1309 // Non standard browser env (web workers, react-native) lack needed support.
1310 (function nonStandardBrowserEnv() {
1311 return {
1312 write: function write() {},
1313 read: function read() { return null; },
1314 remove: function remove() {}
1315 };
1316 })()
1317);
1318
1319
1320/***/ }),
1321
1322/***/ "../node_modules/axios/lib/helpers/isAbsoluteURL.js":
1323/*!**********************************************************!*\
1324 !*** ../node_modules/axios/lib/helpers/isAbsoluteURL.js ***!
1325 \**********************************************************/
1326/*! no static exports found */
1327/***/ (function(module, exports, __webpack_require__) {
1328
1329"use strict";
1330
1331
1332/**
1333 * Determines whether the specified URL is absolute
1334 *
1335 * @param {string} url The URL to test
1336 * @returns {boolean} True if the specified URL is absolute, otherwise false
1337 */
1338module.exports = function isAbsoluteURL(url) {
1339 // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
1340 // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
1341 // by any combination of letters, digits, plus, period, or hyphen.
1342 return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
1343};
1344
1345
1346/***/ }),
1347
1348/***/ "../node_modules/axios/lib/helpers/isURLSameOrigin.js":
1349/*!************************************************************!*\
1350 !*** ../node_modules/axios/lib/helpers/isURLSameOrigin.js ***!
1351 \************************************************************/
1352/*! no static exports found */
1353/***/ (function(module, exports, __webpack_require__) {
1354
1355"use strict";
1356
1357
1358var utils = __webpack_require__(/*! ./../utils */ "../node_modules/axios/lib/utils.js");
1359
1360module.exports = (
1361 utils.isStandardBrowserEnv() ?
1362
1363 // Standard browser envs have full support of the APIs needed to test
1364 // whether the request URL is of the same origin as current location.
1365 (function standardBrowserEnv() {
1366 var msie = /(msie|trident)/i.test(navigator.userAgent);
1367 var urlParsingNode = document.createElement('a');
1368 var originURL;
1369
1370 /**
1371 * Parse a URL to discover it's components
1372 *
1373 * @param {String} url The URL to be parsed
1374 * @returns {Object}
1375 */
1376 function resolveURL(url) {
1377 var href = url;
1378
1379 if (msie) {
1380 // IE needs attribute set twice to normalize properties
1381 urlParsingNode.setAttribute('href', href);
1382 href = urlParsingNode.href;
1383 }
1384
1385 urlParsingNode.setAttribute('href', href);
1386
1387 // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
1388 return {
1389 href: urlParsingNode.href,
1390 protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
1391 host: urlParsingNode.host,
1392 search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
1393 hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
1394 hostname: urlParsingNode.hostname,
1395 port: urlParsingNode.port,
1396 pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
1397 urlParsingNode.pathname :
1398 '/' + urlParsingNode.pathname
1399 };
1400 }
1401
1402 originURL = resolveURL(window.location.href);
1403
1404 /**
1405 * Determine if a URL shares the same origin as the current location
1406 *
1407 * @param {String} requestURL The URL to test
1408 * @returns {boolean} True if URL shares the same origin, otherwise false
1409 */
1410 return function isURLSameOrigin(requestURL) {
1411 var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
1412 return (parsed.protocol === originURL.protocol &&
1413 parsed.host === originURL.host);
1414 };
1415 })() :
1416
1417 // Non standard browser envs (web workers, react-native) lack needed support.
1418 (function nonStandardBrowserEnv() {
1419 return function isURLSameOrigin() {
1420 return true;
1421 };
1422 })()
1423);
1424
1425
1426/***/ }),
1427
1428/***/ "../node_modules/axios/lib/helpers/normalizeHeaderName.js":
1429/*!****************************************************************!*\
1430 !*** ../node_modules/axios/lib/helpers/normalizeHeaderName.js ***!
1431 \****************************************************************/
1432/*! no static exports found */
1433/***/ (function(module, exports, __webpack_require__) {
1434
1435"use strict";
1436
1437
1438var utils = __webpack_require__(/*! ../utils */ "../node_modules/axios/lib/utils.js");
1439
1440module.exports = function normalizeHeaderName(headers, normalizedName) {
1441 utils.forEach(headers, function processHeader(value, name) {
1442 if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
1443 headers[normalizedName] = value;
1444 delete headers[name];
1445 }
1446 });
1447};
1448
1449
1450/***/ }),
1451
1452/***/ "../node_modules/axios/lib/helpers/parseHeaders.js":
1453/*!*********************************************************!*\
1454 !*** ../node_modules/axios/lib/helpers/parseHeaders.js ***!
1455 \*********************************************************/
1456/*! no static exports found */
1457/***/ (function(module, exports, __webpack_require__) {
1458
1459"use strict";
1460
1461
1462var utils = __webpack_require__(/*! ./../utils */ "../node_modules/axios/lib/utils.js");
1463
1464// Headers whose duplicates are ignored by node
1465// c.f. https://nodejs.org/api/http.html#http_message_headers
1466var ignoreDuplicateOf = [
1467 'age', 'authorization', 'content-length', 'content-type', 'etag',
1468 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
1469 'last-modified', 'location', 'max-forwards', 'proxy-authorization',
1470 'referer', 'retry-after', 'user-agent'
1471];
1472
1473/**
1474 * Parse headers into an object
1475 *
1476 * ```
1477 * Date: Wed, 27 Aug 2014 08:58:49 GMT
1478 * Content-Type: application/json
1479 * Connection: keep-alive
1480 * Transfer-Encoding: chunked
1481 * ```
1482 *
1483 * @param {String} headers Headers needing to be parsed
1484 * @returns {Object} Headers parsed into an object
1485 */
1486module.exports = function parseHeaders(headers) {
1487 var parsed = {};
1488 var key;
1489 var val;
1490 var i;
1491
1492 if (!headers) { return parsed; }
1493
1494 utils.forEach(headers.split('\n'), function parser(line) {
1495 i = line.indexOf(':');
1496 key = utils.trim(line.substr(0, i)).toLowerCase();
1497 val = utils.trim(line.substr(i + 1));
1498
1499 if (key) {
1500 if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
1501 return;
1502 }
1503 if (key === 'set-cookie') {
1504 parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
1505 } else {
1506 parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
1507 }
1508 }
1509 });
1510
1511 return parsed;
1512};
1513
1514
1515/***/ }),
1516
1517/***/ "../node_modules/axios/lib/helpers/spread.js":
1518/*!***************************************************!*\
1519 !*** ../node_modules/axios/lib/helpers/spread.js ***!
1520 \***************************************************/
1521/*! no static exports found */
1522/***/ (function(module, exports, __webpack_require__) {
1523
1524"use strict";
1525
1526
1527/**
1528 * Syntactic sugar for invoking a function and expanding an array for arguments.
1529 *
1530 * Common use case would be to use `Function.prototype.apply`.
1531 *
1532 * ```js
1533 * function f(x, y, z) {}
1534 * var args = [1, 2, 3];
1535 * f.apply(null, args);
1536 * ```
1537 *
1538 * With `spread` this example can be re-written.
1539 *
1540 * ```js
1541 * spread(function(x, y, z) {})([1, 2, 3]);
1542 * ```
1543 *
1544 * @param {Function} callback
1545 * @returns {Function}
1546 */
1547module.exports = function spread(callback) {
1548 return function wrap(arr) {
1549 return callback.apply(null, arr);
1550 };
1551};
1552
1553
1554/***/ }),
1555
1556/***/ "../node_modules/axios/lib/utils.js":
1557/*!******************************************!*\
1558 !*** ../node_modules/axios/lib/utils.js ***!
1559 \******************************************/
1560/*! no static exports found */
1561/***/ (function(module, exports, __webpack_require__) {
1562
1563"use strict";
1564
1565
1566var bind = __webpack_require__(/*! ./helpers/bind */ "../node_modules/axios/lib/helpers/bind.js");
1567
1568/*global toString:true*/
1569
1570// utils is a library of generic helper functions non-specific to axios
1571
1572var toString = Object.prototype.toString;
1573
1574/**
1575 * Determine if a value is an Array
1576 *
1577 * @param {Object} val The value to test
1578 * @returns {boolean} True if value is an Array, otherwise false
1579 */
1580function isArray(val) {
1581 return toString.call(val) === '[object Array]';
1582}
1583
1584/**
1585 * Determine if a value is undefined
1586 *
1587 * @param {Object} val The value to test
1588 * @returns {boolean} True if the value is undefined, otherwise false
1589 */
1590function isUndefined(val) {
1591 return typeof val === 'undefined';
1592}
1593
1594/**
1595 * Determine if a value is a Buffer
1596 *
1597 * @param {Object} val The value to test
1598 * @returns {boolean} True if value is a Buffer, otherwise false
1599 */
1600function isBuffer(val) {
1601 return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
1602 && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);
1603}
1604
1605/**
1606 * Determine if a value is an ArrayBuffer
1607 *
1608 * @param {Object} val The value to test
1609 * @returns {boolean} True if value is an ArrayBuffer, otherwise false
1610 */
1611function isArrayBuffer(val) {
1612 return toString.call(val) === '[object ArrayBuffer]';
1613}
1614
1615/**
1616 * Determine if a value is a FormData
1617 *
1618 * @param {Object} val The value to test
1619 * @returns {boolean} True if value is an FormData, otherwise false
1620 */
1621function isFormData(val) {
1622 return (typeof FormData !== 'undefined') && (val instanceof FormData);
1623}
1624
1625/**
1626 * Determine if a value is a view on an ArrayBuffer
1627 *
1628 * @param {Object} val The value to test
1629 * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
1630 */
1631function isArrayBufferView(val) {
1632 var result;
1633 if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
1634 result = ArrayBuffer.isView(val);
1635 } else {
1636 result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);
1637 }
1638 return result;
1639}
1640
1641/**
1642 * Determine if a value is a String
1643 *
1644 * @param {Object} val The value to test
1645 * @returns {boolean} True if value is a String, otherwise false
1646 */
1647function isString(val) {
1648 return typeof val === 'string';
1649}
1650
1651/**
1652 * Determine if a value is a Number
1653 *
1654 * @param {Object} val The value to test
1655 * @returns {boolean} True if value is a Number, otherwise false
1656 */
1657function isNumber(val) {
1658 return typeof val === 'number';
1659}
1660
1661/**
1662 * Determine if a value is an Object
1663 *
1664 * @param {Object} val The value to test
1665 * @returns {boolean} True if value is an Object, otherwise false
1666 */
1667function isObject(val) {
1668 return val !== null && typeof val === 'object';
1669}
1670
1671/**
1672 * Determine if a value is a Date
1673 *
1674 * @param {Object} val The value to test
1675 * @returns {boolean} True if value is a Date, otherwise false
1676 */
1677function isDate(val) {
1678 return toString.call(val) === '[object Date]';
1679}
1680
1681/**
1682 * Determine if a value is a File
1683 *
1684 * @param {Object} val The value to test
1685 * @returns {boolean} True if value is a File, otherwise false
1686 */
1687function isFile(val) {
1688 return toString.call(val) === '[object File]';
1689}
1690
1691/**
1692 * Determine if a value is a Blob
1693 *
1694 * @param {Object} val The value to test
1695 * @returns {boolean} True if value is a Blob, otherwise false
1696 */
1697function isBlob(val) {
1698 return toString.call(val) === '[object Blob]';
1699}
1700
1701/**
1702 * Determine if a value is a Function
1703 *
1704 * @param {Object} val The value to test
1705 * @returns {boolean} True if value is a Function, otherwise false
1706 */
1707function isFunction(val) {
1708 return toString.call(val) === '[object Function]';
1709}
1710
1711/**
1712 * Determine if a value is a Stream
1713 *
1714 * @param {Object} val The value to test
1715 * @returns {boolean} True if value is a Stream, otherwise false
1716 */
1717function isStream(val) {
1718 return isObject(val) && isFunction(val.pipe);
1719}
1720
1721/**
1722 * Determine if a value is a URLSearchParams object
1723 *
1724 * @param {Object} val The value to test
1725 * @returns {boolean} True if value is a URLSearchParams object, otherwise false
1726 */
1727function isURLSearchParams(val) {
1728 return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;
1729}
1730
1731/**
1732 * Trim excess whitespace off the beginning and end of a string
1733 *
1734 * @param {String} str The String to trim
1735 * @returns {String} The String freed of excess whitespace
1736 */
1737function trim(str) {
1738 return str.replace(/^\s*/, '').replace(/\s*$/, '');
1739}
1740
1741/**
1742 * Determine if we're running in a standard browser environment
1743 *
1744 * This allows axios to run in a web worker, and react-native.
1745 * Both environments support XMLHttpRequest, but not fully standard globals.
1746 *
1747 * web workers:
1748 * typeof window -> undefined
1749 * typeof document -> undefined
1750 *
1751 * react-native:
1752 * navigator.product -> 'ReactNative'
1753 * nativescript
1754 * navigator.product -> 'NativeScript' or 'NS'
1755 */
1756function isStandardBrowserEnv() {
1757 if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||
1758 navigator.product === 'NativeScript' ||
1759 navigator.product === 'NS')) {
1760 return false;
1761 }
1762 return (
1763 typeof window !== 'undefined' &&
1764 typeof document !== 'undefined'
1765 );
1766}
1767
1768/**
1769 * Iterate over an Array or an Object invoking a function for each item.
1770 *
1771 * If `obj` is an Array callback will be called passing
1772 * the value, index, and complete array for each item.
1773 *
1774 * If 'obj' is an Object callback will be called passing
1775 * the value, key, and complete object for each property.
1776 *
1777 * @param {Object|Array} obj The object to iterate
1778 * @param {Function} fn The callback to invoke for each item
1779 */
1780function forEach(obj, fn) {
1781 // Don't bother if no value provided
1782 if (obj === null || typeof obj === 'undefined') {
1783 return;
1784 }
1785
1786 // Force an array if not already something iterable
1787 if (typeof obj !== 'object') {
1788 /*eslint no-param-reassign:0*/
1789 obj = [obj];
1790 }
1791
1792 if (isArray(obj)) {
1793 // Iterate over array values
1794 for (var i = 0, l = obj.length; i < l; i++) {
1795 fn.call(null, obj[i], i, obj);
1796 }
1797 } else {
1798 // Iterate over object keys
1799 for (var key in obj) {
1800 if (Object.prototype.hasOwnProperty.call(obj, key)) {
1801 fn.call(null, obj[key], key, obj);
1802 }
1803 }
1804 }
1805}
1806
1807/**
1808 * Accepts varargs expecting each argument to be an object, then
1809 * immutably merges the properties of each object and returns result.
1810 *
1811 * When multiple objects contain the same key the later object in
1812 * the arguments list will take precedence.
1813 *
1814 * Example:
1815 *
1816 * ```js
1817 * var result = merge({foo: 123}, {foo: 456});
1818 * console.log(result.foo); // outputs 456
1819 * ```
1820 *
1821 * @param {Object} obj1 Object to merge
1822 * @returns {Object} Result of all merge properties
1823 */
1824function merge(/* obj1, obj2, obj3, ... */) {
1825 var result = {};
1826 function assignValue(val, key) {
1827 if (typeof result[key] === 'object' && typeof val === 'object') {
1828 result[key] = merge(result[key], val);
1829 } else {
1830 result[key] = val;
1831 }
1832 }
1833
1834 for (var i = 0, l = arguments.length; i < l; i++) {
1835 forEach(arguments[i], assignValue);
1836 }
1837 return result;
1838}
1839
1840/**
1841 * Function equal to merge with the difference being that no reference
1842 * to original objects is kept.
1843 *
1844 * @see merge
1845 * @param {Object} obj1 Object to merge
1846 * @returns {Object} Result of all merge properties
1847 */
1848function deepMerge(/* obj1, obj2, obj3, ... */) {
1849 var result = {};
1850 function assignValue(val, key) {
1851 if (typeof result[key] === 'object' && typeof val === 'object') {
1852 result[key] = deepMerge(result[key], val);
1853 } else if (typeof val === 'object') {
1854 result[key] = deepMerge({}, val);
1855 } else {
1856 result[key] = val;
1857 }
1858 }
1859
1860 for (var i = 0, l = arguments.length; i < l; i++) {
1861 forEach(arguments[i], assignValue);
1862 }
1863 return result;
1864}
1865
1866/**
1867 * Extends object a by mutably adding to it the properties of object b.
1868 *
1869 * @param {Object} a The object to be extended
1870 * @param {Object} b The object to copy properties from
1871 * @param {Object} thisArg The object to bind function to
1872 * @return {Object} The resulting value of object a
1873 */
1874function extend(a, b, thisArg) {
1875 forEach(b, function assignValue(val, key) {
1876 if (thisArg && typeof val === 'function') {
1877 a[key] = bind(val, thisArg);
1878 } else {
1879 a[key] = val;
1880 }
1881 });
1882 return a;
1883}
1884
1885module.exports = {
1886 isArray: isArray,
1887 isArrayBuffer: isArrayBuffer,
1888 isBuffer: isBuffer,
1889 isFormData: isFormData,
1890 isArrayBufferView: isArrayBufferView,
1891 isString: isString,
1892 isNumber: isNumber,
1893 isObject: isObject,
1894 isUndefined: isUndefined,
1895 isDate: isDate,
1896 isFile: isFile,
1897 isBlob: isBlob,
1898 isFunction: isFunction,
1899 isStream: isStream,
1900 isURLSearchParams: isURLSearchParams,
1901 isStandardBrowserEnv: isStandardBrowserEnv,
1902 forEach: forEach,
1903 merge: merge,
1904 deepMerge: deepMerge,
1905 extend: extend,
1906 trim: trim
1907};
1908
1909
1910/***/ }),
1911
1912/***/ "../node_modules/contentful-sdk-core/dist/index.es-modules.js":
1913/*!********************************************************************!*\
1914 !*** ../node_modules/contentful-sdk-core/dist/index.es-modules.js ***!
1915 \********************************************************************/
1916/*! exports provided: createHttpClient, createRequestConfig, enforceObjPath, freezeSys, getUserAgentHeader, toPlainObject */
1917/***/ (function(module, __webpack_exports__, __webpack_require__) {
1918
1919"use strict";
1920__webpack_require__.r(__webpack_exports__);
1921/* WEBPACK VAR INJECTION */(function(process) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createHttpClient", function() { return createHttpClient; });
1922/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createRequestConfig", function() { return createRequestConfig; });
1923/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "enforceObjPath", function() { return enforceObjPath; });
1924/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "freezeSys", function() { return freezeSys; });
1925/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getUserAgentHeader", function() { return getUserAgentHeader; });
1926/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toPlainObject", function() { return toPlainObject; });
1927/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
1928/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
1929/* harmony import */ var qs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! qs */ "../node_modules/qs/lib/index.js");
1930/* harmony import */ var qs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(qs__WEBPACK_IMPORTED_MODULE_1__);
1931/* harmony import */ var lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash/isPlainObject */ "../node_modules/lodash/isPlainObject.js");
1932/* harmony import */ var lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_2__);
1933/* harmony import */ var os__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! os */ 1);
1934/* harmony import */ var os__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(os__WEBPACK_IMPORTED_MODULE_3__);
1935
1936
1937
1938
1939
1940function _defineProperty(obj, key, value) {
1941 if (key in obj) {
1942 Object.defineProperty(obj, key, {
1943 value: value,
1944 enumerable: true,
1945 configurable: true,
1946 writable: true
1947 });
1948 } else {
1949 obj[key] = value;
1950 }
1951
1952 return obj;
1953}
1954
1955function ownKeys(object, enumerableOnly) {
1956 var keys = Object.keys(object);
1957
1958 if (Object.getOwnPropertySymbols) {
1959 var symbols = Object.getOwnPropertySymbols(object);
1960 if (enumerableOnly) symbols = symbols.filter(function (sym) {
1961 return Object.getOwnPropertyDescriptor(object, sym).enumerable;
1962 });
1963 keys.push.apply(keys, symbols);
1964 }
1965
1966 return keys;
1967}
1968
1969function _objectSpread2(target) {
1970 for (var i = 1; i < arguments.length; i++) {
1971 var source = arguments[i] != null ? arguments[i] : {};
1972
1973 if (i % 2) {
1974 ownKeys(Object(source), true).forEach(function (key) {
1975 _defineProperty(target, key, source[key]);
1976 });
1977 } else if (Object.getOwnPropertyDescriptors) {
1978 Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
1979 } else {
1980 ownKeys(Object(source)).forEach(function (key) {
1981 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
1982 });
1983 }
1984 }
1985
1986 return target;
1987}
1988
1989function _slicedToArray(arr, i) {
1990 return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
1991}
1992
1993function _arrayWithHoles(arr) {
1994 if (Array.isArray(arr)) return arr;
1995}
1996
1997function _iterableToArrayLimit(arr, i) {
1998 if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
1999 var _arr = [];
2000 var _n = true;
2001 var _d = false;
2002 var _e = undefined;
2003
2004 try {
2005 for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
2006 _arr.push(_s.value);
2007
2008 if (i && _arr.length === i) break;
2009 }
2010 } catch (err) {
2011 _d = true;
2012 _e = err;
2013 } finally {
2014 try {
2015 if (!_n && _i["return"] != null) _i["return"]();
2016 } finally {
2017 if (_d) throw _e;
2018 }
2019 }
2020
2021 return _arr;
2022}
2023
2024function _unsupportedIterableToArray(o, minLen) {
2025 if (!o) return;
2026 if (typeof o === "string") return _arrayLikeToArray(o, minLen);
2027 var n = Object.prototype.toString.call(o).slice(8, -1);
2028 if (n === "Object" && o.constructor) n = o.constructor.name;
2029 if (n === "Map" || n === "Set") return Array.from(n);
2030 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
2031}
2032
2033function _arrayLikeToArray(arr, len) {
2034 if (len == null || len > arr.length) len = arr.length;
2035
2036 for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
2037
2038 return arr2;
2039}
2040
2041function _nonIterableRest() {
2042 throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
2043}
2044
2045var attempts = {};
2046var networkErrorAttempts = 0;
2047function rateLimit(instance) {
2048 var maxRetry = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 5;
2049 var _instance$defaults = instance.defaults,
2050 _instance$defaults$re = _instance$defaults.responseLogger,
2051 responseLogger = _instance$defaults$re === void 0 ? function () {
2052 return undefined;
2053 } : _instance$defaults$re,
2054 _instance$defaults$re2 = _instance$defaults.requestLogger,
2055 requestLogger = _instance$defaults$re2 === void 0 ? function () {
2056 return undefined;
2057 } : _instance$defaults$re2;
2058 instance.interceptors.request.use(function (config) {
2059 requestLogger(config);
2060 return config;
2061 }, function (error) {
2062 return Promise.reject(error);
2063 });
2064 instance.interceptors.response.use(function (response) {
2065 // we don't need to do anything here
2066 responseLogger(response);
2067 return response;
2068 }, function (error) {
2069 var response = error.response,
2070 config = error.config; // Do not retry if it is disabled or no request config exists (not an axios error)
2071
2072 if (!config || !instance.defaults.retryOnError) {
2073 return Promise.reject(error);
2074 }
2075
2076 var retryErrorType = null;
2077 var wait = 0; // Errors without response did not recieve anything from the server
2078
2079 if (!response) {
2080 retryErrorType = 'Connection';
2081 networkErrorAttempts++;
2082
2083 if (networkErrorAttempts > maxRetry) {
2084 error.attempts = networkErrorAttempts;
2085 return Promise.reject(error);
2086 }
2087
2088 wait = Math.pow(Math.SQRT2, networkErrorAttempts);
2089 response = {};
2090 } else {
2091 networkErrorAttempts = 0;
2092 }
2093
2094 if (response.status >= 500 && response.status < 600) {
2095 // 5** errors are server related
2096 retryErrorType = "Server ".concat(response.status);
2097 var headers = response.headers || {};
2098 var requestId = headers['x-contentful-request-id'] || null;
2099 attempts[requestId] = attempts[requestId] || 0;
2100 attempts[requestId]++; // we reject if there are too many errors with the same request id or request id is not defined
2101
2102 if (attempts[requestId] > maxRetry || !requestId) {
2103 error.attempts = attempts[requestId];
2104 return Promise.reject(error);
2105 }
2106
2107 wait = Math.pow(Math.SQRT2, attempts[requestId]);
2108 } else if (response.status === 429) {
2109 // 429 errors are exceeded rate limit exceptions
2110 retryErrorType = 'Rate limit'; // all headers are lowercased by axios https://github.com/mzabriskie/axios/issues/413
2111
2112 if (response.headers && error.response.headers['x-contentful-ratelimit-reset']) {
2113 wait = response.headers['x-contentful-ratelimit-reset'];
2114 }
2115 }
2116
2117 var delay = function delay(ms) {
2118 return new Promise(function (resolve) {
2119 setTimeout(resolve, ms);
2120 });
2121 };
2122
2123 if (retryErrorType) {
2124 // convert to ms and add jitter
2125 wait = Math.floor(wait * 1000 + Math.random() * 200 + 500);
2126 instance.defaults.logHandler('warning', "".concat(retryErrorType, " error occurred. Waiting for ").concat(wait, " ms before retrying..."));
2127 /* Somehow between the interceptor and retrying the request the httpAgent/httpsAgent gets transformed from an Agent-like object
2128 to a regular object, causing failures on retries after rate limits. Removing these properties here fixes the error, but retry
2129 requests still use the original http/httpsAgent property */
2130
2131 delete config.httpAgent;
2132 delete config.httpsAgent;
2133 return delay(wait).then(function () {
2134 return instance(config);
2135 });
2136 }
2137
2138 return Promise.reject(error);
2139 });
2140}
2141
2142function isNode() {
2143 /**
2144 * Polyfills of 'process' might set process.browser === true
2145 *
2146 * See:
2147 * https://github.com/webpack/node-libs-browser/blob/master/mock/process.js#L8
2148 * https://github.com/defunctzombie/node-process/blob/master/browser.js#L156
2149 **/
2150 return typeof process !== 'undefined' && !process.browser;
2151}
2152function getNodeVersion() {
2153 return process.versions && process.versions.node ? "v".concat(process.versions.node) : process.version;
2154}
2155
2156// Also enforces toplevel domain specified, no spaces and no protocol
2157
2158var HOST_REGEX = /^(?!\w+:\/\/)([^\s:]+\.?[^\s:]+)(?::(\d+))?(?!:)$/;
2159/**
2160 * Create pre configured axios instance
2161 * @private
2162 * @param {Object} axios - Axios library
2163 * @param {Object} httpClientParams - Initialization parameters for the HTTP client
2164 * @prop {string} space - Space ID
2165 * @prop {string} accessToken - Access Token
2166 * @prop {boolean=} insecure - If we should use http instead
2167 * @prop {string=} host - Alternate host
2168 * @prop {Object=} httpAgent - HTTP agent for node
2169 * @prop {Object=} httpsAgent - HTTPS agent for node
2170 * @prop {function=} adapter - Axios adapter to handle requests
2171 * @prop {function=} requestLogger - Gets called on every request triggered by the SDK, takes the axios request config as an argument
2172 * @prop {function=} responseLogger - Gets called on every response, takes axios response object as an argument
2173 * @prop {Object=} proxy - Axios proxy config
2174 * @prop {Object=} headers - Additional headers
2175 * @prop {function=} logHandler - A log handler function to process given log messages & errors. Receives the log level (error, warning & info) and the actual log data (Error object or string). (Default can be found here: https://github.com/contentful/contentful-sdk-core/blob/master/lib/create-http-client.js)
2176 * @return {Object} Initialized axios instance
2177 */
2178
2179function createHttpClient(axios, options) {
2180 var defaultConfig = {
2181 insecure: false,
2182 retryOnError: true,
2183 logHandler: function logHandler(level, data) {
2184 if (level === 'error' && data) {
2185 var title = [data.name, data.message].filter(function (a) {
2186 return a;
2187 }).join(' - ');
2188 console.error("[error] ".concat(title));
2189 console.error(data);
2190 return;
2191 }
2192
2193 console.log("[".concat(level, "] ").concat(data));
2194 },
2195 // Passed to axios
2196 headers: {},
2197 httpAgent: false,
2198 httpsAgent: false,
2199 timeout: 30000,
2200 proxy: false,
2201 basePath: '',
2202 adapter: false,
2203 maxContentLength: 1073741824 // 1GB
2204
2205 };
2206
2207 var config = _objectSpread2({}, defaultConfig, {}, options);
2208
2209 if (!config.accessToken) {
2210 var missingAccessTokenError = new TypeError('Expected parameter accessToken');
2211 config.logHandler('error', missingAccessTokenError);
2212 throw missingAccessTokenError;
2213 } // Construct axios baseURL option
2214
2215
2216 var protocol = config.insecure ? 'http' : 'https';
2217 var space = config.space ? "".concat(config.space, "/") : '';
2218 var hostname = config.defaultHostname;
2219 var port = config.insecure ? 80 : 443;
2220
2221 if (config.host && HOST_REGEX.test(config.host)) {
2222 var parsed = config.host.split(':');
2223
2224 if (parsed.length === 2) {
2225 var _parsed = _slicedToArray(parsed, 2);
2226
2227 hostname = _parsed[0];
2228 port = _parsed[1];
2229 } else {
2230 hostname = parsed[0];
2231 }
2232 } // Ensure that basePath does start but not end with a slash
2233
2234
2235 if (config.basePath) {
2236 config.basePath = "/".concat(config.basePath.split('/').filter(Boolean).join('/'));
2237 }
2238
2239 var baseURL = options.baseURL || "".concat(protocol, "://").concat(hostname, ":").concat(port).concat(config.basePath, "/spaces/").concat(space);
2240
2241 if (!config.headers['Authorization']) {
2242 config.headers['Authorization'] = 'Bearer ' + config.accessToken;
2243 } // Set these headers only for node because browsers don't like it when you
2244 // override user-agent or accept-encoding.
2245 // The SDKs should set their own X-Contentful-User-Agent.
2246
2247
2248 if (isNode()) {
2249 config.headers['user-agent'] = 'node.js/' + getNodeVersion();
2250 config.headers['Accept-Encoding'] = 'gzip';
2251 }
2252
2253 var axiosOptions = {
2254 // Axios
2255 baseURL: baseURL,
2256 headers: config.headers,
2257 httpAgent: config.httpAgent,
2258 httpsAgent: config.httpsAgent,
2259 paramsSerializer: qs__WEBPACK_IMPORTED_MODULE_1___default.a.stringify,
2260 proxy: config.proxy,
2261 timeout: config.timeout,
2262 adapter: config.adapter,
2263 maxContentLength: config.maxContentLength,
2264 // Contentful
2265 logHandler: config.logHandler,
2266 responseLogger: config.responseLogger,
2267 requestLogger: config.requestLogger,
2268 retryOnError: config.retryOnError
2269 };
2270 var instance = axios.create(axiosOptions);
2271 instance.httpClientParams = options;
2272 /**
2273 * Creates a new axios instance with the same default base parameters as the
2274 * current one, and with any overrides passed to the newParams object
2275 * This is useful as the SDKs use dependency injection to get the axios library
2276 * and the version of the library comes from different places depending
2277 * on whether it's a browser build or a node.js build.
2278 * @private
2279 * @param {Object} httpClientParams - Initialization parameters for the HTTP client
2280 * @return {Object} Initialized axios instance
2281 */
2282
2283 instance.cloneWithNewParams = function (newParams) {
2284 return createHttpClient(axios, _objectSpread2({}, lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(options), {}, newParams));
2285 };
2286
2287 rateLimit(instance, config.retryLimit);
2288 return instance;
2289}
2290
2291/**
2292 * Creates request parameters configuration by parsing an existing query object
2293 * @private
2294 * @param {Object} query
2295 * @return {Object} Config object with `params` property, ready to be used in axios
2296 */
2297
2298function createRequestConfig(_ref) {
2299 var query = _ref.query;
2300 var config = {};
2301 delete query.resolveLinks;
2302 config.params = lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(query);
2303 return config;
2304}
2305
2306function enforceObjPath(obj, path) {
2307 if (!(path in obj)) {
2308 var err = new Error();
2309 err.name = 'PropertyMissing';
2310 err.message = "Required property ".concat(path, " missing from:\n\n").concat(JSON.stringify(obj), "\n\n");
2311 throw err;
2312 }
2313
2314 return true;
2315}
2316
2317function freezeObjectDeep(obj) {
2318 Object.keys(obj).forEach(function (key) {
2319 var value = obj[key];
2320
2321 if (lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_2___default()(value)) {
2322 freezeObjectDeep(value);
2323 }
2324 });
2325 return Object.freeze(obj);
2326}
2327
2328function freezeSys(obj) {
2329 freezeObjectDeep(obj.sys || {});
2330 return obj;
2331}
2332
2333function isReactNative() {
2334 return typeof window !== 'undefined' && 'navigator' in window && 'product' in window.navigator && window.navigator.product === 'ReactNative';
2335}
2336
2337function getBrowserOS() {
2338 if (!window) {
2339 return null;
2340 }
2341
2342 var userAgent = window.navigator.userAgent;
2343 var platform = window.navigator.platform;
2344 var macosPlatforms = ['Macintosh', 'MacIntel', 'MacPPC', 'Mac68K'];
2345 var windowsPlatforms = ['Win32', 'Win64', 'Windows', 'WinCE'];
2346 var iosPlatforms = ['iPhone', 'iPad', 'iPod'];
2347 var os = null;
2348
2349 if (macosPlatforms.indexOf(platform) !== -1) {
2350 os = 'macOS';
2351 } else if (iosPlatforms.indexOf(platform) !== -1) {
2352 os = 'iOS';
2353 } else if (windowsPlatforms.indexOf(platform) !== -1) {
2354 os = 'Windows';
2355 } else if (/Android/.test(userAgent)) {
2356 os = 'Android';
2357 } else if (/Linux/.test(platform)) {
2358 os = 'Linux';
2359 }
2360
2361 return os;
2362}
2363
2364function getNodeOS() {
2365 var os = Object(os__WEBPACK_IMPORTED_MODULE_3__["platform"])() || 'linux';
2366 var version = Object(os__WEBPACK_IMPORTED_MODULE_3__["release"])() || '0.0.0';
2367 var osMap = {
2368 android: 'Android',
2369 aix: 'Linux',
2370 darwin: 'macOS',
2371 freebsd: 'Linux',
2372 linux: 'Linux',
2373 openbsd: 'Linux',
2374 sunos: 'Linux',
2375 win32: 'Windows'
2376 };
2377
2378 if (os in osMap) {
2379 return "".concat(osMap[os] || 'Linux', "/").concat(version);
2380 }
2381
2382 return null;
2383}
2384
2385function getUserAgentHeader(sdk, application, integration, feature) {
2386 var headerParts = [];
2387
2388 if (application) {
2389 headerParts.push("app ".concat(application));
2390 }
2391
2392 if (integration) {
2393 headerParts.push("integration ".concat(integration));
2394 }
2395
2396 if (feature) {
2397 headerParts.push('feature ' + feature);
2398 }
2399
2400 headerParts.push("sdk ".concat(sdk));
2401 var os = null;
2402
2403 try {
2404 if (isReactNative()) {
2405 os = getBrowserOS();
2406 headerParts.push('platform ReactNative');
2407 } else if (isNode()) {
2408 os = getNodeOS();
2409 headerParts.push("platform node.js/".concat(getNodeVersion()));
2410 } else {
2411 os = getBrowserOS();
2412 headerParts.push("platform browser");
2413 }
2414 } catch (e) {
2415 os = null;
2416 }
2417
2418 if (os) {
2419 headerParts.push("os ".concat(os));
2420 }
2421
2422 return "".concat(headerParts.filter(function (item) {
2423 return item !== '';
2424 }).join('; '), ";");
2425}
2426
2427/**
2428 * Mixes in a method to return just a plain object with no additional methods
2429 * @private
2430 * @param {Object} data - Any plain JSON response returned from the API
2431 * @return {Object} Enhanced object with toPlainObject method
2432 */
2433
2434function toPlainObject(data) {
2435 return Object.defineProperty(data, 'toPlainObject', {
2436 enumerable: false,
2437 configurable: false,
2438 writable: false,
2439 value: function value() {
2440 return lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(this);
2441 }
2442 });
2443}
2444
2445
2446
2447/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ "../node_modules/process/browser.js")))
2448
2449/***/ }),
2450
2451/***/ "../node_modules/lodash/_Hash.js":
2452/*!***************************************!*\
2453 !*** ../node_modules/lodash/_Hash.js ***!
2454 \***************************************/
2455/*! no static exports found */
2456/***/ (function(module, exports, __webpack_require__) {
2457
2458var hashClear = __webpack_require__(/*! ./_hashClear */ "../node_modules/lodash/_hashClear.js"),
2459 hashDelete = __webpack_require__(/*! ./_hashDelete */ "../node_modules/lodash/_hashDelete.js"),
2460 hashGet = __webpack_require__(/*! ./_hashGet */ "../node_modules/lodash/_hashGet.js"),
2461 hashHas = __webpack_require__(/*! ./_hashHas */ "../node_modules/lodash/_hashHas.js"),
2462 hashSet = __webpack_require__(/*! ./_hashSet */ "../node_modules/lodash/_hashSet.js");
2463
2464/**
2465 * Creates a hash object.
2466 *
2467 * @private
2468 * @constructor
2469 * @param {Array} [entries] The key-value pairs to cache.
2470 */
2471function Hash(entries) {
2472 var index = -1,
2473 length = entries == null ? 0 : entries.length;
2474
2475 this.clear();
2476 while (++index < length) {
2477 var entry = entries[index];
2478 this.set(entry[0], entry[1]);
2479 }
2480}
2481
2482// Add methods to `Hash`.
2483Hash.prototype.clear = hashClear;
2484Hash.prototype['delete'] = hashDelete;
2485Hash.prototype.get = hashGet;
2486Hash.prototype.has = hashHas;
2487Hash.prototype.set = hashSet;
2488
2489module.exports = Hash;
2490
2491
2492/***/ }),
2493
2494/***/ "../node_modules/lodash/_ListCache.js":
2495/*!********************************************!*\
2496 !*** ../node_modules/lodash/_ListCache.js ***!
2497 \********************************************/
2498/*! no static exports found */
2499/***/ (function(module, exports, __webpack_require__) {
2500
2501var listCacheClear = __webpack_require__(/*! ./_listCacheClear */ "../node_modules/lodash/_listCacheClear.js"),
2502 listCacheDelete = __webpack_require__(/*! ./_listCacheDelete */ "../node_modules/lodash/_listCacheDelete.js"),
2503 listCacheGet = __webpack_require__(/*! ./_listCacheGet */ "../node_modules/lodash/_listCacheGet.js"),
2504 listCacheHas = __webpack_require__(/*! ./_listCacheHas */ "../node_modules/lodash/_listCacheHas.js"),
2505 listCacheSet = __webpack_require__(/*! ./_listCacheSet */ "../node_modules/lodash/_listCacheSet.js");
2506
2507/**
2508 * Creates an list cache object.
2509 *
2510 * @private
2511 * @constructor
2512 * @param {Array} [entries] The key-value pairs to cache.
2513 */
2514function ListCache(entries) {
2515 var index = -1,
2516 length = entries == null ? 0 : entries.length;
2517
2518 this.clear();
2519 while (++index < length) {
2520 var entry = entries[index];
2521 this.set(entry[0], entry[1]);
2522 }
2523}
2524
2525// Add methods to `ListCache`.
2526ListCache.prototype.clear = listCacheClear;
2527ListCache.prototype['delete'] = listCacheDelete;
2528ListCache.prototype.get = listCacheGet;
2529ListCache.prototype.has = listCacheHas;
2530ListCache.prototype.set = listCacheSet;
2531
2532module.exports = ListCache;
2533
2534
2535/***/ }),
2536
2537/***/ "../node_modules/lodash/_Map.js":
2538/*!**************************************!*\
2539 !*** ../node_modules/lodash/_Map.js ***!
2540 \**************************************/
2541/*! no static exports found */
2542/***/ (function(module, exports, __webpack_require__) {
2543
2544var getNative = __webpack_require__(/*! ./_getNative */ "../node_modules/lodash/_getNative.js"),
2545 root = __webpack_require__(/*! ./_root */ "../node_modules/lodash/_root.js");
2546
2547/* Built-in method references that are verified to be native. */
2548var Map = getNative(root, 'Map');
2549
2550module.exports = Map;
2551
2552
2553/***/ }),
2554
2555/***/ "../node_modules/lodash/_MapCache.js":
2556/*!*******************************************!*\
2557 !*** ../node_modules/lodash/_MapCache.js ***!
2558 \*******************************************/
2559/*! no static exports found */
2560/***/ (function(module, exports, __webpack_require__) {
2561
2562var mapCacheClear = __webpack_require__(/*! ./_mapCacheClear */ "../node_modules/lodash/_mapCacheClear.js"),
2563 mapCacheDelete = __webpack_require__(/*! ./_mapCacheDelete */ "../node_modules/lodash/_mapCacheDelete.js"),
2564 mapCacheGet = __webpack_require__(/*! ./_mapCacheGet */ "../node_modules/lodash/_mapCacheGet.js"),
2565 mapCacheHas = __webpack_require__(/*! ./_mapCacheHas */ "../node_modules/lodash/_mapCacheHas.js"),
2566 mapCacheSet = __webpack_require__(/*! ./_mapCacheSet */ "../node_modules/lodash/_mapCacheSet.js");
2567
2568/**
2569 * Creates a map cache object to store key-value pairs.
2570 *
2571 * @private
2572 * @constructor
2573 * @param {Array} [entries] The key-value pairs to cache.
2574 */
2575function MapCache(entries) {
2576 var index = -1,
2577 length = entries == null ? 0 : entries.length;
2578
2579 this.clear();
2580 while (++index < length) {
2581 var entry = entries[index];
2582 this.set(entry[0], entry[1]);
2583 }
2584}
2585
2586// Add methods to `MapCache`.
2587MapCache.prototype.clear = mapCacheClear;
2588MapCache.prototype['delete'] = mapCacheDelete;
2589MapCache.prototype.get = mapCacheGet;
2590MapCache.prototype.has = mapCacheHas;
2591MapCache.prototype.set = mapCacheSet;
2592
2593module.exports = MapCache;
2594
2595
2596/***/ }),
2597
2598/***/ "../node_modules/lodash/_Stack.js":
2599/*!****************************************!*\
2600 !*** ../node_modules/lodash/_Stack.js ***!
2601 \****************************************/
2602/*! no static exports found */
2603/***/ (function(module, exports, __webpack_require__) {
2604
2605var ListCache = __webpack_require__(/*! ./_ListCache */ "../node_modules/lodash/_ListCache.js"),
2606 stackClear = __webpack_require__(/*! ./_stackClear */ "../node_modules/lodash/_stackClear.js"),
2607 stackDelete = __webpack_require__(/*! ./_stackDelete */ "../node_modules/lodash/_stackDelete.js"),
2608 stackGet = __webpack_require__(/*! ./_stackGet */ "../node_modules/lodash/_stackGet.js"),
2609 stackHas = __webpack_require__(/*! ./_stackHas */ "../node_modules/lodash/_stackHas.js"),
2610 stackSet = __webpack_require__(/*! ./_stackSet */ "../node_modules/lodash/_stackSet.js");
2611
2612/**
2613 * Creates a stack cache object to store key-value pairs.
2614 *
2615 * @private
2616 * @constructor
2617 * @param {Array} [entries] The key-value pairs to cache.
2618 */
2619function Stack(entries) {
2620 var data = this.__data__ = new ListCache(entries);
2621 this.size = data.size;
2622}
2623
2624// Add methods to `Stack`.
2625Stack.prototype.clear = stackClear;
2626Stack.prototype['delete'] = stackDelete;
2627Stack.prototype.get = stackGet;
2628Stack.prototype.has = stackHas;
2629Stack.prototype.set = stackSet;
2630
2631module.exports = Stack;
2632
2633
2634/***/ }),
2635
2636/***/ "../node_modules/lodash/_arrayEach.js":
2637/*!********************************************!*\
2638 !*** ../node_modules/lodash/_arrayEach.js ***!
2639 \********************************************/
2640/*! no static exports found */
2641/***/ (function(module, exports) {
2642
2643/**
2644 * A specialized version of `_.forEach` for arrays without support for
2645 * iteratee shorthands.
2646 *
2647 * @private
2648 * @param {Array} [array] The array to iterate over.
2649 * @param {Function} iteratee The function invoked per iteration.
2650 * @returns {Array} Returns `array`.
2651 */
2652function arrayEach(array, iteratee) {
2653 var index = -1,
2654 length = array == null ? 0 : array.length;
2655
2656 while (++index < length) {
2657 if (iteratee(array[index], index, array) === false) {
2658 break;
2659 }
2660 }
2661 return array;
2662}
2663
2664module.exports = arrayEach;
2665
2666
2667/***/ }),
2668
2669/***/ "../node_modules/lodash/_assignValue.js":
2670/*!**********************************************!*\
2671 !*** ../node_modules/lodash/_assignValue.js ***!
2672 \**********************************************/
2673/*! no static exports found */
2674/***/ (function(module, exports, __webpack_require__) {
2675
2676var baseAssignValue = __webpack_require__(/*! ./_baseAssignValue */ "../node_modules/lodash/_baseAssignValue.js"),
2677 eq = __webpack_require__(/*! ./eq */ "../node_modules/lodash/eq.js");
2678
2679/** Used for built-in method references. */
2680var objectProto = Object.prototype;
2681
2682/** Used to check objects for own properties. */
2683var hasOwnProperty = objectProto.hasOwnProperty;
2684
2685/**
2686 * Assigns `value` to `key` of `object` if the existing value is not equivalent
2687 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
2688 * for equality comparisons.
2689 *
2690 * @private
2691 * @param {Object} object The object to modify.
2692 * @param {string} key The key of the property to assign.
2693 * @param {*} value The value to assign.
2694 */
2695function assignValue(object, key, value) {
2696 var objValue = object[key];
2697 if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
2698 (value === undefined && !(key in object))) {
2699 baseAssignValue(object, key, value);
2700 }
2701}
2702
2703module.exports = assignValue;
2704
2705
2706/***/ }),
2707
2708/***/ "../node_modules/lodash/_assocIndexOf.js":
2709/*!***********************************************!*\
2710 !*** ../node_modules/lodash/_assocIndexOf.js ***!
2711 \***********************************************/
2712/*! no static exports found */
2713/***/ (function(module, exports, __webpack_require__) {
2714
2715var eq = __webpack_require__(/*! ./eq */ "../node_modules/lodash/eq.js");
2716
2717/**
2718 * Gets the index at which the `key` is found in `array` of key-value pairs.
2719 *
2720 * @private
2721 * @param {Array} array The array to inspect.
2722 * @param {*} key The key to search for.
2723 * @returns {number} Returns the index of the matched value, else `-1`.
2724 */
2725function assocIndexOf(array, key) {
2726 var length = array.length;
2727 while (length--) {
2728 if (eq(array[length][0], key)) {
2729 return length;
2730 }
2731 }
2732 return -1;
2733}
2734
2735module.exports = assocIndexOf;
2736
2737
2738/***/ }),
2739
2740/***/ "../node_modules/lodash/_baseAssign.js":
2741/*!*********************************************!*\
2742 !*** ../node_modules/lodash/_baseAssign.js ***!
2743 \*********************************************/
2744/*! no static exports found */
2745/***/ (function(module, exports, __webpack_require__) {
2746
2747var copyObject = __webpack_require__(/*! ./_copyObject */ "../node_modules/lodash/_copyObject.js"),
2748 keys = __webpack_require__(/*! ./keys */ "../node_modules/lodash/keys.js");
2749
2750/**
2751 * The base implementation of `_.assign` without support for multiple sources
2752 * or `customizer` functions.
2753 *
2754 * @private
2755 * @param {Object} object The destination object.
2756 * @param {Object} source The source object.
2757 * @returns {Object} Returns `object`.
2758 */
2759function baseAssign(object, source) {
2760 return object && copyObject(source, keys(source), object);
2761}
2762
2763module.exports = baseAssign;
2764
2765
2766/***/ }),
2767
2768/***/ "../node_modules/lodash/_baseAssignIn.js":
2769/*!***********************************************!*\
2770 !*** ../node_modules/lodash/_baseAssignIn.js ***!
2771 \***********************************************/
2772/*! no static exports found */
2773/***/ (function(module, exports, __webpack_require__) {
2774
2775var copyObject = __webpack_require__(/*! ./_copyObject */ "../node_modules/lodash/_copyObject.js"),
2776 keysIn = __webpack_require__(/*! ./keysIn */ "../node_modules/lodash/keysIn.js");
2777
2778/**
2779 * The base implementation of `_.assignIn` without support for multiple sources
2780 * or `customizer` functions.
2781 *
2782 * @private
2783 * @param {Object} object The destination object.
2784 * @param {Object} source The source object.
2785 * @returns {Object} Returns `object`.
2786 */
2787function baseAssignIn(object, source) {
2788 return object && copyObject(source, keysIn(source), object);
2789}
2790
2791module.exports = baseAssignIn;
2792
2793
2794/***/ }),
2795
2796/***/ "../node_modules/lodash/_baseAssignValue.js":
2797/*!**************************************************!*\
2798 !*** ../node_modules/lodash/_baseAssignValue.js ***!
2799 \**************************************************/
2800/*! no static exports found */
2801/***/ (function(module, exports, __webpack_require__) {
2802
2803var defineProperty = __webpack_require__(/*! ./_defineProperty */ "../node_modules/lodash/_defineProperty.js");
2804
2805/**
2806 * The base implementation of `assignValue` and `assignMergeValue` without
2807 * value checks.
2808 *
2809 * @private
2810 * @param {Object} object The object to modify.
2811 * @param {string} key The key of the property to assign.
2812 * @param {*} value The value to assign.
2813 */
2814function baseAssignValue(object, key, value) {
2815 if (key == '__proto__' && defineProperty) {
2816 defineProperty(object, key, {
2817 'configurable': true,
2818 'enumerable': true,
2819 'value': value,
2820 'writable': true
2821 });
2822 } else {
2823 object[key] = value;
2824 }
2825}
2826
2827module.exports = baseAssignValue;
2828
2829
2830/***/ }),
2831
2832/***/ "../node_modules/lodash/_baseClone.js":
2833/*!********************************************!*\
2834 !*** ../node_modules/lodash/_baseClone.js ***!
2835 \********************************************/
2836/*! no static exports found */
2837/***/ (function(module, exports, __webpack_require__) {
2838
2839var Stack = __webpack_require__(/*! ./_Stack */ "../node_modules/lodash/_Stack.js"),
2840 arrayEach = __webpack_require__(/*! ./_arrayEach */ "../node_modules/lodash/_arrayEach.js"),
2841 assignValue = __webpack_require__(/*! ./_assignValue */ "../node_modules/lodash/_assignValue.js"),
2842 baseAssign = __webpack_require__(/*! ./_baseAssign */ "../node_modules/lodash/_baseAssign.js"),
2843 baseAssignIn = __webpack_require__(/*! ./_baseAssignIn */ "../node_modules/lodash/_baseAssignIn.js"),
2844 cloneBuffer = __webpack_require__(/*! ./_cloneBuffer */ "../node_modules/lodash/_cloneBuffer.js"),
2845 copyArray = __webpack_require__(/*! ./_copyArray */ "../node_modules/lodash/_copyArray.js"),
2846 copySymbols = __webpack_require__(/*! ./_copySymbols */ "../node_modules/lodash/_copySymbols.js"),
2847 copySymbolsIn = __webpack_require__(/*! ./_copySymbolsIn */ "../node_modules/lodash/_copySymbolsIn.js"),
2848 getAllKeys = __webpack_require__(/*! ./_getAllKeys */ "../node_modules/lodash/_getAllKeys.js"),
2849 getAllKeysIn = __webpack_require__(/*! ./_getAllKeysIn */ "../node_modules/lodash/_getAllKeysIn.js"),
2850 getTag = __webpack_require__(/*! ./_getTag */ "../node_modules/lodash/_getTag.js"),
2851 initCloneArray = __webpack_require__(/*! ./_initCloneArray */ "../node_modules/lodash/_initCloneArray.js"),
2852 initCloneByTag = __webpack_require__(/*! ./_initCloneByTag */ "../node_modules/lodash/_initCloneByTag.js"),
2853 initCloneObject = __webpack_require__(/*! ./_initCloneObject */ "../node_modules/lodash/_initCloneObject.js"),
2854 isArray = __webpack_require__(/*! ./isArray */ "../node_modules/lodash/isArray.js"),
2855 isBuffer = __webpack_require__(/*! ./isBuffer */ "../node_modules/lodash/isBuffer.js"),
2856 isMap = __webpack_require__(/*! ./isMap */ "../node_modules/lodash/isMap.js"),
2857 isObject = __webpack_require__(/*! ./isObject */ "../node_modules/lodash/isObject.js"),
2858 isSet = __webpack_require__(/*! ./isSet */ "../node_modules/lodash/isSet.js"),
2859 keys = __webpack_require__(/*! ./keys */ "../node_modules/lodash/keys.js");
2860
2861/** Used to compose bitmasks for cloning. */
2862var CLONE_DEEP_FLAG = 1,
2863 CLONE_FLAT_FLAG = 2,
2864 CLONE_SYMBOLS_FLAG = 4;
2865
2866/** `Object#toString` result references. */
2867var argsTag = '[object Arguments]',
2868 arrayTag = '[object Array]',
2869 boolTag = '[object Boolean]',
2870 dateTag = '[object Date]',
2871 errorTag = '[object Error]',
2872 funcTag = '[object Function]',
2873 genTag = '[object GeneratorFunction]',
2874 mapTag = '[object Map]',
2875 numberTag = '[object Number]',
2876 objectTag = '[object Object]',
2877 regexpTag = '[object RegExp]',
2878 setTag = '[object Set]',
2879 stringTag = '[object String]',
2880 symbolTag = '[object Symbol]',
2881 weakMapTag = '[object WeakMap]';
2882
2883var arrayBufferTag = '[object ArrayBuffer]',
2884 dataViewTag = '[object DataView]',
2885 float32Tag = '[object Float32Array]',
2886 float64Tag = '[object Float64Array]',
2887 int8Tag = '[object Int8Array]',
2888 int16Tag = '[object Int16Array]',
2889 int32Tag = '[object Int32Array]',
2890 uint8Tag = '[object Uint8Array]',
2891 uint8ClampedTag = '[object Uint8ClampedArray]',
2892 uint16Tag = '[object Uint16Array]',
2893 uint32Tag = '[object Uint32Array]';
2894
2895/** Used to identify `toStringTag` values supported by `_.clone`. */
2896var cloneableTags = {};
2897cloneableTags[argsTag] = cloneableTags[arrayTag] =
2898cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
2899cloneableTags[boolTag] = cloneableTags[dateTag] =
2900cloneableTags[float32Tag] = cloneableTags[float64Tag] =
2901cloneableTags[int8Tag] = cloneableTags[int16Tag] =
2902cloneableTags[int32Tag] = cloneableTags[mapTag] =
2903cloneableTags[numberTag] = cloneableTags[objectTag] =
2904cloneableTags[regexpTag] = cloneableTags[setTag] =
2905cloneableTags[stringTag] = cloneableTags[symbolTag] =
2906cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
2907cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
2908cloneableTags[errorTag] = cloneableTags[funcTag] =
2909cloneableTags[weakMapTag] = false;
2910
2911/**
2912 * The base implementation of `_.clone` and `_.cloneDeep` which tracks
2913 * traversed objects.
2914 *
2915 * @private
2916 * @param {*} value The value to clone.
2917 * @param {boolean} bitmask The bitmask flags.
2918 * 1 - Deep clone
2919 * 2 - Flatten inherited properties
2920 * 4 - Clone symbols
2921 * @param {Function} [customizer] The function to customize cloning.
2922 * @param {string} [key] The key of `value`.
2923 * @param {Object} [object] The parent object of `value`.
2924 * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
2925 * @returns {*} Returns the cloned value.
2926 */
2927function baseClone(value, bitmask, customizer, key, object, stack) {
2928 var result,
2929 isDeep = bitmask & CLONE_DEEP_FLAG,
2930 isFlat = bitmask & CLONE_FLAT_FLAG,
2931 isFull = bitmask & CLONE_SYMBOLS_FLAG;
2932
2933 if (customizer) {
2934 result = object ? customizer(value, key, object, stack) : customizer(value);
2935 }
2936 if (result !== undefined) {
2937 return result;
2938 }
2939 if (!isObject(value)) {
2940 return value;
2941 }
2942 var isArr = isArray(value);
2943 if (isArr) {
2944 result = initCloneArray(value);
2945 if (!isDeep) {
2946 return copyArray(value, result);
2947 }
2948 } else {
2949 var tag = getTag(value),
2950 isFunc = tag == funcTag || tag == genTag;
2951
2952 if (isBuffer(value)) {
2953 return cloneBuffer(value, isDeep);
2954 }
2955 if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
2956 result = (isFlat || isFunc) ? {} : initCloneObject(value);
2957 if (!isDeep) {
2958 return isFlat
2959 ? copySymbolsIn(value, baseAssignIn(result, value))
2960 : copySymbols(value, baseAssign(result, value));
2961 }
2962 } else {
2963 if (!cloneableTags[tag]) {
2964 return object ? value : {};
2965 }
2966 result = initCloneByTag(value, tag, isDeep);
2967 }
2968 }
2969 // Check for circular references and return its corresponding clone.
2970 stack || (stack = new Stack);
2971 var stacked = stack.get(value);
2972 if (stacked) {
2973 return stacked;
2974 }
2975 stack.set(value, result);
2976
2977 if (isSet(value)) {
2978 value.forEach(function(subValue) {
2979 result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
2980 });
2981 } else if (isMap(value)) {
2982 value.forEach(function(subValue, key) {
2983 result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
2984 });
2985 }
2986
2987 var keysFunc = isFull
2988 ? (isFlat ? getAllKeysIn : getAllKeys)
2989 : (isFlat ? keysIn : keys);
2990
2991 var props = isArr ? undefined : keysFunc(value);
2992 arrayEach(props || value, function(subValue, key) {
2993 if (props) {
2994 key = subValue;
2995 subValue = value[key];
2996 }
2997 // Recursively populate clone (susceptible to call stack limits).
2998 assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
2999 });
3000 return result;
3001}
3002
3003module.exports = baseClone;
3004
3005
3006/***/ }),
3007
3008/***/ "../node_modules/lodash/_baseCreate.js":
3009/*!*********************************************!*\
3010 !*** ../node_modules/lodash/_baseCreate.js ***!
3011 \*********************************************/
3012/*! no static exports found */
3013/***/ (function(module, exports, __webpack_require__) {
3014
3015var isObject = __webpack_require__(/*! ./isObject */ "../node_modules/lodash/isObject.js");
3016
3017/** Built-in value references. */
3018var objectCreate = Object.create;
3019
3020/**
3021 * The base implementation of `_.create` without support for assigning
3022 * properties to the created object.
3023 *
3024 * @private
3025 * @param {Object} proto The object to inherit from.
3026 * @returns {Object} Returns the new object.
3027 */
3028var baseCreate = (function() {
3029 function object() {}
3030 return function(proto) {
3031 if (!isObject(proto)) {
3032 return {};
3033 }
3034 if (objectCreate) {
3035 return objectCreate(proto);
3036 }
3037 object.prototype = proto;
3038 var result = new object;
3039 object.prototype = undefined;
3040 return result;
3041 };
3042}());
3043
3044module.exports = baseCreate;
3045
3046
3047/***/ }),
3048
3049/***/ "../node_modules/lodash/_baseGet.js":
3050/*!******************************************!*\
3051 !*** ../node_modules/lodash/_baseGet.js ***!
3052 \******************************************/
3053/*! no static exports found */
3054/***/ (function(module, exports) {
3055
3056/**
3057 * Gets the value at `key` of `object`.
3058 *
3059 * @private
3060 * @param {Object} [object] The object to query.
3061 * @param {string} key The key of the property to get.
3062 * @returns {*} Returns the property value.
3063 */
3064function getValue(object, key) {
3065 return object == null ? undefined : object[key];
3066}
3067
3068module.exports = getValue;
3069
3070
3071/***/ }),
3072
3073/***/ "../node_modules/lodash/_baseGetTag.js":
3074/*!*********************************************!*\
3075 !*** ../node_modules/lodash/_baseGetTag.js ***!
3076 \*********************************************/
3077/*! no static exports found */
3078/***/ (function(module, exports) {
3079
3080/** Used for built-in method references. */
3081var objectProto = Object.prototype;
3082
3083/**
3084 * Used to resolve the
3085 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
3086 * of values.
3087 */
3088var nativeObjectToString = objectProto.toString;
3089
3090/**
3091 * Converts `value` to a string using `Object.prototype.toString`.
3092 *
3093 * @private
3094 * @param {*} value The value to convert.
3095 * @returns {string} Returns the converted string.
3096 */
3097function objectToString(value) {
3098 return nativeObjectToString.call(value);
3099}
3100
3101module.exports = objectToString;
3102
3103
3104/***/ }),
3105
3106/***/ "../node_modules/lodash/_cloneBuffer.js":
3107/*!**********************************************!*\
3108 !*** ../node_modules/lodash/_cloneBuffer.js ***!
3109 \**********************************************/
3110/*! no static exports found */
3111/***/ (function(module, exports, __webpack_require__) {
3112
3113/* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(/*! ./_root */ "../node_modules/lodash/_root.js");
3114
3115/** Detect free variable `exports`. */
3116var freeExports = true && exports && !exports.nodeType && exports;
3117
3118/** Detect free variable `module`. */
3119var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
3120
3121/** Detect the popular CommonJS extension `module.exports`. */
3122var moduleExports = freeModule && freeModule.exports === freeExports;
3123
3124/** Built-in value references. */
3125var Buffer = moduleExports ? root.Buffer : undefined,
3126 allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
3127
3128/**
3129 * Creates a clone of `buffer`.
3130 *
3131 * @private
3132 * @param {Buffer} buffer The buffer to clone.
3133 * @param {boolean} [isDeep] Specify a deep clone.
3134 * @returns {Buffer} Returns the cloned buffer.
3135 */
3136function cloneBuffer(buffer, isDeep) {
3137 if (isDeep) {
3138 return buffer.slice();
3139 }
3140 var length = buffer.length,
3141 result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
3142
3143 buffer.copy(result);
3144 return result;
3145}
3146
3147module.exports = cloneBuffer;
3148
3149/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/module.js */ "../node_modules/webpack/buildin/module.js")(module)))
3150
3151/***/ }),
3152
3153/***/ "../node_modules/lodash/_copyArray.js":
3154/*!********************************************!*\
3155 !*** ../node_modules/lodash/_copyArray.js ***!
3156 \********************************************/
3157/*! no static exports found */
3158/***/ (function(module, exports) {
3159
3160/**
3161 * Copies the values of `source` to `array`.
3162 *
3163 * @private
3164 * @param {Array} source The array to copy values from.
3165 * @param {Array} [array=[]] The array to copy values to.
3166 * @returns {Array} Returns `array`.
3167 */
3168function copyArray(source, array) {
3169 var index = -1,
3170 length = source.length;
3171
3172 array || (array = Array(length));
3173 while (++index < length) {
3174 array[index] = source[index];
3175 }
3176 return array;
3177}
3178
3179module.exports = copyArray;
3180
3181
3182/***/ }),
3183
3184/***/ "../node_modules/lodash/_copyObject.js":
3185/*!*********************************************!*\
3186 !*** ../node_modules/lodash/_copyObject.js ***!
3187 \*********************************************/
3188/*! no static exports found */
3189/***/ (function(module, exports, __webpack_require__) {
3190
3191var assignValue = __webpack_require__(/*! ./_assignValue */ "../node_modules/lodash/_assignValue.js"),
3192 baseAssignValue = __webpack_require__(/*! ./_baseAssignValue */ "../node_modules/lodash/_baseAssignValue.js");
3193
3194/**
3195 * Copies properties of `source` to `object`.
3196 *
3197 * @private
3198 * @param {Object} source The object to copy properties from.
3199 * @param {Array} props The property identifiers to copy.
3200 * @param {Object} [object={}] The object to copy properties to.
3201 * @param {Function} [customizer] The function to customize copied values.
3202 * @returns {Object} Returns `object`.
3203 */
3204function copyObject(source, props, object, customizer) {
3205 var isNew = !object;
3206 object || (object = {});
3207
3208 var index = -1,
3209 length = props.length;
3210
3211 while (++index < length) {
3212 var key = props[index];
3213
3214 var newValue = customizer
3215 ? customizer(object[key], source[key], key, object, source)
3216 : undefined;
3217
3218 if (newValue === undefined) {
3219 newValue = source[key];
3220 }
3221 if (isNew) {
3222 baseAssignValue(object, key, newValue);
3223 } else {
3224 assignValue(object, key, newValue);
3225 }
3226 }
3227 return object;
3228}
3229
3230module.exports = copyObject;
3231
3232
3233/***/ }),
3234
3235/***/ "../node_modules/lodash/_copySymbols.js":
3236/*!**********************************************!*\
3237 !*** ../node_modules/lodash/_copySymbols.js ***!
3238 \**********************************************/
3239/*! no static exports found */
3240/***/ (function(module, exports, __webpack_require__) {
3241
3242var copyObject = __webpack_require__(/*! ./_copyObject */ "../node_modules/lodash/_copyObject.js"),
3243 getSymbols = __webpack_require__(/*! ./_getSymbols */ "../node_modules/lodash/_getSymbols.js");
3244
3245/**
3246 * Copies own symbols of `source` to `object`.
3247 *
3248 * @private
3249 * @param {Object} source The object to copy symbols from.
3250 * @param {Object} [object={}] The object to copy symbols to.
3251 * @returns {Object} Returns `object`.
3252 */
3253function copySymbols(source, object) {
3254 return copyObject(source, getSymbols(source), object);
3255}
3256
3257module.exports = copySymbols;
3258
3259
3260/***/ }),
3261
3262/***/ "../node_modules/lodash/_copySymbolsIn.js":
3263/*!************************************************!*\
3264 !*** ../node_modules/lodash/_copySymbolsIn.js ***!
3265 \************************************************/
3266/*! no static exports found */
3267/***/ (function(module, exports, __webpack_require__) {
3268
3269var copyObject = __webpack_require__(/*! ./_copyObject */ "../node_modules/lodash/_copyObject.js"),
3270 getSymbolsIn = __webpack_require__(/*! ./_getSymbolsIn */ "../node_modules/lodash/_getSymbolsIn.js");
3271
3272/**
3273 * Copies own and inherited symbols of `source` to `object`.
3274 *
3275 * @private
3276 * @param {Object} source The object to copy symbols from.
3277 * @param {Object} [object={}] The object to copy symbols to.
3278 * @returns {Object} Returns `object`.
3279 */
3280function copySymbolsIn(source, object) {
3281 return copyObject(source, getSymbolsIn(source), object);
3282}
3283
3284module.exports = copySymbolsIn;
3285
3286
3287/***/ }),
3288
3289/***/ "../node_modules/lodash/_defineProperty.js":
3290/*!*************************************************!*\
3291 !*** ../node_modules/lodash/_defineProperty.js ***!
3292 \*************************************************/
3293/*! no static exports found */
3294/***/ (function(module, exports, __webpack_require__) {
3295
3296var getNative = __webpack_require__(/*! ./_getNative */ "../node_modules/lodash/_getNative.js");
3297
3298var defineProperty = (function() {
3299 try {
3300 var func = getNative(Object, 'defineProperty');
3301 func({}, '', {});
3302 return func;
3303 } catch (e) {}
3304}());
3305
3306module.exports = defineProperty;
3307
3308
3309/***/ }),
3310
3311/***/ "../node_modules/lodash/_freeGlobal.js":
3312/*!*********************************************!*\
3313 !*** ../node_modules/lodash/_freeGlobal.js ***!
3314 \*********************************************/
3315/*! no static exports found */
3316/***/ (function(module, exports, __webpack_require__) {
3317
3318/* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */
3319var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
3320
3321module.exports = freeGlobal;
3322
3323/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "../node_modules/webpack/buildin/global.js")))
3324
3325/***/ }),
3326
3327/***/ "../node_modules/lodash/_getAllKeys.js":
3328/*!*********************************************!*\
3329 !*** ../node_modules/lodash/_getAllKeys.js ***!
3330 \*********************************************/
3331/*! no static exports found */
3332/***/ (function(module, exports, __webpack_require__) {
3333
3334var overArg = __webpack_require__(/*! ./_overArg */ "../node_modules/lodash/_overArg.js");
3335
3336/* Built-in method references for those with the same name as other `lodash` methods. */
3337var nativeKeys = overArg(Object.keys, Object);
3338
3339module.exports = nativeKeys;
3340
3341
3342/***/ }),
3343
3344/***/ "../node_modules/lodash/_getAllKeysIn.js":
3345/*!***********************************************!*\
3346 !*** ../node_modules/lodash/_getAllKeysIn.js ***!
3347 \***********************************************/
3348/*! no static exports found */
3349/***/ (function(module, exports) {
3350
3351/**
3352 * This function is like
3353 * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
3354 * except that it includes inherited enumerable properties.
3355 *
3356 * @private
3357 * @param {Object} object The object to query.
3358 * @returns {Array} Returns the array of property names.
3359 */
3360function nativeKeysIn(object) {
3361 var result = [];
3362 if (object != null) {
3363 for (var key in Object(object)) {
3364 result.push(key);
3365 }
3366 }
3367 return result;
3368}
3369
3370module.exports = nativeKeysIn;
3371
3372
3373/***/ }),
3374
3375/***/ "../node_modules/lodash/_getMapData.js":
3376/*!*********************************************!*\
3377 !*** ../node_modules/lodash/_getMapData.js ***!
3378 \*********************************************/
3379/*! no static exports found */
3380/***/ (function(module, exports, __webpack_require__) {
3381
3382var isKeyable = __webpack_require__(/*! ./_isKeyable */ "../node_modules/lodash/_isKeyable.js");
3383
3384/**
3385 * Gets the data for `map`.
3386 *
3387 * @private
3388 * @param {Object} map The map to query.
3389 * @param {string} key The reference key.
3390 * @returns {*} Returns the map data.
3391 */
3392function getMapData(map, key) {
3393 var data = map.__data__;
3394 return isKeyable(key)
3395 ? data[typeof key == 'string' ? 'string' : 'hash']
3396 : data.map;
3397}
3398
3399module.exports = getMapData;
3400
3401
3402/***/ }),
3403
3404/***/ "../node_modules/lodash/_getNative.js":
3405/*!********************************************!*\
3406 !*** ../node_modules/lodash/_getNative.js ***!
3407 \********************************************/
3408/*! no static exports found */
3409/***/ (function(module, exports) {
3410
3411/**
3412 * Gets the value at `key` of `object`.
3413 *
3414 * @private
3415 * @param {Object} [object] The object to query.
3416 * @param {string} key The key of the property to get.
3417 * @returns {*} Returns the property value.
3418 */
3419function getValue(object, key) {
3420 return object == null ? undefined : object[key];
3421}
3422
3423module.exports = getValue;
3424
3425
3426/***/ }),
3427
3428/***/ "../node_modules/lodash/_getPrototype.js":
3429/*!***********************************************!*\
3430 !*** ../node_modules/lodash/_getPrototype.js ***!
3431 \***********************************************/
3432/*! no static exports found */
3433/***/ (function(module, exports, __webpack_require__) {
3434
3435var overArg = __webpack_require__(/*! ./_overArg */ "../node_modules/lodash/_overArg.js");
3436
3437/** Built-in value references. */
3438var getPrototype = overArg(Object.getPrototypeOf, Object);
3439
3440module.exports = getPrototype;
3441
3442
3443/***/ }),
3444
3445/***/ "../node_modules/lodash/_getSymbols.js":
3446/*!*********************************************!*\
3447 !*** ../node_modules/lodash/_getSymbols.js ***!
3448 \*********************************************/
3449/*! no static exports found */
3450/***/ (function(module, exports) {
3451
3452/**
3453 * This method returns a new empty array.
3454 *
3455 * @static
3456 * @memberOf _
3457 * @since 4.13.0
3458 * @category Util
3459 * @returns {Array} Returns the new empty array.
3460 * @example
3461 *
3462 * var arrays = _.times(2, _.stubArray);
3463 *
3464 * console.log(arrays);
3465 * // => [[], []]
3466 *
3467 * console.log(arrays[0] === arrays[1]);
3468 * // => false
3469 */
3470function stubArray() {
3471 return [];
3472}
3473
3474module.exports = stubArray;
3475
3476
3477/***/ }),
3478
3479/***/ "../node_modules/lodash/_getSymbolsIn.js":
3480/*!***********************************************!*\
3481 !*** ../node_modules/lodash/_getSymbolsIn.js ***!
3482 \***********************************************/
3483/*! no static exports found */
3484/***/ (function(module, exports) {
3485
3486/**
3487 * This method returns a new empty array.
3488 *
3489 * @static
3490 * @memberOf _
3491 * @since 4.13.0
3492 * @category Util
3493 * @returns {Array} Returns the new empty array.
3494 * @example
3495 *
3496 * var arrays = _.times(2, _.stubArray);
3497 *
3498 * console.log(arrays);
3499 * // => [[], []]
3500 *
3501 * console.log(arrays[0] === arrays[1]);
3502 * // => false
3503 */
3504function stubArray() {
3505 return [];
3506}
3507
3508module.exports = stubArray;
3509
3510
3511/***/ }),
3512
3513/***/ "../node_modules/lodash/_getTag.js":
3514/*!*****************************************!*\
3515 !*** ../node_modules/lodash/_getTag.js ***!
3516 \*****************************************/
3517/*! no static exports found */
3518/***/ (function(module, exports) {
3519
3520/** Used for built-in method references. */
3521var objectProto = Object.prototype;
3522
3523/**
3524 * Used to resolve the
3525 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
3526 * of values.
3527 */
3528var nativeObjectToString = objectProto.toString;
3529
3530/**
3531 * Converts `value` to a string using `Object.prototype.toString`.
3532 *
3533 * @private
3534 * @param {*} value The value to convert.
3535 * @returns {string} Returns the converted string.
3536 */
3537function objectToString(value) {
3538 return nativeObjectToString.call(value);
3539}
3540
3541module.exports = objectToString;
3542
3543
3544/***/ }),
3545
3546/***/ "../node_modules/lodash/_hashClear.js":
3547/*!********************************************!*\
3548 !*** ../node_modules/lodash/_hashClear.js ***!
3549 \********************************************/
3550/*! no static exports found */
3551/***/ (function(module, exports, __webpack_require__) {
3552
3553var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ "../node_modules/lodash/_nativeCreate.js");
3554
3555/**
3556 * Removes all key-value entries from the hash.
3557 *
3558 * @private
3559 * @name clear
3560 * @memberOf Hash
3561 */
3562function hashClear() {
3563 this.__data__ = nativeCreate ? nativeCreate(null) : {};
3564 this.size = 0;
3565}
3566
3567module.exports = hashClear;
3568
3569
3570/***/ }),
3571
3572/***/ "../node_modules/lodash/_hashDelete.js":
3573/*!*********************************************!*\
3574 !*** ../node_modules/lodash/_hashDelete.js ***!
3575 \*********************************************/
3576/*! no static exports found */
3577/***/ (function(module, exports) {
3578
3579/**
3580 * Removes `key` and its value from the hash.
3581 *
3582 * @private
3583 * @name delete
3584 * @memberOf Hash
3585 * @param {Object} hash The hash to modify.
3586 * @param {string} key The key of the value to remove.
3587 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
3588 */
3589function hashDelete(key) {
3590 var result = this.has(key) && delete this.__data__[key];
3591 this.size -= result ? 1 : 0;
3592 return result;
3593}
3594
3595module.exports = hashDelete;
3596
3597
3598/***/ }),
3599
3600/***/ "../node_modules/lodash/_hashGet.js":
3601/*!******************************************!*\
3602 !*** ../node_modules/lodash/_hashGet.js ***!
3603 \******************************************/
3604/*! no static exports found */
3605/***/ (function(module, exports, __webpack_require__) {
3606
3607var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ "../node_modules/lodash/_nativeCreate.js");
3608
3609/** Used to stand-in for `undefined` hash values. */
3610var HASH_UNDEFINED = '__lodash_hash_undefined__';
3611
3612/** Used for built-in method references. */
3613var objectProto = Object.prototype;
3614
3615/** Used to check objects for own properties. */
3616var hasOwnProperty = objectProto.hasOwnProperty;
3617
3618/**
3619 * Gets the hash value for `key`.
3620 *
3621 * @private
3622 * @name get
3623 * @memberOf Hash
3624 * @param {string} key The key of the value to get.
3625 * @returns {*} Returns the entry value.
3626 */
3627function hashGet(key) {
3628 var data = this.__data__;
3629 if (nativeCreate) {
3630 var result = data[key];
3631 return result === HASH_UNDEFINED ? undefined : result;
3632 }
3633 return hasOwnProperty.call(data, key) ? data[key] : undefined;
3634}
3635
3636module.exports = hashGet;
3637
3638
3639/***/ }),
3640
3641/***/ "../node_modules/lodash/_hashHas.js":
3642/*!******************************************!*\
3643 !*** ../node_modules/lodash/_hashHas.js ***!
3644 \******************************************/
3645/*! no static exports found */
3646/***/ (function(module, exports, __webpack_require__) {
3647
3648var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ "../node_modules/lodash/_nativeCreate.js");
3649
3650/** Used for built-in method references. */
3651var objectProto = Object.prototype;
3652
3653/** Used to check objects for own properties. */
3654var hasOwnProperty = objectProto.hasOwnProperty;
3655
3656/**
3657 * Checks if a hash value for `key` exists.
3658 *
3659 * @private
3660 * @name has
3661 * @memberOf Hash
3662 * @param {string} key The key of the entry to check.
3663 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
3664 */
3665function hashHas(key) {
3666 var data = this.__data__;
3667 return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
3668}
3669
3670module.exports = hashHas;
3671
3672
3673/***/ }),
3674
3675/***/ "../node_modules/lodash/_hashSet.js":
3676/*!******************************************!*\
3677 !*** ../node_modules/lodash/_hashSet.js ***!
3678 \******************************************/
3679/*! no static exports found */
3680/***/ (function(module, exports, __webpack_require__) {
3681
3682var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ "../node_modules/lodash/_nativeCreate.js");
3683
3684/** Used to stand-in for `undefined` hash values. */
3685var HASH_UNDEFINED = '__lodash_hash_undefined__';
3686
3687/**
3688 * Sets the hash `key` to `value`.
3689 *
3690 * @private
3691 * @name set
3692 * @memberOf Hash
3693 * @param {string} key The key of the value to set.
3694 * @param {*} value The value to set.
3695 * @returns {Object} Returns the hash instance.
3696 */
3697function hashSet(key, value) {
3698 var data = this.__data__;
3699 this.size += this.has(key) ? 0 : 1;
3700 data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
3701 return this;
3702}
3703
3704module.exports = hashSet;
3705
3706
3707/***/ }),
3708
3709/***/ "../node_modules/lodash/_initCloneArray.js":
3710/*!*************************************************!*\
3711 !*** ../node_modules/lodash/_initCloneArray.js ***!
3712 \*************************************************/
3713/*! no static exports found */
3714/***/ (function(module, exports) {
3715
3716/** Used for built-in method references. */
3717var objectProto = Object.prototype;
3718
3719/** Used to check objects for own properties. */
3720var hasOwnProperty = objectProto.hasOwnProperty;
3721
3722/**
3723 * Initializes an array clone.
3724 *
3725 * @private
3726 * @param {Array} array The array to clone.
3727 * @returns {Array} Returns the initialized clone.
3728 */
3729function initCloneArray(array) {
3730 var length = array.length,
3731 result = new array.constructor(length);
3732
3733 // Add properties assigned by `RegExp#exec`.
3734 if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
3735 result.index = array.index;
3736 result.input = array.input;
3737 }
3738 return result;
3739}
3740
3741module.exports = initCloneArray;
3742
3743
3744/***/ }),
3745
3746/***/ "../node_modules/lodash/_initCloneByTag.js":
3747/*!*************************************************!*\
3748 !*** ../node_modules/lodash/_initCloneByTag.js ***!
3749 \*************************************************/
3750/*! no static exports found */
3751/***/ (function(module, exports) {
3752
3753/**
3754 * This method returns the first argument it receives.
3755 *
3756 * @static
3757 * @since 0.1.0
3758 * @memberOf _
3759 * @category Util
3760 * @param {*} value Any value.
3761 * @returns {*} Returns `value`.
3762 * @example
3763 *
3764 * var object = { 'a': 1 };
3765 *
3766 * console.log(_.identity(object) === object);
3767 * // => true
3768 */
3769function identity(value) {
3770 return value;
3771}
3772
3773module.exports = identity;
3774
3775
3776/***/ }),
3777
3778/***/ "../node_modules/lodash/_initCloneObject.js":
3779/*!**************************************************!*\
3780 !*** ../node_modules/lodash/_initCloneObject.js ***!
3781 \**************************************************/
3782/*! no static exports found */
3783/***/ (function(module, exports, __webpack_require__) {
3784
3785var baseCreate = __webpack_require__(/*! ./_baseCreate */ "../node_modules/lodash/_baseCreate.js"),
3786 getPrototype = __webpack_require__(/*! ./_getPrototype */ "../node_modules/lodash/_getPrototype.js"),
3787 isPrototype = __webpack_require__(/*! ./_isPrototype */ "../node_modules/lodash/_isPrototype.js");
3788
3789/**
3790 * Initializes an object clone.
3791 *
3792 * @private
3793 * @param {Object} object The object to clone.
3794 * @returns {Object} Returns the initialized clone.
3795 */
3796function initCloneObject(object) {
3797 return (typeof object.constructor == 'function' && !isPrototype(object))
3798 ? baseCreate(getPrototype(object))
3799 : {};
3800}
3801
3802module.exports = initCloneObject;
3803
3804
3805/***/ }),
3806
3807/***/ "../node_modules/lodash/_isKeyable.js":
3808/*!********************************************!*\
3809 !*** ../node_modules/lodash/_isKeyable.js ***!
3810 \********************************************/
3811/*! no static exports found */
3812/***/ (function(module, exports) {
3813
3814/**
3815 * Checks if `value` is suitable for use as unique object key.
3816 *
3817 * @private
3818 * @param {*} value The value to check.
3819 * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
3820 */
3821function isKeyable(value) {
3822 var type = typeof value;
3823 return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
3824 ? (value !== '__proto__')
3825 : (value === null);
3826}
3827
3828module.exports = isKeyable;
3829
3830
3831/***/ }),
3832
3833/***/ "../node_modules/lodash/_isPrototype.js":
3834/*!**********************************************!*\
3835 !*** ../node_modules/lodash/_isPrototype.js ***!
3836 \**********************************************/
3837/*! no static exports found */
3838/***/ (function(module, exports) {
3839
3840/**
3841 * This method returns `false`.
3842 *
3843 * @static
3844 * @memberOf _
3845 * @since 4.13.0
3846 * @category Util
3847 * @returns {boolean} Returns `false`.
3848 * @example
3849 *
3850 * _.times(2, _.stubFalse);
3851 * // => [false, false]
3852 */
3853function stubFalse() {
3854 return false;
3855}
3856
3857module.exports = stubFalse;
3858
3859
3860/***/ }),
3861
3862/***/ "../node_modules/lodash/_listCacheClear.js":
3863/*!*************************************************!*\
3864 !*** ../node_modules/lodash/_listCacheClear.js ***!
3865 \*************************************************/
3866/*! no static exports found */
3867/***/ (function(module, exports) {
3868
3869/**
3870 * Removes all key-value entries from the list cache.
3871 *
3872 * @private
3873 * @name clear
3874 * @memberOf ListCache
3875 */
3876function listCacheClear() {
3877 this.__data__ = [];
3878 this.size = 0;
3879}
3880
3881module.exports = listCacheClear;
3882
3883
3884/***/ }),
3885
3886/***/ "../node_modules/lodash/_listCacheDelete.js":
3887/*!**************************************************!*\
3888 !*** ../node_modules/lodash/_listCacheDelete.js ***!
3889 \**************************************************/
3890/*! no static exports found */
3891/***/ (function(module, exports, __webpack_require__) {
3892
3893var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ "../node_modules/lodash/_assocIndexOf.js");
3894
3895/** Used for built-in method references. */
3896var arrayProto = Array.prototype;
3897
3898/** Built-in value references. */
3899var splice = arrayProto.splice;
3900
3901/**
3902 * Removes `key` and its value from the list cache.
3903 *
3904 * @private
3905 * @name delete
3906 * @memberOf ListCache
3907 * @param {string} key The key of the value to remove.
3908 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
3909 */
3910function listCacheDelete(key) {
3911 var data = this.__data__,
3912 index = assocIndexOf(data, key);
3913
3914 if (index < 0) {
3915 return false;
3916 }
3917 var lastIndex = data.length - 1;
3918 if (index == lastIndex) {
3919 data.pop();
3920 } else {
3921 splice.call(data, index, 1);
3922 }
3923 --this.size;
3924 return true;
3925}
3926
3927module.exports = listCacheDelete;
3928
3929
3930/***/ }),
3931
3932/***/ "../node_modules/lodash/_listCacheGet.js":
3933/*!***********************************************!*\
3934 !*** ../node_modules/lodash/_listCacheGet.js ***!
3935 \***********************************************/
3936/*! no static exports found */
3937/***/ (function(module, exports, __webpack_require__) {
3938
3939var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ "../node_modules/lodash/_assocIndexOf.js");
3940
3941/**
3942 * Gets the list cache value for `key`.
3943 *
3944 * @private
3945 * @name get
3946 * @memberOf ListCache
3947 * @param {string} key The key of the value to get.
3948 * @returns {*} Returns the entry value.
3949 */
3950function listCacheGet(key) {
3951 var data = this.__data__,
3952 index = assocIndexOf(data, key);
3953
3954 return index < 0 ? undefined : data[index][1];
3955}
3956
3957module.exports = listCacheGet;
3958
3959
3960/***/ }),
3961
3962/***/ "../node_modules/lodash/_listCacheHas.js":
3963/*!***********************************************!*\
3964 !*** ../node_modules/lodash/_listCacheHas.js ***!
3965 \***********************************************/
3966/*! no static exports found */
3967/***/ (function(module, exports, __webpack_require__) {
3968
3969var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ "../node_modules/lodash/_assocIndexOf.js");
3970
3971/**
3972 * Checks if a list cache value for `key` exists.
3973 *
3974 * @private
3975 * @name has
3976 * @memberOf ListCache
3977 * @param {string} key The key of the entry to check.
3978 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
3979 */
3980function listCacheHas(key) {
3981 return assocIndexOf(this.__data__, key) > -1;
3982}
3983
3984module.exports = listCacheHas;
3985
3986
3987/***/ }),
3988
3989/***/ "../node_modules/lodash/_listCacheSet.js":
3990/*!***********************************************!*\
3991 !*** ../node_modules/lodash/_listCacheSet.js ***!
3992 \***********************************************/
3993/*! no static exports found */
3994/***/ (function(module, exports, __webpack_require__) {
3995
3996var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ "../node_modules/lodash/_assocIndexOf.js");
3997
3998/**
3999 * Sets the list cache `key` to `value`.
4000 *
4001 * @private
4002 * @name set
4003 * @memberOf ListCache
4004 * @param {string} key The key of the value to set.
4005 * @param {*} value The value to set.
4006 * @returns {Object} Returns the list cache instance.
4007 */
4008function listCacheSet(key, value) {
4009 var data = this.__data__,
4010 index = assocIndexOf(data, key);
4011
4012 if (index < 0) {
4013 ++this.size;
4014 data.push([key, value]);
4015 } else {
4016 data[index][1] = value;
4017 }
4018 return this;
4019}
4020
4021module.exports = listCacheSet;
4022
4023
4024/***/ }),
4025
4026/***/ "../node_modules/lodash/_mapCacheClear.js":
4027/*!************************************************!*\
4028 !*** ../node_modules/lodash/_mapCacheClear.js ***!
4029 \************************************************/
4030/*! no static exports found */
4031/***/ (function(module, exports, __webpack_require__) {
4032
4033var Hash = __webpack_require__(/*! ./_Hash */ "../node_modules/lodash/_Hash.js"),
4034 ListCache = __webpack_require__(/*! ./_ListCache */ "../node_modules/lodash/_ListCache.js"),
4035 Map = __webpack_require__(/*! ./_Map */ "../node_modules/lodash/_Map.js");
4036
4037/**
4038 * Removes all key-value entries from the map.
4039 *
4040 * @private
4041 * @name clear
4042 * @memberOf MapCache
4043 */
4044function mapCacheClear() {
4045 this.size = 0;
4046 this.__data__ = {
4047 'hash': new Hash,
4048 'map': new (Map || ListCache),
4049 'string': new Hash
4050 };
4051}
4052
4053module.exports = mapCacheClear;
4054
4055
4056/***/ }),
4057
4058/***/ "../node_modules/lodash/_mapCacheDelete.js":
4059/*!*************************************************!*\
4060 !*** ../node_modules/lodash/_mapCacheDelete.js ***!
4061 \*************************************************/
4062/*! no static exports found */
4063/***/ (function(module, exports, __webpack_require__) {
4064
4065var getMapData = __webpack_require__(/*! ./_getMapData */ "../node_modules/lodash/_getMapData.js");
4066
4067/**
4068 * Removes `key` and its value from the map.
4069 *
4070 * @private
4071 * @name delete
4072 * @memberOf MapCache
4073 * @param {string} key The key of the value to remove.
4074 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
4075 */
4076function mapCacheDelete(key) {
4077 var result = getMapData(this, key)['delete'](key);
4078 this.size -= result ? 1 : 0;
4079 return result;
4080}
4081
4082module.exports = mapCacheDelete;
4083
4084
4085/***/ }),
4086
4087/***/ "../node_modules/lodash/_mapCacheGet.js":
4088/*!**********************************************!*\
4089 !*** ../node_modules/lodash/_mapCacheGet.js ***!
4090 \**********************************************/
4091/*! no static exports found */
4092/***/ (function(module, exports, __webpack_require__) {
4093
4094var getMapData = __webpack_require__(/*! ./_getMapData */ "../node_modules/lodash/_getMapData.js");
4095
4096/**
4097 * Gets the map value for `key`.
4098 *
4099 * @private
4100 * @name get
4101 * @memberOf MapCache
4102 * @param {string} key The key of the value to get.
4103 * @returns {*} Returns the entry value.
4104 */
4105function mapCacheGet(key) {
4106 return getMapData(this, key).get(key);
4107}
4108
4109module.exports = mapCacheGet;
4110
4111
4112/***/ }),
4113
4114/***/ "../node_modules/lodash/_mapCacheHas.js":
4115/*!**********************************************!*\
4116 !*** ../node_modules/lodash/_mapCacheHas.js ***!
4117 \**********************************************/
4118/*! no static exports found */
4119/***/ (function(module, exports, __webpack_require__) {
4120
4121var getMapData = __webpack_require__(/*! ./_getMapData */ "../node_modules/lodash/_getMapData.js");
4122
4123/**
4124 * Checks if a map value for `key` exists.
4125 *
4126 * @private
4127 * @name has
4128 * @memberOf MapCache
4129 * @param {string} key The key of the entry to check.
4130 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
4131 */
4132function mapCacheHas(key) {
4133 return getMapData(this, key).has(key);
4134}
4135
4136module.exports = mapCacheHas;
4137
4138
4139/***/ }),
4140
4141/***/ "../node_modules/lodash/_mapCacheSet.js":
4142/*!**********************************************!*\
4143 !*** ../node_modules/lodash/_mapCacheSet.js ***!
4144 \**********************************************/
4145/*! no static exports found */
4146/***/ (function(module, exports, __webpack_require__) {
4147
4148var getMapData = __webpack_require__(/*! ./_getMapData */ "../node_modules/lodash/_getMapData.js");
4149
4150/**
4151 * Sets the map `key` to `value`.
4152 *
4153 * @private
4154 * @name set
4155 * @memberOf MapCache
4156 * @param {string} key The key of the value to set.
4157 * @param {*} value The value to set.
4158 * @returns {Object} Returns the map cache instance.
4159 */
4160function mapCacheSet(key, value) {
4161 var data = getMapData(this, key),
4162 size = data.size;
4163
4164 data.set(key, value);
4165 this.size += data.size == size ? 0 : 1;
4166 return this;
4167}
4168
4169module.exports = mapCacheSet;
4170
4171
4172/***/ }),
4173
4174/***/ "../node_modules/lodash/_nativeCreate.js":
4175/*!***********************************************!*\
4176 !*** ../node_modules/lodash/_nativeCreate.js ***!
4177 \***********************************************/
4178/*! no static exports found */
4179/***/ (function(module, exports, __webpack_require__) {
4180
4181var getNative = __webpack_require__(/*! ./_getNative */ "../node_modules/lodash/_getNative.js");
4182
4183/* Built-in method references that are verified to be native. */
4184var nativeCreate = getNative(Object, 'create');
4185
4186module.exports = nativeCreate;
4187
4188
4189/***/ }),
4190
4191/***/ "../node_modules/lodash/_overArg.js":
4192/*!******************************************!*\
4193 !*** ../node_modules/lodash/_overArg.js ***!
4194 \******************************************/
4195/*! no static exports found */
4196/***/ (function(module, exports) {
4197
4198/**
4199 * Creates a unary function that invokes `func` with its argument transformed.
4200 *
4201 * @private
4202 * @param {Function} func The function to wrap.
4203 * @param {Function} transform The argument transform.
4204 * @returns {Function} Returns the new function.
4205 */
4206function overArg(func, transform) {
4207 return function(arg) {
4208 return func(transform(arg));
4209 };
4210}
4211
4212module.exports = overArg;
4213
4214
4215/***/ }),
4216
4217/***/ "../node_modules/lodash/_root.js":
4218/*!***************************************!*\
4219 !*** ../node_modules/lodash/_root.js ***!
4220 \***************************************/
4221/*! no static exports found */
4222/***/ (function(module, exports, __webpack_require__) {
4223
4224var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ "../node_modules/lodash/_freeGlobal.js");
4225
4226/** Detect free variable `self`. */
4227var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
4228
4229/** Used as a reference to the global object. */
4230var root = freeGlobal || freeSelf || Function('return this')();
4231
4232module.exports = root;
4233
4234
4235/***/ }),
4236
4237/***/ "../node_modules/lodash/_stackClear.js":
4238/*!*********************************************!*\
4239 !*** ../node_modules/lodash/_stackClear.js ***!
4240 \*********************************************/
4241/*! no static exports found */
4242/***/ (function(module, exports, __webpack_require__) {
4243
4244var ListCache = __webpack_require__(/*! ./_ListCache */ "../node_modules/lodash/_ListCache.js");
4245
4246/**
4247 * Removes all key-value entries from the stack.
4248 *
4249 * @private
4250 * @name clear
4251 * @memberOf Stack
4252 */
4253function stackClear() {
4254 this.__data__ = new ListCache;
4255 this.size = 0;
4256}
4257
4258module.exports = stackClear;
4259
4260
4261/***/ }),
4262
4263/***/ "../node_modules/lodash/_stackDelete.js":
4264/*!**********************************************!*\
4265 !*** ../node_modules/lodash/_stackDelete.js ***!
4266 \**********************************************/
4267/*! no static exports found */
4268/***/ (function(module, exports) {
4269
4270/**
4271 * Removes `key` and its value from the stack.
4272 *
4273 * @private
4274 * @name delete
4275 * @memberOf Stack
4276 * @param {string} key The key of the value to remove.
4277 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
4278 */
4279function stackDelete(key) {
4280 var data = this.__data__,
4281 result = data['delete'](key);
4282
4283 this.size = data.size;
4284 return result;
4285}
4286
4287module.exports = stackDelete;
4288
4289
4290/***/ }),
4291
4292/***/ "../node_modules/lodash/_stackGet.js":
4293/*!*******************************************!*\
4294 !*** ../node_modules/lodash/_stackGet.js ***!
4295 \*******************************************/
4296/*! no static exports found */
4297/***/ (function(module, exports) {
4298
4299/**
4300 * Gets the stack value for `key`.
4301 *
4302 * @private
4303 * @name get
4304 * @memberOf Stack
4305 * @param {string} key The key of the value to get.
4306 * @returns {*} Returns the entry value.
4307 */
4308function stackGet(key) {
4309 return this.__data__.get(key);
4310}
4311
4312module.exports = stackGet;
4313
4314
4315/***/ }),
4316
4317/***/ "../node_modules/lodash/_stackHas.js":
4318/*!*******************************************!*\
4319 !*** ../node_modules/lodash/_stackHas.js ***!
4320 \*******************************************/
4321/*! no static exports found */
4322/***/ (function(module, exports) {
4323
4324/**
4325 * Checks if a stack value for `key` exists.
4326 *
4327 * @private
4328 * @name has
4329 * @memberOf Stack
4330 * @param {string} key The key of the entry to check.
4331 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
4332 */
4333function stackHas(key) {
4334 return this.__data__.has(key);
4335}
4336
4337module.exports = stackHas;
4338
4339
4340/***/ }),
4341
4342/***/ "../node_modules/lodash/_stackSet.js":
4343/*!*******************************************!*\
4344 !*** ../node_modules/lodash/_stackSet.js ***!
4345 \*******************************************/
4346/*! no static exports found */
4347/***/ (function(module, exports, __webpack_require__) {
4348
4349var ListCache = __webpack_require__(/*! ./_ListCache */ "../node_modules/lodash/_ListCache.js"),
4350 Map = __webpack_require__(/*! ./_Map */ "../node_modules/lodash/_Map.js"),
4351 MapCache = __webpack_require__(/*! ./_MapCache */ "../node_modules/lodash/_MapCache.js");
4352
4353/** Used as the size to enable large array optimizations. */
4354var LARGE_ARRAY_SIZE = 200;
4355
4356/**
4357 * Sets the stack `key` to `value`.
4358 *
4359 * @private
4360 * @name set
4361 * @memberOf Stack
4362 * @param {string} key The key of the value to set.
4363 * @param {*} value The value to set.
4364 * @returns {Object} Returns the stack cache instance.
4365 */
4366function stackSet(key, value) {
4367 var data = this.__data__;
4368 if (data instanceof ListCache) {
4369 var pairs = data.__data__;
4370 if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
4371 pairs.push([key, value]);
4372 this.size = ++data.size;
4373 return this;
4374 }
4375 data = this.__data__ = new MapCache(pairs);
4376 }
4377 data.set(key, value);
4378 this.size = data.size;
4379 return this;
4380}
4381
4382module.exports = stackSet;
4383
4384
4385/***/ }),
4386
4387/***/ "../node_modules/lodash/cloneDeep.js":
4388/*!*******************************************!*\
4389 !*** ../node_modules/lodash/cloneDeep.js ***!
4390 \*******************************************/
4391/*! no static exports found */
4392/***/ (function(module, exports, __webpack_require__) {
4393
4394var baseClone = __webpack_require__(/*! ./_baseClone */ "../node_modules/lodash/_baseClone.js");
4395
4396/** Used to compose bitmasks for cloning. */
4397var CLONE_DEEP_FLAG = 1,
4398 CLONE_SYMBOLS_FLAG = 4;
4399
4400/**
4401 * This method is like `_.clone` except that it recursively clones `value`.
4402 *
4403 * @static
4404 * @memberOf _
4405 * @since 1.0.0
4406 * @category Lang
4407 * @param {*} value The value to recursively clone.
4408 * @returns {*} Returns the deep cloned value.
4409 * @see _.clone
4410 * @example
4411 *
4412 * var objects = [{ 'a': 1 }, { 'b': 2 }];
4413 *
4414 * var deep = _.cloneDeep(objects);
4415 * console.log(deep[0] === objects[0]);
4416 * // => false
4417 */
4418function cloneDeep(value) {
4419 return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
4420}
4421
4422module.exports = cloneDeep;
4423
4424
4425/***/ }),
4426
4427/***/ "../node_modules/lodash/eq.js":
4428/*!************************************!*\
4429 !*** ../node_modules/lodash/eq.js ***!
4430 \************************************/
4431/*! no static exports found */
4432/***/ (function(module, exports) {
4433
4434/**
4435 * Performs a
4436 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
4437 * comparison between two values to determine if they are equivalent.
4438 *
4439 * @static
4440 * @memberOf _
4441 * @since 4.0.0
4442 * @category Lang
4443 * @param {*} value The value to compare.
4444 * @param {*} other The other value to compare.
4445 * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
4446 * @example
4447 *
4448 * var object = { 'a': 1 };
4449 * var other = { 'a': 1 };
4450 *
4451 * _.eq(object, object);
4452 * // => true
4453 *
4454 * _.eq(object, other);
4455 * // => false
4456 *
4457 * _.eq('a', 'a');
4458 * // => true
4459 *
4460 * _.eq('a', Object('a'));
4461 * // => false
4462 *
4463 * _.eq(NaN, NaN);
4464 * // => true
4465 */
4466function eq(value, other) {
4467 return value === other || (value !== value && other !== other);
4468}
4469
4470module.exports = eq;
4471
4472
4473/***/ }),
4474
4475/***/ "../node_modules/lodash/get.js":
4476/*!*************************************!*\
4477 !*** ../node_modules/lodash/get.js ***!
4478 \*************************************/
4479/*! no static exports found */
4480/***/ (function(module, exports, __webpack_require__) {
4481
4482var baseGet = __webpack_require__(/*! ./_baseGet */ "../node_modules/lodash/_baseGet.js");
4483
4484/**
4485 * Gets the value at `path` of `object`. If the resolved value is
4486 * `undefined`, the `defaultValue` is returned in its place.
4487 *
4488 * @static
4489 * @memberOf _
4490 * @since 3.7.0
4491 * @category Object
4492 * @param {Object} object The object to query.
4493 * @param {Array|string} path The path of the property to get.
4494 * @param {*} [defaultValue] The value returned for `undefined` resolved values.
4495 * @returns {*} Returns the resolved value.
4496 * @example
4497 *
4498 * var object = { 'a': [{ 'b': { 'c': 3 } }] };
4499 *
4500 * _.get(object, 'a[0].b.c');
4501 * // => 3
4502 *
4503 * _.get(object, ['a', '0', 'b', 'c']);
4504 * // => 3
4505 *
4506 * _.get(object, 'a.b.c', 'default');
4507 * // => 'default'
4508 */
4509function get(object, path, defaultValue) {
4510 var result = object == null ? undefined : baseGet(object, path);
4511 return result === undefined ? defaultValue : result;
4512}
4513
4514module.exports = get;
4515
4516
4517/***/ }),
4518
4519/***/ "../node_modules/lodash/isArray.js":
4520/*!*****************************************!*\
4521 !*** ../node_modules/lodash/isArray.js ***!
4522 \*****************************************/
4523/*! no static exports found */
4524/***/ (function(module, exports) {
4525
4526/**
4527 * Checks if `value` is classified as an `Array` object.
4528 *
4529 * @static
4530 * @memberOf _
4531 * @since 0.1.0
4532 * @category Lang
4533 * @param {*} value The value to check.
4534 * @returns {boolean} Returns `true` if `value` is an array, else `false`.
4535 * @example
4536 *
4537 * _.isArray([1, 2, 3]);
4538 * // => true
4539 *
4540 * _.isArray(document.body.children);
4541 * // => false
4542 *
4543 * _.isArray('abc');
4544 * // => false
4545 *
4546 * _.isArray(_.noop);
4547 * // => false
4548 */
4549var isArray = Array.isArray;
4550
4551module.exports = isArray;
4552
4553
4554/***/ }),
4555
4556/***/ "../node_modules/lodash/isBuffer.js":
4557/*!******************************************!*\
4558 !*** ../node_modules/lodash/isBuffer.js ***!
4559 \******************************************/
4560/*! no static exports found */
4561/***/ (function(module, exports) {
4562
4563/**
4564 * This method returns `false`.
4565 *
4566 * @static
4567 * @memberOf _
4568 * @since 4.13.0
4569 * @category Util
4570 * @returns {boolean} Returns `false`.
4571 * @example
4572 *
4573 * _.times(2, _.stubFalse);
4574 * // => [false, false]
4575 */
4576function stubFalse() {
4577 return false;
4578}
4579
4580module.exports = stubFalse;
4581
4582
4583/***/ }),
4584
4585/***/ "../node_modules/lodash/isMap.js":
4586/*!***************************************!*\
4587 !*** ../node_modules/lodash/isMap.js ***!
4588 \***************************************/
4589/*! no static exports found */
4590/***/ (function(module, exports) {
4591
4592/**
4593 * This method returns `false`.
4594 *
4595 * @static
4596 * @memberOf _
4597 * @since 4.13.0
4598 * @category Util
4599 * @returns {boolean} Returns `false`.
4600 * @example
4601 *
4602 * _.times(2, _.stubFalse);
4603 * // => [false, false]
4604 */
4605function stubFalse() {
4606 return false;
4607}
4608
4609module.exports = stubFalse;
4610
4611
4612/***/ }),
4613
4614/***/ "../node_modules/lodash/isObject.js":
4615/*!******************************************!*\
4616 !*** ../node_modules/lodash/isObject.js ***!
4617 \******************************************/
4618/*! no static exports found */
4619/***/ (function(module, exports) {
4620
4621/**
4622 * Checks if `value` is the
4623 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
4624 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
4625 *
4626 * @static
4627 * @memberOf _
4628 * @since 0.1.0
4629 * @category Lang
4630 * @param {*} value The value to check.
4631 * @returns {boolean} Returns `true` if `value` is an object, else `false`.
4632 * @example
4633 *
4634 * _.isObject({});
4635 * // => true
4636 *
4637 * _.isObject([1, 2, 3]);
4638 * // => true
4639 *
4640 * _.isObject(_.noop);
4641 * // => true
4642 *
4643 * _.isObject(null);
4644 * // => false
4645 */
4646function isObject(value) {
4647 var type = typeof value;
4648 return value != null && (type == 'object' || type == 'function');
4649}
4650
4651module.exports = isObject;
4652
4653
4654/***/ }),
4655
4656/***/ "../node_modules/lodash/isObjectLike.js":
4657/*!**********************************************!*\
4658 !*** ../node_modules/lodash/isObjectLike.js ***!
4659 \**********************************************/
4660/*! no static exports found */
4661/***/ (function(module, exports) {
4662
4663/**
4664 * Checks if `value` is object-like. A value is object-like if it's not `null`
4665 * and has a `typeof` result of "object".
4666 *
4667 * @static
4668 * @memberOf _
4669 * @since 4.0.0
4670 * @category Lang
4671 * @param {*} value The value to check.
4672 * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
4673 * @example
4674 *
4675 * _.isObjectLike({});
4676 * // => true
4677 *
4678 * _.isObjectLike([1, 2, 3]);
4679 * // => true
4680 *
4681 * _.isObjectLike(_.noop);
4682 * // => false
4683 *
4684 * _.isObjectLike(null);
4685 * // => false
4686 */
4687function isObjectLike(value) {
4688 return value != null && typeof value == 'object';
4689}
4690
4691module.exports = isObjectLike;
4692
4693
4694/***/ }),
4695
4696/***/ "../node_modules/lodash/isPlainObject.js":
4697/*!***********************************************!*\
4698 !*** ../node_modules/lodash/isPlainObject.js ***!
4699 \***********************************************/
4700/*! no static exports found */
4701/***/ (function(module, exports, __webpack_require__) {
4702
4703var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "../node_modules/lodash/_baseGetTag.js"),
4704 getPrototype = __webpack_require__(/*! ./_getPrototype */ "../node_modules/lodash/_getPrototype.js"),
4705 isObjectLike = __webpack_require__(/*! ./isObjectLike */ "../node_modules/lodash/isObjectLike.js");
4706
4707/** `Object#toString` result references. */
4708var objectTag = '[object Object]';
4709
4710/** Used for built-in method references. */
4711var funcProto = Function.prototype,
4712 objectProto = Object.prototype;
4713
4714/** Used to resolve the decompiled source of functions. */
4715var funcToString = funcProto.toString;
4716
4717/** Used to check objects for own properties. */
4718var hasOwnProperty = objectProto.hasOwnProperty;
4719
4720/** Used to infer the `Object` constructor. */
4721var objectCtorString = funcToString.call(Object);
4722
4723/**
4724 * Checks if `value` is a plain object, that is, an object created by the
4725 * `Object` constructor or one with a `[[Prototype]]` of `null`.
4726 *
4727 * @static
4728 * @memberOf _
4729 * @since 0.8.0
4730 * @category Lang
4731 * @param {*} value The value to check.
4732 * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
4733 * @example
4734 *
4735 * function Foo() {
4736 * this.a = 1;
4737 * }
4738 *
4739 * _.isPlainObject(new Foo);
4740 * // => false
4741 *
4742 * _.isPlainObject([1, 2, 3]);
4743 * // => false
4744 *
4745 * _.isPlainObject({ 'x': 0, 'y': 0 });
4746 * // => true
4747 *
4748 * _.isPlainObject(Object.create(null));
4749 * // => true
4750 */
4751function isPlainObject(value) {
4752 if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
4753 return false;
4754 }
4755 var proto = getPrototype(value);
4756 if (proto === null) {
4757 return true;
4758 }
4759 var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
4760 return typeof Ctor == 'function' && Ctor instanceof Ctor &&
4761 funcToString.call(Ctor) == objectCtorString;
4762}
4763
4764module.exports = isPlainObject;
4765
4766
4767/***/ }),
4768
4769/***/ "../node_modules/lodash/isSet.js":
4770/*!***************************************!*\
4771 !*** ../node_modules/lodash/isSet.js ***!
4772 \***************************************/
4773/*! no static exports found */
4774/***/ (function(module, exports) {
4775
4776/**
4777 * This method returns `false`.
4778 *
4779 * @static
4780 * @memberOf _
4781 * @since 4.13.0
4782 * @category Util
4783 * @returns {boolean} Returns `false`.
4784 * @example
4785 *
4786 * _.times(2, _.stubFalse);
4787 * // => [false, false]
4788 */
4789function stubFalse() {
4790 return false;
4791}
4792
4793module.exports = stubFalse;
4794
4795
4796/***/ }),
4797
4798/***/ "../node_modules/lodash/keys.js":
4799/*!**************************************!*\
4800 !*** ../node_modules/lodash/keys.js ***!
4801 \**************************************/
4802/*! no static exports found */
4803/***/ (function(module, exports, __webpack_require__) {
4804
4805var overArg = __webpack_require__(/*! ./_overArg */ "../node_modules/lodash/_overArg.js");
4806
4807/* Built-in method references for those with the same name as other `lodash` methods. */
4808var nativeKeys = overArg(Object.keys, Object);
4809
4810module.exports = nativeKeys;
4811
4812
4813/***/ }),
4814
4815/***/ "../node_modules/lodash/keysIn.js":
4816/*!****************************************!*\
4817 !*** ../node_modules/lodash/keysIn.js ***!
4818 \****************************************/
4819/*! no static exports found */
4820/***/ (function(module, exports) {
4821
4822/**
4823 * This function is like
4824 * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
4825 * except that it includes inherited enumerable properties.
4826 *
4827 * @private
4828 * @param {Object} object The object to query.
4829 * @returns {Array} Returns the array of property names.
4830 */
4831function nativeKeysIn(object) {
4832 var result = [];
4833 if (object != null) {
4834 for (var key in Object(object)) {
4835 result.push(key);
4836 }
4837 }
4838 return result;
4839}
4840
4841module.exports = nativeKeysIn;
4842
4843
4844/***/ }),
4845
4846/***/ "../node_modules/process/browser.js":
4847/*!******************************************!*\
4848 !*** ../node_modules/process/browser.js ***!
4849 \******************************************/
4850/*! no static exports found */
4851/***/ (function(module, exports) {
4852
4853// shim for using process in browser
4854var process = module.exports = {};
4855
4856// cached from whatever global is present so that test runners that stub it
4857// don't break things. But we need to wrap it in a try catch in case it is
4858// wrapped in strict mode code which doesn't define any globals. It's inside a
4859// function because try/catches deoptimize in certain engines.
4860
4861var cachedSetTimeout;
4862var cachedClearTimeout;
4863
4864function defaultSetTimout() {
4865 throw new Error('setTimeout has not been defined');
4866}
4867function defaultClearTimeout () {
4868 throw new Error('clearTimeout has not been defined');
4869}
4870(function () {
4871 try {
4872 if (typeof setTimeout === 'function') {
4873 cachedSetTimeout = setTimeout;
4874 } else {
4875 cachedSetTimeout = defaultSetTimout;
4876 }
4877 } catch (e) {
4878 cachedSetTimeout = defaultSetTimout;
4879 }
4880 try {
4881 if (typeof clearTimeout === 'function') {
4882 cachedClearTimeout = clearTimeout;
4883 } else {
4884 cachedClearTimeout = defaultClearTimeout;
4885 }
4886 } catch (e) {
4887 cachedClearTimeout = defaultClearTimeout;
4888 }
4889} ())
4890function runTimeout(fun) {
4891 if (cachedSetTimeout === setTimeout) {
4892 //normal enviroments in sane situations
4893 return setTimeout(fun, 0);
4894 }
4895 // if setTimeout wasn't available but was latter defined
4896 if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
4897 cachedSetTimeout = setTimeout;
4898 return setTimeout(fun, 0);
4899 }
4900 try {
4901 // when when somebody has screwed with setTimeout but no I.E. maddness
4902 return cachedSetTimeout(fun, 0);
4903 } catch(e){
4904 try {
4905 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
4906 return cachedSetTimeout.call(null, fun, 0);
4907 } catch(e){
4908 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
4909 return cachedSetTimeout.call(this, fun, 0);
4910 }
4911 }
4912
4913
4914}
4915function runClearTimeout(marker) {
4916 if (cachedClearTimeout === clearTimeout) {
4917 //normal enviroments in sane situations
4918 return clearTimeout(marker);
4919 }
4920 // if clearTimeout wasn't available but was latter defined
4921 if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
4922 cachedClearTimeout = clearTimeout;
4923 return clearTimeout(marker);
4924 }
4925 try {
4926 // when when somebody has screwed with setTimeout but no I.E. maddness
4927 return cachedClearTimeout(marker);
4928 } catch (e){
4929 try {
4930 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
4931 return cachedClearTimeout.call(null, marker);
4932 } catch (e){
4933 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
4934 // Some versions of I.E. have different rules for clearTimeout vs setTimeout
4935 return cachedClearTimeout.call(this, marker);
4936 }
4937 }
4938
4939
4940
4941}
4942var queue = [];
4943var draining = false;
4944var currentQueue;
4945var queueIndex = -1;
4946
4947function cleanUpNextTick() {
4948 if (!draining || !currentQueue) {
4949 return;
4950 }
4951 draining = false;
4952 if (currentQueue.length) {
4953 queue = currentQueue.concat(queue);
4954 } else {
4955 queueIndex = -1;
4956 }
4957 if (queue.length) {
4958 drainQueue();
4959 }
4960}
4961
4962function drainQueue() {
4963 if (draining) {
4964 return;
4965 }
4966 var timeout = runTimeout(cleanUpNextTick);
4967 draining = true;
4968
4969 var len = queue.length;
4970 while(len) {
4971 currentQueue = queue;
4972 queue = [];
4973 while (++queueIndex < len) {
4974 if (currentQueue) {
4975 currentQueue[queueIndex].run();
4976 }
4977 }
4978 queueIndex = -1;
4979 len = queue.length;
4980 }
4981 currentQueue = null;
4982 draining = false;
4983 runClearTimeout(timeout);
4984}
4985
4986process.nextTick = function (fun) {
4987 var args = new Array(arguments.length - 1);
4988 if (arguments.length > 1) {
4989 for (var i = 1; i < arguments.length; i++) {
4990 args[i - 1] = arguments[i];
4991 }
4992 }
4993 queue.push(new Item(fun, args));
4994 if (queue.length === 1 && !draining) {
4995 runTimeout(drainQueue);
4996 }
4997};
4998
4999// v8 likes predictible objects
5000function Item(fun, array) {
5001 this.fun = fun;
5002 this.array = array;
5003}
5004Item.prototype.run = function () {
5005 this.fun.apply(null, this.array);
5006};
5007process.title = 'browser';
5008process.browser = true;
5009process.env = {};
5010process.argv = [];
5011process.version = ''; // empty string to avoid regexp issues
5012process.versions = {};
5013
5014function noop() {}
5015
5016process.on = noop;
5017process.addListener = noop;
5018process.once = noop;
5019process.off = noop;
5020process.removeListener = noop;
5021process.removeAllListeners = noop;
5022process.emit = noop;
5023process.prependListener = noop;
5024process.prependOnceListener = noop;
5025
5026process.listeners = function (name) { return [] }
5027
5028process.binding = function (name) {
5029 throw new Error('process.binding is not supported');
5030};
5031
5032process.cwd = function () { return '/' };
5033process.chdir = function (dir) {
5034 throw new Error('process.chdir is not supported');
5035};
5036process.umask = function() { return 0; };
5037
5038
5039/***/ }),
5040
5041/***/ "../node_modules/qs/lib/formats.js":
5042/*!*****************************************!*\
5043 !*** ../node_modules/qs/lib/formats.js ***!
5044 \*****************************************/
5045/*! no static exports found */
5046/***/ (function(module, exports, __webpack_require__) {
5047
5048"use strict";
5049
5050
5051var replace = String.prototype.replace;
5052var percentTwenties = /%20/g;
5053
5054var util = __webpack_require__(/*! ./utils */ "../node_modules/qs/lib/utils.js");
5055
5056var Format = {
5057 RFC1738: 'RFC1738',
5058 RFC3986: 'RFC3986'
5059};
5060
5061module.exports = util.assign(
5062 {
5063 'default': Format.RFC3986,
5064 formatters: {
5065 RFC1738: function (value) {
5066 return replace.call(value, percentTwenties, '+');
5067 },
5068 RFC3986: function (value) {
5069 return String(value);
5070 }
5071 }
5072 },
5073 Format
5074);
5075
5076
5077/***/ }),
5078
5079/***/ "../node_modules/qs/lib/index.js":
5080/*!***************************************!*\
5081 !*** ../node_modules/qs/lib/index.js ***!
5082 \***************************************/
5083/*! no static exports found */
5084/***/ (function(module, exports, __webpack_require__) {
5085
5086"use strict";
5087
5088
5089var stringify = __webpack_require__(/*! ./stringify */ "../node_modules/qs/lib/stringify.js");
5090var parse = __webpack_require__(/*! ./parse */ "../node_modules/qs/lib/parse.js");
5091var formats = __webpack_require__(/*! ./formats */ "../node_modules/qs/lib/formats.js");
5092
5093module.exports = {
5094 formats: formats,
5095 parse: parse,
5096 stringify: stringify
5097};
5098
5099
5100/***/ }),
5101
5102/***/ "../node_modules/qs/lib/parse.js":
5103/*!***************************************!*\
5104 !*** ../node_modules/qs/lib/parse.js ***!
5105 \***************************************/
5106/*! no static exports found */
5107/***/ (function(module, exports, __webpack_require__) {
5108
5109"use strict";
5110
5111
5112var utils = __webpack_require__(/*! ./utils */ "../node_modules/qs/lib/utils.js");
5113
5114var has = Object.prototype.hasOwnProperty;
5115var isArray = Array.isArray;
5116
5117var defaults = {
5118 allowDots: false,
5119 allowPrototypes: false,
5120 arrayLimit: 20,
5121 charset: 'utf-8',
5122 charsetSentinel: false,
5123 comma: false,
5124 decoder: utils.decode,
5125 delimiter: '&',
5126 depth: 5,
5127 ignoreQueryPrefix: false,
5128 interpretNumericEntities: false,
5129 parameterLimit: 1000,
5130 parseArrays: true,
5131 plainObjects: false,
5132 strictNullHandling: false
5133};
5134
5135var interpretNumericEntities = function (str) {
5136 return str.replace(/&#(\d+);/g, function ($0, numberStr) {
5137 return String.fromCharCode(parseInt(numberStr, 10));
5138 });
5139};
5140
5141var parseArrayValue = function (val, options) {
5142 if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
5143 return val.split(',');
5144 }
5145
5146 return val;
5147};
5148
5149// This is what browsers will submit when the ✓ character occurs in an
5150// application/x-www-form-urlencoded body and the encoding of the page containing
5151// the form is iso-8859-1, or when the submitted form has an accept-charset
5152// attribute of iso-8859-1. Presumably also with other charsets that do not contain
5153// the ✓ character, such as us-ascii.
5154var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('&#10003;')
5155
5156// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.
5157var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
5158
5159var parseValues = function parseQueryStringValues(str, options) {
5160 var obj = {};
5161 var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
5162 var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
5163 var parts = cleanStr.split(options.delimiter, limit);
5164 var skipIndex = -1; // Keep track of where the utf8 sentinel was found
5165 var i;
5166
5167 var charset = options.charset;
5168 if (options.charsetSentinel) {
5169 for (i = 0; i < parts.length; ++i) {
5170 if (parts[i].indexOf('utf8=') === 0) {
5171 if (parts[i] === charsetSentinel) {
5172 charset = 'utf-8';
5173 } else if (parts[i] === isoSentinel) {
5174 charset = 'iso-8859-1';
5175 }
5176 skipIndex = i;
5177 i = parts.length; // The eslint settings do not allow break;
5178 }
5179 }
5180 }
5181
5182 for (i = 0; i < parts.length; ++i) {
5183 if (i === skipIndex) {
5184 continue;
5185 }
5186 var part = parts[i];
5187
5188 var bracketEqualsPos = part.indexOf(']=');
5189 var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
5190
5191 var key, val;
5192 if (pos === -1) {
5193 key = options.decoder(part, defaults.decoder, charset, 'key');
5194 val = options.strictNullHandling ? null : '';
5195 } else {
5196 key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
5197 val = utils.maybeMap(
5198 parseArrayValue(part.slice(pos + 1), options),
5199 function (encodedVal) {
5200 return options.decoder(encodedVal, defaults.decoder, charset, 'value');
5201 }
5202 );
5203 }
5204
5205 if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
5206 val = interpretNumericEntities(val);
5207 }
5208
5209 if (part.indexOf('[]=') > -1) {
5210 val = isArray(val) ? [val] : val;
5211 }
5212
5213 if (has.call(obj, key)) {
5214 obj[key] = utils.combine(obj[key], val);
5215 } else {
5216 obj[key] = val;
5217 }
5218 }
5219
5220 return obj;
5221};
5222
5223var parseObject = function (chain, val, options, valuesParsed) {
5224 var leaf = valuesParsed ? val : parseArrayValue(val, options);
5225
5226 for (var i = chain.length - 1; i >= 0; --i) {
5227 var obj;
5228 var root = chain[i];
5229
5230 if (root === '[]' && options.parseArrays) {
5231 obj = [].concat(leaf);
5232 } else {
5233 obj = options.plainObjects ? Object.create(null) : {};
5234 var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
5235 var index = parseInt(cleanRoot, 10);
5236 if (!options.parseArrays && cleanRoot === '') {
5237 obj = { 0: leaf };
5238 } else if (
5239 !isNaN(index)
5240 && root !== cleanRoot
5241 && String(index) === cleanRoot
5242 && index >= 0
5243 && (options.parseArrays && index <= options.arrayLimit)
5244 ) {
5245 obj = [];
5246 obj[index] = leaf;
5247 } else {
5248 obj[cleanRoot] = leaf;
5249 }
5250 }
5251
5252 leaf = obj; // eslint-disable-line no-param-reassign
5253 }
5254
5255 return leaf;
5256};
5257
5258var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
5259 if (!givenKey) {
5260 return;
5261 }
5262
5263 // Transform dot notation to bracket notation
5264 var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
5265
5266 // The regex chunks
5267
5268 var brackets = /(\[[^[\]]*])/;
5269 var child = /(\[[^[\]]*])/g;
5270
5271 // Get the parent
5272
5273 var segment = options.depth > 0 && brackets.exec(key);
5274 var parent = segment ? key.slice(0, segment.index) : key;
5275
5276 // Stash the parent if it exists
5277
5278 var keys = [];
5279 if (parent) {
5280 // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties
5281 if (!options.plainObjects && has.call(Object.prototype, parent)) {
5282 if (!options.allowPrototypes) {
5283 return;
5284 }
5285 }
5286
5287 keys.push(parent);
5288 }
5289
5290 // Loop through children appending to the array until we hit depth
5291
5292 var i = 0;
5293 while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {
5294 i += 1;
5295 if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
5296 if (!options.allowPrototypes) {
5297 return;
5298 }
5299 }
5300 keys.push(segment[1]);
5301 }
5302
5303 // If there's a remainder, just add whatever is left
5304
5305 if (segment) {
5306 keys.push('[' + key.slice(segment.index) + ']');
5307 }
5308
5309 return parseObject(keys, val, options, valuesParsed);
5310};
5311
5312var normalizeParseOptions = function normalizeParseOptions(opts) {
5313 if (!opts) {
5314 return defaults;
5315 }
5316
5317 if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {
5318 throw new TypeError('Decoder has to be a function.');
5319 }
5320
5321 if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
5322 throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
5323 }
5324 var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
5325
5326 return {
5327 allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
5328 allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,
5329 arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,
5330 charset: charset,
5331 charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
5332 comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,
5333 decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,
5334 delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
5335 // eslint-disable-next-line no-implicit-coercion, no-extra-parens
5336 depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,
5337 ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
5338 interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
5339 parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,
5340 parseArrays: opts.parseArrays !== false,
5341 plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,
5342 strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
5343 };
5344};
5345
5346module.exports = function (str, opts) {
5347 var options = normalizeParseOptions(opts);
5348
5349 if (str === '' || str === null || typeof str === 'undefined') {
5350 return options.plainObjects ? Object.create(null) : {};
5351 }
5352
5353 var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
5354 var obj = options.plainObjects ? Object.create(null) : {};
5355
5356 // Iterate over the keys and setup the new object
5357
5358 var keys = Object.keys(tempObj);
5359 for (var i = 0; i < keys.length; ++i) {
5360 var key = keys[i];
5361 var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');
5362 obj = utils.merge(obj, newObj, options);
5363 }
5364
5365 return utils.compact(obj);
5366};
5367
5368
5369/***/ }),
5370
5371/***/ "../node_modules/qs/lib/stringify.js":
5372/*!*******************************************!*\
5373 !*** ../node_modules/qs/lib/stringify.js ***!
5374 \*******************************************/
5375/*! no static exports found */
5376/***/ (function(module, exports, __webpack_require__) {
5377
5378"use strict";
5379
5380
5381var utils = __webpack_require__(/*! ./utils */ "../node_modules/qs/lib/utils.js");
5382var formats = __webpack_require__(/*! ./formats */ "../node_modules/qs/lib/formats.js");
5383var has = Object.prototype.hasOwnProperty;
5384
5385var arrayPrefixGenerators = {
5386 brackets: function brackets(prefix) {
5387 return prefix + '[]';
5388 },
5389 comma: 'comma',
5390 indices: function indices(prefix, key) {
5391 return prefix + '[' + key + ']';
5392 },
5393 repeat: function repeat(prefix) {
5394 return prefix;
5395 }
5396};
5397
5398var isArray = Array.isArray;
5399var push = Array.prototype.push;
5400var pushToArray = function (arr, valueOrArray) {
5401 push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);
5402};
5403
5404var toISO = Date.prototype.toISOString;
5405
5406var defaultFormat = formats['default'];
5407var defaults = {
5408 addQueryPrefix: false,
5409 allowDots: false,
5410 charset: 'utf-8',
5411 charsetSentinel: false,
5412 delimiter: '&',
5413 encode: true,
5414 encoder: utils.encode,
5415 encodeValuesOnly: false,
5416 format: defaultFormat,
5417 formatter: formats.formatters[defaultFormat],
5418 // deprecated
5419 indices: false,
5420 serializeDate: function serializeDate(date) {
5421 return toISO.call(date);
5422 },
5423 skipNulls: false,
5424 strictNullHandling: false
5425};
5426
5427var isNonNullishPrimitive = function isNonNullishPrimitive(v) {
5428 return typeof v === 'string'
5429 || typeof v === 'number'
5430 || typeof v === 'boolean'
5431 || typeof v === 'symbol'
5432 || typeof v === 'bigint';
5433};
5434
5435var stringify = function stringify(
5436 object,
5437 prefix,
5438 generateArrayPrefix,
5439 strictNullHandling,
5440 skipNulls,
5441 encoder,
5442 filter,
5443 sort,
5444 allowDots,
5445 serializeDate,
5446 formatter,
5447 encodeValuesOnly,
5448 charset
5449) {
5450 var obj = object;
5451 if (typeof filter === 'function') {
5452 obj = filter(prefix, obj);
5453 } else if (obj instanceof Date) {
5454 obj = serializeDate(obj);
5455 } else if (generateArrayPrefix === 'comma' && isArray(obj)) {
5456 obj = utils.maybeMap(obj, function (value) {
5457 if (value instanceof Date) {
5458 return serializeDate(value);
5459 }
5460 return value;
5461 }).join(',');
5462 }
5463
5464 if (obj === null) {
5465 if (strictNullHandling) {
5466 return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key') : prefix;
5467 }
5468
5469 obj = '';
5470 }
5471
5472 if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {
5473 if (encoder) {
5474 var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key');
5475 return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value'))];
5476 }
5477 return [formatter(prefix) + '=' + formatter(String(obj))];
5478 }
5479
5480 var values = [];
5481
5482 if (typeof obj === 'undefined') {
5483 return values;
5484 }
5485
5486 var objKeys;
5487 if (isArray(filter)) {
5488 objKeys = filter;
5489 } else {
5490 var keys = Object.keys(obj);
5491 objKeys = sort ? keys.sort(sort) : keys;
5492 }
5493
5494 for (var i = 0; i < objKeys.length; ++i) {
5495 var key = objKeys[i];
5496 var value = obj[key];
5497
5498 if (skipNulls && value === null) {
5499 continue;
5500 }
5501
5502 var keyPrefix = isArray(obj)
5503 ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(prefix, key) : prefix
5504 : prefix + (allowDots ? '.' + key : '[' + key + ']');
5505
5506 pushToArray(values, stringify(
5507 value,
5508 keyPrefix,
5509 generateArrayPrefix,
5510 strictNullHandling,
5511 skipNulls,
5512 encoder,
5513 filter,
5514 sort,
5515 allowDots,
5516 serializeDate,
5517 formatter,
5518 encodeValuesOnly,
5519 charset
5520 ));
5521 }
5522
5523 return values;
5524};
5525
5526var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
5527 if (!opts) {
5528 return defaults;
5529 }
5530
5531 if (opts.encoder !== null && opts.encoder !== undefined && typeof opts.encoder !== 'function') {
5532 throw new TypeError('Encoder has to be a function.');
5533 }
5534
5535 var charset = opts.charset || defaults.charset;
5536 if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
5537 throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
5538 }
5539
5540 var format = formats['default'];
5541 if (typeof opts.format !== 'undefined') {
5542 if (!has.call(formats.formatters, opts.format)) {
5543 throw new TypeError('Unknown format option provided.');
5544 }
5545 format = opts.format;
5546 }
5547 var formatter = formats.formatters[format];
5548
5549 var filter = defaults.filter;
5550 if (typeof opts.filter === 'function' || isArray(opts.filter)) {
5551 filter = opts.filter;
5552 }
5553
5554 return {
5555 addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix,
5556 allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
5557 charset: charset,
5558 charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
5559 delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,
5560 encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,
5561 encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder,
5562 encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly,
5563 filter: filter,
5564 formatter: formatter,
5565 serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate,
5566 skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls,
5567 sort: typeof opts.sort === 'function' ? opts.sort : null,
5568 strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
5569 };
5570};
5571
5572module.exports = function (object, opts) {
5573 var obj = object;
5574 var options = normalizeStringifyOptions(opts);
5575
5576 var objKeys;
5577 var filter;
5578
5579 if (typeof options.filter === 'function') {
5580 filter = options.filter;
5581 obj = filter('', obj);
5582 } else if (isArray(options.filter)) {
5583 filter = options.filter;
5584 objKeys = filter;
5585 }
5586
5587 var keys = [];
5588
5589 if (typeof obj !== 'object' || obj === null) {
5590 return '';
5591 }
5592
5593 var arrayFormat;
5594 if (opts && opts.arrayFormat in arrayPrefixGenerators) {
5595 arrayFormat = opts.arrayFormat;
5596 } else if (opts && 'indices' in opts) {
5597 arrayFormat = opts.indices ? 'indices' : 'repeat';
5598 } else {
5599 arrayFormat = 'indices';
5600 }
5601
5602 var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
5603
5604 if (!objKeys) {
5605 objKeys = Object.keys(obj);
5606 }
5607
5608 if (options.sort) {
5609 objKeys.sort(options.sort);
5610 }
5611
5612 for (var i = 0; i < objKeys.length; ++i) {
5613 var key = objKeys[i];
5614
5615 if (options.skipNulls && obj[key] === null) {
5616 continue;
5617 }
5618 pushToArray(keys, stringify(
5619 obj[key],
5620 key,
5621 generateArrayPrefix,
5622 options.strictNullHandling,
5623 options.skipNulls,
5624 options.encode ? options.encoder : null,
5625 options.filter,
5626 options.sort,
5627 options.allowDots,
5628 options.serializeDate,
5629 options.formatter,
5630 options.encodeValuesOnly,
5631 options.charset
5632 ));
5633 }
5634
5635 var joined = keys.join(options.delimiter);
5636 var prefix = options.addQueryPrefix === true ? '?' : '';
5637
5638 if (options.charsetSentinel) {
5639 if (options.charset === 'iso-8859-1') {
5640 // encodeURIComponent('&#10003;'), the "numeric entity" representation of a checkmark
5641 prefix += 'utf8=%26%2310003%3B&';
5642 } else {
5643 // encodeURIComponent('✓')
5644 prefix += 'utf8=%E2%9C%93&';
5645 }
5646 }
5647
5648 return joined.length > 0 ? prefix + joined : '';
5649};
5650
5651
5652/***/ }),
5653
5654/***/ "../node_modules/qs/lib/utils.js":
5655/*!***************************************!*\
5656 !*** ../node_modules/qs/lib/utils.js ***!
5657 \***************************************/
5658/*! no static exports found */
5659/***/ (function(module, exports, __webpack_require__) {
5660
5661"use strict";
5662
5663
5664var has = Object.prototype.hasOwnProperty;
5665var isArray = Array.isArray;
5666
5667var hexTable = (function () {
5668 var array = [];
5669 for (var i = 0; i < 256; ++i) {
5670 array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
5671 }
5672
5673 return array;
5674}());
5675
5676var compactQueue = function compactQueue(queue) {
5677 while (queue.length > 1) {
5678 var item = queue.pop();
5679 var obj = item.obj[item.prop];
5680
5681 if (isArray(obj)) {
5682 var compacted = [];
5683
5684 for (var j = 0; j < obj.length; ++j) {
5685 if (typeof obj[j] !== 'undefined') {
5686 compacted.push(obj[j]);
5687 }
5688 }
5689
5690 item.obj[item.prop] = compacted;
5691 }
5692 }
5693};
5694
5695var arrayToObject = function arrayToObject(source, options) {
5696 var obj = options && options.plainObjects ? Object.create(null) : {};
5697 for (var i = 0; i < source.length; ++i) {
5698 if (typeof source[i] !== 'undefined') {
5699 obj[i] = source[i];
5700 }
5701 }
5702
5703 return obj;
5704};
5705
5706var merge = function merge(target, source, options) {
5707 /* eslint no-param-reassign: 0 */
5708 if (!source) {
5709 return target;
5710 }
5711
5712 if (typeof source !== 'object') {
5713 if (isArray(target)) {
5714 target.push(source);
5715 } else if (target && typeof target === 'object') {
5716 if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) {
5717 target[source] = true;
5718 }
5719 } else {
5720 return [target, source];
5721 }
5722
5723 return target;
5724 }
5725
5726 if (!target || typeof target !== 'object') {
5727 return [target].concat(source);
5728 }
5729
5730 var mergeTarget = target;
5731 if (isArray(target) && !isArray(source)) {
5732 mergeTarget = arrayToObject(target, options);
5733 }
5734
5735 if (isArray(target) && isArray(source)) {
5736 source.forEach(function (item, i) {
5737 if (has.call(target, i)) {
5738 var targetItem = target[i];
5739 if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {
5740 target[i] = merge(targetItem, item, options);
5741 } else {
5742 target.push(item);
5743 }
5744 } else {
5745 target[i] = item;
5746 }
5747 });
5748 return target;
5749 }
5750
5751 return Object.keys(source).reduce(function (acc, key) {
5752 var value = source[key];
5753
5754 if (has.call(acc, key)) {
5755 acc[key] = merge(acc[key], value, options);
5756 } else {
5757 acc[key] = value;
5758 }
5759 return acc;
5760 }, mergeTarget);
5761};
5762
5763var assign = function assignSingleSource(target, source) {
5764 return Object.keys(source).reduce(function (acc, key) {
5765 acc[key] = source[key];
5766 return acc;
5767 }, target);
5768};
5769
5770var decode = function (str, decoder, charset) {
5771 var strWithoutPlus = str.replace(/\+/g, ' ');
5772 if (charset === 'iso-8859-1') {
5773 // unescape never throws, no try...catch needed:
5774 return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
5775 }
5776 // utf-8
5777 try {
5778 return decodeURIComponent(strWithoutPlus);
5779 } catch (e) {
5780 return strWithoutPlus;
5781 }
5782};
5783
5784var encode = function encode(str, defaultEncoder, charset) {
5785 // This code was originally written by Brian White (mscdex) for the io.js core querystring library.
5786 // It has been adapted here for stricter adherence to RFC 3986
5787 if (str.length === 0) {
5788 return str;
5789 }
5790
5791 var string = str;
5792 if (typeof str === 'symbol') {
5793 string = Symbol.prototype.toString.call(str);
5794 } else if (typeof str !== 'string') {
5795 string = String(str);
5796 }
5797
5798 if (charset === 'iso-8859-1') {
5799 return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {
5800 return '%26%23' + parseInt($0.slice(2), 16) + '%3B';
5801 });
5802 }
5803
5804 var out = '';
5805 for (var i = 0; i < string.length; ++i) {
5806 var c = string.charCodeAt(i);
5807
5808 if (
5809 c === 0x2D // -
5810 || c === 0x2E // .
5811 || c === 0x5F // _
5812 || c === 0x7E // ~
5813 || (c >= 0x30 && c <= 0x39) // 0-9
5814 || (c >= 0x41 && c <= 0x5A) // a-z
5815 || (c >= 0x61 && c <= 0x7A) // A-Z
5816 ) {
5817 out += string.charAt(i);
5818 continue;
5819 }
5820
5821 if (c < 0x80) {
5822 out = out + hexTable[c];
5823 continue;
5824 }
5825
5826 if (c < 0x800) {
5827 out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
5828 continue;
5829 }
5830
5831 if (c < 0xD800 || c >= 0xE000) {
5832 out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
5833 continue;
5834 }
5835
5836 i += 1;
5837 c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
5838 out += hexTable[0xF0 | (c >> 18)]
5839 + hexTable[0x80 | ((c >> 12) & 0x3F)]
5840 + hexTable[0x80 | ((c >> 6) & 0x3F)]
5841 + hexTable[0x80 | (c & 0x3F)];
5842 }
5843
5844 return out;
5845};
5846
5847var compact = function compact(value) {
5848 var queue = [{ obj: { o: value }, prop: 'o' }];
5849 var refs = [];
5850
5851 for (var i = 0; i < queue.length; ++i) {
5852 var item = queue[i];
5853 var obj = item.obj[item.prop];
5854
5855 var keys = Object.keys(obj);
5856 for (var j = 0; j < keys.length; ++j) {
5857 var key = keys[j];
5858 var val = obj[key];
5859 if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
5860 queue.push({ obj: obj, prop: key });
5861 refs.push(val);
5862 }
5863 }
5864 }
5865
5866 compactQueue(queue);
5867
5868 return value;
5869};
5870
5871var isRegExp = function isRegExp(obj) {
5872 return Object.prototype.toString.call(obj) === '[object RegExp]';
5873};
5874
5875var isBuffer = function isBuffer(obj) {
5876 if (!obj || typeof obj !== 'object') {
5877 return false;
5878 }
5879
5880 return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
5881};
5882
5883var combine = function combine(a, b) {
5884 return [].concat(a, b);
5885};
5886
5887var maybeMap = function maybeMap(val, fn) {
5888 if (isArray(val)) {
5889 var mapped = [];
5890 for (var i = 0; i < val.length; i += 1) {
5891 mapped.push(fn(val[i]));
5892 }
5893 return mapped;
5894 }
5895 return fn(val);
5896};
5897
5898module.exports = {
5899 arrayToObject: arrayToObject,
5900 assign: assign,
5901 combine: combine,
5902 compact: compact,
5903 decode: decode,
5904 encode: encode,
5905 isBuffer: isBuffer,
5906 isRegExp: isRegExp,
5907 maybeMap: maybeMap,
5908 merge: merge
5909};
5910
5911
5912/***/ }),
5913
5914/***/ "../node_modules/webpack/buildin/global.js":
5915/*!*************************************************!*\
5916 !*** ../node_modules/webpack/buildin/global.js ***!
5917 \*************************************************/
5918/*! no static exports found */
5919/***/ (function(module, exports) {
5920
5921var g;
5922
5923// This works in non-strict mode
5924g = (function() {
5925 return this;
5926})();
5927
5928try {
5929 // This works if eval is allowed (see CSP)
5930 g = g || new Function("return this")();
5931} catch (e) {
5932 // This works if the window reference is available
5933 if (typeof window === "object") g = window;
5934}
5935
5936// g can still be undefined, but nothing to do about it...
5937// We return undefined, instead of nothing here, so it's
5938// easier to handle this case. if(!global) { ...}
5939
5940module.exports = g;
5941
5942
5943/***/ }),
5944
5945/***/ "../node_modules/webpack/buildin/module.js":
5946/*!*************************************************!*\
5947 !*** ../node_modules/webpack/buildin/module.js ***!
5948 \*************************************************/
5949/*! no static exports found */
5950/***/ (function(module, exports) {
5951
5952module.exports = function(module) {
5953 if (!module.webpackPolyfill) {
5954 module.deprecate = function() {};
5955 module.paths = [];
5956 // module.parent = undefined by default
5957 if (!module.children) module.children = [];
5958 Object.defineProperty(module, "loaded", {
5959 enumerable: true,
5960 get: function() {
5961 return module.l;
5962 }
5963 });
5964 Object.defineProperty(module, "id", {
5965 enumerable: true,
5966 get: function() {
5967 return module.i;
5968 }
5969 });
5970 module.webpackPolyfill = 1;
5971 }
5972 return module;
5973};
5974
5975
5976/***/ }),
5977
5978/***/ "./common-utils.ts":
5979/*!*************************!*\
5980 !*** ./common-utils.ts ***!
5981 \*************************/
5982/*! exports provided: wrapCollection */
5983/***/ (function(module, __webpack_exports__, __webpack_require__) {
5984
5985"use strict";
5986__webpack_require__.r(__webpack_exports__);
5987/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapCollection", function() { return wrapCollection; });
5988/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
5989/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
5990/* harmony import */ var contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! contentful-sdk-core */ "../node_modules/contentful-sdk-core/dist/index.es-modules.js");
5991/* eslint-disable @typescript-eslint/ban-ts-ignore */
5992
5993
5994var wrapCollection = function wrapCollection(fn) {
5995 return function (http, data) {
5996 var collectionData = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data)); // @ts-ignore
5997
5998 collectionData.items = collectionData.items.map(function (entity) {
5999 return fn(http, entity);
6000 }); // @ts-ignore
6001
6002 return collectionData;
6003 };
6004};
6005
6006/***/ }),
6007
6008/***/ "./contentful-management.ts":
6009/*!**********************************!*\
6010 !*** ./contentful-management.ts ***!
6011 \**********************************/
6012/*! exports provided: createClient */
6013/***/ (function(module, __webpack_exports__, __webpack_require__) {
6014
6015"use strict";
6016__webpack_require__.r(__webpack_exports__);
6017/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createClient", function() { return createClient; });
6018/* harmony import */ var _create_contentful_api__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./create-contentful-api */ "./create-contentful-api.ts");
6019/* harmony import */ var _create_cma_http_client__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./create-cma-http-client */ "./create-cma-http-client.ts");
6020/**
6021 * Contentful Management API SDK. Allows you to create instances of a client
6022 * with access to the Contentful Content Management API.
6023 * @packageDocumentation
6024 */
6025
6026
6027/**
6028 * Create a client instance
6029 * @param params - Client initialization parameters
6030 *
6031 * ```javascript
6032 * const client = contentfulManagement.createClient({
6033 * accessToken: 'myAccessToken'
6034 * })
6035 * ```
6036 */
6037
6038function createClient(params) {
6039 var http = Object(_create_cma_http_client__WEBPACK_IMPORTED_MODULE_1__["createCMAHttpClient"])(params);
6040 var api = Object(_create_contentful_api__WEBPACK_IMPORTED_MODULE_0__["default"])({
6041 http: http
6042 });
6043 return api;
6044}
6045
6046/***/ }),
6047
6048/***/ "./create-cma-http-client.ts":
6049/*!***********************************!*\
6050 !*** ./create-cma-http-client.ts ***!
6051 \***********************************/
6052/*! exports provided: createCMAHttpClient */
6053/***/ (function(module, __webpack_exports__, __webpack_require__) {
6054
6055"use strict";
6056__webpack_require__.r(__webpack_exports__);
6057/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCMAHttpClient", function() { return createCMAHttpClient; });
6058/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! axios */ "../node_modules/axios/index.js");
6059/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_0__);
6060/* harmony import */ var contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! contentful-sdk-core */ "../node_modules/contentful-sdk-core/dist/index.es-modules.js");
6061/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
6062/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_2__);
6063function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
6064
6065function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
6066
6067function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6068
6069/**
6070 * @packageDocumentation
6071 * @hidden
6072 */
6073
6074
6075
6076
6077/**
6078 * @private
6079 */
6080function createCMAHttpClient(params) {
6081 var defaultParameters = {
6082 defaultHostname: 'api.contentful.com',
6083 defaultHostnameUpload: 'upload.contentful.com'
6084 };
6085 var userAgentHeader = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["getUserAgentHeader"])( // @ts-expect-error
6086 "contentful-management.js/".concat("5.27.1"), params.application, params.integration, params.feature);
6087 var requiredHeaders = {
6088 'Content-Type': 'application/vnd.contentful.management.v1+json',
6089 'X-Contentful-User-Agent': userAgentHeader
6090 };
6091 params = _objectSpread(_objectSpread({}, defaultParameters), lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_2___default()(params));
6092
6093 if (!params.accessToken) {
6094 throw new TypeError('Expected parameter accessToken');
6095 }
6096
6097 params.headers = _objectSpread(_objectSpread({}, params.headers), requiredHeaders);
6098 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createHttpClient"])(axios__WEBPACK_IMPORTED_MODULE_0___default.a, params);
6099}
6100
6101/***/ }),
6102
6103/***/ "./create-contentful-api.ts":
6104/*!**********************************!*\
6105 !*** ./create-contentful-api.ts ***!
6106 \**********************************/
6107/*! exports provided: default */
6108/***/ (function(module, __webpack_exports__, __webpack_require__) {
6109
6110"use strict";
6111__webpack_require__.r(__webpack_exports__);
6112/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return createClientApi; });
6113/* harmony import */ var contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! contentful-sdk-core */ "../node_modules/contentful-sdk-core/dist/index.es-modules.js");
6114/* harmony import */ var _error_handler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./error-handler */ "./error-handler.ts");
6115/* harmony import */ var _entities__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./entities */ "./entities/index.ts");
6116
6117
6118
6119function createClientApi(_ref) {
6120 var http = _ref.http;
6121 var _entities$space = _entities__WEBPACK_IMPORTED_MODULE_2__["default"].space,
6122 wrapSpace = _entities$space.wrapSpace,
6123 wrapSpaceCollection = _entities$space.wrapSpaceCollection;
6124 var wrapUser = _entities__WEBPACK_IMPORTED_MODULE_2__["default"].user.wrapUser;
6125 var _entities$personalAcc = _entities__WEBPACK_IMPORTED_MODULE_2__["default"].personalAccessToken,
6126 wrapPersonalAccessToken = _entities$personalAcc.wrapPersonalAccessToken,
6127 wrapPersonalAccessTokenCollection = _entities$personalAcc.wrapPersonalAccessTokenCollection;
6128 var _entities$organizatio = _entities__WEBPACK_IMPORTED_MODULE_2__["default"].organization,
6129 wrapOrganization = _entities$organizatio.wrapOrganization,
6130 wrapOrganizationCollection = _entities$organizatio.wrapOrganizationCollection;
6131 var wrapUsageCollection = _entities__WEBPACK_IMPORTED_MODULE_2__["default"].usage.wrapUsageCollection;
6132 return {
6133 /**
6134 * Gets all spaces
6135 * @return Promise for a collection of Spaces
6136 * ```javascript
6137 * const contentful = require('contentful-management')
6138 *
6139 * const client = contentful.createClient({
6140 * accessToken: '<content_management_api_key>'
6141 * })
6142 *
6143 * client.getSpaces()
6144 * .then((response) => console.log(response.items))
6145 * .catch(console.error)
6146 * ```
6147 */
6148 getSpaces: function getSpaces() {
6149 var query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6150 return http.get('', Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["createRequestConfig"])({
6151 query: query
6152 })).then(function (response) {
6153 return wrapSpaceCollection(http, response.data);
6154 }, _error_handler__WEBPACK_IMPORTED_MODULE_1__["default"]);
6155 },
6156
6157 /**
6158 * Gets a space
6159 * @param id - Space ID
6160 * @return Promise for a Space
6161 * ```javascript
6162 * const contentful = require('contentful-management')
6163 *
6164 * const client = contentful.createClient({
6165 * accessToken: '<content_management_api_key>'
6166 * })
6167 *
6168 * client.getSpace('<space_id>')
6169 * .then((space) => console.log(space))
6170 * .catch(console.error)
6171 * ```
6172 */
6173 getSpace: function getSpace(id) {
6174 return http.get(id).then(function (response) {
6175 return wrapSpace(http, response.data);
6176 }, _error_handler__WEBPACK_IMPORTED_MODULE_1__["default"]);
6177 },
6178
6179 /**
6180 * Creates a space
6181 * @param data - Object representation of the Space to be created
6182 * @param organizationId - Organization ID, if the associated token can manage more than one organization.
6183 * @return Promise for the newly created Space
6184 * @example ```javascript
6185 * const contentful = require('contentful-management')
6186 *
6187 * const client = contentful.createClient({
6188 * accessToken: '<content_management_api_key>'
6189 * })
6190 *
6191 * client.createSpace({
6192 * name: 'Name of new space'
6193 * })
6194 * .then((space) => console.log(space))
6195 * .catch(console.error)
6196 * ```
6197 */
6198 createSpace: function createSpace(data, organizationId) {
6199 return http.post('', data, {
6200 headers: organizationId ? {
6201 'X-Contentful-Organization': organizationId
6202 } : {}
6203 }).then(function (response) {
6204 return wrapSpace(http, response.data);
6205 }, _error_handler__WEBPACK_IMPORTED_MODULE_1__["default"]);
6206 },
6207
6208 /**
6209 * Gets an organization
6210 * @param id - Organization ID
6211 * @return Promise for a Organization
6212 * @example ```javascript
6213 * const contentful = require('contentful-management')
6214 *
6215 * const client = contentful.createClient({
6216 * accessToken: '<content_management_api_key>'
6217 * })
6218 *
6219 * client.getOrganization('<org_id>')
6220 * .then((org) => console.log(org))
6221 * .catch(console.error)
6222 * ```
6223 */
6224 getOrganization: function getOrganization(id) {
6225 var _http$defaults, _http$defaults$baseUR;
6226
6227 var baseURL = (_http$defaults = http.defaults) === null || _http$defaults === void 0 ? void 0 : (_http$defaults$baseUR = _http$defaults.baseURL) === null || _http$defaults$baseUR === void 0 ? void 0 : _http$defaults$baseUR.replace('/spaces/', '/organizations/');
6228 return http.get('', {
6229 baseURL: baseURL
6230 }).then(function (response) {
6231 var org = response.data.items.find(function (org) {
6232 return org.sys.id === id;
6233 });
6234
6235 if (!org) {
6236 var error = new Error("No organization was found with the ID ".concat(id, " instead got ").concat(JSON.stringify(response))); // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
6237 // @ts-ignore
6238
6239 error.status = 404; // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
6240 // @ts-ignore
6241
6242 error.statusText = 'Not Found';
6243 return Promise.reject(error);
6244 }
6245
6246 return wrapOrganization(http, org);
6247 }, _error_handler__WEBPACK_IMPORTED_MODULE_1__["default"]);
6248 },
6249
6250 /**
6251 * Gets a collection of Organizations
6252 * @return Promise for a collection of Organizations
6253 * @example ```javascript
6254 * const contentful = require('contentful-management')
6255 *
6256 * const client = contentful.createClient({
6257 * accessToken: '<content_management_api_key>'
6258 * })
6259 *
6260 * client.getOrganizations()
6261 * .then(result => console.log(result.items))
6262 * .catch(console.error)
6263 * ```
6264 */
6265 getOrganizations: function getOrganizations() {
6266 var _http$defaults2, _http$defaults2$baseU;
6267
6268 var baseURL = (_http$defaults2 = http.defaults) === null || _http$defaults2 === void 0 ? void 0 : (_http$defaults2$baseU = _http$defaults2.baseURL) === null || _http$defaults2$baseU === void 0 ? void 0 : _http$defaults2$baseU.replace('/spaces/', '/organizations/');
6269 return http.get('', {
6270 baseURL: baseURL
6271 }).then(function (response) {
6272 return wrapOrganizationCollection(http, response.data);
6273 }, _error_handler__WEBPACK_IMPORTED_MODULE_1__["default"]);
6274 },
6275
6276 /**
6277 * Gets the authenticated user
6278 * @return Promise for a User
6279 * @example ```javascript
6280 * const contentful = require('contentful-management')
6281 *
6282 * const client = contentful.createClient({
6283 * accessToken: '<content_management_api_key>'
6284 * })
6285 *
6286 * client.getCurrentUser()
6287 * .then(user => console.log(user.firstName))
6288 * .catch(console.error)
6289 * ```
6290 */
6291 getCurrentUser: function getCurrentUser() {
6292 var _http$defaults3, _http$defaults3$baseU;
6293
6294 var baseURL = (_http$defaults3 = http.defaults) === null || _http$defaults3 === void 0 ? void 0 : (_http$defaults3$baseU = _http$defaults3.baseURL) === null || _http$defaults3$baseU === void 0 ? void 0 : _http$defaults3$baseU.replace('/spaces/', '/users/me/');
6295 return http.get('', {
6296 baseURL: baseURL
6297 }).then(function (response) {
6298 return wrapUser(http, response.data);
6299 }, _error_handler__WEBPACK_IMPORTED_MODULE_1__["default"]);
6300 },
6301
6302 /**
6303 * Creates a personal access token
6304 * @param data - personal access token config
6305 * @return Promise for a Token
6306 * @example ```javascript
6307 * const contentful = require('contentful-management')
6308 *
6309 * const client = contentful.createClient({
6310 * accessToken: '<content_management_api_key>'
6311 * })
6312 *
6313 * client.createPersonalAccessToken(
6314 * {
6315 * "name": "My Token",
6316 * "scope": [
6317 * "content_management_manage"
6318 * ]
6319 * }
6320 * )
6321 * .then(personalAccessToken => console.log(personalAccessToken.token))
6322 * .catch(console.error)
6323 * ```
6324 */
6325 createPersonalAccessToken: function createPersonalAccessToken(data) {
6326 var _http$defaults4, _http$defaults4$baseU;
6327
6328 var baseURL = (_http$defaults4 = http.defaults) === null || _http$defaults4 === void 0 ? void 0 : (_http$defaults4$baseU = _http$defaults4.baseURL) === null || _http$defaults4$baseU === void 0 ? void 0 : _http$defaults4$baseU.replace('/spaces/', '/users/me/access_tokens');
6329 return http.post('', data, {
6330 baseURL: baseURL
6331 }).then(function (response) {
6332 return wrapPersonalAccessToken(http, response.data);
6333 }, _error_handler__WEBPACK_IMPORTED_MODULE_1__["default"]);
6334 },
6335
6336 /**
6337 * Gets a personal access token
6338 * @param data - personal access token config
6339 * @return Promise for a Token
6340 * @example ```javascript
6341 * const contentful = require('contentful-management')
6342 *
6343 * const client = contentful.createClient({
6344 * accessToken: '<content_management_api_key>'
6345 * })
6346 *
6347 * client.getPersonalAccessToken(tokenId)
6348 * .then(token => console.log(token.token))
6349 * .catch(console.error)
6350 * ```
6351 */
6352 getPersonalAccessToken: function getPersonalAccessToken(tokenId) {
6353 var _http$defaults5, _http$defaults5$baseU;
6354
6355 var baseURL = (_http$defaults5 = http.defaults) === null || _http$defaults5 === void 0 ? void 0 : (_http$defaults5$baseU = _http$defaults5.baseURL) === null || _http$defaults5$baseU === void 0 ? void 0 : _http$defaults5$baseU.replace('/spaces/', '/users/me/access_tokens');
6356 return http.get(tokenId, {
6357 baseURL: baseURL
6358 }).then(function (response) {
6359 return wrapPersonalAccessToken(http, response.data);
6360 }, _error_handler__WEBPACK_IMPORTED_MODULE_1__["default"]);
6361 },
6362
6363 /**
6364 * Gets all personal access tokens
6365 * @return Promise for a Token
6366 * @example ```javascript
6367 * const contentful = require('contentful-management')
6368 *
6369 * const client = contentful.createClient({
6370 * accessToken: '<content_management_api_key>'
6371 * })
6372 *
6373 * client.getPersonalAccessTokens()
6374 * .then(response => console.log(reponse.items))
6375 * .catch(console.error)
6376 * ```
6377 */
6378 getPersonalAccessTokens: function getPersonalAccessTokens() {
6379 var _http$defaults6, _http$defaults6$baseU;
6380
6381 var baseURL = (_http$defaults6 = http.defaults) === null || _http$defaults6 === void 0 ? void 0 : (_http$defaults6$baseU = _http$defaults6.baseURL) === null || _http$defaults6$baseU === void 0 ? void 0 : _http$defaults6$baseU.replace('/spaces/', '/users/me/access_tokens');
6382 return http.get('', {
6383 baseURL: baseURL
6384 }).then(function (response) {
6385 return wrapPersonalAccessTokenCollection(http, response.data);
6386 }, _error_handler__WEBPACK_IMPORTED_MODULE_1__["default"]);
6387 },
6388
6389 /**
6390 * Get organization usage grouped by {@link UsageMetricEnum metric}
6391 *
6392 * @param organizationId - Id of an organization
6393 * @param query - Query parameters
6394 * @return Promise of a collection of usages
6395 * @example ```javascript
6396 *
6397 * const contentful = require('contentful-management')
6398 *
6399 * const client = contentful.createClient({
6400 * accessToken: '<content_management_api_key>'
6401 * })
6402 *
6403 * client.getOrganizationUsage('<organizationId>', {
6404 * 'metric[in]': 'cma,gql',
6405 * 'dateRange.startAt': '2019-10-22',
6406 * 'dateRange.endAt': '2019-11-10'
6407 * }
6408 * })
6409 * .then(result => console.log(result.items))
6410 * .catch(console.error)
6411 * ```
6412 */
6413 getOrganizationUsage: function getOrganizationUsage(organizationId) {
6414 var _http$defaults7, _http$defaults7$baseU;
6415
6416 var query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
6417 var baseURL = (_http$defaults7 = http.defaults) === null || _http$defaults7 === void 0 ? void 0 : (_http$defaults7$baseU = _http$defaults7.baseURL) === null || _http$defaults7$baseU === void 0 ? void 0 : _http$defaults7$baseU.replace('/spaces/', "/organizations/".concat(organizationId, "/organization_periodic_usages"));
6418 return http.get('', {
6419 baseURL: baseURL,
6420 params: query
6421 }).then(function (response) {
6422 return wrapUsageCollection(http, response.data);
6423 }, _error_handler__WEBPACK_IMPORTED_MODULE_1__["default"]);
6424 },
6425
6426 /**
6427 * Get organization usage grouped by space and metric
6428 *
6429 * @param organizationId - Id of an organization
6430 * @param query - Query parameters
6431 * @return Promise of a collection of usages
6432 * ```javascript
6433 * const contentful = require('contentful-management')
6434 *
6435 * const client = contentful.createClient({
6436 * accessToken: '<content_management_api_key>'
6437 * })
6438 *
6439 * client.getSpaceUsage('<organizationId>', {
6440 * skip: 0,
6441 * limit: 10,
6442 * 'metric[in]': 'cda,cpa,gql',
6443 * 'dateRange.startAt': '2019-10-22',
6444 * 'dateRange.endAt': '2020-11-30'
6445 * }
6446 * })
6447 * .then(result => console.log(result.items))
6448 * .catch(console.error)
6449 * ```
6450 */
6451 getSpaceUsage: function getSpaceUsage(organizationId) {
6452 var _http$defaults8, _http$defaults8$baseU;
6453
6454 var query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
6455 var baseURL = (_http$defaults8 = http.defaults) === null || _http$defaults8 === void 0 ? void 0 : (_http$defaults8$baseU = _http$defaults8.baseURL) === null || _http$defaults8$baseU === void 0 ? void 0 : _http$defaults8$baseU.replace('/spaces/', "/organizations/".concat(organizationId, "/space_periodic_usages"));
6456 return http.get('', {
6457 baseURL: baseURL,
6458 params: query
6459 }).then(function (response) {
6460 return wrapUsageCollection(http, response.data);
6461 }, _error_handler__WEBPACK_IMPORTED_MODULE_1__["default"]);
6462 },
6463
6464 /**
6465 * Make a custom request to the Contentful management API's /spaces endpoint
6466 * @param opts - axios request options (https://github.com/mzabriskie/axios)
6467 * @return Promise for the response data
6468 * ```javascript
6469 * const contentful = require('contentful-management')
6470 *
6471 * const client = contentful.createClient({
6472 * accessToken: '<content_management_api_key>'
6473 * })
6474 *
6475 * client.rawRequest({
6476 * method: 'GET',
6477 * url: '/custom/path'
6478 * })
6479 * .then((responseData) => console.log(responseData))
6480 * .catch(console.error)
6481 * ```
6482 */
6483 rawRequest: function rawRequest(opts) {
6484 return http(opts).then(function (response) {
6485 return response.data;
6486 }, _error_handler__WEBPACK_IMPORTED_MODULE_1__["default"]);
6487 }
6488 };
6489}
6490
6491/***/ }),
6492
6493/***/ "./create-environment-api.ts":
6494/*!***********************************!*\
6495 !*** ./create-environment-api.ts ***!
6496 \***********************************/
6497/*! exports provided: default */
6498/***/ (function(module, __webpack_exports__, __webpack_require__) {
6499
6500"use strict";
6501__webpack_require__.r(__webpack_exports__);
6502/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return createEnvironmentApi; });
6503/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
6504/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
6505/* harmony import */ var contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! contentful-sdk-core */ "../node_modules/contentful-sdk-core/dist/index.es-modules.js");
6506/* harmony import */ var _error_handler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./error-handler */ "./error-handler.ts");
6507/* harmony import */ var _entities__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./entities */ "./entities/index.ts");
6508function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
6509
6510function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
6511
6512function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6513
6514
6515
6516
6517
6518
6519/**
6520 * Creates API object with methods to access the Environment API
6521 */
6522function createEnvironmentApi(_ref) {
6523 var http = _ref.http,
6524 httpUpload = _ref.httpUpload;
6525 var wrapEnvironment = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].environment.wrapEnvironment;
6526 var _entities$contentType = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].contentType,
6527 wrapContentType = _entities$contentType.wrapContentType,
6528 wrapContentTypeCollection = _entities$contentType.wrapContentTypeCollection;
6529 var _entities$entry = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].entry,
6530 wrapEntry = _entities$entry.wrapEntry,
6531 wrapEntryCollection = _entities$entry.wrapEntryCollection;
6532 var _entities$asset = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].asset,
6533 wrapAsset = _entities$asset.wrapAsset,
6534 wrapAssetCollection = _entities$asset.wrapAssetCollection;
6535 var _entities$locale = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].locale,
6536 wrapLocale = _entities$locale.wrapLocale,
6537 wrapLocaleCollection = _entities$locale.wrapLocaleCollection;
6538 var wrapSnapshotCollection = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].snapshot.wrapSnapshotCollection;
6539 var wrapEditorInterface = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].editorInterface.wrapEditorInterface;
6540 var wrapUpload = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].upload.wrapUpload;
6541 var _entities$uiExtension = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].uiExtension,
6542 wrapUiExtension = _entities$uiExtension.wrapUiExtension,
6543 wrapUiExtensionCollection = _entities$uiExtension.wrapUiExtensionCollection;
6544 var _entities$appInstalla = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].appInstallation,
6545 wrapAppInstallation = _entities$appInstalla.wrapAppInstallation,
6546 wrapAppInstallationCollection = _entities$appInstalla.wrapAppInstallationCollection;
6547
6548 function createAsset(data) {
6549 return http.post('assets', data).then(function (response) {
6550 return wrapAsset(http, response.data);
6551 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
6552 }
6553
6554 function createUpload(data) {
6555 var file = data.file;
6556
6557 if (!file) {
6558 return Promise.reject(new Error('Unable to locate a file to upload.'));
6559 }
6560
6561 return httpUpload.post('uploads', file, {
6562 headers: {
6563 'Content-Type': 'application/octet-stream'
6564 }
6565 }).then(function (uploadResponse) {
6566 return wrapUpload(httpUpload, uploadResponse.data);
6567 }).catch(_error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
6568 }
6569 /**
6570 * @private
6571 * sdk relies heavily on sys metadata
6572 * so we cannot omit the sys property on sdk level
6573 */
6574
6575
6576 function normalizeSelect(query) {
6577 if (query.select && !/sys/i.test(query.select)) {
6578 query.select += ',sys';
6579 }
6580 }
6581
6582 return {
6583 /**
6584 * Deletes the environment
6585 * @return Promise for the deletion. It contains no data, but the Promise error case should be handled.
6586 * @example ```javascript
6587 * const contentful = require('contentful-management')
6588 *
6589 * const client = contentful.createClient({
6590 * accessToken: '<content_management_api_key>'
6591 * })
6592 *
6593 * client.getSpace('<space_id>')
6594 * .then((space) => space.getEnvironment('<environment-id>'))
6595 * .then((environment) => environment.delete())
6596 * .then(() => console.log('Environment deleted.'))
6597 * .catch(console.error)
6598 * ```
6599 */
6600 delete: function deleteEnvironment() {
6601 return http.delete('').then(function () {// noop
6602 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
6603 },
6604
6605 /**
6606 * Updates the environment
6607 * @return Promise for the updated environment.
6608 * @example ```javascript
6609 * const contentful = require('contentful-management')
6610 *
6611 * const client = contentful.createClient({
6612 * accessToken: '<content_management_api_key>'
6613 * })
6614 *
6615 * client.getSpace('<space_id>')
6616 * .then((space) => space.getEnvironment('<environment-id>'))
6617 * .then((environment) => {
6618 * environment.name = 'New name'
6619 * return environment.update()
6620 * })
6621 * .then((environment) => console.log(`Environment ${environment.sys.id} renamed.`)
6622 * .catch(console.error)
6623 * ```
6624 */
6625 update: function updateEnvironment() {
6626 var raw = this.toPlainObject();
6627 var data = lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(raw);
6628 delete data.sys;
6629 return http.put('', data, {
6630 headers: {
6631 'X-Contentful-Version': raw.sys.version
6632 }
6633 }).then(function (response) {
6634 return wrapEnvironment(http, response.data);
6635 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
6636 },
6637
6638 /**
6639 * Creates SDK Entry object (locally) from entry data
6640 * @param entryData - Entry Data
6641 * @return Entry
6642 * @example ```javascript
6643 * environment.getEntry('entryId').then(entry => {
6644 *
6645 * // Build a plainObject in order to make it usable for React (saving in state or redux)
6646 * const plainObject = entry.toPlainObject();
6647 *
6648 * // The entry is being updated in some way as plainObject:
6649 * const updatedPlainObject = {
6650 * ...plainObject,
6651 * fields: {
6652 * ...plainObject.fields,
6653 * title: {
6654 * 'en-US': 'updatedTitle'
6655 * }
6656 * }
6657 * };
6658 *
6659 * // Rebuild an sdk object out of the updated plainObject:
6660 * const entryWithMethodsAgain = environment.getEntryFromData(updatedPlainObject);
6661 *
6662 * // Update with help of the sdk method:
6663 * entryWithMethodsAgain.update();
6664 *
6665 * });
6666 * ```
6667 **/
6668 getEntryFromData: function getEntryFromData(entryData) {
6669 return wrapEntry(http, entryData);
6670 },
6671
6672 /**
6673 * Creates SDK Asset object (locally) from entry data
6674 * @param assetData - Asset ID
6675 * @return Asset
6676 * @example ```javascript
6677 * environment.getAsset('asset_id').then(asset => {
6678 *
6679 * // Build a plainObject in order to make it usable for React (saving in state or redux)
6680 * const plainObject = asset.toPlainObject();
6681 *
6682 * // The asset is being updated in some way as plainObject:
6683 * const updatedPlainObject = {
6684 * ...plainObject,
6685 * fields: {
6686 * ...plainObject.fields,
6687 * title: {
6688 * 'en-US': 'updatedTitle'
6689 * }
6690 * }
6691 * };
6692 *
6693 * // Rebuild an sdk object out of the updated plainObject:
6694 * const assetWithMethodsAgain = environment.getAssetFromData(updatedPlainObject);
6695 *
6696 * // Update with help of the sdk method:
6697 * assetWithMethodsAgain.update();
6698 *
6699 * });
6700 * ```
6701 */
6702 getAssetFromData: function getAssetFromData(assetData) {
6703 return wrapAsset(http, assetData);
6704 },
6705
6706 /**
6707 * Gets a Content Type
6708 * @param id - Content Type ID
6709 * @return Promise for a Content Type
6710 * @example ```javascript
6711 * const contentful = require('contentful-management')
6712 *
6713 * const client = contentful.createClient({
6714 * accessToken: '<content_management_api_key>'
6715 * })
6716 *
6717 * client.getSpace('<space_id>')
6718 * .then((space) => space.getEnvironment('<environment-id>'))
6719 * .then((environment) => environment.getContentType('<content_type_id>'))
6720 * .then((contentType) => console.log(contentType))
6721 * .catch(console.error)
6722 * ```
6723 */
6724 getContentType: function getContentType(id) {
6725 return http.get('content_types/' + id).then(function (response) {
6726 return wrapContentType(http, response.data);
6727 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
6728 },
6729
6730 /**
6731 * Gets a collection of Content Types
6732 * @param query - Object with search parameters. Check the <a href="https://www.contentful.com/developers/docs/javascript/tutorials/using-js-cda-sdk/#retrieving-entries-with-search-parameters">JS SDK tutorial</a> and the <a href="https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters">REST API reference</a> for more details.
6733 * @return Promise for a collection of Content Types
6734 * @example ```javascript
6735 * const contentful = require('contentful-management')
6736 *
6737 * const client = contentful.createClient({
6738 * accessToken: '<content_management_api_key>'
6739 * })
6740 *
6741 * client.getSpace('<space_id>')
6742 * .then((space) => space.getEnvironment('<environment-id>'))
6743 * .then((environment) => environment.getContentTypes())
6744 * .then((response) => console.log(response.items))
6745 * .catch(console.error)
6746 * ```
6747 */
6748 getContentTypes: function getContentTypes() {
6749 var query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6750 return http.get('content_types', Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
6751 query: query
6752 })).then(function (response) {
6753 return wrapContentTypeCollection(http, response.data);
6754 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
6755 },
6756
6757 /**
6758 * Creates a Content Type
6759 * @param data - Object representation of the Content Type to be created
6760 * @return Promise for the newly created Content Type
6761 * @example ```javascript
6762 * const contentful = require('contentful-management')
6763 *
6764 * const client = contentful.createClient({
6765 * accessToken: '<content_management_api_key>'
6766 * })
6767 *
6768 * client.getSpace('<space_id>')
6769 * .then((space) => space.getEnvironment('<environment-id>'))
6770 * .then((environment) => environment.createContentType({
6771 * name: 'Blog Post',
6772 * fields: [
6773 * {
6774 * id: 'title',
6775 * name: 'Title',
6776 * required: true,
6777 * localized: false,
6778 * type: 'Text'
6779 * }
6780 * ]
6781 * }))
6782 * .then((contentType) => console.log(contentType))
6783 * .catch(console.error)
6784 * ```
6785 */
6786 createContentType: function createContentType(data) {
6787 return http.post('content_types', data).then(function (response) {
6788 return wrapContentType(http, response.data);
6789 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
6790 },
6791
6792 /**
6793 * Creates a Content Type with a custom ID
6794 * @param id - Content Type ID
6795 * @param data - Object representation of the Content Type to be created
6796 * @return Promise for the newly created Content Type
6797 * @example ```javascript
6798 * const contentful = require('contentful-management')
6799 *
6800 * const client = contentful.createClient({
6801 * accessToken: '<content_management_api_key>'
6802 * })
6803 *
6804 * client.getSpace('<space_id>')
6805 * .then((space) => space.getEnvironment('<environment-id>'))
6806 * .then((environment) => environment.createContentTypeWithId('<content-type-id>', {
6807 * name: 'Blog Post',
6808 * fields: [
6809 * {
6810 * id: 'title',
6811 * name: 'Title',
6812 * required: true,
6813 * localized: false,
6814 * type: 'Text'
6815 * }
6816 * ]
6817 * }))
6818 * .then((contentType) => console.log(contentType))
6819 * .catch(console.error)
6820 * ```
6821 */
6822 createContentTypeWithId: function createContentTypeWithId(id, data) {
6823 return http.put('content_types/' + id, data).then(function (response) {
6824 return wrapContentType(http, response.data);
6825 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
6826 },
6827
6828 /**
6829 * Gets an EditorInterface for a ContentType
6830 * @param contentTypeId - Content Type ID
6831 * @return Promise for an EditorInterface
6832 * @example ```javascript
6833 * const contentful = require('contentful-management')
6834 *
6835 * const client = contentful.createClient({
6836 * accessToken: '<content_management_api_key>'
6837 * })
6838 *
6839 * client.getSpace('<space_id>')
6840 * .then((space) => space.getEnvironment('<environment-id>'))
6841 * .then((environment) => environment.getEditorInterfaceForContentType('<content_type_id>'))
6842 * .then((EditorInterface) => console.log(EditorInterface))
6843 * .catch(console.error)
6844 * ```
6845 */
6846 getEditorInterfaceForContentType: function getEditorInterfaceForContentType(contentTypeId) {
6847 return http.get('content_types/' + contentTypeId + '/editor_interface').then(function (response) {
6848 return wrapEditorInterface(http, response.data);
6849 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
6850 },
6851
6852 /**
6853 * Gets an Entry
6854 * Warning: if you are using the select operator, when saving, any field that was not selected will be removed
6855 * from your entry in the backend
6856 * @param id - Entry ID
6857 * @param query - Object with search parameters. In this method it's only useful for `locale`.
6858 * @return Promise for an Entry
6859 * @example ```javascript
6860 * const contentful = require('contentful-management')
6861 *
6862 * const client = contentful.createClient({
6863 * accessToken: '<content_management_api_key>'
6864 * })
6865 *
6866 * client.getSpace('<space_id>')
6867 * .then((space) => space.getEnvironment('<environment-id>'))
6868 * .then((environment) => environment.getEntry('<entry-id>'))
6869 * .then((entry) => console.log(entry))
6870 * .catch(console.error)
6871 * ```
6872 */
6873 getEntry: function getEntry(id) {
6874 var query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
6875 normalizeSelect(query);
6876 return http.get('entries/' + id, Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
6877 query: query
6878 })).then(function (response) {
6879 return wrapEntry(http, response.data);
6880 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
6881 },
6882
6883 /**
6884 * Gets a collection of Entries
6885 * Warning: if you are using the select operator, when saving, any field that was not selected will be removed
6886 * from your entry in the backend
6887 * @param query - Object with search parameters. Check the <a href="https://www.contentful.com/developers/docs/javascript/tutorials/using-js-cda-sdk/#retrieving-entries-with-search-parameters">JS SDK tutorial</a> and the <a href="https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters">REST API reference</a> for more details.
6888 * @return Promise for a collection of Entries
6889 * @example ```javascript
6890 * const contentful = require('contentful-management')
6891 *
6892 * const client = contentful.createClient({
6893 * accessToken: '<content_management_api_key>'
6894 * })
6895 *
6896 * client.getSpace('<space_id>')
6897 * .then((space) => space.getEnvironment('<environment-id>'))
6898 * .then((environment) => environment.getEntries({'content_type': 'foo'})) // you can add more queries as 'key': 'value'
6899 * .then((response) => console.log(response.items))
6900 * .catch(console.error)
6901 * ```
6902 */
6903 getEntries: function getEntries() {
6904 var query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6905 normalizeSelect(query);
6906 return http.get('entries', Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
6907 query: query
6908 })).then(function (response) {
6909 return wrapEntryCollection(http, response.data);
6910 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
6911 },
6912
6913 /**
6914 * Creates a Entry
6915 * @param contentTypeId - The Content Type ID of the newly created Entry
6916 * @param data - Object representation of the Entry to be created
6917 * @return Promise for the newly created Entry
6918 * @example ```javascript
6919 * const contentful = require('contentful-management')
6920 *
6921 * const client = contentful.createClient({
6922 * accessToken: '<content_management_api_key>'
6923 * })
6924 *
6925 * client.getSpace('<space_id>')
6926 * .then((space) => space.getEnvironment('<environment-id>'))
6927 * .then((environment) => environment.createEntry('<content_type_id>', {
6928 * fields: {
6929 * title: {
6930 * 'en-US': 'Entry title'
6931 * }
6932 * }
6933 * }))
6934 * .then((entry) => console.log(entry))
6935 * .catch(console.error)
6936 * ```
6937 */
6938 createEntry: function createEntry(contentTypeId, data) {
6939 return http.post('entries', data, {
6940 headers: {
6941 'X-Contentful-Content-Type': contentTypeId
6942 }
6943 }).then(function (response) {
6944 return wrapEntry(http, response.data);
6945 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
6946 },
6947
6948 /**
6949 * Creates a Entry with a custom ID
6950 * @param contentTypeId - The Content Type of the newly created Entry
6951 * @param id - Entry ID
6952 * @param data - Object representation of the Entry to be created
6953 * @return Promise for the newly created Entry
6954 * @example ```javascript
6955 * const contentful = require('contentful-management')
6956 *
6957 * const client = contentful.createClient({
6958 * accessToken: '<content_management_api_key>'
6959 * })
6960 *
6961 * // Create entry
6962 * client.getSpace('<space_id>')
6963 * .then((space) => space.getEnvironment('<environment-id>'))
6964 * .then((environment) => environment.createEntryWithId('<content_type_id>', '<entry_id>', {
6965 * fields: {
6966 * title: {
6967 * 'en-US': 'Entry title'
6968 * }
6969 * }
6970 * }))
6971 * .then((entry) => console.log(entry))
6972 * .catch(console.error)
6973 * ```
6974 */
6975 createEntryWithId: function createEntryWithId(contentTypeId, id, data) {
6976 return http.put('entries/' + id, data, {
6977 headers: {
6978 'X-Contentful-Content-Type': contentTypeId
6979 }
6980 }).then(function (response) {
6981 return wrapEntry(http, response.data);
6982 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
6983 },
6984
6985 /**
6986 * Gets an Asset
6987 * Warning: if you are using the select operator, when saving, any field that was not selected will be removed
6988 * from your entry in the backend
6989 * @param id - Asset ID
6990 * @param query - Object with search parameters. In this method it's only useful for `locale`.
6991 * @return Promise for an Asset
6992 * @example ```javascript
6993 * const contentful = require('contentful-management')
6994 *
6995 * const client = contentful.createClient({
6996 * accessToken: '<content_management_api_key>'
6997 * })
6998 *
6999 * client.getSpace('<space_id>')
7000 * .then((space) => space.getEnvironment('<environment-id>'))
7001 * .then((environment) => environment.getAsset('<asset_id>'))
7002 * .then((asset) => console.log(asset))
7003 * .catch(console.error)
7004 * ```
7005 */
7006 getAsset: function getAsset(id) {
7007 var query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7008 normalizeSelect(query);
7009 return http.get('assets/' + id, Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
7010 query: query
7011 })).then(function (response) {
7012 return wrapAsset(http, response.data);
7013 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
7014 },
7015
7016 /**
7017 * Gets a collection of Assets
7018 * Warning: if you are using the select operator, when saving, any field that was not selected will be removed
7019 * from your entry in the backend
7020 * @param query - Object with search parameters. Check the <a href="https://www.contentful.com/developers/docs/javascript/tutorials/using-js-cda-sdk/#retrieving-entries-with-search-parameters">JS SDK tutorial</a> and the <a href="https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters">REST API reference</a> for more details.
7021 * @return Promise for a collection of Assets
7022 * @example ```javascript
7023 * const contentful = require('contentful-management')
7024 *
7025 * const client = contentful.createClient({
7026 * accessToken: '<content_management_api_key>'
7027 * })
7028 *
7029 * client.getSpace('<space_id>')
7030 * .then((space) => space.getEnvironment('<environment-id>'))
7031 * .then((environment) => environment.getAssets())
7032 * .then((response) => console.log(response.items))
7033 * .catch(console.error)
7034 * ```
7035 */
7036 getAssets: function getAssets() {
7037 var query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7038 normalizeSelect(query);
7039 return http.get('assets', Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
7040 query: query
7041 })).then(function (response) {
7042 return wrapAssetCollection(http, response.data);
7043 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
7044 },
7045
7046 /**
7047 * Creates a Asset. After creation, call asset.processForLocale or asset.processForAllLocales to start asset processing.
7048 * @param data - Object representation of the Asset to be created. Note that the field object should have an upload property on asset creation, which will be removed and replaced with an url property when processing is finished.
7049 * @return Promise for the newly created Asset
7050 * @example ```javascript
7051 * const client = contentful.createClient({
7052 * accessToken: '<content_management_api_key>'
7053 * })
7054 *
7055 * // Create asset
7056 * client.getSpace('<space_id>')
7057 * .then((space) => space.getEnvironment('<environment-id>'))
7058 * .then((environment) => environment.createAsset({
7059 * fields: {
7060 * title: {
7061 * 'en-US': 'Playsam Streamliner'
7062 * },
7063 * file: {
7064 * 'en-US': {
7065 * contentType: 'image/jpeg',
7066 * fileName: 'example.jpeg',
7067 * upload: 'https://example.com/example.jpg'
7068 * }
7069 * }
7070 * }
7071 * }))
7072 * .then((asset) => asset.processForLocale("en-US")) // OR asset.processForAllLocales()
7073 * .then((asset) => console.log(asset))
7074 * .catch(console.error)
7075 * ```
7076 */
7077 createAsset: createAsset,
7078
7079 /**
7080 * Creates a Asset with a custom ID. After creation, call asset.processForLocale or asset.processForAllLocales to start asset processing.
7081 * @param id - Asset ID
7082 * @param data - Object representation of the Asset to be created. Note that the field object should have an upload property on asset creation, which will be removed and replaced with an url property when processing is finished.
7083 * @return Promise for the newly created Asset
7084 * @example ```javascript
7085 * const client = contentful.createClient({
7086 * accessToken: '<content_management_api_key>'
7087 * })
7088 *
7089 * // Create asset
7090 * client.getSpace('<space_id>')
7091 * .then((space) => space.getEnvironment('<environment-id>'))
7092 * .then((environment) => environment.createAssetWithId('<asset_id>', {
7093 * title: {
7094 * 'en-US': 'Playsam Streamliner'
7095 * },
7096 * file: {
7097 * 'en-US': {
7098 * contentType: 'image/jpeg',
7099 * fileName: 'example.jpeg',
7100 * upload: 'https://example.com/example.jpg'
7101 * }
7102 * }
7103 * }))
7104 * .then((asset) => asset.process())
7105 * .then((asset) => console.log(asset))
7106 * .catch(console.error)
7107 * ```
7108 */
7109 createAssetWithId: function createAssetWithId(id, data) {
7110 return http.put('assets/' + id, data).then(function (response) {
7111 return wrapAsset(http, response.data);
7112 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
7113 },
7114
7115 /**
7116 * Creates a Asset based on files. After creation, call asset.processForLocale or asset.processForAllLocales to start asset processing.
7117 * @param data - Object representation of the Asset to be created. Note that the field object should have an uploadFrom property on asset creation, which will be removed and replaced with an url property when processing is finished.
7118 * @param data.fields.file.[LOCALE].file - Can be a string, an ArrayBuffer or a Stream.
7119 * @return Promise for the newly created Asset
7120 * @example ```javascript
7121 * const client = contentful.createClient({
7122 * accessToken: '<content_management_api_key>'
7123 * })
7124 *
7125 * client.getSpace('<space_id>')
7126 * .then((space) => space.getEnvironment('<environment-id>'))
7127 * .then((environment) => environment.createAssetFromFiles({
7128 * fields: {
7129 * file: {
7130 * 'en-US': {
7131 * contentType: 'image/jpeg',
7132 * fileName: 'filename_english.jpg',
7133 * file: createReadStream('path/to/filename_english.jpg')
7134 * },
7135 * 'de-DE': {
7136 * contentType: 'image/svg+xml',
7137 * fileName: 'filename_german.svg',
7138 * file: '<svg><path fill="red" d="M50 50h150v50H50z"/></svg>'
7139 * }
7140 * }
7141 * }
7142 * }))
7143 * .then((asset) => console.log(asset))
7144 * .catch(console.error)
7145 * ```
7146 */
7147 createAssetFromFiles: function createAssetFromFiles(data) {
7148 var file = data.fields.file;
7149 return Promise.all(Object.keys(file).map(function (locale) {
7150 var _file$locale = file[locale],
7151 contentType = _file$locale.contentType,
7152 fileName = _file$locale.fileName;
7153 return createUpload(file[locale]).then(function (upload) {
7154 return _defineProperty({}, locale, {
7155 contentType: contentType,
7156 fileName: fileName,
7157 uploadFrom: {
7158 sys: {
7159 type: 'Link',
7160 linkType: 'Upload',
7161 id: upload.sys.id
7162 }
7163 }
7164 });
7165 });
7166 })).then(function (uploads) {
7167 var file = uploads.reduce(function (fieldsData, upload) {
7168 return _objectSpread(_objectSpread({}, fieldsData), upload);
7169 }, {});
7170
7171 var asset = _objectSpread(_objectSpread({}, data), {}, {
7172 fields: _objectSpread(_objectSpread({}, data.fields), {}, {
7173 file: file
7174 })
7175 });
7176
7177 return createAsset(asset);
7178 }).catch(_error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
7179 },
7180
7181 /**
7182 * Gets an Upload
7183 * @param id - Upload ID
7184 * @return Promise for an Upload
7185 * @example ```javascript
7186 * const client = contentful.createClient({
7187 * accessToken: '<content_management_api_key>'
7188 * })
7189 * const uploadStream = createReadStream('path/to/filename_english.jpg')
7190 *
7191 * client.getSpace('<space_id>')
7192 * .then((space) => space.getEnvironment('<environment-id>'))
7193 * .then((environment) => environment.getUpload('<upload-id>')
7194 * .then((upload) => console.log(upload))
7195 * .catch(console.error)
7196 */
7197 getUpload: function getUpload(id) {
7198 return httpUpload.get('uploads/' + id).then(function (response) {
7199 return wrapUpload(http, response.data);
7200 }).catch(_error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
7201 },
7202
7203 /**
7204 * Creates a Upload.
7205 * @param data - Object with file information.
7206 * @param data.file - Actual file content. Can be a string, an ArrayBuffer or a Stream.
7207 * @return Upload object containing information about the uploaded file.
7208 * @example ```javascript
7209 * const client = contentful.createClient({
7210 * accessToken: '<content_management_api_key>'
7211 * })
7212 * const uploadStream = createReadStream('path/to/filename_english.jpg')
7213 *
7214 * client.getSpace('<space_id>')
7215 * .then((space) => space.getEnvironment('<environment-id>'))
7216 * .then((environment) => environment.createUpload({file: uploadStream})
7217 * .then((upload) => console.log(upload))
7218 * .catch(console.error)
7219 * ```
7220 */
7221 createUpload: createUpload,
7222
7223 /**
7224 * Gets a Locale
7225 * @param id - Locale ID
7226 * @return Promise for an Locale
7227 * @example ```javascript
7228 * const contentful = require('contentful-management')
7229 *
7230 * const client = contentful.createClient({
7231 * accessToken: '<content_management_api_key>'
7232 * })
7233 *
7234 * client.getSpace('<space_id>')
7235 * .then((space) => space.getEnvironment('<environment-id>'))
7236 * .then((environment) => environment.getLocale('<locale_id>'))
7237 * .then((locale) => console.log(locale))
7238 * .catch(console.error)
7239 * ```
7240 */
7241 getLocale: function getLocale(id) {
7242 return http.get('locales/' + id).then(function (response) {
7243 return wrapLocale(http, response.data);
7244 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
7245 },
7246
7247 /**
7248 * Gets a collection of Locales
7249 * @return Promise for a collection of Locales
7250 * @example ```javascript
7251 * const contentful = require('contentful-management')
7252 *
7253 * const client = contentful.createClient({
7254 * accessToken: '<content_management_api_key>'
7255 * })
7256 *
7257 * client.getSpace('<space_id>')
7258 * .then((space) => space.getEnvironment('<environment-id>'))
7259 * .then((environment) => environment.getLocales())
7260 * .then((response) => console.log(response.items))
7261 * .catch(console.error)
7262 * ```
7263 */
7264 getLocales: function getLocales() {
7265 return http.get('locales').then(function (response) {
7266 return wrapLocaleCollection(http, response.data);
7267 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
7268 },
7269
7270 /**
7271 * Creates a Locale
7272 * @param data - Object representation of the Locale to be created
7273 * @return Promise for the newly created Locale
7274 * @example ```javascript
7275 * const contentful = require('contentful-management')
7276 *
7277 * const client = contentful.createClient({
7278 * accessToken: '<content_management_api_key>'
7279 * })
7280 *
7281 * // Create locale
7282 * client.getSpace('<space_id>')
7283 * .then((space) => space.getEnvironment('<environment-id>'))
7284 * .then((environment) => environment.createLocale({
7285 * name: 'German (Austria)',
7286 * code: 'de-AT',
7287 * fallbackCode: 'de-DE',
7288 * optional: true
7289 * }))
7290 * .then((locale) => console.log(locale))
7291 * .catch(console.error)
7292 * ```
7293 */
7294 createLocale: function createLocale(data) {
7295 return http.post('locales', data).then(function (response) {
7296 return wrapLocale(http, response.data);
7297 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
7298 },
7299
7300 /**
7301 * Gets an UI Extension
7302 * @param id - Extension ID
7303 * @return Promise for an UI Extension
7304 * @example ```javascript
7305 * const contentful = require('contentful-management')
7306 *
7307 * const client = contentful.createClient({
7308 * accessToken: '<content_management_api_key>'
7309 * })
7310 *
7311 * client.getSpace('<space_id>')
7312 * .then((space) => space.getEnvironment('<environment-id>'))
7313 * .then((environment) => environment.getUiExtension('<extension-id>'))
7314 * .then((uiExtension) => console.log(uiExtension))
7315 * .catch(console.error)
7316 * ```
7317 */
7318 getUiExtension: function getUiExtension(id) {
7319 return http.get('extensions/' + id).then(function (response) {
7320 return wrapUiExtension(http, response.data);
7321 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
7322 },
7323
7324 /**
7325 * Gets a collection of UI Extension
7326 * @return Promise for a collection of UI Extensions
7327 * @example ```javascript
7328 * const contentful = require('contentful-management')
7329 *
7330 * const client = contentful.createClient({
7331 * accessToken: '<content_management_api_key>'
7332 * })
7333 *
7334 * client.getSpace('<space_id>')
7335 * .then((space) => space.getEnvironment('<environment-id>'))
7336 * .then((environment) => environment.getUiExtensions()
7337 * .then((response) => console.log(response.items))
7338 * .catch(console.error)
7339 * ```
7340 */
7341 getUiExtensions: function getUiExtensions() {
7342 return http.get('extensions').then(function (response) {
7343 return wrapUiExtensionCollection(http, response.data);
7344 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
7345 },
7346
7347 /**
7348 * Creates a UI Extension
7349 * @param data - Object representation of the UI Extension to be created
7350 * @return Promise for the newly created UI Extension
7351 * @example ```javascript
7352 * const contentful = require('contentful-management')
7353 *
7354 * const client = contentful.createClient({
7355 * accessToken: '<content_management_api_key>'
7356 * })
7357 *
7358 * client.getSpace('<space_id>')
7359 * .then((space) => space.getEnvironment('<environment-id>'))
7360 * .then((environment) => environment.createUiExtension({
7361 * extension: {
7362 * name: 'My awesome extension',
7363 * src: 'https://example.com/my',
7364 * fieldTypes: [
7365 * {
7366 * type: 'Symbol'
7367 * },
7368 * {
7369 * type: 'Text'
7370 * }
7371 * ],
7372 * sidebar: false
7373 * }
7374 * }))
7375 * .then((uiExtension) => console.log(uiExtension))
7376 * .catch(console.error)
7377 * ```
7378 */
7379 createUiExtension: function createUiExtension(data) {
7380 return http.post('extensions', data).then(function (response) {
7381 return wrapUiExtension(http, response.data);
7382 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
7383 },
7384
7385 /**
7386 * Creates a UI Extension with a custom ID
7387 * @param id - Extension ID
7388 * @param data - Object representation of the UI Extension to be created
7389 * @return Promise for the newly created UI Extension
7390 * @example ```javascript
7391 * const contentful = require('contentful-management')
7392 *
7393 * const client = contentful.createClient({
7394 * accessToken: '<content_management_api_key>'
7395 * })
7396 *
7397 * client.getSpace('<space_id>')
7398 * .then((space) => space.getEnvironment('<environment-id>'))
7399 * .then((environment) => environment.createUiExtensionWithId('<extension_id>', {
7400 * extension: {
7401 * name: 'My awesome extension',
7402 * src: 'https://example.com/my',
7403 * fieldTypes: [
7404 * {
7405 * type: 'Symbol'
7406 * },
7407 * {
7408 * type: 'Text'
7409 * }
7410 * ],
7411 * sidebar: false
7412 * }
7413 * }))
7414 * .then((uiExtension) => console.log(uiExtension))
7415 * .catch(console.error)
7416 * ```
7417 */
7418 createUiExtensionWithId: function createUiExtensionWithId(id, data) {
7419 return http.put('extensions/' + id, data).then(function (response) {
7420 return wrapUiExtension(http, response.data);
7421 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
7422 },
7423
7424 /**
7425 * Gets an App Installation
7426 * @param appDefinitionId - AppDefinition ID
7427 * @param data - AppInstallation data
7428 * @return Promise for an App Installation
7429 * @example ```javascript
7430 * const contentful = require('contentful-management')
7431 *
7432 * const client = contentful.createClient({
7433 * accessToken: '<content_management_api_key>'
7434 * })
7435 *
7436 * client.getSpace('<space_id>')
7437 * .then((space) => space.getEnvironment('<environment-id>'))
7438 * .then((environment) => environment.createAppInstallation('<app_definition_id>', {
7439 * parameters: {
7440 * someParameter: someValue
7441 * }
7442 * })
7443 * .then((appInstallation) => console.log(appInstallation))
7444 * .catch(console.error)
7445 * ```
7446 */
7447 createAppInstallation: function createAppInstallation(appDefinitionId, data) {
7448 return http.put('app_installations/' + appDefinitionId, data).then(function (response) {
7449 return wrapAppInstallation(http, response.data);
7450 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
7451 },
7452
7453 /**
7454 * Gets an App Installation
7455 * @param id - AppDefintion ID
7456 * @return Promise for an App Installation
7457 * @example ```javascript
7458 * const contentful = require('contentful-management')
7459 *
7460 * const client = contentful.createClient({
7461 * accessToken: '<content_management_api_key>'
7462 * })
7463 *
7464 * client.getSpace('<space_id>')
7465 * .then((space) => space.getEnvironment('<environment-id>'))
7466 * .then((environment) => environment.getAppInstallation('<app-definition-id>'))
7467 * .then((appInstallation) => console.log(appInstallation))
7468 * .catch(console.error)
7469 * ```
7470 */
7471 getAppInstallation: function getAppInstallation(id) {
7472 return http.get('app_installations/' + id).then(function (response) {
7473 return wrapAppInstallation(http, response.data);
7474 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
7475 },
7476
7477 /**
7478 * Gets a collection of App Installation
7479 * @return Promise for a collection of App Installations
7480 * @example ```javascript
7481 * const contentful = require('contentful-management')
7482 *
7483 * const client = contentful.createClient({
7484 * accessToken: '<content_management_api_key>'
7485 * })
7486 *
7487 * client.getSpace('<space_id>')
7488 * .then((space) => space.getEnvironment('<environment-id>'))
7489 * .then((environment) => environment.getAppInstallations()
7490 * .then((response) => console.log(response.items))
7491 * .catch(console.error)
7492 * ```
7493 */
7494 getAppInstallations: function getAppInstallations() {
7495 return http.get('app_installations').then(function (response) {
7496 return wrapAppInstallationCollection(http, response.data);
7497 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
7498 },
7499
7500 /**
7501 * Gets all snapshots of an entry
7502 * @func getEntrySnapshots
7503 * @param entryId - Entry ID
7504 * @param query - query additional query paramaters
7505 * @return Promise for a collection of Entry Snapshots
7506 * @example ```javascript
7507 * const contentful = require('contentful-management')
7508 *
7509 * const client = contentful.createClient({
7510 * accessToken: '<content_management_api_key>'
7511 * })
7512 *
7513 * client.getSpace('<space_id>')
7514 * .then((space) => space.getEnvironment('<environment-id>'))
7515 * .then((environment) => environment.getEntrySnapshots('<entry_id>'))
7516 * .then((snapshots) => console.log(snapshots.items))
7517 * .catch(console.error)
7518 * ```
7519 */
7520 getEntrySnapshots: function getEntrySnapshots(entryId) {
7521 var query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7522 return http.get("entries/".concat(entryId, "/snapshots"), Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
7523 query: query
7524 })).then(function (response) {
7525 return wrapSnapshotCollection(http, response.data);
7526 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
7527 },
7528
7529 /**
7530 * Gets all snapshots of a contentType
7531 * @func getContentTypeSnapshots
7532 * @param contentTypeId - Content Type ID
7533 * @param query - query additional query paramaters
7534 * @return Promise for a collection of Content Type Snapshots
7535 * @example ```javascript
7536 * const contentful = require('contentful-management')
7537 *
7538 * const client = contentful.createClient({
7539 * accessToken: '<content_management_api_key>'
7540 * })
7541 *
7542 * client.getSpace('<space_id>')
7543 * .then((space) => space.getEnvironment('<environment-id>'))
7544 * .then((environment) => environment.getContentTypeSnapshots('<contentTypeId>'))
7545 * .then((snapshots) => console.log(snapshots.items))
7546 * .catch(console.error)
7547 * ```
7548 */
7549 getContentTypeSnapshots: function getContentTypeSnapshots(contentTypeId) {
7550 var query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7551 return http.get("content_types/".concat(contentTypeId, "/snapshots"), Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
7552 query: query
7553 })).then(function (response) {
7554 return wrapSnapshotCollection(http, response.data);
7555 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
7556 }
7557 };
7558}
7559
7560/***/ }),
7561
7562/***/ "./create-organization-api.ts":
7563/*!************************************!*\
7564 !*** ./create-organization-api.ts ***!
7565 \************************************/
7566/*! exports provided: default */
7567/***/ (function(module, __webpack_exports__, __webpack_require__) {
7568
7569"use strict";
7570__webpack_require__.r(__webpack_exports__);
7571/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return createOrganizationApi; });
7572/* harmony import */ var lodash_get__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/get */ "../node_modules/lodash/get.js");
7573/* harmony import */ var lodash_get__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_get__WEBPACK_IMPORTED_MODULE_0__);
7574/* harmony import */ var contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! contentful-sdk-core */ "../node_modules/contentful-sdk-core/dist/index.es-modules.js");
7575/* harmony import */ var _error_handler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./error-handler */ "./error-handler.ts");
7576/* harmony import */ var _entities__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./entities */ "./entities/index.ts");
7577
7578
7579
7580
7581
7582/**
7583 * Creates API object with methods to access the Organization API
7584 */
7585function createOrganizationApi(_ref) {
7586 var http = _ref.http;
7587 var _entities$appDefiniti = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].appDefinition,
7588 wrapAppDefinition = _entities$appDefiniti.wrapAppDefinition,
7589 wrapAppDefinitionCollection = _entities$appDefiniti.wrapAppDefinitionCollection;
7590 var _entities$user = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].user,
7591 wrapUser = _entities$user.wrapUser,
7592 wrapUserCollection = _entities$user.wrapUserCollection;
7593 var _entities$organizatio = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].organizationMembership,
7594 wrapOrganizationMembership = _entities$organizatio.wrapOrganizationMembership,
7595 wrapOrganizationMembershipCollection = _entities$organizatio.wrapOrganizationMembershipCollection;
7596 var _entities$teamMembers = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].teamMembership,
7597 wrapTeamMembership = _entities$teamMembers.wrapTeamMembership,
7598 wrapTeamMembershipCollection = _entities$teamMembers.wrapTeamMembershipCollection;
7599 var _entities$teamSpaceMe = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].teamSpaceMembership,
7600 wrapTeamSpaceMembership = _entities$teamSpaceMe.wrapTeamSpaceMembership,
7601 wrapTeamSpaceMembershipCollection = _entities$teamSpaceMe.wrapTeamSpaceMembershipCollection;
7602 var _entities$team = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].team,
7603 wrapTeam = _entities$team.wrapTeam,
7604 wrapTeamCollection = _entities$team.wrapTeamCollection;
7605 var _entities$spaceMember = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].spaceMembership,
7606 wrapSpaceMembership = _entities$spaceMember.wrapSpaceMembership,
7607 wrapSpaceMembershipCollection = _entities$spaceMember.wrapSpaceMembershipCollection;
7608 var wrapOrganizationInvitation = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].organizationInvitation.wrapOrganizationInvitation;
7609 var headers = {
7610 'x-contentful-enable-alpha-feature': 'organization-user-management-api'
7611 };
7612 return {
7613 /**
7614 * Gets a User
7615 * @return Promise for a User
7616 * @example ```javascript
7617 * const contentful = require('contentful-management')
7618 * const client = contentful.createClient({
7619 * accessToken: '<content_management_api_key>'
7620 * })
7621 *
7622 * client.getOrganization('<organization_id>')
7623 * .then((organization) => organization.getUser('id'))
7624 * .then((user) => console.log(user))
7625 * .catch(console.error)
7626 * ```
7627 */
7628 getUser: function getUser(id) {
7629 return http.get('users/' + id).then(function (response) {
7630 return wrapUser(http, response.data);
7631 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
7632 },
7633
7634 /**
7635 * Gets a collection of Users in organization
7636 * @param query - Object with search parameters. Check the <a href="https://www.contentful.com/developers/docs/javascript/tutorials/using-js-cda-sdk/#retrieving-entries-with-search-parameters">JS SDK tutorial</a> and the <a href="https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters">REST API reference</a> for more details.
7637 * @return Promise a collection of Users in organization
7638 * @example ```javascript
7639 * const contentful = require('contentful-management')
7640 * const client = contentful.createClient({
7641 * accessToken: '<content_management_api_key>'
7642 * })
7643 *
7644 * client.getOrganization('<organization_id>')
7645 * .then((organization) => organization.getUsers())
7646 * .then((user) => console.log(user))
7647 * .catch(console.error)
7648 * ```
7649 */
7650 getUsers: function getUsers() {
7651 var query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7652 return http.get('users', Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
7653 query: query
7654 })).then(function (response) {
7655 return wrapUserCollection(http, response.data);
7656 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
7657 },
7658
7659 /**
7660 * Gets an Organization Membership
7661 * @param id - Organization Membership ID
7662 * @return Promise for an Organization Membership
7663 * @example ```javascript
7664 * const contentful = require('contentful-management')
7665 * const client = contentful.createClient({
7666 * accessToken: '<content_management_api_key>'
7667 * })
7668 *
7669 * client.getOrganization('organization_id')
7670 * .then((organization) => organization.getOrganizationMembership('organizationMembership_id'))
7671 * .then((organizationMembership) => console.log(organizationMembership))
7672 * .catch(console.error)
7673 * ```
7674 */
7675 getOrganizationMembership: function getOrganizationMembership(id) {
7676 return http.get('organization_memberships/' + id).then(function (response) {
7677 return wrapOrganizationMembership(http, response.data);
7678 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
7679 },
7680
7681 /**
7682 * Gets a collection of Organization Memberships
7683 * @param query - Object with search parameters. Check the <a href="https://www.contentful.com/developers/docs/javascript/tutorials/using-js-cda-sdk/#retrieving-entries-with-search-parameters">JS SDK tutorial</a> and the <a href="https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters">REST API reference</a> for more details.
7684 * @return Promise for a collection of Organization Memberships
7685 * @example ```javascript
7686 * const contentful = require('contentful-management')
7687 * const client = contentful.createClient({
7688 * accessToken: '<content_management_api_key>'
7689 * })
7690 *
7691 * client.getOrganization('organization_id')
7692 * .then((organization) => organization.getOrganizationMemberships({'limit': 100})) // you can add more queries as 'key': 'value'
7693 * .then((response) => console.log(response.items))
7694 * .catch(console.error)
7695 * ```
7696 */
7697 getOrganizationMemberships: function getOrganizationMemberships() {
7698 var query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7699 return http.get('organization_memberships', Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
7700 query: query
7701 })).then(function (response) {
7702 return wrapOrganizationMembershipCollection(http, response.data);
7703 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
7704 },
7705
7706 /**
7707 * Creates a Team
7708 * @param Object representation of the Team to be created
7709 * @example ```javascript
7710 * const contentful = require('contentful-management')
7711 * const client = contentful.createClient({
7712 * accessToken: '<content_management_api_key>'
7713 * })
7714 *
7715 * client.getOrganization('<org_id>')
7716 * .then((org) => org.createTeam({
7717 * name: 'new team',
7718 * description: 'new team description'
7719 * }))
7720 * .then((team) => console.log(team))
7721 * .catch(console.error)
7722 * ```
7723 */
7724 createTeam: function createTeam(data) {
7725 return http.post('teams', data).then(function (response) {
7726 return wrapTeam(http, response.data);
7727 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
7728 },
7729
7730 /**
7731 * Gets an Team
7732 * @example ```javascript
7733 * const contentful = require('contentful-management')
7734 * const client = contentful.createClient({
7735 * accessToken: '<content_management_api_key>'
7736 * })
7737 *
7738 * client.getOrganization('orgId')
7739 * .then((organization) => organization.getTeam('teamId'))
7740 * .then((team) => console.log(team))
7741 * .catch(console.error)
7742 * ```
7743 */
7744 getTeam: function getTeam(teamId) {
7745 return http.get('teams/' + teamId).then(function (response) {
7746 return wrapTeam(http, response.data);
7747 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
7748 },
7749
7750 /**
7751 * Gets all Teams in an organization
7752 * @example ```javascript
7753 * const contentful = require('contentful-management')
7754 * const client = contentful.createClient({
7755 * accessToken: '<content_management_api_key>'
7756 * })
7757 *
7758 * client.getOrganization('orgId')
7759 * .then((organization) => organization.getTeams())
7760 * .then((teams) => console.log(teams))
7761 * .catch(console.error)
7762 * ```
7763 */
7764 getTeams: function getTeams() {
7765 var query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7766 return http.get('teams', Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
7767 query: query
7768 })).then(function (response) {
7769 return wrapTeamCollection(http, response.data);
7770 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
7771 },
7772
7773 /**
7774 * Creates a Team membership
7775 * @param data - Object representation of the Team Membership to be created
7776 * @return Promise for the newly created TeamMembership
7777 * @example ```javascript
7778 * const contentful = require('contentful-management')
7779 * const client = contentful.createClient({
7780 * accessToken: '<content_management_api_key>'
7781 * })
7782 *
7783 * client.getOrganization('organizationId')
7784 * .then((org) => org.createTeamMembership('teamId', {
7785 * admin: true,
7786 * organizationMembershipId: 'organizationMembershipId'
7787 * }))
7788 * .then((teamMembership) => console.log(teamMembership))
7789 * .catch(console.error)
7790 * ```
7791 */
7792 createTeamMembership: function createTeamMembership(teamId, data) {
7793 return http.post('teams/' + teamId + '/team_memberships', data).then(function (response) {
7794 return wrapTeamMembership(http, response.data);
7795 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
7796 },
7797
7798 /**
7799 * Gets an Team Membership from the team with given teamId
7800 * @return Promise for an Team Membership
7801 * @example ```javascript
7802 * const contentful = require('contentful-management')
7803 * const client = contentful.createClient({
7804 * accessToken: '<content_management_api_key>'
7805 * })
7806 *
7807 * client.getOrganization('organizationId')
7808 * .then((organization) => organization.getTeamMembership('teamId', 'teamMembership_id'))
7809 * .then((teamMembership) => console.log(teamMembership))
7810 * .catch(console.error)
7811 * ```
7812 */
7813 getTeamMembership: function getTeamMembership(teamId, teamMembershipId) {
7814 return http.get('teams/' + teamId + '/team_memberships/' + teamMembershipId).then(function (response) {
7815 return wrapTeamMembership(http, response.data);
7816 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
7817 },
7818
7819 /**
7820 * Get all Team Memberships. If teamID is provided in the optional config object, it will return all Team Memberships in that team. By default, returns all team memberships for the organization.
7821 * @return Promise for a Team Membership Collection
7822 * @example ```javascript
7823 * const contentful = require('contentful-management')
7824 * const client = contentful.createClient({
7825 * accessToken: '<content_management_api_key>'
7826 * })
7827 *
7828 * client.getOrganization('organizationId')
7829 * .then((organization) => organization.getTeamMemberships('teamId'))
7830 * .then((teamMemberships) => console.log(teamMemberships))
7831 * .catch(console.error)
7832 * ```
7833 */
7834 getTeamMemberships: function getTeamMemberships() {
7835 var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7836
7837 var query = lodash_get__WEBPACK_IMPORTED_MODULE_0___default()(opts, 'query', {});
7838
7839 if (opts.teamId) {
7840 return http.get('teams/' + opts.teamId + '/team_memberships', Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
7841 query: query
7842 })).then(function (response) {
7843 return wrapTeamMembershipCollection(http, response.data);
7844 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
7845 }
7846
7847 return http.get('team_memberships', Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
7848 query: query
7849 })).then(function (response) {
7850 return wrapTeamMembershipCollection(http, response.data);
7851 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
7852 },
7853
7854 /**
7855 * Get all Team Space Memberships. If teamID is provided in the optional config object, it will return all Team Space Memberships in that team. By default, returns all team space memberships across all teams in the organization.
7856 * @return Promise for a Team Space Membership Collection
7857 * @example ```javascript
7858 * const contentful = require('contentful-management')
7859 * const client = contentful.createClient({
7860 * accessToken: '<content_management_api_key>'
7861 * })
7862 *
7863 * client.getOrganization('organizationId')
7864 * .then((organization) => organization.getTeamSpaceMemberships('teamId'))
7865 * .then((teamSpaceMemberships) => console.log(teamSpaceMemberships))
7866 * .catch(console.error)
7867 * ```
7868 */
7869 getTeamSpaceMemberships: function getTeamSpaceMemberships() {
7870 var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7871
7872 var query = lodash_get__WEBPACK_IMPORTED_MODULE_0___default()(opts, 'query', {});
7873
7874 if (opts.teamId) {
7875 // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
7876 // @ts-ignore
7877 query['sys.team.sys.id'] = opts.teamId;
7878 }
7879
7880 return http.get('team_space_memberships', Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
7881 query: query
7882 })).then(function (response) {
7883 return wrapTeamSpaceMembershipCollection(http, response.data);
7884 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
7885 },
7886
7887 /**
7888 * Get a Team Space Membership with given teamSpaceMembershipId
7889 * @return Promise for a Team Space Membership
7890 * @example ```javascript
7891 * const contentful = require('contentful-management')
7892 * const client = contentful.createClient({
7893 * accessToken: '<content_management_api_key>'
7894 * })
7895 *
7896 * client.getOrganization('organizationId')
7897 * .then((organization) => organization.getTeamSpaceMembership('teamSpaceMembershipId'))
7898 * .then((teamSpaceMembership) => console.log(teamSpaceMembership))
7899 * .catch(console.error)]
7900 * ```
7901 */
7902 getTeamSpaceMembership: function getTeamSpaceMembership(teamSpaceMembershipId) {
7903 return http.get('team_space_memberships/' + teamSpaceMembershipId).then(function (response) {
7904 return wrapTeamSpaceMembership(http, response.data);
7905 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
7906 },
7907
7908 /**
7909 * Gets an Space Membership in Organization
7910 * @param id - Organiztion Space Membership ID
7911 * @return Promise for a Space Membership in an organization
7912 * @example ```javascript
7913 * const contentful = require('contentful-management')
7914 * const client = contentful.createClient({
7915 * accessToken: '<content_management_api_key>'
7916 * })
7917 *
7918 * client.getOrganization('organization_id')
7919 * .then((organization) => organization.getOrganizationSpaceMembership('organizationSpaceMembership_id'))
7920 * .then((organizationMembership) => console.log(organizationMembership))
7921 * .catch(console.error)
7922 * ```
7923 */
7924 getOrganizationSpaceMembership: function getOrganizationSpaceMembership(id) {
7925 return http.get('space_memberships/' + id).then(function (response) {
7926 return wrapSpaceMembership(http, response.data);
7927 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
7928 },
7929
7930 /**
7931 * Gets a collection Space Memberships in organization
7932 * @param query - Object with search parameters. Check the <a href="https://www.contentful.com/developers/docs/javascript/tutorials/using-js-cda-sdk/#retrieving-entries-with-search-parameters">JS SDK tutorial</a> and the <a href="https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters">REST API reference</a> for more details.
7933 * @return Promise for a Space Membership collection across all spaces in the organization
7934 * @example ```javascript
7935 * const contentful = require('contentful-management')
7936 * const client = contentful.createClient({
7937 * accessToken: '<content_management_api_key>'
7938 * })
7939 *
7940 * client.getOrganization('organization_id')
7941 * .then((organization) => organization.getOrganizationSpaceMemberships()) // you can add queries like 'limit': 100
7942 * .then((response) => console.log(response.items))
7943 * .catch(console.error)
7944 * ```
7945 */
7946 getOrganizationSpaceMemberships: function getOrganizationSpaceMemberships() {
7947 var query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7948 return http.get('space_memberships', Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
7949 query: query
7950 })).then(function (response) {
7951 return wrapSpaceMembershipCollection(http, response.data);
7952 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
7953 },
7954
7955 /**
7956 * Gets an Invitation in Organization
7957 * @return Promise for a OrganizationInvitation in an organization
7958 * @example ```javascript
7959 * const contentful = require('contentful-management')
7960 * const client = contentful.createClient({
7961 * accessToken: '<content_management_api_key>'
7962 * })
7963 *
7964 * client.getOrganization('<org_id>')
7965 * .then((organization) => organization.getOrganizationInvitation('invitation_id'))
7966 * .then((invitation) => console.log(invitation))
7967 * .catch(console.error)
7968 * ```
7969 */
7970 getOrganizationInvitation: function getOrganizationInvitation(invitationId) {
7971 return http.get('invitations/' + invitationId, {
7972 headers: headers
7973 }).then(function (response) {
7974 return wrapOrganizationInvitation(http, response.data);
7975 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
7976 },
7977
7978 /**
7979 * Create an Invitation in Organization
7980 * @return Promise for a OrganizationInvitation in an organization
7981 * @example ```javascript
7982 * const contentful = require('contentful-management')
7983 * const client = contentful.createClient({
7984 * accessToken: '<content_management_api_key>'
7985 * })
7986 *
7987 * client.getOrganization('<org_id>')
7988 * .then((organization) => organization.createOrganizationInvitation({
7989 * email: 'user.email@example.com'
7990 * firstName: 'User First Name'
7991 * lastName: 'User Last Name'
7992 * role: 'developer'
7993 * })
7994 * .catch(console.error)
7995 * ```
7996 */
7997 createOrganizationInvitation: function createOrganizationInvitation(data) {
7998 var invitationAlphaHeaders = {
7999 'x-contentful-enable-alpha-feature': 'pending-org-membership'
8000 };
8001 return http.post('invitations', data, {
8002 headers: invitationAlphaHeaders
8003 }).then(function (response) {
8004 return wrapOrganizationInvitation(http, response.data);
8005 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8006 },
8007
8008 /**
8009 * Creates an app definition
8010 * @param Object representation of the App Definition to be created
8011 * @return Promise for the newly created AppDefinition
8012 * @example ```javascript
8013 * const contentful = require('contentful-management')
8014 * const client = contentful.createClient({
8015 * accessToken: '<content_management_api_key>'
8016 * })
8017 *
8018 * client.getOrganization('<org_id>')
8019 * .then((org) => org.createAppDefinition({
8020 * name: 'Example app',
8021 * locations: [{ location: 'app-config' }],
8022 * src: "http://my-app-host.com/my-app"
8023 * }))
8024 * .then((appDefinition) => console.log(appDefinition))
8025 * .catch(console.error)
8026 * ```
8027 */
8028 createAppDefinition: function createAppDefinition(data) {
8029 return http.post('app_definitions', data).then(function (response) {
8030 return wrapAppDefinition(http, response.data);
8031 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8032 },
8033
8034 /**
8035 * Gets all app definitions
8036 * @return Promise for a collection of App Definitions
8037 * @example ```javascript
8038 * const contentful = require('contentful-management')
8039 * const client = contentful.createClient({
8040 * accessToken: '<content_management_api_key>'
8041 * })
8042 *
8043 * client.getOrganization('<org_id>')
8044 * .then((org) => org.getAppDefinitions())
8045 * .then((response) => console.log(response.items))
8046 * .catch(console.error)
8047 * ```
8048 */
8049 getAppDefinitions: function getAppDefinitions() {
8050 var query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
8051 return http.get('app_definitions', Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
8052 query: query
8053 })).then(function (response) {
8054 return wrapAppDefinitionCollection(http, response.data);
8055 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8056 },
8057
8058 /**
8059 * Gets an app definition
8060 * @return Promise for an App Definition
8061 * @example ```javascript
8062 * const contentful = require('contentful-management')
8063 * const client = contentful.createClient({
8064 * accessToken: '<content_management_api_key>'
8065 * })
8066 *
8067 * client.getOrganization('<org_id>')
8068 * .then((org) => org.getAppDefinition('<app_definition_id>'))
8069 * .then((appDefinition) => console.log(appDefinition))
8070 * .catch(console.error)
8071 * ```
8072 */
8073 getAppDefinition: function getAppDefinition(id) {
8074 return http.get('app_definitions/' + id).then(function (response) {
8075 return wrapAppDefinition(http, response.data);
8076 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8077 }
8078 };
8079}
8080
8081/***/ }),
8082
8083/***/ "./create-space-api.ts":
8084/*!*****************************!*\
8085 !*** ./create-space-api.ts ***!
8086 \*****************************/
8087/*! exports provided: default */
8088/***/ (function(module, __webpack_exports__, __webpack_require__) {
8089
8090"use strict";
8091__webpack_require__.r(__webpack_exports__);
8092/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return createSpaceApi; });
8093/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
8094/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
8095/* harmony import */ var contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! contentful-sdk-core */ "../node_modules/contentful-sdk-core/dist/index.es-modules.js");
8096/* harmony import */ var _error_handler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./error-handler */ "./error-handler.ts");
8097/* harmony import */ var _entities__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./entities */ "./entities/index.ts");
8098function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
8099
8100function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
8101
8102function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
8103
8104/**
8105 * Contentful Space API. Contains methods to access any operations at a space
8106 * level, such as creating and reading entities contained in a space.
8107 */
8108
8109
8110
8111
8112
8113function raiseDeprecationWarning(method) {
8114 console.warn(["Deprecated: Space.".concat(method, "() will be removed in future major versions."), null, "Please migrate your code to use Environment.".concat(method, "():"), "https://contentful.github.io/contentful-management.js/contentful-management/latest/ContentfulEnvironmentAPI.html#.".concat(method), null].join('\n'));
8115}
8116
8117function spaceMembershipDeprecationWarning() {
8118 console.warn('The user attribute in the space membership root is deprecated. The attribute has been moved inside the sys object (i.e. sys.user)');
8119}
8120
8121/**
8122 * Creates API object with methods to access the Space API
8123 * @param {object} params - API initialization params
8124 * @prop {object} http - HTTP client instance
8125 * @prop {object} entities - Object with wrapper methods for each kind of entity
8126 * @return {ContentfulSpaceAPI}
8127 */
8128function createSpaceApi(_ref) {
8129 var http = _ref.http,
8130 httpUpload = _ref.httpUpload;
8131 var wrapSpace = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].space.wrapSpace;
8132 var _entities$environment = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].environment,
8133 wrapEnvironment = _entities$environment.wrapEnvironment,
8134 wrapEnvironmentCollection = _entities$environment.wrapEnvironmentCollection;
8135 var _entities$contentType = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].contentType,
8136 wrapContentType = _entities$contentType.wrapContentType,
8137 wrapContentTypeCollection = _entities$contentType.wrapContentTypeCollection;
8138 var _entities$entry = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].entry,
8139 wrapEntry = _entities$entry.wrapEntry,
8140 wrapEntryCollection = _entities$entry.wrapEntryCollection;
8141 var _entities$asset = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].asset,
8142 wrapAsset = _entities$asset.wrapAsset,
8143 wrapAssetCollection = _entities$asset.wrapAssetCollection;
8144 var _entities$locale = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].locale,
8145 wrapLocale = _entities$locale.wrapLocale,
8146 wrapLocaleCollection = _entities$locale.wrapLocaleCollection;
8147 var _entities$webhook = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].webhook,
8148 wrapWebhook = _entities$webhook.wrapWebhook,
8149 wrapWebhookCollection = _entities$webhook.wrapWebhookCollection;
8150 var _entities$role = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].role,
8151 wrapRole = _entities$role.wrapRole,
8152 wrapRoleCollection = _entities$role.wrapRoleCollection;
8153 var _entities$user = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].user,
8154 wrapUser = _entities$user.wrapUser,
8155 wrapUserCollection = _entities$user.wrapUserCollection;
8156 var _entities$spaceMember = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].spaceMember,
8157 wrapSpaceMember = _entities$spaceMember.wrapSpaceMember,
8158 wrapSpaceMemberCollection = _entities$spaceMember.wrapSpaceMemberCollection;
8159 var _entities$spaceMember2 = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].spaceMembership,
8160 wrapSpaceMembership = _entities$spaceMember2.wrapSpaceMembership,
8161 wrapSpaceMembershipCollection = _entities$spaceMember2.wrapSpaceMembershipCollection;
8162 var _entities$teamSpaceMe = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].teamSpaceMembership,
8163 wrapTeamSpaceMembership = _entities$teamSpaceMe.wrapTeamSpaceMembership,
8164 wrapTeamSpaceMembershipCollection = _entities$teamSpaceMe.wrapTeamSpaceMembershipCollection;
8165 var _entities$apiKey = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].apiKey,
8166 wrapApiKey = _entities$apiKey.wrapApiKey,
8167 wrapApiKeyCollection = _entities$apiKey.wrapApiKeyCollection;
8168 var _entities$previewApiK = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].previewApiKey,
8169 wrapPreviewApiKey = _entities$previewApiK.wrapPreviewApiKey,
8170 wrapPreviewApiKeyCollection = _entities$previewApiK.wrapPreviewApiKeyCollection;
8171 var wrapSnapshotCollection = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].snapshot.wrapSnapshotCollection;
8172 var wrapEditorInterface = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].editorInterface.wrapEditorInterface;
8173 var wrapUpload = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].upload.wrapUpload;
8174 var _entities$uiExtension = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].uiExtension,
8175 wrapUiExtension = _entities$uiExtension.wrapUiExtension,
8176 wrapUiExtensionCollection = _entities$uiExtension.wrapUiExtensionCollection;
8177 var _entities$environment2 = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].environmentAlias,
8178 wrapEnvironmentAlias = _entities$environment2.wrapEnvironmentAlias,
8179 wrapEnvironmentAliasCollection = _entities$environment2.wrapEnvironmentAliasCollection;
8180
8181 function createAsset(data) {
8182 return http.post('assets', data).then(function (response) {
8183 return wrapAsset(http, response.data);
8184 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8185 }
8186
8187 function createUpload(data) {
8188 raiseDeprecationWarning('createUpload');
8189 var file = data.file;
8190
8191 if (!file) {
8192 return Promise.reject(new Error('Unable to locate a file to upload.'));
8193 }
8194
8195 return httpUpload.post('uploads', file, {
8196 headers: {
8197 'Content-Type': 'application/octet-stream'
8198 }
8199 }).then(function (uploadResponse) {
8200 return wrapUpload(httpUpload, uploadResponse.data);
8201 }).catch(_error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8202 }
8203 /*
8204 * @private
8205 * sdk relies heavily on sys metadata
8206 * so we cannot omit the sys property on sdk level
8207 *
8208 */
8209
8210
8211 function normalizeSelect(query) {
8212 if (query.select && !/sys/i.test(query.select)) {
8213 query.select += ',sys';
8214 }
8215 }
8216
8217 return {
8218 /**
8219 * Deletes the space
8220 * @return Promise for the deletion. It contains no data, but the Promise error case should be handled.
8221 * @example ```javascript
8222 * const contentful = require('contentful-management')
8223 *
8224 * const client = contentful.createClient({
8225 * accessToken: '<content_management_api_key>'
8226 * })
8227 *
8228 * client.getSpace('<space_id>')
8229 * .then((space) => space.delete())
8230 * .then(() => console.log('Space deleted.'))
8231 * .catch(console.error)
8232 * ```
8233 */
8234 delete: function deleteSpace() {
8235 return http.delete('').then(function () {// do nothing
8236 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8237 },
8238
8239 /**
8240 * Updates the space
8241 * @return Promise for the updated space.
8242 * @example ```javascript
8243 * const contentful = require('contentful-management')
8244 *
8245 * const client = contentful.createClient({
8246 * accessToken: '<content_management_api_key>'
8247 * })
8248 *
8249 * client.getSpace('<space_id>')
8250 * .then((space) => {
8251 * space.name = 'New name'
8252 * return space.update()
8253 * })
8254 * .then((space) => console.log(`Space ${space.sys.id} renamed.`)
8255 * .catch(console.error)
8256 * ```
8257 */
8258 update: function updateSpace() {
8259 var raw = this.toPlainObject();
8260 var data = lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(raw);
8261 delete data.sys;
8262 return http.put('', data, {
8263 headers: {
8264 'X-Contentful-Version': raw.sys.version
8265 }
8266 }).then(function (response) {
8267 return wrapSpace(http, response.data);
8268 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8269 },
8270
8271 /**
8272 * Gets an environment
8273 * @param id - Environment ID
8274 * @return Promise for an Environment
8275 * @example ```javascript
8276 * const contentful = require('contentful-management')
8277 *
8278 * const client = contentful.createClient({
8279 * accessToken: '<content_management_api_key>'
8280 * })
8281 *
8282 * client.getSpace('<space_id>')
8283 * .then((space) => space.getEnvironment('<environement_id>'))
8284 * .then((environment) => console.log(environment))
8285 * .catch(console.error)
8286 * ```
8287 */
8288 getEnvironment: function getEnvironment(id) {
8289 return http.get('environments/' + id).then(function (response) {
8290 return wrapEnvironment(http, response.data);
8291 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8292 },
8293
8294 /**
8295 * Gets a collection of Environments
8296 * @return Promise for a collection of Environment
8297 * @example ```javascript
8298 * const contentful = require('contentful-management')
8299 *
8300 * const client = contentful.createClient({
8301 * accessToken: '<content_management_api_key>'
8302 * })
8303 *
8304 * client.getSpace('<space_id>')
8305 * .then((space) => space.getEnvironments())
8306 * .then((response) => console.log(response.items))
8307 * .catch(console.error)
8308 * ```
8309 */
8310 getEnvironments: function getEnvironments() {
8311 return http.get('environments').then(function (response) {
8312 return wrapEnvironmentCollection(http, response.data);
8313 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8314 },
8315
8316 /**
8317 * Creates an Environement
8318 * @param data - Object representation of the Environment to be created
8319 * @return Promise for the newly created Environment
8320 * @example ```javascript
8321 * const contentful = require('contentful-management')
8322 *
8323 * const client = contentful.createClient({
8324 * accessToken: '<content_management_api_key>'
8325 * })
8326 *
8327 * client.getSpace('<space_id>')
8328 * .then((space) => space.createEnvironment({ name: 'Staging' }))
8329 * .then((environment) => console.log(environment))
8330 * .catch(console.error)
8331 * ```
8332 */
8333 createEnvironment: function createEnvironment() {
8334 var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
8335 return http.post('environments', data).then(function (response) {
8336 return wrapEnvironment(http, response.data);
8337 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8338 },
8339
8340 /**
8341 * Creates an Environment with a custom ID
8342 * @param id - Environment ID
8343 * @param data - Object representation of the Environment to be created
8344 * @param sourceEnvironmentId - ID of the source environment that will be copied to create the new environment. Default is "master"
8345 * @return Promise for the newly created Environment
8346 * @example ```javascript
8347 * const contentful = require('contentful-management')
8348 *
8349 * const client = contentful.createClient({
8350 * accessToken: '<content_management_api_key>'
8351 * })
8352 *
8353 * client.getSpace('<space_id>')
8354 * .then((space) => space.createEnvironmentWithId('<environment-id>', { name: 'Staging'}, 'master'))
8355 * .then((environment) => console.log(environment))
8356 * .catch(console.error)
8357 * ```
8358 */
8359 createEnvironmentWithId: function createEnvironmentWithId(id, data, sourceEnvironmentId) {
8360 return http.put('environments/' + id, data, {
8361 headers: sourceEnvironmentId ? {
8362 'X-Contentful-Source-Environment': sourceEnvironmentId
8363 } : {}
8364 }).then(function (response) {
8365 return wrapEnvironment(http, response.data);
8366 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8367 },
8368
8369 /**
8370 * Gets a Content Type
8371 * @deprecated since version 5.0
8372 * @param id - Content Type ID
8373 * @return Promise for a Content Type
8374 * @example ```javascript
8375 * const contentful = require('contentful-management')
8376 *
8377 * const client = contentful.createClient({
8378 * accessToken: '<content_management_api_key>'
8379 * })
8380 *
8381 * client.getSpace('<space_id>')
8382 * .then((space) => space.getContentType('<content_type_id>'))
8383 * .then((contentType) => console.log(contentType))
8384 * .catch(console.error)
8385 * ```
8386 */
8387 getContentType: function getContentType(id) {
8388 raiseDeprecationWarning('getContentType');
8389 return http.get('content_types/' + id).then(function (response) {
8390 return wrapContentType(http, response.data);
8391 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8392 },
8393
8394 /**
8395 * Gets a collection of Content Types
8396 * @deprecated since version 5.0
8397 * @param query - Object with search parameters. Check the <a href="https://www.contentful.com/developers/docs/javascript/tutorials/using-js-cda-sdk/#retrieving-entries-with-search-parameters">JS SDK tutorial</a> and the <a href="https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters">REST API reference</a> for more details.
8398 * @return Promise for a collection of Content Types
8399 * @example ```javascript
8400 * const contentful = require('contentful-management')
8401 *
8402 * const client = contentful.createClient({
8403 * accessToken: '<content_management_api_key>'
8404 * })
8405 *
8406 * client.getSpace('<space_id>')
8407 * .then((space) => space.getContentTypes())
8408 * .then((response) => console.log(response.items))
8409 * .catch(console.error)
8410 * ```
8411 */
8412 getContentTypes: function getContentTypes() {
8413 var query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
8414 raiseDeprecationWarning('getContentTypes');
8415 return http.get('content_types', Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
8416 query: query
8417 })).then(function (response) {
8418 return wrapContentTypeCollection(http, response.data);
8419 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8420 },
8421
8422 /**
8423 * Creates a Content Type
8424 * @deprecated since version 5.0
8425 * @param data - Object representation of the Content Type to be created
8426 * @return Promise for the newly created Content Type
8427 * @example ```javascript
8428 * const contentful = require('contentful-management')
8429 *
8430 * const client = contentful.createClient({
8431 * accessToken: '<content_management_api_key>'
8432 * })
8433 *
8434 * client.getSpace('<space_id>')
8435 * .then((space) => space.createContentType({
8436 * name: 'Blog Post',
8437 * fields: [
8438 * {
8439 * id: 'title',
8440 * name: 'Title',
8441 * required: true,
8442 * localized: false,
8443 * type: 'Text'
8444 * }
8445 * ]
8446 * }))
8447 * .then((contentType) => console.log(contentType))
8448 * .catch(console.error)
8449 * ```
8450 */
8451 createContentType: function createContentType(data) {
8452 raiseDeprecationWarning('createContentType');
8453 return http.post('content_types', data).then(function (response) {
8454 return wrapContentType(http, response.data);
8455 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8456 },
8457
8458 /**
8459 * Creates a Content Type with a custom ID
8460 * @deprecated since version 5.0
8461 * @param id - Content Type ID
8462 * @param data - Object representation of the Content Type to be created
8463 * @return Promise for the newly created Content Type
8464 * @example ```javascript
8465 * const contentful = require('contentful-management')
8466 *
8467 * const client = contentful.createClient({
8468 * accessToken: '<content_management_api_key>'
8469 * })
8470 *
8471 * client.getSpace('<space_id>')
8472 * .then((space) => space.createContentTypeWithId('<content-type-id>', {
8473 * name: 'Blog Post',
8474 * fields: [
8475 * {
8476 * id: 'title',
8477 * name: 'Title',
8478 * required: true,
8479 * localized: false,
8480 * type: 'Text'
8481 * }
8482 * ]
8483 * }))
8484 * .then((contentType) => console.log(contentType))
8485 * .catch(console.error)
8486 * ```
8487 */
8488 createContentTypeWithId: function createContentTypeWithId(id, data) {
8489 raiseDeprecationWarning('createContentTypeWithId');
8490 return http.put('content_types/' + id, data).then(function (response) {
8491 return wrapContentType(http, response.data);
8492 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8493 },
8494
8495 /**
8496 * Gets an EditorInterface for a ContentType
8497 * @deprecated since version 5.0
8498 * @param contentTypeId - Content Type ID
8499 * @return Promise for an EditorInterface
8500 * @example ```javascript
8501 * const contentful = require('contentful-management')
8502 *
8503 * const client = contentful.createClient({
8504 * accessToken: '<content_management_api_key>'
8505 * })
8506 *
8507 * client.getSpace('<space_id>')
8508 * .then((space) => space.getEditorInterfaceForContentType('<content_type_id>'))
8509 * .then((EditorInterface) => console.log(EditorInterface))
8510 * .catch(console.error)
8511 * ```
8512 */
8513 getEditorInterfaceForContentType: function getEditorInterfaceForContentType(contentTypeId) {
8514 raiseDeprecationWarning('getEditorInterfaceForContentType');
8515 return http.get('content_types/' + contentTypeId + '/editor_interface').then(function (response) {
8516 return wrapEditorInterface(http, response.data);
8517 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8518 },
8519
8520 /**
8521 * Gets an Entry
8522 * Warning: if you are using the select operator, when saving, any field that was not selected will be removed
8523 * from your entry in the backend
8524 * @deprecated since version 5.0
8525 * @param id - Entry ID
8526 * @param query - Object with search parameters. In this method it's only useful for `locale`.
8527 * @return Promise for an Entry
8528 * @example ```javascript
8529 * const contentful = require('contentful-management')
8530 *
8531 * const client = contentful.createClient({
8532 * accessToken: '<content_management_api_key>'
8533 * })
8534 *
8535 * client.getSpace('<space_id>')
8536 * .then((space) => space.getEntry('<entry-id>'))
8537 * .then((entry) => console.log(entry))
8538 * .catch(console.error)
8539 * ```
8540 */
8541 getEntry: function getEntry(id) {
8542 var query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
8543 raiseDeprecationWarning('getEntry');
8544 normalizeSelect(query);
8545 return http.get('entries/' + id, Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
8546 query: query
8547 })).then(function (response) {
8548 return wrapEntry(http, response.data);
8549 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8550 },
8551
8552 /**
8553 * Gets a collection of Entries
8554 * Warning: if you are using the select operator, when saving, any field that was not selected will be removed
8555 * from your entry in the backend
8556 * @deprecated since version 5.0
8557 * @param query - Object with search parameters. Check the <a href="https://www.contentful.com/developers/docs/javascript/tutorials/using-js-cda-sdk/#retrieving-entries-with-search-parameters">JS SDK tutorial</a> and the <a href="https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters">REST API reference</a> for more details.
8558 * @return Promise for a collection of Entries
8559 * @example ```javascript
8560 * const contentful = require('contentful-management')
8561 *
8562 * const client = contentful.createClient({
8563 * accessToken: '<content_management_api_key>'
8564 * })
8565 *
8566 * client.getSpace('<space_id>')
8567 * .then((space) => space.getEntries({'content_type': 'foo'})) // you can add more queries as 'key': 'value'
8568 * .then((response) => console.log(response.items))
8569 * .catch(console.error)
8570 * ```
8571 */
8572 getEntries: function getEntries() {
8573 var query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
8574 raiseDeprecationWarning('getEntries');
8575 normalizeSelect(query);
8576 return http.get('entries', Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
8577 query: query
8578 })).then(function (response) {
8579 return wrapEntryCollection(http, response.data);
8580 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8581 },
8582
8583 /**
8584 * Creates a Entry
8585 * @deprecated since version 5.0
8586 * @param contentTypeId - The Content Type which this Entry is based on
8587 * @param data - Object representation of the Entry to be created
8588 * @return Promise for the newly created Entry
8589 * @example ```javascript
8590 * const contentful = require('contentful-management')
8591 *
8592 * const client = contentful.createClient({
8593 * accessToken: '<content_management_api_key>'
8594 * })
8595 *
8596 * client.getSpace('<space_id>')
8597 * .then((space) => space.createEntry('<content_type_id>', {
8598 * fields: {
8599 * title: {
8600 * 'en-US': 'Entry title'
8601 * }
8602 * }
8603 * }))
8604 * .then((entry) => console.log(entry))
8605 * .catch(console.error)
8606 * ```
8607 */
8608 createEntry: function createEntry(contentTypeId, data) {
8609 raiseDeprecationWarning('createEntry');
8610 return http.post('entries', data, {
8611 headers: {
8612 'X-Contentful-Content-Type': contentTypeId
8613 }
8614 }).then(function (response) {
8615 return wrapEntry(http, response.data);
8616 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8617 },
8618
8619 /**
8620 * Creates a Entry with a custom ID
8621 * @deprecated since version 5.0
8622 * @param contentTypeId - The Content Type which this Entry is based on
8623 * @param id - Entry ID
8624 * @param data - Object representation of the Entry to be created
8625 * @return Promise for the newly created Entry
8626 * @example ```javascript
8627 * const contentful = require('contentful-management')
8628 *
8629 * const client = contentful.createClient({
8630 * accessToken: '<content_management_api_key>'
8631 * })
8632 *
8633 * // Create entry
8634 * client.getSpace('<space_id>')
8635 * .then((space) => space.createEntryWithId('<content_type_id>', '<entry_id>', {
8636 * fields: {
8637 * title: {
8638 * 'en-US': 'Entry title'
8639 * }
8640 * }
8641 * }))
8642 * .then((entry) => console.log(entry))
8643 * .catch(console.error)
8644 * ```
8645 */
8646 createEntryWithId: function createEntryWithId(contentTypeId, id, data) {
8647 raiseDeprecationWarning('createEntryWithId');
8648 return http.put('entries/' + id, data, {
8649 headers: {
8650 'X-Contentful-Content-Type': contentTypeId
8651 }
8652 }).then(function (response) {
8653 return wrapEntry(http, response.data);
8654 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8655 },
8656
8657 /**
8658 * Creates a Upload.
8659 * @deprecated since version 5.0
8660 * @param data - Object with file information.
8661 * @param data.file - Actual file content. Can be a string, an ArrayBuffer or a Stream.
8662 * @return Upload object containing information about the uploaded file.
8663 * @example ```javascript
8664 * const client = contentful.createClient({
8665 * accessToken: '<content_management_api_key>'
8666 * })
8667 * const uploadStream = createReadStream('path/to/filename_english.jpg')
8668 * client.getSpace('<space_id>')
8669 * .then((space) => space.createUpload({file: uploadStream, 'image/png'})
8670 * .then((upload) => console.log(upload))
8671 * .catch(console.error)
8672 * ```
8673 */
8674 createUpload: createUpload,
8675
8676 /**
8677 * Creates a Asset. After creation, call asset.processForLocale or asset.processForAllLocales to start asset processing.
8678 * @deprecated since version 5.0
8679 * @param data - Object representation of the Asset to be created. Note that the field object should have an upload property on asset creation, which will be removed and replaced with an url property when processing is finished.
8680 * @return Promise for the newly created Asset
8681 * @example ```javascript
8682 * const client = contentful.createClient({
8683 * accessToken: '<content_management_api_key>'
8684 * })
8685 *
8686 * // Create asset
8687 * client.getSpace('<space_id>')
8688 * .then((space) => space.createAsset({
8689 * fields: {
8690 * title: {
8691 * 'en-US': 'Playsam Streamliner'
8692 * },
8693 * file: {
8694 * 'en-US': {
8695 * contentType: 'image/jpeg',
8696 * fileName: 'example.jpeg',
8697 * upload: 'https://example.com/example.jpg'
8698 * }
8699 * }
8700 * }
8701 * }))
8702 * .then((asset) => asset.processForLocale("en-US")) // OR asset.processForAllLocales()
8703 * .then((asset) => console.log(asset))
8704 * .catch(console.error)
8705 * ```
8706 */
8707 createAsset: createAsset,
8708
8709 /**
8710 * Gets an Asset
8711 * Warning: if you are using the select operator, when saving, any field that was not selected will be removed
8712 * from your entry in the backend
8713 * @deprecated since version 5.0
8714 * @param id - Asset ID
8715 * @param query - Object with search parameters. In this method it's only useful for `locale`.
8716 * @return Promise for an Asset
8717 * @example ```javascript
8718 * const contentful = require('contentful-management')
8719 *
8720 * const client = contentful.createClient({
8721 * accessToken: '<content_management_api_key>'
8722 * })
8723 *
8724 * client.getSpace('<space_id>')
8725 * .then((space) => space.getAsset('<asset_id>'))
8726 * .then((asset) => console.log(asset))
8727 * .catch(console.error)
8728 * ```
8729 */
8730 getAsset: function getAsset(id) {
8731 var query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
8732 raiseDeprecationWarning('getAsset');
8733 normalizeSelect(query);
8734 return http.get('assets/' + id, Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
8735 query: query
8736 })).then(function (response) {
8737 return wrapAsset(http, response.data);
8738 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8739 },
8740
8741 /**
8742 * Gets a collection of Assets
8743 * Warning: if you are using the select operator, when saving, any field that was not selected will be removed
8744 * from your entry in the backend
8745 * @deprecated since version 5.0
8746 * @param query - Object with search parameters. Check the <a href="https://www.contentful.com/developers/docs/javascript/tutorials/using-js-cda-sdk/#retrieving-entries-with-search-parameters">JS SDK tutorial</a> and the <a href="https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters">REST API reference</a> for more details.
8747 * @return Promise for a collection of Assets
8748 * @example ```javascript
8749 * const contentful = require('contentful-management')
8750 *
8751 * const client = contentful.createClient({
8752 * accessToken: '<content_management_api_key>'
8753 * })
8754 *
8755 * client.getSpace('<space_id>')
8756 * .then((space) => space.getAssets())
8757 * .then((response) => console.log(response.items))
8758 * .catch(console.error)
8759 * ```
8760 */
8761 getAssets: function getAssets() {
8762 var query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
8763 raiseDeprecationWarning('getAssets');
8764 normalizeSelect(query);
8765 return http.get('assets', Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
8766 query: query
8767 })).then(function (response) {
8768 return wrapAssetCollection(http, response.data);
8769 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8770 },
8771
8772 /**
8773 * Creates a Asset with a custom ID. After creation, call asset.processForLocale or asset.processForAllLocales to start asset processing.
8774 * @deprecated since version 5.0
8775 * @param id - Asset ID
8776 * @param data - Object representation of the Asset to be created. Note that the field object should have an upload property on asset creation, which will be removed and replaced with an url property when processing is finished.
8777 * @return Promise for the newly created Asset
8778 * @example ```javascript
8779 * const client = contentful.createClient({
8780 * accessToken: '<content_management_api_key>'
8781 * })
8782 *
8783 * // Create asset
8784 * client.getSpace('<space_id>')
8785 * .then((space) => space.createAssetWithId('<asset_id>', {
8786 * title: {
8787 * 'en-US': 'Playsam Streamliner'
8788 * },
8789 * file: {
8790 * 'en-US': {
8791 * contentType: 'image/jpeg',
8792 * fileName: 'example.jpeg',
8793 * upload: 'https://example.com/example.jpg'
8794 * }
8795 * }
8796 * }))
8797 * .then((asset) => asset.process())
8798 * .then((asset) => console.log(asset))
8799 * .catch(console.error)
8800 * ```
8801 */
8802 createAssetWithId: function createAssetWithId(id, data) {
8803 raiseDeprecationWarning('createAssetWithId');
8804 return http.put('assets/' + id, data).then(function (response) {
8805 return wrapAsset(http, response.data);
8806 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8807 },
8808
8809 /**
8810 * Creates a Asset based on files. After creation, call asset.processForLocale or asset.processForAllLocales to start asset processing.
8811 * @deprecated since version 5.0
8812 * @param data - Object representation of the Asset to be created. Note that the field object should have an uploadFrom property on asset creation, which will be removed and replaced with an url property when processing is finished.
8813 * @param data.fields.file.[LOCALE].file - Can be a string, an ArrayBuffer or a Stream.
8814 * @return Promise for the newly created Asset
8815 * @example ```javascript
8816 * const client = contentful.createClient({
8817 * accessToken: '<content_management_api_key>'
8818 * })
8819 * client.getSpace('<space_id>')
8820 * .then((space) => space.createAssetFromFiles({
8821 * fields: {
8822 * file: {
8823 * 'en-US': {
8824 * contentType: 'image/jpeg',
8825 * fileName: 'filename_english.jpg',
8826 * file: createReadStream('path/to/filename_english.jpg')
8827 * },
8828 * 'de-DE': {
8829 * contentType: 'image/svg+xml',
8830 * fileName: 'filename_german.svg',
8831 * file: '<svg><path fill="red" d="M50 50h150v50H50z"/></svg>'
8832 * }
8833 * }
8834 * }
8835 * }))
8836 * .then((asset) => console.log(asset))
8837 * .catch(console.error)
8838 * ```
8839 */
8840 createAssetFromFiles: function createAssetFromFiles(data) {
8841 raiseDeprecationWarning('createAssetFromFiles');
8842 var file = data.fields.file;
8843 return Promise.all(Object.keys(file).map(function (locale) {
8844 var _file$locale = file[locale],
8845 contentType = _file$locale.contentType,
8846 fileName = _file$locale.fileName;
8847 return createUpload(file[locale]).then(function (upload) {
8848 return _defineProperty({}, locale, {
8849 contentType: contentType,
8850 fileName: fileName,
8851 uploadFrom: {
8852 sys: {
8853 type: 'Link',
8854 linkType: 'Upload',
8855 id: upload.sys.id
8856 }
8857 }
8858 });
8859 });
8860 })).then(function (uploads) {
8861 // @ts-expect-error
8862 data.fields.file = uploads.reduce(function (fieldsData, upload) {
8863 return _objectSpread(_objectSpread({}, fieldsData), upload);
8864 }, {});
8865 return createAsset(data);
8866 }).catch(_error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8867 },
8868
8869 /**
8870 * Gets an Upload
8871 * @deprecated since version 5.0
8872 * @param id - Upload ID
8873 * @return Promise for an Upload
8874 * @example ```javascript
8875 * const client = contentful.createClient({
8876 * accessToken: '<content_management_api_key>'
8877 * })
8878 * const uploadStream = createReadStream('path/to/filename_english.jpg')
8879 * client.getSpace('<space_id>')
8880 * .then((space) => space.getUpload('<upload-id>')
8881 * .then((upload) => console.log(upload))
8882 * .catch(console.error)
8883 * ```
8884 */
8885 getUpload: function getUpload(id) {
8886 raiseDeprecationWarning('getUpload');
8887 return httpUpload.get('uploads/' + id).then(function (response) {
8888 return wrapUpload(http, response.data);
8889 }).catch(_error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8890 },
8891
8892 /**
8893 * Gets a Locale
8894 * @deprecated since version 5.0
8895 * @param id - Locale ID
8896 * @return Promise for an Locale
8897 * @example ```javascript
8898 * const contentful = require('contentful-management')
8899 *
8900 * const client = contentful.createClient({
8901 * accessToken: '<content_management_api_key>'
8902 * })
8903 *
8904 * client.getSpace('<space_id>')
8905 * .then((space) => space.getLocale('<locale_id>'))
8906 * .then((locale) => console.log(locale))
8907 * .catch(console.error)
8908 * ```
8909 */
8910 getLocale: function getLocale(id) {
8911 raiseDeprecationWarning('getLocale');
8912 return http.get('locales/' + id).then(function (response) {
8913 return wrapLocale(http, response.data);
8914 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8915 },
8916
8917 /**
8918 * Gets a collection of Locales
8919 * @deprecated since version 5.0
8920 * @return Promise for a collection of Locales
8921 * @example ```javascript
8922 * const contentful = require('contentful-management')
8923 *
8924 * const client = contentful.createClient({
8925 * accessToken: '<content_management_api_key>'
8926 * })
8927 *
8928 * client.getSpace('<space_id>')
8929 * .then((space) => space.getLocales())
8930 * .then((response) => console.log(response.items))
8931 * .catch(console.error)
8932 * ```
8933 */
8934 getLocales: function getLocales() {
8935 raiseDeprecationWarning('getLocales');
8936 return http.get('locales').then(function (response) {
8937 return wrapLocaleCollection(http, response.data);
8938 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8939 },
8940
8941 /**
8942 * Creates a Locale
8943 * @deprecated since version 5.0
8944 * @param data - Object representation of the Locale to be created
8945 * @return Promise for the newly created Locale
8946 * @example ```javascript
8947 * const contentful = require('contentful-management')
8948 *
8949 * const client = contentful.createClient({
8950 * accessToken: '<content_management_api_key>'
8951 * })
8952 *
8953 * // Create locale
8954 * client.getSpace('<space_id>')
8955 * .then((space) => space.createLocale({
8956 * name: 'German (Austria)',
8957 * code: 'de-AT',
8958 * fallbackCode: 'de-DE',
8959 * optional: true
8960 * }))
8961 * .then((locale) => console.log(locale))
8962 * .catch(console.error)
8963 * ```
8964 */
8965 createLocale: function createLocale(data) {
8966 raiseDeprecationWarning('createLocale');
8967 return http.post('locales', data).then(function (response) {
8968 return wrapLocale(http, response.data);
8969 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8970 },
8971
8972 /**
8973 * Gets a Webhook
8974 * @param id - Webhook ID
8975 * @return Promise for a Webhook
8976 * @example ```javascript
8977 * const contentful = require('contentful-management')
8978 *
8979 * const client = contentful.createClient({
8980 * accessToken: '<content_management_api_key>'
8981 * })
8982 *
8983 * client.getSpace('<space_id>')
8984 * .then((space) => space.getWebhook('<webhook_id>'))
8985 * .then((webhook) => console.log(webhook))
8986 * .catch(console.error)
8987 * ```
8988 */
8989 getWebhook: function getWebhook(id) {
8990 return http.get('webhook_definitions/' + id).then(function (response) {
8991 return wrapWebhook(http, response.data);
8992 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8993 },
8994
8995 /**
8996 * Gets a collection of Webhooks
8997 * @return Promise for a collection of Webhooks
8998 * @example ```javascript
8999 * const contentful = require('contentful-management')
9000 *
9001 * const client = contentful.createClient({
9002 * accessToken: '<content_management_api_key>'
9003 * })
9004 *
9005 * client.getSpace('<space_id>')
9006 * .then((space) => space.getWebhooks())
9007 * .then((response) => console.log(response.items))
9008 * .catch(console.error)
9009 * ```
9010 */
9011 getWebhooks: function getWebhooks() {
9012 return http.get('webhook_definitions').then(function (response) {
9013 return wrapWebhookCollection(http, response.data);
9014 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9015 },
9016
9017 /**
9018 * Creates a Webhook
9019 * @param data - Object representation of the Webhook to be created
9020 * @return Promise for the newly created Webhook
9021 * @example ```javascript
9022 * const contentful = require('contentful-management')
9023 *
9024 * client.getSpace('<space_id>')
9025 * .then((space) => space.createWebhook({
9026 * 'name': 'My webhook',
9027 * 'url': 'https://www.example.com/test',
9028 * 'topics': [
9029 * 'Entry.create',
9030 * 'ContentType.create',
9031 * '*.publish',
9032 * 'Asset.*'
9033 * ]
9034 * }))
9035 * .then((webhook) => console.log(webhook))
9036 * .catch(console.error)
9037 * ```
9038 */
9039 createWebhook: function createWebhook(data) {
9040 return http.post('webhook_definitions', data).then(function (response) {
9041 return wrapWebhook(http, response.data);
9042 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9043 },
9044
9045 /**
9046 * Creates a Webhook with a custom ID
9047 * @param id - Webhook ID
9048 * @param data - Object representation of the Webhook to be created
9049 * @return Promise for the newly created Webhook
9050 * @example ```javascript
9051 * const contentful = require('contentful-management')
9052 *
9053 * client.getSpace('<space_id>')
9054 * .then((space) => space.createWebhookWithId('<webhook_id>', {
9055 * 'name': 'My webhook',
9056 * 'url': 'https://www.example.com/test',
9057 * 'topics': [
9058 * 'Entry.create',
9059 * 'ContentType.create',
9060 * '*.publish',
9061 * 'Asset.*'
9062 * ]
9063 * }))
9064 * .then((webhook) => console.log(webhook))
9065 * .catch(console.error)
9066 * ```
9067 */
9068 createWebhookWithId: function createWebhookWithId(id, data) {
9069 return http.put('webhook_definitions/' + id, data).then(function (response) {
9070 return wrapWebhook(http, response.data);
9071 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9072 },
9073
9074 /**
9075 * Gets a Role
9076 * @param id - Role ID
9077 * @return Promise for a Role
9078 * @example ```javascript
9079 * const contentful = require('contentful-management')
9080 *
9081 * const client = contentful.createClient({
9082 * accessToken: '<content_management_api_key>'
9083 * })
9084 *
9085 * client.getSpace('<space_id>')
9086 * .then((space) => space.createRole({
9087 * fields: {
9088 * title: {
9089 * 'en-US': 'Role title'
9090 * }
9091 * }
9092 * }))
9093 * .then((role) => console.log(role))
9094 * .catch(console.error)
9095 * ```
9096 */
9097 getRole: function getRole(id) {
9098 return http.get('roles/' + id).then(function (response) {
9099 return wrapRole(http, response.data);
9100 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9101 },
9102
9103 /**
9104 * Gets a collection of Roles
9105 * @return Promise for a collection of Roles
9106 * @example ```javascript
9107 * const contentful = require('contentful-management')
9108 *
9109 * const client = contentful.createClient({
9110 * accessToken: '<content_management_api_key>'
9111 * })
9112 *
9113 * client.getSpace('<space_id>')
9114 * .then((space) => space.getRoles())
9115 * .then((response) => console.log(response.items))
9116 * .catch(console.error)
9117 * ```
9118 */
9119 getRoles: function getRoles() {
9120 return http.get('roles').then(function (response) {
9121 return wrapRoleCollection(http, response.data);
9122 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9123 },
9124
9125 /**
9126 * Creates a Role
9127 * @param data - Object representation of the Role to be created
9128 * @return Promise for the newly created Role
9129 * @example ```javascript
9130 * const contentful = require('contentful-management')
9131 *
9132 * const client = contentful.createClient({
9133 * accessToken: '<content_management_api_key>'
9134 * })
9135 * client.getSpace('<space_id>')
9136 * .then((space) => space.createRole({
9137 * name: 'My Role',
9138 * description: 'foobar role',
9139 * permissions: {
9140 * ContentDelivery: 'all',
9141 * ContentModel: ['read'],
9142 * Settings: []
9143 * },
9144 * policies: [
9145 * {
9146 * effect: 'allow',
9147 * actions: 'all',
9148 * constraint: {
9149 * and: [
9150 * {
9151 * equals: [
9152 * { doc: 'sys.type' },
9153 * 'Entry'
9154 * ]
9155 * },
9156 * {
9157 * equals: [
9158 * { doc: 'sys.type' },
9159 * 'Asset'
9160 * ]
9161 * }
9162 * ]
9163 * }
9164 * }
9165 * ]
9166 * }))
9167 * .then((role) => console.log(role))
9168 * .catch(console.error)
9169 * ```
9170 */
9171 createRole: function createRole(data) {
9172 return http.post('roles', data).then(function (response) {
9173 return wrapRole(http, response.data);
9174 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9175 },
9176
9177 /**
9178 * Creates a Role with a custom ID
9179 * @param id - Role ID
9180 * @param data - Object representation of the Role to be created
9181 * @return Promise for the newly created Role
9182 * @example ```javascript
9183 * const contentful = require('contentful-management')
9184 *
9185 * const client = contentful.createClient({
9186 * accessToken: '<content_management_api_key>'
9187 * })
9188 * client.getSpace('<space_id>')
9189 * .then((space) => space.createRoleWithId('<role-id>', {
9190 * name: 'My Role',
9191 * description: 'foobar role',
9192 * permissions: {
9193 * ContentDelivery: 'all',
9194 * ContentModel: ['read'],
9195 * Settings: []
9196 * },
9197 * policies: [
9198 * {
9199 * effect: 'allow',
9200 * actions: 'all',
9201 * constraint: {
9202 * and: [
9203 * {
9204 * equals: [
9205 * { doc: 'sys.type' },
9206 * 'Entry'
9207 * ]
9208 * },
9209 * {
9210 * equals: [
9211 * { doc: 'sys.type' },
9212 * 'Asset'
9213 * ]
9214 * }
9215 * ]
9216 * }
9217 * }
9218 * ]
9219 * }))
9220 * .then((role) => console.log(role))
9221 * .catch(console.error)
9222 * ```
9223 */
9224 createRoleWithId: function createRoleWithId(id, data) {
9225 return http.put('roles/' + id, data).then(function (response) {
9226 return wrapRole(http, response.data);
9227 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9228 },
9229
9230 /**
9231 * Gets a User
9232 * @param id - User ID
9233 * @return Promise for a User
9234 * @example ```javascript
9235 * const contentful = require('contentful-management')
9236 *
9237 * client.getSpace('<space_id>')
9238 * .then((space) => space.getSpaceUser('id'))
9239 * .then((user) => console.log(user))
9240 * .catch(console.error)
9241 * ```
9242 */
9243 getSpaceUser: function getSpaceUser(id) {
9244 return http.get('users/' + id).then(function (response) {
9245 return wrapUser(http, response.data);
9246 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9247 },
9248
9249 /**
9250 * Gets a collection of Users in a space
9251 * @param query - Object with search parameters. Check the <a href="https://www.contentful.com/developers/docs/javascript/tutorials/using-js-cda-sdk/#retrieving-entries-with-search-parameters">JS SDK tutorial</a> and the <a href="https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters">REST API reference</a> for more details.
9252 * @return Promise a collection of Users in a space
9253 * @example ```javascript
9254 * const contentful = require('contentful-management')
9255 *
9256 * client.getSpace('<space_id>')
9257 * .then((space) => space.getSpaceUsers(query))
9258 * .then((data) => console.log(data))
9259 * .catch(console.error)
9260 * ```
9261 */
9262 getSpaceUsers: function getSpaceUsers() {
9263 var query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
9264 return http.get('users/', Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
9265 query: query
9266 })).then(function (response) {
9267 return wrapUserCollection(http, response.data);
9268 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9269 },
9270
9271 /**
9272 * Gets a Space Member
9273 * @param id Get Space Member by user_id
9274 * @return Promise for a Space Member
9275 * @example ```javascript
9276 * const contentful = require('contentful-management')
9277 *
9278 * client.getSpace('<space_id>')
9279 * .then((space) => space.getSpaceMember(id))
9280 * .then((spaceMember) => console.log(spaceMember))
9281 * .catch(console.error)
9282 * ```
9283 */
9284 getSpaceMember: function getSpaceMember(id) {
9285 return http.get('space_members/' + id).then(function (response) {
9286 return wrapSpaceMember(http, response.data);
9287 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9288 },
9289
9290 /**
9291 * Gets a collection of Space Members
9292 * @param query
9293 * @return Promise for a collection of Space Members
9294 * @example ```javascript
9295 * const contentful = require('contentful-management')
9296 *
9297 * client.getSpace('<space_id>')
9298 * .then((space) => space.getSpaceMembers({'limit': 100}))
9299 * .then((spaceMemberCollection) => console.log(spaceMemberCollection))
9300 * .catch(console.error)
9301 * ```
9302 */
9303 getSpaceMembers: function getSpaceMembers() {
9304 var query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
9305 return http.get('space_members', Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
9306 query: query
9307 })).then(function (response) {
9308 return wrapSpaceMemberCollection(http, response.data);
9309 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9310 },
9311
9312 /**
9313 * Gets a Space Membership
9314 * Warning: the user attribute in the space membership root is deprecated. The attribute has been moved inside the sys object (i.e. sys.user).
9315 * @param id - Space Membership ID
9316 * @return Promise for a Space Membership
9317 * @example ```javascript
9318 * const contentful = require('contentful-management')
9319 *
9320 * client.getSpace('<space_id>')
9321 * .then((space) => space.getSpaceMembership('id'))
9322 * .then((spaceMembership) => console.log(spaceMembership))
9323 * .catch(console.error)
9324 * ```
9325 */
9326 getSpaceMembership: function getSpaceMembership(id) {
9327 spaceMembershipDeprecationWarning();
9328 return http.get('space_memberships/' + id).then(function (response) {
9329 return wrapSpaceMembership(http, response.data);
9330 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9331 },
9332
9333 /**
9334 * Gets a collection of Space Memberships
9335 * Warning: the user attribute in the space membership root is deprecated. The attribute has been moved inside the sys object (i.e. sys.user).
9336 * @param query - Object with search parameters. Check the <a href="https://www.contentful.com/developers/docs/javascript/tutorials/using-js-cda-sdk/#retrieving-entries-with-search-parameters">JS SDK tutorial</a> and the <a href="https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters">REST API reference</a> for more details.
9337 * @return Promise for a collection of Space Memberships
9338 * @example ```javascript
9339 * const contentful = require('contentful-management')
9340 *
9341 * client.getSpace('<space_id>')
9342 * .then((space) => space.getSpaceMemberships({'limit': 100})) // you can add more queries as 'key': 'value'
9343 * .then((response) => console.log(response.items))
9344 * .catch(console.error)
9345 * ```
9346 */
9347 getSpaceMemberships: function getSpaceMemberships() {
9348 var query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
9349 spaceMembershipDeprecationWarning();
9350 return http.get('space_memberships', Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
9351 query: query
9352 })).then(function (response) {
9353 return wrapSpaceMembershipCollection(http, response.data);
9354 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9355 },
9356
9357 /**
9358 * Creates a Space Membership
9359 * Warning: the user attribute in the space membership root is deprecated. The attribute has been moved inside the sys object (i.e. sys.user).
9360 * @param data - Object representation of the Space Membership to be created
9361 * @return Promise for the newly created Space Membership
9362 * @example ```javascript
9363 * const contentful = require('contentful-management')
9364 *
9365 * const client = contentful.createClient({
9366 * accessToken: '<content_management_api_key>'
9367 * })
9368 *
9369 * client.getSpace('<space_id>')
9370 * .then((space) => space.createSpaceMembership({
9371 * admin: false,
9372 * roles: [
9373 * {
9374 * type: 'Link',
9375 * linkType: 'Role',
9376 * id: '<role_id>'
9377 * }
9378 * ],
9379 * email: 'foo@example.com'
9380 * }))
9381 * .then((spaceMembership) => console.log(spaceMembership))
9382 * .catch(console.error)
9383 * ```
9384 */
9385 createSpaceMembership: function createSpaceMembership(data) {
9386 spaceMembershipDeprecationWarning();
9387 return http.post('space_memberships', data).then(function (response) {
9388 return wrapSpaceMembership(http, response.data);
9389 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9390 },
9391
9392 /**
9393 * Creates a Space Membership with a custom ID
9394 * Warning: the user attribute in the space membership root is deprecated. The attribute has been moved inside the sys object (i.e. sys.user).
9395 * @param id - Space Membership ID
9396 * @param data - Object representation of the Space Membership to be created
9397 * @return Promise for the newly created Space Membership
9398 * @example ```javascript
9399 * const contentful = require('contentful-management')
9400 *
9401 * const client = contentful.createClient({
9402 * accessToken: '<content_management_api_key>'
9403 * })
9404 *
9405 * client.getSpace('<space_id>')
9406 * .then((space) => space.createSpaceMembershipWithId('<space-membership-id>', {
9407 * admin: false,
9408 * roles: [
9409 * {
9410 * type: 'Link',
9411 * linkType: 'Role',
9412 * id: '<role_id>'
9413 * }
9414 * ],
9415 * email: 'foo@example.com'
9416 * }))
9417 * .then((spaceMembership) => console.log(spaceMembership))
9418 * .catch(console.error)
9419 * ```
9420 */
9421 createSpaceMembershipWithId: function createSpaceMembershipWithId(id, data) {
9422 spaceMembershipDeprecationWarning();
9423 return http.put('space_memberships/' + id, data).then(function (response) {
9424 return wrapSpaceMembership(http, response.data);
9425 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9426 },
9427
9428 /**
9429 * Gets a Team Space Membership
9430 * @param id - Team Space Membership ID
9431 * @return Promise for a Team Space Membership
9432 * @example ```javascript
9433 * const contentful = require('contentful-management')
9434 *
9435 * client.getSpace('<space_id>')
9436 * .then((space) => space.getTeamSpaceMembership('team_space_membership_id'))
9437 * .then((teamSpaceMembership) => console.log(teamSpaceMembership))
9438 * .catch(console.error)
9439 * ```
9440 */
9441 getTeamSpaceMembership: function getTeamSpaceMembership(teamSpaceMembershipId) {
9442 return http.get('team_space_memberships/' + teamSpaceMembershipId).then(function (response) {
9443 return wrapTeamSpaceMembership(http, response.data);
9444 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9445 },
9446
9447 /**
9448 * Gets a collection of Team Space Memberships
9449 * @param query - Object with search parameters. Check the <a href="https://www.contentful.com/developers/docs/javascript/tutorials/using-js-cda-sdk/#retrieving-entries-with-search-parameters">JS SDK tutorial</a> and the <a href="https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters">REST API reference</a> for more details.
9450 * @return Promise for a collection of Team Space Memberships
9451 * @example ```javascript
9452 * const contentful = require('contentful-management')
9453 *
9454 * client.getSpace('<space_id>')
9455 * .then((space) => space.getTeamSpaceMemberships())
9456 * .then((response) => console.log(response.items))
9457 * .catch(console.error)
9458 * ```
9459 */
9460 getTeamSpaceMemberships: function getTeamSpaceMemberships() {
9461 var query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
9462 return http.get('team_space_memberships', Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
9463 query: query
9464 })).then(function (response) {
9465 return wrapTeamSpaceMembershipCollection(http, response.data);
9466 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9467 },
9468
9469 /**
9470 * Creates a Team Space Membership
9471 * @param id - Team ID
9472 * @param data - Object representation of the Team Space Membership to be created
9473 * @return Promise for the newly created Team Space Membership
9474 * @example ```javascript
9475 * const contentful = require('contentful-management')
9476 *
9477 * const client = contentful.createClient({
9478 * accessToken: '<content_management_api_key>'
9479 * })
9480 *
9481 * client.getSpace('<space_id>')
9482 * .then((space) => space.createTeamSpaceMembership('team_id', {
9483 * admin: false,
9484 * roles: [
9485 * {
9486 sys: {
9487 * type: 'Link',
9488 * linkType: 'Role',
9489 * id: '<role_id>'
9490 * }
9491 * }
9492 * ],
9493 * }))
9494 * .then((teamSpaceMembership) => console.log(teamSpaceMembership))
9495 * .catch(console.error)
9496 * ```
9497 */
9498 createTeamSpaceMembership: function createTeamSpaceMembership(teamId, data) {
9499 return http.post('team_space_memberships', data, {
9500 headers: {
9501 'x-contentful-team': teamId
9502 }
9503 }).then(function (response) {
9504 return wrapTeamSpaceMembership(http, response.data);
9505 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9506 },
9507
9508 /**
9509 * Gets a Api Key
9510 * @param id - API Key ID
9511 * @return Promise for a Api Key
9512 * @example ```javascript
9513 * const contentful = require('contentful-management')
9514 *
9515 * const client = contentful.createClient({
9516 * accessToken: '<content_management_api_key>'
9517 * })
9518 *
9519 * client.getSpace('<space_id>')
9520 * .then((space) => space.getApiKey('<apikey-id>'))
9521 * .then((apikey) => console.log(apikey))
9522 * .catch(console.error)
9523 * ```
9524 */
9525 getApiKey: function getApiKey(id) {
9526 return http.get('api_keys/' + id).then(function (response) {
9527 return wrapApiKey(http, response.data);
9528 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9529 },
9530
9531 /**
9532 * Gets a collection of Api Keys
9533 * @return Promise for a collection of Api Keys
9534 * @example ```javascript
9535 * const contentful = require('contentful-management')
9536 *
9537 * const client = contentful.createClient({
9538 * accessToken: '<content_management_api_key>'
9539 * })
9540 *
9541 * client.getSpace('<space_id>')
9542 * .then((space) => space.getApiKeys())
9543 * .then((response) => console.log(response.items))
9544 * .catch(console.error)
9545 * ```
9546 */
9547 getApiKeys: function getApiKeys() {
9548 return http.get('api_keys').then(function (response) {
9549 return wrapApiKeyCollection(http, response.data);
9550 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9551 },
9552
9553 /**
9554 * Gets a collection of preview Api Keys
9555 * @return Promise for a collection of Preview Api Keys
9556 * @example ```javascript
9557 * const contentful = require('contentful-management')
9558 *
9559 * const client = contentful.createClient({
9560 * accessToken: '<content_management_api_key>'
9561 * })
9562 *
9563 * client.getSpace('<space_id>')
9564 * .then((space) => space.getPreviewApiKeys())
9565 * .then((response) => console.log(response.items))
9566 * .catch(console.error)
9567 * ```
9568 */
9569 getPreviewApiKeys: function getPreviewApiKeys() {
9570 return http.get('preview_api_keys').then(function (response) {
9571 return wrapPreviewApiKeyCollection(http, response.data);
9572 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9573 },
9574
9575 /**
9576 * Gets a preview Api Key
9577 * @param id - Preview API Key ID
9578 * @return Promise for a Preview Api Key
9579 * @example ```javascript
9580 * const contentful = require('contentful-management')
9581 *
9582 * const client = contentful.createClient({
9583 * accessToken: '<content_management_api_key>'
9584 * })
9585 *
9586 * client.getSpace('<space_id>')
9587 * .then((space) => space.getPreviewApiKey('<preview-apikey-id>'))
9588 * .then((previewApikey) => console.log(previewApikey))
9589 * .catch(console.error)
9590 * ```
9591 */
9592 getPreviewApiKey: function getPreviewApiKey(id) {
9593 return http.get('preview_api_keys/' + id).then(function (response) {
9594 return wrapPreviewApiKey(http, response.data);
9595 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9596 },
9597
9598 /**
9599 * Creates a Api Key
9600 * @param data - Object representation of the Api Key to be created
9601 * @return Promise for the newly created Api Key
9602 * @example ```javascript
9603 * const contentful = require('contentful-management')
9604 *
9605 * const client = contentful.createClient({
9606 * accessToken: '<content_management_api_key>'
9607 * })
9608 *
9609 * client.getSpace('<space_id>')
9610 * .then((space) => space.createApiKey({
9611 * name: 'API Key name',
9612 * environments:[
9613 * {
9614 * sys: {
9615 * type: 'Link'
9616 * linkType: 'Environment',
9617 * id:'<environment_id>'
9618 * }
9619 * }
9620 * ]
9621 * }
9622 * }))
9623 * .then((apiKey) => console.log(apiKey))
9624 * .catch(console.error)
9625 * ```
9626 */
9627 createApiKey: function createApiKey(data) {
9628 return http.post('api_keys', data).then(function (response) {
9629 return wrapApiKey(http, response.data);
9630 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9631 },
9632
9633 /**
9634 * Creates a Api Key with a custom ID
9635 * @param id - Api Key ID
9636 * @param data - Object representation of the Api Key to be created
9637 * @return Promise for the newly created Api Key
9638 * @example ```javascript
9639 * const contentful = require('contentful-management')
9640 *
9641 * const client = contentful.createClient({
9642 * accessToken: '<content_management_api_key>'
9643 * })
9644 *
9645 * client.getSpace('<space_id>')
9646 * .then((space) => space.createApiKeyWithId('<api-key-id>', {
9647 * name: 'API Key name'
9648 * environments:[
9649 * {
9650 * sys: {
9651 * type: 'Link'
9652 * linkType: 'Environment',
9653 * id:'<environment_id>'
9654 * }
9655 * }
9656 * ]
9657 * }
9658 * }))
9659 * .then((apiKey) => console.log(apiKey))
9660 * .catch(console.error)
9661 * ```
9662 */
9663 createApiKeyWithId: function createApiKeyWithId(id, data) {
9664 return http.put('api_keys/' + id, data).then(function (response) {
9665 return wrapApiKey(http, response.data);
9666 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9667 },
9668
9669 /**
9670 * Gets an UI Extension
9671 * @deprecated since version 5.0
9672 * @param id - UI Extension ID
9673 * @return Promise for an UI Extension
9674 * @example ```javascript
9675 * const contentful = require('contentful-management')
9676 *
9677 * const client = contentful.createClient({
9678 * accessToken: '<content_management_api_key>'
9679 * })
9680 *
9681 * client.getSpace('<space_id>')
9682 * .then((space) => space.getUiExtension('<extension-id>'))
9683 * .then((uiExtension) => console.log(uiExtension))
9684 * .catch(console.error)
9685 * ```
9686 */
9687 getUiExtension: function getUiExtension(id) {
9688 raiseDeprecationWarning('getUiExtension');
9689 return http.get('extensions/' + id).then(function (response) {
9690 return wrapUiExtension(http, response.data);
9691 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9692 },
9693
9694 /**
9695 * Gets a collection of UI Extension
9696 * @deprecated since version 5.0
9697 * @return Promise for a collection of UI Extensions
9698 * @example ```javascript
9699 * const contentful = require('contentful-management')
9700 *
9701 * const client = contentful.createClient({
9702 * accessToken: '<content_management_api_key>'
9703 * })
9704 *
9705 * client.getSpace('<space_id>')
9706 * .then((space) => space.getUiExtensions()
9707 * .then((response) => console.log(response.items))
9708 * .catch(console.error)
9709 * ```
9710 */
9711 getUiExtensions: function getUiExtensions() {
9712 raiseDeprecationWarning('getUiExtensions');
9713 return http.get('extensions').then(function (response) {
9714 return wrapUiExtensionCollection(http, response.data);
9715 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9716 },
9717
9718 /**
9719 * Creates a UI Extension
9720 * @deprecated since version 5.0
9721 * @param data - Object representation of the UI Extension to be created
9722 * @return Promise for the newly created UI Extension
9723 * @example ```javascript
9724 * const contentful = require('contentful-management')
9725 *
9726 * const client = contentful.createClient({
9727 * accessToken: '<content_management_api_key>'
9728 * })
9729 *
9730 * client.getSpace('<space_id>')
9731 * .then((space) => space.createUiExtension({
9732 * extension: {
9733 * name: 'My awesome extension',
9734 * src: 'https://example.com/my',
9735 * fieldTypes: [
9736 * {
9737 * type: 'Symbol'
9738 * },
9739 * {
9740 * type: 'Text'
9741 * }
9742 * ],
9743 * sidebar: false
9744 * }
9745 * }))
9746 * .then((uiExtension) => console.log(uiExtension))
9747 * .catch(console.error)
9748 * ```
9749 */
9750 createUiExtension: function createUiExtension(data) {
9751 raiseDeprecationWarning('createUiExtension');
9752 return http.post('extensions', data).then(function (response) {
9753 return wrapUiExtension(http, response.data);
9754 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9755 },
9756
9757 /**
9758 * Creates a UI Extension with a custom ID
9759 * @deprecated since version 5.0
9760 * @param id - UI Extension ID
9761 * @param data - Object representation of the UI Extension to be created
9762 * @return Promise for the newly created UI Extension
9763 * @example ```javascript
9764 * const contentful = require('contentful-management')
9765 *
9766 * const client = contentful.createClient({
9767 * accessToken: '<content_management_api_key>'
9768 * })
9769 *
9770 * client.getSpace('<space_id>')
9771 * .then((space) => space.createUiExtensionWithId('<extension_id>', {
9772 * extension: {
9773 * name: 'My awesome extension',
9774 * src: 'https://example.com/my',
9775 * fieldTypes: [
9776 * {
9777 * type: 'Symbol'
9778 * },
9779 * {
9780 * type: 'Text'
9781 * }
9782 * ],
9783 * sidebar: false
9784 * }
9785 * }))
9786 * .then((uiExtension) => console.log(uiExtension))
9787 * .catch(console.error)
9788 * ```
9789 */
9790 createUiExtensionWithId: function createUiExtensionWithId(id, data) {
9791 raiseDeprecationWarning('createUiExtensionWithId');
9792 return http.put('extensions/' + id, data).then(function (response) {
9793 return wrapUiExtension(http, response.data);
9794 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9795 },
9796
9797 /**
9798 * Gets all snapshots of an entry
9799 * @deprecated since version 5.0
9800 * @param entryId - Entry ID
9801 * @param query - additional query paramaters
9802 * @return Promise for a collection of Entry Snapshots
9803 * @example ```javascript
9804 * const contentful = require('contentful-management')
9805 *
9806 * const client = contentful.createClient({
9807 * accessToken: '<content_management_api_key>'
9808 * })
9809 *
9810 * client.getSpace('<space_id>')
9811 * .then((space) => space.getEntrySnapshots('<entry_id>'))
9812 * .then((snapshots) => console.log(snapshots.items))
9813 * .catch(console.error)
9814 * ```
9815 */
9816 getEntrySnapshots: function getEntrySnapshots(entryId) {
9817 var query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
9818 raiseDeprecationWarning('getEntrySnapshots');
9819 return http.get("entries/".concat(entryId, "/snapshots"), Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
9820 query: query
9821 })).then(function (response) {
9822 return wrapSnapshotCollection(http, response.data);
9823 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9824 },
9825
9826 /**
9827 * Gets all snapshots of a contentType
9828 * @deprecated since version 5.0
9829 * @param contentTypeId - Content Type ID
9830 * @param query - additional query paramaters
9831 * @return Promise for a collection of Content Type Snapshots
9832 * @example ```javascript
9833 * const contentful = require('contentful-management')
9834 *
9835 * const client = contentful.createClient({
9836 * accessToken: '<content_management_api_key>'
9837 * })
9838 *
9839 * client.getSpace('<space_id>')
9840 * .then((space) => space.getContentTypeSnapshots('<contentTypeId>'))
9841 * .then((snapshots) => console.log(snapshots.items))
9842 * .catch(console.error)
9843 * ```
9844 */
9845 getContentTypeSnapshots: function getContentTypeSnapshots(contentTypeId) {
9846 var query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
9847 raiseDeprecationWarning('getContentTypeSnapshots');
9848 return http.get("content_types/".concat(contentTypeId, "/snapshots"), Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
9849 query: query
9850 })).then(function (response) {
9851 return wrapSnapshotCollection(http, response.data);
9852 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9853 },
9854
9855 /**
9856 * Gets an Environment Alias
9857 * @param Environment Alias ID
9858 * @return Promise for an Environment Alias
9859 * @example ```javascript
9860 * const contentful = require('contentful-management')
9861 *
9862 * const client = contentful.createClient({
9863 * accessToken: '<content_management_api_key>'
9864 * })
9865 *
9866 * client.getSpace('<space_id>')
9867 * .then((space) => space.getEnvironmentAlias('<alias-id>'))
9868 * .then((alias) => console.log(alias))
9869 * .catch(console.error)
9870 * ```
9871 */
9872 getEnvironmentAlias: function getEnvironmentAlias(id) {
9873 return http.get('environment_aliases/' + id).then(function (response) {
9874 return wrapEnvironmentAlias(http, response.data);
9875 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9876 },
9877
9878 /**
9879 * Gets a collection of Environment Aliases
9880 * @return Promise for a collection of Environment Aliases
9881 * @example ```javascript
9882 * const contentful = require('contentful-management')
9883 *
9884 * const client = contentful.createClient({
9885 * accessToken: '<content_management_api_key>'
9886 * })
9887 *
9888 * client.getSpace('<space_id>')
9889 * .then((space) => space.getEnvironmentAliases()
9890 * .then((response) => console.log(response.items))
9891 * .catch(console.error)
9892 * ```
9893 */
9894 getEnvironmentAliases: function getEnvironmentAliases() {
9895 return http.get('environment_aliases').then(function (response) {
9896 return wrapEnvironmentAliasCollection(http, response.data);
9897 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9898 }
9899 };
9900}
9901
9902/***/ }),
9903
9904/***/ "./enhance-with-methods.ts":
9905/*!*********************************!*\
9906 !*** ./enhance-with-methods.ts ***!
9907 \*********************************/
9908/*! exports provided: default */
9909/***/ (function(module, __webpack_exports__, __webpack_require__) {
9910
9911"use strict";
9912__webpack_require__.r(__webpack_exports__);
9913/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return enhanceWithMethods; });
9914/**
9915 * This method enhances a base object which would normally contain data, with
9916 * methods from another object that might work on manipulating that data.
9917 * All the added methods are set as non enumerable, non configurable, and non
9918 * writable properties. This ensures that if we try to clone or stringify the
9919 * base object, we don't have to worry about these additional methods.
9920 * @private
9921 * @param {object} baseObject - Base object with data
9922 * @param {object} methodsObject - Object with methods as properties. The key
9923 * values used here will be the same that will be defined on the baseObject.
9924 */
9925function enhanceWithMethods(baseObject, methodsObject) {
9926 // @ts-expect-error
9927 return Object.keys(methodsObject).reduce(function (enhancedObject, methodName) {
9928 Object.defineProperty(enhancedObject, methodName, {
9929 enumerable: false,
9930 configurable: true,
9931 writable: false,
9932 value: methodsObject[methodName]
9933 });
9934 return enhancedObject;
9935 }, baseObject);
9936}
9937
9938/***/ }),
9939
9940/***/ "./entities/api-key.ts":
9941/*!*****************************!*\
9942 !*** ./entities/api-key.ts ***!
9943 \*****************************/
9944/*! exports provided: wrapApiKey, wrapApiKeyCollection */
9945/***/ (function(module, __webpack_exports__, __webpack_require__) {
9946
9947"use strict";
9948__webpack_require__.r(__webpack_exports__);
9949/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapApiKey", function() { return wrapApiKey; });
9950/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapApiKeyCollection", function() { return wrapApiKeyCollection; });
9951/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
9952/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
9953/* harmony import */ var contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! contentful-sdk-core */ "../node_modules/contentful-sdk-core/dist/index.es-modules.js");
9954/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
9955/* harmony import */ var _instance_actions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../instance-actions */ "./instance-actions.ts");
9956/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
9957
9958
9959
9960
9961
9962
9963function createApiKeyApi(http) {
9964 return {
9965 update: function update() {
9966 var self = this;
9967
9968 if ('accessToken' in self) {
9969 delete self.accessToken;
9970 }
9971
9972 if ('preview_api_key' in self) {
9973 delete self.preview_api_key;
9974 }
9975
9976 if ('policies' in self) {
9977 delete self.policies;
9978 }
9979
9980 var update = Object(_instance_actions__WEBPACK_IMPORTED_MODULE_3__["createUpdateEntity"])({
9981 http: http,
9982 entityPath: 'api_keys',
9983 wrapperMethod: wrapApiKey
9984 });
9985 return update.call(self);
9986 },
9987 delete: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_3__["createDeleteEntity"])({
9988 http: http,
9989 entityPath: 'api_keys'
9990 })
9991 };
9992}
9993/**
9994 * @private
9995 * @param http - HTTP client instance
9996 * @param data - Raw api key data
9997 */
9998
9999
10000function wrapApiKey(http, data) {
10001 var apiKey = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
10002 var apiKeyWithMethods = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(apiKey, createApiKeyApi(http));
10003 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(apiKeyWithMethods);
10004}
10005/**
10006 * @private
10007 * @param http - HTTP client instance
10008 * @param data - Raw api key collection data
10009 * @return Wrapped api key collection data
10010 */
10011
10012var wrapApiKeyCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_4__["wrapCollection"])(wrapApiKey);
10013
10014/***/ }),
10015
10016/***/ "./entities/app-definition.ts":
10017/*!************************************!*\
10018 !*** ./entities/app-definition.ts ***!
10019 \************************************/
10020/*! exports provided: wrapAppDefinition, wrapAppDefinitionCollection */
10021/***/ (function(module, __webpack_exports__, __webpack_require__) {
10022
10023"use strict";
10024__webpack_require__.r(__webpack_exports__);
10025/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapAppDefinition", function() { return wrapAppDefinition; });
10026/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapAppDefinitionCollection", function() { return wrapAppDefinitionCollection; });
10027/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
10028/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
10029/* harmony import */ var contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! contentful-sdk-core */ "../node_modules/contentful-sdk-core/dist/index.es-modules.js");
10030/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
10031/* harmony import */ var _instance_actions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../instance-actions */ "./instance-actions.ts");
10032/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
10033
10034
10035
10036
10037
10038var entityPath = 'app_definitions';
10039
10040function createAppDefinitionApi(http) {
10041 return {
10042 update: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_3__["createUpdateEntity"])({
10043 http: http,
10044 entityPath: entityPath,
10045 wrapperMethod: wrapAppDefinition
10046 }),
10047 delete: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_3__["createDeleteEntity"])({
10048 http: http,
10049 entityPath: entityPath
10050 })
10051 };
10052}
10053/**
10054 * @private
10055 * @param http - HTTP client instance
10056 * @param data - Raw App Definition data
10057 * @return Wrapped App Definition data
10058 */
10059
10060
10061function wrapAppDefinition(http, data) {
10062 var appDefinition = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
10063 var appDefinitionWithMethods = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(appDefinition, createAppDefinitionApi(http));
10064 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(appDefinitionWithMethods);
10065}
10066/**
10067 * @private
10068 * @param http - HTTP client instance
10069 * @param data - Raw App Definition collection data
10070 * @return Wrapped App Definition collection data
10071 */
10072
10073var wrapAppDefinitionCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_4__["wrapCollection"])(wrapAppDefinition);
10074
10075/***/ }),
10076
10077/***/ "./entities/app-installation.ts":
10078/*!**************************************!*\
10079 !*** ./entities/app-installation.ts ***!
10080 \**************************************/
10081/*! exports provided: wrapAppInstallation, wrapAppInstallationCollection */
10082/***/ (function(module, __webpack_exports__, __webpack_require__) {
10083
10084"use strict";
10085__webpack_require__.r(__webpack_exports__);
10086/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapAppInstallation", function() { return wrapAppInstallation; });
10087/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapAppInstallationCollection", function() { return wrapAppInstallationCollection; });
10088/* harmony import */ var contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! contentful-sdk-core */ "../node_modules/contentful-sdk-core/dist/index.es-modules.js");
10089/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
10090/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_1__);
10091/* harmony import */ var _error_handler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../error-handler */ "./error-handler.ts");
10092/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
10093/* harmony import */ var _instance_actions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../instance-actions */ "./instance-actions.ts");
10094/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
10095
10096
10097
10098
10099
10100
10101
10102function createAppInstallationApi(http) {
10103 return {
10104 update: function update() {
10105 var self = this;
10106 var raw = self.toPlainObject();
10107 var data = lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_1___default()(raw);
10108 delete data.sys;
10109 return http.put("app_installations/".concat(self.sys.appDefinition.sys.id), data).then(function (response) {
10110 return wrapAppInstallation(http, response.data);
10111 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
10112 },
10113 delete: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createDeleteEntity"])({
10114 http: http,
10115 entityPath: 'app_installations'
10116 })
10117 };
10118}
10119/**
10120 * @private
10121 * @param http - HTTP client instance
10122 * @param data - Raw App Installation data
10123 * @return Wrapped App installation data
10124 */
10125
10126
10127function wrapAppInstallation(http, data) {
10128 var appInstallation = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_1___default()(data));
10129 var appInstallationWithMethods = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_3__["default"])(appInstallation, createAppInstallationApi(http));
10130 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["freezeSys"])(appInstallationWithMethods);
10131}
10132/**
10133 * @private
10134 */
10135
10136var wrapAppInstallationCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_5__["wrapCollection"])(wrapAppInstallation);
10137
10138/***/ }),
10139
10140/***/ "./entities/asset.ts":
10141/*!***************************!*\
10142 !*** ./entities/asset.ts ***!
10143 \***************************/
10144/*! exports provided: wrapAsset, wrapAssetCollection */
10145/***/ (function(module, __webpack_exports__, __webpack_require__) {
10146
10147"use strict";
10148__webpack_require__.r(__webpack_exports__);
10149/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapAsset", function() { return wrapAsset; });
10150/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapAssetCollection", function() { return wrapAssetCollection; });
10151/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
10152/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
10153/* harmony import */ var contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! contentful-sdk-core */ "../node_modules/contentful-sdk-core/dist/index.es-modules.js");
10154/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
10155/* harmony import */ var _error_handler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../error-handler */ "./error-handler.ts");
10156/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
10157/* harmony import */ var _instance_actions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../instance-actions */ "./instance-actions.ts");
10158
10159
10160
10161
10162
10163
10164var ASSET_PROCESSING_CHECK_WAIT = 3000;
10165var ASSET_PROCESSING_CHECK_RETRIES = 10;
10166
10167function createAssetApi(http) {
10168 function checkIfAssetHasUrl(_ref) {
10169 var resolve = _ref.resolve,
10170 reject = _ref.reject,
10171 id = _ref.id,
10172 locale = _ref.locale,
10173 _ref$processingCheckW = _ref.processingCheckWait,
10174 processingCheckWait = _ref$processingCheckW === void 0 ? ASSET_PROCESSING_CHECK_WAIT : _ref$processingCheckW,
10175 _ref$processingCheckR = _ref.processingCheckRetries,
10176 processingCheckRetries = _ref$processingCheckR === void 0 ? ASSET_PROCESSING_CHECK_RETRIES : _ref$processingCheckR,
10177 _ref$checkCount = _ref.checkCount,
10178 checkCount = _ref$checkCount === void 0 ? 0 : _ref$checkCount;
10179 http.get('assets/' + id).then(function (response) {
10180 return wrapAsset(http, response.data);
10181 }, _error_handler__WEBPACK_IMPORTED_MODULE_3__["default"]).then(function (asset) {
10182 if (asset.fields.file[locale].url) {
10183 resolve(asset);
10184 } else if (checkCount === processingCheckRetries) {
10185 var error = new Error();
10186 error.name = 'AssetProcessingTimeout';
10187 error.message = 'Asset is taking longer then expected to process.';
10188 reject(error);
10189 } else {
10190 checkCount++;
10191 setTimeout(function () {
10192 return checkIfAssetHasUrl({
10193 resolve: resolve,
10194 reject: reject,
10195 id: id,
10196 locale: locale,
10197 checkCount: checkCount,
10198 processingCheckWait: processingCheckWait,
10199 processingCheckRetries: processingCheckRetries
10200 });
10201 }, processingCheckWait);
10202 }
10203 });
10204 }
10205
10206 function processForLocale(locale) {
10207 var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
10208 processingCheckWait = _ref2.processingCheckWait,
10209 processingCheckRetries = _ref2.processingCheckRetries;
10210
10211 var assetId = this.sys.id;
10212 return http.put('assets/' + this.sys.id + '/files/' + locale + '/process', null, {
10213 headers: {
10214 'X-Contentful-Version': this.sys.version
10215 }
10216 }).then(function () {
10217 return new Promise(function (resolve, reject) {
10218 return checkIfAssetHasUrl({
10219 resolve: resolve,
10220 reject: reject,
10221 id: assetId,
10222 locale: locale,
10223 processingCheckWait: processingCheckWait,
10224 processingCheckRetries: processingCheckRetries
10225 });
10226 });
10227 }, _error_handler__WEBPACK_IMPORTED_MODULE_3__["default"]);
10228 }
10229
10230 function processForAllLocales() {
10231 var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
10232 var self = this;
10233 var locales = Object.keys(this.fields.file || {});
10234 var mostUpToDateAssetVersion = undefined; // Let all the locales process
10235 // Since they all resolve at different times,
10236 // we need to pick the last resolved value
10237 // to reflect the most recent state
10238
10239 var allProcessingLocales = locales.map(function (locale) {
10240 return processForLocale.call(self, locale, options).then(function (result) {
10241 // Side effect of always setting the most up to date asset version
10242 // The last one to call this will be the last one that finished
10243 // and thus the most up to date
10244 mostUpToDateAssetVersion = result;
10245 });
10246 });
10247 return Promise.all(allProcessingLocales).then(function () {
10248 return mostUpToDateAssetVersion;
10249 });
10250 }
10251
10252 return {
10253 update: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_5__["createUpdateEntity"])({
10254 http: http,
10255 entityPath: 'assets',
10256 wrapperMethod: wrapAsset
10257 }),
10258 delete: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_5__["createDeleteEntity"])({
10259 http: http,
10260 entityPath: 'assets'
10261 }),
10262 publish: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_5__["createPublishEntity"])({
10263 http: http,
10264 entityPath: 'assets',
10265 wrapperMethod: wrapAsset
10266 }),
10267 unpublish: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_5__["createUnpublishEntity"])({
10268 http: http,
10269 entityPath: 'assets',
10270 wrapperMethod: wrapAsset
10271 }),
10272 archive: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_5__["createArchiveEntity"])({
10273 http: http,
10274 entityPath: 'assets',
10275 wrapperMethod: wrapAsset
10276 }),
10277 unarchive: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_5__["createUnarchiveEntity"])({
10278 http: http,
10279 entityPath: 'assets',
10280 wrapperMethod: wrapAsset
10281 }),
10282 processForLocale: processForLocale,
10283 processForAllLocales: processForAllLocales,
10284 isPublished: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_5__["createPublishedChecker"])(),
10285 isUpdated: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_5__["createUpdatedChecker"])(),
10286 isDraft: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_5__["createDraftChecker"])(),
10287 isArchived: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_5__["createArchivedChecker"])()
10288 };
10289}
10290/**
10291 * @private
10292 * @param http - HTTP client instance
10293 * @param data - Raw asset data
10294 * @return Wrapped asset data
10295 */
10296
10297
10298function wrapAsset(http, data) {
10299 var asset = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
10300 var assetWithMethods = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(asset, createAssetApi(http));
10301 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(assetWithMethods);
10302}
10303/**
10304 * @private
10305 */
10306
10307var wrapAssetCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_4__["wrapCollection"])(wrapAsset);
10308
10309/***/ }),
10310
10311/***/ "./entities/content-type.ts":
10312/*!**********************************!*\
10313 !*** ./entities/content-type.ts ***!
10314 \**********************************/
10315/*! exports provided: wrapContentType, wrapContentTypeCollection */
10316/***/ (function(module, __webpack_exports__, __webpack_require__) {
10317
10318"use strict";
10319__webpack_require__.r(__webpack_exports__);
10320/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapContentType", function() { return wrapContentType; });
10321/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapContentTypeCollection", function() { return wrapContentTypeCollection; });
10322/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
10323/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
10324/* harmony import */ var contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! contentful-sdk-core */ "../node_modules/contentful-sdk-core/dist/index.es-modules.js");
10325/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
10326/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
10327/* harmony import */ var _instance_actions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../instance-actions */ "./instance-actions.ts");
10328/* harmony import */ var _editor_interface__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./editor-interface */ "./entities/editor-interface.ts");
10329/* harmony import */ var _error_handler__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../error-handler */ "./error-handler.ts");
10330/* harmony import */ var _snapshot__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./snapshot */ "./entities/snapshot.ts");
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340function createContentTypeApi(http) {
10341 return {
10342 update: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createUpdateEntity"])({
10343 http: http,
10344 entityPath: 'content_types',
10345 wrapperMethod: wrapContentType
10346 }),
10347 delete: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createDeleteEntity"])({
10348 http: http,
10349 entityPath: 'content_types'
10350 }),
10351 publish: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createPublishEntity"])({
10352 http: http,
10353 entityPath: 'content_types',
10354 wrapperMethod: wrapContentType
10355 }),
10356 unpublish: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createUnpublishEntity"])({
10357 http: http,
10358 entityPath: 'content_types',
10359 wrapperMethod: wrapContentType
10360 }),
10361 getEditorInterface: function getEditorInterface() {
10362 return http.get('content_types/' + this.sys.id + '/editor_interface').then(function (response) {
10363 return Object(_editor_interface__WEBPACK_IMPORTED_MODULE_5__["wrapEditorInterface"])(http, response.data);
10364 }, _error_handler__WEBPACK_IMPORTED_MODULE_6__["default"]);
10365 },
10366 getSnapshots: function getSnapshots() {
10367 var query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
10368 return http.get("content_types/".concat(this.sys.id, "/snapshots"), Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
10369 query: query
10370 })).then(function (response) {
10371 return Object(_snapshot__WEBPACK_IMPORTED_MODULE_7__["wrapSnapshotCollection"])(http, response.data);
10372 }, _error_handler__WEBPACK_IMPORTED_MODULE_6__["default"]);
10373 },
10374 getSnapshot: function getSnapshot(snapshotId) {
10375 return http.get("content_types/".concat(this.sys.id, "/snapshots/").concat(snapshotId)).then(function (response) {
10376 return Object(_snapshot__WEBPACK_IMPORTED_MODULE_7__["wrapSnapshot"])(http, response.data);
10377 }, _error_handler__WEBPACK_IMPORTED_MODULE_6__["default"]);
10378 },
10379 isPublished: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createPublishedChecker"])(),
10380 isUpdated: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createUpdatedChecker"])(),
10381 isDraft: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createDraftChecker"])(),
10382 omitAndDeleteField: function omitAndDeleteField(id) {
10383 return findAndUpdateField(this, id, 'omitted', true).then(function (newContentType) {
10384 return findAndUpdateField(newContentType, id, 'deleted', true);
10385 }).catch(_error_handler__WEBPACK_IMPORTED_MODULE_6__["default"]);
10386 }
10387 };
10388}
10389/**
10390 * @private
10391 * @param id - unique ID of the field
10392 * @param key - the attribute on the field to change
10393 * @param value - the value to set the attribute to
10394 */
10395
10396
10397var findAndUpdateField = function findAndUpdateField(contentType, id, key, value) {
10398 var field = contentType.fields.find(function (field) {
10399 return field.id === id;
10400 });
10401
10402 if (!field) {
10403 return Promise.reject(new Error("Tried to omitAndDeleteField on a nonexistent field, ".concat(id, ", on the content type ").concat(contentType.name, ".")));
10404 } // @ts-expect-error
10405
10406
10407 field[key] = value;
10408 return contentType.update();
10409};
10410/**
10411 * @private
10412 * @param http - HTTP client instance
10413 * @param data - Raw content type data
10414 * @return Wrapped content type data
10415 */
10416
10417
10418function wrapContentType(http, data) {
10419 var contentType = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
10420 var contentTypeWithMethods = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(contentType, createContentTypeApi(http));
10421 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(contentTypeWithMethods);
10422}
10423/**
10424 * @private
10425 */
10426
10427var wrapContentTypeCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_3__["wrapCollection"])(wrapContentType);
10428
10429/***/ }),
10430
10431/***/ "./entities/editor-interface.ts":
10432/*!**************************************!*\
10433 !*** ./entities/editor-interface.ts ***!
10434 \**************************************/
10435/*! exports provided: wrapEditorInterface */
10436/***/ (function(module, __webpack_exports__, __webpack_require__) {
10437
10438"use strict";
10439__webpack_require__.r(__webpack_exports__);
10440/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapEditorInterface", function() { return wrapEditorInterface; });
10441/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
10442/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
10443/* harmony import */ var contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! contentful-sdk-core */ "../node_modules/contentful-sdk-core/dist/index.es-modules.js");
10444/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
10445/* harmony import */ var _error_handler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../error-handler */ "./error-handler.ts");
10446
10447
10448
10449
10450
10451function createEditorInterfaceApi(http) {
10452 return {
10453 update: function update() {
10454 var self = this;
10455 var raw = self.toPlainObject();
10456 var data = lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(raw);
10457 delete data.sys;
10458 return http.put("content_types/".concat(self.sys.contentType.sys.id, "/editor_interface"), data, {
10459 headers: {
10460 'X-Contentful-Version': self.sys.version
10461 }
10462 }).then(function (response) {
10463 return wrapEditorInterface(http, response.data);
10464 }, _error_handler__WEBPACK_IMPORTED_MODULE_3__["default"]);
10465 },
10466 getControlForField: function getControlForField(fieldId) {
10467 var self = this;
10468 var result = self.controls.filter(function (control) {
10469 return control.fieldId === fieldId;
10470 });
10471 return result && result.length > 0 ? result[0] : null;
10472 }
10473 };
10474}
10475/**
10476 * @private
10477 */
10478
10479
10480function wrapEditorInterface(http, data) {
10481 var editorInterface = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
10482 var editorInterfaceWithMethods = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(editorInterface, createEditorInterfaceApi(http));
10483 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(editorInterfaceWithMethods);
10484}
10485
10486/***/ }),
10487
10488/***/ "./entities/entry.ts":
10489/*!***************************!*\
10490 !*** ./entities/entry.ts ***!
10491 \***************************/
10492/*! exports provided: wrapEntry, wrapEntryCollection */
10493/***/ (function(module, __webpack_exports__, __webpack_require__) {
10494
10495"use strict";
10496__webpack_require__.r(__webpack_exports__);
10497/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapEntry", function() { return wrapEntry; });
10498/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapEntryCollection", function() { return wrapEntryCollection; });
10499/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
10500/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
10501/* harmony import */ var contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! contentful-sdk-core */ "../node_modules/contentful-sdk-core/dist/index.es-modules.js");
10502/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
10503/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
10504/* harmony import */ var _instance_actions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../instance-actions */ "./instance-actions.ts");
10505/* harmony import */ var _error_handler__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../error-handler */ "./error-handler.ts");
10506/* harmony import */ var _snapshot__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./snapshot */ "./entities/snapshot.ts");
10507
10508
10509
10510
10511
10512
10513
10514
10515function createEntryApi(http) {
10516 return {
10517 update: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createUpdateEntity"])({
10518 http: http,
10519 entityPath: 'entries',
10520 wrapperMethod: wrapEntry
10521 }),
10522 delete: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createDeleteEntity"])({
10523 http: http,
10524 entityPath: 'entries'
10525 }),
10526 publish: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createPublishEntity"])({
10527 http: http,
10528 entityPath: 'entries',
10529 wrapperMethod: wrapEntry
10530 }),
10531 unpublish: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createUnpublishEntity"])({
10532 http: http,
10533 entityPath: 'entries',
10534 wrapperMethod: wrapEntry
10535 }),
10536 archive: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createArchiveEntity"])({
10537 http: http,
10538 entityPath: 'entries',
10539 wrapperMethod: wrapEntry
10540 }),
10541 unarchive: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createUnarchiveEntity"])({
10542 http: http,
10543 entityPath: 'entries',
10544 wrapperMethod: wrapEntry
10545 }),
10546 getSnapshots: function getSnapshots() {
10547 var query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
10548 return http.get("entries/".concat(this.sys.id, "/snapshots"), Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
10549 query: query
10550 })).then(function (response) {
10551 return Object(_snapshot__WEBPACK_IMPORTED_MODULE_6__["wrapSnapshotCollection"])(http, response.data);
10552 }, _error_handler__WEBPACK_IMPORTED_MODULE_5__["default"]);
10553 },
10554 getSnapshot: function getSnapshot(snapshotId) {
10555 return http.get("entries/".concat(this.sys.id, "/snapshots/").concat(snapshotId)).then(function (response) {
10556 return Object(_snapshot__WEBPACK_IMPORTED_MODULE_6__["wrapSnapshot"])(http, response.data);
10557 }, _error_handler__WEBPACK_IMPORTED_MODULE_5__["default"]);
10558 },
10559 isPublished: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createPublishedChecker"])(),
10560 isUpdated: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createUpdatedChecker"])(),
10561 isDraft: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createDraftChecker"])(),
10562 isArchived: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createArchivedChecker"])()
10563 };
10564}
10565/**
10566 * @private
10567 * @param http - HTTP client instance
10568 * @param data - Raw entry data
10569 * @return Wrapped entry data
10570 */
10571
10572
10573function wrapEntry(http, data) {
10574 var entry = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
10575 var entryWithMethods = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(entry, createEntryApi(http));
10576 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(entryWithMethods);
10577}
10578/**
10579 * Data is also mixed in with link getters if links exist and includes were requested
10580 * @private
10581 */
10582
10583var wrapEntryCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_3__["wrapCollection"])(wrapEntry);
10584
10585/***/ }),
10586
10587/***/ "./entities/environment-alias.ts":
10588/*!***************************************!*\
10589 !*** ./entities/environment-alias.ts ***!
10590 \***************************************/
10591/*! exports provided: wrapEnvironmentAlias, wrapEnvironmentAliasCollection */
10592/***/ (function(module, __webpack_exports__, __webpack_require__) {
10593
10594"use strict";
10595__webpack_require__.r(__webpack_exports__);
10596/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapEnvironmentAlias", function() { return wrapEnvironmentAlias; });
10597/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapEnvironmentAliasCollection", function() { return wrapEnvironmentAliasCollection; });
10598/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
10599/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
10600/* harmony import */ var contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! contentful-sdk-core */ "../node_modules/contentful-sdk-core/dist/index.es-modules.js");
10601/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
10602/* harmony import */ var _instance_actions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../instance-actions */ "./instance-actions.ts");
10603/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
10604
10605
10606
10607
10608
10609
10610function createEnvironmentAliasApi(http) {
10611 return {
10612 update: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_3__["createUpdateEntity"])({
10613 http: http,
10614 entityPath: 'environment_aliases',
10615 wrapperMethod: wrapEnvironmentAlias
10616 })
10617 };
10618}
10619/**
10620 * @private
10621 * @param http - HTTP client instance
10622 * @param data - Raw environment alias data
10623 * @return Wrapped environment alias data
10624 */
10625
10626
10627function wrapEnvironmentAlias(http, data) {
10628 var alias = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
10629 var enhancedAlias = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(alias, createEnvironmentAliasApi(http));
10630 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(enhancedAlias);
10631}
10632/**
10633 * @private
10634 * @param http - HTTP client instance
10635 * @param data - Raw environment alias collection data
10636 * @return Wrapped environment alias collection data
10637 */
10638
10639var wrapEnvironmentAliasCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_4__["wrapCollection"])(wrapEnvironmentAlias);
10640
10641/***/ }),
10642
10643/***/ "./entities/environment.ts":
10644/*!*********************************!*\
10645 !*** ./entities/environment.ts ***!
10646 \*********************************/
10647/*! exports provided: wrapEnvironment, wrapEnvironmentCollection */
10648/***/ (function(module, __webpack_exports__, __webpack_require__) {
10649
10650"use strict";
10651__webpack_require__.r(__webpack_exports__);
10652/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapEnvironment", function() { return wrapEnvironment; });
10653/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapEnvironmentCollection", function() { return wrapEnvironmentCollection; });
10654/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
10655/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
10656/* harmony import */ var contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! contentful-sdk-core */ "../node_modules/contentful-sdk-core/dist/index.es-modules.js");
10657/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
10658/* harmony import */ var _create_environment_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../create-environment-api */ "./create-environment-api.ts");
10659/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
10660
10661
10662
10663
10664
10665
10666/**
10667 * This method creates the API for the given environment with all the methods for
10668 * reading and creating other entities. It also passes down a clone of the
10669 * http client with a environment id, so the base path for requests now has the
10670 * environment id already set.
10671 * @private
10672 * @param http - HTTP client instance
10673 * @param data - API response for a Environment
10674 * @return
10675 */
10676function wrapEnvironment(http, data) {
10677 // do not pollute generated typings
10678 var sdkHttp = http;
10679 var environment = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
10680 var _sdkHttp$httpClientPa = sdkHttp.httpClientParams,
10681 hostUpload = _sdkHttp$httpClientPa.hostUpload,
10682 defaultHostnameUpload = _sdkHttp$httpClientPa.defaultHostnameUpload;
10683 var environmentScopedHttpClient = sdkHttp.cloneWithNewParams({
10684 baseURL: http.defaults.baseURL + 'environments/' + environment.sys.id
10685 });
10686 var environmentScopedUploadClient = sdkHttp.cloneWithNewParams({
10687 space: environment.sys.space.sys.id,
10688 host: hostUpload || defaultHostnameUpload
10689 });
10690 var environmentApi = Object(_create_environment_api__WEBPACK_IMPORTED_MODULE_3__["default"])({
10691 http: environmentScopedHttpClient,
10692 httpUpload: environmentScopedUploadClient
10693 });
10694 var enhancedEnvironment = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(environment, environmentApi);
10695 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(enhancedEnvironment);
10696}
10697/**
10698 * This method wraps each environment in a collection with the environment API. See wrapEnvironment
10699 * above for more details.
10700 * @private
10701 */
10702
10703var wrapEnvironmentCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_4__["wrapCollection"])(wrapEnvironment);
10704
10705/***/ }),
10706
10707/***/ "./entities/index.ts":
10708/*!***************************!*\
10709 !*** ./entities/index.ts ***!
10710 \***************************/
10711/*! exports provided: default */
10712/***/ (function(module, __webpack_exports__, __webpack_require__) {
10713
10714"use strict";
10715__webpack_require__.r(__webpack_exports__);
10716/* harmony import */ var _app_definition__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./app-definition */ "./entities/app-definition.ts");
10717/* harmony import */ var _space__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./space */ "./entities/space.ts");
10718/* harmony import */ var _environment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./environment */ "./entities/environment.ts");
10719/* harmony import */ var _entry__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./entry */ "./entities/entry.ts");
10720/* harmony import */ var _asset__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./asset */ "./entities/asset.ts");
10721/* harmony import */ var _content_type__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./content-type */ "./entities/content-type.ts");
10722/* harmony import */ var _editor_interface__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./editor-interface */ "./entities/editor-interface.ts");
10723/* harmony import */ var _locale__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./locale */ "./entities/locale.ts");
10724/* harmony import */ var _webhook__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./webhook */ "./entities/webhook.ts");
10725/* harmony import */ var _space_member__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./space-member */ "./entities/space-member.ts");
10726/* harmony import */ var _space_membership__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./space-membership */ "./entities/space-membership.ts");
10727/* harmony import */ var _team_space_membership__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./team-space-membership */ "./entities/team-space-membership.ts");
10728/* harmony import */ var _organization_membership__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./organization-membership */ "./entities/organization-membership.ts");
10729/* harmony import */ var _organization_invitation__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./organization-invitation */ "./entities/organization-invitation.ts");
10730/* harmony import */ var _role__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./role */ "./entities/role.ts");
10731/* harmony import */ var _api_key__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./api-key */ "./entities/api-key.ts");
10732/* harmony import */ var _preview_api_key__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./preview-api-key */ "./entities/preview-api-key.ts");
10733/* harmony import */ var _upload__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./upload */ "./entities/upload.ts");
10734/* harmony import */ var _organization__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./organization */ "./entities/organization.ts");
10735/* harmony import */ var _ui_extension__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./ui-extension */ "./entities/ui-extension.ts");
10736/* harmony import */ var _app_installation__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./app-installation */ "./entities/app-installation.ts");
10737/* harmony import */ var _snapshot__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./snapshot */ "./entities/snapshot.ts");
10738/* harmony import */ var _user__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./user */ "./entities/user.ts");
10739/* harmony import */ var _personal_access_token__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./personal-access-token */ "./entities/personal-access-token.ts");
10740/* harmony import */ var _usage__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./usage */ "./entities/usage.ts");
10741/* harmony import */ var _environment_alias__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./environment-alias */ "./entities/environment-alias.ts");
10742/* harmony import */ var _team__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./team */ "./entities/team.ts");
10743/* harmony import */ var _team_membership__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./team-membership */ "./entities/team-membership.ts");
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10761
10762
10763
10764
10765
10766
10767
10768
10769
10770
10771
10772/* harmony default export */ __webpack_exports__["default"] = ({
10773 appDefinition: _app_definition__WEBPACK_IMPORTED_MODULE_0__,
10774 space: _space__WEBPACK_IMPORTED_MODULE_1__,
10775 environment: _environment__WEBPACK_IMPORTED_MODULE_2__,
10776 entry: _entry__WEBPACK_IMPORTED_MODULE_3__,
10777 asset: _asset__WEBPACK_IMPORTED_MODULE_4__,
10778 contentType: _content_type__WEBPACK_IMPORTED_MODULE_5__,
10779 editorInterface: _editor_interface__WEBPACK_IMPORTED_MODULE_6__,
10780 locale: _locale__WEBPACK_IMPORTED_MODULE_7__,
10781 webhook: _webhook__WEBPACK_IMPORTED_MODULE_8__,
10782 spaceMember: _space_member__WEBPACK_IMPORTED_MODULE_9__,
10783 spaceMembership: _space_membership__WEBPACK_IMPORTED_MODULE_10__,
10784 teamSpaceMembership: _team_space_membership__WEBPACK_IMPORTED_MODULE_11__,
10785 organizationMembership: _organization_membership__WEBPACK_IMPORTED_MODULE_12__,
10786 organizationInvitation: _organization_invitation__WEBPACK_IMPORTED_MODULE_13__,
10787 role: _role__WEBPACK_IMPORTED_MODULE_14__,
10788 apiKey: _api_key__WEBPACK_IMPORTED_MODULE_15__,
10789 previewApiKey: _preview_api_key__WEBPACK_IMPORTED_MODULE_16__,
10790 upload: _upload__WEBPACK_IMPORTED_MODULE_17__,
10791 organization: _organization__WEBPACK_IMPORTED_MODULE_18__,
10792 uiExtension: _ui_extension__WEBPACK_IMPORTED_MODULE_19__,
10793 appInstallation: _app_installation__WEBPACK_IMPORTED_MODULE_20__,
10794 snapshot: _snapshot__WEBPACK_IMPORTED_MODULE_21__,
10795 user: _user__WEBPACK_IMPORTED_MODULE_22__,
10796 personalAccessToken: _personal_access_token__WEBPACK_IMPORTED_MODULE_23__,
10797 usage: _usage__WEBPACK_IMPORTED_MODULE_24__,
10798 environmentAlias: _environment_alias__WEBPACK_IMPORTED_MODULE_25__,
10799 team: _team__WEBPACK_IMPORTED_MODULE_26__,
10800 teamMembership: _team_membership__WEBPACK_IMPORTED_MODULE_27__
10801});
10802
10803/***/ }),
10804
10805/***/ "./entities/locale.ts":
10806/*!****************************!*\
10807 !*** ./entities/locale.ts ***!
10808 \****************************/
10809/*! exports provided: wrapLocale, wrapLocaleCollection */
10810/***/ (function(module, __webpack_exports__, __webpack_require__) {
10811
10812"use strict";
10813__webpack_require__.r(__webpack_exports__);
10814/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapLocale", function() { return wrapLocale; });
10815/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapLocaleCollection", function() { return wrapLocaleCollection; });
10816/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
10817/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
10818/* harmony import */ var contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! contentful-sdk-core */ "../node_modules/contentful-sdk-core/dist/index.es-modules.js");
10819/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
10820/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
10821/* harmony import */ var _instance_actions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../instance-actions */ "./instance-actions.ts");
10822
10823
10824
10825
10826
10827
10828function createLocaleApi(http) {
10829 return {
10830 update: function update() {
10831 var self = this;
10832 delete self.default; // we should not send this back
10833
10834 return Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createUpdateEntity"])({
10835 http: http,
10836 entityPath: 'locales',
10837 wrapperMethod: wrapLocale
10838 }).call(self);
10839 },
10840 delete: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createDeleteEntity"])({
10841 http: http,
10842 entityPath: 'locales'
10843 })
10844 };
10845}
10846/**
10847 * @private
10848 * @param http - HTTP client instance
10849 * @param data - Raw locale data
10850 * @return Wrapped locale data
10851 */
10852
10853
10854function wrapLocale(http, data) {
10855 // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
10856 // @ts-ignore
10857 delete data.internal_code;
10858 var locale = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
10859 var localeWithMethods = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(locale, createLocaleApi(http));
10860 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(localeWithMethods);
10861}
10862/**
10863 * @private
10864 */
10865
10866var wrapLocaleCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_3__["wrapCollection"])(wrapLocale);
10867
10868/***/ }),
10869
10870/***/ "./entities/organization-invitation.ts":
10871/*!*********************************************!*\
10872 !*** ./entities/organization-invitation.ts ***!
10873 \*********************************************/
10874/*! exports provided: wrapOrganizationInvitation */
10875/***/ (function(module, __webpack_exports__, __webpack_require__) {
10876
10877"use strict";
10878__webpack_require__.r(__webpack_exports__);
10879/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapOrganizationInvitation", function() { return wrapOrganizationInvitation; });
10880/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
10881/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
10882/* harmony import */ var contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! contentful-sdk-core */ "../node_modules/contentful-sdk-core/dist/index.es-modules.js");
10883
10884
10885
10886/**
10887 * @private
10888 * @param http - HTTP client instance
10889 * @param data - Raw invitation data
10890 * @return {OrganizationInvitation} Wrapped Inviation data
10891 */
10892function wrapOrganizationInvitation(http, data) {
10893 var invitation = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
10894 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(invitation);
10895}
10896
10897/***/ }),
10898
10899/***/ "./entities/organization-membership.ts":
10900/*!*********************************************!*\
10901 !*** ./entities/organization-membership.ts ***!
10902 \*********************************************/
10903/*! exports provided: wrapOrganizationMembership, wrapOrganizationMembershipCollection */
10904/***/ (function(module, __webpack_exports__, __webpack_require__) {
10905
10906"use strict";
10907__webpack_require__.r(__webpack_exports__);
10908/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapOrganizationMembership", function() { return wrapOrganizationMembership; });
10909/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapOrganizationMembershipCollection", function() { return wrapOrganizationMembershipCollection; });
10910/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
10911/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
10912/* harmony import */ var contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! contentful-sdk-core */ "../node_modules/contentful-sdk-core/dist/index.es-modules.js");
10913/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
10914/* harmony import */ var _error_handler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../error-handler */ "./error-handler.ts");
10915/* harmony import */ var _instance_actions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../instance-actions */ "./instance-actions.ts");
10916/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
10917
10918
10919
10920
10921
10922
10923
10924function createOrganizationMembershipApi(http) {
10925 return {
10926 update: function update() {
10927 var self = this;
10928 var raw = self.toPlainObject();
10929 var role = raw.role;
10930 return http.put('organization_memberships' + '/' + self.sys.id, {
10931 role: role
10932 }, {
10933 headers: {
10934 'X-Contentful-Version': self.sys.version || 0
10935 }
10936 }).then(function (response) {
10937 return wrapOrganizationMembership(http, response.data);
10938 }, _error_handler__WEBPACK_IMPORTED_MODULE_3__["default"]);
10939 },
10940 delete: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createDeleteEntity"])({
10941 http: http,
10942 entityPath: 'organization_memberships'
10943 })
10944 };
10945}
10946/**
10947 * @private
10948 * @param {Object} http - HTTP client instance
10949 * @param {Object} data - Raw organization membership data
10950 * @return {OrganizationMembership} Wrapped organization membership data
10951 */
10952
10953
10954function wrapOrganizationMembership(http, data) {
10955 var organizationMembership = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
10956 var organizationMembershipWithMethods = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(organizationMembership, createOrganizationMembershipApi(http));
10957 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(organizationMembershipWithMethods);
10958}
10959/**
10960 * @private
10961 */
10962
10963var wrapOrganizationMembershipCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_5__["wrapCollection"])(wrapOrganizationMembership);
10964
10965/***/ }),
10966
10967/***/ "./entities/organization.ts":
10968/*!**********************************!*\
10969 !*** ./entities/organization.ts ***!
10970 \**********************************/
10971/*! exports provided: wrapOrganization, wrapOrganizationCollection */
10972/***/ (function(module, __webpack_exports__, __webpack_require__) {
10973
10974"use strict";
10975__webpack_require__.r(__webpack_exports__);
10976/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapOrganization", function() { return wrapOrganization; });
10977/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapOrganizationCollection", function() { return wrapOrganizationCollection; });
10978/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
10979/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
10980/* harmony import */ var contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! contentful-sdk-core */ "../node_modules/contentful-sdk-core/dist/index.es-modules.js");
10981/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
10982/* harmony import */ var _create_organization_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../create-organization-api */ "./create-organization-api.ts");
10983/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
10984
10985
10986
10987
10988
10989
10990/**
10991 * This method creates the API for the given organization with all the methods for
10992 * reading and creating other entities. It also passes down a clone of the
10993 * http client with an organization id, so the base path for requests now has the
10994 * organization id already set.
10995 * @private
10996 * @param http - HTTP client instance
10997 * @param data - API response for an Organization
10998 * @return {Organization}
10999 */
11000function wrapOrganization(http, data) {
11001 var org = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
11002 var baseURL = (http.defaults.baseURL || '').replace('/spaces/', '/organizations/') + org.sys.id + '/'; // @ts-expect-error
11003
11004 var orgScopedHttpClient = http.cloneWithNewParams({
11005 baseURL: baseURL
11006 });
11007 var orgApi = Object(_create_organization_api__WEBPACK_IMPORTED_MODULE_3__["default"])({
11008 http: orgScopedHttpClient
11009 });
11010 var enhancedOrganization = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(org, orgApi);
11011 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(enhancedOrganization);
11012}
11013/**
11014 * This method normalizes each organization in a collection.
11015 * @private
11016 */
11017
11018var wrapOrganizationCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_4__["wrapCollection"])(wrapOrganization);
11019
11020/***/ }),
11021
11022/***/ "./entities/personal-access-token.ts":
11023/*!*******************************************!*\
11024 !*** ./entities/personal-access-token.ts ***!
11025 \*******************************************/
11026/*! exports provided: wrapPersonalAccessToken, wrapPersonalAccessTokenCollection */
11027/***/ (function(module, __webpack_exports__, __webpack_require__) {
11028
11029"use strict";
11030__webpack_require__.r(__webpack_exports__);
11031/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapPersonalAccessToken", function() { return wrapPersonalAccessToken; });
11032/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapPersonalAccessTokenCollection", function() { return wrapPersonalAccessTokenCollection; });
11033/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
11034/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
11035/* harmony import */ var contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! contentful-sdk-core */ "../node_modules/contentful-sdk-core/dist/index.es-modules.js");
11036/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
11037/* harmony import */ var _error_handler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../error-handler */ "./error-handler.ts");
11038/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
11039
11040
11041
11042
11043
11044
11045function createPersonalAccessToken(http) {
11046 return {
11047 revoke: function revoke() {
11048 var baseURL = (http.defaults.baseURL || '').replace('/spaces/', '/users/me/access_tokens');
11049 return http.put("".concat(this.sys.id, "/revoked"), null, {
11050 baseURL: baseURL
11051 }).then(function (response) {
11052 return response.data;
11053 }, _error_handler__WEBPACK_IMPORTED_MODULE_3__["default"]);
11054 }
11055 };
11056}
11057/**
11058 * @private
11059 * @param http - HTTP client instance
11060 * @param data - Raw personal access token data
11061 * @return Wrapped personal access token
11062 */
11063
11064
11065function wrapPersonalAccessToken(http, data) {
11066 var personalAccessToken = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
11067 var personalAccessTokenWithMethods = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(personalAccessToken, createPersonalAccessToken(http));
11068 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(personalAccessTokenWithMethods);
11069}
11070/**
11071 * @private
11072 * @param http - HTTP client instance
11073 * @param data - Raw personal access collection data
11074 * @return Wrapped personal access token collection data
11075 */
11076
11077var wrapPersonalAccessTokenCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_4__["wrapCollection"])(wrapPersonalAccessToken);
11078
11079/***/ }),
11080
11081/***/ "./entities/preview-api-key.ts":
11082/*!*************************************!*\
11083 !*** ./entities/preview-api-key.ts ***!
11084 \*************************************/
11085/*! exports provided: wrapPreviewApiKey, wrapPreviewApiKeyCollection */
11086/***/ (function(module, __webpack_exports__, __webpack_require__) {
11087
11088"use strict";
11089__webpack_require__.r(__webpack_exports__);
11090/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapPreviewApiKey", function() { return wrapPreviewApiKey; });
11091/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapPreviewApiKeyCollection", function() { return wrapPreviewApiKeyCollection; });
11092/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
11093/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
11094/* harmony import */ var contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! contentful-sdk-core */ "../node_modules/contentful-sdk-core/dist/index.es-modules.js");
11095/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
11096/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
11097
11098
11099
11100
11101
11102function createPreviewApiKeyApi() {
11103 return {};
11104}
11105/**
11106 * @private
11107 * @param http - HTTP client instance
11108 * @param data - Raw api key data
11109 * @return Wrapped preview api key data
11110 */
11111
11112
11113function wrapPreviewApiKey(_http, data) {
11114 var previewApiKey = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
11115 var previewApiKeyWithMethods = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(previewApiKey, createPreviewApiKeyApi());
11116 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(previewApiKeyWithMethods);
11117}
11118/**
11119 * @private
11120 */
11121
11122var wrapPreviewApiKeyCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_3__["wrapCollection"])(wrapPreviewApiKey);
11123
11124/***/ }),
11125
11126/***/ "./entities/role.ts":
11127/*!**************************!*\
11128 !*** ./entities/role.ts ***!
11129 \**************************/
11130/*! exports provided: wrapRole, wrapRoleCollection */
11131/***/ (function(module, __webpack_exports__, __webpack_require__) {
11132
11133"use strict";
11134__webpack_require__.r(__webpack_exports__);
11135/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapRole", function() { return wrapRole; });
11136/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapRoleCollection", function() { return wrapRoleCollection; });
11137/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
11138/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
11139/* harmony import */ var contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! contentful-sdk-core */ "../node_modules/contentful-sdk-core/dist/index.es-modules.js");
11140/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
11141/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
11142/* harmony import */ var _instance_actions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../instance-actions */ "./instance-actions.ts");
11143
11144
11145
11146
11147
11148
11149function createRoleApi(http) {
11150 return {
11151 update: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createUpdateEntity"])({
11152 http: http,
11153 entityPath: 'roles',
11154 wrapperMethod: wrapRole
11155 }),
11156 delete: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createDeleteEntity"])({
11157 http: http,
11158 entityPath: 'roles'
11159 })
11160 };
11161}
11162/**
11163 * @private
11164 * @param http - HTTP client instance
11165 * @param data - Raw role data
11166 * @return Wrapped role data
11167 */
11168
11169
11170function wrapRole(http, data) {
11171 var role = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
11172 var roleWithMethods = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(role, createRoleApi(http));
11173 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(roleWithMethods);
11174}
11175/**
11176 * @private
11177 */
11178
11179var wrapRoleCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_3__["wrapCollection"])(wrapRole);
11180
11181/***/ }),
11182
11183/***/ "./entities/snapshot.ts":
11184/*!******************************!*\
11185 !*** ./entities/snapshot.ts ***!
11186 \******************************/
11187/*! exports provided: wrapSnapshot, wrapSnapshotCollection */
11188/***/ (function(module, __webpack_exports__, __webpack_require__) {
11189
11190"use strict";
11191__webpack_require__.r(__webpack_exports__);
11192/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapSnapshot", function() { return wrapSnapshot; });
11193/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapSnapshotCollection", function() { return wrapSnapshotCollection; });
11194/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
11195/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
11196/* harmony import */ var contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! contentful-sdk-core */ "../node_modules/contentful-sdk-core/dist/index.es-modules.js");
11197/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
11198/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
11199
11200
11201
11202
11203
11204function createSnapshotApi() {
11205 return {
11206 /* In case the snapshot object evolve later */
11207 };
11208}
11209/**
11210 * @private
11211 * @param http - HTTP client instance
11212 * @param data - Raw snapshot data
11213 * @return Wrapped snapshot data
11214 */
11215
11216
11217function wrapSnapshot(_http, data) {
11218 var snapshot = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
11219 var snapshotWithMethods = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(snapshot, createSnapshotApi());
11220 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(snapshotWithMethods);
11221}
11222/**
11223 * @private
11224 * @param http - HTTP client instance
11225 * @param data - Raw snapshot collection data
11226 * @return Wrapped snapshot collection data
11227 */
11228
11229var wrapSnapshotCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_3__["wrapCollection"])(wrapSnapshot);
11230
11231/***/ }),
11232
11233/***/ "./entities/space-member.ts":
11234/*!**********************************!*\
11235 !*** ./entities/space-member.ts ***!
11236 \**********************************/
11237/*! exports provided: wrapSpaceMember, wrapSpaceMemberCollection */
11238/***/ (function(module, __webpack_exports__, __webpack_require__) {
11239
11240"use strict";
11241__webpack_require__.r(__webpack_exports__);
11242/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapSpaceMember", function() { return wrapSpaceMember; });
11243/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapSpaceMemberCollection", function() { return wrapSpaceMemberCollection; });
11244/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
11245/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
11246/* harmony import */ var contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! contentful-sdk-core */ "../node_modules/contentful-sdk-core/dist/index.es-modules.js");
11247/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
11248
11249
11250
11251
11252/**
11253 * @private
11254 * @param http - HTTP client instance
11255 * @param data - Raw space member data
11256 * @return Wrapped space member data
11257 */
11258function wrapSpaceMember(http, data) {
11259 var spaceMember = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
11260 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(spaceMember);
11261}
11262/**
11263 * @private
11264 */
11265
11266var wrapSpaceMemberCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_2__["wrapCollection"])(wrapSpaceMember);
11267
11268/***/ }),
11269
11270/***/ "./entities/space-membership.ts":
11271/*!**************************************!*\
11272 !*** ./entities/space-membership.ts ***!
11273 \**************************************/
11274/*! exports provided: wrapSpaceMembership, wrapSpaceMembershipCollection */
11275/***/ (function(module, __webpack_exports__, __webpack_require__) {
11276
11277"use strict";
11278__webpack_require__.r(__webpack_exports__);
11279/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapSpaceMembership", function() { return wrapSpaceMembership; });
11280/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapSpaceMembershipCollection", function() { return wrapSpaceMembershipCollection; });
11281/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
11282/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
11283/* harmony import */ var contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! contentful-sdk-core */ "../node_modules/contentful-sdk-core/dist/index.es-modules.js");
11284/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
11285/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
11286/* harmony import */ var _instance_actions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../instance-actions */ "./instance-actions.ts");
11287
11288
11289
11290
11291
11292
11293function createSpaceMembershipApi(http) {
11294 return {
11295 update: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createUpdateEntity"])({
11296 http: http,
11297 entityPath: 'space_memberships',
11298 wrapperMethod: wrapSpaceMembership
11299 }),
11300 delete: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createDeleteEntity"])({
11301 http: http,
11302 entityPath: 'space_memberships'
11303 })
11304 };
11305}
11306/**
11307 * @private
11308 * @param http - HTTP client instance
11309 * @param data - Raw space membership data
11310 * @return Wrapped space membership data
11311 */
11312
11313
11314function wrapSpaceMembership(http, data) {
11315 var spaceMembership = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
11316 var spaceMembershipWithMethods = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(spaceMembership, createSpaceMembershipApi(http));
11317 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(spaceMembershipWithMethods);
11318}
11319/**
11320 * @private
11321 */
11322
11323var wrapSpaceMembershipCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_3__["wrapCollection"])(wrapSpaceMembership);
11324
11325/***/ }),
11326
11327/***/ "./entities/space.ts":
11328/*!***************************!*\
11329 !*** ./entities/space.ts ***!
11330 \***************************/
11331/*! exports provided: wrapSpace, wrapSpaceCollection */
11332/***/ (function(module, __webpack_exports__, __webpack_require__) {
11333
11334"use strict";
11335__webpack_require__.r(__webpack_exports__);
11336/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapSpace", function() { return wrapSpace; });
11337/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapSpaceCollection", function() { return wrapSpaceCollection; });
11338/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
11339/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
11340/* harmony import */ var contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! contentful-sdk-core */ "../node_modules/contentful-sdk-core/dist/index.es-modules.js");
11341/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
11342/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
11343/* harmony import */ var _create_space_api__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../create-space-api */ "./create-space-api.ts");
11344
11345
11346
11347
11348
11349
11350/**
11351 * This method creates the API for the given space with all the methods for
11352 * reading and creating other entities. It also passes down a clone of the
11353 * http client with a space id, so the base path for requests now has the
11354 * space id already set.
11355 * @private
11356 * @param http - HTTP client instance
11357 * @param data - API response for a Space
11358 * @return {Space}
11359 */
11360function wrapSpace(http, data) {
11361 var sdkHttp = http;
11362 var space = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
11363 var _sdkHttp$httpClientPa = sdkHttp.httpClientParams,
11364 hostUpload = _sdkHttp$httpClientPa.hostUpload,
11365 defaultHostnameUpload = _sdkHttp$httpClientPa.defaultHostnameUpload;
11366 var spaceScopedHttpClient = sdkHttp.cloneWithNewParams({
11367 space: space.sys.id
11368 });
11369 var spaceScopedUploadClient = sdkHttp.cloneWithNewParams({
11370 space: space.sys.id,
11371 host: hostUpload || defaultHostnameUpload
11372 });
11373 var spaceApi = Object(_create_space_api__WEBPACK_IMPORTED_MODULE_4__["default"])({
11374 http: spaceScopedHttpClient,
11375 httpUpload: spaceScopedUploadClient
11376 });
11377 var enhancedSpace = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(space, spaceApi);
11378 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(enhancedSpace);
11379}
11380/**
11381 * This method wraps each space in a collection with the space API. See wrapSpace
11382 * above for more details.
11383 * @private
11384 */
11385
11386var wrapSpaceCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_3__["wrapCollection"])(wrapSpace);
11387
11388/***/ }),
11389
11390/***/ "./entities/team-membership.ts":
11391/*!*************************************!*\
11392 !*** ./entities/team-membership.ts ***!
11393 \*************************************/
11394/*! exports provided: wrapTeamMembership, wrapTeamMembershipCollection */
11395/***/ (function(module, __webpack_exports__, __webpack_require__) {
11396
11397"use strict";
11398__webpack_require__.r(__webpack_exports__);
11399/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapTeamMembership", function() { return wrapTeamMembership; });
11400/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapTeamMembershipCollection", function() { return wrapTeamMembershipCollection; });
11401/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
11402/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
11403/* harmony import */ var contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! contentful-sdk-core */ "../node_modules/contentful-sdk-core/dist/index.es-modules.js");
11404/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
11405/* harmony import */ var _error_handler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../error-handler */ "./error-handler.ts");
11406/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
11407
11408
11409
11410
11411
11412
11413function createTeamMembershipApi(http) {
11414 return {
11415 update: function update() {
11416 var raw = this.toPlainObject();
11417 var teamId = raw.sys.team.sys.id;
11418 return http.put('teams/' + teamId + '/team_memberships/' + this.sys.id, raw, {
11419 headers: {
11420 'X-Contentful-Version': this.sys.version || 0
11421 }
11422 }).then(function (response) {
11423 return wrapTeamMembership(http, response.data);
11424 }, _error_handler__WEBPACK_IMPORTED_MODULE_3__["default"]);
11425 },
11426 delete: function _delete() {
11427 var raw = this.toPlainObject();
11428 var teamId = raw.sys.team.sys.id;
11429 return http.delete('teams/' + teamId + '/team_memberships/' + this.sys.id).then(function () {// do nothing
11430 }, _error_handler__WEBPACK_IMPORTED_MODULE_3__["default"]);
11431 }
11432 };
11433}
11434/**
11435 * @private
11436 * @param http - HTTP client instance
11437 * @param data - Raw team membership data
11438 * @return Wrapped team membership data
11439 */
11440
11441
11442function wrapTeamMembership(http, data) {
11443 var teamMembership = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
11444 var teamMembershipWithMethods = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(teamMembership, createTeamMembershipApi(http));
11445 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(teamMembershipWithMethods);
11446}
11447/**
11448 * @private
11449 */
11450
11451var wrapTeamMembershipCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_4__["wrapCollection"])(wrapTeamMembership);
11452
11453/***/ }),
11454
11455/***/ "./entities/team-space-membership.ts":
11456/*!*******************************************!*\
11457 !*** ./entities/team-space-membership.ts ***!
11458 \*******************************************/
11459/*! exports provided: wrapTeamSpaceMembership, wrapTeamSpaceMembershipCollection */
11460/***/ (function(module, __webpack_exports__, __webpack_require__) {
11461
11462"use strict";
11463__webpack_require__.r(__webpack_exports__);
11464/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapTeamSpaceMembership", function() { return wrapTeamSpaceMembership; });
11465/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapTeamSpaceMembershipCollection", function() { return wrapTeamSpaceMembershipCollection; });
11466/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
11467/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
11468/* harmony import */ var contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! contentful-sdk-core */ "../node_modules/contentful-sdk-core/dist/index.es-modules.js");
11469/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
11470/* harmony import */ var _instance_actions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../instance-actions */ "./instance-actions.ts");
11471/* harmony import */ var _error_handler__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../error-handler */ "./error-handler.ts");
11472/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
11473
11474
11475
11476
11477
11478
11479
11480function createTeamSpaceMembershipApi(http) {
11481 return {
11482 update: function update() {
11483 var raw = this.toPlainObject();
11484 var data = lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(raw);
11485 delete data.sys;
11486 return http.put('team_space_memberships/' + this.sys.id, data, {
11487 headers: {
11488 'X-Contentful-Version': this.sys.version || 0,
11489 'x-contentful-team': this.sys.team.sys.id
11490 }
11491 }).then(function (response) {
11492 return wrapTeamSpaceMembership(http, response.data);
11493 }, _error_handler__WEBPACK_IMPORTED_MODULE_4__["default"]);
11494 },
11495 delete: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_3__["createDeleteEntity"])({
11496 http: http,
11497 entityPath: 'team_space_memberships'
11498 })
11499 };
11500}
11501/**
11502 * @private
11503 * @param http - HTTP client instance
11504 * @param data - Raw space membership data
11505 * @return Wrapped team space membership data
11506 */
11507
11508
11509function wrapTeamSpaceMembership(http, data) {
11510 var teamSpaceMembership = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
11511 var teamSpaceMembershipWithMethods = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(teamSpaceMembership, createTeamSpaceMembershipApi(http));
11512 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(teamSpaceMembershipWithMethods);
11513}
11514/**
11515 * @private
11516 */
11517
11518var wrapTeamSpaceMembershipCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_5__["wrapCollection"])(wrapTeamSpaceMembership);
11519
11520/***/ }),
11521
11522/***/ "./entities/team.ts":
11523/*!**************************!*\
11524 !*** ./entities/team.ts ***!
11525 \**************************/
11526/*! exports provided: wrapTeam, wrapTeamCollection */
11527/***/ (function(module, __webpack_exports__, __webpack_require__) {
11528
11529"use strict";
11530__webpack_require__.r(__webpack_exports__);
11531/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapTeam", function() { return wrapTeam; });
11532/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapTeamCollection", function() { return wrapTeamCollection; });
11533/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
11534/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
11535/* harmony import */ var contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! contentful-sdk-core */ "../node_modules/contentful-sdk-core/dist/index.es-modules.js");
11536/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
11537/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
11538/* harmony import */ var _instance_actions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../instance-actions */ "./instance-actions.ts");
11539
11540
11541
11542
11543
11544var entityPath = 'teams';
11545/**
11546 * @private
11547 */
11548
11549function createTeamApi(http) {
11550 return {
11551 update: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createUpdateEntity"])({
11552 http: http,
11553 entityPath: entityPath,
11554 wrapperMethod: wrapTeam
11555 }),
11556 delete: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createDeleteEntity"])({
11557 http: http,
11558 entityPath: entityPath
11559 })
11560 };
11561}
11562/**
11563 * @private
11564 * @param http - HTTP client instance
11565 * @param data - Raw team data
11566 * @return Wrapped team data
11567 */
11568
11569
11570function wrapTeam(http, data) {
11571 var team = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
11572 var teamWithMethods = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(team, createTeamApi(http));
11573 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(teamWithMethods);
11574}
11575/**
11576 * @private
11577 */
11578
11579var wrapTeamCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_3__["wrapCollection"])(wrapTeam);
11580
11581/***/ }),
11582
11583/***/ "./entities/ui-extension.ts":
11584/*!**********************************!*\
11585 !*** ./entities/ui-extension.ts ***!
11586 \**********************************/
11587/*! exports provided: wrapUiExtension, wrapUiExtensionCollection */
11588/***/ (function(module, __webpack_exports__, __webpack_require__) {
11589
11590"use strict";
11591__webpack_require__.r(__webpack_exports__);
11592/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapUiExtension", function() { return wrapUiExtension; });
11593/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapUiExtensionCollection", function() { return wrapUiExtensionCollection; });
11594/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
11595/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
11596/* harmony import */ var contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! contentful-sdk-core */ "../node_modules/contentful-sdk-core/dist/index.es-modules.js");
11597/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
11598/* harmony import */ var _instance_actions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../instance-actions */ "./instance-actions.ts");
11599/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
11600
11601
11602
11603
11604
11605
11606function createUiExtensionApi(http) {
11607 return {
11608 update: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_3__["createUpdateEntity"])({
11609 http: http,
11610 entityPath: 'extensions',
11611 wrapperMethod: wrapUiExtension
11612 }),
11613 delete: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_3__["createDeleteEntity"])({
11614 http: http,
11615 entityPath: 'extensions'
11616 })
11617 };
11618}
11619/**
11620 * @private
11621 * @param http - HTTP client instance
11622 * @param data - Raw UI Extension data
11623 * @return Wrapped UI Extension data
11624 */
11625
11626
11627function wrapUiExtension(http, data) {
11628 var uiExtension = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
11629 var uiExtensionWithMethods = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(uiExtension, createUiExtensionApi(http));
11630 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(uiExtensionWithMethods);
11631}
11632/**
11633 * @private
11634 */
11635
11636var wrapUiExtensionCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_4__["wrapCollection"])(wrapUiExtension);
11637
11638/***/ }),
11639
11640/***/ "./entities/upload.ts":
11641/*!****************************!*\
11642 !*** ./entities/upload.ts ***!
11643 \****************************/
11644/*! exports provided: wrapUpload */
11645/***/ (function(module, __webpack_exports__, __webpack_require__) {
11646
11647"use strict";
11648__webpack_require__.r(__webpack_exports__);
11649/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapUpload", function() { return wrapUpload; });
11650/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
11651/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
11652/* harmony import */ var contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! contentful-sdk-core */ "../node_modules/contentful-sdk-core/dist/index.es-modules.js");
11653/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
11654/* harmony import */ var _instance_actions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../instance-actions */ "./instance-actions.ts");
11655
11656
11657
11658
11659
11660function createUploadApi(http) {
11661 return {
11662 delete: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_3__["createDeleteEntity"])({
11663 http: http,
11664 entityPath: 'uploads'
11665 })
11666 };
11667}
11668/**
11669 * @private
11670 * @param {Object} http - HTTP client instance
11671 * @param {Object} data - Raw upload data
11672 * @return {Upload} Wrapped upload data
11673 */
11674
11675
11676function wrapUpload(http, data) {
11677 var upload = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
11678 var uploadWithMethods = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(upload, createUploadApi(http));
11679 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(uploadWithMethods);
11680}
11681
11682/***/ }),
11683
11684/***/ "./entities/usage.ts":
11685/*!***************************!*\
11686 !*** ./entities/usage.ts ***!
11687 \***************************/
11688/*! exports provided: wrapUsage, wrapUsageCollection */
11689/***/ (function(module, __webpack_exports__, __webpack_require__) {
11690
11691"use strict";
11692__webpack_require__.r(__webpack_exports__);
11693/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapUsage", function() { return wrapUsage; });
11694/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapUsageCollection", function() { return wrapUsageCollection; });
11695/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
11696/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
11697/* harmony import */ var contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! contentful-sdk-core */ "../node_modules/contentful-sdk-core/dist/index.es-modules.js");
11698/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
11699/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
11700
11701
11702
11703
11704
11705/**
11706 * @private
11707 * @param http - HTTP client instance
11708 * @param data - Raw data
11709 * @return Normalized usage
11710 */
11711function wrapUsage(http, data) {
11712 var usage = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
11713 var usageWithMethods = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(usage, {});
11714 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(usageWithMethods);
11715}
11716/**
11717 * @private
11718 */
11719
11720var wrapUsageCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_3__["wrapCollection"])(wrapUsage);
11721
11722/***/ }),
11723
11724/***/ "./entities/user.ts":
11725/*!**************************!*\
11726 !*** ./entities/user.ts ***!
11727 \**************************/
11728/*! exports provided: wrapUser, wrapUserCollection */
11729/***/ (function(module, __webpack_exports__, __webpack_require__) {
11730
11731"use strict";
11732__webpack_require__.r(__webpack_exports__);
11733/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapUser", function() { return wrapUser; });
11734/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapUserCollection", function() { return wrapUserCollection; });
11735/* harmony import */ var contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! contentful-sdk-core */ "../node_modules/contentful-sdk-core/dist/index.es-modules.js");
11736/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
11737/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_1__);
11738/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
11739/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
11740
11741
11742
11743
11744
11745/**
11746 * @private
11747 * @param http - HTTP client instance
11748 * @param data - Raw data
11749 * @return Normalized user
11750 */
11751function wrapUser(http, data) {
11752 var user = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_1___default()(data));
11753 var userWithMethods = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(user, {});
11754 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["freezeSys"])(userWithMethods);
11755}
11756/**
11757 * @private
11758 * @param http - HTTP client instance
11759 * @param data - Raw data collection
11760 * @return Normalized user collection
11761 */
11762
11763var wrapUserCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_3__["wrapCollection"])(wrapUser);
11764
11765/***/ }),
11766
11767/***/ "./entities/webhook.ts":
11768/*!*****************************!*\
11769 !*** ./entities/webhook.ts ***!
11770 \*****************************/
11771/*! exports provided: wrapWebhook, wrapWebhookCollection */
11772/***/ (function(module, __webpack_exports__, __webpack_require__) {
11773
11774"use strict";
11775__webpack_require__.r(__webpack_exports__);
11776/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapWebhook", function() { return wrapWebhook; });
11777/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapWebhookCollection", function() { return wrapWebhookCollection; });
11778/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
11779/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
11780/* harmony import */ var contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! contentful-sdk-core */ "../node_modules/contentful-sdk-core/dist/index.es-modules.js");
11781/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
11782/* harmony import */ var _error_handler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../error-handler */ "./error-handler.ts");
11783/* harmony import */ var _instance_actions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../instance-actions */ "./instance-actions.ts");
11784/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
11785
11786
11787
11788
11789
11790
11791var entityPath = 'webhook_definitions';
11792
11793function createWebhookApi(http) {
11794 return {
11795 update: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createUpdateEntity"])({
11796 http: http,
11797 entityPath: entityPath,
11798 wrapperMethod: wrapWebhook
11799 }),
11800 delete: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createDeleteEntity"])({
11801 http: http,
11802 entityPath: entityPath
11803 }),
11804 getCalls: function getCalls() {
11805 return http.get('webhooks/' + this.sys.id + '/calls').then(function (response) {
11806 return response.data;
11807 }, _error_handler__WEBPACK_IMPORTED_MODULE_3__["default"]);
11808 },
11809 getCall: function getCall(id) {
11810 return http.get('webhooks/' + this.sys.id + '/calls/' + id).then(function (response) {
11811 return response.data;
11812 }, _error_handler__WEBPACK_IMPORTED_MODULE_3__["default"]);
11813 },
11814 getHealth: function getHealth() {
11815 return http.get('webhooks/' + this.sys.id + '/health').then(function (response) {
11816 return response.data;
11817 }, _error_handler__WEBPACK_IMPORTED_MODULE_3__["default"]);
11818 }
11819 };
11820}
11821/**
11822 * @private
11823 * @param http - HTTP client instance
11824 * @param data - Raw webhook data
11825 * @return Wrapped webhook data
11826 */
11827
11828
11829function wrapWebhook(http, data) {
11830 var webhook = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
11831 var webhookWithMethods = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(webhook, createWebhookApi(http));
11832 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(webhookWithMethods);
11833}
11834/**
11835 * @private
11836 */
11837
11838var wrapWebhookCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_5__["wrapCollection"])(wrapWebhook);
11839
11840/***/ }),
11841
11842/***/ "./error-handler.ts":
11843/*!**************************!*\
11844 !*** ./error-handler.ts ***!
11845 \**************************/
11846/*! exports provided: default */
11847/***/ (function(module, __webpack_exports__, __webpack_require__) {
11848
11849"use strict";
11850__webpack_require__.r(__webpack_exports__);
11851/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return errorHandler; });
11852/* harmony import */ var lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/isPlainObject */ "../node_modules/lodash/isPlainObject.js");
11853/* harmony import */ var lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0__);
11854
11855
11856/**
11857 * Handles errors received from the server. Parses the error into a more useful
11858 * format, places it in an exception and throws it.
11859 * See https://www.contentful.com/developers/docs/references/errors/
11860 * for more details on the data received on the errorResponse.data property
11861 * and the expected error codes.
11862 * @private
11863 */
11864function errorHandler(errorResponse) {
11865 var config = errorResponse.config,
11866 response = errorResponse.response;
11867 var errorName; // Obscure the Management token
11868
11869 if (config.headers && config.headers['Authorization']) {
11870 var token = "...".concat(config.headers['Authorization'].substr(-5));
11871 config.headers['Authorization'] = "Bearer ".concat(token);
11872 }
11873
11874 if (!lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0___default()(response) || !lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0___default()(config)) {
11875 throw errorResponse;
11876 }
11877
11878 var data = response === null || response === void 0 ? void 0 : response.data;
11879 var errorData = {
11880 status: response === null || response === void 0 ? void 0 : response.status,
11881 statusText: response === null || response === void 0 ? void 0 : response.statusText,
11882 message: '',
11883 details: {}
11884 };
11885
11886 if (lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0___default()(config)) {
11887 errorData.request = {
11888 url: config.url,
11889 headers: config.headers,
11890 method: config.method,
11891 payloadData: config.data
11892 };
11893 }
11894
11895 if (data && lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0___default()(data)) {
11896 if ('requestId' in data) {
11897 errorData.requestId = data.requestId || 'UNKNOWN';
11898 }
11899
11900 if ('message' in data) {
11901 errorData.message = data.message || '';
11902 }
11903
11904 if ('details' in data) {
11905 errorData.details = data.details || {};
11906 }
11907
11908 if ('sys' in data) {
11909 if ('id' in data.sys) {
11910 errorName = data.sys.id;
11911 }
11912 }
11913 }
11914
11915 var error = new Error();
11916 error.name = errorName && errorName !== 'Unknown' ? errorName : "".concat(response === null || response === void 0 ? void 0 : response.status, " ").concat(response === null || response === void 0 ? void 0 : response.statusText);
11917 error.message = JSON.stringify(errorData, null, ' ');
11918 throw error;
11919}
11920
11921/***/ }),
11922
11923/***/ "./instance-actions.ts":
11924/*!*****************************!*\
11925 !*** ./instance-actions.ts ***!
11926 \*****************************/
11927/*! exports provided: createUpdateEntity, createDeleteEntity, createPublishEntity, createUnpublishEntity, createArchiveEntity, createUnarchiveEntity, createPublishedChecker, createUpdatedChecker, createDraftChecker, createArchivedChecker */
11928/***/ (function(module, __webpack_exports__, __webpack_require__) {
11929
11930"use strict";
11931__webpack_require__.r(__webpack_exports__);
11932/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createUpdateEntity", function() { return createUpdateEntity; });
11933/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createDeleteEntity", function() { return createDeleteEntity; });
11934/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createPublishEntity", function() { return createPublishEntity; });
11935/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createUnpublishEntity", function() { return createUnpublishEntity; });
11936/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createArchiveEntity", function() { return createArchiveEntity; });
11937/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createUnarchiveEntity", function() { return createUnarchiveEntity; });
11938/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createPublishedChecker", function() { return createPublishedChecker; });
11939/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createUpdatedChecker", function() { return createUpdatedChecker; });
11940/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createDraftChecker", function() { return createDraftChecker; });
11941/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createArchivedChecker", function() { return createArchivedChecker; });
11942/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
11943/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
11944/* harmony import */ var _error_handler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./error-handler */ "./error-handler.ts");
11945function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
11946
11947function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
11948
11949function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
11950
11951
11952
11953
11954/**
11955 * @private
11956 */
11957function createUpdateEntity(_ref) {
11958 var http = _ref.http,
11959 entityPath = _ref.entityPath,
11960 wrapperMethod = _ref.wrapperMethod,
11961 headers = _ref.headers;
11962 return function () {
11963 var self = this;
11964 var raw = self.toPlainObject();
11965 var data = lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(raw);
11966 delete data.sys;
11967 return http.put(entityPath + '/' + self.sys.id, data, {
11968 headers: _objectSpread({
11969 'X-Contentful-Version': self.sys.version || 0
11970 }, headers)
11971 }).then(function (response) {
11972 return wrapperMethod(http, response.data);
11973 }, _error_handler__WEBPACK_IMPORTED_MODULE_1__["default"]);
11974 };
11975}
11976/**
11977 * @private
11978 */
11979
11980function createDeleteEntity(_ref2) {
11981 var http = _ref2.http,
11982 entityPath = _ref2.entityPath;
11983 return function () {
11984 var self = this;
11985 return http.delete(entityPath + '/' + self.sys.id).then(function () {// do nothing
11986 }, _error_handler__WEBPACK_IMPORTED_MODULE_1__["default"]);
11987 };
11988}
11989/**
11990 * @private
11991 */
11992
11993function createPublishEntity(_ref3) {
11994 var http = _ref3.http,
11995 entityPath = _ref3.entityPath,
11996 wrapperMethod = _ref3.wrapperMethod;
11997 return function () {
11998 var self = this;
11999 return http.put(entityPath + '/' + self.sys.id + '/published', null, {
12000 headers: {
12001 'X-Contentful-Version': self.sys.version
12002 }
12003 }).then(function (response) {
12004 return wrapperMethod(http, response.data);
12005 }, _error_handler__WEBPACK_IMPORTED_MODULE_1__["default"]);
12006 };
12007}
12008/**
12009 * @private
12010 */
12011
12012function createUnpublishEntity(_ref4) {
12013 var http = _ref4.http,
12014 entityPath = _ref4.entityPath,
12015 wrapperMethod = _ref4.wrapperMethod;
12016 return function () {
12017 var self = this;
12018 return http.delete(entityPath + '/' + self.sys.id + '/published').then(function (response) {
12019 return wrapperMethod(http, response.data);
12020 }, _error_handler__WEBPACK_IMPORTED_MODULE_1__["default"]);
12021 };
12022}
12023/**
12024 * @private
12025 */
12026
12027function createArchiveEntity(_ref5) {
12028 var http = _ref5.http,
12029 entityPath = _ref5.entityPath,
12030 wrapperMethod = _ref5.wrapperMethod;
12031 return function () {
12032 var self = this;
12033 return http.put(entityPath + '/' + self.sys.id + '/archived').then(function (response) {
12034 return wrapperMethod(http, response.data);
12035 }, _error_handler__WEBPACK_IMPORTED_MODULE_1__["default"]);
12036 };
12037}
12038/**
12039 * @private
12040 */
12041
12042function createUnarchiveEntity(_ref6) {
12043 var http = _ref6.http,
12044 entityPath = _ref6.entityPath,
12045 wrapperMethod = _ref6.wrapperMethod;
12046 return function () {
12047 var self = this;
12048 return http.delete(entityPath + '/' + self.sys.id + '/archived').then(function (response) {
12049 return wrapperMethod(http, response.data);
12050 }, _error_handler__WEBPACK_IMPORTED_MODULE_1__["default"]);
12051 };
12052}
12053/**
12054 * @private
12055 */
12056
12057function createPublishedChecker() {
12058 return function () {
12059 var self = this;
12060 return !!self.sys.publishedVersion;
12061 };
12062}
12063/**
12064 * @private
12065 */
12066
12067function createUpdatedChecker() {
12068 return function () {
12069 var self = this; // The act of publishing an entity increases its version by 1, so any entry which has
12070 // 2 versions higher or more than the publishedVersion has unpublished changes.
12071
12072 return !!(self.sys.publishedVersion && self.sys.version > self.sys.publishedVersion + 1);
12073 };
12074}
12075/**
12076 * @private
12077 */
12078
12079function createDraftChecker() {
12080 return function () {
12081 var self = this;
12082 return !self.sys.publishedVersion;
12083 };
12084}
12085/**
12086 * @private
12087 */
12088
12089function createArchivedChecker() {
12090 return function () {
12091 var self = this;
12092 return !!self.sys.archivedVersion;
12093 };
12094}
12095
12096/***/ }),
12097
12098/***/ 0:
12099/*!****************************************!*\
12100 !*** multi ./contentful-management.ts ***!
12101 \****************************************/
12102/*! no static exports found */
12103/***/ (function(module, exports, __webpack_require__) {
12104
12105module.exports = __webpack_require__(/*! ./contentful-management.ts */"./contentful-management.ts");
12106
12107
12108/***/ }),
12109
12110/***/ 1:
12111/*!********************!*\
12112 !*** os (ignored) ***!
12113 \********************/
12114/*! no static exports found */
12115/***/ (function(module, exports) {
12116
12117/* (ignored) */
12118
12119/***/ })
12120
12121/******/ });
12122});
12123//# sourceMappingURL=contentful-management.browser.js.map
\No newline at end of file