contentful-management 11.56.0 → 11.57.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5089,6 +5089,8 @@ __webpack_require__.r(__webpack_exports__);
5089
5089
 
5090
5090
  /** Base interface for all Payload interfaces. Used as part of the MakeRequestOptions to simplify payload definitions. */
5091
5091
 
5092
+ // Retry options used by createWithResponse and createWithResult. Kept separate for clarity.
5093
+
5092
5094
  // New route params for fetching structured call or raw response
5093
5095
 
5094
5096
  var ScheduledActionReferenceFilters = /*#__PURE__*/function (ScheduledActionReferenceFilters) {
@@ -23230,7 +23232,9 @@ __webpack_require__.r(__webpack_exports__);
23230
23232
  const knownAdapters = {
23231
23233
  http: _http_js__WEBPACK_IMPORTED_MODULE_0__["default"],
23232
23234
  xhr: _xhr_js__WEBPACK_IMPORTED_MODULE_1__["default"],
23233
- fetch: _fetch_js__WEBPACK_IMPORTED_MODULE_2__["default"]
23235
+ fetch: {
23236
+ get: _fetch_js__WEBPACK_IMPORTED_MODULE_2__.getFetch,
23237
+ }
23234
23238
  }
23235
23239
 
23236
23240
  _utils_js__WEBPACK_IMPORTED_MODULE_3__["default"].forEach(knownAdapters, (fn, value) => {
@@ -23249,7 +23253,7 @@ const renderReason = (reason) => `- ${reason}`;
23249
23253
  const isResolvedHandle = (adapter) => _utils_js__WEBPACK_IMPORTED_MODULE_3__["default"].isFunction(adapter) || adapter === null || adapter === false;
23250
23254
 
23251
23255
  /* harmony default export */ __webpack_exports__["default"] = ({
23252
- getAdapter: (adapters) => {
23256
+ getAdapter: (adapters, config) => {
23253
23257
  adapters = _utils_js__WEBPACK_IMPORTED_MODULE_3__["default"].isArray(adapters) ? adapters : [adapters];
23254
23258
 
23255
23259
  const {length} = adapters;
@@ -23272,7 +23276,7 @@ const isResolvedHandle = (adapter) => _utils_js__WEBPACK_IMPORTED_MODULE_3__["de
23272
23276
  }
23273
23277
  }
23274
23278
 
23275
- if (adapter) {
23279
+ if (adapter && (_utils_js__WEBPACK_IMPORTED_MODULE_3__["default"].isFunction(adapter) || (adapter = adapter.get(config)))) {
23276
23280
  break;
23277
23281
  }
23278
23282
 
@@ -23312,8 +23316,11 @@ const isResolvedHandle = (adapter) => _utils_js__WEBPACK_IMPORTED_MODULE_3__["de
23312
23316
 
23313
23317
  "use strict";
23314
23318
  __webpack_require__.r(__webpack_exports__);
23315
- /* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../platform/index.js */ "../node_modules/axios/lib/platform/index.js");
23316
- /* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils.js */ "../node_modules/axios/lib/utils.js");
23319
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
23320
+ /* harmony export */ getFetch: function() { return /* binding */ getFetch; }
23321
+ /* harmony export */ });
23322
+ /* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../platform/index.js */ "../node_modules/axios/lib/platform/index.js");
23323
+ /* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "../node_modules/axios/lib/utils.js");
23317
23324
  /* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../core/AxiosError.js */ "../node_modules/axios/lib/core/AxiosError.js");
23318
23325
  /* harmony import */ var _helpers_composeSignals_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../helpers/composeSignals.js */ "../node_modules/axios/lib/helpers/composeSignals.js");
23319
23326
  /* harmony import */ var _helpers_trackStream_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../helpers/trackStream.js */ "../node_modules/axios/lib/helpers/trackStream.js");
@@ -23331,14 +23338,18 @@ __webpack_require__.r(__webpack_exports__);
23331
23338
 
23332
23339
 
23333
23340
 
23334
- const isFetchSupported = typeof fetch === 'function' && typeof Request === 'function' && typeof Response === 'function';
23335
- const isReadableStreamSupported = isFetchSupported && typeof ReadableStream === 'function';
23341
+ const DEFAULT_CHUNK_SIZE = 64 * 1024;
23342
+
23343
+ const {isFunction} = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"];
23344
+
23345
+ const globalFetchAPI = (({fetch, Request, Response}) => ({
23346
+ fetch, Request, Response
23347
+ }))(_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].global);
23348
+
23349
+ const {
23350
+ ReadableStream, TextEncoder
23351
+ } = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].global;
23336
23352
 
23337
- // used only inside the fetch adapter
23338
- const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?
23339
- ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :
23340
- async (str) => new Uint8Array(await new Response(str).arrayBuffer())
23341
- );
23342
23353
 
23343
23354
  const test = (fn, ...args) => {
23344
23355
  try {
@@ -23348,208 +23359,261 @@ const test = (fn, ...args) => {
23348
23359
  }
23349
23360
  }
23350
23361
 
23351
- const supportsRequestStream = isReadableStreamSupported && test(() => {
23352
- let duplexAccessed = false;
23362
+ const factory = (env) => {
23363
+ const {fetch, Request, Response} = Object.assign({}, globalFetchAPI, env);
23364
+ const isFetchSupported = isFunction(fetch);
23365
+ const isRequestSupported = isFunction(Request);
23366
+ const isResponseSupported = isFunction(Response);
23353
23367
 
23354
- const hasContentType = new Request(_platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].origin, {
23355
- body: new ReadableStream(),
23356
- method: 'POST',
23357
- get duplex() {
23358
- duplexAccessed = true;
23359
- return 'half';
23360
- },
23361
- }).headers.has('Content-Type');
23368
+ if (!isFetchSupported) {
23369
+ return false;
23370
+ }
23362
23371
 
23363
- return duplexAccessed && !hasContentType;
23364
- });
23372
+ const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream);
23365
23373
 
23366
- const DEFAULT_CHUNK_SIZE = 64 * 1024;
23374
+ const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?
23375
+ ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :
23376
+ async (str) => new Uint8Array(await new Request(str).arrayBuffer())
23377
+ );
23378
+
23379
+ const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
23380
+ let duplexAccessed = false;
23367
23381
 
23368
- const supportsResponseStream = isReadableStreamSupported &&
23369
- test(() => _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isReadableStream(new Response('').body));
23382
+ const hasContentType = new Request(_platform_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].origin, {
23383
+ body: new ReadableStream(),
23384
+ method: 'POST',
23385
+ get duplex() {
23386
+ duplexAccessed = true;
23387
+ return 'half';
23388
+ },
23389
+ }).headers.has('Content-Type');
23370
23390
 
23391
+ return duplexAccessed && !hasContentType;
23392
+ });
23371
23393
 
23372
- const resolvers = {
23373
- stream: supportsResponseStream && ((res) => res.body)
23374
- };
23394
+ const supportsResponseStream = isResponseSupported && isReadableStreamSupported &&
23395
+ test(() => _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isReadableStream(new Response('').body));
23396
+
23397
+ const resolvers = {
23398
+ stream: supportsResponseStream && ((res) => res.body)
23399
+ };
23400
+
23401
+ isFetchSupported && ((() => {
23402
+ ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {
23403
+ !resolvers[type] && (resolvers[type] = (res, config) => {
23404
+ let method = res && res[type];
23405
+
23406
+ if (method) {
23407
+ return method.call(res);
23408
+ }
23375
23409
 
23376
- isFetchSupported && (((res) => {
23377
- ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {
23378
- !resolvers[type] && (resolvers[type] = _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isFunction(res[type]) ? (res) => res[type]() :
23379
- (_, config) => {
23380
23410
  throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__["default"](`Response type '${type}' is not supported`, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__["default"].ERR_NOT_SUPPORT, config);
23381
23411
  })
23382
- });
23383
- })(new Response));
23412
+ });
23413
+ })());
23384
23414
 
23385
- const getBodyLength = async (body) => {
23386
- if (body == null) {
23387
- return 0;
23388
- }
23415
+ const getBodyLength = async (body) => {
23416
+ if (body == null) {
23417
+ return 0;
23418
+ }
23389
23419
 
23390
- if(_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isBlob(body)) {
23391
- return body.size;
23392
- }
23420
+ if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isBlob(body)) {
23421
+ return body.size;
23422
+ }
23393
23423
 
23394
- if(_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isSpecCompliantForm(body)) {
23395
- const _request = new Request(_platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].origin, {
23396
- method: 'POST',
23397
- body,
23398
- });
23399
- return (await _request.arrayBuffer()).byteLength;
23400
- }
23424
+ if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isSpecCompliantForm(body)) {
23425
+ const _request = new Request(_platform_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].origin, {
23426
+ method: 'POST',
23427
+ body,
23428
+ });
23429
+ return (await _request.arrayBuffer()).byteLength;
23430
+ }
23401
23431
 
23402
- if(_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isArrayBufferView(body) || _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isArrayBuffer(body)) {
23403
- return body.byteLength;
23404
- }
23432
+ if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArrayBufferView(body) || _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArrayBuffer(body)) {
23433
+ return body.byteLength;
23434
+ }
23405
23435
 
23406
- if(_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isURLSearchParams(body)) {
23407
- body = body + '';
23408
- }
23436
+ if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isURLSearchParams(body)) {
23437
+ body = body + '';
23438
+ }
23409
23439
 
23410
- if(_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isString(body)) {
23411
- return (await encodeText(body)).byteLength;
23440
+ if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(body)) {
23441
+ return (await encodeText(body)).byteLength;
23442
+ }
23412
23443
  }
23413
- }
23414
23444
 
23415
- const resolveBodyLength = async (headers, body) => {
23416
- const length = _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].toFiniteNumber(headers.getContentLength());
23445
+ const resolveBodyLength = async (headers, body) => {
23446
+ const length = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toFiniteNumber(headers.getContentLength());
23417
23447
 
23418
- return length == null ? getBodyLength(body) : length;
23419
- }
23448
+ return length == null ? getBodyLength(body) : length;
23449
+ }
23420
23450
 
23421
- /* harmony default export */ __webpack_exports__["default"] = (isFetchSupported && (async (config) => {
23422
- let {
23423
- url,
23424
- method,
23425
- data,
23426
- signal,
23427
- cancelToken,
23428
- timeout,
23429
- onDownloadProgress,
23430
- onUploadProgress,
23431
- responseType,
23432
- headers,
23433
- withCredentials = 'same-origin',
23434
- fetchOptions
23435
- } = (0,_helpers_resolveConfig_js__WEBPACK_IMPORTED_MODULE_3__["default"])(config);
23451
+ return async (config) => {
23452
+ let {
23453
+ url,
23454
+ method,
23455
+ data,
23456
+ signal,
23457
+ cancelToken,
23458
+ timeout,
23459
+ onDownloadProgress,
23460
+ onUploadProgress,
23461
+ responseType,
23462
+ headers,
23463
+ withCredentials = 'same-origin',
23464
+ fetchOptions
23465
+ } = (0,_helpers_resolveConfig_js__WEBPACK_IMPORTED_MODULE_3__["default"])(config);
23436
23466
 
23437
- responseType = responseType ? (responseType + '').toLowerCase() : 'text';
23467
+ responseType = responseType ? (responseType + '').toLowerCase() : 'text';
23438
23468
 
23439
- let composedSignal = (0,_helpers_composeSignals_js__WEBPACK_IMPORTED_MODULE_4__["default"])([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
23469
+ let composedSignal = (0,_helpers_composeSignals_js__WEBPACK_IMPORTED_MODULE_4__["default"])([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
23440
23470
 
23441
- let request;
23471
+ let request = null;
23442
23472
 
23443
- const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
23473
+ const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
23444
23474
  composedSignal.unsubscribe();
23445
- });
23475
+ });
23446
23476
 
23447
- let requestContentLength;
23477
+ let requestContentLength;
23448
23478
 
23449
- try {
23450
- if (
23451
- onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&
23452
- (requestContentLength = await resolveBodyLength(headers, data)) !== 0
23453
- ) {
23454
- let _request = new Request(url, {
23455
- method: 'POST',
23456
- body: data,
23457
- duplex: "half"
23458
- });
23479
+ try {
23480
+ if (
23481
+ onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&
23482
+ (requestContentLength = await resolveBodyLength(headers, data)) !== 0
23483
+ ) {
23484
+ let _request = new Request(url, {
23485
+ method: 'POST',
23486
+ body: data,
23487
+ duplex: "half"
23488
+ });
23459
23489
 
23460
- let contentTypeHeader;
23490
+ let contentTypeHeader;
23461
23491
 
23462
- if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {
23463
- headers.setContentType(contentTypeHeader)
23464
- }
23492
+ if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {
23493
+ headers.setContentType(contentTypeHeader)
23494
+ }
23465
23495
 
23466
- if (_request.body) {
23467
- const [onProgress, flush] = (0,_helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_5__.progressEventDecorator)(
23468
- requestContentLength,
23469
- (0,_helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_5__.progressEventReducer)((0,_helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_5__.asyncDecorator)(onUploadProgress))
23470
- );
23496
+ if (_request.body) {
23497
+ const [onProgress, flush] = (0,_helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_5__.progressEventDecorator)(
23498
+ requestContentLength,
23499
+ (0,_helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_5__.progressEventReducer)((0,_helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_5__.asyncDecorator)(onUploadProgress))
23500
+ );
23471
23501
 
23472
- data = (0,_helpers_trackStream_js__WEBPACK_IMPORTED_MODULE_6__.trackStream)(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
23502
+ data = (0,_helpers_trackStream_js__WEBPACK_IMPORTED_MODULE_6__.trackStream)(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
23503
+ }
23473
23504
  }
23474
- }
23475
23505
 
23476
- if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isString(withCredentials)) {
23477
- withCredentials = withCredentials ? 'include' : 'omit';
23478
- }
23506
+ if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(withCredentials)) {
23507
+ withCredentials = withCredentials ? 'include' : 'omit';
23508
+ }
23479
23509
 
23480
- // Cloudflare Workers throws when credentials are defined
23481
- // see https://github.com/cloudflare/workerd/issues/902
23482
- const isCredentialsSupported = "credentials" in Request.prototype;
23483
- request = new Request(url, {
23484
- ...fetchOptions,
23485
- signal: composedSignal,
23486
- method: method.toUpperCase(),
23487
- headers: headers.normalize().toJSON(),
23488
- body: data,
23489
- duplex: "half",
23490
- credentials: isCredentialsSupported ? withCredentials : undefined
23491
- });
23510
+ // Cloudflare Workers throws when credentials are defined
23511
+ // see https://github.com/cloudflare/workerd/issues/902
23512
+ const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype;
23492
23513
 
23493
- let response = await fetch(request, fetchOptions);
23514
+ const resolvedOptions = {
23515
+ ...fetchOptions,
23516
+ signal: composedSignal,
23517
+ method: method.toUpperCase(),
23518
+ headers: headers.normalize().toJSON(),
23519
+ body: data,
23520
+ duplex: "half",
23521
+ credentials: isCredentialsSupported ? withCredentials : undefined
23522
+ };
23494
23523
 
23495
- const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
23524
+ request = isRequestSupported && new Request(url, resolvedOptions);
23496
23525
 
23497
- if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {
23498
- const options = {};
23526
+ let response = await (isRequestSupported ? fetch(request, fetchOptions) : fetch(url, resolvedOptions));
23499
23527
 
23500
- ['status', 'statusText', 'headers'].forEach(prop => {
23501
- options[prop] = response[prop];
23502
- });
23528
+ const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
23503
23529
 
23504
- const responseContentLength = _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].toFiniteNumber(response.headers.get('content-length'));
23530
+ if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {
23531
+ const options = {};
23505
23532
 
23506
- const [onProgress, flush] = onDownloadProgress && (0,_helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_5__.progressEventDecorator)(
23507
- responseContentLength,
23508
- (0,_helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_5__.progressEventReducer)((0,_helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_5__.asyncDecorator)(onDownloadProgress), true)
23509
- ) || [];
23533
+ ['status', 'statusText', 'headers'].forEach(prop => {
23534
+ options[prop] = response[prop];
23535
+ });
23510
23536
 
23511
- response = new Response(
23512
- (0,_helpers_trackStream_js__WEBPACK_IMPORTED_MODULE_6__.trackStream)(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
23513
- flush && flush();
23514
- unsubscribe && unsubscribe();
23515
- }),
23516
- options
23517
- );
23518
- }
23537
+ const responseContentLength = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toFiniteNumber(response.headers.get('content-length'));
23519
23538
 
23520
- responseType = responseType || 'text';
23539
+ const [onProgress, flush] = onDownloadProgress && (0,_helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_5__.progressEventDecorator)(
23540
+ responseContentLength,
23541
+ (0,_helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_5__.progressEventReducer)((0,_helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_5__.asyncDecorator)(onDownloadProgress), true)
23542
+ ) || [];
23521
23543
 
23522
- let responseData = await resolvers[_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].findKey(resolvers, responseType) || 'text'](response, config);
23544
+ response = new Response(
23545
+ (0,_helpers_trackStream_js__WEBPACK_IMPORTED_MODULE_6__.trackStream)(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
23546
+ flush && flush();
23547
+ unsubscribe && unsubscribe();
23548
+ }),
23549
+ options
23550
+ );
23551
+ }
23523
23552
 
23524
- !isStreamResponse && unsubscribe && unsubscribe();
23553
+ responseType = responseType || 'text';
23525
23554
 
23526
- return await new Promise((resolve, reject) => {
23527
- (0,_core_settle_js__WEBPACK_IMPORTED_MODULE_7__["default"])(resolve, reject, {
23528
- data: responseData,
23529
- headers: _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_8__["default"].from(response.headers),
23530
- status: response.status,
23531
- statusText: response.statusText,
23532
- config,
23533
- request
23555
+ let responseData = await resolvers[_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(resolvers, responseType) || 'text'](response, config);
23556
+
23557
+ !isStreamResponse && unsubscribe && unsubscribe();
23558
+
23559
+ return await new Promise((resolve, reject) => {
23560
+ (0,_core_settle_js__WEBPACK_IMPORTED_MODULE_7__["default"])(resolve, reject, {
23561
+ data: responseData,
23562
+ headers: _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_8__["default"].from(response.headers),
23563
+ status: response.status,
23564
+ statusText: response.statusText,
23565
+ config,
23566
+ request
23567
+ })
23534
23568
  })
23535
- })
23536
- } catch (err) {
23537
- unsubscribe && unsubscribe();
23538
-
23539
- if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
23540
- throw Object.assign(
23541
- new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__["default"]('Network Error', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__["default"].ERR_NETWORK, config, request),
23542
- {
23543
- cause: err.cause || err
23544
- }
23545
- )
23569
+ } catch (err) {
23570
+ unsubscribe && unsubscribe();
23571
+
23572
+ if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
23573
+ throw Object.assign(
23574
+ new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__["default"]('Network Error', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__["default"].ERR_NETWORK, config, request),
23575
+ {
23576
+ cause: err.cause || err
23577
+ }
23578
+ )
23579
+ }
23580
+
23581
+ throw _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__["default"].from(err, err && err.code, config, request);
23546
23582
  }
23583
+ }
23584
+ }
23585
+
23586
+ const seedCache = new Map();
23587
+
23588
+ const getFetch = (config) => {
23589
+ let env = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].merge.call({
23590
+ skipUndefined: true
23591
+ }, globalFetchAPI, config ? config.env : null);
23547
23592
 
23548
- throw _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__["default"].from(err, err && err.code, config, request);
23593
+ const {fetch, Request, Response} = env;
23594
+
23595
+ const seeds = [
23596
+ Request, Response, fetch
23597
+ ];
23598
+
23599
+ let len = seeds.length, i = len,
23600
+ seed, target, map = seedCache;
23601
+
23602
+ while (i--) {
23603
+ seed = seeds[i];
23604
+ target = map.get(seed);
23605
+
23606
+ target === undefined && map.set(seed, target = (i ? new Map() : factory(env)))
23607
+
23608
+ map = target;
23549
23609
  }
23550
- }));
23551
23610
 
23611
+ return target;
23612
+ };
23613
+
23614
+ const adapter = getFetch();
23552
23615
 
23616
+ /* harmony default export */ __webpack_exports__["default"] = (adapter);
23553
23617
 
23554
23618
 
23555
23619
  /***/ }),
@@ -23678,15 +23742,18 @@ const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
23678
23742
  };
23679
23743
 
23680
23744
  // Handle low level network errors
23681
- request.onerror = function handleError() {
23682
- // Real errors are hidden from us by the browser
23683
- // onerror should only fire if it's a network error
23684
- reject(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__["default"]('Network Error', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__["default"].ERR_NETWORK, config, request));
23685
-
23686
- // Clean up request
23687
- request = null;
23745
+ request.onerror = function handleError(event) {
23746
+ // Browsers deliver a ProgressEvent in XHR onerror
23747
+ // (message may be empty; when present, surface it)
23748
+ // See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event
23749
+ const msg = event && event.message ? event.message : 'Network Error';
23750
+ const err = new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__["default"](msg, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__["default"].ERR_NETWORK, config, request);
23751
+ // attach the underlying event for consumers who want details
23752
+ err.event = event || null;
23753
+ reject(err);
23754
+ request = null;
23688
23755
  };
23689
-
23756
+
23690
23757
  // Handle timeout
23691
23758
  request.ontimeout = function handleTimeout() {
23692
23759
  let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';
@@ -24460,11 +24527,18 @@ AxiosError.from = (error, code, config, request, response, customProps) => {
24460
24527
  return prop !== 'isAxiosError';
24461
24528
  });
24462
24529
 
24463
- AxiosError.call(axiosError, error.message, code, config, request, response);
24530
+ const msg = error && error.message ? error.message : 'Error';
24464
24531
 
24465
- axiosError.cause = error;
24532
+ // Prefer explicit code; otherwise copy the low-level error's code (e.g. ECONNREFUSED)
24533
+ const errCode = code == null && error ? error.code : code;
24534
+ AxiosError.call(axiosError, msg, errCode, config, request, response);
24466
24535
 
24467
- axiosError.name = error.name;
24536
+ // Chain the original error on the standard field; non-enumerable to avoid JSON noise
24537
+ if (error && axiosError.cause == null) {
24538
+ Object.defineProperty(axiosError, 'cause', { value: error, configurable: true });
24539
+ }
24540
+
24541
+ axiosError.name = (error && error.name) || 'Error';
24468
24542
 
24469
24543
  customProps && Object.assign(axiosError, customProps);
24470
24544
 
@@ -24992,7 +25066,7 @@ function dispatchRequest(config) {
24992
25066
  config.headers.setContentType('application/x-www-form-urlencoded', false);
24993
25067
  }
24994
25068
 
24995
- const adapter = _adapters_adapters_js__WEBPACK_IMPORTED_MODULE_3__["default"].getAdapter(config.adapter || _defaults_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].adapter);
25069
+ const adapter = _adapters_adapters_js__WEBPACK_IMPORTED_MODULE_3__["default"].getAdapter(config.adapter || _defaults_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].adapter, config);
24996
25070
 
24997
25071
  return adapter(config).then(function onAdapterResolution(response) {
24998
25072
  throwIfCancellationRequested(config);
@@ -25369,7 +25443,7 @@ const defaults = {
25369
25443
  const strictJSONParsing = !silentJSONParsing && JSONRequested;
25370
25444
 
25371
25445
  try {
25372
- return JSON.parse(data);
25446
+ return JSON.parse(data, this.parseReviver);
25373
25447
  } catch (e) {
25374
25448
  if (strictJSONParsing) {
25375
25449
  if (e.name === 'SyntaxError') {
@@ -25451,7 +25525,7 @@ __webpack_require__.r(__webpack_exports__);
25451
25525
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
25452
25526
  /* harmony export */ VERSION: function() { return /* binding */ VERSION; }
25453
25527
  /* harmony export */ });
25454
- const VERSION = "1.11.0";
25528
+ const VERSION = "1.12.0";
25455
25529
 
25456
25530
  /***/ }),
25457
25531
 
@@ -25662,9 +25736,7 @@ function encode(val) {
25662
25736
  replace(/%3A/gi, ':').
25663
25737
  replace(/%24/g, '$').
25664
25738
  replace(/%2C/gi, ',').
25665
- replace(/%20/g, '+').
25666
- replace(/%5B/gi, '[').
25667
- replace(/%5D/gi, ']');
25739
+ replace(/%20/g, '+');
25668
25740
  }
25669
25741
 
25670
25742
  /**
@@ -26256,7 +26328,7 @@ __webpack_require__.r(__webpack_exports__);
26256
26328
  /* harmony default export */ __webpack_exports__["default"] = ((config) => {
26257
26329
  const newConfig = (0,_core_mergeConfig_js__WEBPACK_IMPORTED_MODULE_0__["default"])({}, config);
26258
26330
 
26259
- let {data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth} = newConfig;
26331
+ let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
26260
26332
 
26261
26333
  newConfig.headers = headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"].from(headers);
26262
26334
 
@@ -26269,17 +26341,21 @@ __webpack_require__.r(__webpack_exports__);
26269
26341
  );
26270
26342
  }
26271
26343
 
26272
- let contentType;
26273
-
26274
26344
  if (_utils_js__WEBPACK_IMPORTED_MODULE_4__["default"].isFormData(data)) {
26275
26345
  if (_platform_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].hasStandardBrowserEnv || _platform_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].hasStandardBrowserWebWorkerEnv) {
26276
- headers.setContentType(undefined); // Let the browser set it
26277
- } else if ((contentType = headers.getContentType()) !== false) {
26278
- // fix semicolon duplication issue for ReactNative FormData implementation
26279
- const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];
26280
- headers.setContentType([type || 'multipart/form-data', ...tokens].join('; '));
26346
+ headers.setContentType(undefined); // browser handles it
26347
+ } else if (_utils_js__WEBPACK_IMPORTED_MODULE_4__["default"].isFunction(data.getHeaders)) {
26348
+ // Node.js FormData (like form-data package)
26349
+ const formHeaders = data.getHeaders();
26350
+ // Only set safe headers to avoid overwriting security headers
26351
+ const allowedHeaders = ['content-type', 'content-length'];
26352
+ Object.entries(formHeaders).forEach(([key, val]) => {
26353
+ if (allowedHeaders.includes(key.toLowerCase())) {
26354
+ headers.set(key, val);
26355
+ }
26356
+ });
26281
26357
  }
26282
- }
26358
+ }
26283
26359
 
26284
26360
  // Add xsrf header
26285
26361
  // This is only done if running in a standard browser environment.
@@ -27282,7 +27358,7 @@ const isEmptyObject = (val) => {
27282
27358
  if (!isObject(val) || isBuffer(val)) {
27283
27359
  return false;
27284
27360
  }
27285
-
27361
+
27286
27362
  try {
27287
27363
  return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
27288
27364
  } catch (e) {
@@ -27475,7 +27551,7 @@ const isContextDefined = (context) => !isUndefined(context) && context !== _glob
27475
27551
  * @returns {Object} Result of all merge properties
27476
27552
  */
27477
27553
  function merge(/* obj1, obj2, obj3, ... */) {
27478
- const {caseless} = isContextDefined(this) && this || {};
27554
+ const {caseless, skipUndefined} = isContextDefined(this) && this || {};
27479
27555
  const result = {};
27480
27556
  const assignValue = (val, key) => {
27481
27557
  const targetKey = caseless && findKey(result, key) || key;
@@ -27486,7 +27562,9 @@ function merge(/* obj1, obj2, obj3, ... */) {
27486
27562
  } else if (isArray(val)) {
27487
27563
  result[targetKey] = val.slice();
27488
27564
  } else {
27489
- result[targetKey] = val;
27565
+ if (!skipUndefined || !isUndefined(val)) {
27566
+ result[targetKey] = val;
27567
+ }
27490
27568
  }
27491
27569
  }
27492
27570
 
@@ -27767,6 +27845,8 @@ const toFiniteNumber = (value, defaultValue) => {
27767
27845
  return value != null && Number.isFinite(value = +value) ? value : defaultValue;
27768
27846
  }
27769
27847
 
27848
+
27849
+
27770
27850
  /**
27771
27851
  * If the thing is a FormData object, return true, otherwise return false.
27772
27852
  *
@@ -29375,7 +29455,7 @@ function createClient(params) {
29375
29455
  var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
29376
29456
  var sdkMain = opts.type === 'plain' ? 'contentful-management-plain.js' : 'contentful-management.js';
29377
29457
  var userAgent = (0,contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__.getUserAgentHeader)(// @ts-expect-error
29378
- "".concat(sdkMain, "/").concat("11.56.0"), params.application, params.integration, params.feature);
29458
+ "".concat(sdkMain, "/").concat("11.57.1"), params.application, params.integration, params.feature);
29379
29459
  var adapter = (0,_create_adapter__WEBPACK_IMPORTED_MODULE_1__.createAdapter)(_objectSpread(_objectSpread({}, params), {}, {
29380
29460
  userAgent: userAgent
29381
29461
  }));