UNPKG

469 kBJavaScriptView Raw
1module.exports =
2/******/ (function(modules) { // webpackBootstrap
3/******/ // The module cache
4/******/ var installedModules = {};
5/******/
6/******/ // The require function
7/******/ function __webpack_require__(moduleId) {
8/******/
9/******/ // Check if module is in cache
10/******/ if(installedModules[moduleId]) {
11/******/ return installedModules[moduleId].exports;
12/******/ }
13/******/ // Create a new module (and put it into the cache)
14/******/ var module = installedModules[moduleId] = {
15/******/ i: moduleId,
16/******/ l: false,
17/******/ exports: {}
18/******/ };
19/******/
20/******/ // Execute the module function
21/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
22/******/
23/******/ // Flag the module as loaded
24/******/ module.l = true;
25/******/
26/******/ // Return the exports of the module
27/******/ return module.exports;
28/******/ }
29/******/
30/******/
31/******/ // expose the modules object (__webpack_modules__)
32/******/ __webpack_require__.m = modules;
33/******/
34/******/ // expose the module cache
35/******/ __webpack_require__.c = installedModules;
36/******/
37/******/ // define getter function for harmony exports
38/******/ __webpack_require__.d = function(exports, name, getter) {
39/******/ if(!__webpack_require__.o(exports, name)) {
40/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
41/******/ }
42/******/ };
43/******/
44/******/ // define __esModule on exports
45/******/ __webpack_require__.r = function(exports) {
46/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
47/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
48/******/ }
49/******/ Object.defineProperty(exports, '__esModule', { value: true });
50/******/ };
51/******/
52/******/ // create a fake namespace object
53/******/ // mode & 1: value is a module id, require it
54/******/ // mode & 2: merge all properties of value into the ns
55/******/ // mode & 4: return value when already ns object
56/******/ // mode & 8|1: behave like require
57/******/ __webpack_require__.t = function(value, mode) {
58/******/ if(mode & 1) value = __webpack_require__(value);
59/******/ if(mode & 8) return value;
60/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
61/******/ var ns = Object.create(null);
62/******/ __webpack_require__.r(ns);
63/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
64/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
65/******/ return ns;
66/******/ };
67/******/
68/******/ // getDefaultExport function for compatibility with non-harmony modules
69/******/ __webpack_require__.n = function(module) {
70/******/ var getter = module && module.__esModule ?
71/******/ function getDefault() { return module['default']; } :
72/******/ function getModuleExports() { return module; };
73/******/ __webpack_require__.d(getter, 'a', getter);
74/******/ return getter;
75/******/ };
76/******/
77/******/ // Object.prototype.hasOwnProperty.call
78/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
79/******/
80/******/ // __webpack_public_path__
81/******/ __webpack_require__.p = "";
82/******/
83/******/
84/******/ // Load entry module and return exports
85/******/ return __webpack_require__(__webpack_require__.s = 0);
86/******/ })
87/************************************************************************/
88/******/ ({
89
90/***/ "../node_modules/axios/index.js":
91/*!**************************************!*\
92 !*** ../node_modules/axios/index.js ***!
93 \**************************************/
94/*! no static exports found */
95/***/ (function(module, exports, __webpack_require__) {
96
97module.exports = __webpack_require__(/*! ./lib/axios */ "../node_modules/axios/lib/axios.js");
98
99/***/ }),
100
101/***/ "../node_modules/axios/lib/adapters/http.js":
102/*!**************************************************!*\
103 !*** ../node_modules/axios/lib/adapters/http.js ***!
104 \**************************************************/
105/*! no static exports found */
106/***/ (function(module, exports, __webpack_require__) {
107
108"use strict";
109
110
111var utils = __webpack_require__(/*! ./../utils */ "../node_modules/axios/lib/utils.js");
112var settle = __webpack_require__(/*! ./../core/settle */ "../node_modules/axios/lib/core/settle.js");
113var buildFullPath = __webpack_require__(/*! ../core/buildFullPath */ "../node_modules/axios/lib/core/buildFullPath.js");
114var buildURL = __webpack_require__(/*! ./../helpers/buildURL */ "../node_modules/axios/lib/helpers/buildURL.js");
115var http = __webpack_require__(/*! http */ "http");
116var https = __webpack_require__(/*! https */ "https");
117var httpFollow = __webpack_require__(/*! follow-redirects */ "../node_modules/follow-redirects/index.js").http;
118var httpsFollow = __webpack_require__(/*! follow-redirects */ "../node_modules/follow-redirects/index.js").https;
119var url = __webpack_require__(/*! url */ "url");
120var zlib = __webpack_require__(/*! zlib */ "zlib");
121var pkg = __webpack_require__(/*! ./../../package.json */ "../node_modules/axios/package.json");
122var createError = __webpack_require__(/*! ../core/createError */ "../node_modules/axios/lib/core/createError.js");
123var enhanceError = __webpack_require__(/*! ../core/enhanceError */ "../node_modules/axios/lib/core/enhanceError.js");
124
125var isHttps = /https:?/;
126
127/*eslint consistent-return:0*/
128module.exports = function httpAdapter(config) {
129 return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) {
130 var resolve = function resolve(value) {
131 resolvePromise(value);
132 };
133 var reject = function reject(value) {
134 rejectPromise(value);
135 };
136 var data = config.data;
137 var headers = config.headers;
138
139 // Set User-Agent (required by some servers)
140 // Only set header if it hasn't been set in config
141 // See https://github.com/axios/axios/issues/69
142 if (!headers['User-Agent'] && !headers['user-agent']) {
143 headers['User-Agent'] = 'axios/' + pkg.version;
144 }
145
146 if (data && !utils.isStream(data)) {
147 if (Buffer.isBuffer(data)) {
148 // Nothing to do...
149 } else if (utils.isArrayBuffer(data)) {
150 data = Buffer.from(new Uint8Array(data));
151 } else if (utils.isString(data)) {
152 data = Buffer.from(data, 'utf-8');
153 } else {
154 return reject(createError(
155 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream',
156 config
157 ));
158 }
159
160 // Add Content-Length header if data exists
161 headers['Content-Length'] = data.length;
162 }
163
164 // HTTP basic authentication
165 var auth = undefined;
166 if (config.auth) {
167 var username = config.auth.username || '';
168 var password = config.auth.password || '';
169 auth = username + ':' + password;
170 }
171
172 // Parse url
173 var fullPath = buildFullPath(config.baseURL, config.url);
174 var parsed = url.parse(fullPath);
175 var protocol = parsed.protocol || 'http:';
176
177 if (!auth && parsed.auth) {
178 var urlAuth = parsed.auth.split(':');
179 var urlUsername = urlAuth[0] || '';
180 var urlPassword = urlAuth[1] || '';
181 auth = urlUsername + ':' + urlPassword;
182 }
183
184 if (auth) {
185 delete headers.Authorization;
186 }
187
188 var isHttpsRequest = isHttps.test(protocol);
189 var agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;
190
191 var options = {
192 path: buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\?/, ''),
193 method: config.method.toUpperCase(),
194 headers: headers,
195 agent: agent,
196 agents: { http: config.httpAgent, https: config.httpsAgent },
197 auth: auth
198 };
199
200 if (config.socketPath) {
201 options.socketPath = config.socketPath;
202 } else {
203 options.hostname = parsed.hostname;
204 options.port = parsed.port;
205 }
206
207 var proxy = config.proxy;
208 if (!proxy && proxy !== false) {
209 var proxyEnv = protocol.slice(0, -1) + '_proxy';
210 var proxyUrl = process.env[proxyEnv] || process.env[proxyEnv.toUpperCase()];
211 if (proxyUrl) {
212 var parsedProxyUrl = url.parse(proxyUrl);
213 var noProxyEnv = process.env.no_proxy || process.env.NO_PROXY;
214 var shouldProxy = true;
215
216 if (noProxyEnv) {
217 var noProxy = noProxyEnv.split(',').map(function trim(s) {
218 return s.trim();
219 });
220
221 shouldProxy = !noProxy.some(function proxyMatch(proxyElement) {
222 if (!proxyElement) {
223 return false;
224 }
225 if (proxyElement === '*') {
226 return true;
227 }
228 if (proxyElement[0] === '.' &&
229 parsed.hostname.substr(parsed.hostname.length - proxyElement.length) === proxyElement) {
230 return true;
231 }
232
233 return parsed.hostname === proxyElement;
234 });
235 }
236
237
238 if (shouldProxy) {
239 proxy = {
240 host: parsedProxyUrl.hostname,
241 port: parsedProxyUrl.port
242 };
243
244 if (parsedProxyUrl.auth) {
245 var proxyUrlAuth = parsedProxyUrl.auth.split(':');
246 proxy.auth = {
247 username: proxyUrlAuth[0],
248 password: proxyUrlAuth[1]
249 };
250 }
251 }
252 }
253 }
254
255 if (proxy) {
256 options.hostname = proxy.host;
257 options.host = proxy.host;
258 options.headers.host = parsed.hostname + (parsed.port ? ':' + parsed.port : '');
259 options.port = proxy.port;
260 options.path = protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path;
261
262 // Basic proxy authorization
263 if (proxy.auth) {
264 var base64 = Buffer.from(proxy.auth.username + ':' + proxy.auth.password, 'utf8').toString('base64');
265 options.headers['Proxy-Authorization'] = 'Basic ' + base64;
266 }
267 }
268
269 var transport;
270 var isHttpsProxy = isHttpsRequest && (proxy ? isHttps.test(proxy.protocol) : true);
271 if (config.transport) {
272 transport = config.transport;
273 } else if (config.maxRedirects === 0) {
274 transport = isHttpsProxy ? https : http;
275 } else {
276 if (config.maxRedirects) {
277 options.maxRedirects = config.maxRedirects;
278 }
279 transport = isHttpsProxy ? httpsFollow : httpFollow;
280 }
281
282 if (config.maxContentLength && config.maxContentLength > -1) {
283 options.maxBodyLength = config.maxContentLength;
284 }
285
286 // Create the request
287 var req = transport.request(options, function handleResponse(res) {
288 if (req.aborted) return;
289
290 // uncompress the response body transparently if required
291 var stream = res;
292 switch (res.headers['content-encoding']) {
293 /*eslint default-case:0*/
294 case 'gzip':
295 case 'compress':
296 case 'deflate':
297 // add the unzipper to the body stream processing pipeline
298 stream = (res.statusCode === 204) ? stream : stream.pipe(zlib.createUnzip());
299
300 // remove the content-encoding in order to not confuse downstream operations
301 delete res.headers['content-encoding'];
302 break;
303 }
304
305 // return the last request in case of redirects
306 var lastRequest = res.req || req;
307
308 var response = {
309 status: res.statusCode,
310 statusText: res.statusMessage,
311 headers: res.headers,
312 config: config,
313 request: lastRequest
314 };
315
316 if (config.responseType === 'stream') {
317 response.data = stream;
318 settle(resolve, reject, response);
319 } else {
320 var responseBuffer = [];
321 stream.on('data', function handleStreamData(chunk) {
322 responseBuffer.push(chunk);
323
324 // make sure the content length is not over the maxContentLength if specified
325 if (config.maxContentLength > -1 && Buffer.concat(responseBuffer).length > config.maxContentLength) {
326 stream.destroy();
327 reject(createError('maxContentLength size of ' + config.maxContentLength + ' exceeded',
328 config, null, lastRequest));
329 }
330 });
331
332 stream.on('error', function handleStreamError(err) {
333 if (req.aborted) return;
334 reject(enhanceError(err, config, null, lastRequest));
335 });
336
337 stream.on('end', function handleStreamEnd() {
338 var responseData = Buffer.concat(responseBuffer);
339 if (config.responseType !== 'arraybuffer') {
340 responseData = responseData.toString(config.responseEncoding);
341 }
342
343 response.data = responseData;
344 settle(resolve, reject, response);
345 });
346 }
347 });
348
349 // Handle errors
350 req.on('error', function handleRequestError(err) {
351 if (req.aborted) return;
352 reject(enhanceError(err, config, null, req));
353 });
354
355 // Handle request timeout
356 if (config.timeout) {
357 // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system.
358 // And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET.
359 // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up.
360 // And then these socket which be hang up will devoring CPU little by little.
361 // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect.
362 req.setTimeout(config.timeout, function handleRequestTimeout() {
363 req.abort();
364 reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED', req));
365 });
366 }
367
368 if (config.cancelToken) {
369 // Handle cancellation
370 config.cancelToken.promise.then(function onCanceled(cancel) {
371 if (req.aborted) return;
372
373 req.abort();
374 reject(cancel);
375 });
376 }
377
378 // Send the request
379 if (utils.isStream(data)) {
380 data.on('error', function handleStreamError(err) {
381 reject(enhanceError(err, config, null, req));
382 }).pipe(req);
383 } else {
384 req.end(data);
385 }
386 });
387};
388
389
390/***/ }),
391
392/***/ "../node_modules/axios/lib/adapters/xhr.js":
393/*!*************************************************!*\
394 !*** ../node_modules/axios/lib/adapters/xhr.js ***!
395 \*************************************************/
396/*! no static exports found */
397/***/ (function(module, exports, __webpack_require__) {
398
399"use strict";
400
401
402var utils = __webpack_require__(/*! ./../utils */ "../node_modules/axios/lib/utils.js");
403var settle = __webpack_require__(/*! ./../core/settle */ "../node_modules/axios/lib/core/settle.js");
404var buildURL = __webpack_require__(/*! ./../helpers/buildURL */ "../node_modules/axios/lib/helpers/buildURL.js");
405var buildFullPath = __webpack_require__(/*! ../core/buildFullPath */ "../node_modules/axios/lib/core/buildFullPath.js");
406var parseHeaders = __webpack_require__(/*! ./../helpers/parseHeaders */ "../node_modules/axios/lib/helpers/parseHeaders.js");
407var isURLSameOrigin = __webpack_require__(/*! ./../helpers/isURLSameOrigin */ "../node_modules/axios/lib/helpers/isURLSameOrigin.js");
408var createError = __webpack_require__(/*! ../core/createError */ "../node_modules/axios/lib/core/createError.js");
409
410module.exports = function xhrAdapter(config) {
411 return new Promise(function dispatchXhrRequest(resolve, reject) {
412 var requestData = config.data;
413 var requestHeaders = config.headers;
414
415 if (utils.isFormData(requestData)) {
416 delete requestHeaders['Content-Type']; // Let the browser set it
417 }
418
419 var request = new XMLHttpRequest();
420
421 // HTTP basic authentication
422 if (config.auth) {
423 var username = config.auth.username || '';
424 var password = config.auth.password || '';
425 requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
426 }
427
428 var fullPath = buildFullPath(config.baseURL, config.url);
429 request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
430
431 // Set the request timeout in MS
432 request.timeout = config.timeout;
433
434 // Listen for ready state
435 request.onreadystatechange = function handleLoad() {
436 if (!request || request.readyState !== 4) {
437 return;
438 }
439
440 // The request errored out and we didn't get a response, this will be
441 // handled by onerror instead
442 // With one exception: request that using file: protocol, most browsers
443 // will return status as 0 even though it's a successful request
444 if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
445 return;
446 }
447
448 // Prepare the response
449 var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;
450 var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;
451 var response = {
452 data: responseData,
453 status: request.status,
454 statusText: request.statusText,
455 headers: responseHeaders,
456 config: config,
457 request: request
458 };
459
460 settle(resolve, reject, response);
461
462 // Clean up request
463 request = null;
464 };
465
466 // Handle browser request cancellation (as opposed to a manual cancellation)
467 request.onabort = function handleAbort() {
468 if (!request) {
469 return;
470 }
471
472 reject(createError('Request aborted', config, 'ECONNABORTED', request));
473
474 // Clean up request
475 request = null;
476 };
477
478 // Handle low level network errors
479 request.onerror = function handleError() {
480 // Real errors are hidden from us by the browser
481 // onerror should only fire if it's a network error
482 reject(createError('Network Error', config, null, request));
483
484 // Clean up request
485 request = null;
486 };
487
488 // Handle timeout
489 request.ontimeout = function handleTimeout() {
490 var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';
491 if (config.timeoutErrorMessage) {
492 timeoutErrorMessage = config.timeoutErrorMessage;
493 }
494 reject(createError(timeoutErrorMessage, config, 'ECONNABORTED',
495 request));
496
497 // Clean up request
498 request = null;
499 };
500
501 // Add xsrf header
502 // This is only done if running in a standard browser environment.
503 // Specifically not if we're in a web worker, or react-native.
504 if (utils.isStandardBrowserEnv()) {
505 var cookies = __webpack_require__(/*! ./../helpers/cookies */ "../node_modules/axios/lib/helpers/cookies.js");
506
507 // Add xsrf header
508 var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?
509 cookies.read(config.xsrfCookieName) :
510 undefined;
511
512 if (xsrfValue) {
513 requestHeaders[config.xsrfHeaderName] = xsrfValue;
514 }
515 }
516
517 // Add headers to the request
518 if ('setRequestHeader' in request) {
519 utils.forEach(requestHeaders, function setRequestHeader(val, key) {
520 if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {
521 // Remove Content-Type if data is undefined
522 delete requestHeaders[key];
523 } else {
524 // Otherwise add header to the request
525 request.setRequestHeader(key, val);
526 }
527 });
528 }
529
530 // Add withCredentials to request if needed
531 if (!utils.isUndefined(config.withCredentials)) {
532 request.withCredentials = !!config.withCredentials;
533 }
534
535 // Add responseType to request if needed
536 if (config.responseType) {
537 try {
538 request.responseType = config.responseType;
539 } catch (e) {
540 // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.
541 // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.
542 if (config.responseType !== 'json') {
543 throw e;
544 }
545 }
546 }
547
548 // Handle progress if needed
549 if (typeof config.onDownloadProgress === 'function') {
550 request.addEventListener('progress', config.onDownloadProgress);
551 }
552
553 // Not all browsers support upload events
554 if (typeof config.onUploadProgress === 'function' && request.upload) {
555 request.upload.addEventListener('progress', config.onUploadProgress);
556 }
557
558 if (config.cancelToken) {
559 // Handle cancellation
560 config.cancelToken.promise.then(function onCanceled(cancel) {
561 if (!request) {
562 return;
563 }
564
565 request.abort();
566 reject(cancel);
567 // Clean up request
568 request = null;
569 });
570 }
571
572 if (requestData === undefined) {
573 requestData = null;
574 }
575
576 // Send the request
577 request.send(requestData);
578 });
579};
580
581
582/***/ }),
583
584/***/ "../node_modules/axios/lib/axios.js":
585/*!******************************************!*\
586 !*** ../node_modules/axios/lib/axios.js ***!
587 \******************************************/
588/*! no static exports found */
589/***/ (function(module, exports, __webpack_require__) {
590
591"use strict";
592
593
594var utils = __webpack_require__(/*! ./utils */ "../node_modules/axios/lib/utils.js");
595var bind = __webpack_require__(/*! ./helpers/bind */ "../node_modules/axios/lib/helpers/bind.js");
596var Axios = __webpack_require__(/*! ./core/Axios */ "../node_modules/axios/lib/core/Axios.js");
597var mergeConfig = __webpack_require__(/*! ./core/mergeConfig */ "../node_modules/axios/lib/core/mergeConfig.js");
598var defaults = __webpack_require__(/*! ./defaults */ "../node_modules/axios/lib/defaults.js");
599
600/**
601 * Create an instance of Axios
602 *
603 * @param {Object} defaultConfig The default config for the instance
604 * @return {Axios} A new instance of Axios
605 */
606function createInstance(defaultConfig) {
607 var context = new Axios(defaultConfig);
608 var instance = bind(Axios.prototype.request, context);
609
610 // Copy axios.prototype to instance
611 utils.extend(instance, Axios.prototype, context);
612
613 // Copy context to instance
614 utils.extend(instance, context);
615
616 return instance;
617}
618
619// Create the default instance to be exported
620var axios = createInstance(defaults);
621
622// Expose Axios class to allow class inheritance
623axios.Axios = Axios;
624
625// Factory for creating new instances
626axios.create = function create(instanceConfig) {
627 return createInstance(mergeConfig(axios.defaults, instanceConfig));
628};
629
630// Expose Cancel & CancelToken
631axios.Cancel = __webpack_require__(/*! ./cancel/Cancel */ "../node_modules/axios/lib/cancel/Cancel.js");
632axios.CancelToken = __webpack_require__(/*! ./cancel/CancelToken */ "../node_modules/axios/lib/cancel/CancelToken.js");
633axios.isCancel = __webpack_require__(/*! ./cancel/isCancel */ "../node_modules/axios/lib/cancel/isCancel.js");
634
635// Expose all/spread
636axios.all = function all(promises) {
637 return Promise.all(promises);
638};
639axios.spread = __webpack_require__(/*! ./helpers/spread */ "../node_modules/axios/lib/helpers/spread.js");
640
641module.exports = axios;
642
643// Allow use of default import syntax in TypeScript
644module.exports.default = axios;
645
646
647/***/ }),
648
649/***/ "../node_modules/axios/lib/cancel/Cancel.js":
650/*!**************************************************!*\
651 !*** ../node_modules/axios/lib/cancel/Cancel.js ***!
652 \**************************************************/
653/*! no static exports found */
654/***/ (function(module, exports, __webpack_require__) {
655
656"use strict";
657
658
659/**
660 * A `Cancel` is an object that is thrown when an operation is canceled.
661 *
662 * @class
663 * @param {string=} message The message.
664 */
665function Cancel(message) {
666 this.message = message;
667}
668
669Cancel.prototype.toString = function toString() {
670 return 'Cancel' + (this.message ? ': ' + this.message : '');
671};
672
673Cancel.prototype.__CANCEL__ = true;
674
675module.exports = Cancel;
676
677
678/***/ }),
679
680/***/ "../node_modules/axios/lib/cancel/CancelToken.js":
681/*!*******************************************************!*\
682 !*** ../node_modules/axios/lib/cancel/CancelToken.js ***!
683 \*******************************************************/
684/*! no static exports found */
685/***/ (function(module, exports, __webpack_require__) {
686
687"use strict";
688
689
690var Cancel = __webpack_require__(/*! ./Cancel */ "../node_modules/axios/lib/cancel/Cancel.js");
691
692/**
693 * A `CancelToken` is an object that can be used to request cancellation of an operation.
694 *
695 * @class
696 * @param {Function} executor The executor function.
697 */
698function CancelToken(executor) {
699 if (typeof executor !== 'function') {
700 throw new TypeError('executor must be a function.');
701 }
702
703 var resolvePromise;
704 this.promise = new Promise(function promiseExecutor(resolve) {
705 resolvePromise = resolve;
706 });
707
708 var token = this;
709 executor(function cancel(message) {
710 if (token.reason) {
711 // Cancellation has already been requested
712 return;
713 }
714
715 token.reason = new Cancel(message);
716 resolvePromise(token.reason);
717 });
718}
719
720/**
721 * Throws a `Cancel` if cancellation has been requested.
722 */
723CancelToken.prototype.throwIfRequested = function throwIfRequested() {
724 if (this.reason) {
725 throw this.reason;
726 }
727};
728
729/**
730 * Returns an object that contains a new `CancelToken` and a function that, when called,
731 * cancels the `CancelToken`.
732 */
733CancelToken.source = function source() {
734 var cancel;
735 var token = new CancelToken(function executor(c) {
736 cancel = c;
737 });
738 return {
739 token: token,
740 cancel: cancel
741 };
742};
743
744module.exports = CancelToken;
745
746
747/***/ }),
748
749/***/ "../node_modules/axios/lib/cancel/isCancel.js":
750/*!****************************************************!*\
751 !*** ../node_modules/axios/lib/cancel/isCancel.js ***!
752 \****************************************************/
753/*! no static exports found */
754/***/ (function(module, exports, __webpack_require__) {
755
756"use strict";
757
758
759module.exports = function isCancel(value) {
760 return !!(value && value.__CANCEL__);
761};
762
763
764/***/ }),
765
766/***/ "../node_modules/axios/lib/core/Axios.js":
767/*!***********************************************!*\
768 !*** ../node_modules/axios/lib/core/Axios.js ***!
769 \***********************************************/
770/*! no static exports found */
771/***/ (function(module, exports, __webpack_require__) {
772
773"use strict";
774
775
776var utils = __webpack_require__(/*! ./../utils */ "../node_modules/axios/lib/utils.js");
777var buildURL = __webpack_require__(/*! ../helpers/buildURL */ "../node_modules/axios/lib/helpers/buildURL.js");
778var InterceptorManager = __webpack_require__(/*! ./InterceptorManager */ "../node_modules/axios/lib/core/InterceptorManager.js");
779var dispatchRequest = __webpack_require__(/*! ./dispatchRequest */ "../node_modules/axios/lib/core/dispatchRequest.js");
780var mergeConfig = __webpack_require__(/*! ./mergeConfig */ "../node_modules/axios/lib/core/mergeConfig.js");
781
782/**
783 * Create a new instance of Axios
784 *
785 * @param {Object} instanceConfig The default config for the instance
786 */
787function Axios(instanceConfig) {
788 this.defaults = instanceConfig;
789 this.interceptors = {
790 request: new InterceptorManager(),
791 response: new InterceptorManager()
792 };
793}
794
795/**
796 * Dispatch a request
797 *
798 * @param {Object} config The config specific for this request (merged with this.defaults)
799 */
800Axios.prototype.request = function request(config) {
801 /*eslint no-param-reassign:0*/
802 // Allow for axios('example/url'[, config]) a la fetch API
803 if (typeof config === 'string') {
804 config = arguments[1] || {};
805 config.url = arguments[0];
806 } else {
807 config = config || {};
808 }
809
810 config = mergeConfig(this.defaults, config);
811
812 // Set config.method
813 if (config.method) {
814 config.method = config.method.toLowerCase();
815 } else if (this.defaults.method) {
816 config.method = this.defaults.method.toLowerCase();
817 } else {
818 config.method = 'get';
819 }
820
821 // Hook up interceptors middleware
822 var chain = [dispatchRequest, undefined];
823 var promise = Promise.resolve(config);
824
825 this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
826 chain.unshift(interceptor.fulfilled, interceptor.rejected);
827 });
828
829 this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
830 chain.push(interceptor.fulfilled, interceptor.rejected);
831 });
832
833 while (chain.length) {
834 promise = promise.then(chain.shift(), chain.shift());
835 }
836
837 return promise;
838};
839
840Axios.prototype.getUri = function getUri(config) {
841 config = mergeConfig(this.defaults, config);
842 return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, '');
843};
844
845// Provide aliases for supported request methods
846utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
847 /*eslint func-names:0*/
848 Axios.prototype[method] = function(url, config) {
849 return this.request(utils.merge(config || {}, {
850 method: method,
851 url: url
852 }));
853 };
854});
855
856utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
857 /*eslint func-names:0*/
858 Axios.prototype[method] = function(url, data, config) {
859 return this.request(utils.merge(config || {}, {
860 method: method,
861 url: url,
862 data: data
863 }));
864 };
865});
866
867module.exports = Axios;
868
869
870/***/ }),
871
872/***/ "../node_modules/axios/lib/core/InterceptorManager.js":
873/*!************************************************************!*\
874 !*** ../node_modules/axios/lib/core/InterceptorManager.js ***!
875 \************************************************************/
876/*! no static exports found */
877/***/ (function(module, exports, __webpack_require__) {
878
879"use strict";
880
881
882var utils = __webpack_require__(/*! ./../utils */ "../node_modules/axios/lib/utils.js");
883
884function InterceptorManager() {
885 this.handlers = [];
886}
887
888/**
889 * Add a new interceptor to the stack
890 *
891 * @param {Function} fulfilled The function to handle `then` for a `Promise`
892 * @param {Function} rejected The function to handle `reject` for a `Promise`
893 *
894 * @return {Number} An ID used to remove interceptor later
895 */
896InterceptorManager.prototype.use = function use(fulfilled, rejected) {
897 this.handlers.push({
898 fulfilled: fulfilled,
899 rejected: rejected
900 });
901 return this.handlers.length - 1;
902};
903
904/**
905 * Remove an interceptor from the stack
906 *
907 * @param {Number} id The ID that was returned by `use`
908 */
909InterceptorManager.prototype.eject = function eject(id) {
910 if (this.handlers[id]) {
911 this.handlers[id] = null;
912 }
913};
914
915/**
916 * Iterate over all the registered interceptors
917 *
918 * This method is particularly useful for skipping over any
919 * interceptors that may have become `null` calling `eject`.
920 *
921 * @param {Function} fn The function to call for each interceptor
922 */
923InterceptorManager.prototype.forEach = function forEach(fn) {
924 utils.forEach(this.handlers, function forEachHandler(h) {
925 if (h !== null) {
926 fn(h);
927 }
928 });
929};
930
931module.exports = InterceptorManager;
932
933
934/***/ }),
935
936/***/ "../node_modules/axios/lib/core/buildFullPath.js":
937/*!*******************************************************!*\
938 !*** ../node_modules/axios/lib/core/buildFullPath.js ***!
939 \*******************************************************/
940/*! no static exports found */
941/***/ (function(module, exports, __webpack_require__) {
942
943"use strict";
944
945
946var isAbsoluteURL = __webpack_require__(/*! ../helpers/isAbsoluteURL */ "../node_modules/axios/lib/helpers/isAbsoluteURL.js");
947var combineURLs = __webpack_require__(/*! ../helpers/combineURLs */ "../node_modules/axios/lib/helpers/combineURLs.js");
948
949/**
950 * Creates a new URL by combining the baseURL with the requestedURL,
951 * only when the requestedURL is not already an absolute URL.
952 * If the requestURL is absolute, this function returns the requestedURL untouched.
953 *
954 * @param {string} baseURL The base URL
955 * @param {string} requestedURL Absolute or relative URL to combine
956 * @returns {string} The combined full path
957 */
958module.exports = function buildFullPath(baseURL, requestedURL) {
959 if (baseURL && !isAbsoluteURL(requestedURL)) {
960 return combineURLs(baseURL, requestedURL);
961 }
962 return requestedURL;
963};
964
965
966/***/ }),
967
968/***/ "../node_modules/axios/lib/core/createError.js":
969/*!*****************************************************!*\
970 !*** ../node_modules/axios/lib/core/createError.js ***!
971 \*****************************************************/
972/*! no static exports found */
973/***/ (function(module, exports, __webpack_require__) {
974
975"use strict";
976
977
978var enhanceError = __webpack_require__(/*! ./enhanceError */ "../node_modules/axios/lib/core/enhanceError.js");
979
980/**
981 * Create an Error with the specified message, config, error code, request and response.
982 *
983 * @param {string} message The error message.
984 * @param {Object} config The config.
985 * @param {string} [code] The error code (for example, 'ECONNABORTED').
986 * @param {Object} [request] The request.
987 * @param {Object} [response] The response.
988 * @returns {Error} The created error.
989 */
990module.exports = function createError(message, config, code, request, response) {
991 var error = new Error(message);
992 return enhanceError(error, config, code, request, response);
993};
994
995
996/***/ }),
997
998/***/ "../node_modules/axios/lib/core/dispatchRequest.js":
999/*!*********************************************************!*\
1000 !*** ../node_modules/axios/lib/core/dispatchRequest.js ***!
1001 \*********************************************************/
1002/*! no static exports found */
1003/***/ (function(module, exports, __webpack_require__) {
1004
1005"use strict";
1006
1007
1008var utils = __webpack_require__(/*! ./../utils */ "../node_modules/axios/lib/utils.js");
1009var transformData = __webpack_require__(/*! ./transformData */ "../node_modules/axios/lib/core/transformData.js");
1010var isCancel = __webpack_require__(/*! ../cancel/isCancel */ "../node_modules/axios/lib/cancel/isCancel.js");
1011var defaults = __webpack_require__(/*! ../defaults */ "../node_modules/axios/lib/defaults.js");
1012
1013/**
1014 * Throws a `Cancel` if cancellation has been requested.
1015 */
1016function throwIfCancellationRequested(config) {
1017 if (config.cancelToken) {
1018 config.cancelToken.throwIfRequested();
1019 }
1020}
1021
1022/**
1023 * Dispatch a request to the server using the configured adapter.
1024 *
1025 * @param {object} config The config that is to be used for the request
1026 * @returns {Promise} The Promise to be fulfilled
1027 */
1028module.exports = function dispatchRequest(config) {
1029 throwIfCancellationRequested(config);
1030
1031 // Ensure headers exist
1032 config.headers = config.headers || {};
1033
1034 // Transform request data
1035 config.data = transformData(
1036 config.data,
1037 config.headers,
1038 config.transformRequest
1039 );
1040
1041 // Flatten headers
1042 config.headers = utils.merge(
1043 config.headers.common || {},
1044 config.headers[config.method] || {},
1045 config.headers
1046 );
1047
1048 utils.forEach(
1049 ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
1050 function cleanHeaderConfig(method) {
1051 delete config.headers[method];
1052 }
1053 );
1054
1055 var adapter = config.adapter || defaults.adapter;
1056
1057 return adapter(config).then(function onAdapterResolution(response) {
1058 throwIfCancellationRequested(config);
1059
1060 // Transform response data
1061 response.data = transformData(
1062 response.data,
1063 response.headers,
1064 config.transformResponse
1065 );
1066
1067 return response;
1068 }, function onAdapterRejection(reason) {
1069 if (!isCancel(reason)) {
1070 throwIfCancellationRequested(config);
1071
1072 // Transform response data
1073 if (reason && reason.response) {
1074 reason.response.data = transformData(
1075 reason.response.data,
1076 reason.response.headers,
1077 config.transformResponse
1078 );
1079 }
1080 }
1081
1082 return Promise.reject(reason);
1083 });
1084};
1085
1086
1087/***/ }),
1088
1089/***/ "../node_modules/axios/lib/core/enhanceError.js":
1090/*!******************************************************!*\
1091 !*** ../node_modules/axios/lib/core/enhanceError.js ***!
1092 \******************************************************/
1093/*! no static exports found */
1094/***/ (function(module, exports, __webpack_require__) {
1095
1096"use strict";
1097
1098
1099/**
1100 * Update an Error with the specified config, error code, and response.
1101 *
1102 * @param {Error} error The error to update.
1103 * @param {Object} config The config.
1104 * @param {string} [code] The error code (for example, 'ECONNABORTED').
1105 * @param {Object} [request] The request.
1106 * @param {Object} [response] The response.
1107 * @returns {Error} The error.
1108 */
1109module.exports = function enhanceError(error, config, code, request, response) {
1110 error.config = config;
1111 if (code) {
1112 error.code = code;
1113 }
1114
1115 error.request = request;
1116 error.response = response;
1117 error.isAxiosError = true;
1118
1119 error.toJSON = function() {
1120 return {
1121 // Standard
1122 message: this.message,
1123 name: this.name,
1124 // Microsoft
1125 description: this.description,
1126 number: this.number,
1127 // Mozilla
1128 fileName: this.fileName,
1129 lineNumber: this.lineNumber,
1130 columnNumber: this.columnNumber,
1131 stack: this.stack,
1132 // Axios
1133 config: this.config,
1134 code: this.code
1135 };
1136 };
1137 return error;
1138};
1139
1140
1141/***/ }),
1142
1143/***/ "../node_modules/axios/lib/core/mergeConfig.js":
1144/*!*****************************************************!*\
1145 !*** ../node_modules/axios/lib/core/mergeConfig.js ***!
1146 \*****************************************************/
1147/*! no static exports found */
1148/***/ (function(module, exports, __webpack_require__) {
1149
1150"use strict";
1151
1152
1153var utils = __webpack_require__(/*! ../utils */ "../node_modules/axios/lib/utils.js");
1154
1155/**
1156 * Config-specific merge-function which creates a new config-object
1157 * by merging two configuration objects together.
1158 *
1159 * @param {Object} config1
1160 * @param {Object} config2
1161 * @returns {Object} New object resulting from merging config2 to config1
1162 */
1163module.exports = function mergeConfig(config1, config2) {
1164 // eslint-disable-next-line no-param-reassign
1165 config2 = config2 || {};
1166 var config = {};
1167
1168 var valueFromConfig2Keys = ['url', 'method', 'params', 'data'];
1169 var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy'];
1170 var defaultToConfig2Keys = [
1171 'baseURL', 'url', 'transformRequest', 'transformResponse', 'paramsSerializer',
1172 'timeout', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',
1173 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress',
1174 'maxContentLength', 'validateStatus', 'maxRedirects', 'httpAgent',
1175 'httpsAgent', 'cancelToken', 'socketPath'
1176 ];
1177
1178 utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {
1179 if (typeof config2[prop] !== 'undefined') {
1180 config[prop] = config2[prop];
1181 }
1182 });
1183
1184 utils.forEach(mergeDeepPropertiesKeys, function mergeDeepProperties(prop) {
1185 if (utils.isObject(config2[prop])) {
1186 config[prop] = utils.deepMerge(config1[prop], config2[prop]);
1187 } else if (typeof config2[prop] !== 'undefined') {
1188 config[prop] = config2[prop];
1189 } else if (utils.isObject(config1[prop])) {
1190 config[prop] = utils.deepMerge(config1[prop]);
1191 } else if (typeof config1[prop] !== 'undefined') {
1192 config[prop] = config1[prop];
1193 }
1194 });
1195
1196 utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {
1197 if (typeof config2[prop] !== 'undefined') {
1198 config[prop] = config2[prop];
1199 } else if (typeof config1[prop] !== 'undefined') {
1200 config[prop] = config1[prop];
1201 }
1202 });
1203
1204 var axiosKeys = valueFromConfig2Keys
1205 .concat(mergeDeepPropertiesKeys)
1206 .concat(defaultToConfig2Keys);
1207
1208 var otherKeys = Object
1209 .keys(config2)
1210 .filter(function filterAxiosKeys(key) {
1211 return axiosKeys.indexOf(key) === -1;
1212 });
1213
1214 utils.forEach(otherKeys, function otherKeysDefaultToConfig2(prop) {
1215 if (typeof config2[prop] !== 'undefined') {
1216 config[prop] = config2[prop];
1217 } else if (typeof config1[prop] !== 'undefined') {
1218 config[prop] = config1[prop];
1219 }
1220 });
1221
1222 return config;
1223};
1224
1225
1226/***/ }),
1227
1228/***/ "../node_modules/axios/lib/core/settle.js":
1229/*!************************************************!*\
1230 !*** ../node_modules/axios/lib/core/settle.js ***!
1231 \************************************************/
1232/*! no static exports found */
1233/***/ (function(module, exports, __webpack_require__) {
1234
1235"use strict";
1236
1237
1238var createError = __webpack_require__(/*! ./createError */ "../node_modules/axios/lib/core/createError.js");
1239
1240/**
1241 * Resolve or reject a Promise based on response status.
1242 *
1243 * @param {Function} resolve A function that resolves the promise.
1244 * @param {Function} reject A function that rejects the promise.
1245 * @param {object} response The response.
1246 */
1247module.exports = function settle(resolve, reject, response) {
1248 var validateStatus = response.config.validateStatus;
1249 if (!validateStatus || validateStatus(response.status)) {
1250 resolve(response);
1251 } else {
1252 reject(createError(
1253 'Request failed with status code ' + response.status,
1254 response.config,
1255 null,
1256 response.request,
1257 response
1258 ));
1259 }
1260};
1261
1262
1263/***/ }),
1264
1265/***/ "../node_modules/axios/lib/core/transformData.js":
1266/*!*******************************************************!*\
1267 !*** ../node_modules/axios/lib/core/transformData.js ***!
1268 \*******************************************************/
1269/*! no static exports found */
1270/***/ (function(module, exports, __webpack_require__) {
1271
1272"use strict";
1273
1274
1275var utils = __webpack_require__(/*! ./../utils */ "../node_modules/axios/lib/utils.js");
1276
1277/**
1278 * Transform the data for a request or a response
1279 *
1280 * @param {Object|String} data The data to be transformed
1281 * @param {Array} headers The headers for the request or response
1282 * @param {Array|Function} fns A single function or Array of functions
1283 * @returns {*} The resulting transformed data
1284 */
1285module.exports = function transformData(data, headers, fns) {
1286 /*eslint no-param-reassign:0*/
1287 utils.forEach(fns, function transform(fn) {
1288 data = fn(data, headers);
1289 });
1290
1291 return data;
1292};
1293
1294
1295/***/ }),
1296
1297/***/ "../node_modules/axios/lib/defaults.js":
1298/*!*********************************************!*\
1299 !*** ../node_modules/axios/lib/defaults.js ***!
1300 \*********************************************/
1301/*! no static exports found */
1302/***/ (function(module, exports, __webpack_require__) {
1303
1304"use strict";
1305
1306
1307var utils = __webpack_require__(/*! ./utils */ "../node_modules/axios/lib/utils.js");
1308var normalizeHeaderName = __webpack_require__(/*! ./helpers/normalizeHeaderName */ "../node_modules/axios/lib/helpers/normalizeHeaderName.js");
1309
1310var DEFAULT_CONTENT_TYPE = {
1311 'Content-Type': 'application/x-www-form-urlencoded'
1312};
1313
1314function setContentTypeIfUnset(headers, value) {
1315 if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {
1316 headers['Content-Type'] = value;
1317 }
1318}
1319
1320function getDefaultAdapter() {
1321 var adapter;
1322 if (typeof XMLHttpRequest !== 'undefined') {
1323 // For browsers use XHR adapter
1324 adapter = __webpack_require__(/*! ./adapters/xhr */ "../node_modules/axios/lib/adapters/xhr.js");
1325 } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {
1326 // For node use HTTP adapter
1327 adapter = __webpack_require__(/*! ./adapters/http */ "../node_modules/axios/lib/adapters/http.js");
1328 }
1329 return adapter;
1330}
1331
1332var defaults = {
1333 adapter: getDefaultAdapter(),
1334
1335 transformRequest: [function transformRequest(data, headers) {
1336 normalizeHeaderName(headers, 'Accept');
1337 normalizeHeaderName(headers, 'Content-Type');
1338 if (utils.isFormData(data) ||
1339 utils.isArrayBuffer(data) ||
1340 utils.isBuffer(data) ||
1341 utils.isStream(data) ||
1342 utils.isFile(data) ||
1343 utils.isBlob(data)
1344 ) {
1345 return data;
1346 }
1347 if (utils.isArrayBufferView(data)) {
1348 return data.buffer;
1349 }
1350 if (utils.isURLSearchParams(data)) {
1351 setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
1352 return data.toString();
1353 }
1354 if (utils.isObject(data)) {
1355 setContentTypeIfUnset(headers, 'application/json;charset=utf-8');
1356 return JSON.stringify(data);
1357 }
1358 return data;
1359 }],
1360
1361 transformResponse: [function transformResponse(data) {
1362 /*eslint no-param-reassign:0*/
1363 if (typeof data === 'string') {
1364 try {
1365 data = JSON.parse(data);
1366 } catch (e) { /* Ignore */ }
1367 }
1368 return data;
1369 }],
1370
1371 /**
1372 * A timeout in milliseconds to abort a request. If set to 0 (default) a
1373 * timeout is not created.
1374 */
1375 timeout: 0,
1376
1377 xsrfCookieName: 'XSRF-TOKEN',
1378 xsrfHeaderName: 'X-XSRF-TOKEN',
1379
1380 maxContentLength: -1,
1381
1382 validateStatus: function validateStatus(status) {
1383 return status >= 200 && status < 300;
1384 }
1385};
1386
1387defaults.headers = {
1388 common: {
1389 'Accept': 'application/json, text/plain, */*'
1390 }
1391};
1392
1393utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
1394 defaults.headers[method] = {};
1395});
1396
1397utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
1398 defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
1399});
1400
1401module.exports = defaults;
1402
1403
1404/***/ }),
1405
1406/***/ "../node_modules/axios/lib/helpers/bind.js":
1407/*!*************************************************!*\
1408 !*** ../node_modules/axios/lib/helpers/bind.js ***!
1409 \*************************************************/
1410/*! no static exports found */
1411/***/ (function(module, exports, __webpack_require__) {
1412
1413"use strict";
1414
1415
1416module.exports = function bind(fn, thisArg) {
1417 return function wrap() {
1418 var args = new Array(arguments.length);
1419 for (var i = 0; i < args.length; i++) {
1420 args[i] = arguments[i];
1421 }
1422 return fn.apply(thisArg, args);
1423 };
1424};
1425
1426
1427/***/ }),
1428
1429/***/ "../node_modules/axios/lib/helpers/buildURL.js":
1430/*!*****************************************************!*\
1431 !*** ../node_modules/axios/lib/helpers/buildURL.js ***!
1432 \*****************************************************/
1433/*! no static exports found */
1434/***/ (function(module, exports, __webpack_require__) {
1435
1436"use strict";
1437
1438
1439var utils = __webpack_require__(/*! ./../utils */ "../node_modules/axios/lib/utils.js");
1440
1441function encode(val) {
1442 return encodeURIComponent(val).
1443 replace(/%40/gi, '@').
1444 replace(/%3A/gi, ':').
1445 replace(/%24/g, '$').
1446 replace(/%2C/gi, ',').
1447 replace(/%20/g, '+').
1448 replace(/%5B/gi, '[').
1449 replace(/%5D/gi, ']');
1450}
1451
1452/**
1453 * Build a URL by appending params to the end
1454 *
1455 * @param {string} url The base of the url (e.g., http://www.google.com)
1456 * @param {object} [params] The params to be appended
1457 * @returns {string} The formatted url
1458 */
1459module.exports = function buildURL(url, params, paramsSerializer) {
1460 /*eslint no-param-reassign:0*/
1461 if (!params) {
1462 return url;
1463 }
1464
1465 var serializedParams;
1466 if (paramsSerializer) {
1467 serializedParams = paramsSerializer(params);
1468 } else if (utils.isURLSearchParams(params)) {
1469 serializedParams = params.toString();
1470 } else {
1471 var parts = [];
1472
1473 utils.forEach(params, function serialize(val, key) {
1474 if (val === null || typeof val === 'undefined') {
1475 return;
1476 }
1477
1478 if (utils.isArray(val)) {
1479 key = key + '[]';
1480 } else {
1481 val = [val];
1482 }
1483
1484 utils.forEach(val, function parseValue(v) {
1485 if (utils.isDate(v)) {
1486 v = v.toISOString();
1487 } else if (utils.isObject(v)) {
1488 v = JSON.stringify(v);
1489 }
1490 parts.push(encode(key) + '=' + encode(v));
1491 });
1492 });
1493
1494 serializedParams = parts.join('&');
1495 }
1496
1497 if (serializedParams) {
1498 var hashmarkIndex = url.indexOf('#');
1499 if (hashmarkIndex !== -1) {
1500 url = url.slice(0, hashmarkIndex);
1501 }
1502
1503 url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
1504 }
1505
1506 return url;
1507};
1508
1509
1510/***/ }),
1511
1512/***/ "../node_modules/axios/lib/helpers/combineURLs.js":
1513/*!********************************************************!*\
1514 !*** ../node_modules/axios/lib/helpers/combineURLs.js ***!
1515 \********************************************************/
1516/*! no static exports found */
1517/***/ (function(module, exports, __webpack_require__) {
1518
1519"use strict";
1520
1521
1522/**
1523 * Creates a new URL by combining the specified URLs
1524 *
1525 * @param {string} baseURL The base URL
1526 * @param {string} relativeURL The relative URL
1527 * @returns {string} The combined URL
1528 */
1529module.exports = function combineURLs(baseURL, relativeURL) {
1530 return relativeURL
1531 ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
1532 : baseURL;
1533};
1534
1535
1536/***/ }),
1537
1538/***/ "../node_modules/axios/lib/helpers/cookies.js":
1539/*!****************************************************!*\
1540 !*** ../node_modules/axios/lib/helpers/cookies.js ***!
1541 \****************************************************/
1542/*! no static exports found */
1543/***/ (function(module, exports, __webpack_require__) {
1544
1545"use strict";
1546
1547
1548var utils = __webpack_require__(/*! ./../utils */ "../node_modules/axios/lib/utils.js");
1549
1550module.exports = (
1551 utils.isStandardBrowserEnv() ?
1552
1553 // Standard browser envs support document.cookie
1554 (function standardBrowserEnv() {
1555 return {
1556 write: function write(name, value, expires, path, domain, secure) {
1557 var cookie = [];
1558 cookie.push(name + '=' + encodeURIComponent(value));
1559
1560 if (utils.isNumber(expires)) {
1561 cookie.push('expires=' + new Date(expires).toGMTString());
1562 }
1563
1564 if (utils.isString(path)) {
1565 cookie.push('path=' + path);
1566 }
1567
1568 if (utils.isString(domain)) {
1569 cookie.push('domain=' + domain);
1570 }
1571
1572 if (secure === true) {
1573 cookie.push('secure');
1574 }
1575
1576 document.cookie = cookie.join('; ');
1577 },
1578
1579 read: function read(name) {
1580 var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
1581 return (match ? decodeURIComponent(match[3]) : null);
1582 },
1583
1584 remove: function remove(name) {
1585 this.write(name, '', Date.now() - 86400000);
1586 }
1587 };
1588 })() :
1589
1590 // Non standard browser env (web workers, react-native) lack needed support.
1591 (function nonStandardBrowserEnv() {
1592 return {
1593 write: function write() {},
1594 read: function read() { return null; },
1595 remove: function remove() {}
1596 };
1597 })()
1598);
1599
1600
1601/***/ }),
1602
1603/***/ "../node_modules/axios/lib/helpers/isAbsoluteURL.js":
1604/*!**********************************************************!*\
1605 !*** ../node_modules/axios/lib/helpers/isAbsoluteURL.js ***!
1606 \**********************************************************/
1607/*! no static exports found */
1608/***/ (function(module, exports, __webpack_require__) {
1609
1610"use strict";
1611
1612
1613/**
1614 * Determines whether the specified URL is absolute
1615 *
1616 * @param {string} url The URL to test
1617 * @returns {boolean} True if the specified URL is absolute, otherwise false
1618 */
1619module.exports = function isAbsoluteURL(url) {
1620 // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
1621 // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
1622 // by any combination of letters, digits, plus, period, or hyphen.
1623 return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
1624};
1625
1626
1627/***/ }),
1628
1629/***/ "../node_modules/axios/lib/helpers/isURLSameOrigin.js":
1630/*!************************************************************!*\
1631 !*** ../node_modules/axios/lib/helpers/isURLSameOrigin.js ***!
1632 \************************************************************/
1633/*! no static exports found */
1634/***/ (function(module, exports, __webpack_require__) {
1635
1636"use strict";
1637
1638
1639var utils = __webpack_require__(/*! ./../utils */ "../node_modules/axios/lib/utils.js");
1640
1641module.exports = (
1642 utils.isStandardBrowserEnv() ?
1643
1644 // Standard browser envs have full support of the APIs needed to test
1645 // whether the request URL is of the same origin as current location.
1646 (function standardBrowserEnv() {
1647 var msie = /(msie|trident)/i.test(navigator.userAgent);
1648 var urlParsingNode = document.createElement('a');
1649 var originURL;
1650
1651 /**
1652 * Parse a URL to discover it's components
1653 *
1654 * @param {String} url The URL to be parsed
1655 * @returns {Object}
1656 */
1657 function resolveURL(url) {
1658 var href = url;
1659
1660 if (msie) {
1661 // IE needs attribute set twice to normalize properties
1662 urlParsingNode.setAttribute('href', href);
1663 href = urlParsingNode.href;
1664 }
1665
1666 urlParsingNode.setAttribute('href', href);
1667
1668 // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
1669 return {
1670 href: urlParsingNode.href,
1671 protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
1672 host: urlParsingNode.host,
1673 search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
1674 hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
1675 hostname: urlParsingNode.hostname,
1676 port: urlParsingNode.port,
1677 pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
1678 urlParsingNode.pathname :
1679 '/' + urlParsingNode.pathname
1680 };
1681 }
1682
1683 originURL = resolveURL(window.location.href);
1684
1685 /**
1686 * Determine if a URL shares the same origin as the current location
1687 *
1688 * @param {String} requestURL The URL to test
1689 * @returns {boolean} True if URL shares the same origin, otherwise false
1690 */
1691 return function isURLSameOrigin(requestURL) {
1692 var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
1693 return (parsed.protocol === originURL.protocol &&
1694 parsed.host === originURL.host);
1695 };
1696 })() :
1697
1698 // Non standard browser envs (web workers, react-native) lack needed support.
1699 (function nonStandardBrowserEnv() {
1700 return function isURLSameOrigin() {
1701 return true;
1702 };
1703 })()
1704);
1705
1706
1707/***/ }),
1708
1709/***/ "../node_modules/axios/lib/helpers/normalizeHeaderName.js":
1710/*!****************************************************************!*\
1711 !*** ../node_modules/axios/lib/helpers/normalizeHeaderName.js ***!
1712 \****************************************************************/
1713/*! no static exports found */
1714/***/ (function(module, exports, __webpack_require__) {
1715
1716"use strict";
1717
1718
1719var utils = __webpack_require__(/*! ../utils */ "../node_modules/axios/lib/utils.js");
1720
1721module.exports = function normalizeHeaderName(headers, normalizedName) {
1722 utils.forEach(headers, function processHeader(value, name) {
1723 if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
1724 headers[normalizedName] = value;
1725 delete headers[name];
1726 }
1727 });
1728};
1729
1730
1731/***/ }),
1732
1733/***/ "../node_modules/axios/lib/helpers/parseHeaders.js":
1734/*!*********************************************************!*\
1735 !*** ../node_modules/axios/lib/helpers/parseHeaders.js ***!
1736 \*********************************************************/
1737/*! no static exports found */
1738/***/ (function(module, exports, __webpack_require__) {
1739
1740"use strict";
1741
1742
1743var utils = __webpack_require__(/*! ./../utils */ "../node_modules/axios/lib/utils.js");
1744
1745// Headers whose duplicates are ignored by node
1746// c.f. https://nodejs.org/api/http.html#http_message_headers
1747var ignoreDuplicateOf = [
1748 'age', 'authorization', 'content-length', 'content-type', 'etag',
1749 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
1750 'last-modified', 'location', 'max-forwards', 'proxy-authorization',
1751 'referer', 'retry-after', 'user-agent'
1752];
1753
1754/**
1755 * Parse headers into an object
1756 *
1757 * ```
1758 * Date: Wed, 27 Aug 2014 08:58:49 GMT
1759 * Content-Type: application/json
1760 * Connection: keep-alive
1761 * Transfer-Encoding: chunked
1762 * ```
1763 *
1764 * @param {String} headers Headers needing to be parsed
1765 * @returns {Object} Headers parsed into an object
1766 */
1767module.exports = function parseHeaders(headers) {
1768 var parsed = {};
1769 var key;
1770 var val;
1771 var i;
1772
1773 if (!headers) { return parsed; }
1774
1775 utils.forEach(headers.split('\n'), function parser(line) {
1776 i = line.indexOf(':');
1777 key = utils.trim(line.substr(0, i)).toLowerCase();
1778 val = utils.trim(line.substr(i + 1));
1779
1780 if (key) {
1781 if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
1782 return;
1783 }
1784 if (key === 'set-cookie') {
1785 parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
1786 } else {
1787 parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
1788 }
1789 }
1790 });
1791
1792 return parsed;
1793};
1794
1795
1796/***/ }),
1797
1798/***/ "../node_modules/axios/lib/helpers/spread.js":
1799/*!***************************************************!*\
1800 !*** ../node_modules/axios/lib/helpers/spread.js ***!
1801 \***************************************************/
1802/*! no static exports found */
1803/***/ (function(module, exports, __webpack_require__) {
1804
1805"use strict";
1806
1807
1808/**
1809 * Syntactic sugar for invoking a function and expanding an array for arguments.
1810 *
1811 * Common use case would be to use `Function.prototype.apply`.
1812 *
1813 * ```js
1814 * function f(x, y, z) {}
1815 * var args = [1, 2, 3];
1816 * f.apply(null, args);
1817 * ```
1818 *
1819 * With `spread` this example can be re-written.
1820 *
1821 * ```js
1822 * spread(function(x, y, z) {})([1, 2, 3]);
1823 * ```
1824 *
1825 * @param {Function} callback
1826 * @returns {Function}
1827 */
1828module.exports = function spread(callback) {
1829 return function wrap(arr) {
1830 return callback.apply(null, arr);
1831 };
1832};
1833
1834
1835/***/ }),
1836
1837/***/ "../node_modules/axios/lib/utils.js":
1838/*!******************************************!*\
1839 !*** ../node_modules/axios/lib/utils.js ***!
1840 \******************************************/
1841/*! no static exports found */
1842/***/ (function(module, exports, __webpack_require__) {
1843
1844"use strict";
1845
1846
1847var bind = __webpack_require__(/*! ./helpers/bind */ "../node_modules/axios/lib/helpers/bind.js");
1848
1849/*global toString:true*/
1850
1851// utils is a library of generic helper functions non-specific to axios
1852
1853var toString = Object.prototype.toString;
1854
1855/**
1856 * Determine if a value is an Array
1857 *
1858 * @param {Object} val The value to test
1859 * @returns {boolean} True if value is an Array, otherwise false
1860 */
1861function isArray(val) {
1862 return toString.call(val) === '[object Array]';
1863}
1864
1865/**
1866 * Determine if a value is undefined
1867 *
1868 * @param {Object} val The value to test
1869 * @returns {boolean} True if the value is undefined, otherwise false
1870 */
1871function isUndefined(val) {
1872 return typeof val === 'undefined';
1873}
1874
1875/**
1876 * Determine if a value is a Buffer
1877 *
1878 * @param {Object} val The value to test
1879 * @returns {boolean} True if value is a Buffer, otherwise false
1880 */
1881function isBuffer(val) {
1882 return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
1883 && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);
1884}
1885
1886/**
1887 * Determine if a value is an ArrayBuffer
1888 *
1889 * @param {Object} val The value to test
1890 * @returns {boolean} True if value is an ArrayBuffer, otherwise false
1891 */
1892function isArrayBuffer(val) {
1893 return toString.call(val) === '[object ArrayBuffer]';
1894}
1895
1896/**
1897 * Determine if a value is a FormData
1898 *
1899 * @param {Object} val The value to test
1900 * @returns {boolean} True if value is an FormData, otherwise false
1901 */
1902function isFormData(val) {
1903 return (typeof FormData !== 'undefined') && (val instanceof FormData);
1904}
1905
1906/**
1907 * Determine if a value is a view on an ArrayBuffer
1908 *
1909 * @param {Object} val The value to test
1910 * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
1911 */
1912function isArrayBufferView(val) {
1913 var result;
1914 if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
1915 result = ArrayBuffer.isView(val);
1916 } else {
1917 result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);
1918 }
1919 return result;
1920}
1921
1922/**
1923 * Determine if a value is a String
1924 *
1925 * @param {Object} val The value to test
1926 * @returns {boolean} True if value is a String, otherwise false
1927 */
1928function isString(val) {
1929 return typeof val === 'string';
1930}
1931
1932/**
1933 * Determine if a value is a Number
1934 *
1935 * @param {Object} val The value to test
1936 * @returns {boolean} True if value is a Number, otherwise false
1937 */
1938function isNumber(val) {
1939 return typeof val === 'number';
1940}
1941
1942/**
1943 * Determine if a value is an Object
1944 *
1945 * @param {Object} val The value to test
1946 * @returns {boolean} True if value is an Object, otherwise false
1947 */
1948function isObject(val) {
1949 return val !== null && typeof val === 'object';
1950}
1951
1952/**
1953 * Determine if a value is a Date
1954 *
1955 * @param {Object} val The value to test
1956 * @returns {boolean} True if value is a Date, otherwise false
1957 */
1958function isDate(val) {
1959 return toString.call(val) === '[object Date]';
1960}
1961
1962/**
1963 * Determine if a value is a File
1964 *
1965 * @param {Object} val The value to test
1966 * @returns {boolean} True if value is a File, otherwise false
1967 */
1968function isFile(val) {
1969 return toString.call(val) === '[object File]';
1970}
1971
1972/**
1973 * Determine if a value is a Blob
1974 *
1975 * @param {Object} val The value to test
1976 * @returns {boolean} True if value is a Blob, otherwise false
1977 */
1978function isBlob(val) {
1979 return toString.call(val) === '[object Blob]';
1980}
1981
1982/**
1983 * Determine if a value is a Function
1984 *
1985 * @param {Object} val The value to test
1986 * @returns {boolean} True if value is a Function, otherwise false
1987 */
1988function isFunction(val) {
1989 return toString.call(val) === '[object Function]';
1990}
1991
1992/**
1993 * Determine if a value is a Stream
1994 *
1995 * @param {Object} val The value to test
1996 * @returns {boolean} True if value is a Stream, otherwise false
1997 */
1998function isStream(val) {
1999 return isObject(val) && isFunction(val.pipe);
2000}
2001
2002/**
2003 * Determine if a value is a URLSearchParams object
2004 *
2005 * @param {Object} val The value to test
2006 * @returns {boolean} True if value is a URLSearchParams object, otherwise false
2007 */
2008function isURLSearchParams(val) {
2009 return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;
2010}
2011
2012/**
2013 * Trim excess whitespace off the beginning and end of a string
2014 *
2015 * @param {String} str The String to trim
2016 * @returns {String} The String freed of excess whitespace
2017 */
2018function trim(str) {
2019 return str.replace(/^\s*/, '').replace(/\s*$/, '');
2020}
2021
2022/**
2023 * Determine if we're running in a standard browser environment
2024 *
2025 * This allows axios to run in a web worker, and react-native.
2026 * Both environments support XMLHttpRequest, but not fully standard globals.
2027 *
2028 * web workers:
2029 * typeof window -> undefined
2030 * typeof document -> undefined
2031 *
2032 * react-native:
2033 * navigator.product -> 'ReactNative'
2034 * nativescript
2035 * navigator.product -> 'NativeScript' or 'NS'
2036 */
2037function isStandardBrowserEnv() {
2038 if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||
2039 navigator.product === 'NativeScript' ||
2040 navigator.product === 'NS')) {
2041 return false;
2042 }
2043 return (
2044 typeof window !== 'undefined' &&
2045 typeof document !== 'undefined'
2046 );
2047}
2048
2049/**
2050 * Iterate over an Array or an Object invoking a function for each item.
2051 *
2052 * If `obj` is an Array callback will be called passing
2053 * the value, index, and complete array for each item.
2054 *
2055 * If 'obj' is an Object callback will be called passing
2056 * the value, key, and complete object for each property.
2057 *
2058 * @param {Object|Array} obj The object to iterate
2059 * @param {Function} fn The callback to invoke for each item
2060 */
2061function forEach(obj, fn) {
2062 // Don't bother if no value provided
2063 if (obj === null || typeof obj === 'undefined') {
2064 return;
2065 }
2066
2067 // Force an array if not already something iterable
2068 if (typeof obj !== 'object') {
2069 /*eslint no-param-reassign:0*/
2070 obj = [obj];
2071 }
2072
2073 if (isArray(obj)) {
2074 // Iterate over array values
2075 for (var i = 0, l = obj.length; i < l; i++) {
2076 fn.call(null, obj[i], i, obj);
2077 }
2078 } else {
2079 // Iterate over object keys
2080 for (var key in obj) {
2081 if (Object.prototype.hasOwnProperty.call(obj, key)) {
2082 fn.call(null, obj[key], key, obj);
2083 }
2084 }
2085 }
2086}
2087
2088/**
2089 * Accepts varargs expecting each argument to be an object, then
2090 * immutably merges the properties of each object and returns result.
2091 *
2092 * When multiple objects contain the same key the later object in
2093 * the arguments list will take precedence.
2094 *
2095 * Example:
2096 *
2097 * ```js
2098 * var result = merge({foo: 123}, {foo: 456});
2099 * console.log(result.foo); // outputs 456
2100 * ```
2101 *
2102 * @param {Object} obj1 Object to merge
2103 * @returns {Object} Result of all merge properties
2104 */
2105function merge(/* obj1, obj2, obj3, ... */) {
2106 var result = {};
2107 function assignValue(val, key) {
2108 if (typeof result[key] === 'object' && typeof val === 'object') {
2109 result[key] = merge(result[key], val);
2110 } else {
2111 result[key] = val;
2112 }
2113 }
2114
2115 for (var i = 0, l = arguments.length; i < l; i++) {
2116 forEach(arguments[i], assignValue);
2117 }
2118 return result;
2119}
2120
2121/**
2122 * Function equal to merge with the difference being that no reference
2123 * to original objects is kept.
2124 *
2125 * @see merge
2126 * @param {Object} obj1 Object to merge
2127 * @returns {Object} Result of all merge properties
2128 */
2129function deepMerge(/* obj1, obj2, obj3, ... */) {
2130 var result = {};
2131 function assignValue(val, key) {
2132 if (typeof result[key] === 'object' && typeof val === 'object') {
2133 result[key] = deepMerge(result[key], val);
2134 } else if (typeof val === 'object') {
2135 result[key] = deepMerge({}, val);
2136 } else {
2137 result[key] = val;
2138 }
2139 }
2140
2141 for (var i = 0, l = arguments.length; i < l; i++) {
2142 forEach(arguments[i], assignValue);
2143 }
2144 return result;
2145}
2146
2147/**
2148 * Extends object a by mutably adding to it the properties of object b.
2149 *
2150 * @param {Object} a The object to be extended
2151 * @param {Object} b The object to copy properties from
2152 * @param {Object} thisArg The object to bind function to
2153 * @return {Object} The resulting value of object a
2154 */
2155function extend(a, b, thisArg) {
2156 forEach(b, function assignValue(val, key) {
2157 if (thisArg && typeof val === 'function') {
2158 a[key] = bind(val, thisArg);
2159 } else {
2160 a[key] = val;
2161 }
2162 });
2163 return a;
2164}
2165
2166module.exports = {
2167 isArray: isArray,
2168 isArrayBuffer: isArrayBuffer,
2169 isBuffer: isBuffer,
2170 isFormData: isFormData,
2171 isArrayBufferView: isArrayBufferView,
2172 isString: isString,
2173 isNumber: isNumber,
2174 isObject: isObject,
2175 isUndefined: isUndefined,
2176 isDate: isDate,
2177 isFile: isFile,
2178 isBlob: isBlob,
2179 isFunction: isFunction,
2180 isStream: isStream,
2181 isURLSearchParams: isURLSearchParams,
2182 isStandardBrowserEnv: isStandardBrowserEnv,
2183 forEach: forEach,
2184 merge: merge,
2185 deepMerge: deepMerge,
2186 extend: extend,
2187 trim: trim
2188};
2189
2190
2191/***/ }),
2192
2193/***/ "../node_modules/axios/package.json":
2194/*!******************************************!*\
2195 !*** ../node_modules/axios/package.json ***!
2196 \******************************************/
2197/*! exports provided: _from, _id, _inBundle, _integrity, _location, _phantomChildren, _requested, _requiredBy, _resolved, _shasum, _spec, _where, author, browser, bugs, bundleDependencies, bundlesize, dependencies, deprecated, description, devDependencies, homepage, keywords, license, main, name, repository, scripts, typings, version, default */
2198/***/ (function(module) {
2199
2200module.exports = JSON.parse("{\"_from\":\"axios@^0.19.0\",\"_id\":\"axios@0.19.2\",\"_inBundle\":false,\"_integrity\":\"sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA==\",\"_location\":\"/axios\",\"_phantomChildren\":{},\"_requested\":{\"type\":\"range\",\"registry\":true,\"raw\":\"axios@^0.19.0\",\"name\":\"axios\",\"escapedName\":\"axios\",\"rawSpec\":\"^0.19.0\",\"saveSpec\":null,\"fetchSpec\":\"^0.19.0\"},\"_requiredBy\":[\"/\",\"/bundlesize\"],\"_resolved\":\"https://registry.npmjs.org/axios/-/axios-0.19.2.tgz\",\"_shasum\":\"3ea36c5d8818d0d5f8a8a97a6d36b86cdc00cb27\",\"_spec\":\"axios@^0.19.0\",\"_where\":\"/home/circleci/project\",\"author\":{\"name\":\"Matt Zabriskie\"},\"browser\":{\"./lib/adapters/http.js\":\"./lib/adapters/xhr.js\"},\"bugs\":{\"url\":\"https://github.com/axios/axios/issues\"},\"bundleDependencies\":false,\"bundlesize\":[{\"path\":\"./dist/axios.min.js\",\"threshold\":\"5kB\"}],\"dependencies\":{\"follow-redirects\":\"1.5.10\"},\"deprecated\":false,\"description\":\"Promise based HTTP client for the browser and node.js\",\"devDependencies\":{\"bundlesize\":\"^0.17.0\",\"coveralls\":\"^3.0.0\",\"es6-promise\":\"^4.2.4\",\"grunt\":\"^1.0.2\",\"grunt-banner\":\"^0.6.0\",\"grunt-cli\":\"^1.2.0\",\"grunt-contrib-clean\":\"^1.1.0\",\"grunt-contrib-watch\":\"^1.0.0\",\"grunt-eslint\":\"^20.1.0\",\"grunt-karma\":\"^2.0.0\",\"grunt-mocha-test\":\"^0.13.3\",\"grunt-ts\":\"^6.0.0-beta.19\",\"grunt-webpack\":\"^1.0.18\",\"istanbul-instrumenter-loader\":\"^1.0.0\",\"jasmine-core\":\"^2.4.1\",\"karma\":\"^1.3.0\",\"karma-chrome-launcher\":\"^2.2.0\",\"karma-coverage\":\"^1.1.1\",\"karma-firefox-launcher\":\"^1.1.0\",\"karma-jasmine\":\"^1.1.1\",\"karma-jasmine-ajax\":\"^0.1.13\",\"karma-opera-launcher\":\"^1.0.0\",\"karma-safari-launcher\":\"^1.0.0\",\"karma-sauce-launcher\":\"^1.2.0\",\"karma-sinon\":\"^1.0.5\",\"karma-sourcemap-loader\":\"^0.3.7\",\"karma-webpack\":\"^1.7.0\",\"load-grunt-tasks\":\"^3.5.2\",\"minimist\":\"^1.2.0\",\"mocha\":\"^5.2.0\",\"sinon\":\"^4.5.0\",\"typescript\":\"^2.8.1\",\"url-search-params\":\"^0.10.0\",\"webpack\":\"^1.13.1\",\"webpack-dev-server\":\"^1.14.1\"},\"homepage\":\"https://github.com/axios/axios\",\"keywords\":[\"xhr\",\"http\",\"ajax\",\"promise\",\"node\"],\"license\":\"MIT\",\"main\":\"index.js\",\"name\":\"axios\",\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/axios/axios.git\"},\"scripts\":{\"build\":\"NODE_ENV=production grunt build\",\"coveralls\":\"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js\",\"examples\":\"node ./examples/server.js\",\"fix\":\"eslint --fix lib/**/*.js\",\"postversion\":\"git push && git push --tags\",\"preversion\":\"npm test\",\"start\":\"node ./sandbox/server.js\",\"test\":\"grunt test && bundlesize\",\"version\":\"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json\"},\"typings\":\"./index.d.ts\",\"version\":\"0.19.2\"}");
2201
2202/***/ }),
2203
2204/***/ "../node_modules/contentful-sdk-core/dist/index.es-modules.js":
2205/*!********************************************************************!*\
2206 !*** ../node_modules/contentful-sdk-core/dist/index.es-modules.js ***!
2207 \********************************************************************/
2208/*! exports provided: createHttpClient, createRequestConfig, enforceObjPath, freezeSys, getUserAgentHeader, toPlainObject */
2209/***/ (function(module, __webpack_exports__, __webpack_require__) {
2210
2211"use strict";
2212__webpack_require__.r(__webpack_exports__);
2213/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createHttpClient", function() { return createHttpClient; });
2214/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createRequestConfig", function() { return createRequestConfig; });
2215/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "enforceObjPath", function() { return enforceObjPath; });
2216/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "freezeSys", function() { return freezeSys; });
2217/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getUserAgentHeader", function() { return getUserAgentHeader; });
2218/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toPlainObject", function() { return toPlainObject; });
2219/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
2220/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
2221/* harmony import */ var qs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! qs */ "../node_modules/qs/lib/index.js");
2222/* harmony import */ var qs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(qs__WEBPACK_IMPORTED_MODULE_1__);
2223/* harmony import */ var lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash/isPlainObject */ "../node_modules/lodash/isPlainObject.js");
2224/* harmony import */ var lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_2__);
2225/* harmony import */ var os__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! os */ "os");
2226/* harmony import */ var os__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(os__WEBPACK_IMPORTED_MODULE_3__);
2227
2228
2229
2230
2231
2232function _defineProperty(obj, key, value) {
2233 if (key in obj) {
2234 Object.defineProperty(obj, key, {
2235 value: value,
2236 enumerable: true,
2237 configurable: true,
2238 writable: true
2239 });
2240 } else {
2241 obj[key] = value;
2242 }
2243
2244 return obj;
2245}
2246
2247function ownKeys(object, enumerableOnly) {
2248 var keys = Object.keys(object);
2249
2250 if (Object.getOwnPropertySymbols) {
2251 var symbols = Object.getOwnPropertySymbols(object);
2252 if (enumerableOnly) symbols = symbols.filter(function (sym) {
2253 return Object.getOwnPropertyDescriptor(object, sym).enumerable;
2254 });
2255 keys.push.apply(keys, symbols);
2256 }
2257
2258 return keys;
2259}
2260
2261function _objectSpread2(target) {
2262 for (var i = 1; i < arguments.length; i++) {
2263 var source = arguments[i] != null ? arguments[i] : {};
2264
2265 if (i % 2) {
2266 ownKeys(Object(source), true).forEach(function (key) {
2267 _defineProperty(target, key, source[key]);
2268 });
2269 } else if (Object.getOwnPropertyDescriptors) {
2270 Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
2271 } else {
2272 ownKeys(Object(source)).forEach(function (key) {
2273 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
2274 });
2275 }
2276 }
2277
2278 return target;
2279}
2280
2281function _slicedToArray(arr, i) {
2282 return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
2283}
2284
2285function _arrayWithHoles(arr) {
2286 if (Array.isArray(arr)) return arr;
2287}
2288
2289function _iterableToArrayLimit(arr, i) {
2290 if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
2291 var _arr = [];
2292 var _n = true;
2293 var _d = false;
2294 var _e = undefined;
2295
2296 try {
2297 for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
2298 _arr.push(_s.value);
2299
2300 if (i && _arr.length === i) break;
2301 }
2302 } catch (err) {
2303 _d = true;
2304 _e = err;
2305 } finally {
2306 try {
2307 if (!_n && _i["return"] != null) _i["return"]();
2308 } finally {
2309 if (_d) throw _e;
2310 }
2311 }
2312
2313 return _arr;
2314}
2315
2316function _unsupportedIterableToArray(o, minLen) {
2317 if (!o) return;
2318 if (typeof o === "string") return _arrayLikeToArray(o, minLen);
2319 var n = Object.prototype.toString.call(o).slice(8, -1);
2320 if (n === "Object" && o.constructor) n = o.constructor.name;
2321 if (n === "Map" || n === "Set") return Array.from(n);
2322 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
2323}
2324
2325function _arrayLikeToArray(arr, len) {
2326 if (len == null || len > arr.length) len = arr.length;
2327
2328 for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
2329
2330 return arr2;
2331}
2332
2333function _nonIterableRest() {
2334 throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
2335}
2336
2337var attempts = {};
2338var networkErrorAttempts = 0;
2339function rateLimit(instance) {
2340 var maxRetry = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 5;
2341 var _instance$defaults = instance.defaults,
2342 _instance$defaults$re = _instance$defaults.responseLogger,
2343 responseLogger = _instance$defaults$re === void 0 ? function () {
2344 return undefined;
2345 } : _instance$defaults$re,
2346 _instance$defaults$re2 = _instance$defaults.requestLogger,
2347 requestLogger = _instance$defaults$re2 === void 0 ? function () {
2348 return undefined;
2349 } : _instance$defaults$re2;
2350 instance.interceptors.request.use(function (config) {
2351 requestLogger(config);
2352 return config;
2353 }, function (error) {
2354 return Promise.reject(error);
2355 });
2356 instance.interceptors.response.use(function (response) {
2357 // we don't need to do anything here
2358 responseLogger(response);
2359 return response;
2360 }, function (error) {
2361 var response = error.response,
2362 config = error.config; // Do not retry if it is disabled or no request config exists (not an axios error)
2363
2364 if (!config || !instance.defaults.retryOnError) {
2365 return Promise.reject(error);
2366 }
2367
2368 var retryErrorType = null;
2369 var wait = 0; // Errors without response did not recieve anything from the server
2370
2371 if (!response) {
2372 retryErrorType = 'Connection';
2373 networkErrorAttempts++;
2374
2375 if (networkErrorAttempts > maxRetry) {
2376 error.attempts = networkErrorAttempts;
2377 return Promise.reject(error);
2378 }
2379
2380 wait = Math.pow(Math.SQRT2, networkErrorAttempts);
2381 response = {};
2382 } else {
2383 networkErrorAttempts = 0;
2384 }
2385
2386 if (response.status >= 500 && response.status < 600) {
2387 // 5** errors are server related
2388 retryErrorType = "Server ".concat(response.status);
2389 var headers = response.headers || {};
2390 var requestId = headers['x-contentful-request-id'] || null;
2391 attempts[requestId] = attempts[requestId] || 0;
2392 attempts[requestId]++; // we reject if there are too many errors with the same request id or request id is not defined
2393
2394 if (attempts[requestId] > maxRetry || !requestId) {
2395 error.attempts = attempts[requestId];
2396 return Promise.reject(error);
2397 }
2398
2399 wait = Math.pow(Math.SQRT2, attempts[requestId]);
2400 } else if (response.status === 429) {
2401 // 429 errors are exceeded rate limit exceptions
2402 retryErrorType = 'Rate limit'; // all headers are lowercased by axios https://github.com/mzabriskie/axios/issues/413
2403
2404 if (response.headers && error.response.headers['x-contentful-ratelimit-reset']) {
2405 wait = response.headers['x-contentful-ratelimit-reset'];
2406 }
2407 }
2408
2409 var delay = function delay(ms) {
2410 return new Promise(function (resolve) {
2411 setTimeout(resolve, ms);
2412 });
2413 };
2414
2415 if (retryErrorType) {
2416 // convert to ms and add jitter
2417 wait = Math.floor(wait * 1000 + Math.random() * 200 + 500);
2418 instance.defaults.logHandler('warning', "".concat(retryErrorType, " error occurred. Waiting for ").concat(wait, " ms before retrying..."));
2419 /* Somehow between the interceptor and retrying the request the httpAgent/httpsAgent gets transformed from an Agent-like object
2420 to a regular object, causing failures on retries after rate limits. Removing these properties here fixes the error, but retry
2421 requests still use the original http/httpsAgent property */
2422
2423 delete config.httpAgent;
2424 delete config.httpsAgent;
2425 return delay(wait).then(function () {
2426 return instance(config);
2427 });
2428 }
2429
2430 return Promise.reject(error);
2431 });
2432}
2433
2434function isNode() {
2435 /**
2436 * Polyfills of 'process' might set process.browser === true
2437 *
2438 * See:
2439 * https://github.com/webpack/node-libs-browser/blob/master/mock/process.js#L8
2440 * https://github.com/defunctzombie/node-process/blob/master/browser.js#L156
2441 **/
2442 return typeof process !== 'undefined' && !process.browser;
2443}
2444function getNodeVersion() {
2445 return process.versions && process.versions.node ? "v".concat(process.versions.node) : process.version;
2446}
2447
2448// Also enforces toplevel domain specified, no spaces and no protocol
2449
2450var HOST_REGEX = /^(?!\w+:\/\/)([^\s:]+\.?[^\s:]+)(?::(\d+))?(?!:)$/;
2451/**
2452 * Create pre configured axios instance
2453 * @private
2454 * @param {Object} axios - Axios library
2455 * @param {Object} httpClientParams - Initialization parameters for the HTTP client
2456 * @prop {string} space - Space ID
2457 * @prop {string} accessToken - Access Token
2458 * @prop {boolean=} insecure - If we should use http instead
2459 * @prop {string=} host - Alternate host
2460 * @prop {Object=} httpAgent - HTTP agent for node
2461 * @prop {Object=} httpsAgent - HTTPS agent for node
2462 * @prop {function=} adapter - Axios adapter to handle requests
2463 * @prop {function=} requestLogger - Gets called on every request triggered by the SDK, takes the axios request config as an argument
2464 * @prop {function=} responseLogger - Gets called on every response, takes axios response object as an argument
2465 * @prop {Object=} proxy - Axios proxy config
2466 * @prop {Object=} headers - Additional headers
2467 * @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)
2468 * @return {Object} Initialized axios instance
2469 */
2470
2471function createHttpClient(axios, options) {
2472 var defaultConfig = {
2473 insecure: false,
2474 retryOnError: true,
2475 logHandler: function logHandler(level, data) {
2476 if (level === 'error' && data) {
2477 var title = [data.name, data.message].filter(function (a) {
2478 return a;
2479 }).join(' - ');
2480 console.error("[error] ".concat(title));
2481 console.error(data);
2482 return;
2483 }
2484
2485 console.log("[".concat(level, "] ").concat(data));
2486 },
2487 // Passed to axios
2488 headers: {},
2489 httpAgent: false,
2490 httpsAgent: false,
2491 timeout: 30000,
2492 proxy: false,
2493 basePath: '',
2494 adapter: false,
2495 maxContentLength: 1073741824 // 1GB
2496
2497 };
2498
2499 var config = _objectSpread2({}, defaultConfig, {}, options);
2500
2501 if (!config.accessToken) {
2502 var missingAccessTokenError = new TypeError('Expected parameter accessToken');
2503 config.logHandler('error', missingAccessTokenError);
2504 throw missingAccessTokenError;
2505 } // Construct axios baseURL option
2506
2507
2508 var protocol = config.insecure ? 'http' : 'https';
2509 var space = config.space ? "".concat(config.space, "/") : '';
2510 var hostname = config.defaultHostname;
2511 var port = config.insecure ? 80 : 443;
2512
2513 if (config.host && HOST_REGEX.test(config.host)) {
2514 var parsed = config.host.split(':');
2515
2516 if (parsed.length === 2) {
2517 var _parsed = _slicedToArray(parsed, 2);
2518
2519 hostname = _parsed[0];
2520 port = _parsed[1];
2521 } else {
2522 hostname = parsed[0];
2523 }
2524 } // Ensure that basePath does start but not end with a slash
2525
2526
2527 if (config.basePath) {
2528 config.basePath = "/".concat(config.basePath.split('/').filter(Boolean).join('/'));
2529 }
2530
2531 var baseURL = options.baseURL || "".concat(protocol, "://").concat(hostname, ":").concat(port).concat(config.basePath, "/spaces/").concat(space);
2532
2533 if (!config.headers['Authorization']) {
2534 config.headers['Authorization'] = 'Bearer ' + config.accessToken;
2535 } // Set these headers only for node because browsers don't like it when you
2536 // override user-agent or accept-encoding.
2537 // The SDKs should set their own X-Contentful-User-Agent.
2538
2539
2540 if (isNode()) {
2541 config.headers['user-agent'] = 'node.js/' + getNodeVersion();
2542 config.headers['Accept-Encoding'] = 'gzip';
2543 }
2544
2545 var axiosOptions = {
2546 // Axios
2547 baseURL: baseURL,
2548 headers: config.headers,
2549 httpAgent: config.httpAgent,
2550 httpsAgent: config.httpsAgent,
2551 paramsSerializer: qs__WEBPACK_IMPORTED_MODULE_1___default.a.stringify,
2552 proxy: config.proxy,
2553 timeout: config.timeout,
2554 adapter: config.adapter,
2555 maxContentLength: config.maxContentLength,
2556 // Contentful
2557 logHandler: config.logHandler,
2558 responseLogger: config.responseLogger,
2559 requestLogger: config.requestLogger,
2560 retryOnError: config.retryOnError
2561 };
2562 var instance = axios.create(axiosOptions);
2563 instance.httpClientParams = options;
2564 /**
2565 * Creates a new axios instance with the same default base parameters as the
2566 * current one, and with any overrides passed to the newParams object
2567 * This is useful as the SDKs use dependency injection to get the axios library
2568 * and the version of the library comes from different places depending
2569 * on whether it's a browser build or a node.js build.
2570 * @private
2571 * @param {Object} httpClientParams - Initialization parameters for the HTTP client
2572 * @return {Object} Initialized axios instance
2573 */
2574
2575 instance.cloneWithNewParams = function (newParams) {
2576 return createHttpClient(axios, _objectSpread2({}, lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(options), {}, newParams));
2577 };
2578
2579 rateLimit(instance, config.retryLimit);
2580 return instance;
2581}
2582
2583/**
2584 * Creates request parameters configuration by parsing an existing query object
2585 * @private
2586 * @param {Object} query
2587 * @return {Object} Config object with `params` property, ready to be used in axios
2588 */
2589
2590function createRequestConfig(_ref) {
2591 var query = _ref.query;
2592 var config = {};
2593 delete query.resolveLinks;
2594 config.params = lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(query);
2595 return config;
2596}
2597
2598function enforceObjPath(obj, path) {
2599 if (!(path in obj)) {
2600 var err = new Error();
2601 err.name = 'PropertyMissing';
2602 err.message = "Required property ".concat(path, " missing from:\n\n").concat(JSON.stringify(obj), "\n\n");
2603 throw err;
2604 }
2605
2606 return true;
2607}
2608
2609function freezeObjectDeep(obj) {
2610 Object.keys(obj).forEach(function (key) {
2611 var value = obj[key];
2612
2613 if (lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_2___default()(value)) {
2614 freezeObjectDeep(value);
2615 }
2616 });
2617 return Object.freeze(obj);
2618}
2619
2620function freezeSys(obj) {
2621 freezeObjectDeep(obj.sys || {});
2622 return obj;
2623}
2624
2625function isReactNative() {
2626 return typeof window !== 'undefined' && 'navigator' in window && 'product' in window.navigator && window.navigator.product === 'ReactNative';
2627}
2628
2629function getBrowserOS() {
2630 if (!window) {
2631 return null;
2632 }
2633
2634 var userAgent = window.navigator.userAgent;
2635 var platform = window.navigator.platform;
2636 var macosPlatforms = ['Macintosh', 'MacIntel', 'MacPPC', 'Mac68K'];
2637 var windowsPlatforms = ['Win32', 'Win64', 'Windows', 'WinCE'];
2638 var iosPlatforms = ['iPhone', 'iPad', 'iPod'];
2639 var os = null;
2640
2641 if (macosPlatforms.indexOf(platform) !== -1) {
2642 os = 'macOS';
2643 } else if (iosPlatforms.indexOf(platform) !== -1) {
2644 os = 'iOS';
2645 } else if (windowsPlatforms.indexOf(platform) !== -1) {
2646 os = 'Windows';
2647 } else if (/Android/.test(userAgent)) {
2648 os = 'Android';
2649 } else if (/Linux/.test(platform)) {
2650 os = 'Linux';
2651 }
2652
2653 return os;
2654}
2655
2656function getNodeOS() {
2657 var os = Object(os__WEBPACK_IMPORTED_MODULE_3__["platform"])() || 'linux';
2658 var version = Object(os__WEBPACK_IMPORTED_MODULE_3__["release"])() || '0.0.0';
2659 var osMap = {
2660 android: 'Android',
2661 aix: 'Linux',
2662 darwin: 'macOS',
2663 freebsd: 'Linux',
2664 linux: 'Linux',
2665 openbsd: 'Linux',
2666 sunos: 'Linux',
2667 win32: 'Windows'
2668 };
2669
2670 if (os in osMap) {
2671 return "".concat(osMap[os] || 'Linux', "/").concat(version);
2672 }
2673
2674 return null;
2675}
2676
2677function getUserAgentHeader(sdk, application, integration, feature) {
2678 var headerParts = [];
2679
2680 if (application) {
2681 headerParts.push("app ".concat(application));
2682 }
2683
2684 if (integration) {
2685 headerParts.push("integration ".concat(integration));
2686 }
2687
2688 if (feature) {
2689 headerParts.push('feature ' + feature);
2690 }
2691
2692 headerParts.push("sdk ".concat(sdk));
2693 var os = null;
2694
2695 try {
2696 if (isReactNative()) {
2697 os = getBrowserOS();
2698 headerParts.push('platform ReactNative');
2699 } else if (isNode()) {
2700 os = getNodeOS();
2701 headerParts.push("platform node.js/".concat(getNodeVersion()));
2702 } else {
2703 os = getBrowserOS();
2704 headerParts.push("platform browser");
2705 }
2706 } catch (e) {
2707 os = null;
2708 }
2709
2710 if (os) {
2711 headerParts.push("os ".concat(os));
2712 }
2713
2714 return "".concat(headerParts.filter(function (item) {
2715 return item !== '';
2716 }).join('; '), ";");
2717}
2718
2719/**
2720 * Mixes in a method to return just a plain object with no additional methods
2721 * @private
2722 * @param {Object} data - Any plain JSON response returned from the API
2723 * @return {Object} Enhanced object with toPlainObject method
2724 */
2725
2726function toPlainObject(data) {
2727 return Object.defineProperty(data, 'toPlainObject', {
2728 enumerable: false,
2729 configurable: false,
2730 writable: false,
2731 value: function value() {
2732 return lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(this);
2733 }
2734 });
2735}
2736
2737
2738
2739
2740/***/ }),
2741
2742/***/ "../node_modules/debug/src/browser.js":
2743/*!********************************************!*\
2744 !*** ../node_modules/debug/src/browser.js ***!
2745 \********************************************/
2746/*! no static exports found */
2747/***/ (function(module, exports, __webpack_require__) {
2748
2749/**
2750 * This is the web browser implementation of `debug()`.
2751 *
2752 * Expose `debug()` as the module.
2753 */
2754
2755exports = module.exports = __webpack_require__(/*! ./debug */ "../node_modules/debug/src/debug.js");
2756exports.log = log;
2757exports.formatArgs = formatArgs;
2758exports.save = save;
2759exports.load = load;
2760exports.useColors = useColors;
2761exports.storage = 'undefined' != typeof chrome
2762 && 'undefined' != typeof chrome.storage
2763 ? chrome.storage.local
2764 : localstorage();
2765
2766/**
2767 * Colors.
2768 */
2769
2770exports.colors = [
2771 '#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC',
2772 '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF',
2773 '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC',
2774 '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF',
2775 '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC',
2776 '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033',
2777 '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366',
2778 '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933',
2779 '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC',
2780 '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF',
2781 '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'
2782];
2783
2784/**
2785 * Currently only WebKit-based Web Inspectors, Firefox >= v31,
2786 * and the Firebug extension (any Firefox version) are known
2787 * to support "%c" CSS customizations.
2788 *
2789 * TODO: add a `localStorage` variable to explicitly enable/disable colors
2790 */
2791
2792function useColors() {
2793 // NB: In an Electron preload script, document will be defined but not fully
2794 // initialized. Since we know we're in Chrome, we'll just detect this case
2795 // explicitly
2796 if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {
2797 return true;
2798 }
2799
2800 // Internet Explorer and Edge do not support colors.
2801 if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
2802 return false;
2803 }
2804
2805 // is webkit? http://stackoverflow.com/a/16459606/376773
2806 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
2807 return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
2808 // is firebug? http://stackoverflow.com/a/398120/376773
2809 (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
2810 // is firefox >= v31?
2811 // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
2812 (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
2813 // double check webkit in userAgent just in case we are in a worker
2814 (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
2815}
2816
2817/**
2818 * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
2819 */
2820
2821exports.formatters.j = function(v) {
2822 try {
2823 return JSON.stringify(v);
2824 } catch (err) {
2825 return '[UnexpectedJSONParseError]: ' + err.message;
2826 }
2827};
2828
2829
2830/**
2831 * Colorize log arguments if enabled.
2832 *
2833 * @api public
2834 */
2835
2836function formatArgs(args) {
2837 var useColors = this.useColors;
2838
2839 args[0] = (useColors ? '%c' : '')
2840 + this.namespace
2841 + (useColors ? ' %c' : ' ')
2842 + args[0]
2843 + (useColors ? '%c ' : ' ')
2844 + '+' + exports.humanize(this.diff);
2845
2846 if (!useColors) return;
2847
2848 var c = 'color: ' + this.color;
2849 args.splice(1, 0, c, 'color: inherit')
2850
2851 // the final "%c" is somewhat tricky, because there could be other
2852 // arguments passed either before or after the %c, so we need to
2853 // figure out the correct index to insert the CSS into
2854 var index = 0;
2855 var lastC = 0;
2856 args[0].replace(/%[a-zA-Z%]/g, function(match) {
2857 if ('%%' === match) return;
2858 index++;
2859 if ('%c' === match) {
2860 // we only are interested in the *last* %c
2861 // (the user may have provided their own)
2862 lastC = index;
2863 }
2864 });
2865
2866 args.splice(lastC, 0, c);
2867}
2868
2869/**
2870 * Invokes `console.log()` when available.
2871 * No-op when `console.log` is not a "function".
2872 *
2873 * @api public
2874 */
2875
2876function log() {
2877 // this hackery is required for IE8/9, where
2878 // the `console.log` function doesn't have 'apply'
2879 return 'object' === typeof console
2880 && console.log
2881 && Function.prototype.apply.call(console.log, console, arguments);
2882}
2883
2884/**
2885 * Save `namespaces`.
2886 *
2887 * @param {String} namespaces
2888 * @api private
2889 */
2890
2891function save(namespaces) {
2892 try {
2893 if (null == namespaces) {
2894 exports.storage.removeItem('debug');
2895 } else {
2896 exports.storage.debug = namespaces;
2897 }
2898 } catch(e) {}
2899}
2900
2901/**
2902 * Load `namespaces`.
2903 *
2904 * @return {String} returns the previously persisted debug modes
2905 * @api private
2906 */
2907
2908function load() {
2909 var r;
2910 try {
2911 r = exports.storage.debug;
2912 } catch(e) {}
2913
2914 // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
2915 if (!r && typeof process !== 'undefined' && 'env' in process) {
2916 r = process.env.DEBUG;
2917 }
2918
2919 return r;
2920}
2921
2922/**
2923 * Enable namespaces listed in `localStorage.debug` initially.
2924 */
2925
2926exports.enable(load());
2927
2928/**
2929 * Localstorage attempts to return the localstorage.
2930 *
2931 * This is necessary because safari throws
2932 * when a user disables cookies/localstorage
2933 * and you attempt to access it.
2934 *
2935 * @return {LocalStorage}
2936 * @api private
2937 */
2938
2939function localstorage() {
2940 try {
2941 return window.localStorage;
2942 } catch (e) {}
2943}
2944
2945
2946/***/ }),
2947
2948/***/ "../node_modules/debug/src/debug.js":
2949/*!******************************************!*\
2950 !*** ../node_modules/debug/src/debug.js ***!
2951 \******************************************/
2952/*! no static exports found */
2953/***/ (function(module, exports, __webpack_require__) {
2954
2955
2956/**
2957 * This is the common logic for both the Node.js and web browser
2958 * implementations of `debug()`.
2959 *
2960 * Expose `debug()` as the module.
2961 */
2962
2963exports = module.exports = createDebug.debug = createDebug['default'] = createDebug;
2964exports.coerce = coerce;
2965exports.disable = disable;
2966exports.enable = enable;
2967exports.enabled = enabled;
2968exports.humanize = __webpack_require__(/*! ms */ "../node_modules/ms/index.js");
2969
2970/**
2971 * Active `debug` instances.
2972 */
2973exports.instances = [];
2974
2975/**
2976 * The currently active debug mode names, and names to skip.
2977 */
2978
2979exports.names = [];
2980exports.skips = [];
2981
2982/**
2983 * Map of special "%n" handling functions, for the debug "format" argument.
2984 *
2985 * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
2986 */
2987
2988exports.formatters = {};
2989
2990/**
2991 * Select a color.
2992 * @param {String} namespace
2993 * @return {Number}
2994 * @api private
2995 */
2996
2997function selectColor(namespace) {
2998 var hash = 0, i;
2999
3000 for (i in namespace) {
3001 hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
3002 hash |= 0; // Convert to 32bit integer
3003 }
3004
3005 return exports.colors[Math.abs(hash) % exports.colors.length];
3006}
3007
3008/**
3009 * Create a debugger with the given `namespace`.
3010 *
3011 * @param {String} namespace
3012 * @return {Function}
3013 * @api public
3014 */
3015
3016function createDebug(namespace) {
3017
3018 var prevTime;
3019
3020 function debug() {
3021 // disabled?
3022 if (!debug.enabled) return;
3023
3024 var self = debug;
3025
3026 // set `diff` timestamp
3027 var curr = +new Date();
3028 var ms = curr - (prevTime || curr);
3029 self.diff = ms;
3030 self.prev = prevTime;
3031 self.curr = curr;
3032 prevTime = curr;
3033
3034 // turn the `arguments` into a proper Array
3035 var args = new Array(arguments.length);
3036 for (var i = 0; i < args.length; i++) {
3037 args[i] = arguments[i];
3038 }
3039
3040 args[0] = exports.coerce(args[0]);
3041
3042 if ('string' !== typeof args[0]) {
3043 // anything else let's inspect with %O
3044 args.unshift('%O');
3045 }
3046
3047 // apply any `formatters` transformations
3048 var index = 0;
3049 args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {
3050 // if we encounter an escaped % then don't increase the array index
3051 if (match === '%%') return match;
3052 index++;
3053 var formatter = exports.formatters[format];
3054 if ('function' === typeof formatter) {
3055 var val = args[index];
3056 match = formatter.call(self, val);
3057
3058 // now we need to remove `args[index]` since it's inlined in the `format`
3059 args.splice(index, 1);
3060 index--;
3061 }
3062 return match;
3063 });
3064
3065 // apply env-specific formatting (colors, etc.)
3066 exports.formatArgs.call(self, args);
3067
3068 var logFn = debug.log || exports.log || console.log.bind(console);
3069 logFn.apply(self, args);
3070 }
3071
3072 debug.namespace = namespace;
3073 debug.enabled = exports.enabled(namespace);
3074 debug.useColors = exports.useColors();
3075 debug.color = selectColor(namespace);
3076 debug.destroy = destroy;
3077
3078 // env-specific initialization logic for debug instances
3079 if ('function' === typeof exports.init) {
3080 exports.init(debug);
3081 }
3082
3083 exports.instances.push(debug);
3084
3085 return debug;
3086}
3087
3088function destroy () {
3089 var index = exports.instances.indexOf(this);
3090 if (index !== -1) {
3091 exports.instances.splice(index, 1);
3092 return true;
3093 } else {
3094 return false;
3095 }
3096}
3097
3098/**
3099 * Enables a debug mode by namespaces. This can include modes
3100 * separated by a colon and wildcards.
3101 *
3102 * @param {String} namespaces
3103 * @api public
3104 */
3105
3106function enable(namespaces) {
3107 exports.save(namespaces);
3108
3109 exports.names = [];
3110 exports.skips = [];
3111
3112 var i;
3113 var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
3114 var len = split.length;
3115
3116 for (i = 0; i < len; i++) {
3117 if (!split[i]) continue; // ignore empty strings
3118 namespaces = split[i].replace(/\*/g, '.*?');
3119 if (namespaces[0] === '-') {
3120 exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
3121 } else {
3122 exports.names.push(new RegExp('^' + namespaces + '$'));
3123 }
3124 }
3125
3126 for (i = 0; i < exports.instances.length; i++) {
3127 var instance = exports.instances[i];
3128 instance.enabled = exports.enabled(instance.namespace);
3129 }
3130}
3131
3132/**
3133 * Disable debug output.
3134 *
3135 * @api public
3136 */
3137
3138function disable() {
3139 exports.enable('');
3140}
3141
3142/**
3143 * Returns true if the given mode name is enabled, false otherwise.
3144 *
3145 * @param {String} name
3146 * @return {Boolean}
3147 * @api public
3148 */
3149
3150function enabled(name) {
3151 if (name[name.length - 1] === '*') {
3152 return true;
3153 }
3154 var i, len;
3155 for (i = 0, len = exports.skips.length; i < len; i++) {
3156 if (exports.skips[i].test(name)) {
3157 return false;
3158 }
3159 }
3160 for (i = 0, len = exports.names.length; i < len; i++) {
3161 if (exports.names[i].test(name)) {
3162 return true;
3163 }
3164 }
3165 return false;
3166}
3167
3168/**
3169 * Coerce `val`.
3170 *
3171 * @param {Mixed} val
3172 * @return {Mixed}
3173 * @api private
3174 */
3175
3176function coerce(val) {
3177 if (val instanceof Error) return val.stack || val.message;
3178 return val;
3179}
3180
3181
3182/***/ }),
3183
3184/***/ "../node_modules/debug/src/index.js":
3185/*!******************************************!*\
3186 !*** ../node_modules/debug/src/index.js ***!
3187 \******************************************/
3188/*! no static exports found */
3189/***/ (function(module, exports, __webpack_require__) {
3190
3191/**
3192 * Detect Electron renderer process, which is node, but we should
3193 * treat as a browser.
3194 */
3195
3196if (typeof process === 'undefined' || process.type === 'renderer') {
3197 module.exports = __webpack_require__(/*! ./browser.js */ "../node_modules/debug/src/browser.js");
3198} else {
3199 module.exports = __webpack_require__(/*! ./node.js */ "../node_modules/debug/src/node.js");
3200}
3201
3202
3203/***/ }),
3204
3205/***/ "../node_modules/debug/src/node.js":
3206/*!*****************************************!*\
3207 !*** ../node_modules/debug/src/node.js ***!
3208 \*****************************************/
3209/*! no static exports found */
3210/***/ (function(module, exports, __webpack_require__) {
3211
3212/**
3213 * Module dependencies.
3214 */
3215
3216var tty = __webpack_require__(/*! tty */ "tty");
3217var util = __webpack_require__(/*! util */ "util");
3218
3219/**
3220 * This is the Node.js implementation of `debug()`.
3221 *
3222 * Expose `debug()` as the module.
3223 */
3224
3225exports = module.exports = __webpack_require__(/*! ./debug */ "../node_modules/debug/src/debug.js");
3226exports.init = init;
3227exports.log = log;
3228exports.formatArgs = formatArgs;
3229exports.save = save;
3230exports.load = load;
3231exports.useColors = useColors;
3232
3233/**
3234 * Colors.
3235 */
3236
3237exports.colors = [ 6, 2, 3, 4, 5, 1 ];
3238
3239try {
3240 var supportsColor = __webpack_require__(/*! supports-color */ "../node_modules/supports-color/index.js");
3241 if (supportsColor && supportsColor.level >= 2) {
3242 exports.colors = [
3243 20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68,
3244 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134,
3245 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171,
3246 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204,
3247 205, 206, 207, 208, 209, 214, 215, 220, 221
3248 ];
3249 }
3250} catch (err) {
3251 // swallow - we only care if `supports-color` is available; it doesn't have to be.
3252}
3253
3254/**
3255 * Build up the default `inspectOpts` object from the environment variables.
3256 *
3257 * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
3258 */
3259
3260exports.inspectOpts = Object.keys(process.env).filter(function (key) {
3261 return /^debug_/i.test(key);
3262}).reduce(function (obj, key) {
3263 // camel-case
3264 var prop = key
3265 .substring(6)
3266 .toLowerCase()
3267 .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() });
3268
3269 // coerce string value into JS value
3270 var val = process.env[key];
3271 if (/^(yes|on|true|enabled)$/i.test(val)) val = true;
3272 else if (/^(no|off|false|disabled)$/i.test(val)) val = false;
3273 else if (val === 'null') val = null;
3274 else val = Number(val);
3275
3276 obj[prop] = val;
3277 return obj;
3278}, {});
3279
3280/**
3281 * Is stdout a TTY? Colored output is enabled when `true`.
3282 */
3283
3284function useColors() {
3285 return 'colors' in exports.inspectOpts
3286 ? Boolean(exports.inspectOpts.colors)
3287 : tty.isatty(process.stderr.fd);
3288}
3289
3290/**
3291 * Map %o to `util.inspect()`, all on a single line.
3292 */
3293
3294exports.formatters.o = function(v) {
3295 this.inspectOpts.colors = this.useColors;
3296 return util.inspect(v, this.inspectOpts)
3297 .split('\n').map(function(str) {
3298 return str.trim()
3299 }).join(' ');
3300};
3301
3302/**
3303 * Map %o to `util.inspect()`, allowing multiple lines if needed.
3304 */
3305
3306exports.formatters.O = function(v) {
3307 this.inspectOpts.colors = this.useColors;
3308 return util.inspect(v, this.inspectOpts);
3309};
3310
3311/**
3312 * Adds ANSI color escape codes if enabled.
3313 *
3314 * @api public
3315 */
3316
3317function formatArgs(args) {
3318 var name = this.namespace;
3319 var useColors = this.useColors;
3320
3321 if (useColors) {
3322 var c = this.color;
3323 var colorCode = '\u001b[3' + (c < 8 ? c : '8;5;' + c);
3324 var prefix = ' ' + colorCode + ';1m' + name + ' ' + '\u001b[0m';
3325
3326 args[0] = prefix + args[0].split('\n').join('\n' + prefix);
3327 args.push(colorCode + 'm+' + exports.humanize(this.diff) + '\u001b[0m');
3328 } else {
3329 args[0] = getDate() + name + ' ' + args[0];
3330 }
3331}
3332
3333function getDate() {
3334 if (exports.inspectOpts.hideDate) {
3335 return '';
3336 } else {
3337 return new Date().toISOString() + ' ';
3338 }
3339}
3340
3341/**
3342 * Invokes `util.format()` with the specified arguments and writes to stderr.
3343 */
3344
3345function log() {
3346 return process.stderr.write(util.format.apply(util, arguments) + '\n');
3347}
3348
3349/**
3350 * Save `namespaces`.
3351 *
3352 * @param {String} namespaces
3353 * @api private
3354 */
3355
3356function save(namespaces) {
3357 if (null == namespaces) {
3358 // If you set a process.env field to null or undefined, it gets cast to the
3359 // string 'null' or 'undefined'. Just delete instead.
3360 delete process.env.DEBUG;
3361 } else {
3362 process.env.DEBUG = namespaces;
3363 }
3364}
3365
3366/**
3367 * Load `namespaces`.
3368 *
3369 * @return {String} returns the previously persisted debug modes
3370 * @api private
3371 */
3372
3373function load() {
3374 return process.env.DEBUG;
3375}
3376
3377/**
3378 * Init logic for `debug` instances.
3379 *
3380 * Create a new `inspectOpts` object in case `useColors` is set
3381 * differently for a particular `debug` instance.
3382 */
3383
3384function init (debug) {
3385 debug.inspectOpts = {};
3386
3387 var keys = Object.keys(exports.inspectOpts);
3388 for (var i = 0; i < keys.length; i++) {
3389 debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
3390 }
3391}
3392
3393/**
3394 * Enable namespaces listed in `process.env.DEBUG` initially.
3395 */
3396
3397exports.enable(load());
3398
3399
3400/***/ }),
3401
3402/***/ "../node_modules/follow-redirects/index.js":
3403/*!*************************************************!*\
3404 !*** ../node_modules/follow-redirects/index.js ***!
3405 \*************************************************/
3406/*! no static exports found */
3407/***/ (function(module, exports, __webpack_require__) {
3408
3409var url = __webpack_require__(/*! url */ "url");
3410var http = __webpack_require__(/*! http */ "http");
3411var https = __webpack_require__(/*! https */ "https");
3412var assert = __webpack_require__(/*! assert */ "assert");
3413var Writable = __webpack_require__(/*! stream */ "stream").Writable;
3414var debug = __webpack_require__(/*! debug */ "../node_modules/debug/src/index.js")("follow-redirects");
3415
3416// RFC7231§4.2.1: Of the request methods defined by this specification,
3417// the GET, HEAD, OPTIONS, and TRACE methods are defined to be safe.
3418var SAFE_METHODS = { GET: true, HEAD: true, OPTIONS: true, TRACE: true };
3419
3420// Create handlers that pass events from native requests
3421var eventHandlers = Object.create(null);
3422["abort", "aborted", "error", "socket", "timeout"].forEach(function (event) {
3423 eventHandlers[event] = function (arg) {
3424 this._redirectable.emit(event, arg);
3425 };
3426});
3427
3428// An HTTP(S) request that can be redirected
3429function RedirectableRequest(options, responseCallback) {
3430 // Initialize the request
3431 Writable.call(this);
3432 options.headers = options.headers || {};
3433 this._options = options;
3434 this._redirectCount = 0;
3435 this._redirects = [];
3436 this._requestBodyLength = 0;
3437 this._requestBodyBuffers = [];
3438
3439 // Since http.request treats host as an alias of hostname,
3440 // but the url module interprets host as hostname plus port,
3441 // eliminate the host property to avoid confusion.
3442 if (options.host) {
3443 // Use hostname if set, because it has precedence
3444 if (!options.hostname) {
3445 options.hostname = options.host;
3446 }
3447 delete options.host;
3448 }
3449
3450 // Attach a callback if passed
3451 if (responseCallback) {
3452 this.on("response", responseCallback);
3453 }
3454
3455 // React to responses of native requests
3456 var self = this;
3457 this._onNativeResponse = function (response) {
3458 self._processResponse(response);
3459 };
3460
3461 // Complete the URL object when necessary
3462 if (!options.pathname && options.path) {
3463 var searchPos = options.path.indexOf("?");
3464 if (searchPos < 0) {
3465 options.pathname = options.path;
3466 }
3467 else {
3468 options.pathname = options.path.substring(0, searchPos);
3469 options.search = options.path.substring(searchPos);
3470 }
3471 }
3472
3473 // Perform the first request
3474 this._performRequest();
3475}
3476RedirectableRequest.prototype = Object.create(Writable.prototype);
3477
3478// Writes buffered data to the current native request
3479RedirectableRequest.prototype.write = function (data, encoding, callback) {
3480 // Validate input and shift parameters if necessary
3481 if (!(typeof data === "string" || typeof data === "object" && ("length" in data))) {
3482 throw new Error("data should be a string, Buffer or Uint8Array");
3483 }
3484 if (typeof encoding === "function") {
3485 callback = encoding;
3486 encoding = null;
3487 }
3488
3489 // Ignore empty buffers, since writing them doesn't invoke the callback
3490 // https://github.com/nodejs/node/issues/22066
3491 if (data.length === 0) {
3492 if (callback) {
3493 callback();
3494 }
3495 return;
3496 }
3497 // Only write when we don't exceed the maximum body length
3498 if (this._requestBodyLength + data.length <= this._options.maxBodyLength) {
3499 this._requestBodyLength += data.length;
3500 this._requestBodyBuffers.push({ data: data, encoding: encoding });
3501 this._currentRequest.write(data, encoding, callback);
3502 }
3503 // Error when we exceed the maximum body length
3504 else {
3505 this.emit("error", new Error("Request body larger than maxBodyLength limit"));
3506 this.abort();
3507 }
3508};
3509
3510// Ends the current native request
3511RedirectableRequest.prototype.end = function (data, encoding, callback) {
3512 // Shift parameters if necessary
3513 if (typeof data === "function") {
3514 callback = data;
3515 data = encoding = null;
3516 }
3517 else if (typeof encoding === "function") {
3518 callback = encoding;
3519 encoding = null;
3520 }
3521
3522 // Write data and end
3523 var currentRequest = this._currentRequest;
3524 this.write(data || "", encoding, function () {
3525 currentRequest.end(null, null, callback);
3526 });
3527};
3528
3529// Sets a header value on the current native request
3530RedirectableRequest.prototype.setHeader = function (name, value) {
3531 this._options.headers[name] = value;
3532 this._currentRequest.setHeader(name, value);
3533};
3534
3535// Clears a header value on the current native request
3536RedirectableRequest.prototype.removeHeader = function (name) {
3537 delete this._options.headers[name];
3538 this._currentRequest.removeHeader(name);
3539};
3540
3541// Proxy all other public ClientRequest methods
3542[
3543 "abort", "flushHeaders", "getHeader",
3544 "setNoDelay", "setSocketKeepAlive", "setTimeout",
3545].forEach(function (method) {
3546 RedirectableRequest.prototype[method] = function (a, b) {
3547 return this._currentRequest[method](a, b);
3548 };
3549});
3550
3551// Proxy all public ClientRequest properties
3552["aborted", "connection", "socket"].forEach(function (property) {
3553 Object.defineProperty(RedirectableRequest.prototype, property, {
3554 get: function () { return this._currentRequest[property]; },
3555 });
3556});
3557
3558// Executes the next native request (initial or redirect)
3559RedirectableRequest.prototype._performRequest = function () {
3560 // Load the native protocol
3561 var protocol = this._options.protocol;
3562 var nativeProtocol = this._options.nativeProtocols[protocol];
3563 if (!nativeProtocol) {
3564 this.emit("error", new Error("Unsupported protocol " + protocol));
3565 return;
3566 }
3567
3568 // If specified, use the agent corresponding to the protocol
3569 // (HTTP and HTTPS use different types of agents)
3570 if (this._options.agents) {
3571 var scheme = protocol.substr(0, protocol.length - 1);
3572 this._options.agent = this._options.agents[scheme];
3573 }
3574
3575 // Create the native request
3576 var request = this._currentRequest =
3577 nativeProtocol.request(this._options, this._onNativeResponse);
3578 this._currentUrl = url.format(this._options);
3579
3580 // Set up event handlers
3581 request._redirectable = this;
3582 for (var event in eventHandlers) {
3583 /* istanbul ignore else */
3584 if (event) {
3585 request.on(event, eventHandlers[event]);
3586 }
3587 }
3588
3589 // End a redirected request
3590 // (The first request must be ended explicitly with RedirectableRequest#end)
3591 if (this._isRedirect) {
3592 // Write the request entity and end.
3593 var i = 0;
3594 var buffers = this._requestBodyBuffers;
3595 (function writeNext() {
3596 if (i < buffers.length) {
3597 var buffer = buffers[i++];
3598 request.write(buffer.data, buffer.encoding, writeNext);
3599 }
3600 else {
3601 request.end();
3602 }
3603 }());
3604 }
3605};
3606
3607// Processes a response from the current native request
3608RedirectableRequest.prototype._processResponse = function (response) {
3609 // Store the redirected response
3610 if (this._options.trackRedirects) {
3611 this._redirects.push({
3612 url: this._currentUrl,
3613 headers: response.headers,
3614 statusCode: response.statusCode,
3615 });
3616 }
3617
3618 // RFC7231§6.4: The 3xx (Redirection) class of status code indicates
3619 // that further action needs to be taken by the user agent in order to
3620 // fulfill the request. If a Location header field is provided,
3621 // the user agent MAY automatically redirect its request to the URI
3622 // referenced by the Location field value,
3623 // even if the specific status code is not understood.
3624 var location = response.headers.location;
3625 if (location && this._options.followRedirects !== false &&
3626 response.statusCode >= 300 && response.statusCode < 400) {
3627 // RFC7231§6.4: A client SHOULD detect and intervene
3628 // in cyclical redirections (i.e., "infinite" redirection loops).
3629 if (++this._redirectCount > this._options.maxRedirects) {
3630 this.emit("error", new Error("Max redirects exceeded."));
3631 return;
3632 }
3633
3634 // RFC7231§6.4: Automatic redirection needs to done with
3635 // care for methods not known to be safe […],
3636 // since the user might not wish to redirect an unsafe request.
3637 // RFC7231§6.4.7: The 307 (Temporary Redirect) status code indicates
3638 // that the target resource resides temporarily under a different URI
3639 // and the user agent MUST NOT change the request method
3640 // if it performs an automatic redirection to that URI.
3641 var header;
3642 var headers = this._options.headers;
3643 if (response.statusCode !== 307 && !(this._options.method in SAFE_METHODS)) {
3644 this._options.method = "GET";
3645 // Drop a possible entity and headers related to it
3646 this._requestBodyBuffers = [];
3647 for (header in headers) {
3648 if (/^content-/i.test(header)) {
3649 delete headers[header];
3650 }
3651 }
3652 }
3653
3654 // Drop the Host header, as the redirect might lead to a different host
3655 if (!this._isRedirect) {
3656 for (header in headers) {
3657 if (/^host$/i.test(header)) {
3658 delete headers[header];
3659 }
3660 }
3661 }
3662
3663 // Perform the redirected request
3664 var redirectUrl = url.resolve(this._currentUrl, location);
3665 debug("redirecting to", redirectUrl);
3666 Object.assign(this._options, url.parse(redirectUrl));
3667 this._isRedirect = true;
3668 this._performRequest();
3669
3670 // Discard the remainder of the response to avoid waiting for data
3671 response.destroy();
3672 }
3673 else {
3674 // The response is not a redirect; return it as-is
3675 response.responseUrl = this._currentUrl;
3676 response.redirects = this._redirects;
3677 this.emit("response", response);
3678
3679 // Clean up
3680 this._requestBodyBuffers = [];
3681 }
3682};
3683
3684// Wraps the key/value object of protocols with redirect functionality
3685function wrap(protocols) {
3686 // Default settings
3687 var exports = {
3688 maxRedirects: 21,
3689 maxBodyLength: 10 * 1024 * 1024,
3690 };
3691
3692 // Wrap each protocol
3693 var nativeProtocols = {};
3694 Object.keys(protocols).forEach(function (scheme) {
3695 var protocol = scheme + ":";
3696 var nativeProtocol = nativeProtocols[protocol] = protocols[scheme];
3697 var wrappedProtocol = exports[scheme] = Object.create(nativeProtocol);
3698
3699 // Executes a request, following redirects
3700 wrappedProtocol.request = function (options, callback) {
3701 if (typeof options === "string") {
3702 options = url.parse(options);
3703 options.maxRedirects = exports.maxRedirects;
3704 }
3705 else {
3706 options = Object.assign({
3707 protocol: protocol,
3708 maxRedirects: exports.maxRedirects,
3709 maxBodyLength: exports.maxBodyLength,
3710 }, options);
3711 }
3712 options.nativeProtocols = nativeProtocols;
3713 assert.equal(options.protocol, protocol, "protocol mismatch");
3714 debug("options", options);
3715 return new RedirectableRequest(options, callback);
3716 };
3717
3718 // Executes a GET request, following redirects
3719 wrappedProtocol.get = function (options, callback) {
3720 var request = wrappedProtocol.request(options, callback);
3721 request.end();
3722 return request;
3723 };
3724 });
3725 return exports;
3726}
3727
3728// Exports
3729module.exports = wrap({ http: http, https: https });
3730module.exports.wrap = wrap;
3731
3732
3733/***/ }),
3734
3735/***/ "../node_modules/has-flag/index.js":
3736/*!*****************************************!*\
3737 !*** ../node_modules/has-flag/index.js ***!
3738 \*****************************************/
3739/*! no static exports found */
3740/***/ (function(module, exports, __webpack_require__) {
3741
3742"use strict";
3743
3744module.exports = (flag, argv) => {
3745 argv = argv || process.argv;
3746 const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
3747 const pos = argv.indexOf(prefix + flag);
3748 const terminatorPos = argv.indexOf('--');
3749 return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
3750};
3751
3752
3753/***/ }),
3754
3755/***/ "../node_modules/lodash/_Hash.js":
3756/*!***************************************!*\
3757 !*** ../node_modules/lodash/_Hash.js ***!
3758 \***************************************/
3759/*! no static exports found */
3760/***/ (function(module, exports, __webpack_require__) {
3761
3762var hashClear = __webpack_require__(/*! ./_hashClear */ "../node_modules/lodash/_hashClear.js"),
3763 hashDelete = __webpack_require__(/*! ./_hashDelete */ "../node_modules/lodash/_hashDelete.js"),
3764 hashGet = __webpack_require__(/*! ./_hashGet */ "../node_modules/lodash/_hashGet.js"),
3765 hashHas = __webpack_require__(/*! ./_hashHas */ "../node_modules/lodash/_hashHas.js"),
3766 hashSet = __webpack_require__(/*! ./_hashSet */ "../node_modules/lodash/_hashSet.js");
3767
3768/**
3769 * Creates a hash object.
3770 *
3771 * @private
3772 * @constructor
3773 * @param {Array} [entries] The key-value pairs to cache.
3774 */
3775function Hash(entries) {
3776 var index = -1,
3777 length = entries == null ? 0 : entries.length;
3778
3779 this.clear();
3780 while (++index < length) {
3781 var entry = entries[index];
3782 this.set(entry[0], entry[1]);
3783 }
3784}
3785
3786// Add methods to `Hash`.
3787Hash.prototype.clear = hashClear;
3788Hash.prototype['delete'] = hashDelete;
3789Hash.prototype.get = hashGet;
3790Hash.prototype.has = hashHas;
3791Hash.prototype.set = hashSet;
3792
3793module.exports = Hash;
3794
3795
3796/***/ }),
3797
3798/***/ "../node_modules/lodash/_ListCache.js":
3799/*!********************************************!*\
3800 !*** ../node_modules/lodash/_ListCache.js ***!
3801 \********************************************/
3802/*! no static exports found */
3803/***/ (function(module, exports, __webpack_require__) {
3804
3805var listCacheClear = __webpack_require__(/*! ./_listCacheClear */ "../node_modules/lodash/_listCacheClear.js"),
3806 listCacheDelete = __webpack_require__(/*! ./_listCacheDelete */ "../node_modules/lodash/_listCacheDelete.js"),
3807 listCacheGet = __webpack_require__(/*! ./_listCacheGet */ "../node_modules/lodash/_listCacheGet.js"),
3808 listCacheHas = __webpack_require__(/*! ./_listCacheHas */ "../node_modules/lodash/_listCacheHas.js"),
3809 listCacheSet = __webpack_require__(/*! ./_listCacheSet */ "../node_modules/lodash/_listCacheSet.js");
3810
3811/**
3812 * Creates an list cache object.
3813 *
3814 * @private
3815 * @constructor
3816 * @param {Array} [entries] The key-value pairs to cache.
3817 */
3818function ListCache(entries) {
3819 var index = -1,
3820 length = entries == null ? 0 : entries.length;
3821
3822 this.clear();
3823 while (++index < length) {
3824 var entry = entries[index];
3825 this.set(entry[0], entry[1]);
3826 }
3827}
3828
3829// Add methods to `ListCache`.
3830ListCache.prototype.clear = listCacheClear;
3831ListCache.prototype['delete'] = listCacheDelete;
3832ListCache.prototype.get = listCacheGet;
3833ListCache.prototype.has = listCacheHas;
3834ListCache.prototype.set = listCacheSet;
3835
3836module.exports = ListCache;
3837
3838
3839/***/ }),
3840
3841/***/ "../node_modules/lodash/_Map.js":
3842/*!**************************************!*\
3843 !*** ../node_modules/lodash/_Map.js ***!
3844 \**************************************/
3845/*! no static exports found */
3846/***/ (function(module, exports, __webpack_require__) {
3847
3848var getNative = __webpack_require__(/*! ./_getNative */ "../node_modules/lodash/_getNative.js"),
3849 root = __webpack_require__(/*! ./_root */ "../node_modules/lodash/_root.js");
3850
3851/* Built-in method references that are verified to be native. */
3852var Map = getNative(root, 'Map');
3853
3854module.exports = Map;
3855
3856
3857/***/ }),
3858
3859/***/ "../node_modules/lodash/_MapCache.js":
3860/*!*******************************************!*\
3861 !*** ../node_modules/lodash/_MapCache.js ***!
3862 \*******************************************/
3863/*! no static exports found */
3864/***/ (function(module, exports, __webpack_require__) {
3865
3866var mapCacheClear = __webpack_require__(/*! ./_mapCacheClear */ "../node_modules/lodash/_mapCacheClear.js"),
3867 mapCacheDelete = __webpack_require__(/*! ./_mapCacheDelete */ "../node_modules/lodash/_mapCacheDelete.js"),
3868 mapCacheGet = __webpack_require__(/*! ./_mapCacheGet */ "../node_modules/lodash/_mapCacheGet.js"),
3869 mapCacheHas = __webpack_require__(/*! ./_mapCacheHas */ "../node_modules/lodash/_mapCacheHas.js"),
3870 mapCacheSet = __webpack_require__(/*! ./_mapCacheSet */ "../node_modules/lodash/_mapCacheSet.js");
3871
3872/**
3873 * Creates a map cache object to store key-value pairs.
3874 *
3875 * @private
3876 * @constructor
3877 * @param {Array} [entries] The key-value pairs to cache.
3878 */
3879function MapCache(entries) {
3880 var index = -1,
3881 length = entries == null ? 0 : entries.length;
3882
3883 this.clear();
3884 while (++index < length) {
3885 var entry = entries[index];
3886 this.set(entry[0], entry[1]);
3887 }
3888}
3889
3890// Add methods to `MapCache`.
3891MapCache.prototype.clear = mapCacheClear;
3892MapCache.prototype['delete'] = mapCacheDelete;
3893MapCache.prototype.get = mapCacheGet;
3894MapCache.prototype.has = mapCacheHas;
3895MapCache.prototype.set = mapCacheSet;
3896
3897module.exports = MapCache;
3898
3899
3900/***/ }),
3901
3902/***/ "../node_modules/lodash/_Stack.js":
3903/*!****************************************!*\
3904 !*** ../node_modules/lodash/_Stack.js ***!
3905 \****************************************/
3906/*! no static exports found */
3907/***/ (function(module, exports, __webpack_require__) {
3908
3909var ListCache = __webpack_require__(/*! ./_ListCache */ "../node_modules/lodash/_ListCache.js"),
3910 stackClear = __webpack_require__(/*! ./_stackClear */ "../node_modules/lodash/_stackClear.js"),
3911 stackDelete = __webpack_require__(/*! ./_stackDelete */ "../node_modules/lodash/_stackDelete.js"),
3912 stackGet = __webpack_require__(/*! ./_stackGet */ "../node_modules/lodash/_stackGet.js"),
3913 stackHas = __webpack_require__(/*! ./_stackHas */ "../node_modules/lodash/_stackHas.js"),
3914 stackSet = __webpack_require__(/*! ./_stackSet */ "../node_modules/lodash/_stackSet.js");
3915
3916/**
3917 * Creates a stack cache object to store key-value pairs.
3918 *
3919 * @private
3920 * @constructor
3921 * @param {Array} [entries] The key-value pairs to cache.
3922 */
3923function Stack(entries) {
3924 var data = this.__data__ = new ListCache(entries);
3925 this.size = data.size;
3926}
3927
3928// Add methods to `Stack`.
3929Stack.prototype.clear = stackClear;
3930Stack.prototype['delete'] = stackDelete;
3931Stack.prototype.get = stackGet;
3932Stack.prototype.has = stackHas;
3933Stack.prototype.set = stackSet;
3934
3935module.exports = Stack;
3936
3937
3938/***/ }),
3939
3940/***/ "../node_modules/lodash/_arrayEach.js":
3941/*!********************************************!*\
3942 !*** ../node_modules/lodash/_arrayEach.js ***!
3943 \********************************************/
3944/*! no static exports found */
3945/***/ (function(module, exports) {
3946
3947/**
3948 * A specialized version of `_.forEach` for arrays without support for
3949 * iteratee shorthands.
3950 *
3951 * @private
3952 * @param {Array} [array] The array to iterate over.
3953 * @param {Function} iteratee The function invoked per iteration.
3954 * @returns {Array} Returns `array`.
3955 */
3956function arrayEach(array, iteratee) {
3957 var index = -1,
3958 length = array == null ? 0 : array.length;
3959
3960 while (++index < length) {
3961 if (iteratee(array[index], index, array) === false) {
3962 break;
3963 }
3964 }
3965 return array;
3966}
3967
3968module.exports = arrayEach;
3969
3970
3971/***/ }),
3972
3973/***/ "../node_modules/lodash/_assignValue.js":
3974/*!**********************************************!*\
3975 !*** ../node_modules/lodash/_assignValue.js ***!
3976 \**********************************************/
3977/*! no static exports found */
3978/***/ (function(module, exports, __webpack_require__) {
3979
3980var baseAssignValue = __webpack_require__(/*! ./_baseAssignValue */ "../node_modules/lodash/_baseAssignValue.js"),
3981 eq = __webpack_require__(/*! ./eq */ "../node_modules/lodash/eq.js");
3982
3983/** Used for built-in method references. */
3984var objectProto = Object.prototype;
3985
3986/** Used to check objects for own properties. */
3987var hasOwnProperty = objectProto.hasOwnProperty;
3988
3989/**
3990 * Assigns `value` to `key` of `object` if the existing value is not equivalent
3991 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
3992 * for equality comparisons.
3993 *
3994 * @private
3995 * @param {Object} object The object to modify.
3996 * @param {string} key The key of the property to assign.
3997 * @param {*} value The value to assign.
3998 */
3999function assignValue(object, key, value) {
4000 var objValue = object[key];
4001 if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
4002 (value === undefined && !(key in object))) {
4003 baseAssignValue(object, key, value);
4004 }
4005}
4006
4007module.exports = assignValue;
4008
4009
4010/***/ }),
4011
4012/***/ "../node_modules/lodash/_assocIndexOf.js":
4013/*!***********************************************!*\
4014 !*** ../node_modules/lodash/_assocIndexOf.js ***!
4015 \***********************************************/
4016/*! no static exports found */
4017/***/ (function(module, exports, __webpack_require__) {
4018
4019var eq = __webpack_require__(/*! ./eq */ "../node_modules/lodash/eq.js");
4020
4021/**
4022 * Gets the index at which the `key` is found in `array` of key-value pairs.
4023 *
4024 * @private
4025 * @param {Array} array The array to inspect.
4026 * @param {*} key The key to search for.
4027 * @returns {number} Returns the index of the matched value, else `-1`.
4028 */
4029function assocIndexOf(array, key) {
4030 var length = array.length;
4031 while (length--) {
4032 if (eq(array[length][0], key)) {
4033 return length;
4034 }
4035 }
4036 return -1;
4037}
4038
4039module.exports = assocIndexOf;
4040
4041
4042/***/ }),
4043
4044/***/ "../node_modules/lodash/_baseAssign.js":
4045/*!*********************************************!*\
4046 !*** ../node_modules/lodash/_baseAssign.js ***!
4047 \*********************************************/
4048/*! no static exports found */
4049/***/ (function(module, exports, __webpack_require__) {
4050
4051var copyObject = __webpack_require__(/*! ./_copyObject */ "../node_modules/lodash/_copyObject.js"),
4052 keys = __webpack_require__(/*! ./keys */ "../node_modules/lodash/keys.js");
4053
4054/**
4055 * The base implementation of `_.assign` without support for multiple sources
4056 * or `customizer` functions.
4057 *
4058 * @private
4059 * @param {Object} object The destination object.
4060 * @param {Object} source The source object.
4061 * @returns {Object} Returns `object`.
4062 */
4063function baseAssign(object, source) {
4064 return object && copyObject(source, keys(source), object);
4065}
4066
4067module.exports = baseAssign;
4068
4069
4070/***/ }),
4071
4072/***/ "../node_modules/lodash/_baseAssignIn.js":
4073/*!***********************************************!*\
4074 !*** ../node_modules/lodash/_baseAssignIn.js ***!
4075 \***********************************************/
4076/*! no static exports found */
4077/***/ (function(module, exports, __webpack_require__) {
4078
4079var copyObject = __webpack_require__(/*! ./_copyObject */ "../node_modules/lodash/_copyObject.js"),
4080 keysIn = __webpack_require__(/*! ./keysIn */ "../node_modules/lodash/keysIn.js");
4081
4082/**
4083 * The base implementation of `_.assignIn` without support for multiple sources
4084 * or `customizer` functions.
4085 *
4086 * @private
4087 * @param {Object} object The destination object.
4088 * @param {Object} source The source object.
4089 * @returns {Object} Returns `object`.
4090 */
4091function baseAssignIn(object, source) {
4092 return object && copyObject(source, keysIn(source), object);
4093}
4094
4095module.exports = baseAssignIn;
4096
4097
4098/***/ }),
4099
4100/***/ "../node_modules/lodash/_baseAssignValue.js":
4101/*!**************************************************!*\
4102 !*** ../node_modules/lodash/_baseAssignValue.js ***!
4103 \**************************************************/
4104/*! no static exports found */
4105/***/ (function(module, exports, __webpack_require__) {
4106
4107var defineProperty = __webpack_require__(/*! ./_defineProperty */ "../node_modules/lodash/_defineProperty.js");
4108
4109/**
4110 * The base implementation of `assignValue` and `assignMergeValue` without
4111 * value checks.
4112 *
4113 * @private
4114 * @param {Object} object The object to modify.
4115 * @param {string} key The key of the property to assign.
4116 * @param {*} value The value to assign.
4117 */
4118function baseAssignValue(object, key, value) {
4119 if (key == '__proto__' && defineProperty) {
4120 defineProperty(object, key, {
4121 'configurable': true,
4122 'enumerable': true,
4123 'value': value,
4124 'writable': true
4125 });
4126 } else {
4127 object[key] = value;
4128 }
4129}
4130
4131module.exports = baseAssignValue;
4132
4133
4134/***/ }),
4135
4136/***/ "../node_modules/lodash/_baseClone.js":
4137/*!********************************************!*\
4138 !*** ../node_modules/lodash/_baseClone.js ***!
4139 \********************************************/
4140/*! no static exports found */
4141/***/ (function(module, exports, __webpack_require__) {
4142
4143var Stack = __webpack_require__(/*! ./_Stack */ "../node_modules/lodash/_Stack.js"),
4144 arrayEach = __webpack_require__(/*! ./_arrayEach */ "../node_modules/lodash/_arrayEach.js"),
4145 assignValue = __webpack_require__(/*! ./_assignValue */ "../node_modules/lodash/_assignValue.js"),
4146 baseAssign = __webpack_require__(/*! ./_baseAssign */ "../node_modules/lodash/_baseAssign.js"),
4147 baseAssignIn = __webpack_require__(/*! ./_baseAssignIn */ "../node_modules/lodash/_baseAssignIn.js"),
4148 cloneBuffer = __webpack_require__(/*! ./_cloneBuffer */ "../node_modules/lodash/_cloneBuffer.js"),
4149 copyArray = __webpack_require__(/*! ./_copyArray */ "../node_modules/lodash/_copyArray.js"),
4150 copySymbols = __webpack_require__(/*! ./_copySymbols */ "../node_modules/lodash/_copySymbols.js"),
4151 copySymbolsIn = __webpack_require__(/*! ./_copySymbolsIn */ "../node_modules/lodash/_copySymbolsIn.js"),
4152 getAllKeys = __webpack_require__(/*! ./_getAllKeys */ "../node_modules/lodash/_getAllKeys.js"),
4153 getAllKeysIn = __webpack_require__(/*! ./_getAllKeysIn */ "../node_modules/lodash/_getAllKeysIn.js"),
4154 getTag = __webpack_require__(/*! ./_getTag */ "../node_modules/lodash/_getTag.js"),
4155 initCloneArray = __webpack_require__(/*! ./_initCloneArray */ "../node_modules/lodash/_initCloneArray.js"),
4156 initCloneByTag = __webpack_require__(/*! ./_initCloneByTag */ "../node_modules/lodash/_initCloneByTag.js"),
4157 initCloneObject = __webpack_require__(/*! ./_initCloneObject */ "../node_modules/lodash/_initCloneObject.js"),
4158 isArray = __webpack_require__(/*! ./isArray */ "../node_modules/lodash/isArray.js"),
4159 isBuffer = __webpack_require__(/*! ./isBuffer */ "../node_modules/lodash/isBuffer.js"),
4160 isMap = __webpack_require__(/*! ./isMap */ "../node_modules/lodash/isMap.js"),
4161 isObject = __webpack_require__(/*! ./isObject */ "../node_modules/lodash/isObject.js"),
4162 isSet = __webpack_require__(/*! ./isSet */ "../node_modules/lodash/isSet.js"),
4163 keys = __webpack_require__(/*! ./keys */ "../node_modules/lodash/keys.js");
4164
4165/** Used to compose bitmasks for cloning. */
4166var CLONE_DEEP_FLAG = 1,
4167 CLONE_FLAT_FLAG = 2,
4168 CLONE_SYMBOLS_FLAG = 4;
4169
4170/** `Object#toString` result references. */
4171var argsTag = '[object Arguments]',
4172 arrayTag = '[object Array]',
4173 boolTag = '[object Boolean]',
4174 dateTag = '[object Date]',
4175 errorTag = '[object Error]',
4176 funcTag = '[object Function]',
4177 genTag = '[object GeneratorFunction]',
4178 mapTag = '[object Map]',
4179 numberTag = '[object Number]',
4180 objectTag = '[object Object]',
4181 regexpTag = '[object RegExp]',
4182 setTag = '[object Set]',
4183 stringTag = '[object String]',
4184 symbolTag = '[object Symbol]',
4185 weakMapTag = '[object WeakMap]';
4186
4187var arrayBufferTag = '[object ArrayBuffer]',
4188 dataViewTag = '[object DataView]',
4189 float32Tag = '[object Float32Array]',
4190 float64Tag = '[object Float64Array]',
4191 int8Tag = '[object Int8Array]',
4192 int16Tag = '[object Int16Array]',
4193 int32Tag = '[object Int32Array]',
4194 uint8Tag = '[object Uint8Array]',
4195 uint8ClampedTag = '[object Uint8ClampedArray]',
4196 uint16Tag = '[object Uint16Array]',
4197 uint32Tag = '[object Uint32Array]';
4198
4199/** Used to identify `toStringTag` values supported by `_.clone`. */
4200var cloneableTags = {};
4201cloneableTags[argsTag] = cloneableTags[arrayTag] =
4202cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
4203cloneableTags[boolTag] = cloneableTags[dateTag] =
4204cloneableTags[float32Tag] = cloneableTags[float64Tag] =
4205cloneableTags[int8Tag] = cloneableTags[int16Tag] =
4206cloneableTags[int32Tag] = cloneableTags[mapTag] =
4207cloneableTags[numberTag] = cloneableTags[objectTag] =
4208cloneableTags[regexpTag] = cloneableTags[setTag] =
4209cloneableTags[stringTag] = cloneableTags[symbolTag] =
4210cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
4211cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
4212cloneableTags[errorTag] = cloneableTags[funcTag] =
4213cloneableTags[weakMapTag] = false;
4214
4215/**
4216 * The base implementation of `_.clone` and `_.cloneDeep` which tracks
4217 * traversed objects.
4218 *
4219 * @private
4220 * @param {*} value The value to clone.
4221 * @param {boolean} bitmask The bitmask flags.
4222 * 1 - Deep clone
4223 * 2 - Flatten inherited properties
4224 * 4 - Clone symbols
4225 * @param {Function} [customizer] The function to customize cloning.
4226 * @param {string} [key] The key of `value`.
4227 * @param {Object} [object] The parent object of `value`.
4228 * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
4229 * @returns {*} Returns the cloned value.
4230 */
4231function baseClone(value, bitmask, customizer, key, object, stack) {
4232 var result,
4233 isDeep = bitmask & CLONE_DEEP_FLAG,
4234 isFlat = bitmask & CLONE_FLAT_FLAG,
4235 isFull = bitmask & CLONE_SYMBOLS_FLAG;
4236
4237 if (customizer) {
4238 result = object ? customizer(value, key, object, stack) : customizer(value);
4239 }
4240 if (result !== undefined) {
4241 return result;
4242 }
4243 if (!isObject(value)) {
4244 return value;
4245 }
4246 var isArr = isArray(value);
4247 if (isArr) {
4248 result = initCloneArray(value);
4249 if (!isDeep) {
4250 return copyArray(value, result);
4251 }
4252 } else {
4253 var tag = getTag(value),
4254 isFunc = tag == funcTag || tag == genTag;
4255
4256 if (isBuffer(value)) {
4257 return cloneBuffer(value, isDeep);
4258 }
4259 if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
4260 result = (isFlat || isFunc) ? {} : initCloneObject(value);
4261 if (!isDeep) {
4262 return isFlat
4263 ? copySymbolsIn(value, baseAssignIn(result, value))
4264 : copySymbols(value, baseAssign(result, value));
4265 }
4266 } else {
4267 if (!cloneableTags[tag]) {
4268 return object ? value : {};
4269 }
4270 result = initCloneByTag(value, tag, isDeep);
4271 }
4272 }
4273 // Check for circular references and return its corresponding clone.
4274 stack || (stack = new Stack);
4275 var stacked = stack.get(value);
4276 if (stacked) {
4277 return stacked;
4278 }
4279 stack.set(value, result);
4280
4281 if (isSet(value)) {
4282 value.forEach(function(subValue) {
4283 result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
4284 });
4285 } else if (isMap(value)) {
4286 value.forEach(function(subValue, key) {
4287 result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
4288 });
4289 }
4290
4291 var keysFunc = isFull
4292 ? (isFlat ? getAllKeysIn : getAllKeys)
4293 : (isFlat ? keysIn : keys);
4294
4295 var props = isArr ? undefined : keysFunc(value);
4296 arrayEach(props || value, function(subValue, key) {
4297 if (props) {
4298 key = subValue;
4299 subValue = value[key];
4300 }
4301 // Recursively populate clone (susceptible to call stack limits).
4302 assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
4303 });
4304 return result;
4305}
4306
4307module.exports = baseClone;
4308
4309
4310/***/ }),
4311
4312/***/ "../node_modules/lodash/_baseCreate.js":
4313/*!*********************************************!*\
4314 !*** ../node_modules/lodash/_baseCreate.js ***!
4315 \*********************************************/
4316/*! no static exports found */
4317/***/ (function(module, exports, __webpack_require__) {
4318
4319var isObject = __webpack_require__(/*! ./isObject */ "../node_modules/lodash/isObject.js");
4320
4321/** Built-in value references. */
4322var objectCreate = Object.create;
4323
4324/**
4325 * The base implementation of `_.create` without support for assigning
4326 * properties to the created object.
4327 *
4328 * @private
4329 * @param {Object} proto The object to inherit from.
4330 * @returns {Object} Returns the new object.
4331 */
4332var baseCreate = (function() {
4333 function object() {}
4334 return function(proto) {
4335 if (!isObject(proto)) {
4336 return {};
4337 }
4338 if (objectCreate) {
4339 return objectCreate(proto);
4340 }
4341 object.prototype = proto;
4342 var result = new object;
4343 object.prototype = undefined;
4344 return result;
4345 };
4346}());
4347
4348module.exports = baseCreate;
4349
4350
4351/***/ }),
4352
4353/***/ "../node_modules/lodash/_baseGet.js":
4354/*!******************************************!*\
4355 !*** ../node_modules/lodash/_baseGet.js ***!
4356 \******************************************/
4357/*! no static exports found */
4358/***/ (function(module, exports) {
4359
4360/**
4361 * Gets the value at `key` of `object`.
4362 *
4363 * @private
4364 * @param {Object} [object] The object to query.
4365 * @param {string} key The key of the property to get.
4366 * @returns {*} Returns the property value.
4367 */
4368function getValue(object, key) {
4369 return object == null ? undefined : object[key];
4370}
4371
4372module.exports = getValue;
4373
4374
4375/***/ }),
4376
4377/***/ "../node_modules/lodash/_baseGetTag.js":
4378/*!*********************************************!*\
4379 !*** ../node_modules/lodash/_baseGetTag.js ***!
4380 \*********************************************/
4381/*! no static exports found */
4382/***/ (function(module, exports) {
4383
4384/** Used for built-in method references. */
4385var objectProto = Object.prototype;
4386
4387/**
4388 * Used to resolve the
4389 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
4390 * of values.
4391 */
4392var nativeObjectToString = objectProto.toString;
4393
4394/**
4395 * Converts `value` to a string using `Object.prototype.toString`.
4396 *
4397 * @private
4398 * @param {*} value The value to convert.
4399 * @returns {string} Returns the converted string.
4400 */
4401function objectToString(value) {
4402 return nativeObjectToString.call(value);
4403}
4404
4405module.exports = objectToString;
4406
4407
4408/***/ }),
4409
4410/***/ "../node_modules/lodash/_cloneBuffer.js":
4411/*!**********************************************!*\
4412 !*** ../node_modules/lodash/_cloneBuffer.js ***!
4413 \**********************************************/
4414/*! no static exports found */
4415/***/ (function(module, exports, __webpack_require__) {
4416
4417/* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(/*! ./_root */ "../node_modules/lodash/_root.js");
4418
4419/** Detect free variable `exports`. */
4420var freeExports = true && exports && !exports.nodeType && exports;
4421
4422/** Detect free variable `module`. */
4423var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
4424
4425/** Detect the popular CommonJS extension `module.exports`. */
4426var moduleExports = freeModule && freeModule.exports === freeExports;
4427
4428/** Built-in value references. */
4429var Buffer = moduleExports ? root.Buffer : undefined,
4430 allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
4431
4432/**
4433 * Creates a clone of `buffer`.
4434 *
4435 * @private
4436 * @param {Buffer} buffer The buffer to clone.
4437 * @param {boolean} [isDeep] Specify a deep clone.
4438 * @returns {Buffer} Returns the cloned buffer.
4439 */
4440function cloneBuffer(buffer, isDeep) {
4441 if (isDeep) {
4442 return buffer.slice();
4443 }
4444 var length = buffer.length,
4445 result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
4446
4447 buffer.copy(result);
4448 return result;
4449}
4450
4451module.exports = cloneBuffer;
4452
4453/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/module.js */ "../node_modules/webpack/buildin/module.js")(module)))
4454
4455/***/ }),
4456
4457/***/ "../node_modules/lodash/_copyArray.js":
4458/*!********************************************!*\
4459 !*** ../node_modules/lodash/_copyArray.js ***!
4460 \********************************************/
4461/*! no static exports found */
4462/***/ (function(module, exports) {
4463
4464/**
4465 * Copies the values of `source` to `array`.
4466 *
4467 * @private
4468 * @param {Array} source The array to copy values from.
4469 * @param {Array} [array=[]] The array to copy values to.
4470 * @returns {Array} Returns `array`.
4471 */
4472function copyArray(source, array) {
4473 var index = -1,
4474 length = source.length;
4475
4476 array || (array = Array(length));
4477 while (++index < length) {
4478 array[index] = source[index];
4479 }
4480 return array;
4481}
4482
4483module.exports = copyArray;
4484
4485
4486/***/ }),
4487
4488/***/ "../node_modules/lodash/_copyObject.js":
4489/*!*********************************************!*\
4490 !*** ../node_modules/lodash/_copyObject.js ***!
4491 \*********************************************/
4492/*! no static exports found */
4493/***/ (function(module, exports, __webpack_require__) {
4494
4495var assignValue = __webpack_require__(/*! ./_assignValue */ "../node_modules/lodash/_assignValue.js"),
4496 baseAssignValue = __webpack_require__(/*! ./_baseAssignValue */ "../node_modules/lodash/_baseAssignValue.js");
4497
4498/**
4499 * Copies properties of `source` to `object`.
4500 *
4501 * @private
4502 * @param {Object} source The object to copy properties from.
4503 * @param {Array} props The property identifiers to copy.
4504 * @param {Object} [object={}] The object to copy properties to.
4505 * @param {Function} [customizer] The function to customize copied values.
4506 * @returns {Object} Returns `object`.
4507 */
4508function copyObject(source, props, object, customizer) {
4509 var isNew = !object;
4510 object || (object = {});
4511
4512 var index = -1,
4513 length = props.length;
4514
4515 while (++index < length) {
4516 var key = props[index];
4517
4518 var newValue = customizer
4519 ? customizer(object[key], source[key], key, object, source)
4520 : undefined;
4521
4522 if (newValue === undefined) {
4523 newValue = source[key];
4524 }
4525 if (isNew) {
4526 baseAssignValue(object, key, newValue);
4527 } else {
4528 assignValue(object, key, newValue);
4529 }
4530 }
4531 return object;
4532}
4533
4534module.exports = copyObject;
4535
4536
4537/***/ }),
4538
4539/***/ "../node_modules/lodash/_copySymbols.js":
4540/*!**********************************************!*\
4541 !*** ../node_modules/lodash/_copySymbols.js ***!
4542 \**********************************************/
4543/*! no static exports found */
4544/***/ (function(module, exports, __webpack_require__) {
4545
4546var copyObject = __webpack_require__(/*! ./_copyObject */ "../node_modules/lodash/_copyObject.js"),
4547 getSymbols = __webpack_require__(/*! ./_getSymbols */ "../node_modules/lodash/_getSymbols.js");
4548
4549/**
4550 * Copies own symbols of `source` to `object`.
4551 *
4552 * @private
4553 * @param {Object} source The object to copy symbols from.
4554 * @param {Object} [object={}] The object to copy symbols to.
4555 * @returns {Object} Returns `object`.
4556 */
4557function copySymbols(source, object) {
4558 return copyObject(source, getSymbols(source), object);
4559}
4560
4561module.exports = copySymbols;
4562
4563
4564/***/ }),
4565
4566/***/ "../node_modules/lodash/_copySymbolsIn.js":
4567/*!************************************************!*\
4568 !*** ../node_modules/lodash/_copySymbolsIn.js ***!
4569 \************************************************/
4570/*! no static exports found */
4571/***/ (function(module, exports, __webpack_require__) {
4572
4573var copyObject = __webpack_require__(/*! ./_copyObject */ "../node_modules/lodash/_copyObject.js"),
4574 getSymbolsIn = __webpack_require__(/*! ./_getSymbolsIn */ "../node_modules/lodash/_getSymbolsIn.js");
4575
4576/**
4577 * Copies own and inherited symbols of `source` to `object`.
4578 *
4579 * @private
4580 * @param {Object} source The object to copy symbols from.
4581 * @param {Object} [object={}] The object to copy symbols to.
4582 * @returns {Object} Returns `object`.
4583 */
4584function copySymbolsIn(source, object) {
4585 return copyObject(source, getSymbolsIn(source), object);
4586}
4587
4588module.exports = copySymbolsIn;
4589
4590
4591/***/ }),
4592
4593/***/ "../node_modules/lodash/_defineProperty.js":
4594/*!*************************************************!*\
4595 !*** ../node_modules/lodash/_defineProperty.js ***!
4596 \*************************************************/
4597/*! no static exports found */
4598/***/ (function(module, exports, __webpack_require__) {
4599
4600var getNative = __webpack_require__(/*! ./_getNative */ "../node_modules/lodash/_getNative.js");
4601
4602var defineProperty = (function() {
4603 try {
4604 var func = getNative(Object, 'defineProperty');
4605 func({}, '', {});
4606 return func;
4607 } catch (e) {}
4608}());
4609
4610module.exports = defineProperty;
4611
4612
4613/***/ }),
4614
4615/***/ "../node_modules/lodash/_freeGlobal.js":
4616/*!*********************************************!*\
4617 !*** ../node_modules/lodash/_freeGlobal.js ***!
4618 \*********************************************/
4619/*! no static exports found */
4620/***/ (function(module, exports) {
4621
4622/** Detect free variable `global` from Node.js. */
4623var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
4624
4625module.exports = freeGlobal;
4626
4627
4628/***/ }),
4629
4630/***/ "../node_modules/lodash/_getAllKeys.js":
4631/*!*********************************************!*\
4632 !*** ../node_modules/lodash/_getAllKeys.js ***!
4633 \*********************************************/
4634/*! no static exports found */
4635/***/ (function(module, exports, __webpack_require__) {
4636
4637var overArg = __webpack_require__(/*! ./_overArg */ "../node_modules/lodash/_overArg.js");
4638
4639/* Built-in method references for those with the same name as other `lodash` methods. */
4640var nativeKeys = overArg(Object.keys, Object);
4641
4642module.exports = nativeKeys;
4643
4644
4645/***/ }),
4646
4647/***/ "../node_modules/lodash/_getAllKeysIn.js":
4648/*!***********************************************!*\
4649 !*** ../node_modules/lodash/_getAllKeysIn.js ***!
4650 \***********************************************/
4651/*! no static exports found */
4652/***/ (function(module, exports) {
4653
4654/**
4655 * This function is like
4656 * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
4657 * except that it includes inherited enumerable properties.
4658 *
4659 * @private
4660 * @param {Object} object The object to query.
4661 * @returns {Array} Returns the array of property names.
4662 */
4663function nativeKeysIn(object) {
4664 var result = [];
4665 if (object != null) {
4666 for (var key in Object(object)) {
4667 result.push(key);
4668 }
4669 }
4670 return result;
4671}
4672
4673module.exports = nativeKeysIn;
4674
4675
4676/***/ }),
4677
4678/***/ "../node_modules/lodash/_getMapData.js":
4679/*!*********************************************!*\
4680 !*** ../node_modules/lodash/_getMapData.js ***!
4681 \*********************************************/
4682/*! no static exports found */
4683/***/ (function(module, exports, __webpack_require__) {
4684
4685var isKeyable = __webpack_require__(/*! ./_isKeyable */ "../node_modules/lodash/_isKeyable.js");
4686
4687/**
4688 * Gets the data for `map`.
4689 *
4690 * @private
4691 * @param {Object} map The map to query.
4692 * @param {string} key The reference key.
4693 * @returns {*} Returns the map data.
4694 */
4695function getMapData(map, key) {
4696 var data = map.__data__;
4697 return isKeyable(key)
4698 ? data[typeof key == 'string' ? 'string' : 'hash']
4699 : data.map;
4700}
4701
4702module.exports = getMapData;
4703
4704
4705/***/ }),
4706
4707/***/ "../node_modules/lodash/_getNative.js":
4708/*!********************************************!*\
4709 !*** ../node_modules/lodash/_getNative.js ***!
4710 \********************************************/
4711/*! no static exports found */
4712/***/ (function(module, exports) {
4713
4714/**
4715 * Gets the value at `key` of `object`.
4716 *
4717 * @private
4718 * @param {Object} [object] The object to query.
4719 * @param {string} key The key of the property to get.
4720 * @returns {*} Returns the property value.
4721 */
4722function getValue(object, key) {
4723 return object == null ? undefined : object[key];
4724}
4725
4726module.exports = getValue;
4727
4728
4729/***/ }),
4730
4731/***/ "../node_modules/lodash/_getPrototype.js":
4732/*!***********************************************!*\
4733 !*** ../node_modules/lodash/_getPrototype.js ***!
4734 \***********************************************/
4735/*! no static exports found */
4736/***/ (function(module, exports, __webpack_require__) {
4737
4738var overArg = __webpack_require__(/*! ./_overArg */ "../node_modules/lodash/_overArg.js");
4739
4740/** Built-in value references. */
4741var getPrototype = overArg(Object.getPrototypeOf, Object);
4742
4743module.exports = getPrototype;
4744
4745
4746/***/ }),
4747
4748/***/ "../node_modules/lodash/_getSymbols.js":
4749/*!*********************************************!*\
4750 !*** ../node_modules/lodash/_getSymbols.js ***!
4751 \*********************************************/
4752/*! no static exports found */
4753/***/ (function(module, exports) {
4754
4755/**
4756 * This method returns a new empty array.
4757 *
4758 * @static
4759 * @memberOf _
4760 * @since 4.13.0
4761 * @category Util
4762 * @returns {Array} Returns the new empty array.
4763 * @example
4764 *
4765 * var arrays = _.times(2, _.stubArray);
4766 *
4767 * console.log(arrays);
4768 * // => [[], []]
4769 *
4770 * console.log(arrays[0] === arrays[1]);
4771 * // => false
4772 */
4773function stubArray() {
4774 return [];
4775}
4776
4777module.exports = stubArray;
4778
4779
4780/***/ }),
4781
4782/***/ "../node_modules/lodash/_getSymbolsIn.js":
4783/*!***********************************************!*\
4784 !*** ../node_modules/lodash/_getSymbolsIn.js ***!
4785 \***********************************************/
4786/*! no static exports found */
4787/***/ (function(module, exports) {
4788
4789/**
4790 * This method returns a new empty array.
4791 *
4792 * @static
4793 * @memberOf _
4794 * @since 4.13.0
4795 * @category Util
4796 * @returns {Array} Returns the new empty array.
4797 * @example
4798 *
4799 * var arrays = _.times(2, _.stubArray);
4800 *
4801 * console.log(arrays);
4802 * // => [[], []]
4803 *
4804 * console.log(arrays[0] === arrays[1]);
4805 * // => false
4806 */
4807function stubArray() {
4808 return [];
4809}
4810
4811module.exports = stubArray;
4812
4813
4814/***/ }),
4815
4816/***/ "../node_modules/lodash/_getTag.js":
4817/*!*****************************************!*\
4818 !*** ../node_modules/lodash/_getTag.js ***!
4819 \*****************************************/
4820/*! no static exports found */
4821/***/ (function(module, exports) {
4822
4823/** Used for built-in method references. */
4824var objectProto = Object.prototype;
4825
4826/**
4827 * Used to resolve the
4828 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
4829 * of values.
4830 */
4831var nativeObjectToString = objectProto.toString;
4832
4833/**
4834 * Converts `value` to a string using `Object.prototype.toString`.
4835 *
4836 * @private
4837 * @param {*} value The value to convert.
4838 * @returns {string} Returns the converted string.
4839 */
4840function objectToString(value) {
4841 return nativeObjectToString.call(value);
4842}
4843
4844module.exports = objectToString;
4845
4846
4847/***/ }),
4848
4849/***/ "../node_modules/lodash/_hashClear.js":
4850/*!********************************************!*\
4851 !*** ../node_modules/lodash/_hashClear.js ***!
4852 \********************************************/
4853/*! no static exports found */
4854/***/ (function(module, exports, __webpack_require__) {
4855
4856var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ "../node_modules/lodash/_nativeCreate.js");
4857
4858/**
4859 * Removes all key-value entries from the hash.
4860 *
4861 * @private
4862 * @name clear
4863 * @memberOf Hash
4864 */
4865function hashClear() {
4866 this.__data__ = nativeCreate ? nativeCreate(null) : {};
4867 this.size = 0;
4868}
4869
4870module.exports = hashClear;
4871
4872
4873/***/ }),
4874
4875/***/ "../node_modules/lodash/_hashDelete.js":
4876/*!*********************************************!*\
4877 !*** ../node_modules/lodash/_hashDelete.js ***!
4878 \*********************************************/
4879/*! no static exports found */
4880/***/ (function(module, exports) {
4881
4882/**
4883 * Removes `key` and its value from the hash.
4884 *
4885 * @private
4886 * @name delete
4887 * @memberOf Hash
4888 * @param {Object} hash The hash to modify.
4889 * @param {string} key The key of the value to remove.
4890 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
4891 */
4892function hashDelete(key) {
4893 var result = this.has(key) && delete this.__data__[key];
4894 this.size -= result ? 1 : 0;
4895 return result;
4896}
4897
4898module.exports = hashDelete;
4899
4900
4901/***/ }),
4902
4903/***/ "../node_modules/lodash/_hashGet.js":
4904/*!******************************************!*\
4905 !*** ../node_modules/lodash/_hashGet.js ***!
4906 \******************************************/
4907/*! no static exports found */
4908/***/ (function(module, exports, __webpack_require__) {
4909
4910var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ "../node_modules/lodash/_nativeCreate.js");
4911
4912/** Used to stand-in for `undefined` hash values. */
4913var HASH_UNDEFINED = '__lodash_hash_undefined__';
4914
4915/** Used for built-in method references. */
4916var objectProto = Object.prototype;
4917
4918/** Used to check objects for own properties. */
4919var hasOwnProperty = objectProto.hasOwnProperty;
4920
4921/**
4922 * Gets the hash value for `key`.
4923 *
4924 * @private
4925 * @name get
4926 * @memberOf Hash
4927 * @param {string} key The key of the value to get.
4928 * @returns {*} Returns the entry value.
4929 */
4930function hashGet(key) {
4931 var data = this.__data__;
4932 if (nativeCreate) {
4933 var result = data[key];
4934 return result === HASH_UNDEFINED ? undefined : result;
4935 }
4936 return hasOwnProperty.call(data, key) ? data[key] : undefined;
4937}
4938
4939module.exports = hashGet;
4940
4941
4942/***/ }),
4943
4944/***/ "../node_modules/lodash/_hashHas.js":
4945/*!******************************************!*\
4946 !*** ../node_modules/lodash/_hashHas.js ***!
4947 \******************************************/
4948/*! no static exports found */
4949/***/ (function(module, exports, __webpack_require__) {
4950
4951var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ "../node_modules/lodash/_nativeCreate.js");
4952
4953/** Used for built-in method references. */
4954var objectProto = Object.prototype;
4955
4956/** Used to check objects for own properties. */
4957var hasOwnProperty = objectProto.hasOwnProperty;
4958
4959/**
4960 * Checks if a hash value for `key` exists.
4961 *
4962 * @private
4963 * @name has
4964 * @memberOf Hash
4965 * @param {string} key The key of the entry to check.
4966 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
4967 */
4968function hashHas(key) {
4969 var data = this.__data__;
4970 return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
4971}
4972
4973module.exports = hashHas;
4974
4975
4976/***/ }),
4977
4978/***/ "../node_modules/lodash/_hashSet.js":
4979/*!******************************************!*\
4980 !*** ../node_modules/lodash/_hashSet.js ***!
4981 \******************************************/
4982/*! no static exports found */
4983/***/ (function(module, exports, __webpack_require__) {
4984
4985var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ "../node_modules/lodash/_nativeCreate.js");
4986
4987/** Used to stand-in for `undefined` hash values. */
4988var HASH_UNDEFINED = '__lodash_hash_undefined__';
4989
4990/**
4991 * Sets the hash `key` to `value`.
4992 *
4993 * @private
4994 * @name set
4995 * @memberOf Hash
4996 * @param {string} key The key of the value to set.
4997 * @param {*} value The value to set.
4998 * @returns {Object} Returns the hash instance.
4999 */
5000function hashSet(key, value) {
5001 var data = this.__data__;
5002 this.size += this.has(key) ? 0 : 1;
5003 data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
5004 return this;
5005}
5006
5007module.exports = hashSet;
5008
5009
5010/***/ }),
5011
5012/***/ "../node_modules/lodash/_initCloneArray.js":
5013/*!*************************************************!*\
5014 !*** ../node_modules/lodash/_initCloneArray.js ***!
5015 \*************************************************/
5016/*! no static exports found */
5017/***/ (function(module, exports) {
5018
5019/** Used for built-in method references. */
5020var objectProto = Object.prototype;
5021
5022/** Used to check objects for own properties. */
5023var hasOwnProperty = objectProto.hasOwnProperty;
5024
5025/**
5026 * Initializes an array clone.
5027 *
5028 * @private
5029 * @param {Array} array The array to clone.
5030 * @returns {Array} Returns the initialized clone.
5031 */
5032function initCloneArray(array) {
5033 var length = array.length,
5034 result = new array.constructor(length);
5035
5036 // Add properties assigned by `RegExp#exec`.
5037 if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
5038 result.index = array.index;
5039 result.input = array.input;
5040 }
5041 return result;
5042}
5043
5044module.exports = initCloneArray;
5045
5046
5047/***/ }),
5048
5049/***/ "../node_modules/lodash/_initCloneByTag.js":
5050/*!*************************************************!*\
5051 !*** ../node_modules/lodash/_initCloneByTag.js ***!
5052 \*************************************************/
5053/*! no static exports found */
5054/***/ (function(module, exports) {
5055
5056/**
5057 * This method returns the first argument it receives.
5058 *
5059 * @static
5060 * @since 0.1.0
5061 * @memberOf _
5062 * @category Util
5063 * @param {*} value Any value.
5064 * @returns {*} Returns `value`.
5065 * @example
5066 *
5067 * var object = { 'a': 1 };
5068 *
5069 * console.log(_.identity(object) === object);
5070 * // => true
5071 */
5072function identity(value) {
5073 return value;
5074}
5075
5076module.exports = identity;
5077
5078
5079/***/ }),
5080
5081/***/ "../node_modules/lodash/_initCloneObject.js":
5082/*!**************************************************!*\
5083 !*** ../node_modules/lodash/_initCloneObject.js ***!
5084 \**************************************************/
5085/*! no static exports found */
5086/***/ (function(module, exports, __webpack_require__) {
5087
5088var baseCreate = __webpack_require__(/*! ./_baseCreate */ "../node_modules/lodash/_baseCreate.js"),
5089 getPrototype = __webpack_require__(/*! ./_getPrototype */ "../node_modules/lodash/_getPrototype.js"),
5090 isPrototype = __webpack_require__(/*! ./_isPrototype */ "../node_modules/lodash/_isPrototype.js");
5091
5092/**
5093 * Initializes an object clone.
5094 *
5095 * @private
5096 * @param {Object} object The object to clone.
5097 * @returns {Object} Returns the initialized clone.
5098 */
5099function initCloneObject(object) {
5100 return (typeof object.constructor == 'function' && !isPrototype(object))
5101 ? baseCreate(getPrototype(object))
5102 : {};
5103}
5104
5105module.exports = initCloneObject;
5106
5107
5108/***/ }),
5109
5110/***/ "../node_modules/lodash/_isKeyable.js":
5111/*!********************************************!*\
5112 !*** ../node_modules/lodash/_isKeyable.js ***!
5113 \********************************************/
5114/*! no static exports found */
5115/***/ (function(module, exports) {
5116
5117/**
5118 * Checks if `value` is suitable for use as unique object key.
5119 *
5120 * @private
5121 * @param {*} value The value to check.
5122 * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
5123 */
5124function isKeyable(value) {
5125 var type = typeof value;
5126 return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
5127 ? (value !== '__proto__')
5128 : (value === null);
5129}
5130
5131module.exports = isKeyable;
5132
5133
5134/***/ }),
5135
5136/***/ "../node_modules/lodash/_isPrototype.js":
5137/*!**********************************************!*\
5138 !*** ../node_modules/lodash/_isPrototype.js ***!
5139 \**********************************************/
5140/*! no static exports found */
5141/***/ (function(module, exports) {
5142
5143/**
5144 * This method returns `false`.
5145 *
5146 * @static
5147 * @memberOf _
5148 * @since 4.13.0
5149 * @category Util
5150 * @returns {boolean} Returns `false`.
5151 * @example
5152 *
5153 * _.times(2, _.stubFalse);
5154 * // => [false, false]
5155 */
5156function stubFalse() {
5157 return false;
5158}
5159
5160module.exports = stubFalse;
5161
5162
5163/***/ }),
5164
5165/***/ "../node_modules/lodash/_listCacheClear.js":
5166/*!*************************************************!*\
5167 !*** ../node_modules/lodash/_listCacheClear.js ***!
5168 \*************************************************/
5169/*! no static exports found */
5170/***/ (function(module, exports) {
5171
5172/**
5173 * Removes all key-value entries from the list cache.
5174 *
5175 * @private
5176 * @name clear
5177 * @memberOf ListCache
5178 */
5179function listCacheClear() {
5180 this.__data__ = [];
5181 this.size = 0;
5182}
5183
5184module.exports = listCacheClear;
5185
5186
5187/***/ }),
5188
5189/***/ "../node_modules/lodash/_listCacheDelete.js":
5190/*!**************************************************!*\
5191 !*** ../node_modules/lodash/_listCacheDelete.js ***!
5192 \**************************************************/
5193/*! no static exports found */
5194/***/ (function(module, exports, __webpack_require__) {
5195
5196var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ "../node_modules/lodash/_assocIndexOf.js");
5197
5198/** Used for built-in method references. */
5199var arrayProto = Array.prototype;
5200
5201/** Built-in value references. */
5202var splice = arrayProto.splice;
5203
5204/**
5205 * Removes `key` and its value from the list cache.
5206 *
5207 * @private
5208 * @name delete
5209 * @memberOf ListCache
5210 * @param {string} key The key of the value to remove.
5211 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
5212 */
5213function listCacheDelete(key) {
5214 var data = this.__data__,
5215 index = assocIndexOf(data, key);
5216
5217 if (index < 0) {
5218 return false;
5219 }
5220 var lastIndex = data.length - 1;
5221 if (index == lastIndex) {
5222 data.pop();
5223 } else {
5224 splice.call(data, index, 1);
5225 }
5226 --this.size;
5227 return true;
5228}
5229
5230module.exports = listCacheDelete;
5231
5232
5233/***/ }),
5234
5235/***/ "../node_modules/lodash/_listCacheGet.js":
5236/*!***********************************************!*\
5237 !*** ../node_modules/lodash/_listCacheGet.js ***!
5238 \***********************************************/
5239/*! no static exports found */
5240/***/ (function(module, exports, __webpack_require__) {
5241
5242var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ "../node_modules/lodash/_assocIndexOf.js");
5243
5244/**
5245 * Gets the list cache value for `key`.
5246 *
5247 * @private
5248 * @name get
5249 * @memberOf ListCache
5250 * @param {string} key The key of the value to get.
5251 * @returns {*} Returns the entry value.
5252 */
5253function listCacheGet(key) {
5254 var data = this.__data__,
5255 index = assocIndexOf(data, key);
5256
5257 return index < 0 ? undefined : data[index][1];
5258}
5259
5260module.exports = listCacheGet;
5261
5262
5263/***/ }),
5264
5265/***/ "../node_modules/lodash/_listCacheHas.js":
5266/*!***********************************************!*\
5267 !*** ../node_modules/lodash/_listCacheHas.js ***!
5268 \***********************************************/
5269/*! no static exports found */
5270/***/ (function(module, exports, __webpack_require__) {
5271
5272var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ "../node_modules/lodash/_assocIndexOf.js");
5273
5274/**
5275 * Checks if a list cache value for `key` exists.
5276 *
5277 * @private
5278 * @name has
5279 * @memberOf ListCache
5280 * @param {string} key The key of the entry to check.
5281 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
5282 */
5283function listCacheHas(key) {
5284 return assocIndexOf(this.__data__, key) > -1;
5285}
5286
5287module.exports = listCacheHas;
5288
5289
5290/***/ }),
5291
5292/***/ "../node_modules/lodash/_listCacheSet.js":
5293/*!***********************************************!*\
5294 !*** ../node_modules/lodash/_listCacheSet.js ***!
5295 \***********************************************/
5296/*! no static exports found */
5297/***/ (function(module, exports, __webpack_require__) {
5298
5299var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ "../node_modules/lodash/_assocIndexOf.js");
5300
5301/**
5302 * Sets the list cache `key` to `value`.
5303 *
5304 * @private
5305 * @name set
5306 * @memberOf ListCache
5307 * @param {string} key The key of the value to set.
5308 * @param {*} value The value to set.
5309 * @returns {Object} Returns the list cache instance.
5310 */
5311function listCacheSet(key, value) {
5312 var data = this.__data__,
5313 index = assocIndexOf(data, key);
5314
5315 if (index < 0) {
5316 ++this.size;
5317 data.push([key, value]);
5318 } else {
5319 data[index][1] = value;
5320 }
5321 return this;
5322}
5323
5324module.exports = listCacheSet;
5325
5326
5327/***/ }),
5328
5329/***/ "../node_modules/lodash/_mapCacheClear.js":
5330/*!************************************************!*\
5331 !*** ../node_modules/lodash/_mapCacheClear.js ***!
5332 \************************************************/
5333/*! no static exports found */
5334/***/ (function(module, exports, __webpack_require__) {
5335
5336var Hash = __webpack_require__(/*! ./_Hash */ "../node_modules/lodash/_Hash.js"),
5337 ListCache = __webpack_require__(/*! ./_ListCache */ "../node_modules/lodash/_ListCache.js"),
5338 Map = __webpack_require__(/*! ./_Map */ "../node_modules/lodash/_Map.js");
5339
5340/**
5341 * Removes all key-value entries from the map.
5342 *
5343 * @private
5344 * @name clear
5345 * @memberOf MapCache
5346 */
5347function mapCacheClear() {
5348 this.size = 0;
5349 this.__data__ = {
5350 'hash': new Hash,
5351 'map': new (Map || ListCache),
5352 'string': new Hash
5353 };
5354}
5355
5356module.exports = mapCacheClear;
5357
5358
5359/***/ }),
5360
5361/***/ "../node_modules/lodash/_mapCacheDelete.js":
5362/*!*************************************************!*\
5363 !*** ../node_modules/lodash/_mapCacheDelete.js ***!
5364 \*************************************************/
5365/*! no static exports found */
5366/***/ (function(module, exports, __webpack_require__) {
5367
5368var getMapData = __webpack_require__(/*! ./_getMapData */ "../node_modules/lodash/_getMapData.js");
5369
5370/**
5371 * Removes `key` and its value from the map.
5372 *
5373 * @private
5374 * @name delete
5375 * @memberOf MapCache
5376 * @param {string} key The key of the value to remove.
5377 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
5378 */
5379function mapCacheDelete(key) {
5380 var result = getMapData(this, key)['delete'](key);
5381 this.size -= result ? 1 : 0;
5382 return result;
5383}
5384
5385module.exports = mapCacheDelete;
5386
5387
5388/***/ }),
5389
5390/***/ "../node_modules/lodash/_mapCacheGet.js":
5391/*!**********************************************!*\
5392 !*** ../node_modules/lodash/_mapCacheGet.js ***!
5393 \**********************************************/
5394/*! no static exports found */
5395/***/ (function(module, exports, __webpack_require__) {
5396
5397var getMapData = __webpack_require__(/*! ./_getMapData */ "../node_modules/lodash/_getMapData.js");
5398
5399/**
5400 * Gets the map value for `key`.
5401 *
5402 * @private
5403 * @name get
5404 * @memberOf MapCache
5405 * @param {string} key The key of the value to get.
5406 * @returns {*} Returns the entry value.
5407 */
5408function mapCacheGet(key) {
5409 return getMapData(this, key).get(key);
5410}
5411
5412module.exports = mapCacheGet;
5413
5414
5415/***/ }),
5416
5417/***/ "../node_modules/lodash/_mapCacheHas.js":
5418/*!**********************************************!*\
5419 !*** ../node_modules/lodash/_mapCacheHas.js ***!
5420 \**********************************************/
5421/*! no static exports found */
5422/***/ (function(module, exports, __webpack_require__) {
5423
5424var getMapData = __webpack_require__(/*! ./_getMapData */ "../node_modules/lodash/_getMapData.js");
5425
5426/**
5427 * Checks if a map value for `key` exists.
5428 *
5429 * @private
5430 * @name has
5431 * @memberOf MapCache
5432 * @param {string} key The key of the entry to check.
5433 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
5434 */
5435function mapCacheHas(key) {
5436 return getMapData(this, key).has(key);
5437}
5438
5439module.exports = mapCacheHas;
5440
5441
5442/***/ }),
5443
5444/***/ "../node_modules/lodash/_mapCacheSet.js":
5445/*!**********************************************!*\
5446 !*** ../node_modules/lodash/_mapCacheSet.js ***!
5447 \**********************************************/
5448/*! no static exports found */
5449/***/ (function(module, exports, __webpack_require__) {
5450
5451var getMapData = __webpack_require__(/*! ./_getMapData */ "../node_modules/lodash/_getMapData.js");
5452
5453/**
5454 * Sets the map `key` to `value`.
5455 *
5456 * @private
5457 * @name set
5458 * @memberOf MapCache
5459 * @param {string} key The key of the value to set.
5460 * @param {*} value The value to set.
5461 * @returns {Object} Returns the map cache instance.
5462 */
5463function mapCacheSet(key, value) {
5464 var data = getMapData(this, key),
5465 size = data.size;
5466
5467 data.set(key, value);
5468 this.size += data.size == size ? 0 : 1;
5469 return this;
5470}
5471
5472module.exports = mapCacheSet;
5473
5474
5475/***/ }),
5476
5477/***/ "../node_modules/lodash/_nativeCreate.js":
5478/*!***********************************************!*\
5479 !*** ../node_modules/lodash/_nativeCreate.js ***!
5480 \***********************************************/
5481/*! no static exports found */
5482/***/ (function(module, exports, __webpack_require__) {
5483
5484var getNative = __webpack_require__(/*! ./_getNative */ "../node_modules/lodash/_getNative.js");
5485
5486/* Built-in method references that are verified to be native. */
5487var nativeCreate = getNative(Object, 'create');
5488
5489module.exports = nativeCreate;
5490
5491
5492/***/ }),
5493
5494/***/ "../node_modules/lodash/_overArg.js":
5495/*!******************************************!*\
5496 !*** ../node_modules/lodash/_overArg.js ***!
5497 \******************************************/
5498/*! no static exports found */
5499/***/ (function(module, exports) {
5500
5501/**
5502 * Creates a unary function that invokes `func` with its argument transformed.
5503 *
5504 * @private
5505 * @param {Function} func The function to wrap.
5506 * @param {Function} transform The argument transform.
5507 * @returns {Function} Returns the new function.
5508 */
5509function overArg(func, transform) {
5510 return function(arg) {
5511 return func(transform(arg));
5512 };
5513}
5514
5515module.exports = overArg;
5516
5517
5518/***/ }),
5519
5520/***/ "../node_modules/lodash/_root.js":
5521/*!***************************************!*\
5522 !*** ../node_modules/lodash/_root.js ***!
5523 \***************************************/
5524/*! no static exports found */
5525/***/ (function(module, exports, __webpack_require__) {
5526
5527var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ "../node_modules/lodash/_freeGlobal.js");
5528
5529/** Detect free variable `self`. */
5530var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
5531
5532/** Used as a reference to the global object. */
5533var root = freeGlobal || freeSelf || Function('return this')();
5534
5535module.exports = root;
5536
5537
5538/***/ }),
5539
5540/***/ "../node_modules/lodash/_stackClear.js":
5541/*!*********************************************!*\
5542 !*** ../node_modules/lodash/_stackClear.js ***!
5543 \*********************************************/
5544/*! no static exports found */
5545/***/ (function(module, exports, __webpack_require__) {
5546
5547var ListCache = __webpack_require__(/*! ./_ListCache */ "../node_modules/lodash/_ListCache.js");
5548
5549/**
5550 * Removes all key-value entries from the stack.
5551 *
5552 * @private
5553 * @name clear
5554 * @memberOf Stack
5555 */
5556function stackClear() {
5557 this.__data__ = new ListCache;
5558 this.size = 0;
5559}
5560
5561module.exports = stackClear;
5562
5563
5564/***/ }),
5565
5566/***/ "../node_modules/lodash/_stackDelete.js":
5567/*!**********************************************!*\
5568 !*** ../node_modules/lodash/_stackDelete.js ***!
5569 \**********************************************/
5570/*! no static exports found */
5571/***/ (function(module, exports) {
5572
5573/**
5574 * Removes `key` and its value from the stack.
5575 *
5576 * @private
5577 * @name delete
5578 * @memberOf Stack
5579 * @param {string} key The key of the value to remove.
5580 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
5581 */
5582function stackDelete(key) {
5583 var data = this.__data__,
5584 result = data['delete'](key);
5585
5586 this.size = data.size;
5587 return result;
5588}
5589
5590module.exports = stackDelete;
5591
5592
5593/***/ }),
5594
5595/***/ "../node_modules/lodash/_stackGet.js":
5596/*!*******************************************!*\
5597 !*** ../node_modules/lodash/_stackGet.js ***!
5598 \*******************************************/
5599/*! no static exports found */
5600/***/ (function(module, exports) {
5601
5602/**
5603 * Gets the stack value for `key`.
5604 *
5605 * @private
5606 * @name get
5607 * @memberOf Stack
5608 * @param {string} key The key of the value to get.
5609 * @returns {*} Returns the entry value.
5610 */
5611function stackGet(key) {
5612 return this.__data__.get(key);
5613}
5614
5615module.exports = stackGet;
5616
5617
5618/***/ }),
5619
5620/***/ "../node_modules/lodash/_stackHas.js":
5621/*!*******************************************!*\
5622 !*** ../node_modules/lodash/_stackHas.js ***!
5623 \*******************************************/
5624/*! no static exports found */
5625/***/ (function(module, exports) {
5626
5627/**
5628 * Checks if a stack value for `key` exists.
5629 *
5630 * @private
5631 * @name has
5632 * @memberOf Stack
5633 * @param {string} key The key of the entry to check.
5634 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
5635 */
5636function stackHas(key) {
5637 return this.__data__.has(key);
5638}
5639
5640module.exports = stackHas;
5641
5642
5643/***/ }),
5644
5645/***/ "../node_modules/lodash/_stackSet.js":
5646/*!*******************************************!*\
5647 !*** ../node_modules/lodash/_stackSet.js ***!
5648 \*******************************************/
5649/*! no static exports found */
5650/***/ (function(module, exports, __webpack_require__) {
5651
5652var ListCache = __webpack_require__(/*! ./_ListCache */ "../node_modules/lodash/_ListCache.js"),
5653 Map = __webpack_require__(/*! ./_Map */ "../node_modules/lodash/_Map.js"),
5654 MapCache = __webpack_require__(/*! ./_MapCache */ "../node_modules/lodash/_MapCache.js");
5655
5656/** Used as the size to enable large array optimizations. */
5657var LARGE_ARRAY_SIZE = 200;
5658
5659/**
5660 * Sets the stack `key` to `value`.
5661 *
5662 * @private
5663 * @name set
5664 * @memberOf Stack
5665 * @param {string} key The key of the value to set.
5666 * @param {*} value The value to set.
5667 * @returns {Object} Returns the stack cache instance.
5668 */
5669function stackSet(key, value) {
5670 var data = this.__data__;
5671 if (data instanceof ListCache) {
5672 var pairs = data.__data__;
5673 if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
5674 pairs.push([key, value]);
5675 this.size = ++data.size;
5676 return this;
5677 }
5678 data = this.__data__ = new MapCache(pairs);
5679 }
5680 data.set(key, value);
5681 this.size = data.size;
5682 return this;
5683}
5684
5685module.exports = stackSet;
5686
5687
5688/***/ }),
5689
5690/***/ "../node_modules/lodash/cloneDeep.js":
5691/*!*******************************************!*\
5692 !*** ../node_modules/lodash/cloneDeep.js ***!
5693 \*******************************************/
5694/*! no static exports found */
5695/***/ (function(module, exports, __webpack_require__) {
5696
5697var baseClone = __webpack_require__(/*! ./_baseClone */ "../node_modules/lodash/_baseClone.js");
5698
5699/** Used to compose bitmasks for cloning. */
5700var CLONE_DEEP_FLAG = 1,
5701 CLONE_SYMBOLS_FLAG = 4;
5702
5703/**
5704 * This method is like `_.clone` except that it recursively clones `value`.
5705 *
5706 * @static
5707 * @memberOf _
5708 * @since 1.0.0
5709 * @category Lang
5710 * @param {*} value The value to recursively clone.
5711 * @returns {*} Returns the deep cloned value.
5712 * @see _.clone
5713 * @example
5714 *
5715 * var objects = [{ 'a': 1 }, { 'b': 2 }];
5716 *
5717 * var deep = _.cloneDeep(objects);
5718 * console.log(deep[0] === objects[0]);
5719 * // => false
5720 */
5721function cloneDeep(value) {
5722 return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
5723}
5724
5725module.exports = cloneDeep;
5726
5727
5728/***/ }),
5729
5730/***/ "../node_modules/lodash/eq.js":
5731/*!************************************!*\
5732 !*** ../node_modules/lodash/eq.js ***!
5733 \************************************/
5734/*! no static exports found */
5735/***/ (function(module, exports) {
5736
5737/**
5738 * Performs a
5739 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
5740 * comparison between two values to determine if they are equivalent.
5741 *
5742 * @static
5743 * @memberOf _
5744 * @since 4.0.0
5745 * @category Lang
5746 * @param {*} value The value to compare.
5747 * @param {*} other The other value to compare.
5748 * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
5749 * @example
5750 *
5751 * var object = { 'a': 1 };
5752 * var other = { 'a': 1 };
5753 *
5754 * _.eq(object, object);
5755 * // => true
5756 *
5757 * _.eq(object, other);
5758 * // => false
5759 *
5760 * _.eq('a', 'a');
5761 * // => true
5762 *
5763 * _.eq('a', Object('a'));
5764 * // => false
5765 *
5766 * _.eq(NaN, NaN);
5767 * // => true
5768 */
5769function eq(value, other) {
5770 return value === other || (value !== value && other !== other);
5771}
5772
5773module.exports = eq;
5774
5775
5776/***/ }),
5777
5778/***/ "../node_modules/lodash/get.js":
5779/*!*************************************!*\
5780 !*** ../node_modules/lodash/get.js ***!
5781 \*************************************/
5782/*! no static exports found */
5783/***/ (function(module, exports, __webpack_require__) {
5784
5785var baseGet = __webpack_require__(/*! ./_baseGet */ "../node_modules/lodash/_baseGet.js");
5786
5787/**
5788 * Gets the value at `path` of `object`. If the resolved value is
5789 * `undefined`, the `defaultValue` is returned in its place.
5790 *
5791 * @static
5792 * @memberOf _
5793 * @since 3.7.0
5794 * @category Object
5795 * @param {Object} object The object to query.
5796 * @param {Array|string} path The path of the property to get.
5797 * @param {*} [defaultValue] The value returned for `undefined` resolved values.
5798 * @returns {*} Returns the resolved value.
5799 * @example
5800 *
5801 * var object = { 'a': [{ 'b': { 'c': 3 } }] };
5802 *
5803 * _.get(object, 'a[0].b.c');
5804 * // => 3
5805 *
5806 * _.get(object, ['a', '0', 'b', 'c']);
5807 * // => 3
5808 *
5809 * _.get(object, 'a.b.c', 'default');
5810 * // => 'default'
5811 */
5812function get(object, path, defaultValue) {
5813 var result = object == null ? undefined : baseGet(object, path);
5814 return result === undefined ? defaultValue : result;
5815}
5816
5817module.exports = get;
5818
5819
5820/***/ }),
5821
5822/***/ "../node_modules/lodash/isArray.js":
5823/*!*****************************************!*\
5824 !*** ../node_modules/lodash/isArray.js ***!
5825 \*****************************************/
5826/*! no static exports found */
5827/***/ (function(module, exports) {
5828
5829/**
5830 * Checks if `value` is classified as an `Array` object.
5831 *
5832 * @static
5833 * @memberOf _
5834 * @since 0.1.0
5835 * @category Lang
5836 * @param {*} value The value to check.
5837 * @returns {boolean} Returns `true` if `value` is an array, else `false`.
5838 * @example
5839 *
5840 * _.isArray([1, 2, 3]);
5841 * // => true
5842 *
5843 * _.isArray(document.body.children);
5844 * // => false
5845 *
5846 * _.isArray('abc');
5847 * // => false
5848 *
5849 * _.isArray(_.noop);
5850 * // => false
5851 */
5852var isArray = Array.isArray;
5853
5854module.exports = isArray;
5855
5856
5857/***/ }),
5858
5859/***/ "../node_modules/lodash/isBuffer.js":
5860/*!******************************************!*\
5861 !*** ../node_modules/lodash/isBuffer.js ***!
5862 \******************************************/
5863/*! no static exports found */
5864/***/ (function(module, exports) {
5865
5866/**
5867 * This method returns `false`.
5868 *
5869 * @static
5870 * @memberOf _
5871 * @since 4.13.0
5872 * @category Util
5873 * @returns {boolean} Returns `false`.
5874 * @example
5875 *
5876 * _.times(2, _.stubFalse);
5877 * // => [false, false]
5878 */
5879function stubFalse() {
5880 return false;
5881}
5882
5883module.exports = stubFalse;
5884
5885
5886/***/ }),
5887
5888/***/ "../node_modules/lodash/isMap.js":
5889/*!***************************************!*\
5890 !*** ../node_modules/lodash/isMap.js ***!
5891 \***************************************/
5892/*! no static exports found */
5893/***/ (function(module, exports) {
5894
5895/**
5896 * This method returns `false`.
5897 *
5898 * @static
5899 * @memberOf _
5900 * @since 4.13.0
5901 * @category Util
5902 * @returns {boolean} Returns `false`.
5903 * @example
5904 *
5905 * _.times(2, _.stubFalse);
5906 * // => [false, false]
5907 */
5908function stubFalse() {
5909 return false;
5910}
5911
5912module.exports = stubFalse;
5913
5914
5915/***/ }),
5916
5917/***/ "../node_modules/lodash/isObject.js":
5918/*!******************************************!*\
5919 !*** ../node_modules/lodash/isObject.js ***!
5920 \******************************************/
5921/*! no static exports found */
5922/***/ (function(module, exports) {
5923
5924/**
5925 * Checks if `value` is the
5926 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
5927 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
5928 *
5929 * @static
5930 * @memberOf _
5931 * @since 0.1.0
5932 * @category Lang
5933 * @param {*} value The value to check.
5934 * @returns {boolean} Returns `true` if `value` is an object, else `false`.
5935 * @example
5936 *
5937 * _.isObject({});
5938 * // => true
5939 *
5940 * _.isObject([1, 2, 3]);
5941 * // => true
5942 *
5943 * _.isObject(_.noop);
5944 * // => true
5945 *
5946 * _.isObject(null);
5947 * // => false
5948 */
5949function isObject(value) {
5950 var type = typeof value;
5951 return value != null && (type == 'object' || type == 'function');
5952}
5953
5954module.exports = isObject;
5955
5956
5957/***/ }),
5958
5959/***/ "../node_modules/lodash/isObjectLike.js":
5960/*!**********************************************!*\
5961 !*** ../node_modules/lodash/isObjectLike.js ***!
5962 \**********************************************/
5963/*! no static exports found */
5964/***/ (function(module, exports) {
5965
5966/**
5967 * Checks if `value` is object-like. A value is object-like if it's not `null`
5968 * and has a `typeof` result of "object".
5969 *
5970 * @static
5971 * @memberOf _
5972 * @since 4.0.0
5973 * @category Lang
5974 * @param {*} value The value to check.
5975 * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
5976 * @example
5977 *
5978 * _.isObjectLike({});
5979 * // => true
5980 *
5981 * _.isObjectLike([1, 2, 3]);
5982 * // => true
5983 *
5984 * _.isObjectLike(_.noop);
5985 * // => false
5986 *
5987 * _.isObjectLike(null);
5988 * // => false
5989 */
5990function isObjectLike(value) {
5991 return value != null && typeof value == 'object';
5992}
5993
5994module.exports = isObjectLike;
5995
5996
5997/***/ }),
5998
5999/***/ "../node_modules/lodash/isPlainObject.js":
6000/*!***********************************************!*\
6001 !*** ../node_modules/lodash/isPlainObject.js ***!
6002 \***********************************************/
6003/*! no static exports found */
6004/***/ (function(module, exports, __webpack_require__) {
6005
6006var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "../node_modules/lodash/_baseGetTag.js"),
6007 getPrototype = __webpack_require__(/*! ./_getPrototype */ "../node_modules/lodash/_getPrototype.js"),
6008 isObjectLike = __webpack_require__(/*! ./isObjectLike */ "../node_modules/lodash/isObjectLike.js");
6009
6010/** `Object#toString` result references. */
6011var objectTag = '[object Object]';
6012
6013/** Used for built-in method references. */
6014var funcProto = Function.prototype,
6015 objectProto = Object.prototype;
6016
6017/** Used to resolve the decompiled source of functions. */
6018var funcToString = funcProto.toString;
6019
6020/** Used to check objects for own properties. */
6021var hasOwnProperty = objectProto.hasOwnProperty;
6022
6023/** Used to infer the `Object` constructor. */
6024var objectCtorString = funcToString.call(Object);
6025
6026/**
6027 * Checks if `value` is a plain object, that is, an object created by the
6028 * `Object` constructor or one with a `[[Prototype]]` of `null`.
6029 *
6030 * @static
6031 * @memberOf _
6032 * @since 0.8.0
6033 * @category Lang
6034 * @param {*} value The value to check.
6035 * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
6036 * @example
6037 *
6038 * function Foo() {
6039 * this.a = 1;
6040 * }
6041 *
6042 * _.isPlainObject(new Foo);
6043 * // => false
6044 *
6045 * _.isPlainObject([1, 2, 3]);
6046 * // => false
6047 *
6048 * _.isPlainObject({ 'x': 0, 'y': 0 });
6049 * // => true
6050 *
6051 * _.isPlainObject(Object.create(null));
6052 * // => true
6053 */
6054function isPlainObject(value) {
6055 if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
6056 return false;
6057 }
6058 var proto = getPrototype(value);
6059 if (proto === null) {
6060 return true;
6061 }
6062 var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
6063 return typeof Ctor == 'function' && Ctor instanceof Ctor &&
6064 funcToString.call(Ctor) == objectCtorString;
6065}
6066
6067module.exports = isPlainObject;
6068
6069
6070/***/ }),
6071
6072/***/ "../node_modules/lodash/isSet.js":
6073/*!***************************************!*\
6074 !*** ../node_modules/lodash/isSet.js ***!
6075 \***************************************/
6076/*! no static exports found */
6077/***/ (function(module, exports) {
6078
6079/**
6080 * This method returns `false`.
6081 *
6082 * @static
6083 * @memberOf _
6084 * @since 4.13.0
6085 * @category Util
6086 * @returns {boolean} Returns `false`.
6087 * @example
6088 *
6089 * _.times(2, _.stubFalse);
6090 * // => [false, false]
6091 */
6092function stubFalse() {
6093 return false;
6094}
6095
6096module.exports = stubFalse;
6097
6098
6099/***/ }),
6100
6101/***/ "../node_modules/lodash/keys.js":
6102/*!**************************************!*\
6103 !*** ../node_modules/lodash/keys.js ***!
6104 \**************************************/
6105/*! no static exports found */
6106/***/ (function(module, exports, __webpack_require__) {
6107
6108var overArg = __webpack_require__(/*! ./_overArg */ "../node_modules/lodash/_overArg.js");
6109
6110/* Built-in method references for those with the same name as other `lodash` methods. */
6111var nativeKeys = overArg(Object.keys, Object);
6112
6113module.exports = nativeKeys;
6114
6115
6116/***/ }),
6117
6118/***/ "../node_modules/lodash/keysIn.js":
6119/*!****************************************!*\
6120 !*** ../node_modules/lodash/keysIn.js ***!
6121 \****************************************/
6122/*! no static exports found */
6123/***/ (function(module, exports) {
6124
6125/**
6126 * This function is like
6127 * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
6128 * except that it includes inherited enumerable properties.
6129 *
6130 * @private
6131 * @param {Object} object The object to query.
6132 * @returns {Array} Returns the array of property names.
6133 */
6134function nativeKeysIn(object) {
6135 var result = [];
6136 if (object != null) {
6137 for (var key in Object(object)) {
6138 result.push(key);
6139 }
6140 }
6141 return result;
6142}
6143
6144module.exports = nativeKeysIn;
6145
6146
6147/***/ }),
6148
6149/***/ "../node_modules/ms/index.js":
6150/*!***********************************!*\
6151 !*** ../node_modules/ms/index.js ***!
6152 \***********************************/
6153/*! no static exports found */
6154/***/ (function(module, exports) {
6155
6156/**
6157 * Helpers.
6158 */
6159
6160var s = 1000;
6161var m = s * 60;
6162var h = m * 60;
6163var d = h * 24;
6164var y = d * 365.25;
6165
6166/**
6167 * Parse or format the given `val`.
6168 *
6169 * Options:
6170 *
6171 * - `long` verbose formatting [false]
6172 *
6173 * @param {String|Number} val
6174 * @param {Object} [options]
6175 * @throws {Error} throw an error if val is not a non-empty string or a number
6176 * @return {String|Number}
6177 * @api public
6178 */
6179
6180module.exports = function(val, options) {
6181 options = options || {};
6182 var type = typeof val;
6183 if (type === 'string' && val.length > 0) {
6184 return parse(val);
6185 } else if (type === 'number' && isNaN(val) === false) {
6186 return options.long ? fmtLong(val) : fmtShort(val);
6187 }
6188 throw new Error(
6189 'val is not a non-empty string or a valid number. val=' +
6190 JSON.stringify(val)
6191 );
6192};
6193
6194/**
6195 * Parse the given `str` and return milliseconds.
6196 *
6197 * @param {String} str
6198 * @return {Number}
6199 * @api private
6200 */
6201
6202function parse(str) {
6203 str = String(str);
6204 if (str.length > 100) {
6205 return;
6206 }
6207 var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(
6208 str
6209 );
6210 if (!match) {
6211 return;
6212 }
6213 var n = parseFloat(match[1]);
6214 var type = (match[2] || 'ms').toLowerCase();
6215 switch (type) {
6216 case 'years':
6217 case 'year':
6218 case 'yrs':
6219 case 'yr':
6220 case 'y':
6221 return n * y;
6222 case 'days':
6223 case 'day':
6224 case 'd':
6225 return n * d;
6226 case 'hours':
6227 case 'hour':
6228 case 'hrs':
6229 case 'hr':
6230 case 'h':
6231 return n * h;
6232 case 'minutes':
6233 case 'minute':
6234 case 'mins':
6235 case 'min':
6236 case 'm':
6237 return n * m;
6238 case 'seconds':
6239 case 'second':
6240 case 'secs':
6241 case 'sec':
6242 case 's':
6243 return n * s;
6244 case 'milliseconds':
6245 case 'millisecond':
6246 case 'msecs':
6247 case 'msec':
6248 case 'ms':
6249 return n;
6250 default:
6251 return undefined;
6252 }
6253}
6254
6255/**
6256 * Short format for `ms`.
6257 *
6258 * @param {Number} ms
6259 * @return {String}
6260 * @api private
6261 */
6262
6263function fmtShort(ms) {
6264 if (ms >= d) {
6265 return Math.round(ms / d) + 'd';
6266 }
6267 if (ms >= h) {
6268 return Math.round(ms / h) + 'h';
6269 }
6270 if (ms >= m) {
6271 return Math.round(ms / m) + 'm';
6272 }
6273 if (ms >= s) {
6274 return Math.round(ms / s) + 's';
6275 }
6276 return ms + 'ms';
6277}
6278
6279/**
6280 * Long format for `ms`.
6281 *
6282 * @param {Number} ms
6283 * @return {String}
6284 * @api private
6285 */
6286
6287function fmtLong(ms) {
6288 return plural(ms, d, 'day') ||
6289 plural(ms, h, 'hour') ||
6290 plural(ms, m, 'minute') ||
6291 plural(ms, s, 'second') ||
6292 ms + ' ms';
6293}
6294
6295/**
6296 * Pluralization helper.
6297 */
6298
6299function plural(ms, n, name) {
6300 if (ms < n) {
6301 return;
6302 }
6303 if (ms < n * 1.5) {
6304 return Math.floor(ms / n) + ' ' + name;
6305 }
6306 return Math.ceil(ms / n) + ' ' + name + 's';
6307}
6308
6309
6310/***/ }),
6311
6312/***/ "../node_modules/qs/lib/formats.js":
6313/*!*****************************************!*\
6314 !*** ../node_modules/qs/lib/formats.js ***!
6315 \*****************************************/
6316/*! no static exports found */
6317/***/ (function(module, exports, __webpack_require__) {
6318
6319"use strict";
6320
6321
6322var replace = String.prototype.replace;
6323var percentTwenties = /%20/g;
6324
6325var util = __webpack_require__(/*! ./utils */ "../node_modules/qs/lib/utils.js");
6326
6327var Format = {
6328 RFC1738: 'RFC1738',
6329 RFC3986: 'RFC3986'
6330};
6331
6332module.exports = util.assign(
6333 {
6334 'default': Format.RFC3986,
6335 formatters: {
6336 RFC1738: function (value) {
6337 return replace.call(value, percentTwenties, '+');
6338 },
6339 RFC3986: function (value) {
6340 return String(value);
6341 }
6342 }
6343 },
6344 Format
6345);
6346
6347
6348/***/ }),
6349
6350/***/ "../node_modules/qs/lib/index.js":
6351/*!***************************************!*\
6352 !*** ../node_modules/qs/lib/index.js ***!
6353 \***************************************/
6354/*! no static exports found */
6355/***/ (function(module, exports, __webpack_require__) {
6356
6357"use strict";
6358
6359
6360var stringify = __webpack_require__(/*! ./stringify */ "../node_modules/qs/lib/stringify.js");
6361var parse = __webpack_require__(/*! ./parse */ "../node_modules/qs/lib/parse.js");
6362var formats = __webpack_require__(/*! ./formats */ "../node_modules/qs/lib/formats.js");
6363
6364module.exports = {
6365 formats: formats,
6366 parse: parse,
6367 stringify: stringify
6368};
6369
6370
6371/***/ }),
6372
6373/***/ "../node_modules/qs/lib/parse.js":
6374/*!***************************************!*\
6375 !*** ../node_modules/qs/lib/parse.js ***!
6376 \***************************************/
6377/*! no static exports found */
6378/***/ (function(module, exports, __webpack_require__) {
6379
6380"use strict";
6381
6382
6383var utils = __webpack_require__(/*! ./utils */ "../node_modules/qs/lib/utils.js");
6384
6385var has = Object.prototype.hasOwnProperty;
6386var isArray = Array.isArray;
6387
6388var defaults = {
6389 allowDots: false,
6390 allowPrototypes: false,
6391 arrayLimit: 20,
6392 charset: 'utf-8',
6393 charsetSentinel: false,
6394 comma: false,
6395 decoder: utils.decode,
6396 delimiter: '&',
6397 depth: 5,
6398 ignoreQueryPrefix: false,
6399 interpretNumericEntities: false,
6400 parameterLimit: 1000,
6401 parseArrays: true,
6402 plainObjects: false,
6403 strictNullHandling: false
6404};
6405
6406var interpretNumericEntities = function (str) {
6407 return str.replace(/&#(\d+);/g, function ($0, numberStr) {
6408 return String.fromCharCode(parseInt(numberStr, 10));
6409 });
6410};
6411
6412var parseArrayValue = function (val, options) {
6413 if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
6414 return val.split(',');
6415 }
6416
6417 return val;
6418};
6419
6420// This is what browsers will submit when the ✓ character occurs in an
6421// application/x-www-form-urlencoded body and the encoding of the page containing
6422// the form is iso-8859-1, or when the submitted form has an accept-charset
6423// attribute of iso-8859-1. Presumably also with other charsets that do not contain
6424// the ✓ character, such as us-ascii.
6425var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('&#10003;')
6426
6427// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.
6428var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
6429
6430var parseValues = function parseQueryStringValues(str, options) {
6431 var obj = {};
6432 var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
6433 var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
6434 var parts = cleanStr.split(options.delimiter, limit);
6435 var skipIndex = -1; // Keep track of where the utf8 sentinel was found
6436 var i;
6437
6438 var charset = options.charset;
6439 if (options.charsetSentinel) {
6440 for (i = 0; i < parts.length; ++i) {
6441 if (parts[i].indexOf('utf8=') === 0) {
6442 if (parts[i] === charsetSentinel) {
6443 charset = 'utf-8';
6444 } else if (parts[i] === isoSentinel) {
6445 charset = 'iso-8859-1';
6446 }
6447 skipIndex = i;
6448 i = parts.length; // The eslint settings do not allow break;
6449 }
6450 }
6451 }
6452
6453 for (i = 0; i < parts.length; ++i) {
6454 if (i === skipIndex) {
6455 continue;
6456 }
6457 var part = parts[i];
6458
6459 var bracketEqualsPos = part.indexOf(']=');
6460 var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
6461
6462 var key, val;
6463 if (pos === -1) {
6464 key = options.decoder(part, defaults.decoder, charset, 'key');
6465 val = options.strictNullHandling ? null : '';
6466 } else {
6467 key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
6468 val = utils.maybeMap(
6469 parseArrayValue(part.slice(pos + 1), options),
6470 function (encodedVal) {
6471 return options.decoder(encodedVal, defaults.decoder, charset, 'value');
6472 }
6473 );
6474 }
6475
6476 if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
6477 val = interpretNumericEntities(val);
6478 }
6479
6480 if (part.indexOf('[]=') > -1) {
6481 val = isArray(val) ? [val] : val;
6482 }
6483
6484 if (has.call(obj, key)) {
6485 obj[key] = utils.combine(obj[key], val);
6486 } else {
6487 obj[key] = val;
6488 }
6489 }
6490
6491 return obj;
6492};
6493
6494var parseObject = function (chain, val, options, valuesParsed) {
6495 var leaf = valuesParsed ? val : parseArrayValue(val, options);
6496
6497 for (var i = chain.length - 1; i >= 0; --i) {
6498 var obj;
6499 var root = chain[i];
6500
6501 if (root === '[]' && options.parseArrays) {
6502 obj = [].concat(leaf);
6503 } else {
6504 obj = options.plainObjects ? Object.create(null) : {};
6505 var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
6506 var index = parseInt(cleanRoot, 10);
6507 if (!options.parseArrays && cleanRoot === '') {
6508 obj = { 0: leaf };
6509 } else if (
6510 !isNaN(index)
6511 && root !== cleanRoot
6512 && String(index) === cleanRoot
6513 && index >= 0
6514 && (options.parseArrays && index <= options.arrayLimit)
6515 ) {
6516 obj = [];
6517 obj[index] = leaf;
6518 } else {
6519 obj[cleanRoot] = leaf;
6520 }
6521 }
6522
6523 leaf = obj; // eslint-disable-line no-param-reassign
6524 }
6525
6526 return leaf;
6527};
6528
6529var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
6530 if (!givenKey) {
6531 return;
6532 }
6533
6534 // Transform dot notation to bracket notation
6535 var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
6536
6537 // The regex chunks
6538
6539 var brackets = /(\[[^[\]]*])/;
6540 var child = /(\[[^[\]]*])/g;
6541
6542 // Get the parent
6543
6544 var segment = options.depth > 0 && brackets.exec(key);
6545 var parent = segment ? key.slice(0, segment.index) : key;
6546
6547 // Stash the parent if it exists
6548
6549 var keys = [];
6550 if (parent) {
6551 // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties
6552 if (!options.plainObjects && has.call(Object.prototype, parent)) {
6553 if (!options.allowPrototypes) {
6554 return;
6555 }
6556 }
6557
6558 keys.push(parent);
6559 }
6560
6561 // Loop through children appending to the array until we hit depth
6562
6563 var i = 0;
6564 while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {
6565 i += 1;
6566 if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
6567 if (!options.allowPrototypes) {
6568 return;
6569 }
6570 }
6571 keys.push(segment[1]);
6572 }
6573
6574 // If there's a remainder, just add whatever is left
6575
6576 if (segment) {
6577 keys.push('[' + key.slice(segment.index) + ']');
6578 }
6579
6580 return parseObject(keys, val, options, valuesParsed);
6581};
6582
6583var normalizeParseOptions = function normalizeParseOptions(opts) {
6584 if (!opts) {
6585 return defaults;
6586 }
6587
6588 if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {
6589 throw new TypeError('Decoder has to be a function.');
6590 }
6591
6592 if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
6593 throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
6594 }
6595 var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
6596
6597 return {
6598 allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
6599 allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,
6600 arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,
6601 charset: charset,
6602 charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
6603 comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,
6604 decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,
6605 delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
6606 // eslint-disable-next-line no-implicit-coercion, no-extra-parens
6607 depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,
6608 ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
6609 interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
6610 parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,
6611 parseArrays: opts.parseArrays !== false,
6612 plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,
6613 strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
6614 };
6615};
6616
6617module.exports = function (str, opts) {
6618 var options = normalizeParseOptions(opts);
6619
6620 if (str === '' || str === null || typeof str === 'undefined') {
6621 return options.plainObjects ? Object.create(null) : {};
6622 }
6623
6624 var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
6625 var obj = options.plainObjects ? Object.create(null) : {};
6626
6627 // Iterate over the keys and setup the new object
6628
6629 var keys = Object.keys(tempObj);
6630 for (var i = 0; i < keys.length; ++i) {
6631 var key = keys[i];
6632 var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');
6633 obj = utils.merge(obj, newObj, options);
6634 }
6635
6636 return utils.compact(obj);
6637};
6638
6639
6640/***/ }),
6641
6642/***/ "../node_modules/qs/lib/stringify.js":
6643/*!*******************************************!*\
6644 !*** ../node_modules/qs/lib/stringify.js ***!
6645 \*******************************************/
6646/*! no static exports found */
6647/***/ (function(module, exports, __webpack_require__) {
6648
6649"use strict";
6650
6651
6652var utils = __webpack_require__(/*! ./utils */ "../node_modules/qs/lib/utils.js");
6653var formats = __webpack_require__(/*! ./formats */ "../node_modules/qs/lib/formats.js");
6654var has = Object.prototype.hasOwnProperty;
6655
6656var arrayPrefixGenerators = {
6657 brackets: function brackets(prefix) {
6658 return prefix + '[]';
6659 },
6660 comma: 'comma',
6661 indices: function indices(prefix, key) {
6662 return prefix + '[' + key + ']';
6663 },
6664 repeat: function repeat(prefix) {
6665 return prefix;
6666 }
6667};
6668
6669var isArray = Array.isArray;
6670var push = Array.prototype.push;
6671var pushToArray = function (arr, valueOrArray) {
6672 push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);
6673};
6674
6675var toISO = Date.prototype.toISOString;
6676
6677var defaultFormat = formats['default'];
6678var defaults = {
6679 addQueryPrefix: false,
6680 allowDots: false,
6681 charset: 'utf-8',
6682 charsetSentinel: false,
6683 delimiter: '&',
6684 encode: true,
6685 encoder: utils.encode,
6686 encodeValuesOnly: false,
6687 format: defaultFormat,
6688 formatter: formats.formatters[defaultFormat],
6689 // deprecated
6690 indices: false,
6691 serializeDate: function serializeDate(date) {
6692 return toISO.call(date);
6693 },
6694 skipNulls: false,
6695 strictNullHandling: false
6696};
6697
6698var isNonNullishPrimitive = function isNonNullishPrimitive(v) {
6699 return typeof v === 'string'
6700 || typeof v === 'number'
6701 || typeof v === 'boolean'
6702 || typeof v === 'symbol'
6703 || typeof v === 'bigint';
6704};
6705
6706var stringify = function stringify(
6707 object,
6708 prefix,
6709 generateArrayPrefix,
6710 strictNullHandling,
6711 skipNulls,
6712 encoder,
6713 filter,
6714 sort,
6715 allowDots,
6716 serializeDate,
6717 formatter,
6718 encodeValuesOnly,
6719 charset
6720) {
6721 var obj = object;
6722 if (typeof filter === 'function') {
6723 obj = filter(prefix, obj);
6724 } else if (obj instanceof Date) {
6725 obj = serializeDate(obj);
6726 } else if (generateArrayPrefix === 'comma' && isArray(obj)) {
6727 obj = utils.maybeMap(obj, function (value) {
6728 if (value instanceof Date) {
6729 return serializeDate(value);
6730 }
6731 return value;
6732 }).join(',');
6733 }
6734
6735 if (obj === null) {
6736 if (strictNullHandling) {
6737 return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key') : prefix;
6738 }
6739
6740 obj = '';
6741 }
6742
6743 if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {
6744 if (encoder) {
6745 var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key');
6746 return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value'))];
6747 }
6748 return [formatter(prefix) + '=' + formatter(String(obj))];
6749 }
6750
6751 var values = [];
6752
6753 if (typeof obj === 'undefined') {
6754 return values;
6755 }
6756
6757 var objKeys;
6758 if (isArray(filter)) {
6759 objKeys = filter;
6760 } else {
6761 var keys = Object.keys(obj);
6762 objKeys = sort ? keys.sort(sort) : keys;
6763 }
6764
6765 for (var i = 0; i < objKeys.length; ++i) {
6766 var key = objKeys[i];
6767 var value = obj[key];
6768
6769 if (skipNulls && value === null) {
6770 continue;
6771 }
6772
6773 var keyPrefix = isArray(obj)
6774 ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(prefix, key) : prefix
6775 : prefix + (allowDots ? '.' + key : '[' + key + ']');
6776
6777 pushToArray(values, stringify(
6778 value,
6779 keyPrefix,
6780 generateArrayPrefix,
6781 strictNullHandling,
6782 skipNulls,
6783 encoder,
6784 filter,
6785 sort,
6786 allowDots,
6787 serializeDate,
6788 formatter,
6789 encodeValuesOnly,
6790 charset
6791 ));
6792 }
6793
6794 return values;
6795};
6796
6797var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
6798 if (!opts) {
6799 return defaults;
6800 }
6801
6802 if (opts.encoder !== null && opts.encoder !== undefined && typeof opts.encoder !== 'function') {
6803 throw new TypeError('Encoder has to be a function.');
6804 }
6805
6806 var charset = opts.charset || defaults.charset;
6807 if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
6808 throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
6809 }
6810
6811 var format = formats['default'];
6812 if (typeof opts.format !== 'undefined') {
6813 if (!has.call(formats.formatters, opts.format)) {
6814 throw new TypeError('Unknown format option provided.');
6815 }
6816 format = opts.format;
6817 }
6818 var formatter = formats.formatters[format];
6819
6820 var filter = defaults.filter;
6821 if (typeof opts.filter === 'function' || isArray(opts.filter)) {
6822 filter = opts.filter;
6823 }
6824
6825 return {
6826 addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix,
6827 allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
6828 charset: charset,
6829 charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
6830 delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,
6831 encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,
6832 encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder,
6833 encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly,
6834 filter: filter,
6835 formatter: formatter,
6836 serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate,
6837 skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls,
6838 sort: typeof opts.sort === 'function' ? opts.sort : null,
6839 strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
6840 };
6841};
6842
6843module.exports = function (object, opts) {
6844 var obj = object;
6845 var options = normalizeStringifyOptions(opts);
6846
6847 var objKeys;
6848 var filter;
6849
6850 if (typeof options.filter === 'function') {
6851 filter = options.filter;
6852 obj = filter('', obj);
6853 } else if (isArray(options.filter)) {
6854 filter = options.filter;
6855 objKeys = filter;
6856 }
6857
6858 var keys = [];
6859
6860 if (typeof obj !== 'object' || obj === null) {
6861 return '';
6862 }
6863
6864 var arrayFormat;
6865 if (opts && opts.arrayFormat in arrayPrefixGenerators) {
6866 arrayFormat = opts.arrayFormat;
6867 } else if (opts && 'indices' in opts) {
6868 arrayFormat = opts.indices ? 'indices' : 'repeat';
6869 } else {
6870 arrayFormat = 'indices';
6871 }
6872
6873 var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
6874
6875 if (!objKeys) {
6876 objKeys = Object.keys(obj);
6877 }
6878
6879 if (options.sort) {
6880 objKeys.sort(options.sort);
6881 }
6882
6883 for (var i = 0; i < objKeys.length; ++i) {
6884 var key = objKeys[i];
6885
6886 if (options.skipNulls && obj[key] === null) {
6887 continue;
6888 }
6889 pushToArray(keys, stringify(
6890 obj[key],
6891 key,
6892 generateArrayPrefix,
6893 options.strictNullHandling,
6894 options.skipNulls,
6895 options.encode ? options.encoder : null,
6896 options.filter,
6897 options.sort,
6898 options.allowDots,
6899 options.serializeDate,
6900 options.formatter,
6901 options.encodeValuesOnly,
6902 options.charset
6903 ));
6904 }
6905
6906 var joined = keys.join(options.delimiter);
6907 var prefix = options.addQueryPrefix === true ? '?' : '';
6908
6909 if (options.charsetSentinel) {
6910 if (options.charset === 'iso-8859-1') {
6911 // encodeURIComponent('&#10003;'), the "numeric entity" representation of a checkmark
6912 prefix += 'utf8=%26%2310003%3B&';
6913 } else {
6914 // encodeURIComponent('✓')
6915 prefix += 'utf8=%E2%9C%93&';
6916 }
6917 }
6918
6919 return joined.length > 0 ? prefix + joined : '';
6920};
6921
6922
6923/***/ }),
6924
6925/***/ "../node_modules/qs/lib/utils.js":
6926/*!***************************************!*\
6927 !*** ../node_modules/qs/lib/utils.js ***!
6928 \***************************************/
6929/*! no static exports found */
6930/***/ (function(module, exports, __webpack_require__) {
6931
6932"use strict";
6933
6934
6935var has = Object.prototype.hasOwnProperty;
6936var isArray = Array.isArray;
6937
6938var hexTable = (function () {
6939 var array = [];
6940 for (var i = 0; i < 256; ++i) {
6941 array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
6942 }
6943
6944 return array;
6945}());
6946
6947var compactQueue = function compactQueue(queue) {
6948 while (queue.length > 1) {
6949 var item = queue.pop();
6950 var obj = item.obj[item.prop];
6951
6952 if (isArray(obj)) {
6953 var compacted = [];
6954
6955 for (var j = 0; j < obj.length; ++j) {
6956 if (typeof obj[j] !== 'undefined') {
6957 compacted.push(obj[j]);
6958 }
6959 }
6960
6961 item.obj[item.prop] = compacted;
6962 }
6963 }
6964};
6965
6966var arrayToObject = function arrayToObject(source, options) {
6967 var obj = options && options.plainObjects ? Object.create(null) : {};
6968 for (var i = 0; i < source.length; ++i) {
6969 if (typeof source[i] !== 'undefined') {
6970 obj[i] = source[i];
6971 }
6972 }
6973
6974 return obj;
6975};
6976
6977var merge = function merge(target, source, options) {
6978 /* eslint no-param-reassign: 0 */
6979 if (!source) {
6980 return target;
6981 }
6982
6983 if (typeof source !== 'object') {
6984 if (isArray(target)) {
6985 target.push(source);
6986 } else if (target && typeof target === 'object') {
6987 if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) {
6988 target[source] = true;
6989 }
6990 } else {
6991 return [target, source];
6992 }
6993
6994 return target;
6995 }
6996
6997 if (!target || typeof target !== 'object') {
6998 return [target].concat(source);
6999 }
7000
7001 var mergeTarget = target;
7002 if (isArray(target) && !isArray(source)) {
7003 mergeTarget = arrayToObject(target, options);
7004 }
7005
7006 if (isArray(target) && isArray(source)) {
7007 source.forEach(function (item, i) {
7008 if (has.call(target, i)) {
7009 var targetItem = target[i];
7010 if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {
7011 target[i] = merge(targetItem, item, options);
7012 } else {
7013 target.push(item);
7014 }
7015 } else {
7016 target[i] = item;
7017 }
7018 });
7019 return target;
7020 }
7021
7022 return Object.keys(source).reduce(function (acc, key) {
7023 var value = source[key];
7024
7025 if (has.call(acc, key)) {
7026 acc[key] = merge(acc[key], value, options);
7027 } else {
7028 acc[key] = value;
7029 }
7030 return acc;
7031 }, mergeTarget);
7032};
7033
7034var assign = function assignSingleSource(target, source) {
7035 return Object.keys(source).reduce(function (acc, key) {
7036 acc[key] = source[key];
7037 return acc;
7038 }, target);
7039};
7040
7041var decode = function (str, decoder, charset) {
7042 var strWithoutPlus = str.replace(/\+/g, ' ');
7043 if (charset === 'iso-8859-1') {
7044 // unescape never throws, no try...catch needed:
7045 return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
7046 }
7047 // utf-8
7048 try {
7049 return decodeURIComponent(strWithoutPlus);
7050 } catch (e) {
7051 return strWithoutPlus;
7052 }
7053};
7054
7055var encode = function encode(str, defaultEncoder, charset) {
7056 // This code was originally written by Brian White (mscdex) for the io.js core querystring library.
7057 // It has been adapted here for stricter adherence to RFC 3986
7058 if (str.length === 0) {
7059 return str;
7060 }
7061
7062 var string = str;
7063 if (typeof str === 'symbol') {
7064 string = Symbol.prototype.toString.call(str);
7065 } else if (typeof str !== 'string') {
7066 string = String(str);
7067 }
7068
7069 if (charset === 'iso-8859-1') {
7070 return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {
7071 return '%26%23' + parseInt($0.slice(2), 16) + '%3B';
7072 });
7073 }
7074
7075 var out = '';
7076 for (var i = 0; i < string.length; ++i) {
7077 var c = string.charCodeAt(i);
7078
7079 if (
7080 c === 0x2D // -
7081 || c === 0x2E // .
7082 || c === 0x5F // _
7083 || c === 0x7E // ~
7084 || (c >= 0x30 && c <= 0x39) // 0-9
7085 || (c >= 0x41 && c <= 0x5A) // a-z
7086 || (c >= 0x61 && c <= 0x7A) // A-Z
7087 ) {
7088 out += string.charAt(i);
7089 continue;
7090 }
7091
7092 if (c < 0x80) {
7093 out = out + hexTable[c];
7094 continue;
7095 }
7096
7097 if (c < 0x800) {
7098 out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
7099 continue;
7100 }
7101
7102 if (c < 0xD800 || c >= 0xE000) {
7103 out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
7104 continue;
7105 }
7106
7107 i += 1;
7108 c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
7109 out += hexTable[0xF0 | (c >> 18)]
7110 + hexTable[0x80 | ((c >> 12) & 0x3F)]
7111 + hexTable[0x80 | ((c >> 6) & 0x3F)]
7112 + hexTable[0x80 | (c & 0x3F)];
7113 }
7114
7115 return out;
7116};
7117
7118var compact = function compact(value) {
7119 var queue = [{ obj: { o: value }, prop: 'o' }];
7120 var refs = [];
7121
7122 for (var i = 0; i < queue.length; ++i) {
7123 var item = queue[i];
7124 var obj = item.obj[item.prop];
7125
7126 var keys = Object.keys(obj);
7127 for (var j = 0; j < keys.length; ++j) {
7128 var key = keys[j];
7129 var val = obj[key];
7130 if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
7131 queue.push({ obj: obj, prop: key });
7132 refs.push(val);
7133 }
7134 }
7135 }
7136
7137 compactQueue(queue);
7138
7139 return value;
7140};
7141
7142var isRegExp = function isRegExp(obj) {
7143 return Object.prototype.toString.call(obj) === '[object RegExp]';
7144};
7145
7146var isBuffer = function isBuffer(obj) {
7147 if (!obj || typeof obj !== 'object') {
7148 return false;
7149 }
7150
7151 return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
7152};
7153
7154var combine = function combine(a, b) {
7155 return [].concat(a, b);
7156};
7157
7158var maybeMap = function maybeMap(val, fn) {
7159 if (isArray(val)) {
7160 var mapped = [];
7161 for (var i = 0; i < val.length; i += 1) {
7162 mapped.push(fn(val[i]));
7163 }
7164 return mapped;
7165 }
7166 return fn(val);
7167};
7168
7169module.exports = {
7170 arrayToObject: arrayToObject,
7171 assign: assign,
7172 combine: combine,
7173 compact: compact,
7174 decode: decode,
7175 encode: encode,
7176 isBuffer: isBuffer,
7177 isRegExp: isRegExp,
7178 maybeMap: maybeMap,
7179 merge: merge
7180};
7181
7182
7183/***/ }),
7184
7185/***/ "../node_modules/supports-color/index.js":
7186/*!***********************************************!*\
7187 !*** ../node_modules/supports-color/index.js ***!
7188 \***********************************************/
7189/*! no static exports found */
7190/***/ (function(module, exports, __webpack_require__) {
7191
7192"use strict";
7193
7194const os = __webpack_require__(/*! os */ "os");
7195const hasFlag = __webpack_require__(/*! has-flag */ "../node_modules/has-flag/index.js");
7196
7197const env = process.env;
7198
7199let forceColor;
7200if (hasFlag('no-color') ||
7201 hasFlag('no-colors') ||
7202 hasFlag('color=false')) {
7203 forceColor = false;
7204} else if (hasFlag('color') ||
7205 hasFlag('colors') ||
7206 hasFlag('color=true') ||
7207 hasFlag('color=always')) {
7208 forceColor = true;
7209}
7210if ('FORCE_COLOR' in env) {
7211 forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;
7212}
7213
7214function translateLevel(level) {
7215 if (level === 0) {
7216 return false;
7217 }
7218
7219 return {
7220 level,
7221 hasBasic: true,
7222 has256: level >= 2,
7223 has16m: level >= 3
7224 };
7225}
7226
7227function supportsColor(stream) {
7228 if (forceColor === false) {
7229 return 0;
7230 }
7231
7232 if (hasFlag('color=16m') ||
7233 hasFlag('color=full') ||
7234 hasFlag('color=truecolor')) {
7235 return 3;
7236 }
7237
7238 if (hasFlag('color=256')) {
7239 return 2;
7240 }
7241
7242 if (stream && !stream.isTTY && forceColor !== true) {
7243 return 0;
7244 }
7245
7246 const min = forceColor ? 1 : 0;
7247
7248 if (process.platform === 'win32') {
7249 // Node.js 7.5.0 is the first version of Node.js to include a patch to
7250 // libuv that enables 256 color output on Windows. Anything earlier and it
7251 // won't work. However, here we target Node.js 8 at minimum as it is an LTS
7252 // release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows
7253 // release that supports 256 colors. Windows 10 build 14931 is the first release
7254 // that supports 16m/TrueColor.
7255 const osRelease = os.release().split('.');
7256 if (
7257 Number(process.versions.node.split('.')[0]) >= 8 &&
7258 Number(osRelease[0]) >= 10 &&
7259 Number(osRelease[2]) >= 10586
7260 ) {
7261 return Number(osRelease[2]) >= 14931 ? 3 : 2;
7262 }
7263
7264 return 1;
7265 }
7266
7267 if ('CI' in env) {
7268 if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
7269 return 1;
7270 }
7271
7272 return min;
7273 }
7274
7275 if ('TEAMCITY_VERSION' in env) {
7276 return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
7277 }
7278
7279 if (env.COLORTERM === 'truecolor') {
7280 return 3;
7281 }
7282
7283 if ('TERM_PROGRAM' in env) {
7284 const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
7285
7286 switch (env.TERM_PROGRAM) {
7287 case 'iTerm.app':
7288 return version >= 3 ? 3 : 2;
7289 case 'Apple_Terminal':
7290 return 2;
7291 // No default
7292 }
7293 }
7294
7295 if (/-256(color)?$/i.test(env.TERM)) {
7296 return 2;
7297 }
7298
7299 if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
7300 return 1;
7301 }
7302
7303 if ('COLORTERM' in env) {
7304 return 1;
7305 }
7306
7307 if (env.TERM === 'dumb') {
7308 return min;
7309 }
7310
7311 return min;
7312}
7313
7314function getSupportLevel(stream) {
7315 const level = supportsColor(stream);
7316 return translateLevel(level);
7317}
7318
7319module.exports = {
7320 supportsColor: getSupportLevel,
7321 stdout: getSupportLevel(process.stdout),
7322 stderr: getSupportLevel(process.stderr)
7323};
7324
7325
7326/***/ }),
7327
7328/***/ "../node_modules/webpack/buildin/module.js":
7329/*!*************************************************!*\
7330 !*** ../node_modules/webpack/buildin/module.js ***!
7331 \*************************************************/
7332/*! no static exports found */
7333/***/ (function(module, exports) {
7334
7335module.exports = function(module) {
7336 if (!module.webpackPolyfill) {
7337 module.deprecate = function() {};
7338 module.paths = [];
7339 // module.parent = undefined by default
7340 if (!module.children) module.children = [];
7341 Object.defineProperty(module, "loaded", {
7342 enumerable: true,
7343 get: function() {
7344 return module.l;
7345 }
7346 });
7347 Object.defineProperty(module, "id", {
7348 enumerable: true,
7349 get: function() {
7350 return module.i;
7351 }
7352 });
7353 module.webpackPolyfill = 1;
7354 }
7355 return module;
7356};
7357
7358
7359/***/ }),
7360
7361/***/ "./common-utils.ts":
7362/*!*************************!*\
7363 !*** ./common-utils.ts ***!
7364 \*************************/
7365/*! exports provided: wrapCollection */
7366/***/ (function(module, __webpack_exports__, __webpack_require__) {
7367
7368"use strict";
7369__webpack_require__.r(__webpack_exports__);
7370/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapCollection", function() { return wrapCollection; });
7371/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
7372/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
7373/* 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");
7374/* eslint-disable @typescript-eslint/ban-ts-ignore */
7375
7376
7377const wrapCollection = fn => (http, data) => {
7378 const collectionData = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data)); // @ts-ignore
7379
7380 collectionData.items = collectionData.items.map(entity => fn(http, entity)); // @ts-ignore
7381
7382 return collectionData;
7383};
7384
7385/***/ }),
7386
7387/***/ "./contentful-management.ts":
7388/*!**********************************!*\
7389 !*** ./contentful-management.ts ***!
7390 \**********************************/
7391/*! exports provided: createClient */
7392/***/ (function(module, __webpack_exports__, __webpack_require__) {
7393
7394"use strict";
7395__webpack_require__.r(__webpack_exports__);
7396/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createClient", function() { return createClient; });
7397/* harmony import */ var _create_contentful_api__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./create-contentful-api */ "./create-contentful-api.ts");
7398/* harmony import */ var _create_cma_http_client__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./create-cma-http-client */ "./create-cma-http-client.ts");
7399/**
7400 * Contentful Management API SDK. Allows you to create instances of a client
7401 * with access to the Contentful Content Management API.
7402 * @packageDocumentation
7403 */
7404
7405
7406/**
7407 * Create a client instance
7408 * @param params - Client initialization parameters
7409 *
7410 * ```javascript
7411 * const client = contentfulManagement.createClient({
7412 * accessToken: 'myAccessToken'
7413 * })
7414 * ```
7415 */
7416
7417function createClient(params) {
7418 const http = Object(_create_cma_http_client__WEBPACK_IMPORTED_MODULE_1__["createCMAHttpClient"])(params);
7419 const api = Object(_create_contentful_api__WEBPACK_IMPORTED_MODULE_0__["default"])({
7420 http: http
7421 });
7422 return api;
7423}
7424
7425/***/ }),
7426
7427/***/ "./create-cma-http-client.ts":
7428/*!***********************************!*\
7429 !*** ./create-cma-http-client.ts ***!
7430 \***********************************/
7431/*! exports provided: createCMAHttpClient */
7432/***/ (function(module, __webpack_exports__, __webpack_require__) {
7433
7434"use strict";
7435__webpack_require__.r(__webpack_exports__);
7436/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCMAHttpClient", function() { return createCMAHttpClient; });
7437/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! axios */ "../node_modules/axios/index.js");
7438/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_0__);
7439/* 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");
7440/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
7441/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_2__);
7442function 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; }
7443
7444function _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; }
7445
7446function _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; }
7447
7448/**
7449 * @packageDocumentation
7450 * @hidden
7451 */
7452
7453
7454
7455
7456/**
7457 * @private
7458 */
7459function createCMAHttpClient(params) {
7460 const defaultParameters = {
7461 defaultHostname: 'api.contentful.com',
7462 defaultHostnameUpload: 'upload.contentful.com'
7463 };
7464 const userAgentHeader = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["getUserAgentHeader"])( // @ts-expect-error
7465 `contentful-management.js/${"5.27.1"}`, params.application, params.integration, params.feature);
7466 const requiredHeaders = {
7467 'Content-Type': 'application/vnd.contentful.management.v1+json',
7468 'X-Contentful-User-Agent': userAgentHeader
7469 };
7470 params = _objectSpread(_objectSpread({}, defaultParameters), lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_2___default()(params));
7471
7472 if (!params.accessToken) {
7473 throw new TypeError('Expected parameter accessToken');
7474 }
7475
7476 params.headers = _objectSpread(_objectSpread({}, params.headers), requiredHeaders);
7477 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createHttpClient"])(axios__WEBPACK_IMPORTED_MODULE_0___default.a, params);
7478}
7479
7480/***/ }),
7481
7482/***/ "./create-contentful-api.ts":
7483/*!**********************************!*\
7484 !*** ./create-contentful-api.ts ***!
7485 \**********************************/
7486/*! exports provided: default */
7487/***/ (function(module, __webpack_exports__, __webpack_require__) {
7488
7489"use strict";
7490__webpack_require__.r(__webpack_exports__);
7491/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return createClientApi; });
7492/* 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");
7493/* harmony import */ var _error_handler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./error-handler */ "./error-handler.ts");
7494/* harmony import */ var _entities__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./entities */ "./entities/index.ts");
7495
7496
7497
7498function createClientApi({
7499 http
7500}) {
7501 const _entities$space = _entities__WEBPACK_IMPORTED_MODULE_2__["default"].space,
7502 wrapSpace = _entities$space.wrapSpace,
7503 wrapSpaceCollection = _entities$space.wrapSpaceCollection;
7504 const wrapUser = _entities__WEBPACK_IMPORTED_MODULE_2__["default"].user.wrapUser;
7505 const _entities$personalAcc = _entities__WEBPACK_IMPORTED_MODULE_2__["default"].personalAccessToken,
7506 wrapPersonalAccessToken = _entities$personalAcc.wrapPersonalAccessToken,
7507 wrapPersonalAccessTokenCollection = _entities$personalAcc.wrapPersonalAccessTokenCollection;
7508 const _entities$organizatio = _entities__WEBPACK_IMPORTED_MODULE_2__["default"].organization,
7509 wrapOrganization = _entities$organizatio.wrapOrganization,
7510 wrapOrganizationCollection = _entities$organizatio.wrapOrganizationCollection;
7511 const wrapUsageCollection = _entities__WEBPACK_IMPORTED_MODULE_2__["default"].usage.wrapUsageCollection;
7512 return {
7513 /**
7514 * Gets all spaces
7515 * @return Promise for a collection of Spaces
7516 * ```javascript
7517 * const contentful = require('contentful-management')
7518 *
7519 * const client = contentful.createClient({
7520 * accessToken: '<content_management_api_key>'
7521 * })
7522 *
7523 * client.getSpaces()
7524 * .then((response) => console.log(response.items))
7525 * .catch(console.error)
7526 * ```
7527 */
7528 getSpaces: function getSpaces(query = {}) {
7529 return http.get('', Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["createRequestConfig"])({
7530 query: query
7531 })).then(response => wrapSpaceCollection(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_1__["default"]);
7532 },
7533
7534 /**
7535 * Gets a space
7536 * @param id - Space ID
7537 * @return Promise for a Space
7538 * ```javascript
7539 * const contentful = require('contentful-management')
7540 *
7541 * const client = contentful.createClient({
7542 * accessToken: '<content_management_api_key>'
7543 * })
7544 *
7545 * client.getSpace('<space_id>')
7546 * .then((space) => console.log(space))
7547 * .catch(console.error)
7548 * ```
7549 */
7550 getSpace: function getSpace(id) {
7551 return http.get(id).then(response => wrapSpace(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_1__["default"]);
7552 },
7553
7554 /**
7555 * Creates a space
7556 * @param data - Object representation of the Space to be created
7557 * @param organizationId - Organization ID, if the associated token can manage more than one organization.
7558 * @return Promise for the newly created Space
7559 * @example ```javascript
7560 * const contentful = require('contentful-management')
7561 *
7562 * const client = contentful.createClient({
7563 * accessToken: '<content_management_api_key>'
7564 * })
7565 *
7566 * client.createSpace({
7567 * name: 'Name of new space'
7568 * })
7569 * .then((space) => console.log(space))
7570 * .catch(console.error)
7571 * ```
7572 */
7573 createSpace: function createSpace(data, organizationId) {
7574 return http.post('', data, {
7575 headers: organizationId ? {
7576 'X-Contentful-Organization': organizationId
7577 } : {}
7578 }).then(response => wrapSpace(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_1__["default"]);
7579 },
7580
7581 /**
7582 * Gets an organization
7583 * @param id - Organization ID
7584 * @return Promise for a Organization
7585 * @example ```javascript
7586 * const contentful = require('contentful-management')
7587 *
7588 * const client = contentful.createClient({
7589 * accessToken: '<content_management_api_key>'
7590 * })
7591 *
7592 * client.getOrganization('<org_id>')
7593 * .then((org) => console.log(org))
7594 * .catch(console.error)
7595 * ```
7596 */
7597 getOrganization: function getOrganization(id) {
7598 var _http$defaults, _http$defaults$baseUR;
7599
7600 const 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/');
7601 return http.get('', {
7602 baseURL
7603 }).then(response => {
7604 const org = response.data.items.find(org => org.sys.id === id);
7605
7606 if (!org) {
7607 const error = new Error(`No organization was found with the ID ${id} instead got ${JSON.stringify(response)}`); // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
7608 // @ts-ignore
7609
7610 error.status = 404; // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
7611 // @ts-ignore
7612
7613 error.statusText = 'Not Found';
7614 return Promise.reject(error);
7615 }
7616
7617 return wrapOrganization(http, org);
7618 }, _error_handler__WEBPACK_IMPORTED_MODULE_1__["default"]);
7619 },
7620
7621 /**
7622 * Gets a collection of Organizations
7623 * @return Promise for a collection of Organizations
7624 * @example ```javascript
7625 * const contentful = require('contentful-management')
7626 *
7627 * const client = contentful.createClient({
7628 * accessToken: '<content_management_api_key>'
7629 * })
7630 *
7631 * client.getOrganizations()
7632 * .then(result => console.log(result.items))
7633 * .catch(console.error)
7634 * ```
7635 */
7636 getOrganizations: function getOrganizations() {
7637 var _http$defaults2, _http$defaults2$baseU;
7638
7639 const 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/');
7640 return http.get('', {
7641 baseURL
7642 }).then(response => wrapOrganizationCollection(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_1__["default"]);
7643 },
7644
7645 /**
7646 * Gets the authenticated user
7647 * @return Promise for a User
7648 * @example ```javascript
7649 * const contentful = require('contentful-management')
7650 *
7651 * const client = contentful.createClient({
7652 * accessToken: '<content_management_api_key>'
7653 * })
7654 *
7655 * client.getCurrentUser()
7656 * .then(user => console.log(user.firstName))
7657 * .catch(console.error)
7658 * ```
7659 */
7660 getCurrentUser: function getCurrentUser() {
7661 var _http$defaults3, _http$defaults3$baseU;
7662
7663 const 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/');
7664 return http.get('', {
7665 baseURL
7666 }).then(response => wrapUser(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_1__["default"]);
7667 },
7668
7669 /**
7670 * Creates a personal access token
7671 * @param data - personal access token config
7672 * @return Promise for a Token
7673 * @example ```javascript
7674 * const contentful = require('contentful-management')
7675 *
7676 * const client = contentful.createClient({
7677 * accessToken: '<content_management_api_key>'
7678 * })
7679 *
7680 * client.createPersonalAccessToken(
7681 * {
7682 * "name": "My Token",
7683 * "scope": [
7684 * "content_management_manage"
7685 * ]
7686 * }
7687 * )
7688 * .then(personalAccessToken => console.log(personalAccessToken.token))
7689 * .catch(console.error)
7690 * ```
7691 */
7692 createPersonalAccessToken: function createPersonalAccessToken(data) {
7693 var _http$defaults4, _http$defaults4$baseU;
7694
7695 const 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');
7696 return http.post('', data, {
7697 baseURL
7698 }).then(response => wrapPersonalAccessToken(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_1__["default"]);
7699 },
7700
7701 /**
7702 * Gets a personal access token
7703 * @param data - personal access token config
7704 * @return Promise for a Token
7705 * @example ```javascript
7706 * const contentful = require('contentful-management')
7707 *
7708 * const client = contentful.createClient({
7709 * accessToken: '<content_management_api_key>'
7710 * })
7711 *
7712 * client.getPersonalAccessToken(tokenId)
7713 * .then(token => console.log(token.token))
7714 * .catch(console.error)
7715 * ```
7716 */
7717 getPersonalAccessToken: function getPersonalAccessToken(tokenId) {
7718 var _http$defaults5, _http$defaults5$baseU;
7719
7720 const 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');
7721 return http.get(tokenId, {
7722 baseURL
7723 }).then(response => wrapPersonalAccessToken(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_1__["default"]);
7724 },
7725
7726 /**
7727 * Gets all personal access tokens
7728 * @return Promise for a Token
7729 * @example ```javascript
7730 * const contentful = require('contentful-management')
7731 *
7732 * const client = contentful.createClient({
7733 * accessToken: '<content_management_api_key>'
7734 * })
7735 *
7736 * client.getPersonalAccessTokens()
7737 * .then(response => console.log(reponse.items))
7738 * .catch(console.error)
7739 * ```
7740 */
7741 getPersonalAccessTokens: function getPersonalAccessTokens() {
7742 var _http$defaults6, _http$defaults6$baseU;
7743
7744 const 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');
7745 return http.get('', {
7746 baseURL
7747 }).then(response => wrapPersonalAccessTokenCollection(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_1__["default"]);
7748 },
7749
7750 /**
7751 * Get organization usage grouped by {@link UsageMetricEnum metric}
7752 *
7753 * @param organizationId - Id of an organization
7754 * @param query - Query parameters
7755 * @return Promise of a collection of usages
7756 * @example ```javascript
7757 *
7758 * const contentful = require('contentful-management')
7759 *
7760 * const client = contentful.createClient({
7761 * accessToken: '<content_management_api_key>'
7762 * })
7763 *
7764 * client.getOrganizationUsage('<organizationId>', {
7765 * 'metric[in]': 'cma,gql',
7766 * 'dateRange.startAt': '2019-10-22',
7767 * 'dateRange.endAt': '2019-11-10'
7768 * }
7769 * })
7770 * .then(result => console.log(result.items))
7771 * .catch(console.error)
7772 * ```
7773 */
7774 getOrganizationUsage: function getOrganizationUsage(organizationId, query = {}) {
7775 var _http$defaults7, _http$defaults7$baseU;
7776
7777 const 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/${organizationId}/organization_periodic_usages`);
7778 return http.get('', {
7779 baseURL,
7780 params: query
7781 }).then(response => wrapUsageCollection(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_1__["default"]);
7782 },
7783
7784 /**
7785 * Get organization usage grouped by space and metric
7786 *
7787 * @param organizationId - Id of an organization
7788 * @param query - Query parameters
7789 * @return Promise of a collection of usages
7790 * ```javascript
7791 * const contentful = require('contentful-management')
7792 *
7793 * const client = contentful.createClient({
7794 * accessToken: '<content_management_api_key>'
7795 * })
7796 *
7797 * client.getSpaceUsage('<organizationId>', {
7798 * skip: 0,
7799 * limit: 10,
7800 * 'metric[in]': 'cda,cpa,gql',
7801 * 'dateRange.startAt': '2019-10-22',
7802 * 'dateRange.endAt': '2020-11-30'
7803 * }
7804 * })
7805 * .then(result => console.log(result.items))
7806 * .catch(console.error)
7807 * ```
7808 */
7809 getSpaceUsage: function getSpaceUsage(organizationId, query = {}) {
7810 var _http$defaults8, _http$defaults8$baseU;
7811
7812 const 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/${organizationId}/space_periodic_usages`);
7813 return http.get('', {
7814 baseURL,
7815 params: query
7816 }).then(response => wrapUsageCollection(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_1__["default"]);
7817 },
7818
7819 /**
7820 * Make a custom request to the Contentful management API's /spaces endpoint
7821 * @param opts - axios request options (https://github.com/mzabriskie/axios)
7822 * @return Promise for the response data
7823 * ```javascript
7824 * const contentful = require('contentful-management')
7825 *
7826 * const client = contentful.createClient({
7827 * accessToken: '<content_management_api_key>'
7828 * })
7829 *
7830 * client.rawRequest({
7831 * method: 'GET',
7832 * url: '/custom/path'
7833 * })
7834 * .then((responseData) => console.log(responseData))
7835 * .catch(console.error)
7836 * ```
7837 */
7838 rawRequest: function rawRequest(opts) {
7839 return http(opts).then(response => response.data, _error_handler__WEBPACK_IMPORTED_MODULE_1__["default"]);
7840 }
7841 };
7842}
7843
7844/***/ }),
7845
7846/***/ "./create-environment-api.ts":
7847/*!***********************************!*\
7848 !*** ./create-environment-api.ts ***!
7849 \***********************************/
7850/*! exports provided: default */
7851/***/ (function(module, __webpack_exports__, __webpack_require__) {
7852
7853"use strict";
7854__webpack_require__.r(__webpack_exports__);
7855/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return createEnvironmentApi; });
7856/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
7857/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
7858/* 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");
7859/* harmony import */ var _error_handler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./error-handler */ "./error-handler.ts");
7860/* harmony import */ var _entities__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./entities */ "./entities/index.ts");
7861function 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; }
7862
7863function _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; }
7864
7865function _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; }
7866
7867
7868
7869
7870
7871
7872/**
7873 * Creates API object with methods to access the Environment API
7874 */
7875function createEnvironmentApi({
7876 http,
7877 httpUpload
7878}) {
7879 const wrapEnvironment = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].environment.wrapEnvironment;
7880 const _entities$contentType = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].contentType,
7881 wrapContentType = _entities$contentType.wrapContentType,
7882 wrapContentTypeCollection = _entities$contentType.wrapContentTypeCollection;
7883 const _entities$entry = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].entry,
7884 wrapEntry = _entities$entry.wrapEntry,
7885 wrapEntryCollection = _entities$entry.wrapEntryCollection;
7886 const _entities$asset = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].asset,
7887 wrapAsset = _entities$asset.wrapAsset,
7888 wrapAssetCollection = _entities$asset.wrapAssetCollection;
7889 const _entities$locale = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].locale,
7890 wrapLocale = _entities$locale.wrapLocale,
7891 wrapLocaleCollection = _entities$locale.wrapLocaleCollection;
7892 const wrapSnapshotCollection = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].snapshot.wrapSnapshotCollection;
7893 const wrapEditorInterface = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].editorInterface.wrapEditorInterface;
7894 const wrapUpload = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].upload.wrapUpload;
7895 const _entities$uiExtension = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].uiExtension,
7896 wrapUiExtension = _entities$uiExtension.wrapUiExtension,
7897 wrapUiExtensionCollection = _entities$uiExtension.wrapUiExtensionCollection;
7898 const _entities$appInstalla = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].appInstallation,
7899 wrapAppInstallation = _entities$appInstalla.wrapAppInstallation,
7900 wrapAppInstallationCollection = _entities$appInstalla.wrapAppInstallationCollection;
7901
7902 function createAsset(data) {
7903 return http.post('assets', data).then(response => wrapAsset(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
7904 }
7905
7906 function createUpload(data) {
7907 const file = data.file;
7908
7909 if (!file) {
7910 return Promise.reject(new Error('Unable to locate a file to upload.'));
7911 }
7912
7913 return httpUpload.post('uploads', file, {
7914 headers: {
7915 'Content-Type': 'application/octet-stream'
7916 }
7917 }).then(uploadResponse => {
7918 return wrapUpload(httpUpload, uploadResponse.data);
7919 }).catch(_error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
7920 }
7921 /**
7922 * @private
7923 * sdk relies heavily on sys metadata
7924 * so we cannot omit the sys property on sdk level
7925 */
7926
7927
7928 function normalizeSelect(query) {
7929 if (query.select && !/sys/i.test(query.select)) {
7930 query.select += ',sys';
7931 }
7932 }
7933
7934 return {
7935 /**
7936 * Deletes the environment
7937 * @return Promise for the deletion. It contains no data, but the Promise error case should be handled.
7938 * @example ```javascript
7939 * const contentful = require('contentful-management')
7940 *
7941 * const client = contentful.createClient({
7942 * accessToken: '<content_management_api_key>'
7943 * })
7944 *
7945 * client.getSpace('<space_id>')
7946 * .then((space) => space.getEnvironment('<environment-id>'))
7947 * .then((environment) => environment.delete())
7948 * .then(() => console.log('Environment deleted.'))
7949 * .catch(console.error)
7950 * ```
7951 */
7952 delete: function deleteEnvironment() {
7953 return http.delete('').then(() => {// noop
7954 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
7955 },
7956
7957 /**
7958 * Updates the environment
7959 * @return Promise for the updated environment.
7960 * @example ```javascript
7961 * const contentful = require('contentful-management')
7962 *
7963 * const client = contentful.createClient({
7964 * accessToken: '<content_management_api_key>'
7965 * })
7966 *
7967 * client.getSpace('<space_id>')
7968 * .then((space) => space.getEnvironment('<environment-id>'))
7969 * .then((environment) => {
7970 * environment.name = 'New name'
7971 * return environment.update()
7972 * })
7973 * .then((environment) => console.log(`Environment ${environment.sys.id} renamed.`)
7974 * .catch(console.error)
7975 * ```
7976 */
7977 update: function updateEnvironment() {
7978 const raw = this.toPlainObject();
7979 const data = lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(raw);
7980 delete data.sys;
7981 return http.put('', data, {
7982 headers: {
7983 'X-Contentful-Version': raw.sys.version
7984 }
7985 }).then(response => wrapEnvironment(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
7986 },
7987
7988 /**
7989 * Creates SDK Entry object (locally) from entry data
7990 * @param entryData - Entry Data
7991 * @return Entry
7992 * @example ```javascript
7993 * environment.getEntry('entryId').then(entry => {
7994 *
7995 * // Build a plainObject in order to make it usable for React (saving in state or redux)
7996 * const plainObject = entry.toPlainObject();
7997 *
7998 * // The entry is being updated in some way as plainObject:
7999 * const updatedPlainObject = {
8000 * ...plainObject,
8001 * fields: {
8002 * ...plainObject.fields,
8003 * title: {
8004 * 'en-US': 'updatedTitle'
8005 * }
8006 * }
8007 * };
8008 *
8009 * // Rebuild an sdk object out of the updated plainObject:
8010 * const entryWithMethodsAgain = environment.getEntryFromData(updatedPlainObject);
8011 *
8012 * // Update with help of the sdk method:
8013 * entryWithMethodsAgain.update();
8014 *
8015 * });
8016 * ```
8017 **/
8018 getEntryFromData(entryData) {
8019 return wrapEntry(http, entryData);
8020 },
8021
8022 /**
8023 * Creates SDK Asset object (locally) from entry data
8024 * @param assetData - Asset ID
8025 * @return Asset
8026 * @example ```javascript
8027 * environment.getAsset('asset_id').then(asset => {
8028 *
8029 * // Build a plainObject in order to make it usable for React (saving in state or redux)
8030 * const plainObject = asset.toPlainObject();
8031 *
8032 * // The asset is being updated in some way as plainObject:
8033 * const updatedPlainObject = {
8034 * ...plainObject,
8035 * fields: {
8036 * ...plainObject.fields,
8037 * title: {
8038 * 'en-US': 'updatedTitle'
8039 * }
8040 * }
8041 * };
8042 *
8043 * // Rebuild an sdk object out of the updated plainObject:
8044 * const assetWithMethodsAgain = environment.getAssetFromData(updatedPlainObject);
8045 *
8046 * // Update with help of the sdk method:
8047 * assetWithMethodsAgain.update();
8048 *
8049 * });
8050 * ```
8051 */
8052 getAssetFromData(assetData) {
8053 return wrapAsset(http, assetData);
8054 },
8055
8056 /**
8057 * Gets a Content Type
8058 * @param id - Content Type ID
8059 * @return Promise for a Content Type
8060 * @example ```javascript
8061 * const contentful = require('contentful-management')
8062 *
8063 * const client = contentful.createClient({
8064 * accessToken: '<content_management_api_key>'
8065 * })
8066 *
8067 * client.getSpace('<space_id>')
8068 * .then((space) => space.getEnvironment('<environment-id>'))
8069 * .then((environment) => environment.getContentType('<content_type_id>'))
8070 * .then((contentType) => console.log(contentType))
8071 * .catch(console.error)
8072 * ```
8073 */
8074 getContentType(id) {
8075 return http.get('content_types/' + id).then(response => wrapContentType(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8076 },
8077
8078 /**
8079 * Gets a collection of Content Types
8080 * @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.
8081 * @return Promise for a collection of Content Types
8082 * @example ```javascript
8083 * const contentful = require('contentful-management')
8084 *
8085 * const client = contentful.createClient({
8086 * accessToken: '<content_management_api_key>'
8087 * })
8088 *
8089 * client.getSpace('<space_id>')
8090 * .then((space) => space.getEnvironment('<environment-id>'))
8091 * .then((environment) => environment.getContentTypes())
8092 * .then((response) => console.log(response.items))
8093 * .catch(console.error)
8094 * ```
8095 */
8096 getContentTypes(query = {}) {
8097 return http.get('content_types', Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
8098 query: query
8099 })).then(response => wrapContentTypeCollection(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8100 },
8101
8102 /**
8103 * Creates a Content Type
8104 * @param data - Object representation of the Content Type to be created
8105 * @return Promise for the newly created Content Type
8106 * @example ```javascript
8107 * const contentful = require('contentful-management')
8108 *
8109 * const client = contentful.createClient({
8110 * accessToken: '<content_management_api_key>'
8111 * })
8112 *
8113 * client.getSpace('<space_id>')
8114 * .then((space) => space.getEnvironment('<environment-id>'))
8115 * .then((environment) => environment.createContentType({
8116 * name: 'Blog Post',
8117 * fields: [
8118 * {
8119 * id: 'title',
8120 * name: 'Title',
8121 * required: true,
8122 * localized: false,
8123 * type: 'Text'
8124 * }
8125 * ]
8126 * }))
8127 * .then((contentType) => console.log(contentType))
8128 * .catch(console.error)
8129 * ```
8130 */
8131 createContentType(data) {
8132 return http.post('content_types', data).then(response => wrapContentType(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8133 },
8134
8135 /**
8136 * Creates a Content Type with a custom ID
8137 * @param id - Content Type ID
8138 * @param data - Object representation of the Content Type to be created
8139 * @return Promise for the newly created Content Type
8140 * @example ```javascript
8141 * const contentful = require('contentful-management')
8142 *
8143 * const client = contentful.createClient({
8144 * accessToken: '<content_management_api_key>'
8145 * })
8146 *
8147 * client.getSpace('<space_id>')
8148 * .then((space) => space.getEnvironment('<environment-id>'))
8149 * .then((environment) => environment.createContentTypeWithId('<content-type-id>', {
8150 * name: 'Blog Post',
8151 * fields: [
8152 * {
8153 * id: 'title',
8154 * name: 'Title',
8155 * required: true,
8156 * localized: false,
8157 * type: 'Text'
8158 * }
8159 * ]
8160 * }))
8161 * .then((contentType) => console.log(contentType))
8162 * .catch(console.error)
8163 * ```
8164 */
8165 createContentTypeWithId(id, data) {
8166 return http.put('content_types/' + id, data).then(response => wrapContentType(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8167 },
8168
8169 /**
8170 * Gets an EditorInterface for a ContentType
8171 * @param contentTypeId - Content Type ID
8172 * @return Promise for an EditorInterface
8173 * @example ```javascript
8174 * const contentful = require('contentful-management')
8175 *
8176 * const client = contentful.createClient({
8177 * accessToken: '<content_management_api_key>'
8178 * })
8179 *
8180 * client.getSpace('<space_id>')
8181 * .then((space) => space.getEnvironment('<environment-id>'))
8182 * .then((environment) => environment.getEditorInterfaceForContentType('<content_type_id>'))
8183 * .then((EditorInterface) => console.log(EditorInterface))
8184 * .catch(console.error)
8185 * ```
8186 */
8187 getEditorInterfaceForContentType(contentTypeId) {
8188 return http.get('content_types/' + contentTypeId + '/editor_interface').then(response => wrapEditorInterface(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8189 },
8190
8191 /**
8192 * Gets an Entry
8193 * Warning: if you are using the select operator, when saving, any field that was not selected will be removed
8194 * from your entry in the backend
8195 * @param id - Entry ID
8196 * @param query - Object with search parameters. In this method it's only useful for `locale`.
8197 * @return Promise for an Entry
8198 * @example ```javascript
8199 * const contentful = require('contentful-management')
8200 *
8201 * const client = contentful.createClient({
8202 * accessToken: '<content_management_api_key>'
8203 * })
8204 *
8205 * client.getSpace('<space_id>')
8206 * .then((space) => space.getEnvironment('<environment-id>'))
8207 * .then((environment) => environment.getEntry('<entry-id>'))
8208 * .then((entry) => console.log(entry))
8209 * .catch(console.error)
8210 * ```
8211 */
8212 getEntry(id, query = {}) {
8213 normalizeSelect(query);
8214 return http.get('entries/' + id, Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
8215 query: query
8216 })).then(response => wrapEntry(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8217 },
8218
8219 /**
8220 * Gets a collection of Entries
8221 * Warning: if you are using the select operator, when saving, any field that was not selected will be removed
8222 * from your entry in the backend
8223 * @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.
8224 * @return Promise for a collection of Entries
8225 * @example ```javascript
8226 * const contentful = require('contentful-management')
8227 *
8228 * const client = contentful.createClient({
8229 * accessToken: '<content_management_api_key>'
8230 * })
8231 *
8232 * client.getSpace('<space_id>')
8233 * .then((space) => space.getEnvironment('<environment-id>'))
8234 * .then((environment) => environment.getEntries({'content_type': 'foo'})) // you can add more queries as 'key': 'value'
8235 * .then((response) => console.log(response.items))
8236 * .catch(console.error)
8237 * ```
8238 */
8239 getEntries(query = {}) {
8240 normalizeSelect(query);
8241 return http.get('entries', Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
8242 query: query
8243 })).then(response => wrapEntryCollection(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8244 },
8245
8246 /**
8247 * Creates a Entry
8248 * @param contentTypeId - The Content Type ID of the newly created Entry
8249 * @param data - Object representation of the Entry to be created
8250 * @return Promise for the newly created Entry
8251 * @example ```javascript
8252 * const contentful = require('contentful-management')
8253 *
8254 * const client = contentful.createClient({
8255 * accessToken: '<content_management_api_key>'
8256 * })
8257 *
8258 * client.getSpace('<space_id>')
8259 * .then((space) => space.getEnvironment('<environment-id>'))
8260 * .then((environment) => environment.createEntry('<content_type_id>', {
8261 * fields: {
8262 * title: {
8263 * 'en-US': 'Entry title'
8264 * }
8265 * }
8266 * }))
8267 * .then((entry) => console.log(entry))
8268 * .catch(console.error)
8269 * ```
8270 */
8271 createEntry(contentTypeId, data) {
8272 return http.post('entries', data, {
8273 headers: {
8274 'X-Contentful-Content-Type': contentTypeId
8275 }
8276 }).then(response => wrapEntry(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8277 },
8278
8279 /**
8280 * Creates a Entry with a custom ID
8281 * @param contentTypeId - The Content Type of the newly created Entry
8282 * @param id - Entry ID
8283 * @param data - Object representation of the Entry to be created
8284 * @return Promise for the newly created Entry
8285 * @example ```javascript
8286 * const contentful = require('contentful-management')
8287 *
8288 * const client = contentful.createClient({
8289 * accessToken: '<content_management_api_key>'
8290 * })
8291 *
8292 * // Create entry
8293 * client.getSpace('<space_id>')
8294 * .then((space) => space.getEnvironment('<environment-id>'))
8295 * .then((environment) => environment.createEntryWithId('<content_type_id>', '<entry_id>', {
8296 * fields: {
8297 * title: {
8298 * 'en-US': 'Entry title'
8299 * }
8300 * }
8301 * }))
8302 * .then((entry) => console.log(entry))
8303 * .catch(console.error)
8304 * ```
8305 */
8306 createEntryWithId(contentTypeId, id, data) {
8307 return http.put('entries/' + id, data, {
8308 headers: {
8309 'X-Contentful-Content-Type': contentTypeId
8310 }
8311 }).then(response => wrapEntry(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8312 },
8313
8314 /**
8315 * Gets an Asset
8316 * Warning: if you are using the select operator, when saving, any field that was not selected will be removed
8317 * from your entry in the backend
8318 * @param id - Asset ID
8319 * @param query - Object with search parameters. In this method it's only useful for `locale`.
8320 * @return Promise for an Asset
8321 * @example ```javascript
8322 * const contentful = require('contentful-management')
8323 *
8324 * const client = contentful.createClient({
8325 * accessToken: '<content_management_api_key>'
8326 * })
8327 *
8328 * client.getSpace('<space_id>')
8329 * .then((space) => space.getEnvironment('<environment-id>'))
8330 * .then((environment) => environment.getAsset('<asset_id>'))
8331 * .then((asset) => console.log(asset))
8332 * .catch(console.error)
8333 * ```
8334 */
8335 getAsset(id, query = {}) {
8336 normalizeSelect(query);
8337 return http.get('assets/' + id, Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
8338 query: query
8339 })).then(response => wrapAsset(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8340 },
8341
8342 /**
8343 * Gets a collection of Assets
8344 * Warning: if you are using the select operator, when saving, any field that was not selected will be removed
8345 * from your entry in the backend
8346 * @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.
8347 * @return Promise for a collection of Assets
8348 * @example ```javascript
8349 * const contentful = require('contentful-management')
8350 *
8351 * const client = contentful.createClient({
8352 * accessToken: '<content_management_api_key>'
8353 * })
8354 *
8355 * client.getSpace('<space_id>')
8356 * .then((space) => space.getEnvironment('<environment-id>'))
8357 * .then((environment) => environment.getAssets())
8358 * .then((response) => console.log(response.items))
8359 * .catch(console.error)
8360 * ```
8361 */
8362 getAssets(query = {}) {
8363 normalizeSelect(query);
8364 return http.get('assets', Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
8365 query: query
8366 })).then(response => wrapAssetCollection(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8367 },
8368
8369 /**
8370 * Creates a Asset. After creation, call asset.processForLocale or asset.processForAllLocales to start asset processing.
8371 * @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.
8372 * @return Promise for the newly created Asset
8373 * @example ```javascript
8374 * const client = contentful.createClient({
8375 * accessToken: '<content_management_api_key>'
8376 * })
8377 *
8378 * // Create asset
8379 * client.getSpace('<space_id>')
8380 * .then((space) => space.getEnvironment('<environment-id>'))
8381 * .then((environment) => environment.createAsset({
8382 * fields: {
8383 * title: {
8384 * 'en-US': 'Playsam Streamliner'
8385 * },
8386 * file: {
8387 * 'en-US': {
8388 * contentType: 'image/jpeg',
8389 * fileName: 'example.jpeg',
8390 * upload: 'https://example.com/example.jpg'
8391 * }
8392 * }
8393 * }
8394 * }))
8395 * .then((asset) => asset.processForLocale("en-US")) // OR asset.processForAllLocales()
8396 * .then((asset) => console.log(asset))
8397 * .catch(console.error)
8398 * ```
8399 */
8400 createAsset: createAsset,
8401
8402 /**
8403 * Creates a Asset with a custom ID. After creation, call asset.processForLocale or asset.processForAllLocales to start asset processing.
8404 * @param id - Asset ID
8405 * @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.
8406 * @return Promise for the newly created Asset
8407 * @example ```javascript
8408 * const client = contentful.createClient({
8409 * accessToken: '<content_management_api_key>'
8410 * })
8411 *
8412 * // Create asset
8413 * client.getSpace('<space_id>')
8414 * .then((space) => space.getEnvironment('<environment-id>'))
8415 * .then((environment) => environment.createAssetWithId('<asset_id>', {
8416 * title: {
8417 * 'en-US': 'Playsam Streamliner'
8418 * },
8419 * file: {
8420 * 'en-US': {
8421 * contentType: 'image/jpeg',
8422 * fileName: 'example.jpeg',
8423 * upload: 'https://example.com/example.jpg'
8424 * }
8425 * }
8426 * }))
8427 * .then((asset) => asset.process())
8428 * .then((asset) => console.log(asset))
8429 * .catch(console.error)
8430 * ```
8431 */
8432 createAssetWithId(id, data) {
8433 return http.put('assets/' + id, data).then(response => wrapAsset(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8434 },
8435
8436 /**
8437 * Creates a Asset based on files. After creation, call asset.processForLocale or asset.processForAllLocales to start asset processing.
8438 * @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.
8439 * @param data.fields.file.[LOCALE].file - Can be a string, an ArrayBuffer or a Stream.
8440 * @return Promise for the newly created Asset
8441 * @example ```javascript
8442 * const client = contentful.createClient({
8443 * accessToken: '<content_management_api_key>'
8444 * })
8445 *
8446 * client.getSpace('<space_id>')
8447 * .then((space) => space.getEnvironment('<environment-id>'))
8448 * .then((environment) => environment.createAssetFromFiles({
8449 * fields: {
8450 * file: {
8451 * 'en-US': {
8452 * contentType: 'image/jpeg',
8453 * fileName: 'filename_english.jpg',
8454 * file: createReadStream('path/to/filename_english.jpg')
8455 * },
8456 * 'de-DE': {
8457 * contentType: 'image/svg+xml',
8458 * fileName: 'filename_german.svg',
8459 * file: '<svg><path fill="red" d="M50 50h150v50H50z"/></svg>'
8460 * }
8461 * }
8462 * }
8463 * }))
8464 * .then((asset) => console.log(asset))
8465 * .catch(console.error)
8466 * ```
8467 */
8468 createAssetFromFiles(data) {
8469 const file = data.fields.file;
8470 return Promise.all(Object.keys(file).map(locale => {
8471 const _file$locale = file[locale],
8472 contentType = _file$locale.contentType,
8473 fileName = _file$locale.fileName;
8474 return createUpload(file[locale]).then(upload => {
8475 return {
8476 [locale]: {
8477 contentType,
8478 fileName,
8479 uploadFrom: {
8480 sys: {
8481 type: 'Link',
8482 linkType: 'Upload',
8483 id: upload.sys.id
8484 }
8485 }
8486 }
8487 };
8488 });
8489 })).then(uploads => {
8490 const file = uploads.reduce((fieldsData, upload) => _objectSpread(_objectSpread({}, fieldsData), upload), {});
8491
8492 const asset = _objectSpread(_objectSpread({}, data), {}, {
8493 fields: _objectSpread(_objectSpread({}, data.fields), {}, {
8494 file
8495 })
8496 });
8497
8498 return createAsset(asset);
8499 }).catch(_error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8500 },
8501
8502 /**
8503 * Gets an Upload
8504 * @param id - Upload ID
8505 * @return Promise for an Upload
8506 * @example ```javascript
8507 * const client = contentful.createClient({
8508 * accessToken: '<content_management_api_key>'
8509 * })
8510 * const uploadStream = createReadStream('path/to/filename_english.jpg')
8511 *
8512 * client.getSpace('<space_id>')
8513 * .then((space) => space.getEnvironment('<environment-id>'))
8514 * .then((environment) => environment.getUpload('<upload-id>')
8515 * .then((upload) => console.log(upload))
8516 * .catch(console.error)
8517 */
8518 getUpload(id) {
8519 return httpUpload.get('uploads/' + id).then(response => wrapUpload(http, response.data)).catch(_error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8520 },
8521
8522 /**
8523 * Creates a Upload.
8524 * @param data - Object with file information.
8525 * @param data.file - Actual file content. Can be a string, an ArrayBuffer or a Stream.
8526 * @return Upload object containing information about the uploaded file.
8527 * @example ```javascript
8528 * const client = contentful.createClient({
8529 * accessToken: '<content_management_api_key>'
8530 * })
8531 * const uploadStream = createReadStream('path/to/filename_english.jpg')
8532 *
8533 * client.getSpace('<space_id>')
8534 * .then((space) => space.getEnvironment('<environment-id>'))
8535 * .then((environment) => environment.createUpload({file: uploadStream})
8536 * .then((upload) => console.log(upload))
8537 * .catch(console.error)
8538 * ```
8539 */
8540 createUpload: createUpload,
8541
8542 /**
8543 * Gets a Locale
8544 * @param id - Locale ID
8545 * @return Promise for an Locale
8546 * @example ```javascript
8547 * const contentful = require('contentful-management')
8548 *
8549 * const client = contentful.createClient({
8550 * accessToken: '<content_management_api_key>'
8551 * })
8552 *
8553 * client.getSpace('<space_id>')
8554 * .then((space) => space.getEnvironment('<environment-id>'))
8555 * .then((environment) => environment.getLocale('<locale_id>'))
8556 * .then((locale) => console.log(locale))
8557 * .catch(console.error)
8558 * ```
8559 */
8560 getLocale(id) {
8561 return http.get('locales/' + id).then(response => wrapLocale(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8562 },
8563
8564 /**
8565 * Gets a collection of Locales
8566 * @return Promise for a collection of Locales
8567 * @example ```javascript
8568 * const contentful = require('contentful-management')
8569 *
8570 * const client = contentful.createClient({
8571 * accessToken: '<content_management_api_key>'
8572 * })
8573 *
8574 * client.getSpace('<space_id>')
8575 * .then((space) => space.getEnvironment('<environment-id>'))
8576 * .then((environment) => environment.getLocales())
8577 * .then((response) => console.log(response.items))
8578 * .catch(console.error)
8579 * ```
8580 */
8581 getLocales() {
8582 return http.get('locales').then(response => wrapLocaleCollection(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8583 },
8584
8585 /**
8586 * Creates a Locale
8587 * @param data - Object representation of the Locale to be created
8588 * @return Promise for the newly created Locale
8589 * @example ```javascript
8590 * const contentful = require('contentful-management')
8591 *
8592 * const client = contentful.createClient({
8593 * accessToken: '<content_management_api_key>'
8594 * })
8595 *
8596 * // Create locale
8597 * client.getSpace('<space_id>')
8598 * .then((space) => space.getEnvironment('<environment-id>'))
8599 * .then((environment) => environment.createLocale({
8600 * name: 'German (Austria)',
8601 * code: 'de-AT',
8602 * fallbackCode: 'de-DE',
8603 * optional: true
8604 * }))
8605 * .then((locale) => console.log(locale))
8606 * .catch(console.error)
8607 * ```
8608 */
8609 createLocale(data) {
8610 return http.post('locales', data).then(response => wrapLocale(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8611 },
8612
8613 /**
8614 * Gets an UI Extension
8615 * @param id - Extension ID
8616 * @return Promise for an UI Extension
8617 * @example ```javascript
8618 * const contentful = require('contentful-management')
8619 *
8620 * const client = contentful.createClient({
8621 * accessToken: '<content_management_api_key>'
8622 * })
8623 *
8624 * client.getSpace('<space_id>')
8625 * .then((space) => space.getEnvironment('<environment-id>'))
8626 * .then((environment) => environment.getUiExtension('<extension-id>'))
8627 * .then((uiExtension) => console.log(uiExtension))
8628 * .catch(console.error)
8629 * ```
8630 */
8631 getUiExtension(id) {
8632 return http.get('extensions/' + id).then(response => wrapUiExtension(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8633 },
8634
8635 /**
8636 * Gets a collection of UI Extension
8637 * @return Promise for a collection of UI Extensions
8638 * @example ```javascript
8639 * const contentful = require('contentful-management')
8640 *
8641 * const client = contentful.createClient({
8642 * accessToken: '<content_management_api_key>'
8643 * })
8644 *
8645 * client.getSpace('<space_id>')
8646 * .then((space) => space.getEnvironment('<environment-id>'))
8647 * .then((environment) => environment.getUiExtensions()
8648 * .then((response) => console.log(response.items))
8649 * .catch(console.error)
8650 * ```
8651 */
8652 getUiExtensions() {
8653 return http.get('extensions').then(response => wrapUiExtensionCollection(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8654 },
8655
8656 /**
8657 * Creates a UI Extension
8658 * @param data - Object representation of the UI Extension to be created
8659 * @return Promise for the newly created UI Extension
8660 * @example ```javascript
8661 * const contentful = require('contentful-management')
8662 *
8663 * const client = contentful.createClient({
8664 * accessToken: '<content_management_api_key>'
8665 * })
8666 *
8667 * client.getSpace('<space_id>')
8668 * .then((space) => space.getEnvironment('<environment-id>'))
8669 * .then((environment) => environment.createUiExtension({
8670 * extension: {
8671 * name: 'My awesome extension',
8672 * src: 'https://example.com/my',
8673 * fieldTypes: [
8674 * {
8675 * type: 'Symbol'
8676 * },
8677 * {
8678 * type: 'Text'
8679 * }
8680 * ],
8681 * sidebar: false
8682 * }
8683 * }))
8684 * .then((uiExtension) => console.log(uiExtension))
8685 * .catch(console.error)
8686 * ```
8687 */
8688 createUiExtension(data) {
8689 return http.post('extensions', data).then(response => wrapUiExtension(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8690 },
8691
8692 /**
8693 * Creates a UI Extension with a custom ID
8694 * @param id - Extension ID
8695 * @param data - Object representation of the UI Extension to be created
8696 * @return Promise for the newly created UI Extension
8697 * @example ```javascript
8698 * const contentful = require('contentful-management')
8699 *
8700 * const client = contentful.createClient({
8701 * accessToken: '<content_management_api_key>'
8702 * })
8703 *
8704 * client.getSpace('<space_id>')
8705 * .then((space) => space.getEnvironment('<environment-id>'))
8706 * .then((environment) => environment.createUiExtensionWithId('<extension_id>', {
8707 * extension: {
8708 * name: 'My awesome extension',
8709 * src: 'https://example.com/my',
8710 * fieldTypes: [
8711 * {
8712 * type: 'Symbol'
8713 * },
8714 * {
8715 * type: 'Text'
8716 * }
8717 * ],
8718 * sidebar: false
8719 * }
8720 * }))
8721 * .then((uiExtension) => console.log(uiExtension))
8722 * .catch(console.error)
8723 * ```
8724 */
8725 createUiExtensionWithId(id, data) {
8726 return http.put('extensions/' + id, data).then(response => wrapUiExtension(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8727 },
8728
8729 /**
8730 * Gets an App Installation
8731 * @param appDefinitionId - AppDefinition ID
8732 * @param data - AppInstallation data
8733 * @return Promise for an App Installation
8734 * @example ```javascript
8735 * const contentful = require('contentful-management')
8736 *
8737 * const client = contentful.createClient({
8738 * accessToken: '<content_management_api_key>'
8739 * })
8740 *
8741 * client.getSpace('<space_id>')
8742 * .then((space) => space.getEnvironment('<environment-id>'))
8743 * .then((environment) => environment.createAppInstallation('<app_definition_id>', {
8744 * parameters: {
8745 * someParameter: someValue
8746 * }
8747 * })
8748 * .then((appInstallation) => console.log(appInstallation))
8749 * .catch(console.error)
8750 * ```
8751 */
8752 createAppInstallation(appDefinitionId, data) {
8753 return http.put('app_installations/' + appDefinitionId, data).then(response => wrapAppInstallation(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8754 },
8755
8756 /**
8757 * Gets an App Installation
8758 * @param id - AppDefintion ID
8759 * @return Promise for an App Installation
8760 * @example ```javascript
8761 * const contentful = require('contentful-management')
8762 *
8763 * const client = contentful.createClient({
8764 * accessToken: '<content_management_api_key>'
8765 * })
8766 *
8767 * client.getSpace('<space_id>')
8768 * .then((space) => space.getEnvironment('<environment-id>'))
8769 * .then((environment) => environment.getAppInstallation('<app-definition-id>'))
8770 * .then((appInstallation) => console.log(appInstallation))
8771 * .catch(console.error)
8772 * ```
8773 */
8774 getAppInstallation(id) {
8775 return http.get('app_installations/' + id).then(response => wrapAppInstallation(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8776 },
8777
8778 /**
8779 * Gets a collection of App Installation
8780 * @return Promise for a collection of App Installations
8781 * @example ```javascript
8782 * const contentful = require('contentful-management')
8783 *
8784 * const client = contentful.createClient({
8785 * accessToken: '<content_management_api_key>'
8786 * })
8787 *
8788 * client.getSpace('<space_id>')
8789 * .then((space) => space.getEnvironment('<environment-id>'))
8790 * .then((environment) => environment.getAppInstallations()
8791 * .then((response) => console.log(response.items))
8792 * .catch(console.error)
8793 * ```
8794 */
8795 getAppInstallations() {
8796 return http.get('app_installations').then(response => wrapAppInstallationCollection(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8797 },
8798
8799 /**
8800 * Gets all snapshots of an entry
8801 * @func getEntrySnapshots
8802 * @param entryId - Entry ID
8803 * @param query - query additional query paramaters
8804 * @return Promise for a collection of Entry Snapshots
8805 * @example ```javascript
8806 * const contentful = require('contentful-management')
8807 *
8808 * const client = contentful.createClient({
8809 * accessToken: '<content_management_api_key>'
8810 * })
8811 *
8812 * client.getSpace('<space_id>')
8813 * .then((space) => space.getEnvironment('<environment-id>'))
8814 * .then((environment) => environment.getEntrySnapshots('<entry_id>'))
8815 * .then((snapshots) => console.log(snapshots.items))
8816 * .catch(console.error)
8817 * ```
8818 */
8819 getEntrySnapshots(entryId, query = {}) {
8820 return http.get(`entries/${entryId}/snapshots`, Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
8821 query: query
8822 })).then(response => wrapSnapshotCollection(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8823 },
8824
8825 /**
8826 * Gets all snapshots of a contentType
8827 * @func getContentTypeSnapshots
8828 * @param contentTypeId - Content Type ID
8829 * @param query - query additional query paramaters
8830 * @return Promise for a collection of Content Type Snapshots
8831 * @example ```javascript
8832 * const contentful = require('contentful-management')
8833 *
8834 * const client = contentful.createClient({
8835 * accessToken: '<content_management_api_key>'
8836 * })
8837 *
8838 * client.getSpace('<space_id>')
8839 * .then((space) => space.getEnvironment('<environment-id>'))
8840 * .then((environment) => environment.getContentTypeSnapshots('<contentTypeId>'))
8841 * .then((snapshots) => console.log(snapshots.items))
8842 * .catch(console.error)
8843 * ```
8844 */
8845 getContentTypeSnapshots(contentTypeId, query = {}) {
8846 return http.get(`content_types/${contentTypeId}/snapshots`, Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
8847 query: query
8848 })).then(response => wrapSnapshotCollection(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8849 }
8850
8851 };
8852}
8853
8854/***/ }),
8855
8856/***/ "./create-organization-api.ts":
8857/*!************************************!*\
8858 !*** ./create-organization-api.ts ***!
8859 \************************************/
8860/*! exports provided: default */
8861/***/ (function(module, __webpack_exports__, __webpack_require__) {
8862
8863"use strict";
8864__webpack_require__.r(__webpack_exports__);
8865/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return createOrganizationApi; });
8866/* harmony import */ var lodash_get__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/get */ "../node_modules/lodash/get.js");
8867/* harmony import */ var lodash_get__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_get__WEBPACK_IMPORTED_MODULE_0__);
8868/* 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");
8869/* harmony import */ var _error_handler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./error-handler */ "./error-handler.ts");
8870/* harmony import */ var _entities__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./entities */ "./entities/index.ts");
8871
8872
8873
8874
8875
8876/**
8877 * Creates API object with methods to access the Organization API
8878 */
8879function createOrganizationApi({
8880 http
8881}) {
8882 const _entities$appDefiniti = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].appDefinition,
8883 wrapAppDefinition = _entities$appDefiniti.wrapAppDefinition,
8884 wrapAppDefinitionCollection = _entities$appDefiniti.wrapAppDefinitionCollection;
8885 const _entities$user = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].user,
8886 wrapUser = _entities$user.wrapUser,
8887 wrapUserCollection = _entities$user.wrapUserCollection;
8888 const _entities$organizatio = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].organizationMembership,
8889 wrapOrganizationMembership = _entities$organizatio.wrapOrganizationMembership,
8890 wrapOrganizationMembershipCollection = _entities$organizatio.wrapOrganizationMembershipCollection;
8891 const _entities$teamMembers = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].teamMembership,
8892 wrapTeamMembership = _entities$teamMembers.wrapTeamMembership,
8893 wrapTeamMembershipCollection = _entities$teamMembers.wrapTeamMembershipCollection;
8894 const _entities$teamSpaceMe = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].teamSpaceMembership,
8895 wrapTeamSpaceMembership = _entities$teamSpaceMe.wrapTeamSpaceMembership,
8896 wrapTeamSpaceMembershipCollection = _entities$teamSpaceMe.wrapTeamSpaceMembershipCollection;
8897 const _entities$team = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].team,
8898 wrapTeam = _entities$team.wrapTeam,
8899 wrapTeamCollection = _entities$team.wrapTeamCollection;
8900 const _entities$spaceMember = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].spaceMembership,
8901 wrapSpaceMembership = _entities$spaceMember.wrapSpaceMembership,
8902 wrapSpaceMembershipCollection = _entities$spaceMember.wrapSpaceMembershipCollection;
8903 const wrapOrganizationInvitation = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].organizationInvitation.wrapOrganizationInvitation;
8904 const headers = {
8905 'x-contentful-enable-alpha-feature': 'organization-user-management-api'
8906 };
8907 return {
8908 /**
8909 * Gets a User
8910 * @return Promise for a User
8911 * @example ```javascript
8912 * const contentful = require('contentful-management')
8913 * const client = contentful.createClient({
8914 * accessToken: '<content_management_api_key>'
8915 * })
8916 *
8917 * client.getOrganization('<organization_id>')
8918 * .then((organization) => organization.getUser('id'))
8919 * .then((user) => console.log(user))
8920 * .catch(console.error)
8921 * ```
8922 */
8923 getUser(id) {
8924 return http.get('users/' + id).then(response => wrapUser(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8925 },
8926
8927 /**
8928 * Gets a collection of Users in organization
8929 * @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.
8930 * @return Promise a collection of Users in organization
8931 * @example ```javascript
8932 * const contentful = require('contentful-management')
8933 * const client = contentful.createClient({
8934 * accessToken: '<content_management_api_key>'
8935 * })
8936 *
8937 * client.getOrganization('<organization_id>')
8938 * .then((organization) => organization.getUsers())
8939 * .then((user) => console.log(user))
8940 * .catch(console.error)
8941 * ```
8942 */
8943 getUsers(query = {}) {
8944 return http.get('users', Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
8945 query
8946 })).then(response => wrapUserCollection(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8947 },
8948
8949 /**
8950 * Gets an Organization Membership
8951 * @param id - Organization Membership ID
8952 * @return Promise for an Organization Membership
8953 * @example ```javascript
8954 * const contentful = require('contentful-management')
8955 * const client = contentful.createClient({
8956 * accessToken: '<content_management_api_key>'
8957 * })
8958 *
8959 * client.getOrganization('organization_id')
8960 * .then((organization) => organization.getOrganizationMembership('organizationMembership_id'))
8961 * .then((organizationMembership) => console.log(organizationMembership))
8962 * .catch(console.error)
8963 * ```
8964 */
8965 getOrganizationMembership(id) {
8966 return http.get('organization_memberships/' + id).then(response => wrapOrganizationMembership(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8967 },
8968
8969 /**
8970 * Gets a collection of Organization Memberships
8971 * @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.
8972 * @return Promise for a collection of Organization Memberships
8973 * @example ```javascript
8974 * const contentful = require('contentful-management')
8975 * const client = contentful.createClient({
8976 * accessToken: '<content_management_api_key>'
8977 * })
8978 *
8979 * client.getOrganization('organization_id')
8980 * .then((organization) => organization.getOrganizationMemberships({'limit': 100})) // you can add more queries as 'key': 'value'
8981 * .then((response) => console.log(response.items))
8982 * .catch(console.error)
8983 * ```
8984 */
8985 getOrganizationMemberships(query = {}) {
8986 return http.get('organization_memberships', Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
8987 query
8988 })).then(response => wrapOrganizationMembershipCollection(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
8989 },
8990
8991 /**
8992 * Creates a Team
8993 * @param Object representation of the Team to be created
8994 * @example ```javascript
8995 * const contentful = require('contentful-management')
8996 * const client = contentful.createClient({
8997 * accessToken: '<content_management_api_key>'
8998 * })
8999 *
9000 * client.getOrganization('<org_id>')
9001 * .then((org) => org.createTeam({
9002 * name: 'new team',
9003 * description: 'new team description'
9004 * }))
9005 * .then((team) => console.log(team))
9006 * .catch(console.error)
9007 * ```
9008 */
9009 createTeam(data) {
9010 return http.post('teams', data).then(response => wrapTeam(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9011 },
9012
9013 /**
9014 * Gets an Team
9015 * @example ```javascript
9016 * const contentful = require('contentful-management')
9017 * const client = contentful.createClient({
9018 * accessToken: '<content_management_api_key>'
9019 * })
9020 *
9021 * client.getOrganization('orgId')
9022 * .then((organization) => organization.getTeam('teamId'))
9023 * .then((team) => console.log(team))
9024 * .catch(console.error)
9025 * ```
9026 */
9027 getTeam(teamId) {
9028 return http.get('teams/' + teamId).then(response => wrapTeam(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9029 },
9030
9031 /**
9032 * Gets all Teams in an organization
9033 * @example ```javascript
9034 * const contentful = require('contentful-management')
9035 * const client = contentful.createClient({
9036 * accessToken: '<content_management_api_key>'
9037 * })
9038 *
9039 * client.getOrganization('orgId')
9040 * .then((organization) => organization.getTeams())
9041 * .then((teams) => console.log(teams))
9042 * .catch(console.error)
9043 * ```
9044 */
9045 getTeams(query = {}) {
9046 return http.get('teams', Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
9047 query
9048 })).then(response => wrapTeamCollection(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9049 },
9050
9051 /**
9052 * Creates a Team membership
9053 * @param data - Object representation of the Team Membership to be created
9054 * @return Promise for the newly created TeamMembership
9055 * @example ```javascript
9056 * const contentful = require('contentful-management')
9057 * const client = contentful.createClient({
9058 * accessToken: '<content_management_api_key>'
9059 * })
9060 *
9061 * client.getOrganization('organizationId')
9062 * .then((org) => org.createTeamMembership('teamId', {
9063 * admin: true,
9064 * organizationMembershipId: 'organizationMembershipId'
9065 * }))
9066 * .then((teamMembership) => console.log(teamMembership))
9067 * .catch(console.error)
9068 * ```
9069 */
9070 createTeamMembership(teamId, data) {
9071 return http.post('teams/' + teamId + '/team_memberships', data).then(response => wrapTeamMembership(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9072 },
9073
9074 /**
9075 * Gets an Team Membership from the team with given teamId
9076 * @return Promise for an Team Membership
9077 * @example ```javascript
9078 * const contentful = require('contentful-management')
9079 * const client = contentful.createClient({
9080 * accessToken: '<content_management_api_key>'
9081 * })
9082 *
9083 * client.getOrganization('organizationId')
9084 * .then((organization) => organization.getTeamMembership('teamId', 'teamMembership_id'))
9085 * .then((teamMembership) => console.log(teamMembership))
9086 * .catch(console.error)
9087 * ```
9088 */
9089 getTeamMembership(teamId, teamMembershipId) {
9090 return http.get('teams/' + teamId + '/team_memberships/' + teamMembershipId).then(response => wrapTeamMembership(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9091 },
9092
9093 /**
9094 * 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.
9095 * @return Promise for a Team Membership Collection
9096 * @example ```javascript
9097 * const contentful = require('contentful-management')
9098 * const client = contentful.createClient({
9099 * accessToken: '<content_management_api_key>'
9100 * })
9101 *
9102 * client.getOrganization('organizationId')
9103 * .then((organization) => organization.getTeamMemberships('teamId'))
9104 * .then((teamMemberships) => console.log(teamMemberships))
9105 * .catch(console.error)
9106 * ```
9107 */
9108 getTeamMemberships(opts = {}) {
9109 const query = lodash_get__WEBPACK_IMPORTED_MODULE_0___default()(opts, 'query', {});
9110
9111 if (opts.teamId) {
9112 return http.get('teams/' + opts.teamId + '/team_memberships', Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
9113 query
9114 })).then(response => wrapTeamMembershipCollection(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9115 }
9116
9117 return http.get('team_memberships', Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
9118 query
9119 })).then(response => wrapTeamMembershipCollection(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9120 },
9121
9122 /**
9123 * 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.
9124 * @return Promise for a Team Space Membership Collection
9125 * @example ```javascript
9126 * const contentful = require('contentful-management')
9127 * const client = contentful.createClient({
9128 * accessToken: '<content_management_api_key>'
9129 * })
9130 *
9131 * client.getOrganization('organizationId')
9132 * .then((organization) => organization.getTeamSpaceMemberships('teamId'))
9133 * .then((teamSpaceMemberships) => console.log(teamSpaceMemberships))
9134 * .catch(console.error)
9135 * ```
9136 */
9137 getTeamSpaceMemberships(opts = {}) {
9138 const query = lodash_get__WEBPACK_IMPORTED_MODULE_0___default()(opts, 'query', {});
9139
9140 if (opts.teamId) {
9141 // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
9142 // @ts-ignore
9143 query['sys.team.sys.id'] = opts.teamId;
9144 }
9145
9146 return http.get('team_space_memberships', Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
9147 query
9148 })).then(response => wrapTeamSpaceMembershipCollection(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9149 },
9150
9151 /**
9152 * Get a Team Space Membership with given teamSpaceMembershipId
9153 * @return Promise for a Team Space Membership
9154 * @example ```javascript
9155 * const contentful = require('contentful-management')
9156 * const client = contentful.createClient({
9157 * accessToken: '<content_management_api_key>'
9158 * })
9159 *
9160 * client.getOrganization('organizationId')
9161 * .then((organization) => organization.getTeamSpaceMembership('teamSpaceMembershipId'))
9162 * .then((teamSpaceMembership) => console.log(teamSpaceMembership))
9163 * .catch(console.error)]
9164 * ```
9165 */
9166 getTeamSpaceMembership(teamSpaceMembershipId) {
9167 return http.get('team_space_memberships/' + teamSpaceMembershipId).then(response => wrapTeamSpaceMembership(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9168 },
9169
9170 /**
9171 * Gets an Space Membership in Organization
9172 * @param id - Organiztion Space Membership ID
9173 * @return Promise for a Space Membership in an organization
9174 * @example ```javascript
9175 * const contentful = require('contentful-management')
9176 * const client = contentful.createClient({
9177 * accessToken: '<content_management_api_key>'
9178 * })
9179 *
9180 * client.getOrganization('organization_id')
9181 * .then((organization) => organization.getOrganizationSpaceMembership('organizationSpaceMembership_id'))
9182 * .then((organizationMembership) => console.log(organizationMembership))
9183 * .catch(console.error)
9184 * ```
9185 */
9186 getOrganizationSpaceMembership(id) {
9187 return http.get('space_memberships/' + id).then(response => wrapSpaceMembership(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9188 },
9189
9190 /**
9191 * Gets a collection Space Memberships in organization
9192 * @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.
9193 * @return Promise for a Space Membership collection across all spaces in the organization
9194 * @example ```javascript
9195 * const contentful = require('contentful-management')
9196 * const client = contentful.createClient({
9197 * accessToken: '<content_management_api_key>'
9198 * })
9199 *
9200 * client.getOrganization('organization_id')
9201 * .then((organization) => organization.getOrganizationSpaceMemberships()) // you can add queries like 'limit': 100
9202 * .then((response) => console.log(response.items))
9203 * .catch(console.error)
9204 * ```
9205 */
9206 getOrganizationSpaceMemberships(query = {}) {
9207 return http.get('space_memberships', Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
9208 query
9209 })).then(response => wrapSpaceMembershipCollection(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9210 },
9211
9212 /**
9213 * Gets an Invitation in Organization
9214 * @return Promise for a OrganizationInvitation in an organization
9215 * @example ```javascript
9216 * const contentful = require('contentful-management')
9217 * const client = contentful.createClient({
9218 * accessToken: '<content_management_api_key>'
9219 * })
9220 *
9221 * client.getOrganization('<org_id>')
9222 * .then((organization) => organization.getOrganizationInvitation('invitation_id'))
9223 * .then((invitation) => console.log(invitation))
9224 * .catch(console.error)
9225 * ```
9226 */
9227 getOrganizationInvitation(invitationId) {
9228 return http.get('invitations/' + invitationId, {
9229 headers
9230 }).then(response => wrapOrganizationInvitation(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9231 },
9232
9233 /**
9234 * Create an Invitation in Organization
9235 * @return Promise for a OrganizationInvitation in an organization
9236 * @example ```javascript
9237 * const contentful = require('contentful-management')
9238 * const client = contentful.createClient({
9239 * accessToken: '<content_management_api_key>'
9240 * })
9241 *
9242 * client.getOrganization('<org_id>')
9243 * .then((organization) => organization.createOrganizationInvitation({
9244 * email: 'user.email@example.com'
9245 * firstName: 'User First Name'
9246 * lastName: 'User Last Name'
9247 * role: 'developer'
9248 * })
9249 * .catch(console.error)
9250 * ```
9251 */
9252 createOrganizationInvitation(data) {
9253 const invitationAlphaHeaders = {
9254 'x-contentful-enable-alpha-feature': 'pending-org-membership'
9255 };
9256 return http.post('invitations', data, {
9257 headers: invitationAlphaHeaders
9258 }).then(response => wrapOrganizationInvitation(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9259 },
9260
9261 /**
9262 * Creates an app definition
9263 * @param Object representation of the App Definition to be created
9264 * @return Promise for the newly created AppDefinition
9265 * @example ```javascript
9266 * const contentful = require('contentful-management')
9267 * const client = contentful.createClient({
9268 * accessToken: '<content_management_api_key>'
9269 * })
9270 *
9271 * client.getOrganization('<org_id>')
9272 * .then((org) => org.createAppDefinition({
9273 * name: 'Example app',
9274 * locations: [{ location: 'app-config' }],
9275 * src: "http://my-app-host.com/my-app"
9276 * }))
9277 * .then((appDefinition) => console.log(appDefinition))
9278 * .catch(console.error)
9279 * ```
9280 */
9281 createAppDefinition(data) {
9282 return http.post('app_definitions', data).then(response => wrapAppDefinition(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9283 },
9284
9285 /**
9286 * Gets all app definitions
9287 * @return Promise for a collection of App Definitions
9288 * @example ```javascript
9289 * const contentful = require('contentful-management')
9290 * const client = contentful.createClient({
9291 * accessToken: '<content_management_api_key>'
9292 * })
9293 *
9294 * client.getOrganization('<org_id>')
9295 * .then((org) => org.getAppDefinitions())
9296 * .then((response) => console.log(response.items))
9297 * .catch(console.error)
9298 * ```
9299 */
9300 getAppDefinitions(query = {}) {
9301 return http.get('app_definitions', Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
9302 query
9303 })).then(response => wrapAppDefinitionCollection(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9304 },
9305
9306 /**
9307 * Gets an app definition
9308 * @return Promise for an App Definition
9309 * @example ```javascript
9310 * const contentful = require('contentful-management')
9311 * const client = contentful.createClient({
9312 * accessToken: '<content_management_api_key>'
9313 * })
9314 *
9315 * client.getOrganization('<org_id>')
9316 * .then((org) => org.getAppDefinition('<app_definition_id>'))
9317 * .then((appDefinition) => console.log(appDefinition))
9318 * .catch(console.error)
9319 * ```
9320 */
9321 getAppDefinition(id) {
9322 return http.get('app_definitions/' + id).then(response => wrapAppDefinition(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9323 }
9324
9325 };
9326}
9327
9328/***/ }),
9329
9330/***/ "./create-space-api.ts":
9331/*!*****************************!*\
9332 !*** ./create-space-api.ts ***!
9333 \*****************************/
9334/*! exports provided: default */
9335/***/ (function(module, __webpack_exports__, __webpack_require__) {
9336
9337"use strict";
9338__webpack_require__.r(__webpack_exports__);
9339/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return createSpaceApi; });
9340/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
9341/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
9342/* 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");
9343/* harmony import */ var _error_handler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./error-handler */ "./error-handler.ts");
9344/* harmony import */ var _entities__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./entities */ "./entities/index.ts");
9345function 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; }
9346
9347function _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; }
9348
9349function _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; }
9350
9351/**
9352 * Contentful Space API. Contains methods to access any operations at a space
9353 * level, such as creating and reading entities contained in a space.
9354 */
9355
9356
9357
9358
9359
9360function raiseDeprecationWarning(method) {
9361 console.warn([`Deprecated: Space.${method}() will be removed in future major versions.`, null, `Please migrate your code to use Environment.${method}():`, `https://contentful.github.io/contentful-management.js/contentful-management/latest/ContentfulEnvironmentAPI.html#.${method}`, null].join('\n'));
9362}
9363
9364function spaceMembershipDeprecationWarning() {
9365 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)');
9366}
9367
9368/**
9369 * Creates API object with methods to access the Space API
9370 * @param {object} params - API initialization params
9371 * @prop {object} http - HTTP client instance
9372 * @prop {object} entities - Object with wrapper methods for each kind of entity
9373 * @return {ContentfulSpaceAPI}
9374 */
9375function createSpaceApi({
9376 http,
9377 httpUpload
9378}) {
9379 const wrapSpace = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].space.wrapSpace;
9380 const _entities$environment = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].environment,
9381 wrapEnvironment = _entities$environment.wrapEnvironment,
9382 wrapEnvironmentCollection = _entities$environment.wrapEnvironmentCollection;
9383 const _entities$contentType = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].contentType,
9384 wrapContentType = _entities$contentType.wrapContentType,
9385 wrapContentTypeCollection = _entities$contentType.wrapContentTypeCollection;
9386 const _entities$entry = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].entry,
9387 wrapEntry = _entities$entry.wrapEntry,
9388 wrapEntryCollection = _entities$entry.wrapEntryCollection;
9389 const _entities$asset = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].asset,
9390 wrapAsset = _entities$asset.wrapAsset,
9391 wrapAssetCollection = _entities$asset.wrapAssetCollection;
9392 const _entities$locale = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].locale,
9393 wrapLocale = _entities$locale.wrapLocale,
9394 wrapLocaleCollection = _entities$locale.wrapLocaleCollection;
9395 const _entities$webhook = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].webhook,
9396 wrapWebhook = _entities$webhook.wrapWebhook,
9397 wrapWebhookCollection = _entities$webhook.wrapWebhookCollection;
9398 const _entities$role = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].role,
9399 wrapRole = _entities$role.wrapRole,
9400 wrapRoleCollection = _entities$role.wrapRoleCollection;
9401 const _entities$user = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].user,
9402 wrapUser = _entities$user.wrapUser,
9403 wrapUserCollection = _entities$user.wrapUserCollection;
9404 const _entities$spaceMember = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].spaceMember,
9405 wrapSpaceMember = _entities$spaceMember.wrapSpaceMember,
9406 wrapSpaceMemberCollection = _entities$spaceMember.wrapSpaceMemberCollection;
9407 const _entities$spaceMember2 = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].spaceMembership,
9408 wrapSpaceMembership = _entities$spaceMember2.wrapSpaceMembership,
9409 wrapSpaceMembershipCollection = _entities$spaceMember2.wrapSpaceMembershipCollection;
9410 const _entities$teamSpaceMe = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].teamSpaceMembership,
9411 wrapTeamSpaceMembership = _entities$teamSpaceMe.wrapTeamSpaceMembership,
9412 wrapTeamSpaceMembershipCollection = _entities$teamSpaceMe.wrapTeamSpaceMembershipCollection;
9413 const _entities$apiKey = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].apiKey,
9414 wrapApiKey = _entities$apiKey.wrapApiKey,
9415 wrapApiKeyCollection = _entities$apiKey.wrapApiKeyCollection;
9416 const _entities$previewApiK = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].previewApiKey,
9417 wrapPreviewApiKey = _entities$previewApiK.wrapPreviewApiKey,
9418 wrapPreviewApiKeyCollection = _entities$previewApiK.wrapPreviewApiKeyCollection;
9419 const wrapSnapshotCollection = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].snapshot.wrapSnapshotCollection;
9420 const wrapEditorInterface = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].editorInterface.wrapEditorInterface;
9421 const wrapUpload = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].upload.wrapUpload;
9422 const _entities$uiExtension = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].uiExtension,
9423 wrapUiExtension = _entities$uiExtension.wrapUiExtension,
9424 wrapUiExtensionCollection = _entities$uiExtension.wrapUiExtensionCollection;
9425 const _entities$environment2 = _entities__WEBPACK_IMPORTED_MODULE_3__["default"].environmentAlias,
9426 wrapEnvironmentAlias = _entities$environment2.wrapEnvironmentAlias,
9427 wrapEnvironmentAliasCollection = _entities$environment2.wrapEnvironmentAliasCollection;
9428
9429 function createAsset(data) {
9430 return http.post('assets', data).then(response => wrapAsset(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9431 }
9432
9433 function createUpload(data) {
9434 raiseDeprecationWarning('createUpload');
9435 const file = data.file;
9436
9437 if (!file) {
9438 return Promise.reject(new Error('Unable to locate a file to upload.'));
9439 }
9440
9441 return httpUpload.post('uploads', file, {
9442 headers: {
9443 'Content-Type': 'application/octet-stream'
9444 }
9445 }).then(uploadResponse => {
9446 return wrapUpload(httpUpload, uploadResponse.data);
9447 }).catch(_error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9448 }
9449 /*
9450 * @private
9451 * sdk relies heavily on sys metadata
9452 * so we cannot omit the sys property on sdk level
9453 *
9454 */
9455
9456
9457 function normalizeSelect(query) {
9458 if (query.select && !/sys/i.test(query.select)) {
9459 query.select += ',sys';
9460 }
9461 }
9462
9463 return {
9464 /**
9465 * Deletes the space
9466 * @return Promise for the deletion. It contains no data, but the Promise error case should be handled.
9467 * @example ```javascript
9468 * const contentful = require('contentful-management')
9469 *
9470 * const client = contentful.createClient({
9471 * accessToken: '<content_management_api_key>'
9472 * })
9473 *
9474 * client.getSpace('<space_id>')
9475 * .then((space) => space.delete())
9476 * .then(() => console.log('Space deleted.'))
9477 * .catch(console.error)
9478 * ```
9479 */
9480 delete: function deleteSpace() {
9481 return http.delete('').then(() => {// do nothing
9482 }, _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9483 },
9484
9485 /**
9486 * Updates the space
9487 * @return Promise for the updated space.
9488 * @example ```javascript
9489 * const contentful = require('contentful-management')
9490 *
9491 * const client = contentful.createClient({
9492 * accessToken: '<content_management_api_key>'
9493 * })
9494 *
9495 * client.getSpace('<space_id>')
9496 * .then((space) => {
9497 * space.name = 'New name'
9498 * return space.update()
9499 * })
9500 * .then((space) => console.log(`Space ${space.sys.id} renamed.`)
9501 * .catch(console.error)
9502 * ```
9503 */
9504 update: function updateSpace() {
9505 const raw = this.toPlainObject();
9506 const data = lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(raw);
9507 delete data.sys;
9508 return http.put('', data, {
9509 headers: {
9510 'X-Contentful-Version': raw.sys.version
9511 }
9512 }).then(response => wrapSpace(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9513 },
9514
9515 /**
9516 * Gets an environment
9517 * @param id - Environment ID
9518 * @return Promise for an Environment
9519 * @example ```javascript
9520 * const contentful = require('contentful-management')
9521 *
9522 * const client = contentful.createClient({
9523 * accessToken: '<content_management_api_key>'
9524 * })
9525 *
9526 * client.getSpace('<space_id>')
9527 * .then((space) => space.getEnvironment('<environement_id>'))
9528 * .then((environment) => console.log(environment))
9529 * .catch(console.error)
9530 * ```
9531 */
9532 getEnvironment(id) {
9533 return http.get('environments/' + id).then(response => wrapEnvironment(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9534 },
9535
9536 /**
9537 * Gets a collection of Environments
9538 * @return Promise for a collection of Environment
9539 * @example ```javascript
9540 * const contentful = require('contentful-management')
9541 *
9542 * const client = contentful.createClient({
9543 * accessToken: '<content_management_api_key>'
9544 * })
9545 *
9546 * client.getSpace('<space_id>')
9547 * .then((space) => space.getEnvironments())
9548 * .then((response) => console.log(response.items))
9549 * .catch(console.error)
9550 * ```
9551 */
9552 getEnvironments() {
9553 return http.get('environments').then(response => wrapEnvironmentCollection(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9554 },
9555
9556 /**
9557 * Creates an Environement
9558 * @param data - Object representation of the Environment to be created
9559 * @return Promise for the newly created Environment
9560 * @example ```javascript
9561 * const contentful = require('contentful-management')
9562 *
9563 * const client = contentful.createClient({
9564 * accessToken: '<content_management_api_key>'
9565 * })
9566 *
9567 * client.getSpace('<space_id>')
9568 * .then((space) => space.createEnvironment({ name: 'Staging' }))
9569 * .then((environment) => console.log(environment))
9570 * .catch(console.error)
9571 * ```
9572 */
9573 createEnvironment(data = {}) {
9574 return http.post('environments', data).then(response => wrapEnvironment(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9575 },
9576
9577 /**
9578 * Creates an Environment with a custom ID
9579 * @param id - Environment ID
9580 * @param data - Object representation of the Environment to be created
9581 * @param sourceEnvironmentId - ID of the source environment that will be copied to create the new environment. Default is "master"
9582 * @return Promise for the newly created Environment
9583 * @example ```javascript
9584 * const contentful = require('contentful-management')
9585 *
9586 * const client = contentful.createClient({
9587 * accessToken: '<content_management_api_key>'
9588 * })
9589 *
9590 * client.getSpace('<space_id>')
9591 * .then((space) => space.createEnvironmentWithId('<environment-id>', { name: 'Staging'}, 'master'))
9592 * .then((environment) => console.log(environment))
9593 * .catch(console.error)
9594 * ```
9595 */
9596 createEnvironmentWithId(id, data, sourceEnvironmentId) {
9597 return http.put('environments/' + id, data, {
9598 headers: sourceEnvironmentId ? {
9599 'X-Contentful-Source-Environment': sourceEnvironmentId
9600 } : {}
9601 }).then(response => wrapEnvironment(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9602 },
9603
9604 /**
9605 * Gets a Content Type
9606 * @deprecated since version 5.0
9607 * @param id - Content Type ID
9608 * @return Promise for a Content Type
9609 * @example ```javascript
9610 * const contentful = require('contentful-management')
9611 *
9612 * const client = contentful.createClient({
9613 * accessToken: '<content_management_api_key>'
9614 * })
9615 *
9616 * client.getSpace('<space_id>')
9617 * .then((space) => space.getContentType('<content_type_id>'))
9618 * .then((contentType) => console.log(contentType))
9619 * .catch(console.error)
9620 * ```
9621 */
9622 getContentType(id) {
9623 raiseDeprecationWarning('getContentType');
9624 return http.get('content_types/' + id).then(response => wrapContentType(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9625 },
9626
9627 /**
9628 * Gets a collection of Content Types
9629 * @deprecated since version 5.0
9630 * @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.
9631 * @return Promise for a collection of Content Types
9632 * @example ```javascript
9633 * const contentful = require('contentful-management')
9634 *
9635 * const client = contentful.createClient({
9636 * accessToken: '<content_management_api_key>'
9637 * })
9638 *
9639 * client.getSpace('<space_id>')
9640 * .then((space) => space.getContentTypes())
9641 * .then((response) => console.log(response.items))
9642 * .catch(console.error)
9643 * ```
9644 */
9645 getContentTypes(query = {}) {
9646 raiseDeprecationWarning('getContentTypes');
9647 return http.get('content_types', Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
9648 query: query
9649 })).then(response => wrapContentTypeCollection(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9650 },
9651
9652 /**
9653 * Creates a Content Type
9654 * @deprecated since version 5.0
9655 * @param data - Object representation of the Content Type to be created
9656 * @return Promise for the newly created Content Type
9657 * @example ```javascript
9658 * const contentful = require('contentful-management')
9659 *
9660 * const client = contentful.createClient({
9661 * accessToken: '<content_management_api_key>'
9662 * })
9663 *
9664 * client.getSpace('<space_id>')
9665 * .then((space) => space.createContentType({
9666 * name: 'Blog Post',
9667 * fields: [
9668 * {
9669 * id: 'title',
9670 * name: 'Title',
9671 * required: true,
9672 * localized: false,
9673 * type: 'Text'
9674 * }
9675 * ]
9676 * }))
9677 * .then((contentType) => console.log(contentType))
9678 * .catch(console.error)
9679 * ```
9680 */
9681 createContentType(data) {
9682 raiseDeprecationWarning('createContentType');
9683 return http.post('content_types', data).then(response => wrapContentType(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9684 },
9685
9686 /**
9687 * Creates a Content Type with a custom ID
9688 * @deprecated since version 5.0
9689 * @param id - Content Type ID
9690 * @param data - Object representation of the Content Type to be created
9691 * @return Promise for the newly created Content Type
9692 * @example ```javascript
9693 * const contentful = require('contentful-management')
9694 *
9695 * const client = contentful.createClient({
9696 * accessToken: '<content_management_api_key>'
9697 * })
9698 *
9699 * client.getSpace('<space_id>')
9700 * .then((space) => space.createContentTypeWithId('<content-type-id>', {
9701 * name: 'Blog Post',
9702 * fields: [
9703 * {
9704 * id: 'title',
9705 * name: 'Title',
9706 * required: true,
9707 * localized: false,
9708 * type: 'Text'
9709 * }
9710 * ]
9711 * }))
9712 * .then((contentType) => console.log(contentType))
9713 * .catch(console.error)
9714 * ```
9715 */
9716 createContentTypeWithId(id, data) {
9717 raiseDeprecationWarning('createContentTypeWithId');
9718 return http.put('content_types/' + id, data).then(response => wrapContentType(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9719 },
9720
9721 /**
9722 * Gets an EditorInterface for a ContentType
9723 * @deprecated since version 5.0
9724 * @param contentTypeId - Content Type ID
9725 * @return Promise for an EditorInterface
9726 * @example ```javascript
9727 * const contentful = require('contentful-management')
9728 *
9729 * const client = contentful.createClient({
9730 * accessToken: '<content_management_api_key>'
9731 * })
9732 *
9733 * client.getSpace('<space_id>')
9734 * .then((space) => space.getEditorInterfaceForContentType('<content_type_id>'))
9735 * .then((EditorInterface) => console.log(EditorInterface))
9736 * .catch(console.error)
9737 * ```
9738 */
9739 getEditorInterfaceForContentType(contentTypeId) {
9740 raiseDeprecationWarning('getEditorInterfaceForContentType');
9741 return http.get('content_types/' + contentTypeId + '/editor_interface').then(response => wrapEditorInterface(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9742 },
9743
9744 /**
9745 * Gets an Entry
9746 * Warning: if you are using the select operator, when saving, any field that was not selected will be removed
9747 * from your entry in the backend
9748 * @deprecated since version 5.0
9749 * @param id - Entry ID
9750 * @param query - Object with search parameters. In this method it's only useful for `locale`.
9751 * @return Promise for an Entry
9752 * @example ```javascript
9753 * const contentful = require('contentful-management')
9754 *
9755 * const client = contentful.createClient({
9756 * accessToken: '<content_management_api_key>'
9757 * })
9758 *
9759 * client.getSpace('<space_id>')
9760 * .then((space) => space.getEntry('<entry-id>'))
9761 * .then((entry) => console.log(entry))
9762 * .catch(console.error)
9763 * ```
9764 */
9765 getEntry(id, query = {}) {
9766 raiseDeprecationWarning('getEntry');
9767 normalizeSelect(query);
9768 return http.get('entries/' + id, Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
9769 query: query
9770 })).then(response => wrapEntry(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9771 },
9772
9773 /**
9774 * Gets a collection of Entries
9775 * Warning: if you are using the select operator, when saving, any field that was not selected will be removed
9776 * from your entry in the backend
9777 * @deprecated since version 5.0
9778 * @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.
9779 * @return Promise for a collection of Entries
9780 * @example ```javascript
9781 * const contentful = require('contentful-management')
9782 *
9783 * const client = contentful.createClient({
9784 * accessToken: '<content_management_api_key>'
9785 * })
9786 *
9787 * client.getSpace('<space_id>')
9788 * .then((space) => space.getEntries({'content_type': 'foo'})) // you can add more queries as 'key': 'value'
9789 * .then((response) => console.log(response.items))
9790 * .catch(console.error)
9791 * ```
9792 */
9793 getEntries(query = {}) {
9794 raiseDeprecationWarning('getEntries');
9795 normalizeSelect(query);
9796 return http.get('entries', Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
9797 query: query
9798 })).then(response => wrapEntryCollection(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9799 },
9800
9801 /**
9802 * Creates a Entry
9803 * @deprecated since version 5.0
9804 * @param contentTypeId - The Content Type which this Entry is based on
9805 * @param data - Object representation of the Entry to be created
9806 * @return Promise for the newly created Entry
9807 * @example ```javascript
9808 * const contentful = require('contentful-management')
9809 *
9810 * const client = contentful.createClient({
9811 * accessToken: '<content_management_api_key>'
9812 * })
9813 *
9814 * client.getSpace('<space_id>')
9815 * .then((space) => space.createEntry('<content_type_id>', {
9816 * fields: {
9817 * title: {
9818 * 'en-US': 'Entry title'
9819 * }
9820 * }
9821 * }))
9822 * .then((entry) => console.log(entry))
9823 * .catch(console.error)
9824 * ```
9825 */
9826 createEntry(contentTypeId, data) {
9827 raiseDeprecationWarning('createEntry');
9828 return http.post('entries', data, {
9829 headers: {
9830 'X-Contentful-Content-Type': contentTypeId
9831 }
9832 }).then(response => wrapEntry(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9833 },
9834
9835 /**
9836 * Creates a Entry with a custom ID
9837 * @deprecated since version 5.0
9838 * @param contentTypeId - The Content Type which this Entry is based on
9839 * @param id - Entry ID
9840 * @param data - Object representation of the Entry to be created
9841 * @return Promise for the newly created Entry
9842 * @example ```javascript
9843 * const contentful = require('contentful-management')
9844 *
9845 * const client = contentful.createClient({
9846 * accessToken: '<content_management_api_key>'
9847 * })
9848 *
9849 * // Create entry
9850 * client.getSpace('<space_id>')
9851 * .then((space) => space.createEntryWithId('<content_type_id>', '<entry_id>', {
9852 * fields: {
9853 * title: {
9854 * 'en-US': 'Entry title'
9855 * }
9856 * }
9857 * }))
9858 * .then((entry) => console.log(entry))
9859 * .catch(console.error)
9860 * ```
9861 */
9862 createEntryWithId(contentTypeId, id, data) {
9863 raiseDeprecationWarning('createEntryWithId');
9864 return http.put('entries/' + id, data, {
9865 headers: {
9866 'X-Contentful-Content-Type': contentTypeId
9867 }
9868 }).then(response => wrapEntry(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9869 },
9870
9871 /**
9872 * Creates a Upload.
9873 * @deprecated since version 5.0
9874 * @param data - Object with file information.
9875 * @param data.file - Actual file content. Can be a string, an ArrayBuffer or a Stream.
9876 * @return Upload object containing information about the uploaded file.
9877 * @example ```javascript
9878 * const client = contentful.createClient({
9879 * accessToken: '<content_management_api_key>'
9880 * })
9881 * const uploadStream = createReadStream('path/to/filename_english.jpg')
9882 * client.getSpace('<space_id>')
9883 * .then((space) => space.createUpload({file: uploadStream, 'image/png'})
9884 * .then((upload) => console.log(upload))
9885 * .catch(console.error)
9886 * ```
9887 */
9888 createUpload,
9889
9890 /**
9891 * Creates a Asset. After creation, call asset.processForLocale or asset.processForAllLocales to start asset processing.
9892 * @deprecated since version 5.0
9893 * @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.
9894 * @return Promise for the newly created Asset
9895 * @example ```javascript
9896 * const client = contentful.createClient({
9897 * accessToken: '<content_management_api_key>'
9898 * })
9899 *
9900 * // Create asset
9901 * client.getSpace('<space_id>')
9902 * .then((space) => space.createAsset({
9903 * fields: {
9904 * title: {
9905 * 'en-US': 'Playsam Streamliner'
9906 * },
9907 * file: {
9908 * 'en-US': {
9909 * contentType: 'image/jpeg',
9910 * fileName: 'example.jpeg',
9911 * upload: 'https://example.com/example.jpg'
9912 * }
9913 * }
9914 * }
9915 * }))
9916 * .then((asset) => asset.processForLocale("en-US")) // OR asset.processForAllLocales()
9917 * .then((asset) => console.log(asset))
9918 * .catch(console.error)
9919 * ```
9920 */
9921 createAsset,
9922
9923 /**
9924 * Gets an Asset
9925 * Warning: if you are using the select operator, when saving, any field that was not selected will be removed
9926 * from your entry in the backend
9927 * @deprecated since version 5.0
9928 * @param id - Asset ID
9929 * @param query - Object with search parameters. In this method it's only useful for `locale`.
9930 * @return Promise for an Asset
9931 * @example ```javascript
9932 * const contentful = require('contentful-management')
9933 *
9934 * const client = contentful.createClient({
9935 * accessToken: '<content_management_api_key>'
9936 * })
9937 *
9938 * client.getSpace('<space_id>')
9939 * .then((space) => space.getAsset('<asset_id>'))
9940 * .then((asset) => console.log(asset))
9941 * .catch(console.error)
9942 * ```
9943 */
9944 getAsset(id, query = {}) {
9945 raiseDeprecationWarning('getAsset');
9946 normalizeSelect(query);
9947 return http.get('assets/' + id, Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
9948 query: query
9949 })).then(response => wrapAsset(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9950 },
9951
9952 /**
9953 * Gets a collection of Assets
9954 * Warning: if you are using the select operator, when saving, any field that was not selected will be removed
9955 * from your entry in the backend
9956 * @deprecated since version 5.0
9957 * @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.
9958 * @return Promise for a collection of Assets
9959 * @example ```javascript
9960 * const contentful = require('contentful-management')
9961 *
9962 * const client = contentful.createClient({
9963 * accessToken: '<content_management_api_key>'
9964 * })
9965 *
9966 * client.getSpace('<space_id>')
9967 * .then((space) => space.getAssets())
9968 * .then((response) => console.log(response.items))
9969 * .catch(console.error)
9970 * ```
9971 */
9972 getAssets(query = {}) {
9973 raiseDeprecationWarning('getAssets');
9974 normalizeSelect(query);
9975 return http.get('assets', Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
9976 query: query
9977 })).then(response => wrapAssetCollection(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
9978 },
9979
9980 /**
9981 * Creates a Asset with a custom ID. After creation, call asset.processForLocale or asset.processForAllLocales to start asset processing.
9982 * @deprecated since version 5.0
9983 * @param id - Asset ID
9984 * @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.
9985 * @return Promise for the newly created Asset
9986 * @example ```javascript
9987 * const client = contentful.createClient({
9988 * accessToken: '<content_management_api_key>'
9989 * })
9990 *
9991 * // Create asset
9992 * client.getSpace('<space_id>')
9993 * .then((space) => space.createAssetWithId('<asset_id>', {
9994 * title: {
9995 * 'en-US': 'Playsam Streamliner'
9996 * },
9997 * file: {
9998 * 'en-US': {
9999 * contentType: 'image/jpeg',
10000 * fileName: 'example.jpeg',
10001 * upload: 'https://example.com/example.jpg'
10002 * }
10003 * }
10004 * }))
10005 * .then((asset) => asset.process())
10006 * .then((asset) => console.log(asset))
10007 * .catch(console.error)
10008 * ```
10009 */
10010 createAssetWithId(id, data) {
10011 raiseDeprecationWarning('createAssetWithId');
10012 return http.put('assets/' + id, data).then(response => wrapAsset(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
10013 },
10014
10015 /**
10016 * Creates a Asset based on files. After creation, call asset.processForLocale or asset.processForAllLocales to start asset processing.
10017 * @deprecated since version 5.0
10018 * @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.
10019 * @param data.fields.file.[LOCALE].file - Can be a string, an ArrayBuffer or a Stream.
10020 * @return Promise for the newly created Asset
10021 * @example ```javascript
10022 * const client = contentful.createClient({
10023 * accessToken: '<content_management_api_key>'
10024 * })
10025 * client.getSpace('<space_id>')
10026 * .then((space) => space.createAssetFromFiles({
10027 * fields: {
10028 * file: {
10029 * 'en-US': {
10030 * contentType: 'image/jpeg',
10031 * fileName: 'filename_english.jpg',
10032 * file: createReadStream('path/to/filename_english.jpg')
10033 * },
10034 * 'de-DE': {
10035 * contentType: 'image/svg+xml',
10036 * fileName: 'filename_german.svg',
10037 * file: '<svg><path fill="red" d="M50 50h150v50H50z"/></svg>'
10038 * }
10039 * }
10040 * }
10041 * }))
10042 * .then((asset) => console.log(asset))
10043 * .catch(console.error)
10044 * ```
10045 */
10046 createAssetFromFiles(data) {
10047 raiseDeprecationWarning('createAssetFromFiles');
10048 const file = data.fields.file;
10049 return Promise.all(Object.keys(file).map(locale => {
10050 const _file$locale = file[locale],
10051 contentType = _file$locale.contentType,
10052 fileName = _file$locale.fileName;
10053 return createUpload(file[locale]).then(upload => {
10054 return {
10055 [locale]: {
10056 contentType,
10057 fileName,
10058 uploadFrom: {
10059 sys: {
10060 type: 'Link',
10061 linkType: 'Upload',
10062 id: upload.sys.id
10063 }
10064 }
10065 }
10066 };
10067 });
10068 })).then(uploads => {
10069 // @ts-expect-error
10070 data.fields.file = uploads.reduce((fieldsData, upload) => {
10071 return _objectSpread(_objectSpread({}, fieldsData), upload);
10072 }, {});
10073 return createAsset(data);
10074 }).catch(_error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
10075 },
10076
10077 /**
10078 * Gets an Upload
10079 * @deprecated since version 5.0
10080 * @param id - Upload ID
10081 * @return Promise for an Upload
10082 * @example ```javascript
10083 * const client = contentful.createClient({
10084 * accessToken: '<content_management_api_key>'
10085 * })
10086 * const uploadStream = createReadStream('path/to/filename_english.jpg')
10087 * client.getSpace('<space_id>')
10088 * .then((space) => space.getUpload('<upload-id>')
10089 * .then((upload) => console.log(upload))
10090 * .catch(console.error)
10091 * ```
10092 */
10093 getUpload(id) {
10094 raiseDeprecationWarning('getUpload');
10095 return httpUpload.get('uploads/' + id).then(response => wrapUpload(http, response.data)).catch(_error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
10096 },
10097
10098 /**
10099 * Gets a Locale
10100 * @deprecated since version 5.0
10101 * @param id - Locale ID
10102 * @return Promise for an Locale
10103 * @example ```javascript
10104 * const contentful = require('contentful-management')
10105 *
10106 * const client = contentful.createClient({
10107 * accessToken: '<content_management_api_key>'
10108 * })
10109 *
10110 * client.getSpace('<space_id>')
10111 * .then((space) => space.getLocale('<locale_id>'))
10112 * .then((locale) => console.log(locale))
10113 * .catch(console.error)
10114 * ```
10115 */
10116 getLocale(id) {
10117 raiseDeprecationWarning('getLocale');
10118 return http.get('locales/' + id).then(response => wrapLocale(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
10119 },
10120
10121 /**
10122 * Gets a collection of Locales
10123 * @deprecated since version 5.0
10124 * @return Promise for a collection of Locales
10125 * @example ```javascript
10126 * const contentful = require('contentful-management')
10127 *
10128 * const client = contentful.createClient({
10129 * accessToken: '<content_management_api_key>'
10130 * })
10131 *
10132 * client.getSpace('<space_id>')
10133 * .then((space) => space.getLocales())
10134 * .then((response) => console.log(response.items))
10135 * .catch(console.error)
10136 * ```
10137 */
10138 getLocales() {
10139 raiseDeprecationWarning('getLocales');
10140 return http.get('locales').then(response => wrapLocaleCollection(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
10141 },
10142
10143 /**
10144 * Creates a Locale
10145 * @deprecated since version 5.0
10146 * @param data - Object representation of the Locale to be created
10147 * @return Promise for the newly created Locale
10148 * @example ```javascript
10149 * const contentful = require('contentful-management')
10150 *
10151 * const client = contentful.createClient({
10152 * accessToken: '<content_management_api_key>'
10153 * })
10154 *
10155 * // Create locale
10156 * client.getSpace('<space_id>')
10157 * .then((space) => space.createLocale({
10158 * name: 'German (Austria)',
10159 * code: 'de-AT',
10160 * fallbackCode: 'de-DE',
10161 * optional: true
10162 * }))
10163 * .then((locale) => console.log(locale))
10164 * .catch(console.error)
10165 * ```
10166 */
10167 createLocale(data) {
10168 raiseDeprecationWarning('createLocale');
10169 return http.post('locales', data).then(response => wrapLocale(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
10170 },
10171
10172 /**
10173 * Gets a Webhook
10174 * @param id - Webhook ID
10175 * @return Promise for a Webhook
10176 * @example ```javascript
10177 * const contentful = require('contentful-management')
10178 *
10179 * const client = contentful.createClient({
10180 * accessToken: '<content_management_api_key>'
10181 * })
10182 *
10183 * client.getSpace('<space_id>')
10184 * .then((space) => space.getWebhook('<webhook_id>'))
10185 * .then((webhook) => console.log(webhook))
10186 * .catch(console.error)
10187 * ```
10188 */
10189 getWebhook(id) {
10190 return http.get('webhook_definitions/' + id).then(response => wrapWebhook(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
10191 },
10192
10193 /**
10194 * Gets a collection of Webhooks
10195 * @return Promise for a collection of Webhooks
10196 * @example ```javascript
10197 * const contentful = require('contentful-management')
10198 *
10199 * const client = contentful.createClient({
10200 * accessToken: '<content_management_api_key>'
10201 * })
10202 *
10203 * client.getSpace('<space_id>')
10204 * .then((space) => space.getWebhooks())
10205 * .then((response) => console.log(response.items))
10206 * .catch(console.error)
10207 * ```
10208 */
10209 getWebhooks() {
10210 return http.get('webhook_definitions').then(response => wrapWebhookCollection(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
10211 },
10212
10213 /**
10214 * Creates a Webhook
10215 * @param data - Object representation of the Webhook to be created
10216 * @return Promise for the newly created Webhook
10217 * @example ```javascript
10218 * const contentful = require('contentful-management')
10219 *
10220 * client.getSpace('<space_id>')
10221 * .then((space) => space.createWebhook({
10222 * 'name': 'My webhook',
10223 * 'url': 'https://www.example.com/test',
10224 * 'topics': [
10225 * 'Entry.create',
10226 * 'ContentType.create',
10227 * '*.publish',
10228 * 'Asset.*'
10229 * ]
10230 * }))
10231 * .then((webhook) => console.log(webhook))
10232 * .catch(console.error)
10233 * ```
10234 */
10235 createWebhook(data) {
10236 return http.post('webhook_definitions', data).then(response => wrapWebhook(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
10237 },
10238
10239 /**
10240 * Creates a Webhook with a custom ID
10241 * @param id - Webhook ID
10242 * @param data - Object representation of the Webhook to be created
10243 * @return Promise for the newly created Webhook
10244 * @example ```javascript
10245 * const contentful = require('contentful-management')
10246 *
10247 * client.getSpace('<space_id>')
10248 * .then((space) => space.createWebhookWithId('<webhook_id>', {
10249 * 'name': 'My webhook',
10250 * 'url': 'https://www.example.com/test',
10251 * 'topics': [
10252 * 'Entry.create',
10253 * 'ContentType.create',
10254 * '*.publish',
10255 * 'Asset.*'
10256 * ]
10257 * }))
10258 * .then((webhook) => console.log(webhook))
10259 * .catch(console.error)
10260 * ```
10261 */
10262 createWebhookWithId(id, data) {
10263 return http.put('webhook_definitions/' + id, data).then(response => wrapWebhook(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
10264 },
10265
10266 /**
10267 * Gets a Role
10268 * @param id - Role ID
10269 * @return Promise for a Role
10270 * @example ```javascript
10271 * const contentful = require('contentful-management')
10272 *
10273 * const client = contentful.createClient({
10274 * accessToken: '<content_management_api_key>'
10275 * })
10276 *
10277 * client.getSpace('<space_id>')
10278 * .then((space) => space.createRole({
10279 * fields: {
10280 * title: {
10281 * 'en-US': 'Role title'
10282 * }
10283 * }
10284 * }))
10285 * .then((role) => console.log(role))
10286 * .catch(console.error)
10287 * ```
10288 */
10289 getRole(id) {
10290 return http.get('roles/' + id).then(response => wrapRole(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
10291 },
10292
10293 /**
10294 * Gets a collection of Roles
10295 * @return Promise for a collection of Roles
10296 * @example ```javascript
10297 * const contentful = require('contentful-management')
10298 *
10299 * const client = contentful.createClient({
10300 * accessToken: '<content_management_api_key>'
10301 * })
10302 *
10303 * client.getSpace('<space_id>')
10304 * .then((space) => space.getRoles())
10305 * .then((response) => console.log(response.items))
10306 * .catch(console.error)
10307 * ```
10308 */
10309 getRoles() {
10310 return http.get('roles').then(response => wrapRoleCollection(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
10311 },
10312
10313 /**
10314 * Creates a Role
10315 * @param data - Object representation of the Role to be created
10316 * @return Promise for the newly created Role
10317 * @example ```javascript
10318 * const contentful = require('contentful-management')
10319 *
10320 * const client = contentful.createClient({
10321 * accessToken: '<content_management_api_key>'
10322 * })
10323 * client.getSpace('<space_id>')
10324 * .then((space) => space.createRole({
10325 * name: 'My Role',
10326 * description: 'foobar role',
10327 * permissions: {
10328 * ContentDelivery: 'all',
10329 * ContentModel: ['read'],
10330 * Settings: []
10331 * },
10332 * policies: [
10333 * {
10334 * effect: 'allow',
10335 * actions: 'all',
10336 * constraint: {
10337 * and: [
10338 * {
10339 * equals: [
10340 * { doc: 'sys.type' },
10341 * 'Entry'
10342 * ]
10343 * },
10344 * {
10345 * equals: [
10346 * { doc: 'sys.type' },
10347 * 'Asset'
10348 * ]
10349 * }
10350 * ]
10351 * }
10352 * }
10353 * ]
10354 * }))
10355 * .then((role) => console.log(role))
10356 * .catch(console.error)
10357 * ```
10358 */
10359 createRole(data) {
10360 return http.post('roles', data).then(response => wrapRole(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
10361 },
10362
10363 /**
10364 * Creates a Role with a custom ID
10365 * @param id - Role ID
10366 * @param data - Object representation of the Role to be created
10367 * @return Promise for the newly created Role
10368 * @example ```javascript
10369 * const contentful = require('contentful-management')
10370 *
10371 * const client = contentful.createClient({
10372 * accessToken: '<content_management_api_key>'
10373 * })
10374 * client.getSpace('<space_id>')
10375 * .then((space) => space.createRoleWithId('<role-id>', {
10376 * name: 'My Role',
10377 * description: 'foobar role',
10378 * permissions: {
10379 * ContentDelivery: 'all',
10380 * ContentModel: ['read'],
10381 * Settings: []
10382 * },
10383 * policies: [
10384 * {
10385 * effect: 'allow',
10386 * actions: 'all',
10387 * constraint: {
10388 * and: [
10389 * {
10390 * equals: [
10391 * { doc: 'sys.type' },
10392 * 'Entry'
10393 * ]
10394 * },
10395 * {
10396 * equals: [
10397 * { doc: 'sys.type' },
10398 * 'Asset'
10399 * ]
10400 * }
10401 * ]
10402 * }
10403 * }
10404 * ]
10405 * }))
10406 * .then((role) => console.log(role))
10407 * .catch(console.error)
10408 * ```
10409 */
10410 createRoleWithId(id, data) {
10411 return http.put('roles/' + id, data).then(response => wrapRole(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
10412 },
10413
10414 /**
10415 * Gets a User
10416 * @param id - User ID
10417 * @return Promise for a User
10418 * @example ```javascript
10419 * const contentful = require('contentful-management')
10420 *
10421 * client.getSpace('<space_id>')
10422 * .then((space) => space.getSpaceUser('id'))
10423 * .then((user) => console.log(user))
10424 * .catch(console.error)
10425 * ```
10426 */
10427 getSpaceUser(id) {
10428 return http.get('users/' + id).then(response => wrapUser(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
10429 },
10430
10431 /**
10432 * Gets a collection of Users in a space
10433 * @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.
10434 * @return Promise a collection of Users in a space
10435 * @example ```javascript
10436 * const contentful = require('contentful-management')
10437 *
10438 * client.getSpace('<space_id>')
10439 * .then((space) => space.getSpaceUsers(query))
10440 * .then((data) => console.log(data))
10441 * .catch(console.error)
10442 * ```
10443 */
10444 getSpaceUsers(query = {}) {
10445 return http.get('users/', Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
10446 query: query
10447 })).then(response => wrapUserCollection(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
10448 },
10449
10450 /**
10451 * Gets a Space Member
10452 * @param id Get Space Member by user_id
10453 * @return Promise for a Space Member
10454 * @example ```javascript
10455 * const contentful = require('contentful-management')
10456 *
10457 * client.getSpace('<space_id>')
10458 * .then((space) => space.getSpaceMember(id))
10459 * .then((spaceMember) => console.log(spaceMember))
10460 * .catch(console.error)
10461 * ```
10462 */
10463 getSpaceMember(id) {
10464 return http.get('space_members/' + id).then(response => wrapSpaceMember(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
10465 },
10466
10467 /**
10468 * Gets a collection of Space Members
10469 * @param query
10470 * @return Promise for a collection of Space Members
10471 * @example ```javascript
10472 * const contentful = require('contentful-management')
10473 *
10474 * client.getSpace('<space_id>')
10475 * .then((space) => space.getSpaceMembers({'limit': 100}))
10476 * .then((spaceMemberCollection) => console.log(spaceMemberCollection))
10477 * .catch(console.error)
10478 * ```
10479 */
10480 getSpaceMembers(query = {}) {
10481 return http.get('space_members', Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
10482 query: query
10483 })).then(response => wrapSpaceMemberCollection(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
10484 },
10485
10486 /**
10487 * Gets a Space Membership
10488 * Warning: the user attribute in the space membership root is deprecated. The attribute has been moved inside the sys object (i.e. sys.user).
10489 * @param id - Space Membership ID
10490 * @return Promise for a Space Membership
10491 * @example ```javascript
10492 * const contentful = require('contentful-management')
10493 *
10494 * client.getSpace('<space_id>')
10495 * .then((space) => space.getSpaceMembership('id'))
10496 * .then((spaceMembership) => console.log(spaceMembership))
10497 * .catch(console.error)
10498 * ```
10499 */
10500 getSpaceMembership(id) {
10501 spaceMembershipDeprecationWarning();
10502 return http.get('space_memberships/' + id).then(response => wrapSpaceMembership(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
10503 },
10504
10505 /**
10506 * Gets a collection of Space Memberships
10507 * Warning: the user attribute in the space membership root is deprecated. The attribute has been moved inside the sys object (i.e. sys.user).
10508 * @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.
10509 * @return Promise for a collection of Space Memberships
10510 * @example ```javascript
10511 * const contentful = require('contentful-management')
10512 *
10513 * client.getSpace('<space_id>')
10514 * .then((space) => space.getSpaceMemberships({'limit': 100})) // you can add more queries as 'key': 'value'
10515 * .then((response) => console.log(response.items))
10516 * .catch(console.error)
10517 * ```
10518 */
10519 getSpaceMemberships(query = {}) {
10520 spaceMembershipDeprecationWarning();
10521 return http.get('space_memberships', Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
10522 query: query
10523 })).then(response => wrapSpaceMembershipCollection(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
10524 },
10525
10526 /**
10527 * Creates a Space Membership
10528 * Warning: the user attribute in the space membership root is deprecated. The attribute has been moved inside the sys object (i.e. sys.user).
10529 * @param data - Object representation of the Space Membership to be created
10530 * @return Promise for the newly created Space Membership
10531 * @example ```javascript
10532 * const contentful = require('contentful-management')
10533 *
10534 * const client = contentful.createClient({
10535 * accessToken: '<content_management_api_key>'
10536 * })
10537 *
10538 * client.getSpace('<space_id>')
10539 * .then((space) => space.createSpaceMembership({
10540 * admin: false,
10541 * roles: [
10542 * {
10543 * type: 'Link',
10544 * linkType: 'Role',
10545 * id: '<role_id>'
10546 * }
10547 * ],
10548 * email: 'foo@example.com'
10549 * }))
10550 * .then((spaceMembership) => console.log(spaceMembership))
10551 * .catch(console.error)
10552 * ```
10553 */
10554 createSpaceMembership(data) {
10555 spaceMembershipDeprecationWarning();
10556 return http.post('space_memberships', data).then(response => wrapSpaceMembership(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
10557 },
10558
10559 /**
10560 * Creates a Space Membership with a custom ID
10561 * Warning: the user attribute in the space membership root is deprecated. The attribute has been moved inside the sys object (i.e. sys.user).
10562 * @param id - Space Membership ID
10563 * @param data - Object representation of the Space Membership to be created
10564 * @return Promise for the newly created Space Membership
10565 * @example ```javascript
10566 * const contentful = require('contentful-management')
10567 *
10568 * const client = contentful.createClient({
10569 * accessToken: '<content_management_api_key>'
10570 * })
10571 *
10572 * client.getSpace('<space_id>')
10573 * .then((space) => space.createSpaceMembershipWithId('<space-membership-id>', {
10574 * admin: false,
10575 * roles: [
10576 * {
10577 * type: 'Link',
10578 * linkType: 'Role',
10579 * id: '<role_id>'
10580 * }
10581 * ],
10582 * email: 'foo@example.com'
10583 * }))
10584 * .then((spaceMembership) => console.log(spaceMembership))
10585 * .catch(console.error)
10586 * ```
10587 */
10588 createSpaceMembershipWithId(id, data) {
10589 spaceMembershipDeprecationWarning();
10590 return http.put('space_memberships/' + id, data).then(response => wrapSpaceMembership(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
10591 },
10592
10593 /**
10594 * Gets a Team Space Membership
10595 * @param id - Team Space Membership ID
10596 * @return Promise for a Team Space Membership
10597 * @example ```javascript
10598 * const contentful = require('contentful-management')
10599 *
10600 * client.getSpace('<space_id>')
10601 * .then((space) => space.getTeamSpaceMembership('team_space_membership_id'))
10602 * .then((teamSpaceMembership) => console.log(teamSpaceMembership))
10603 * .catch(console.error)
10604 * ```
10605 */
10606 getTeamSpaceMembership(teamSpaceMembershipId) {
10607 return http.get('team_space_memberships/' + teamSpaceMembershipId).then(response => wrapTeamSpaceMembership(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
10608 },
10609
10610 /**
10611 * Gets a collection of Team Space Memberships
10612 * @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.
10613 * @return Promise for a collection of Team Space Memberships
10614 * @example ```javascript
10615 * const contentful = require('contentful-management')
10616 *
10617 * client.getSpace('<space_id>')
10618 * .then((space) => space.getTeamSpaceMemberships())
10619 * .then((response) => console.log(response.items))
10620 * .catch(console.error)
10621 * ```
10622 */
10623 getTeamSpaceMemberships(query = {}) {
10624 return http.get('team_space_memberships', Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
10625 query: query
10626 })).then(response => wrapTeamSpaceMembershipCollection(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
10627 },
10628
10629 /**
10630 * Creates a Team Space Membership
10631 * @param id - Team ID
10632 * @param data - Object representation of the Team Space Membership to be created
10633 * @return Promise for the newly created Team Space Membership
10634 * @example ```javascript
10635 * const contentful = require('contentful-management')
10636 *
10637 * const client = contentful.createClient({
10638 * accessToken: '<content_management_api_key>'
10639 * })
10640 *
10641 * client.getSpace('<space_id>')
10642 * .then((space) => space.createTeamSpaceMembership('team_id', {
10643 * admin: false,
10644 * roles: [
10645 * {
10646 sys: {
10647 * type: 'Link',
10648 * linkType: 'Role',
10649 * id: '<role_id>'
10650 * }
10651 * }
10652 * ],
10653 * }))
10654 * .then((teamSpaceMembership) => console.log(teamSpaceMembership))
10655 * .catch(console.error)
10656 * ```
10657 */
10658 createTeamSpaceMembership(teamId, data) {
10659 return http.post('team_space_memberships', data, {
10660 headers: {
10661 'x-contentful-team': teamId
10662 }
10663 }).then(response => wrapTeamSpaceMembership(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
10664 },
10665
10666 /**
10667 * Gets a Api Key
10668 * @param id - API Key ID
10669 * @return Promise for a Api Key
10670 * @example ```javascript
10671 * const contentful = require('contentful-management')
10672 *
10673 * const client = contentful.createClient({
10674 * accessToken: '<content_management_api_key>'
10675 * })
10676 *
10677 * client.getSpace('<space_id>')
10678 * .then((space) => space.getApiKey('<apikey-id>'))
10679 * .then((apikey) => console.log(apikey))
10680 * .catch(console.error)
10681 * ```
10682 */
10683 getApiKey(id) {
10684 return http.get('api_keys/' + id).then(response => wrapApiKey(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
10685 },
10686
10687 /**
10688 * Gets a collection of Api Keys
10689 * @return Promise for a collection of Api Keys
10690 * @example ```javascript
10691 * const contentful = require('contentful-management')
10692 *
10693 * const client = contentful.createClient({
10694 * accessToken: '<content_management_api_key>'
10695 * })
10696 *
10697 * client.getSpace('<space_id>')
10698 * .then((space) => space.getApiKeys())
10699 * .then((response) => console.log(response.items))
10700 * .catch(console.error)
10701 * ```
10702 */
10703 getApiKeys() {
10704 return http.get('api_keys').then(response => wrapApiKeyCollection(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
10705 },
10706
10707 /**
10708 * Gets a collection of preview Api Keys
10709 * @return Promise for a collection of Preview Api Keys
10710 * @example ```javascript
10711 * const contentful = require('contentful-management')
10712 *
10713 * const client = contentful.createClient({
10714 * accessToken: '<content_management_api_key>'
10715 * })
10716 *
10717 * client.getSpace('<space_id>')
10718 * .then((space) => space.getPreviewApiKeys())
10719 * .then((response) => console.log(response.items))
10720 * .catch(console.error)
10721 * ```
10722 */
10723 getPreviewApiKeys() {
10724 return http.get('preview_api_keys').then(response => wrapPreviewApiKeyCollection(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
10725 },
10726
10727 /**
10728 * Gets a preview Api Key
10729 * @param id - Preview API Key ID
10730 * @return Promise for a Preview Api Key
10731 * @example ```javascript
10732 * const contentful = require('contentful-management')
10733 *
10734 * const client = contentful.createClient({
10735 * accessToken: '<content_management_api_key>'
10736 * })
10737 *
10738 * client.getSpace('<space_id>')
10739 * .then((space) => space.getPreviewApiKey('<preview-apikey-id>'))
10740 * .then((previewApikey) => console.log(previewApikey))
10741 * .catch(console.error)
10742 * ```
10743 */
10744 getPreviewApiKey(id) {
10745 return http.get('preview_api_keys/' + id).then(response => wrapPreviewApiKey(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
10746 },
10747
10748 /**
10749 * Creates a Api Key
10750 * @param data - Object representation of the Api Key to be created
10751 * @return Promise for the newly created Api Key
10752 * @example ```javascript
10753 * const contentful = require('contentful-management')
10754 *
10755 * const client = contentful.createClient({
10756 * accessToken: '<content_management_api_key>'
10757 * })
10758 *
10759 * client.getSpace('<space_id>')
10760 * .then((space) => space.createApiKey({
10761 * name: 'API Key name',
10762 * environments:[
10763 * {
10764 * sys: {
10765 * type: 'Link'
10766 * linkType: 'Environment',
10767 * id:'<environment_id>'
10768 * }
10769 * }
10770 * ]
10771 * }
10772 * }))
10773 * .then((apiKey) => console.log(apiKey))
10774 * .catch(console.error)
10775 * ```
10776 */
10777 createApiKey: function createApiKey(data) {
10778 return http.post('api_keys', data).then(response => wrapApiKey(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
10779 },
10780
10781 /**
10782 * Creates a Api Key with a custom ID
10783 * @param id - Api Key ID
10784 * @param data - Object representation of the Api Key to be created
10785 * @return Promise for the newly created Api Key
10786 * @example ```javascript
10787 * const contentful = require('contentful-management')
10788 *
10789 * const client = contentful.createClient({
10790 * accessToken: '<content_management_api_key>'
10791 * })
10792 *
10793 * client.getSpace('<space_id>')
10794 * .then((space) => space.createApiKeyWithId('<api-key-id>', {
10795 * name: 'API Key name'
10796 * environments:[
10797 * {
10798 * sys: {
10799 * type: 'Link'
10800 * linkType: 'Environment',
10801 * id:'<environment_id>'
10802 * }
10803 * }
10804 * ]
10805 * }
10806 * }))
10807 * .then((apiKey) => console.log(apiKey))
10808 * .catch(console.error)
10809 * ```
10810 */
10811 createApiKeyWithId(id, data) {
10812 return http.put('api_keys/' + id, data).then(response => wrapApiKey(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
10813 },
10814
10815 /**
10816 * Gets an UI Extension
10817 * @deprecated since version 5.0
10818 * @param id - UI Extension ID
10819 * @return Promise for an UI Extension
10820 * @example ```javascript
10821 * const contentful = require('contentful-management')
10822 *
10823 * const client = contentful.createClient({
10824 * accessToken: '<content_management_api_key>'
10825 * })
10826 *
10827 * client.getSpace('<space_id>')
10828 * .then((space) => space.getUiExtension('<extension-id>'))
10829 * .then((uiExtension) => console.log(uiExtension))
10830 * .catch(console.error)
10831 * ```
10832 */
10833 getUiExtension(id) {
10834 raiseDeprecationWarning('getUiExtension');
10835 return http.get('extensions/' + id).then(response => wrapUiExtension(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
10836 },
10837
10838 /**
10839 * Gets a collection of UI Extension
10840 * @deprecated since version 5.0
10841 * @return Promise for a collection of UI Extensions
10842 * @example ```javascript
10843 * const contentful = require('contentful-management')
10844 *
10845 * const client = contentful.createClient({
10846 * accessToken: '<content_management_api_key>'
10847 * })
10848 *
10849 * client.getSpace('<space_id>')
10850 * .then((space) => space.getUiExtensions()
10851 * .then((response) => console.log(response.items))
10852 * .catch(console.error)
10853 * ```
10854 */
10855 getUiExtensions() {
10856 raiseDeprecationWarning('getUiExtensions');
10857 return http.get('extensions').then(response => wrapUiExtensionCollection(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
10858 },
10859
10860 /**
10861 * Creates a UI Extension
10862 * @deprecated since version 5.0
10863 * @param data - Object representation of the UI Extension to be created
10864 * @return Promise for the newly created UI Extension
10865 * @example ```javascript
10866 * const contentful = require('contentful-management')
10867 *
10868 * const client = contentful.createClient({
10869 * accessToken: '<content_management_api_key>'
10870 * })
10871 *
10872 * client.getSpace('<space_id>')
10873 * .then((space) => space.createUiExtension({
10874 * extension: {
10875 * name: 'My awesome extension',
10876 * src: 'https://example.com/my',
10877 * fieldTypes: [
10878 * {
10879 * type: 'Symbol'
10880 * },
10881 * {
10882 * type: 'Text'
10883 * }
10884 * ],
10885 * sidebar: false
10886 * }
10887 * }))
10888 * .then((uiExtension) => console.log(uiExtension))
10889 * .catch(console.error)
10890 * ```
10891 */
10892 createUiExtension(data) {
10893 raiseDeprecationWarning('createUiExtension');
10894 return http.post('extensions', data).then(response => wrapUiExtension(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
10895 },
10896
10897 /**
10898 * Creates a UI Extension with a custom ID
10899 * @deprecated since version 5.0
10900 * @param id - UI Extension ID
10901 * @param data - Object representation of the UI Extension to be created
10902 * @return Promise for the newly created UI Extension
10903 * @example ```javascript
10904 * const contentful = require('contentful-management')
10905 *
10906 * const client = contentful.createClient({
10907 * accessToken: '<content_management_api_key>'
10908 * })
10909 *
10910 * client.getSpace('<space_id>')
10911 * .then((space) => space.createUiExtensionWithId('<extension_id>', {
10912 * extension: {
10913 * name: 'My awesome extension',
10914 * src: 'https://example.com/my',
10915 * fieldTypes: [
10916 * {
10917 * type: 'Symbol'
10918 * },
10919 * {
10920 * type: 'Text'
10921 * }
10922 * ],
10923 * sidebar: false
10924 * }
10925 * }))
10926 * .then((uiExtension) => console.log(uiExtension))
10927 * .catch(console.error)
10928 * ```
10929 */
10930 createUiExtensionWithId(id, data) {
10931 raiseDeprecationWarning('createUiExtensionWithId');
10932 return http.put('extensions/' + id, data).then(response => wrapUiExtension(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
10933 },
10934
10935 /**
10936 * Gets all snapshots of an entry
10937 * @deprecated since version 5.0
10938 * @param entryId - Entry ID
10939 * @param query - additional query paramaters
10940 * @return Promise for a collection of Entry Snapshots
10941 * @example ```javascript
10942 * const contentful = require('contentful-management')
10943 *
10944 * const client = contentful.createClient({
10945 * accessToken: '<content_management_api_key>'
10946 * })
10947 *
10948 * client.getSpace('<space_id>')
10949 * .then((space) => space.getEntrySnapshots('<entry_id>'))
10950 * .then((snapshots) => console.log(snapshots.items))
10951 * .catch(console.error)
10952 * ```
10953 */
10954 getEntrySnapshots(entryId, query = {}) {
10955 raiseDeprecationWarning('getEntrySnapshots');
10956 return http.get(`entries/${entryId}/snapshots`, Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
10957 query: query
10958 })).then(response => wrapSnapshotCollection(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
10959 },
10960
10961 /**
10962 * Gets all snapshots of a contentType
10963 * @deprecated since version 5.0
10964 * @param contentTypeId - Content Type ID
10965 * @param query - additional query paramaters
10966 * @return Promise for a collection of Content Type Snapshots
10967 * @example ```javascript
10968 * const contentful = require('contentful-management')
10969 *
10970 * const client = contentful.createClient({
10971 * accessToken: '<content_management_api_key>'
10972 * })
10973 *
10974 * client.getSpace('<space_id>')
10975 * .then((space) => space.getContentTypeSnapshots('<contentTypeId>'))
10976 * .then((snapshots) => console.log(snapshots.items))
10977 * .catch(console.error)
10978 * ```
10979 */
10980 getContentTypeSnapshots(contentTypeId, query = {}) {
10981 raiseDeprecationWarning('getContentTypeSnapshots');
10982 return http.get(`content_types/${contentTypeId}/snapshots`, Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
10983 query: query
10984 })).then(response => wrapSnapshotCollection(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
10985 },
10986
10987 /**
10988 * Gets an Environment Alias
10989 * @param Environment Alias ID
10990 * @return Promise for an Environment Alias
10991 * @example ```javascript
10992 * const contentful = require('contentful-management')
10993 *
10994 * const client = contentful.createClient({
10995 * accessToken: '<content_management_api_key>'
10996 * })
10997 *
10998 * client.getSpace('<space_id>')
10999 * .then((space) => space.getEnvironmentAlias('<alias-id>'))
11000 * .then((alias) => console.log(alias))
11001 * .catch(console.error)
11002 * ```
11003 */
11004 getEnvironmentAlias(id) {
11005 return http.get('environment_aliases/' + id).then(response => wrapEnvironmentAlias(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
11006 },
11007
11008 /**
11009 * Gets a collection of Environment Aliases
11010 * @return Promise for a collection of Environment Aliases
11011 * @example ```javascript
11012 * const contentful = require('contentful-management')
11013 *
11014 * const client = contentful.createClient({
11015 * accessToken: '<content_management_api_key>'
11016 * })
11017 *
11018 * client.getSpace('<space_id>')
11019 * .then((space) => space.getEnvironmentAliases()
11020 * .then((response) => console.log(response.items))
11021 * .catch(console.error)
11022 * ```
11023 */
11024 getEnvironmentAliases() {
11025 return http.get('environment_aliases').then(response => wrapEnvironmentAliasCollection(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
11026 }
11027
11028 };
11029}
11030
11031/***/ }),
11032
11033/***/ "./enhance-with-methods.ts":
11034/*!*********************************!*\
11035 !*** ./enhance-with-methods.ts ***!
11036 \*********************************/
11037/*! exports provided: default */
11038/***/ (function(module, __webpack_exports__, __webpack_require__) {
11039
11040"use strict";
11041__webpack_require__.r(__webpack_exports__);
11042/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return enhanceWithMethods; });
11043/**
11044 * This method enhances a base object which would normally contain data, with
11045 * methods from another object that might work on manipulating that data.
11046 * All the added methods are set as non enumerable, non configurable, and non
11047 * writable properties. This ensures that if we try to clone or stringify the
11048 * base object, we don't have to worry about these additional methods.
11049 * @private
11050 * @param {object} baseObject - Base object with data
11051 * @param {object} methodsObject - Object with methods as properties. The key
11052 * values used here will be the same that will be defined on the baseObject.
11053 */
11054function enhanceWithMethods(baseObject, methodsObject) {
11055 // @ts-expect-error
11056 return Object.keys(methodsObject).reduce((enhancedObject, methodName) => {
11057 Object.defineProperty(enhancedObject, methodName, {
11058 enumerable: false,
11059 configurable: true,
11060 writable: false,
11061 value: methodsObject[methodName]
11062 });
11063 return enhancedObject;
11064 }, baseObject);
11065}
11066
11067/***/ }),
11068
11069/***/ "./entities/api-key.ts":
11070/*!*****************************!*\
11071 !*** ./entities/api-key.ts ***!
11072 \*****************************/
11073/*! exports provided: wrapApiKey, wrapApiKeyCollection */
11074/***/ (function(module, __webpack_exports__, __webpack_require__) {
11075
11076"use strict";
11077__webpack_require__.r(__webpack_exports__);
11078/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapApiKey", function() { return wrapApiKey; });
11079/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapApiKeyCollection", function() { return wrapApiKeyCollection; });
11080/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
11081/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
11082/* 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");
11083/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
11084/* harmony import */ var _instance_actions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../instance-actions */ "./instance-actions.ts");
11085/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
11086
11087
11088
11089
11090
11091
11092function createApiKeyApi(http) {
11093 return {
11094 update: function update() {
11095 const self = this;
11096
11097 if ('accessToken' in self) {
11098 delete self.accessToken;
11099 }
11100
11101 if ('preview_api_key' in self) {
11102 delete self.preview_api_key;
11103 }
11104
11105 if ('policies' in self) {
11106 delete self.policies;
11107 }
11108
11109 const update = Object(_instance_actions__WEBPACK_IMPORTED_MODULE_3__["createUpdateEntity"])({
11110 http: http,
11111 entityPath: 'api_keys',
11112 wrapperMethod: wrapApiKey
11113 });
11114 return update.call(self);
11115 },
11116 delete: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_3__["createDeleteEntity"])({
11117 http: http,
11118 entityPath: 'api_keys'
11119 })
11120 };
11121}
11122/**
11123 * @private
11124 * @param http - HTTP client instance
11125 * @param data - Raw api key data
11126 */
11127
11128
11129function wrapApiKey(http, data) {
11130 const apiKey = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
11131 const apiKeyWithMethods = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(apiKey, createApiKeyApi(http));
11132 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(apiKeyWithMethods);
11133}
11134/**
11135 * @private
11136 * @param http - HTTP client instance
11137 * @param data - Raw api key collection data
11138 * @return Wrapped api key collection data
11139 */
11140
11141const wrapApiKeyCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_4__["wrapCollection"])(wrapApiKey);
11142
11143/***/ }),
11144
11145/***/ "./entities/app-definition.ts":
11146/*!************************************!*\
11147 !*** ./entities/app-definition.ts ***!
11148 \************************************/
11149/*! exports provided: wrapAppDefinition, wrapAppDefinitionCollection */
11150/***/ (function(module, __webpack_exports__, __webpack_require__) {
11151
11152"use strict";
11153__webpack_require__.r(__webpack_exports__);
11154/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapAppDefinition", function() { return wrapAppDefinition; });
11155/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapAppDefinitionCollection", function() { return wrapAppDefinitionCollection; });
11156/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
11157/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
11158/* 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");
11159/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
11160/* harmony import */ var _instance_actions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../instance-actions */ "./instance-actions.ts");
11161/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
11162
11163
11164
11165
11166
11167const entityPath = 'app_definitions';
11168
11169function createAppDefinitionApi(http) {
11170 return {
11171 update: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_3__["createUpdateEntity"])({
11172 http,
11173 entityPath,
11174 wrapperMethod: wrapAppDefinition
11175 }),
11176 delete: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_3__["createDeleteEntity"])({
11177 http,
11178 entityPath
11179 })
11180 };
11181}
11182/**
11183 * @private
11184 * @param http - HTTP client instance
11185 * @param data - Raw App Definition data
11186 * @return Wrapped App Definition data
11187 */
11188
11189
11190function wrapAppDefinition(http, data) {
11191 const appDefinition = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
11192 const appDefinitionWithMethods = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(appDefinition, createAppDefinitionApi(http));
11193 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(appDefinitionWithMethods);
11194}
11195/**
11196 * @private
11197 * @param http - HTTP client instance
11198 * @param data - Raw App Definition collection data
11199 * @return Wrapped App Definition collection data
11200 */
11201
11202const wrapAppDefinitionCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_4__["wrapCollection"])(wrapAppDefinition);
11203
11204/***/ }),
11205
11206/***/ "./entities/app-installation.ts":
11207/*!**************************************!*\
11208 !*** ./entities/app-installation.ts ***!
11209 \**************************************/
11210/*! exports provided: wrapAppInstallation, wrapAppInstallationCollection */
11211/***/ (function(module, __webpack_exports__, __webpack_require__) {
11212
11213"use strict";
11214__webpack_require__.r(__webpack_exports__);
11215/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapAppInstallation", function() { return wrapAppInstallation; });
11216/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapAppInstallationCollection", function() { return wrapAppInstallationCollection; });
11217/* 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");
11218/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
11219/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_1__);
11220/* harmony import */ var _error_handler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../error-handler */ "./error-handler.ts");
11221/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
11222/* harmony import */ var _instance_actions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../instance-actions */ "./instance-actions.ts");
11223/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
11224
11225
11226
11227
11228
11229
11230
11231function createAppInstallationApi(http) {
11232 return {
11233 update: function update() {
11234 const self = this;
11235 const raw = self.toPlainObject();
11236 const data = lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_1___default()(raw);
11237 delete data.sys;
11238 return http.put(`app_installations/${self.sys.appDefinition.sys.id}`, data).then(response => wrapAppInstallation(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_2__["default"]);
11239 },
11240 delete: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createDeleteEntity"])({
11241 http: http,
11242 entityPath: 'app_installations'
11243 })
11244 };
11245}
11246/**
11247 * @private
11248 * @param http - HTTP client instance
11249 * @param data - Raw App Installation data
11250 * @return Wrapped App installation data
11251 */
11252
11253
11254function wrapAppInstallation(http, data) {
11255 const appInstallation = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_1___default()(data));
11256 const appInstallationWithMethods = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_3__["default"])(appInstallation, createAppInstallationApi(http));
11257 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["freezeSys"])(appInstallationWithMethods);
11258}
11259/**
11260 * @private
11261 */
11262
11263const wrapAppInstallationCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_5__["wrapCollection"])(wrapAppInstallation);
11264
11265/***/ }),
11266
11267/***/ "./entities/asset.ts":
11268/*!***************************!*\
11269 !*** ./entities/asset.ts ***!
11270 \***************************/
11271/*! exports provided: wrapAsset, wrapAssetCollection */
11272/***/ (function(module, __webpack_exports__, __webpack_require__) {
11273
11274"use strict";
11275__webpack_require__.r(__webpack_exports__);
11276/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapAsset", function() { return wrapAsset; });
11277/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapAssetCollection", function() { return wrapAssetCollection; });
11278/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
11279/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
11280/* 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");
11281/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
11282/* harmony import */ var _error_handler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../error-handler */ "./error-handler.ts");
11283/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
11284/* harmony import */ var _instance_actions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../instance-actions */ "./instance-actions.ts");
11285
11286
11287
11288
11289
11290
11291const ASSET_PROCESSING_CHECK_WAIT = 3000;
11292const ASSET_PROCESSING_CHECK_RETRIES = 10;
11293
11294function createAssetApi(http) {
11295 function checkIfAssetHasUrl({
11296 resolve,
11297 reject,
11298 id,
11299 locale,
11300 processingCheckWait = ASSET_PROCESSING_CHECK_WAIT,
11301 processingCheckRetries = ASSET_PROCESSING_CHECK_RETRIES,
11302 checkCount = 0
11303 }) {
11304 http.get('assets/' + id).then(response => wrapAsset(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_3__["default"]).then(asset => {
11305 if (asset.fields.file[locale].url) {
11306 resolve(asset);
11307 } else if (checkCount === processingCheckRetries) {
11308 const error = new Error();
11309 error.name = 'AssetProcessingTimeout';
11310 error.message = 'Asset is taking longer then expected to process.';
11311 reject(error);
11312 } else {
11313 checkCount++;
11314 setTimeout(() => checkIfAssetHasUrl({
11315 resolve: resolve,
11316 reject: reject,
11317 id: id,
11318 locale: locale,
11319 checkCount: checkCount,
11320 processingCheckWait,
11321 processingCheckRetries
11322 }), processingCheckWait);
11323 }
11324 });
11325 }
11326
11327 function processForLocale(locale, {
11328 processingCheckWait,
11329 processingCheckRetries
11330 } = {}) {
11331 const assetId = this.sys.id;
11332 return http.put('assets/' + this.sys.id + '/files/' + locale + '/process', null, {
11333 headers: {
11334 'X-Contentful-Version': this.sys.version
11335 }
11336 }).then(() => {
11337 return new Promise((resolve, reject) => checkIfAssetHasUrl({
11338 resolve: resolve,
11339 reject: reject,
11340 id: assetId,
11341 locale: locale,
11342 processingCheckWait: processingCheckWait,
11343 processingCheckRetries: processingCheckRetries
11344 }));
11345 }, _error_handler__WEBPACK_IMPORTED_MODULE_3__["default"]);
11346 }
11347
11348 function processForAllLocales(options = {}) {
11349 const self = this;
11350 const locales = Object.keys(this.fields.file || {});
11351 let mostUpToDateAssetVersion = undefined; // Let all the locales process
11352 // Since they all resolve at different times,
11353 // we need to pick the last resolved value
11354 // to reflect the most recent state
11355
11356 const allProcessingLocales = locales.map(locale => processForLocale.call(self, locale, options).then(result => {
11357 // Side effect of always setting the most up to date asset version
11358 // The last one to call this will be the last one that finished
11359 // and thus the most up to date
11360 mostUpToDateAssetVersion = result;
11361 }));
11362 return Promise.all(allProcessingLocales).then(() => mostUpToDateAssetVersion);
11363 }
11364
11365 return {
11366 update: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_5__["createUpdateEntity"])({
11367 http: http,
11368 entityPath: 'assets',
11369 wrapperMethod: wrapAsset
11370 }),
11371 delete: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_5__["createDeleteEntity"])({
11372 http: http,
11373 entityPath: 'assets'
11374 }),
11375 publish: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_5__["createPublishEntity"])({
11376 http: http,
11377 entityPath: 'assets',
11378 wrapperMethod: wrapAsset
11379 }),
11380 unpublish: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_5__["createUnpublishEntity"])({
11381 http: http,
11382 entityPath: 'assets',
11383 wrapperMethod: wrapAsset
11384 }),
11385 archive: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_5__["createArchiveEntity"])({
11386 http: http,
11387 entityPath: 'assets',
11388 wrapperMethod: wrapAsset
11389 }),
11390 unarchive: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_5__["createUnarchiveEntity"])({
11391 http: http,
11392 entityPath: 'assets',
11393 wrapperMethod: wrapAsset
11394 }),
11395 processForLocale: processForLocale,
11396 processForAllLocales: processForAllLocales,
11397 isPublished: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_5__["createPublishedChecker"])(),
11398 isUpdated: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_5__["createUpdatedChecker"])(),
11399 isDraft: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_5__["createDraftChecker"])(),
11400 isArchived: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_5__["createArchivedChecker"])()
11401 };
11402}
11403/**
11404 * @private
11405 * @param http - HTTP client instance
11406 * @param data - Raw asset data
11407 * @return Wrapped asset data
11408 */
11409
11410
11411function wrapAsset(http, data) {
11412 const asset = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
11413 const assetWithMethods = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(asset, createAssetApi(http));
11414 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(assetWithMethods);
11415}
11416/**
11417 * @private
11418 */
11419
11420const wrapAssetCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_4__["wrapCollection"])(wrapAsset);
11421
11422/***/ }),
11423
11424/***/ "./entities/content-type.ts":
11425/*!**********************************!*\
11426 !*** ./entities/content-type.ts ***!
11427 \**********************************/
11428/*! exports provided: wrapContentType, wrapContentTypeCollection */
11429/***/ (function(module, __webpack_exports__, __webpack_require__) {
11430
11431"use strict";
11432__webpack_require__.r(__webpack_exports__);
11433/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapContentType", function() { return wrapContentType; });
11434/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapContentTypeCollection", function() { return wrapContentTypeCollection; });
11435/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
11436/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
11437/* 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");
11438/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
11439/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
11440/* harmony import */ var _instance_actions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../instance-actions */ "./instance-actions.ts");
11441/* harmony import */ var _editor_interface__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./editor-interface */ "./entities/editor-interface.ts");
11442/* harmony import */ var _error_handler__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../error-handler */ "./error-handler.ts");
11443/* harmony import */ var _snapshot__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./snapshot */ "./entities/snapshot.ts");
11444
11445
11446
11447
11448
11449
11450
11451
11452
11453function createContentTypeApi(http) {
11454 return {
11455 update: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createUpdateEntity"])({
11456 http: http,
11457 entityPath: 'content_types',
11458 wrapperMethod: wrapContentType
11459 }),
11460 delete: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createDeleteEntity"])({
11461 http: http,
11462 entityPath: 'content_types'
11463 }),
11464 publish: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createPublishEntity"])({
11465 http: http,
11466 entityPath: 'content_types',
11467 wrapperMethod: wrapContentType
11468 }),
11469 unpublish: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createUnpublishEntity"])({
11470 http: http,
11471 entityPath: 'content_types',
11472 wrapperMethod: wrapContentType
11473 }),
11474 getEditorInterface: function getEditorInterface() {
11475 return http.get('content_types/' + this.sys.id + '/editor_interface').then(response => Object(_editor_interface__WEBPACK_IMPORTED_MODULE_5__["wrapEditorInterface"])(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_6__["default"]);
11476 },
11477 getSnapshots: function getSnapshots(query = {}) {
11478 return http.get(`content_types/${this.sys.id}/snapshots`, Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
11479 query: query
11480 })).then(response => Object(_snapshot__WEBPACK_IMPORTED_MODULE_7__["wrapSnapshotCollection"])(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_6__["default"]);
11481 },
11482 getSnapshot: function getSnapshot(snapshotId) {
11483 return http.get(`content_types/${this.sys.id}/snapshots/${snapshotId}`).then(response => Object(_snapshot__WEBPACK_IMPORTED_MODULE_7__["wrapSnapshot"])(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_6__["default"]);
11484 },
11485 isPublished: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createPublishedChecker"])(),
11486 isUpdated: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createUpdatedChecker"])(),
11487 isDraft: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createDraftChecker"])(),
11488 omitAndDeleteField: function omitAndDeleteField(id) {
11489 return findAndUpdateField(this, id, 'omitted', true).then(newContentType => findAndUpdateField(newContentType, id, 'deleted', true)).catch(_error_handler__WEBPACK_IMPORTED_MODULE_6__["default"]);
11490 }
11491 };
11492}
11493/**
11494 * @private
11495 * @param id - unique ID of the field
11496 * @param key - the attribute on the field to change
11497 * @param value - the value to set the attribute to
11498 */
11499
11500
11501const findAndUpdateField = function findAndUpdateField(contentType, id, key, value) {
11502 const field = contentType.fields.find(field => field.id === id);
11503
11504 if (!field) {
11505 return Promise.reject(new Error(`Tried to omitAndDeleteField on a nonexistent field, ${id}, on the content type ${contentType.name}.`));
11506 } // @ts-expect-error
11507
11508
11509 field[key] = value;
11510 return contentType.update();
11511};
11512/**
11513 * @private
11514 * @param http - HTTP client instance
11515 * @param data - Raw content type data
11516 * @return Wrapped content type data
11517 */
11518
11519
11520function wrapContentType(http, data) {
11521 const contentType = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
11522 const contentTypeWithMethods = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(contentType, createContentTypeApi(http));
11523 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(contentTypeWithMethods);
11524}
11525/**
11526 * @private
11527 */
11528
11529const wrapContentTypeCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_3__["wrapCollection"])(wrapContentType);
11530
11531/***/ }),
11532
11533/***/ "./entities/editor-interface.ts":
11534/*!**************************************!*\
11535 !*** ./entities/editor-interface.ts ***!
11536 \**************************************/
11537/*! exports provided: wrapEditorInterface */
11538/***/ (function(module, __webpack_exports__, __webpack_require__) {
11539
11540"use strict";
11541__webpack_require__.r(__webpack_exports__);
11542/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapEditorInterface", function() { return wrapEditorInterface; });
11543/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
11544/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
11545/* 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");
11546/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
11547/* harmony import */ var _error_handler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../error-handler */ "./error-handler.ts");
11548
11549
11550
11551
11552
11553function createEditorInterfaceApi(http) {
11554 return {
11555 update: function update() {
11556 const self = this;
11557 const raw = self.toPlainObject();
11558 const data = lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(raw);
11559 delete data.sys;
11560 return http.put(`content_types/${self.sys.contentType.sys.id}/editor_interface`, data, {
11561 headers: {
11562 'X-Contentful-Version': self.sys.version
11563 }
11564 }).then(response => wrapEditorInterface(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_3__["default"]);
11565 },
11566 getControlForField: function getControlForField(fieldId) {
11567 const self = this;
11568 const result = self.controls.filter(control => {
11569 return control.fieldId === fieldId;
11570 });
11571 return result && result.length > 0 ? result[0] : null;
11572 }
11573 };
11574}
11575/**
11576 * @private
11577 */
11578
11579
11580function wrapEditorInterface(http, data) {
11581 const editorInterface = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
11582 const editorInterfaceWithMethods = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(editorInterface, createEditorInterfaceApi(http));
11583 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(editorInterfaceWithMethods);
11584}
11585
11586/***/ }),
11587
11588/***/ "./entities/entry.ts":
11589/*!***************************!*\
11590 !*** ./entities/entry.ts ***!
11591 \***************************/
11592/*! exports provided: wrapEntry, wrapEntryCollection */
11593/***/ (function(module, __webpack_exports__, __webpack_require__) {
11594
11595"use strict";
11596__webpack_require__.r(__webpack_exports__);
11597/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapEntry", function() { return wrapEntry; });
11598/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapEntryCollection", function() { return wrapEntryCollection; });
11599/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
11600/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
11601/* 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");
11602/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
11603/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
11604/* harmony import */ var _instance_actions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../instance-actions */ "./instance-actions.ts");
11605/* harmony import */ var _error_handler__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../error-handler */ "./error-handler.ts");
11606/* harmony import */ var _snapshot__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./snapshot */ "./entities/snapshot.ts");
11607
11608
11609
11610
11611
11612
11613
11614
11615function createEntryApi(http) {
11616 return {
11617 update: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createUpdateEntity"])({
11618 http: http,
11619 entityPath: 'entries',
11620 wrapperMethod: wrapEntry
11621 }),
11622 delete: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createDeleteEntity"])({
11623 http: http,
11624 entityPath: 'entries'
11625 }),
11626 publish: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createPublishEntity"])({
11627 http: http,
11628 entityPath: 'entries',
11629 wrapperMethod: wrapEntry
11630 }),
11631 unpublish: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createUnpublishEntity"])({
11632 http: http,
11633 entityPath: 'entries',
11634 wrapperMethod: wrapEntry
11635 }),
11636 archive: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createArchiveEntity"])({
11637 http: http,
11638 entityPath: 'entries',
11639 wrapperMethod: wrapEntry
11640 }),
11641 unarchive: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createUnarchiveEntity"])({
11642 http: http,
11643 entityPath: 'entries',
11644 wrapperMethod: wrapEntry
11645 }),
11646 getSnapshots: function getSnapshots(query = {}) {
11647 return http.get(`entries/${this.sys.id}/snapshots`, Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["createRequestConfig"])({
11648 query: query
11649 })).then(response => Object(_snapshot__WEBPACK_IMPORTED_MODULE_6__["wrapSnapshotCollection"])(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_5__["default"]);
11650 },
11651 getSnapshot: function getSnapshot(snapshotId) {
11652 return http.get(`entries/${this.sys.id}/snapshots/${snapshotId}`).then(response => Object(_snapshot__WEBPACK_IMPORTED_MODULE_6__["wrapSnapshot"])(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_5__["default"]);
11653 },
11654 isPublished: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createPublishedChecker"])(),
11655 isUpdated: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createUpdatedChecker"])(),
11656 isDraft: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createDraftChecker"])(),
11657 isArchived: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createArchivedChecker"])()
11658 };
11659}
11660/**
11661 * @private
11662 * @param http - HTTP client instance
11663 * @param data - Raw entry data
11664 * @return Wrapped entry data
11665 */
11666
11667
11668function wrapEntry(http, data) {
11669 const entry = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
11670 const entryWithMethods = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(entry, createEntryApi(http));
11671 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(entryWithMethods);
11672}
11673/**
11674 * Data is also mixed in with link getters if links exist and includes were requested
11675 * @private
11676 */
11677
11678const wrapEntryCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_3__["wrapCollection"])(wrapEntry);
11679
11680/***/ }),
11681
11682/***/ "./entities/environment-alias.ts":
11683/*!***************************************!*\
11684 !*** ./entities/environment-alias.ts ***!
11685 \***************************************/
11686/*! exports provided: wrapEnvironmentAlias, wrapEnvironmentAliasCollection */
11687/***/ (function(module, __webpack_exports__, __webpack_require__) {
11688
11689"use strict";
11690__webpack_require__.r(__webpack_exports__);
11691/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapEnvironmentAlias", function() { return wrapEnvironmentAlias; });
11692/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapEnvironmentAliasCollection", function() { return wrapEnvironmentAliasCollection; });
11693/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
11694/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
11695/* 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");
11696/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
11697/* harmony import */ var _instance_actions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../instance-actions */ "./instance-actions.ts");
11698/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
11699
11700
11701
11702
11703
11704
11705function createEnvironmentAliasApi(http) {
11706 return {
11707 update: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_3__["createUpdateEntity"])({
11708 http: http,
11709 entityPath: 'environment_aliases',
11710 wrapperMethod: wrapEnvironmentAlias
11711 })
11712 };
11713}
11714/**
11715 * @private
11716 * @param http - HTTP client instance
11717 * @param data - Raw environment alias data
11718 * @return Wrapped environment alias data
11719 */
11720
11721
11722function wrapEnvironmentAlias(http, data) {
11723 const alias = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
11724 const enhancedAlias = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(alias, createEnvironmentAliasApi(http));
11725 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(enhancedAlias);
11726}
11727/**
11728 * @private
11729 * @param http - HTTP client instance
11730 * @param data - Raw environment alias collection data
11731 * @return Wrapped environment alias collection data
11732 */
11733
11734const wrapEnvironmentAliasCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_4__["wrapCollection"])(wrapEnvironmentAlias);
11735
11736/***/ }),
11737
11738/***/ "./entities/environment.ts":
11739/*!*********************************!*\
11740 !*** ./entities/environment.ts ***!
11741 \*********************************/
11742/*! exports provided: wrapEnvironment, wrapEnvironmentCollection */
11743/***/ (function(module, __webpack_exports__, __webpack_require__) {
11744
11745"use strict";
11746__webpack_require__.r(__webpack_exports__);
11747/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapEnvironment", function() { return wrapEnvironment; });
11748/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapEnvironmentCollection", function() { return wrapEnvironmentCollection; });
11749/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
11750/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
11751/* 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");
11752/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
11753/* harmony import */ var _create_environment_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../create-environment-api */ "./create-environment-api.ts");
11754/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
11755
11756
11757
11758
11759
11760
11761/**
11762 * This method creates the API for the given environment with all the methods for
11763 * reading and creating other entities. It also passes down a clone of the
11764 * http client with a environment id, so the base path for requests now has the
11765 * environment id already set.
11766 * @private
11767 * @param http - HTTP client instance
11768 * @param data - API response for a Environment
11769 * @return
11770 */
11771function wrapEnvironment(http, data) {
11772 // do not pollute generated typings
11773 const sdkHttp = http;
11774 const environment = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
11775 const _sdkHttp$httpClientPa = sdkHttp.httpClientParams,
11776 hostUpload = _sdkHttp$httpClientPa.hostUpload,
11777 defaultHostnameUpload = _sdkHttp$httpClientPa.defaultHostnameUpload;
11778 const environmentScopedHttpClient = sdkHttp.cloneWithNewParams({
11779 baseURL: http.defaults.baseURL + 'environments/' + environment.sys.id
11780 });
11781 const environmentScopedUploadClient = sdkHttp.cloneWithNewParams({
11782 space: environment.sys.space.sys.id,
11783 host: hostUpload || defaultHostnameUpload
11784 });
11785 const environmentApi = Object(_create_environment_api__WEBPACK_IMPORTED_MODULE_3__["default"])({
11786 http: environmentScopedHttpClient,
11787 httpUpload: environmentScopedUploadClient
11788 });
11789 const enhancedEnvironment = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(environment, environmentApi);
11790 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(enhancedEnvironment);
11791}
11792/**
11793 * This method wraps each environment in a collection with the environment API. See wrapEnvironment
11794 * above for more details.
11795 * @private
11796 */
11797
11798const wrapEnvironmentCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_4__["wrapCollection"])(wrapEnvironment);
11799
11800/***/ }),
11801
11802/***/ "./entities/index.ts":
11803/*!***************************!*\
11804 !*** ./entities/index.ts ***!
11805 \***************************/
11806/*! exports provided: default */
11807/***/ (function(module, __webpack_exports__, __webpack_require__) {
11808
11809"use strict";
11810__webpack_require__.r(__webpack_exports__);
11811/* harmony import */ var _app_definition__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./app-definition */ "./entities/app-definition.ts");
11812/* harmony import */ var _space__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./space */ "./entities/space.ts");
11813/* harmony import */ var _environment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./environment */ "./entities/environment.ts");
11814/* harmony import */ var _entry__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./entry */ "./entities/entry.ts");
11815/* harmony import */ var _asset__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./asset */ "./entities/asset.ts");
11816/* harmony import */ var _content_type__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./content-type */ "./entities/content-type.ts");
11817/* harmony import */ var _editor_interface__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./editor-interface */ "./entities/editor-interface.ts");
11818/* harmony import */ var _locale__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./locale */ "./entities/locale.ts");
11819/* harmony import */ var _webhook__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./webhook */ "./entities/webhook.ts");
11820/* harmony import */ var _space_member__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./space-member */ "./entities/space-member.ts");
11821/* harmony import */ var _space_membership__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./space-membership */ "./entities/space-membership.ts");
11822/* harmony import */ var _team_space_membership__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./team-space-membership */ "./entities/team-space-membership.ts");
11823/* harmony import */ var _organization_membership__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./organization-membership */ "./entities/organization-membership.ts");
11824/* harmony import */ var _organization_invitation__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./organization-invitation */ "./entities/organization-invitation.ts");
11825/* harmony import */ var _role__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./role */ "./entities/role.ts");
11826/* harmony import */ var _api_key__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./api-key */ "./entities/api-key.ts");
11827/* harmony import */ var _preview_api_key__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./preview-api-key */ "./entities/preview-api-key.ts");
11828/* harmony import */ var _upload__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./upload */ "./entities/upload.ts");
11829/* harmony import */ var _organization__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./organization */ "./entities/organization.ts");
11830/* harmony import */ var _ui_extension__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./ui-extension */ "./entities/ui-extension.ts");
11831/* harmony import */ var _app_installation__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./app-installation */ "./entities/app-installation.ts");
11832/* harmony import */ var _snapshot__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./snapshot */ "./entities/snapshot.ts");
11833/* harmony import */ var _user__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./user */ "./entities/user.ts");
11834/* harmony import */ var _personal_access_token__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./personal-access-token */ "./entities/personal-access-token.ts");
11835/* harmony import */ var _usage__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./usage */ "./entities/usage.ts");
11836/* harmony import */ var _environment_alias__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./environment-alias */ "./entities/environment-alias.ts");
11837/* harmony import */ var _team__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./team */ "./entities/team.ts");
11838/* harmony import */ var _team_membership__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./team-membership */ "./entities/team-membership.ts");
11839
11840
11841
11842
11843
11844
11845
11846
11847
11848
11849
11850
11851
11852
11853
11854
11855
11856
11857
11858
11859
11860
11861
11862
11863
11864
11865
11866
11867/* harmony default export */ __webpack_exports__["default"] = ({
11868 appDefinition: _app_definition__WEBPACK_IMPORTED_MODULE_0__,
11869 space: _space__WEBPACK_IMPORTED_MODULE_1__,
11870 environment: _environment__WEBPACK_IMPORTED_MODULE_2__,
11871 entry: _entry__WEBPACK_IMPORTED_MODULE_3__,
11872 asset: _asset__WEBPACK_IMPORTED_MODULE_4__,
11873 contentType: _content_type__WEBPACK_IMPORTED_MODULE_5__,
11874 editorInterface: _editor_interface__WEBPACK_IMPORTED_MODULE_6__,
11875 locale: _locale__WEBPACK_IMPORTED_MODULE_7__,
11876 webhook: _webhook__WEBPACK_IMPORTED_MODULE_8__,
11877 spaceMember: _space_member__WEBPACK_IMPORTED_MODULE_9__,
11878 spaceMembership: _space_membership__WEBPACK_IMPORTED_MODULE_10__,
11879 teamSpaceMembership: _team_space_membership__WEBPACK_IMPORTED_MODULE_11__,
11880 organizationMembership: _organization_membership__WEBPACK_IMPORTED_MODULE_12__,
11881 organizationInvitation: _organization_invitation__WEBPACK_IMPORTED_MODULE_13__,
11882 role: _role__WEBPACK_IMPORTED_MODULE_14__,
11883 apiKey: _api_key__WEBPACK_IMPORTED_MODULE_15__,
11884 previewApiKey: _preview_api_key__WEBPACK_IMPORTED_MODULE_16__,
11885 upload: _upload__WEBPACK_IMPORTED_MODULE_17__,
11886 organization: _organization__WEBPACK_IMPORTED_MODULE_18__,
11887 uiExtension: _ui_extension__WEBPACK_IMPORTED_MODULE_19__,
11888 appInstallation: _app_installation__WEBPACK_IMPORTED_MODULE_20__,
11889 snapshot: _snapshot__WEBPACK_IMPORTED_MODULE_21__,
11890 user: _user__WEBPACK_IMPORTED_MODULE_22__,
11891 personalAccessToken: _personal_access_token__WEBPACK_IMPORTED_MODULE_23__,
11892 usage: _usage__WEBPACK_IMPORTED_MODULE_24__,
11893 environmentAlias: _environment_alias__WEBPACK_IMPORTED_MODULE_25__,
11894 team: _team__WEBPACK_IMPORTED_MODULE_26__,
11895 teamMembership: _team_membership__WEBPACK_IMPORTED_MODULE_27__
11896});
11897
11898/***/ }),
11899
11900/***/ "./entities/locale.ts":
11901/*!****************************!*\
11902 !*** ./entities/locale.ts ***!
11903 \****************************/
11904/*! exports provided: wrapLocale, wrapLocaleCollection */
11905/***/ (function(module, __webpack_exports__, __webpack_require__) {
11906
11907"use strict";
11908__webpack_require__.r(__webpack_exports__);
11909/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapLocale", function() { return wrapLocale; });
11910/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapLocaleCollection", function() { return wrapLocaleCollection; });
11911/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
11912/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
11913/* 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");
11914/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
11915/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
11916/* harmony import */ var _instance_actions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../instance-actions */ "./instance-actions.ts");
11917
11918
11919
11920
11921
11922
11923function createLocaleApi(http) {
11924 return {
11925 update: function update() {
11926 const self = this;
11927 delete self.default; // we should not send this back
11928
11929 return Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createUpdateEntity"])({
11930 http: http,
11931 entityPath: 'locales',
11932 wrapperMethod: wrapLocale
11933 }).call(self);
11934 },
11935 delete: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createDeleteEntity"])({
11936 http: http,
11937 entityPath: 'locales'
11938 })
11939 };
11940}
11941/**
11942 * @private
11943 * @param http - HTTP client instance
11944 * @param data - Raw locale data
11945 * @return Wrapped locale data
11946 */
11947
11948
11949function wrapLocale(http, data) {
11950 // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
11951 // @ts-ignore
11952 delete data.internal_code;
11953 const locale = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
11954 const localeWithMethods = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(locale, createLocaleApi(http));
11955 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(localeWithMethods);
11956}
11957/**
11958 * @private
11959 */
11960
11961const wrapLocaleCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_3__["wrapCollection"])(wrapLocale);
11962
11963/***/ }),
11964
11965/***/ "./entities/organization-invitation.ts":
11966/*!*********************************************!*\
11967 !*** ./entities/organization-invitation.ts ***!
11968 \*********************************************/
11969/*! exports provided: wrapOrganizationInvitation */
11970/***/ (function(module, __webpack_exports__, __webpack_require__) {
11971
11972"use strict";
11973__webpack_require__.r(__webpack_exports__);
11974/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapOrganizationInvitation", function() { return wrapOrganizationInvitation; });
11975/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
11976/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
11977/* 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");
11978
11979
11980
11981/**
11982 * @private
11983 * @param http - HTTP client instance
11984 * @param data - Raw invitation data
11985 * @return {OrganizationInvitation} Wrapped Inviation data
11986 */
11987function wrapOrganizationInvitation(http, data) {
11988 const invitation = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
11989 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(invitation);
11990}
11991
11992/***/ }),
11993
11994/***/ "./entities/organization-membership.ts":
11995/*!*********************************************!*\
11996 !*** ./entities/organization-membership.ts ***!
11997 \*********************************************/
11998/*! exports provided: wrapOrganizationMembership, wrapOrganizationMembershipCollection */
11999/***/ (function(module, __webpack_exports__, __webpack_require__) {
12000
12001"use strict";
12002__webpack_require__.r(__webpack_exports__);
12003/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapOrganizationMembership", function() { return wrapOrganizationMembership; });
12004/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapOrganizationMembershipCollection", function() { return wrapOrganizationMembershipCollection; });
12005/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
12006/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
12007/* 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");
12008/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
12009/* harmony import */ var _error_handler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../error-handler */ "./error-handler.ts");
12010/* harmony import */ var _instance_actions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../instance-actions */ "./instance-actions.ts");
12011/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
12012
12013
12014
12015
12016
12017
12018
12019function createOrganizationMembershipApi(http) {
12020 return {
12021 update: function update() {
12022 const self = this;
12023 const raw = self.toPlainObject();
12024 const role = raw.role;
12025 return http.put('organization_memberships' + '/' + self.sys.id, {
12026 role
12027 }, {
12028 headers: {
12029 'X-Contentful-Version': self.sys.version || 0
12030 }
12031 }).then(response => wrapOrganizationMembership(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_3__["default"]);
12032 },
12033 delete: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createDeleteEntity"])({
12034 http: http,
12035 entityPath: 'organization_memberships'
12036 })
12037 };
12038}
12039/**
12040 * @private
12041 * @param {Object} http - HTTP client instance
12042 * @param {Object} data - Raw organization membership data
12043 * @return {OrganizationMembership} Wrapped organization membership data
12044 */
12045
12046
12047function wrapOrganizationMembership(http, data) {
12048 const organizationMembership = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
12049 const organizationMembershipWithMethods = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(organizationMembership, createOrganizationMembershipApi(http));
12050 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(organizationMembershipWithMethods);
12051}
12052/**
12053 * @private
12054 */
12055
12056const wrapOrganizationMembershipCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_5__["wrapCollection"])(wrapOrganizationMembership);
12057
12058/***/ }),
12059
12060/***/ "./entities/organization.ts":
12061/*!**********************************!*\
12062 !*** ./entities/organization.ts ***!
12063 \**********************************/
12064/*! exports provided: wrapOrganization, wrapOrganizationCollection */
12065/***/ (function(module, __webpack_exports__, __webpack_require__) {
12066
12067"use strict";
12068__webpack_require__.r(__webpack_exports__);
12069/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapOrganization", function() { return wrapOrganization; });
12070/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapOrganizationCollection", function() { return wrapOrganizationCollection; });
12071/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
12072/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
12073/* 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");
12074/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
12075/* harmony import */ var _create_organization_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../create-organization-api */ "./create-organization-api.ts");
12076/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
12077
12078
12079
12080
12081
12082
12083/**
12084 * This method creates the API for the given organization with all the methods for
12085 * reading and creating other entities. It also passes down a clone of the
12086 * http client with an organization id, so the base path for requests now has the
12087 * organization id already set.
12088 * @private
12089 * @param http - HTTP client instance
12090 * @param data - API response for an Organization
12091 * @return {Organization}
12092 */
12093function wrapOrganization(http, data) {
12094 const org = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
12095 const baseURL = (http.defaults.baseURL || '').replace('/spaces/', '/organizations/') + org.sys.id + '/'; // @ts-expect-error
12096
12097 const orgScopedHttpClient = http.cloneWithNewParams({
12098 baseURL
12099 });
12100 const orgApi = Object(_create_organization_api__WEBPACK_IMPORTED_MODULE_3__["default"])({
12101 http: orgScopedHttpClient
12102 });
12103 const enhancedOrganization = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(org, orgApi);
12104 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(enhancedOrganization);
12105}
12106/**
12107 * This method normalizes each organization in a collection.
12108 * @private
12109 */
12110
12111const wrapOrganizationCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_4__["wrapCollection"])(wrapOrganization);
12112
12113/***/ }),
12114
12115/***/ "./entities/personal-access-token.ts":
12116/*!*******************************************!*\
12117 !*** ./entities/personal-access-token.ts ***!
12118 \*******************************************/
12119/*! exports provided: wrapPersonalAccessToken, wrapPersonalAccessTokenCollection */
12120/***/ (function(module, __webpack_exports__, __webpack_require__) {
12121
12122"use strict";
12123__webpack_require__.r(__webpack_exports__);
12124/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapPersonalAccessToken", function() { return wrapPersonalAccessToken; });
12125/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapPersonalAccessTokenCollection", function() { return wrapPersonalAccessTokenCollection; });
12126/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
12127/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
12128/* 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");
12129/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
12130/* harmony import */ var _error_handler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../error-handler */ "./error-handler.ts");
12131/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
12132
12133
12134
12135
12136
12137
12138function createPersonalAccessToken(http) {
12139 return {
12140 revoke: function revoke() {
12141 const baseURL = (http.defaults.baseURL || '').replace('/spaces/', '/users/me/access_tokens');
12142 return http.put(`${this.sys.id}/revoked`, null, {
12143 baseURL
12144 }).then(response => response.data, _error_handler__WEBPACK_IMPORTED_MODULE_3__["default"]);
12145 }
12146 };
12147}
12148/**
12149 * @private
12150 * @param http - HTTP client instance
12151 * @param data - Raw personal access token data
12152 * @return Wrapped personal access token
12153 */
12154
12155
12156function wrapPersonalAccessToken(http, data) {
12157 const personalAccessToken = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
12158 const personalAccessTokenWithMethods = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(personalAccessToken, createPersonalAccessToken(http));
12159 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(personalAccessTokenWithMethods);
12160}
12161/**
12162 * @private
12163 * @param http - HTTP client instance
12164 * @param data - Raw personal access collection data
12165 * @return Wrapped personal access token collection data
12166 */
12167
12168const wrapPersonalAccessTokenCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_4__["wrapCollection"])(wrapPersonalAccessToken);
12169
12170/***/ }),
12171
12172/***/ "./entities/preview-api-key.ts":
12173/*!*************************************!*\
12174 !*** ./entities/preview-api-key.ts ***!
12175 \*************************************/
12176/*! exports provided: wrapPreviewApiKey, wrapPreviewApiKeyCollection */
12177/***/ (function(module, __webpack_exports__, __webpack_require__) {
12178
12179"use strict";
12180__webpack_require__.r(__webpack_exports__);
12181/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapPreviewApiKey", function() { return wrapPreviewApiKey; });
12182/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapPreviewApiKeyCollection", function() { return wrapPreviewApiKeyCollection; });
12183/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
12184/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
12185/* 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");
12186/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
12187/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
12188
12189
12190
12191
12192
12193function createPreviewApiKeyApi() {
12194 return {};
12195}
12196/**
12197 * @private
12198 * @param http - HTTP client instance
12199 * @param data - Raw api key data
12200 * @return Wrapped preview api key data
12201 */
12202
12203
12204function wrapPreviewApiKey(_http, data) {
12205 const previewApiKey = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
12206 const previewApiKeyWithMethods = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(previewApiKey, createPreviewApiKeyApi());
12207 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(previewApiKeyWithMethods);
12208}
12209/**
12210 * @private
12211 */
12212
12213const wrapPreviewApiKeyCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_3__["wrapCollection"])(wrapPreviewApiKey);
12214
12215/***/ }),
12216
12217/***/ "./entities/role.ts":
12218/*!**************************!*\
12219 !*** ./entities/role.ts ***!
12220 \**************************/
12221/*! exports provided: wrapRole, wrapRoleCollection */
12222/***/ (function(module, __webpack_exports__, __webpack_require__) {
12223
12224"use strict";
12225__webpack_require__.r(__webpack_exports__);
12226/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapRole", function() { return wrapRole; });
12227/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapRoleCollection", function() { return wrapRoleCollection; });
12228/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
12229/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
12230/* 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");
12231/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
12232/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
12233/* harmony import */ var _instance_actions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../instance-actions */ "./instance-actions.ts");
12234
12235
12236
12237
12238
12239
12240function createRoleApi(http) {
12241 return {
12242 update: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createUpdateEntity"])({
12243 http: http,
12244 entityPath: 'roles',
12245 wrapperMethod: wrapRole
12246 }),
12247 delete: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createDeleteEntity"])({
12248 http: http,
12249 entityPath: 'roles'
12250 })
12251 };
12252}
12253/**
12254 * @private
12255 * @param http - HTTP client instance
12256 * @param data - Raw role data
12257 * @return Wrapped role data
12258 */
12259
12260
12261function wrapRole(http, data) {
12262 const role = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
12263 const roleWithMethods = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(role, createRoleApi(http));
12264 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(roleWithMethods);
12265}
12266/**
12267 * @private
12268 */
12269
12270const wrapRoleCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_3__["wrapCollection"])(wrapRole);
12271
12272/***/ }),
12273
12274/***/ "./entities/snapshot.ts":
12275/*!******************************!*\
12276 !*** ./entities/snapshot.ts ***!
12277 \******************************/
12278/*! exports provided: wrapSnapshot, wrapSnapshotCollection */
12279/***/ (function(module, __webpack_exports__, __webpack_require__) {
12280
12281"use strict";
12282__webpack_require__.r(__webpack_exports__);
12283/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapSnapshot", function() { return wrapSnapshot; });
12284/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapSnapshotCollection", function() { return wrapSnapshotCollection; });
12285/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
12286/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
12287/* 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");
12288/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
12289/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
12290
12291
12292
12293
12294
12295function createSnapshotApi() {
12296 return {
12297 /* In case the snapshot object evolve later */
12298 };
12299}
12300/**
12301 * @private
12302 * @param http - HTTP client instance
12303 * @param data - Raw snapshot data
12304 * @return Wrapped snapshot data
12305 */
12306
12307
12308function wrapSnapshot(_http, data) {
12309 const snapshot = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
12310 const snapshotWithMethods = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(snapshot, createSnapshotApi());
12311 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(snapshotWithMethods);
12312}
12313/**
12314 * @private
12315 * @param http - HTTP client instance
12316 * @param data - Raw snapshot collection data
12317 * @return Wrapped snapshot collection data
12318 */
12319
12320const wrapSnapshotCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_3__["wrapCollection"])(wrapSnapshot);
12321
12322/***/ }),
12323
12324/***/ "./entities/space-member.ts":
12325/*!**********************************!*\
12326 !*** ./entities/space-member.ts ***!
12327 \**********************************/
12328/*! exports provided: wrapSpaceMember, wrapSpaceMemberCollection */
12329/***/ (function(module, __webpack_exports__, __webpack_require__) {
12330
12331"use strict";
12332__webpack_require__.r(__webpack_exports__);
12333/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapSpaceMember", function() { return wrapSpaceMember; });
12334/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapSpaceMemberCollection", function() { return wrapSpaceMemberCollection; });
12335/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
12336/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
12337/* 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");
12338/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
12339
12340
12341
12342
12343/**
12344 * @private
12345 * @param http - HTTP client instance
12346 * @param data - Raw space member data
12347 * @return Wrapped space member data
12348 */
12349function wrapSpaceMember(http, data) {
12350 const spaceMember = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
12351 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(spaceMember);
12352}
12353/**
12354 * @private
12355 */
12356
12357const wrapSpaceMemberCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_2__["wrapCollection"])(wrapSpaceMember);
12358
12359/***/ }),
12360
12361/***/ "./entities/space-membership.ts":
12362/*!**************************************!*\
12363 !*** ./entities/space-membership.ts ***!
12364 \**************************************/
12365/*! exports provided: wrapSpaceMembership, wrapSpaceMembershipCollection */
12366/***/ (function(module, __webpack_exports__, __webpack_require__) {
12367
12368"use strict";
12369__webpack_require__.r(__webpack_exports__);
12370/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapSpaceMembership", function() { return wrapSpaceMembership; });
12371/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapSpaceMembershipCollection", function() { return wrapSpaceMembershipCollection; });
12372/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
12373/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
12374/* 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");
12375/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
12376/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
12377/* harmony import */ var _instance_actions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../instance-actions */ "./instance-actions.ts");
12378
12379
12380
12381
12382
12383
12384function createSpaceMembershipApi(http) {
12385 return {
12386 update: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createUpdateEntity"])({
12387 http: http,
12388 entityPath: 'space_memberships',
12389 wrapperMethod: wrapSpaceMembership
12390 }),
12391 delete: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createDeleteEntity"])({
12392 http: http,
12393 entityPath: 'space_memberships'
12394 })
12395 };
12396}
12397/**
12398 * @private
12399 * @param http - HTTP client instance
12400 * @param data - Raw space membership data
12401 * @return Wrapped space membership data
12402 */
12403
12404
12405function wrapSpaceMembership(http, data) {
12406 const spaceMembership = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
12407 const spaceMembershipWithMethods = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(spaceMembership, createSpaceMembershipApi(http));
12408 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(spaceMembershipWithMethods);
12409}
12410/**
12411 * @private
12412 */
12413
12414const wrapSpaceMembershipCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_3__["wrapCollection"])(wrapSpaceMembership);
12415
12416/***/ }),
12417
12418/***/ "./entities/space.ts":
12419/*!***************************!*\
12420 !*** ./entities/space.ts ***!
12421 \***************************/
12422/*! exports provided: wrapSpace, wrapSpaceCollection */
12423/***/ (function(module, __webpack_exports__, __webpack_require__) {
12424
12425"use strict";
12426__webpack_require__.r(__webpack_exports__);
12427/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapSpace", function() { return wrapSpace; });
12428/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapSpaceCollection", function() { return wrapSpaceCollection; });
12429/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
12430/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
12431/* 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");
12432/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
12433/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
12434/* harmony import */ var _create_space_api__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../create-space-api */ "./create-space-api.ts");
12435
12436
12437
12438
12439
12440
12441/**
12442 * This method creates the API for the given space with all the methods for
12443 * reading and creating other entities. It also passes down a clone of the
12444 * http client with a space id, so the base path for requests now has the
12445 * space id already set.
12446 * @private
12447 * @param http - HTTP client instance
12448 * @param data - API response for a Space
12449 * @return {Space}
12450 */
12451function wrapSpace(http, data) {
12452 const sdkHttp = http;
12453 const space = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
12454 const _sdkHttp$httpClientPa = sdkHttp.httpClientParams,
12455 hostUpload = _sdkHttp$httpClientPa.hostUpload,
12456 defaultHostnameUpload = _sdkHttp$httpClientPa.defaultHostnameUpload;
12457 const spaceScopedHttpClient = sdkHttp.cloneWithNewParams({
12458 space: space.sys.id
12459 });
12460 const spaceScopedUploadClient = sdkHttp.cloneWithNewParams({
12461 space: space.sys.id,
12462 host: hostUpload || defaultHostnameUpload
12463 });
12464 const spaceApi = Object(_create_space_api__WEBPACK_IMPORTED_MODULE_4__["default"])({
12465 http: spaceScopedHttpClient,
12466 httpUpload: spaceScopedUploadClient
12467 });
12468 const enhancedSpace = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(space, spaceApi);
12469 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(enhancedSpace);
12470}
12471/**
12472 * This method wraps each space in a collection with the space API. See wrapSpace
12473 * above for more details.
12474 * @private
12475 */
12476
12477const wrapSpaceCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_3__["wrapCollection"])(wrapSpace);
12478
12479/***/ }),
12480
12481/***/ "./entities/team-membership.ts":
12482/*!*************************************!*\
12483 !*** ./entities/team-membership.ts ***!
12484 \*************************************/
12485/*! exports provided: wrapTeamMembership, wrapTeamMembershipCollection */
12486/***/ (function(module, __webpack_exports__, __webpack_require__) {
12487
12488"use strict";
12489__webpack_require__.r(__webpack_exports__);
12490/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapTeamMembership", function() { return wrapTeamMembership; });
12491/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapTeamMembershipCollection", function() { return wrapTeamMembershipCollection; });
12492/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
12493/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
12494/* 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");
12495/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
12496/* harmony import */ var _error_handler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../error-handler */ "./error-handler.ts");
12497/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
12498
12499
12500
12501
12502
12503
12504function createTeamMembershipApi(http) {
12505 return {
12506 update: function update() {
12507 const raw = this.toPlainObject();
12508 const teamId = raw.sys.team.sys.id;
12509 return http.put('teams/' + teamId + '/team_memberships/' + this.sys.id, raw, {
12510 headers: {
12511 'X-Contentful-Version': this.sys.version || 0
12512 }
12513 }).then(response => wrapTeamMembership(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_3__["default"]);
12514 },
12515 delete: function _delete() {
12516 const raw = this.toPlainObject();
12517 const teamId = raw.sys.team.sys.id;
12518 return http.delete('teams/' + teamId + '/team_memberships/' + this.sys.id).then(() => {// do nothing
12519 }, _error_handler__WEBPACK_IMPORTED_MODULE_3__["default"]);
12520 }
12521 };
12522}
12523/**
12524 * @private
12525 * @param http - HTTP client instance
12526 * @param data - Raw team membership data
12527 * @return Wrapped team membership data
12528 */
12529
12530
12531function wrapTeamMembership(http, data) {
12532 const teamMembership = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
12533 const teamMembershipWithMethods = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(teamMembership, createTeamMembershipApi(http));
12534 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(teamMembershipWithMethods);
12535}
12536/**
12537 * @private
12538 */
12539
12540const wrapTeamMembershipCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_4__["wrapCollection"])(wrapTeamMembership);
12541
12542/***/ }),
12543
12544/***/ "./entities/team-space-membership.ts":
12545/*!*******************************************!*\
12546 !*** ./entities/team-space-membership.ts ***!
12547 \*******************************************/
12548/*! exports provided: wrapTeamSpaceMembership, wrapTeamSpaceMembershipCollection */
12549/***/ (function(module, __webpack_exports__, __webpack_require__) {
12550
12551"use strict";
12552__webpack_require__.r(__webpack_exports__);
12553/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapTeamSpaceMembership", function() { return wrapTeamSpaceMembership; });
12554/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapTeamSpaceMembershipCollection", function() { return wrapTeamSpaceMembershipCollection; });
12555/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
12556/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
12557/* 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");
12558/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
12559/* harmony import */ var _instance_actions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../instance-actions */ "./instance-actions.ts");
12560/* harmony import */ var _error_handler__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../error-handler */ "./error-handler.ts");
12561/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
12562
12563
12564
12565
12566
12567
12568
12569function createTeamSpaceMembershipApi(http) {
12570 return {
12571 update: function update() {
12572 const raw = this.toPlainObject();
12573 const data = lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(raw);
12574 delete data.sys;
12575 return http.put('team_space_memberships/' + this.sys.id, data, {
12576 headers: {
12577 'X-Contentful-Version': this.sys.version || 0,
12578 'x-contentful-team': this.sys.team.sys.id
12579 }
12580 }).then(response => wrapTeamSpaceMembership(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_4__["default"]);
12581 },
12582 delete: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_3__["createDeleteEntity"])({
12583 http: http,
12584 entityPath: 'team_space_memberships'
12585 })
12586 };
12587}
12588/**
12589 * @private
12590 * @param http - HTTP client instance
12591 * @param data - Raw space membership data
12592 * @return Wrapped team space membership data
12593 */
12594
12595
12596function wrapTeamSpaceMembership(http, data) {
12597 const teamSpaceMembership = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
12598 const teamSpaceMembershipWithMethods = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(teamSpaceMembership, createTeamSpaceMembershipApi(http));
12599 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(teamSpaceMembershipWithMethods);
12600}
12601/**
12602 * @private
12603 */
12604
12605const wrapTeamSpaceMembershipCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_5__["wrapCollection"])(wrapTeamSpaceMembership);
12606
12607/***/ }),
12608
12609/***/ "./entities/team.ts":
12610/*!**************************!*\
12611 !*** ./entities/team.ts ***!
12612 \**************************/
12613/*! exports provided: wrapTeam, wrapTeamCollection */
12614/***/ (function(module, __webpack_exports__, __webpack_require__) {
12615
12616"use strict";
12617__webpack_require__.r(__webpack_exports__);
12618/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapTeam", function() { return wrapTeam; });
12619/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapTeamCollection", function() { return wrapTeamCollection; });
12620/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
12621/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
12622/* 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");
12623/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
12624/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
12625/* harmony import */ var _instance_actions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../instance-actions */ "./instance-actions.ts");
12626
12627
12628
12629
12630
12631const entityPath = 'teams';
12632/**
12633 * @private
12634 */
12635
12636function createTeamApi(http) {
12637 return {
12638 update: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createUpdateEntity"])({
12639 http,
12640 entityPath,
12641 wrapperMethod: wrapTeam
12642 }),
12643 delete: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createDeleteEntity"])({
12644 http,
12645 entityPath
12646 })
12647 };
12648}
12649/**
12650 * @private
12651 * @param http - HTTP client instance
12652 * @param data - Raw team data
12653 * @return Wrapped team data
12654 */
12655
12656
12657function wrapTeam(http, data) {
12658 const team = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
12659 const teamWithMethods = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(team, createTeamApi(http));
12660 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(teamWithMethods);
12661}
12662/**
12663 * @private
12664 */
12665
12666const wrapTeamCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_3__["wrapCollection"])(wrapTeam);
12667
12668/***/ }),
12669
12670/***/ "./entities/ui-extension.ts":
12671/*!**********************************!*\
12672 !*** ./entities/ui-extension.ts ***!
12673 \**********************************/
12674/*! exports provided: wrapUiExtension, wrapUiExtensionCollection */
12675/***/ (function(module, __webpack_exports__, __webpack_require__) {
12676
12677"use strict";
12678__webpack_require__.r(__webpack_exports__);
12679/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapUiExtension", function() { return wrapUiExtension; });
12680/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapUiExtensionCollection", function() { return wrapUiExtensionCollection; });
12681/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
12682/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
12683/* 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");
12684/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
12685/* harmony import */ var _instance_actions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../instance-actions */ "./instance-actions.ts");
12686/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
12687
12688
12689
12690
12691
12692
12693function createUiExtensionApi(http) {
12694 return {
12695 update: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_3__["createUpdateEntity"])({
12696 http: http,
12697 entityPath: 'extensions',
12698 wrapperMethod: wrapUiExtension
12699 }),
12700 delete: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_3__["createDeleteEntity"])({
12701 http: http,
12702 entityPath: 'extensions'
12703 })
12704 };
12705}
12706/**
12707 * @private
12708 * @param http - HTTP client instance
12709 * @param data - Raw UI Extension data
12710 * @return Wrapped UI Extension data
12711 */
12712
12713
12714function wrapUiExtension(http, data) {
12715 const uiExtension = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
12716 const uiExtensionWithMethods = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(uiExtension, createUiExtensionApi(http));
12717 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(uiExtensionWithMethods);
12718}
12719/**
12720 * @private
12721 */
12722
12723const wrapUiExtensionCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_4__["wrapCollection"])(wrapUiExtension);
12724
12725/***/ }),
12726
12727/***/ "./entities/upload.ts":
12728/*!****************************!*\
12729 !*** ./entities/upload.ts ***!
12730 \****************************/
12731/*! exports provided: wrapUpload */
12732/***/ (function(module, __webpack_exports__, __webpack_require__) {
12733
12734"use strict";
12735__webpack_require__.r(__webpack_exports__);
12736/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapUpload", function() { return wrapUpload; });
12737/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
12738/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
12739/* 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");
12740/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
12741/* harmony import */ var _instance_actions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../instance-actions */ "./instance-actions.ts");
12742
12743
12744
12745
12746
12747function createUploadApi(http) {
12748 return {
12749 delete: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_3__["createDeleteEntity"])({
12750 http: http,
12751 entityPath: 'uploads'
12752 })
12753 };
12754}
12755/**
12756 * @private
12757 * @param {Object} http - HTTP client instance
12758 * @param {Object} data - Raw upload data
12759 * @return {Upload} Wrapped upload data
12760 */
12761
12762
12763function wrapUpload(http, data) {
12764 const upload = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
12765 const uploadWithMethods = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(upload, createUploadApi(http));
12766 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(uploadWithMethods);
12767}
12768
12769/***/ }),
12770
12771/***/ "./entities/usage.ts":
12772/*!***************************!*\
12773 !*** ./entities/usage.ts ***!
12774 \***************************/
12775/*! exports provided: wrapUsage, wrapUsageCollection */
12776/***/ (function(module, __webpack_exports__, __webpack_require__) {
12777
12778"use strict";
12779__webpack_require__.r(__webpack_exports__);
12780/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapUsage", function() { return wrapUsage; });
12781/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapUsageCollection", function() { return wrapUsageCollection; });
12782/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
12783/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
12784/* 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");
12785/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
12786/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
12787
12788
12789
12790
12791
12792/**
12793 * @private
12794 * @param http - HTTP client instance
12795 * @param data - Raw data
12796 * @return Normalized usage
12797 */
12798function wrapUsage(http, data) {
12799 const usage = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
12800 const usageWithMethods = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(usage, {});
12801 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(usageWithMethods);
12802}
12803/**
12804 * @private
12805 */
12806
12807const wrapUsageCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_3__["wrapCollection"])(wrapUsage);
12808
12809/***/ }),
12810
12811/***/ "./entities/user.ts":
12812/*!**************************!*\
12813 !*** ./entities/user.ts ***!
12814 \**************************/
12815/*! exports provided: wrapUser, wrapUserCollection */
12816/***/ (function(module, __webpack_exports__, __webpack_require__) {
12817
12818"use strict";
12819__webpack_require__.r(__webpack_exports__);
12820/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapUser", function() { return wrapUser; });
12821/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapUserCollection", function() { return wrapUserCollection; });
12822/* 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");
12823/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
12824/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_1__);
12825/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
12826/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
12827
12828
12829
12830
12831
12832/**
12833 * @private
12834 * @param http - HTTP client instance
12835 * @param data - Raw data
12836 * @return Normalized user
12837 */
12838function wrapUser(http, data) {
12839 const user = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_1___default()(data));
12840 const userWithMethods = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(user, {});
12841 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["freezeSys"])(userWithMethods);
12842}
12843/**
12844 * @private
12845 * @param http - HTTP client instance
12846 * @param data - Raw data collection
12847 * @return Normalized user collection
12848 */
12849
12850const wrapUserCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_3__["wrapCollection"])(wrapUser);
12851
12852/***/ }),
12853
12854/***/ "./entities/webhook.ts":
12855/*!*****************************!*\
12856 !*** ./entities/webhook.ts ***!
12857 \*****************************/
12858/*! exports provided: wrapWebhook, wrapWebhookCollection */
12859/***/ (function(module, __webpack_exports__, __webpack_require__) {
12860
12861"use strict";
12862__webpack_require__.r(__webpack_exports__);
12863/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapWebhook", function() { return wrapWebhook; });
12864/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapWebhookCollection", function() { return wrapWebhookCollection; });
12865/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
12866/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
12867/* 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");
12868/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
12869/* harmony import */ var _error_handler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../error-handler */ "./error-handler.ts");
12870/* harmony import */ var _instance_actions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../instance-actions */ "./instance-actions.ts");
12871/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
12872
12873
12874
12875
12876
12877
12878const entityPath = 'webhook_definitions';
12879
12880function createWebhookApi(http) {
12881 return {
12882 update: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createUpdateEntity"])({
12883 http,
12884 entityPath,
12885 wrapperMethod: wrapWebhook
12886 }),
12887 delete: Object(_instance_actions__WEBPACK_IMPORTED_MODULE_4__["createDeleteEntity"])({
12888 http,
12889 entityPath
12890 }),
12891 getCalls: function getCalls() {
12892 return http.get('webhooks/' + this.sys.id + '/calls').then(response => response.data, _error_handler__WEBPACK_IMPORTED_MODULE_3__["default"]);
12893 },
12894 getCall: function getCall(id) {
12895 return http.get('webhooks/' + this.sys.id + '/calls/' + id).then(response => response.data, _error_handler__WEBPACK_IMPORTED_MODULE_3__["default"]);
12896 },
12897 getHealth: function getHealth() {
12898 return http.get('webhooks/' + this.sys.id + '/health').then(response => response.data, _error_handler__WEBPACK_IMPORTED_MODULE_3__["default"]);
12899 }
12900 };
12901}
12902/**
12903 * @private
12904 * @param http - HTTP client instance
12905 * @param data - Raw webhook data
12906 * @return Wrapped webhook data
12907 */
12908
12909
12910function wrapWebhook(http, data) {
12911 const webhook = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(data));
12912 const webhookWithMethods = Object(_enhance_with_methods__WEBPACK_IMPORTED_MODULE_2__["default"])(webhook, createWebhookApi(http));
12913 return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(webhookWithMethods);
12914}
12915/**
12916 * @private
12917 */
12918
12919const wrapWebhookCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_5__["wrapCollection"])(wrapWebhook);
12920
12921/***/ }),
12922
12923/***/ "./error-handler.ts":
12924/*!**************************!*\
12925 !*** ./error-handler.ts ***!
12926 \**************************/
12927/*! exports provided: default */
12928/***/ (function(module, __webpack_exports__, __webpack_require__) {
12929
12930"use strict";
12931__webpack_require__.r(__webpack_exports__);
12932/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return errorHandler; });
12933/* harmony import */ var lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/isPlainObject */ "../node_modules/lodash/isPlainObject.js");
12934/* harmony import */ var lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0__);
12935
12936
12937/**
12938 * Handles errors received from the server. Parses the error into a more useful
12939 * format, places it in an exception and throws it.
12940 * See https://www.contentful.com/developers/docs/references/errors/
12941 * for more details on the data received on the errorResponse.data property
12942 * and the expected error codes.
12943 * @private
12944 */
12945function errorHandler(errorResponse) {
12946 const config = errorResponse.config,
12947 response = errorResponse.response;
12948 let errorName; // Obscure the Management token
12949
12950 if (config.headers && config.headers['Authorization']) {
12951 const token = `...${config.headers['Authorization'].substr(-5)}`;
12952 config.headers['Authorization'] = `Bearer ${token}`;
12953 }
12954
12955 if (!lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0___default()(response) || !lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0___default()(config)) {
12956 throw errorResponse;
12957 }
12958
12959 const data = response === null || response === void 0 ? void 0 : response.data;
12960 const errorData = {
12961 status: response === null || response === void 0 ? void 0 : response.status,
12962 statusText: response === null || response === void 0 ? void 0 : response.statusText,
12963 message: '',
12964 details: {}
12965 };
12966
12967 if (lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0___default()(config)) {
12968 errorData.request = {
12969 url: config.url,
12970 headers: config.headers,
12971 method: config.method,
12972 payloadData: config.data
12973 };
12974 }
12975
12976 if (data && lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0___default()(data)) {
12977 if ('requestId' in data) {
12978 errorData.requestId = data.requestId || 'UNKNOWN';
12979 }
12980
12981 if ('message' in data) {
12982 errorData.message = data.message || '';
12983 }
12984
12985 if ('details' in data) {
12986 errorData.details = data.details || {};
12987 }
12988
12989 if ('sys' in data) {
12990 if ('id' in data.sys) {
12991 errorName = data.sys.id;
12992 }
12993 }
12994 }
12995
12996 const error = new Error();
12997 error.name = errorName && errorName !== 'Unknown' ? errorName : `${response === null || response === void 0 ? void 0 : response.status} ${response === null || response === void 0 ? void 0 : response.statusText}`;
12998 error.message = JSON.stringify(errorData, null, ' ');
12999 throw error;
13000}
13001
13002/***/ }),
13003
13004/***/ "./instance-actions.ts":
13005/*!*****************************!*\
13006 !*** ./instance-actions.ts ***!
13007 \*****************************/
13008/*! exports provided: createUpdateEntity, createDeleteEntity, createPublishEntity, createUnpublishEntity, createArchiveEntity, createUnarchiveEntity, createPublishedChecker, createUpdatedChecker, createDraftChecker, createArchivedChecker */
13009/***/ (function(module, __webpack_exports__, __webpack_require__) {
13010
13011"use strict";
13012__webpack_require__.r(__webpack_exports__);
13013/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createUpdateEntity", function() { return createUpdateEntity; });
13014/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createDeleteEntity", function() { return createDeleteEntity; });
13015/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createPublishEntity", function() { return createPublishEntity; });
13016/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createUnpublishEntity", function() { return createUnpublishEntity; });
13017/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createArchiveEntity", function() { return createArchiveEntity; });
13018/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createUnarchiveEntity", function() { return createUnarchiveEntity; });
13019/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createPublishedChecker", function() { return createPublishedChecker; });
13020/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createUpdatedChecker", function() { return createUpdatedChecker; });
13021/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createDraftChecker", function() { return createDraftChecker; });
13022/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createArchivedChecker", function() { return createArchivedChecker; });
13023/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/cloneDeep */ "../node_modules/lodash/cloneDeep.js");
13024/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0__);
13025/* harmony import */ var _error_handler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./error-handler */ "./error-handler.ts");
13026function 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; }
13027
13028function _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; }
13029
13030function _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; }
13031
13032
13033
13034
13035/**
13036 * @private
13037 */
13038function createUpdateEntity({
13039 http,
13040 entityPath,
13041 wrapperMethod,
13042 headers
13043}) {
13044 return function () {
13045 const self = this;
13046 const raw = self.toPlainObject();
13047 const data = lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_0___default()(raw);
13048 delete data.sys;
13049 return http.put(entityPath + '/' + self.sys.id, data, {
13050 headers: _objectSpread({
13051 'X-Contentful-Version': self.sys.version || 0
13052 }, headers)
13053 }).then(response => wrapperMethod(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_1__["default"]);
13054 };
13055}
13056/**
13057 * @private
13058 */
13059
13060function createDeleteEntity({
13061 http,
13062 entityPath
13063}) {
13064 return function () {
13065 const self = this;
13066 return http.delete(entityPath + '/' + self.sys.id).then(() => {// do nothing
13067 }, _error_handler__WEBPACK_IMPORTED_MODULE_1__["default"]);
13068 };
13069}
13070/**
13071 * @private
13072 */
13073
13074function createPublishEntity({
13075 http,
13076 entityPath,
13077 wrapperMethod
13078}) {
13079 return function () {
13080 const self = this;
13081 return http.put(entityPath + '/' + self.sys.id + '/published', null, {
13082 headers: {
13083 'X-Contentful-Version': self.sys.version
13084 }
13085 }).then(response => wrapperMethod(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_1__["default"]);
13086 };
13087}
13088/**
13089 * @private
13090 */
13091
13092function createUnpublishEntity({
13093 http,
13094 entityPath,
13095 wrapperMethod
13096}) {
13097 return function () {
13098 const self = this;
13099 return http.delete(entityPath + '/' + self.sys.id + '/published').then(response => wrapperMethod(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_1__["default"]);
13100 };
13101}
13102/**
13103 * @private
13104 */
13105
13106function createArchiveEntity({
13107 http,
13108 entityPath,
13109 wrapperMethod
13110}) {
13111 return function () {
13112 const self = this;
13113 return http.put(entityPath + '/' + self.sys.id + '/archived').then(response => wrapperMethod(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_1__["default"]);
13114 };
13115}
13116/**
13117 * @private
13118 */
13119
13120function createUnarchiveEntity({
13121 http,
13122 entityPath,
13123 wrapperMethod
13124}) {
13125 return function () {
13126 const self = this;
13127 return http.delete(entityPath + '/' + self.sys.id + '/archived').then(response => wrapperMethod(http, response.data), _error_handler__WEBPACK_IMPORTED_MODULE_1__["default"]);
13128 };
13129}
13130/**
13131 * @private
13132 */
13133
13134function createPublishedChecker() {
13135 return function () {
13136 const self = this;
13137 return !!self.sys.publishedVersion;
13138 };
13139}
13140/**
13141 * @private
13142 */
13143
13144function createUpdatedChecker() {
13145 return function () {
13146 const self = this; // The act of publishing an entity increases its version by 1, so any entry which has
13147 // 2 versions higher or more than the publishedVersion has unpublished changes.
13148
13149 return !!(self.sys.publishedVersion && self.sys.version > self.sys.publishedVersion + 1);
13150 };
13151}
13152/**
13153 * @private
13154 */
13155
13156function createDraftChecker() {
13157 return function () {
13158 const self = this;
13159 return !self.sys.publishedVersion;
13160 };
13161}
13162/**
13163 * @private
13164 */
13165
13166function createArchivedChecker() {
13167 return function () {
13168 const self = this;
13169 return !!self.sys.archivedVersion;
13170 };
13171}
13172
13173/***/ }),
13174
13175/***/ 0:
13176/*!****************************************!*\
13177 !*** multi ./contentful-management.ts ***!
13178 \****************************************/
13179/*! no static exports found */
13180/***/ (function(module, exports, __webpack_require__) {
13181
13182module.exports = __webpack_require__(/*! ./contentful-management.ts */"./contentful-management.ts");
13183
13184
13185/***/ }),
13186
13187/***/ "assert":
13188/*!*************************!*\
13189 !*** external "assert" ***!
13190 \*************************/
13191/*! no static exports found */
13192/***/ (function(module, exports) {
13193
13194module.exports = require("assert");
13195
13196/***/ }),
13197
13198/***/ "http":
13199/*!***********************!*\
13200 !*** external "http" ***!
13201 \***********************/
13202/*! no static exports found */
13203/***/ (function(module, exports) {
13204
13205module.exports = require("http");
13206
13207/***/ }),
13208
13209/***/ "https":
13210/*!************************!*\
13211 !*** external "https" ***!
13212 \************************/
13213/*! no static exports found */
13214/***/ (function(module, exports) {
13215
13216module.exports = require("https");
13217
13218/***/ }),
13219
13220/***/ "os":
13221/*!*********************!*\
13222 !*** external "os" ***!
13223 \*********************/
13224/*! no static exports found */
13225/***/ (function(module, exports) {
13226
13227module.exports = require("os");
13228
13229/***/ }),
13230
13231/***/ "stream":
13232/*!*************************!*\
13233 !*** external "stream" ***!
13234 \*************************/
13235/*! no static exports found */
13236/***/ (function(module, exports) {
13237
13238module.exports = require("stream");
13239
13240/***/ }),
13241
13242/***/ "tty":
13243/*!**********************!*\
13244 !*** external "tty" ***!
13245 \**********************/
13246/*! no static exports found */
13247/***/ (function(module, exports) {
13248
13249module.exports = require("tty");
13250
13251/***/ }),
13252
13253/***/ "url":
13254/*!**********************!*\
13255 !*** external "url" ***!
13256 \**********************/
13257/*! no static exports found */
13258/***/ (function(module, exports) {
13259
13260module.exports = require("url");
13261
13262/***/ }),
13263
13264/***/ "util":
13265/*!***********************!*\
13266 !*** external "util" ***!
13267 \***********************/
13268/*! no static exports found */
13269/***/ (function(module, exports) {
13270
13271module.exports = require("util");
13272
13273/***/ }),
13274
13275/***/ "zlib":
13276/*!***********************!*\
13277 !*** external "zlib" ***!
13278 \***********************/
13279/*! no static exports found */
13280/***/ (function(module, exports) {
13281
13282module.exports = require("zlib");
13283
13284/***/ })
13285
13286/******/ });
13287//# sourceMappingURL=contentful-management.node.js.map
\No newline at end of file