contentful 11.12.2 → 11.12.4

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.
@@ -1447,10 +1447,10 @@ var contentful = (function (exports) {
1447
1447
  * @returns {Object} The JSON-compatible object.
1448
1448
  */
1449
1449
  var toJSONObject = function toJSONObject(obj) {
1450
- var stack = new Array(10);
1451
- var _visit = function visit(source, i) {
1450
+ var visited = new WeakSet();
1451
+ var _visit = function visit(source) {
1452
1452
  if (isObject(source)) {
1453
- if (stack.indexOf(source) >= 0) {
1453
+ if (visited.has(source)) {
1454
1454
  return;
1455
1455
  }
1456
1456
 
@@ -1459,19 +1459,20 @@ var contentful = (function (exports) {
1459
1459
  return source;
1460
1460
  }
1461
1461
  if (!('toJSON' in source)) {
1462
- stack[i] = source;
1462
+ // add-on descent / delete-on-ascent: preserves path semantics, so DAG nodes serialise at every occurrence (see #7230).
1463
+ visited.add(source);
1463
1464
  var target = isArray$7(source) ? [] : {};
1464
1465
  forEach(source, function (value, key) {
1465
- var reducedValue = _visit(value, i + 1);
1466
+ var reducedValue = _visit(value);
1466
1467
  !isUndefined(reducedValue) && (target[key] = reducedValue);
1467
1468
  });
1468
- stack[i] = undefined;
1469
+ visited.delete(source);
1469
1470
  return target;
1470
1471
  }
1471
1472
  }
1472
1473
  return source;
1473
1474
  };
1474
- return _visit(obj, 0);
1475
+ return _visit(obj);
1475
1476
  };
1476
1477
 
1477
1478
  /**
@@ -1642,8 +1643,6 @@ var contentful = (function (exports) {
1642
1643
  });
1643
1644
  return parsed;
1644
1645
  };
1645
- var $internals = Symbol('internals');
1646
- var INVALID_HEADER_VALUE_CHARS_RE = /[^\x09\x20-\x7E\x80-\xFF]/g;
1647
1646
  function trimSPorHTAB(str) {
1648
1647
  var start = 0;
1649
1648
  var end = str.length;
@@ -1663,12 +1662,37 @@ var contentful = (function (exports) {
1663
1662
  }
1664
1663
  return start === 0 && end === str.length ? str : str.slice(start, end);
1665
1664
  }
1665
+
1666
+ // The control-code ranges are intentional: header sanitization strips C0/DEL bytes.
1667
+ // eslint-disable-next-line no-control-regex
1668
+ var INVALID_UNICODE_HEADER_VALUE_CHARS = new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+", 'g');
1669
+ // eslint-disable-next-line no-control-regex
1670
+ var INVALID_BYTE_STRING_HEADER_VALUE_CHARS = new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+", 'g');
1671
+ function sanitizeValue(value, invalidChars) {
1672
+ if (utils$1$1.isArray(value)) {
1673
+ return value.map(function (item) {
1674
+ return sanitizeValue(item, invalidChars);
1675
+ });
1676
+ }
1677
+ return trimSPorHTAB(String(value).replace(invalidChars, ''));
1678
+ }
1679
+ var sanitizeHeaderValue = function sanitizeHeaderValue(value) {
1680
+ return sanitizeValue(value, INVALID_UNICODE_HEADER_VALUE_CHARS);
1681
+ };
1682
+ var sanitizeByteStringHeaderValue = function sanitizeByteStringHeaderValue(value) {
1683
+ return sanitizeValue(value, INVALID_BYTE_STRING_HEADER_VALUE_CHARS);
1684
+ };
1685
+ function toByteStringHeaderObject(headers) {
1686
+ var byteStringHeaders = Object.create(null);
1687
+ utils$1$1.forEach(headers.toJSON(), function (value, header) {
1688
+ byteStringHeaders[header] = sanitizeByteStringHeaderValue(value);
1689
+ });
1690
+ return byteStringHeaders;
1691
+ }
1692
+ var $internals = Symbol('internals');
1666
1693
  function normalizeHeader(header) {
1667
1694
  return header && String(header).trim().toLowerCase();
1668
1695
  }
1669
- function sanitizeHeaderValue(str) {
1670
- return trimSPorHTAB(str.replace(INVALID_HEADER_VALUE_CHARS_RE, ''));
1671
- }
1672
1696
  function normalizeValue(value) {
1673
1697
  if (value === false || value == null) {
1674
1698
  return value;
@@ -1949,8 +1973,8 @@ var contentful = (function (exports) {
1949
1973
  AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
1950
1974
 
1951
1975
  // reserved names hotfix
1952
- utils$1$1.reduceDescriptors(AxiosHeaders.prototype, function (_ref10, key) {
1953
- var value = _ref10.value;
1976
+ utils$1$1.reduceDescriptors(AxiosHeaders.prototype, function (_ref0, key) {
1977
+ var value = _ref0.value;
1954
1978
  var mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
1955
1979
  return {
1956
1980
  get: function get() {
@@ -2621,7 +2645,7 @@ var contentful = (function (exports) {
2621
2645
  }
2622
2646
  return !isNumericKey;
2623
2647
  }
2624
- if (!target[name] || !utils$1$1.isObject(target[name])) {
2648
+ if (!utils$1$1.hasOwnProp(target, name) || !utils$1$1.isObject(target[name])) {
2625
2649
  target[name] = [];
2626
2650
  }
2627
2651
  var result = buildPath(path, value, target[name], index);
@@ -2915,6 +2939,9 @@ var contentful = (function (exports) {
2915
2939
  var bytesNotified = 0;
2916
2940
  var _speedometer = speedometer(50, 250);
2917
2941
  return throttle(function (e) {
2942
+ if (!e || typeof e.loaded !== 'number') {
2943
+ return;
2944
+ }
2918
2945
  var rawLoaded = e.loaded;
2919
2946
  var total = e.lengthComputable ? e.total : undefined;
2920
2947
  var loaded = total != null ? Math.min(rawLoaded, total) : rawLoaded;
@@ -3186,10 +3213,10 @@ var contentful = (function (exports) {
3186
3213
  headers.set(formHeaders);
3187
3214
  return;
3188
3215
  }
3189
- Object.entries(formHeaders).forEach(function (_ref11) {
3190
- var _ref12 = _slicedToArray$1(_ref11, 2),
3191
- key = _ref12[0],
3192
- val = _ref12[1];
3216
+ Object.entries(formHeaders).forEach(function (_ref1) {
3217
+ var _ref10 = _slicedToArray$1(_ref1, 2),
3218
+ key = _ref10[0],
3219
+ val = _ref10[1];
3193
3220
  if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) {
3194
3221
  headers.set(key, val);
3195
3222
  }
@@ -3382,7 +3409,7 @@ var contentful = (function (exports) {
3382
3409
 
3383
3410
  // Add headers to the request
3384
3411
  if ('setRequestHeader' in request) {
3385
- utils$1$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
3412
+ utils$1$1.forEach(toByteStringHeaderObject(requestHeaders), function setRequestHeader(val, key) {
3386
3413
  request.setRequestHeader(key, val);
3387
3414
  });
3388
3415
  }
@@ -3443,42 +3470,43 @@ var contentful = (function (exports) {
3443
3470
  });
3444
3471
  };
3445
3472
  var composeSignals = function composeSignals(signals, timeout) {
3446
- var _signals = signals = signals ? signals.filter(Boolean) : [],
3447
- length = _signals.length;
3448
- if (timeout || length) {
3449
- var controller = new AbortController();
3450
- var aborted;
3451
- var onabort = function onabort(reason) {
3452
- if (!aborted) {
3453
- aborted = true;
3454
- unsubscribe();
3455
- var err = reason instanceof Error ? reason : this.reason;
3456
- controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));
3457
- }
3458
- };
3459
- var timer = timeout && setTimeout(function () {
3460
- timer = null;
3461
- onabort(new AxiosError("timeout of ".concat(timeout, "ms exceeded"), AxiosError.ETIMEDOUT));
3462
- }, timeout);
3463
- var unsubscribe = function unsubscribe() {
3464
- if (signals) {
3465
- timer && clearTimeout(timer);
3466
- timer = null;
3467
- signals.forEach(function (signal) {
3468
- signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort);
3469
- });
3470
- signals = null;
3471
- }
3472
- };
3473
+ signals = signals ? signals.filter(Boolean) : [];
3474
+ if (!timeout && !signals.length) {
3475
+ return;
3476
+ }
3477
+ var controller = new AbortController();
3478
+ var aborted = false;
3479
+ var onabort = function onabort(reason) {
3480
+ if (!aborted) {
3481
+ aborted = true;
3482
+ unsubscribe();
3483
+ var err = reason instanceof Error ? reason : this.reason;
3484
+ controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));
3485
+ }
3486
+ };
3487
+ var timer = timeout && setTimeout(function () {
3488
+ timer = null;
3489
+ onabort(new AxiosError("timeout of ".concat(timeout, "ms exceeded"), AxiosError.ETIMEDOUT));
3490
+ }, timeout);
3491
+ var unsubscribe = function unsubscribe() {
3492
+ if (!signals) {
3493
+ return;
3494
+ }
3495
+ timer && clearTimeout(timer);
3496
+ timer = null;
3473
3497
  signals.forEach(function (signal) {
3474
- return signal.addEventListener('abort', onabort);
3498
+ signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort);
3475
3499
  });
3476
- var signal = controller.signal;
3477
- signal.unsubscribe = function () {
3478
- return utils$1$1.asap(unsubscribe);
3479
- };
3480
- return signal;
3481
- }
3500
+ signals = null;
3501
+ };
3502
+ signals.forEach(function (signal) {
3503
+ return signal.addEventListener('abort', onabort);
3504
+ });
3505
+ var signal = controller.signal;
3506
+ signal.unsubscribe = function () {
3507
+ return utils$1$1.asap(unsubscribe);
3508
+ };
3509
+ return signal;
3482
3510
  };
3483
3511
  var streamChunk = /*#__PURE__*/_regeneratorRuntime.mark(function streamChunk(chunk, chunkSize) {
3484
3512
  var len, pos, end;
@@ -3778,7 +3806,7 @@ var contentful = (function (exports) {
3778
3806
  }
3779
3807
  return bytes;
3780
3808
  }
3781
- var VERSION = "1.16.0";
3809
+ var VERSION = "1.16.1";
3782
3810
  var DEFAULT_CHUNK_SIZE = 64 * 1024;
3783
3811
  var isFunction = utils$1$1.isFunction;
3784
3812
  var test = function test(fn) {
@@ -3792,8 +3820,7 @@ var contentful = (function (exports) {
3792
3820
  }
3793
3821
  };
3794
3822
  var factory = function factory(env) {
3795
- var _utils$1$global;
3796
- var globalObject = (_utils$1$global = utils$1$1.global) !== null && _utils$1$global !== void 0 ? _utils$1$global : globalThis;
3823
+ var globalObject = utils$1$1.global !== undefined && utils$1$1.global !== null ? utils$1$1.global : globalThis;
3797
3824
  var ReadableStream = globalObject.ReadableStream,
3798
3825
  TextEncoder = globalObject.TextEncoder;
3799
3826
  env = utils$1$1.merge.call({
@@ -3818,7 +3845,7 @@ var contentful = (function (exports) {
3818
3845
  return encoder.encode(str);
3819
3846
  };
3820
3847
  }(new TextEncoder()) : (/*#__PURE__*/function () {
3821
- var _ref13 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(str) {
3848
+ var _ref11 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(str) {
3822
3849
  return _regeneratorRuntime.wrap(function _callee4$(_context5) {
3823
3850
  while (1) switch (_context5.prev = _context5.next) {
3824
3851
  case 0:
@@ -3835,7 +3862,7 @@ var contentful = (function (exports) {
3835
3862
  }, _callee4);
3836
3863
  }));
3837
3864
  return function (_x4) {
3838
- return _ref13.apply(this, arguments);
3865
+ return _ref11.apply(this, arguments);
3839
3866
  };
3840
3867
  }()));
3841
3868
  var supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(function () {
@@ -3874,7 +3901,7 @@ var contentful = (function (exports) {
3874
3901
  });
3875
3902
  }();
3876
3903
  var getBodyLength = /*#__PURE__*/function () {
3877
- var _ref14 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(body) {
3904
+ var _ref12 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(body) {
3878
3905
  var _request;
3879
3906
  return _regeneratorRuntime.wrap(function _callee5$(_context6) {
3880
3907
  while (1) switch (_context6.prev = _context6.next) {
@@ -3928,11 +3955,11 @@ var contentful = (function (exports) {
3928
3955
  }, _callee5);
3929
3956
  }));
3930
3957
  return function getBodyLength(_x5) {
3931
- return _ref14.apply(this, arguments);
3958
+ return _ref12.apply(this, arguments);
3932
3959
  };
3933
3960
  }();
3934
3961
  var resolveBodyLength = /*#__PURE__*/function () {
3935
- var _ref15 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(headers, body) {
3962
+ var _ref13 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(headers, body) {
3936
3963
  var length;
3937
3964
  return _regeneratorRuntime.wrap(function _callee6$(_context7) {
3938
3965
  while (1) switch (_context7.prev = _context7.next) {
@@ -3946,12 +3973,12 @@ var contentful = (function (exports) {
3946
3973
  }, _callee6);
3947
3974
  }));
3948
3975
  return function resolveBodyLength(_x6, _x7) {
3949
- return _ref15.apply(this, arguments);
3976
+ return _ref13.apply(this, arguments);
3950
3977
  };
3951
3978
  }();
3952
3979
  return /*#__PURE__*/function () {
3953
- var _ref16 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(config) {
3954
- var _resolveConfig, url, method, data, signal, cancelToken, timeout, onDownloadProgress, onUploadProgress, responseType, headers, _resolveConfig$withCr, withCredentials, fetchOptions, maxContentLength, maxBodyLength, hasMaxContentLength, hasMaxBodyLength, _fetch, composedSignal, request, unsubscribe, requestContentLength, estimated, outboundLength, _request, contentTypeHeader, _progressEventDecorat, _progressEventDecorat2, onProgress, flush, isCredentialsSupported, contentType, resolvedOptions, response, declaredLength, isStreamResponse, options, responseContentLength, _ref17, _ref18, _onProgress, _flush, bytesRead, onChunkProgress, responseData, materializedSize, canceledError;
3980
+ var _ref14 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(config) {
3981
+ var _resolveConfig, url, method, data, signal, cancelToken, timeout, onDownloadProgress, onUploadProgress, responseType, headers, _resolveConfig$withCr, withCredentials, fetchOptions, maxContentLength, maxBodyLength, hasMaxContentLength, hasMaxBodyLength, _fetch, composedSignal, request, unsubscribe, requestContentLength, estimated, outboundLength, _request, contentTypeHeader, _progressEventDecorat, _progressEventDecorat2, onProgress, flush, isCredentialsSupported, contentType, resolvedOptions, response, declaredLength, isStreamResponse, options, responseContentLength, _ref15, _ref16, _onProgress, _flush, bytesRead, onChunkProgress, responseData, materializedSize, canceledError;
3955
3982
  return _regeneratorRuntime.wrap(function _callee7$(_context8) {
3956
3983
  while (1) switch (_context8.prev = _context8.next) {
3957
3984
  case 0:
@@ -4039,7 +4066,7 @@ var contentful = (function (exports) {
4039
4066
  resolvedOptions = _objectSpread$2(_objectSpread$2({}, fetchOptions), {}, {
4040
4067
  signal: composedSignal,
4041
4068
  method: method.toUpperCase(),
4042
- headers: headers.normalize().toJSON(),
4069
+ headers: toByteStringHeaderObject(headers.normalize()),
4043
4070
  body: data,
4044
4071
  duplex: 'half',
4045
4072
  credentials: isCredentialsSupported ? withCredentials : undefined
@@ -4067,7 +4094,7 @@ var contentful = (function (exports) {
4067
4094
  options[prop] = response[prop];
4068
4095
  });
4069
4096
  responseContentLength = utils$1$1.toFiniteNumber(response.headers.get('content-length'));
4070
- _ref17 = onDownloadProgress && progressEventDecorator(responseContentLength, progressEventReducer(asyncDecorator(onDownloadProgress), true)) || [], _ref18 = _slicedToArray$1(_ref17, 2), _onProgress = _ref18[0], _flush = _ref18[1];
4097
+ _ref15 = onDownloadProgress && progressEventDecorator(responseContentLength, progressEventReducer(asyncDecorator(onDownloadProgress), true)) || [], _ref16 = _slicedToArray$1(_ref15, 2), _onProgress = _ref16[0], _flush = _ref16[1];
4071
4098
  bytesRead = 0;
4072
4099
  onChunkProgress = function onChunkProgress(loadedBytes) {
4073
4100
  if (hasMaxContentLength) {
@@ -4155,7 +4182,7 @@ var contentful = (function (exports) {
4155
4182
  }, _callee7, null, [[8, 58]]);
4156
4183
  }));
4157
4184
  return function (_x8) {
4158
- return _ref16.apply(this, arguments);
4185
+ return _ref14.apply(this, arguments);
4159
4186
  };
4160
4187
  }();
4161
4188
  };
@@ -4271,10 +4298,10 @@ var contentful = (function (exports) {
4271
4298
  rejectedReasons[id || '#' + i] = adapter;
4272
4299
  }
4273
4300
  if (!adapter) {
4274
- var reasons = Object.entries(rejectedReasons).map(function (_ref19) {
4275
- var _ref20 = _slicedToArray$1(_ref19, 2),
4276
- id = _ref20[0],
4277
- state = _ref20[1];
4301
+ var reasons = Object.entries(rejectedReasons).map(function (_ref17) {
4302
+ var _ref18 = _slicedToArray$1(_ref17, 2),
4303
+ id = _ref18[0],
4304
+ state = _ref18[1];
4278
4305
  return "adapter ".concat(id, " ") + (state === false ? 'is not supported by the environment' : 'is not available in the build');
4279
4306
  });
4280
4307
  var s = length ? reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0]) : 'as no adapter specified';
@@ -4525,7 +4552,7 @@ var contentful = (function (exports) {
4525
4552
  }
4526
4553
  }, _callee8, this, [[0, 6]]);
4527
4554
  }));
4528
- function request(_x9, _x10) {
4555
+ function request(_x9, _x0) {
4529
4556
  return _request2.apply(this, arguments);
4530
4557
  }
4531
4558
  return request;
@@ -4922,10 +4949,10 @@ var contentful = (function (exports) {
4922
4949
  SslHandshakeFailed: 525,
4923
4950
  InvalidSslCertificate: 526
4924
4951
  };
4925
- Object.entries(HttpStatusCode).forEach(function (_ref21) {
4926
- var _ref22 = _slicedToArray$1(_ref21, 2),
4927
- key = _ref22[0],
4928
- value = _ref22[1];
4952
+ Object.entries(HttpStatusCode).forEach(function (_ref19) {
4953
+ var _ref20 = _slicedToArray$1(_ref19, 2),
4954
+ key = _ref20[0],
4955
+ value = _ref20[1];
4929
4956
  HttpStatusCode[value] = key;
4930
4957
  });
4931
4958
 
@@ -8087,7 +8114,7 @@ var contentful = (function (exports) {
8087
8114
  }
8088
8115
  if (obj === null) {
8089
8116
  if (strictNullHandling) {
8090
- return encoder && !encodeValuesOnly ? encoder(prefix, defaults$1.encoder, charset, 'key', format) : prefix;
8117
+ return formatter(encoder && !encodeValuesOnly ? encoder(prefix, defaults$1.encoder, charset, 'key', format) : prefix);
8091
8118
  }
8092
8119
  obj = '';
8093
8120
  }
@@ -8106,7 +8133,9 @@ var contentful = (function (exports) {
8106
8133
  if (generateArrayPrefix === 'comma' && isArray$1(obj)) {
8107
8134
  // we need to join elements in
8108
8135
  if (encodeValuesOnly && encoder) {
8109
- obj = utils$1.maybeMap(obj, encoder);
8136
+ obj = utils$1.maybeMap(obj, function (v) {
8137
+ return v == null ? v : encoder(v);
8138
+ });
8110
8139
  }
8111
8140
  objKeys = [{
8112
8141
  value: obj.length > 0 ? obj.join(',') || null : void undefined
@@ -8227,6 +8256,9 @@ var contentful = (function (exports) {
8227
8256
  var sideChannel = getSideChannel();
8228
8257
  for (var i = 0; i < objKeys.length; ++i) {
8229
8258
  var key = objKeys[i];
8259
+ if (typeof key === 'undefined' || key === null) {
8260
+ continue;
8261
+ }
8230
8262
  var value = obj[key];
8231
8263
  if (options.skipNulls && value === null) {
8232
8264
  continue;
@@ -8238,10 +8270,10 @@ var contentful = (function (exports) {
8238
8270
  if (options.charsetSentinel) {
8239
8271
  if (options.charset === 'iso-8859-1') {
8240
8272
  // encodeURIComponent('&#10003;'), the "numeric entity" representation of a checkmark
8241
- prefix += 'utf8=%26%2310003%3B&';
8273
+ prefix += 'utf8=%26%2310003%3B' + options.delimiter;
8242
8274
  } else {
8243
8275
  // encodeURIComponent('✓')
8244
- prefix += 'utf8=%E2%9C%93&';
8276
+ prefix += 'utf8=%E2%9C%93' + options.delimiter;
8245
8277
  }
8246
8278
  }
8247
8279
  return joined.length > 0 ? prefix + joined : '';
@@ -8306,8 +8338,8 @@ var contentful = (function (exports) {
8306
8338
  var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
8307
8339
  cleanStr = cleanStr.replace(/%5B/gi, '[').replace(/%5D/gi, ']');
8308
8340
  var limit = options.parameterLimit === Infinity ? void undefined : options.parameterLimit;
8309
- var parts = cleanStr.split(options.delimiter, options.throwOnLimitExceeded ? limit + 1 : limit);
8310
- if (options.throwOnLimitExceeded && parts.length > limit) {
8341
+ var parts = cleanStr.split(options.delimiter, options.throwOnLimitExceeded && typeof limit !== 'undefined' ? limit + 1 : limit);
8342
+ if (options.throwOnLimitExceeded && typeof limit !== 'undefined' && parts.length > limit) {
8311
8343
  throw new RangeError('Parameter limit exceeded. Only ' + limit + ' parameter' + (limit === 1 ? '' : 's') + ' allowed.');
8312
8344
  }
8313
8345
  var skipIndex = -1; // Keep track of where the utf8 sentinel was found
@@ -8414,8 +8446,13 @@ var contentful = (function (exports) {
8414
8446
  }
8415
8447
  return leaf;
8416
8448
  };
8417
- var splitKeyIntoSegments = function splitKeyIntoSegments(givenKey, options) {
8418
- var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
8449
+
8450
+ // Split a key like "a[b][c[]]" into ['a', '[b]', '[c[]]'] while preserving
8451
+ // qs parse semantics for depth/prototype guards.
8452
+ var splitKeyIntoSegments = function splitKeyIntoSegments(originalKey, options) {
8453
+ var key = options.allowDots ? originalKey.replace(/\.([^.[]+)/g, '[$1]') : originalKey;
8454
+
8455
+ // depth <= 0 keeps the whole key as one segment
8419
8456
  if (options.depth <= 0) {
8420
8457
  if (!options.plainObjects && has.call(Object.prototype, key)) {
8421
8458
  if (!options.allowPrototypes) {
@@ -8424,37 +8461,67 @@ var contentful = (function (exports) {
8424
8461
  }
8425
8462
  return [key];
8426
8463
  }
8427
- var brackets = /(\[[^[\]]*])/;
8428
- var child = /(\[[^[\]]*])/g;
8429
- var segment = brackets.exec(key);
8430
- var parent = segment ? key.slice(0, segment.index) : key;
8431
- var keys = [];
8464
+ var segments = [];
8465
+
8466
+ // parent before the first '[' (may be empty if key starts with '[')
8467
+ var first = key.indexOf('[');
8468
+ var parent = first >= 0 ? key.slice(0, first) : key;
8432
8469
  if (parent) {
8433
8470
  if (!options.plainObjects && has.call(Object.prototype, parent)) {
8434
8471
  if (!options.allowPrototypes) {
8435
8472
  return;
8436
8473
  }
8437
8474
  }
8438
- keys[keys.length] = parent;
8439
- }
8440
- var i = 0;
8441
- while ((segment = child.exec(key)) !== null && i < options.depth) {
8442
- i += 1;
8443
- var segmentContent = segment[1].slice(1, -1);
8444
- if (!options.plainObjects && has.call(Object.prototype, segmentContent)) {
8445
- if (!options.allowPrototypes) {
8446
- return;
8475
+ segments[segments.length] = parent;
8476
+ }
8477
+ var n = key.length;
8478
+ var open = first;
8479
+ var collected = 0;
8480
+ while (open >= 0 && collected < options.depth) {
8481
+ var level = 1;
8482
+ var i = open + 1;
8483
+ var close = -1;
8484
+
8485
+ // balance nested '[' and ']' inside this bracket group using a nesting level counter
8486
+ while (i < n && close < 0) {
8487
+ var cu = key.charCodeAt(i);
8488
+ if (cu === 0x5B) {
8489
+ // '['
8490
+ level += 1;
8491
+ } else if (cu === 0x5D) {
8492
+ // ']'
8493
+ level -= 1;
8494
+ if (level === 0) {
8495
+ close = i; // found matching close; loop will exit by condition
8496
+ }
8447
8497
  }
8498
+ i += 1;
8499
+ }
8500
+ if (close < 0) {
8501
+ // Unterminated group: wrap the raw remainder in one bracket pair so it stays
8502
+ // a single literal segment (e.g. "[[]b" -> "[[]b]"); we do not infer missing ']'.
8503
+ segments[segments.length] = '[' + key.slice(open) + ']';
8504
+ return segments;
8448
8505
  }
8449
- keys[keys.length] = segment[1];
8506
+ var seg = key.slice(open, close + 1);
8507
+ // prototype guard for the content of this group
8508
+ var content = seg.slice(1, -1);
8509
+ if (!options.plainObjects && has.call(Object.prototype, content) && !options.allowPrototypes) {
8510
+ return;
8511
+ }
8512
+ segments[segments.length] = seg;
8513
+ collected += 1;
8514
+
8515
+ // find the next '[' after this balanced group
8516
+ open = key.indexOf('[', close + 1);
8450
8517
  }
8451
- if (segment) {
8518
+ if (open >= 0) {
8452
8519
  if (options.strictDepth === true) {
8453
8520
  throw new RangeError('Input depth exceeded depth option of ' + options.depth + ' and strictDepth is true');
8454
8521
  }
8455
- keys[keys.length] = '[' + key.slice(segment.index) + ']';
8522
+ segments[segments.length] = '[' + key.slice(open) + ']';
8456
8523
  }
8457
- return keys;
8524
+ return segments;
8458
8525
  };
8459
8526
  var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
8460
8527
  if (!givenKey) {
@@ -10046,7 +10113,14 @@ var contentful = (function (exports) {
10046
10113
  return false;
10047
10114
  }
10048
10115
  var isValidConfig = isValidTimelinePreviewConfig(timelinePreview);
10049
- var isValidHost = typeof host === 'string' && host.startsWith('preview');
10116
+ // Show error if used outside of CPA.
10117
+ // Opt-out of the error if a custom domain is used and CPA could not be identified.
10118
+ // Use an exact domain match to avoid false-positives on proxy hostnames that contain
10119
+ // "contentful" as a substring (e.g. api-contentful-proxy.example.com).
10120
+ var PREVIEW_HOST_REGEX = /^preview(\.eu)?\.contentful\.com$/;
10121
+ var isContentfulHost = typeof host === 'string' && PREVIEW_HOST_REGEX.test(host);
10122
+ var isCustomHost = typeof host !== 'string' || !host.endsWith('.contentful.com');
10123
+ var isValidHost = isContentfulHost || isCustomHost;
10050
10124
  if (isValidConfig && !isValidHost) {
10051
10125
  throw new ValidationError('timelinePreview', "The 'timelinePreview' parameter can only be used with the CPA. Please set host to 'preview.contentful.com' or 'preview.eu.contentful.com' to enable Timeline Preview.\n ");
10052
10126
  }
@@ -10430,58 +10504,58 @@ var contentful = (function (exports) {
10430
10504
  return _internalGetEntry.apply(this, arguments);
10431
10505
  }
10432
10506
  function _internalGetEntry() {
10433
- _internalGetEntry = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee10(id, query, options) {
10507
+ _internalGetEntry = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee0(id, query, options) {
10434
10508
  var response;
10435
- return _regeneratorRuntime.wrap(function _callee10$(_context10) {
10436
- while (1) switch (_context10.prev = _context10.next) {
10509
+ return _regeneratorRuntime.wrap(function _callee0$(_context0) {
10510
+ while (1) switch (_context0.prev = _context0.next) {
10437
10511
  case 0:
10438
10512
  if (id) {
10439
- _context10.next = 2;
10513
+ _context0.next = 2;
10440
10514
  break;
10441
10515
  }
10442
10516
  throw notFoundError(id);
10443
10517
  case 2:
10444
- _context10.prev = 2;
10445
- _context10.next = 5;
10518
+ _context0.prev = 2;
10519
+ _context0.next = 5;
10446
10520
  return internalGetEntries(Object.assign({
10447
10521
  'sys.id': id
10448
10522
  }, maybeEnableSourceMaps(query)), options);
10449
10523
  case 5:
10450
- response = _context10.sent;
10524
+ response = _context0.sent;
10451
10525
  if (!(response.items.length > 0)) {
10452
- _context10.next = 10;
10526
+ _context0.next = 10;
10453
10527
  break;
10454
10528
  }
10455
- return _context10.abrupt("return", response.items[0]);
10529
+ return _context0.abrupt("return", response.items[0]);
10456
10530
  case 10:
10457
10531
  throw notFoundError(id);
10458
10532
  case 11:
10459
- _context10.next = 16;
10533
+ _context0.next = 16;
10460
10534
  break;
10461
10535
  case 13:
10462
- _context10.prev = 13;
10463
- _context10.t0 = _context10["catch"](2);
10464
- errorHandler(_context10.t0);
10536
+ _context0.prev = 13;
10537
+ _context0.t0 = _context0["catch"](2);
10538
+ errorHandler(_context0.t0);
10465
10539
  case 16:
10466
10540
  case "end":
10467
- return _context10.stop();
10541
+ return _context0.stop();
10468
10542
  }
10469
- }, _callee10, null, [[2, 13]]);
10543
+ }, _callee0, null, [[2, 13]]);
10470
10544
  }));
10471
10545
  return _internalGetEntry.apply(this, arguments);
10472
10546
  }
10473
- function makeGetEntries(_x10) {
10547
+ function makeGetEntries(_x0) {
10474
10548
  return _makeGetEntries.apply(this, arguments);
10475
10549
  }
10476
10550
  function _makeGetEntries() {
10477
- _makeGetEntries = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee11(query) {
10551
+ _makeGetEntries = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee1(query) {
10478
10552
  var options,
10479
10553
  withAllLocales,
10480
- _args11 = arguments;
10481
- return _regeneratorRuntime.wrap(function _callee11$(_context11) {
10482
- while (1) switch (_context11.prev = _context11.next) {
10554
+ _args1 = arguments;
10555
+ return _regeneratorRuntime.wrap(function _callee1$(_context1) {
10556
+ while (1) switch (_context1.prev = _context1.next) {
10483
10557
  case 0:
10484
- options = _args11.length > 1 && _args11[1] !== undefined ? _args11[1] : {
10558
+ options = _args1.length > 1 && _args1[1] !== undefined ? _args1[1] : {
10485
10559
  withAllLocales: false,
10486
10560
  withoutLinkResolution: false,
10487
10561
  withoutUnresolvableLinks: false,
@@ -10492,14 +10566,14 @@ var contentful = (function (exports) {
10492
10566
  validateResolveLinksParam(query);
10493
10567
  validateRemoveUnresolvedParam(query);
10494
10568
  validateSearchParameters(query);
10495
- return _context11.abrupt("return", internalGetEntries(withAllLocales ? Object.assign(Object.assign({}, query), {
10569
+ return _context1.abrupt("return", internalGetEntries(withAllLocales ? Object.assign(Object.assign({}, query), {
10496
10570
  locale: '*'
10497
10571
  }) : query, options));
10498
10572
  case 7:
10499
10573
  case "end":
10500
- return _context11.stop();
10574
+ return _context1.stop();
10501
10575
  }
10502
- }, _callee11);
10576
+ }, _callee1);
10503
10577
  }));
10504
10578
  return _makeGetEntries.apply(this, arguments);
10505
10579
  }
@@ -10509,17 +10583,17 @@ var contentful = (function (exports) {
10509
10583
  // Then, apply source maps and other normalizations
10510
10584
  return maybeEnableSourceMaps(normalizeSearchParameters(normalizeSelect(withTimelinePreview)));
10511
10585
  }
10512
- function internalGetEntries(_x11, _x12) {
10586
+ function internalGetEntries(_x1, _x10) {
10513
10587
  return _internalGetEntries.apply(this, arguments);
10514
10588
  }
10515
10589
  function _internalGetEntries() {
10516
- _internalGetEntries = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee12(query, options) {
10590
+ _internalGetEntries = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee10(query, options) {
10517
10591
  var withoutLinkResolution, withoutUnresolvableLinks, withLocaleBasedPublishing, baseConfig, config, entries;
10518
- return _regeneratorRuntime.wrap(function _callee12$(_context12) {
10519
- while (1) switch (_context12.prev = _context12.next) {
10592
+ return _regeneratorRuntime.wrap(function _callee10$(_context10) {
10593
+ while (1) switch (_context10.prev = _context10.next) {
10520
10594
  case 0:
10521
10595
  withoutLinkResolution = options.withoutLinkResolution, withoutUnresolvableLinks = options.withoutUnresolvableLinks, withLocaleBasedPublishing = options.withLocaleBasedPublishing;
10522
- _context12.prev = 1;
10596
+ _context10.prev = 1;
10523
10597
  baseConfig = createRequestConfig({
10524
10598
  query: prepareQuery(query)
10525
10599
  });
@@ -10529,47 +10603,47 @@ var contentful = (function (exports) {
10529
10603
  'X-Contentful-Locale-Based-Publishing': true
10530
10604
  });
10531
10605
  }
10532
- _context12.next = 7;
10606
+ _context10.next = 7;
10533
10607
  return get({
10534
10608
  context: 'environment',
10535
10609
  path: maybeEnableTimelinePreview('entries'),
10536
10610
  config: config
10537
10611
  });
10538
10612
  case 7:
10539
- entries = _context12.sent;
10540
- return _context12.abrupt("return", resolveCircular(entries, {
10613
+ entries = _context10.sent;
10614
+ return _context10.abrupt("return", resolveCircular(entries, {
10541
10615
  resolveLinks: !withoutLinkResolution,
10542
10616
  removeUnresolved: withoutUnresolvableLinks !== null && withoutUnresolvableLinks !== void 0 ? withoutUnresolvableLinks : false
10543
10617
  }));
10544
10618
  case 11:
10545
- _context12.prev = 11;
10546
- _context12.t0 = _context12["catch"](1);
10547
- errorHandler(_context12.t0);
10619
+ _context10.prev = 11;
10620
+ _context10.t0 = _context10["catch"](1);
10621
+ errorHandler(_context10.t0);
10548
10622
  case 14:
10549
10623
  case "end":
10550
- return _context12.stop();
10624
+ return _context10.stop();
10551
10625
  }
10552
- }, _callee12, null, [[1, 11]]);
10626
+ }, _callee10, null, [[1, 11]]);
10553
10627
  }));
10554
10628
  return _internalGetEntries.apply(this, arguments);
10555
10629
  }
10556
- function getAsset(_x13) {
10630
+ function getAsset(_x11) {
10557
10631
  return _getAsset.apply(this, arguments);
10558
10632
  }
10559
10633
  function _getAsset() {
10560
- _getAsset = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee13(id) {
10634
+ _getAsset = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee11(id) {
10561
10635
  var query,
10562
- _args13 = arguments;
10563
- return _regeneratorRuntime.wrap(function _callee13$(_context13) {
10564
- while (1) switch (_context13.prev = _context13.next) {
10636
+ _args11 = arguments;
10637
+ return _regeneratorRuntime.wrap(function _callee11$(_context11) {
10638
+ while (1) switch (_context11.prev = _context11.next) {
10565
10639
  case 0:
10566
- query = _args13.length > 1 && _args13[1] !== undefined ? _args13[1] : {};
10567
- return _context13.abrupt("return", makeGetAsset(id, query, options));
10640
+ query = _args11.length > 1 && _args11[1] !== undefined ? _args11[1] : {};
10641
+ return _context11.abrupt("return", makeGetAsset(id, query, options));
10568
10642
  case 2:
10569
10643
  case "end":
10570
- return _context13.stop();
10644
+ return _context11.stop();
10571
10645
  }
10572
- }, _callee13);
10646
+ }, _callee11);
10573
10647
  }));
10574
10648
  return _getAsset.apply(this, arguments);
10575
10649
  }
@@ -10577,19 +10651,19 @@ var contentful = (function (exports) {
10577
10651
  return _getAssets.apply(this, arguments);
10578
10652
  }
10579
10653
  function _getAssets() {
10580
- _getAssets = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee14() {
10654
+ _getAssets = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee12() {
10581
10655
  var query,
10582
- _args14 = arguments;
10583
- return _regeneratorRuntime.wrap(function _callee14$(_context14) {
10584
- while (1) switch (_context14.prev = _context14.next) {
10656
+ _args12 = arguments;
10657
+ return _regeneratorRuntime.wrap(function _callee12$(_context12) {
10658
+ while (1) switch (_context12.prev = _context12.next) {
10585
10659
  case 0:
10586
- query = _args14.length > 0 && _args14[0] !== undefined ? _args14[0] : {};
10587
- return _context14.abrupt("return", makeGetAssets(query, options));
10660
+ query = _args12.length > 0 && _args12[0] !== undefined ? _args12[0] : {};
10661
+ return _context12.abrupt("return", makeGetAssets(query, options));
10588
10662
  case 2:
10589
10663
  case "end":
10590
- return _context14.stop();
10664
+ return _context12.stop();
10591
10665
  }
10592
- }, _callee14);
10666
+ }, _callee12);
10593
10667
  }));
10594
10668
  return _getAssets.apply(this, arguments);
10595
10669
  }
@@ -10597,40 +10671,40 @@ var contentful = (function (exports) {
10597
10671
  return _getAssetsWithCursor.apply(this, arguments);
10598
10672
  }
10599
10673
  function _getAssetsWithCursor() {
10600
- _getAssetsWithCursor = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee15() {
10674
+ _getAssetsWithCursor = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee13() {
10601
10675
  var query,
10602
10676
  response,
10603
- _args15 = arguments;
10604
- return _regeneratorRuntime.wrap(function _callee15$(_context15) {
10605
- while (1) switch (_context15.prev = _context15.next) {
10677
+ _args13 = arguments;
10678
+ return _regeneratorRuntime.wrap(function _callee13$(_context13) {
10679
+ while (1) switch (_context13.prev = _context13.next) {
10606
10680
  case 0:
10607
- query = _args15.length > 0 && _args15[0] !== undefined ? _args15[0] : {};
10608
- _context15.next = 3;
10681
+ query = _args13.length > 0 && _args13[0] !== undefined ? _args13[0] : {};
10682
+ _context13.next = 3;
10609
10683
  return makeGetAssets(normalizeCursorPaginationParameters(query), options);
10610
10684
  case 3:
10611
- response = _context15.sent;
10612
- return _context15.abrupt("return", normalizeCursorPaginationResponse(response));
10685
+ response = _context13.sent;
10686
+ return _context13.abrupt("return", normalizeCursorPaginationResponse(response));
10613
10687
  case 5:
10614
10688
  case "end":
10615
- return _context15.stop();
10689
+ return _context13.stop();
10616
10690
  }
10617
- }, _callee15);
10691
+ }, _callee13);
10618
10692
  }));
10619
10693
  return _getAssetsWithCursor.apply(this, arguments);
10620
10694
  }
10621
- function makeGetAssets(_x14) {
10695
+ function makeGetAssets(_x12) {
10622
10696
  return _makeGetAssets.apply(this, arguments);
10623
10697
  }
10624
10698
  function _makeGetAssets() {
10625
- _makeGetAssets = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee16(query) {
10699
+ _makeGetAssets = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee14(query) {
10626
10700
  var options,
10627
10701
  withAllLocales,
10628
10702
  localeSpecificQuery,
10629
- _args16 = arguments;
10630
- return _regeneratorRuntime.wrap(function _callee16$(_context16) {
10631
- while (1) switch (_context16.prev = _context16.next) {
10703
+ _args14 = arguments;
10704
+ return _regeneratorRuntime.wrap(function _callee14$(_context14) {
10705
+ while (1) switch (_context14.prev = _context14.next) {
10632
10706
  case 0:
10633
- options = _args16.length > 1 && _args16[1] !== undefined ? _args16[1] : {
10707
+ options = _args14.length > 1 && _args14[1] !== undefined ? _args14[1] : {
10634
10708
  withAllLocales: false,
10635
10709
  withoutLinkResolution: false,
10636
10710
  withoutUnresolvableLinks: false,
@@ -10642,26 +10716,26 @@ var contentful = (function (exports) {
10642
10716
  localeSpecificQuery = withAllLocales ? Object.assign(Object.assign({}, query), {
10643
10717
  locale: '*'
10644
10718
  }) : query;
10645
- return _context16.abrupt("return", internalGetAssets(localeSpecificQuery, options));
10719
+ return _context14.abrupt("return", internalGetAssets(localeSpecificQuery, options));
10646
10720
  case 6:
10647
10721
  case "end":
10648
- return _context16.stop();
10722
+ return _context14.stop();
10649
10723
  }
10650
- }, _callee16);
10724
+ }, _callee14);
10651
10725
  }));
10652
10726
  return _makeGetAssets.apply(this, arguments);
10653
10727
  }
10654
- function internalGetAsset(_x15, _x16, _x17) {
10728
+ function internalGetAsset(_x13, _x14, _x15) {
10655
10729
  return _internalGetAsset.apply(this, arguments);
10656
10730
  }
10657
10731
  function _internalGetAsset() {
10658
- _internalGetAsset = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee17(id, query, options) {
10732
+ _internalGetAsset = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee15(id, query, options) {
10659
10733
  var withLocaleBasedPublishing, baseConfig, config;
10660
- return _regeneratorRuntime.wrap(function _callee17$(_context17) {
10661
- while (1) switch (_context17.prev = _context17.next) {
10734
+ return _regeneratorRuntime.wrap(function _callee15$(_context15) {
10735
+ while (1) switch (_context15.prev = _context15.next) {
10662
10736
  case 0:
10663
10737
  withLocaleBasedPublishing = options.withLocaleBasedPublishing;
10664
- _context17.prev = 1;
10738
+ _context15.prev = 1;
10665
10739
  baseConfig = createRequestConfig({
10666
10740
  query: prepareQuery(query)
10667
10741
  });
@@ -10671,36 +10745,36 @@ var contentful = (function (exports) {
10671
10745
  'X-Contentful-Locale-Based-Publishing': true
10672
10746
  });
10673
10747
  }
10674
- return _context17.abrupt("return", get({
10748
+ return _context15.abrupt("return", get({
10675
10749
  context: 'environment',
10676
10750
  path: maybeEnableTimelinePreview("assets/".concat(id)),
10677
10751
  config: config
10678
10752
  }));
10679
10753
  case 8:
10680
- _context17.prev = 8;
10681
- _context17.t0 = _context17["catch"](1);
10682
- errorHandler(_context17.t0);
10754
+ _context15.prev = 8;
10755
+ _context15.t0 = _context15["catch"](1);
10756
+ errorHandler(_context15.t0);
10683
10757
  case 11:
10684
10758
  case "end":
10685
- return _context17.stop();
10759
+ return _context15.stop();
10686
10760
  }
10687
- }, _callee17, null, [[1, 8]]);
10761
+ }, _callee15, null, [[1, 8]]);
10688
10762
  }));
10689
10763
  return _internalGetAsset.apply(this, arguments);
10690
10764
  }
10691
- function makeGetAsset(_x18, _x19) {
10765
+ function makeGetAsset(_x16, _x17) {
10692
10766
  return _makeGetAsset.apply(this, arguments);
10693
10767
  }
10694
10768
  function _makeGetAsset() {
10695
- _makeGetAsset = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee18(id, query) {
10769
+ _makeGetAsset = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee16(id, query) {
10696
10770
  var options,
10697
10771
  withAllLocales,
10698
10772
  localeSpecificQuery,
10699
- _args18 = arguments;
10700
- return _regeneratorRuntime.wrap(function _callee18$(_context18) {
10701
- while (1) switch (_context18.prev = _context18.next) {
10773
+ _args16 = arguments;
10774
+ return _regeneratorRuntime.wrap(function _callee16$(_context16) {
10775
+ while (1) switch (_context16.prev = _context16.next) {
10702
10776
  case 0:
10703
- options = _args18.length > 2 && _args18[2] !== undefined ? _args18[2] : {
10777
+ options = _args16.length > 2 && _args16[2] !== undefined ? _args16[2] : {
10704
10778
  withAllLocales: false,
10705
10779
  withoutLinkResolution: false,
10706
10780
  withoutUnresolvableLinks: false,
@@ -10712,26 +10786,26 @@ var contentful = (function (exports) {
10712
10786
  localeSpecificQuery = withAllLocales ? Object.assign(Object.assign({}, query), {
10713
10787
  locale: '*'
10714
10788
  }) : query;
10715
- return _context18.abrupt("return", internalGetAsset(id, localeSpecificQuery, options));
10789
+ return _context16.abrupt("return", internalGetAsset(id, localeSpecificQuery, options));
10716
10790
  case 6:
10717
10791
  case "end":
10718
- return _context18.stop();
10792
+ return _context16.stop();
10719
10793
  }
10720
- }, _callee18);
10794
+ }, _callee16);
10721
10795
  }));
10722
10796
  return _makeGetAsset.apply(this, arguments);
10723
10797
  }
10724
- function internalGetAssets(_x20, _x21) {
10798
+ function internalGetAssets(_x18, _x19) {
10725
10799
  return _internalGetAssets.apply(this, arguments);
10726
10800
  }
10727
10801
  function _internalGetAssets() {
10728
- _internalGetAssets = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee19(query, options) {
10802
+ _internalGetAssets = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee17(query, options) {
10729
10803
  var withLocaleBasedPublishing, baseConfig, config;
10730
- return _regeneratorRuntime.wrap(function _callee19$(_context19) {
10731
- while (1) switch (_context19.prev = _context19.next) {
10804
+ return _regeneratorRuntime.wrap(function _callee17$(_context17) {
10805
+ while (1) switch (_context17.prev = _context17.next) {
10732
10806
  case 0:
10733
10807
  withLocaleBasedPublishing = options.withLocaleBasedPublishing;
10734
- _context19.prev = 1;
10808
+ _context17.prev = 1;
10735
10809
  baseConfig = createRequestConfig({
10736
10810
  query: prepareQuery(query)
10737
10811
  });
@@ -10741,40 +10815,40 @@ var contentful = (function (exports) {
10741
10815
  'X-Contentful-Locale-Based-Publishing': true
10742
10816
  });
10743
10817
  }
10744
- return _context19.abrupt("return", get({
10818
+ return _context17.abrupt("return", get({
10745
10819
  context: 'environment',
10746
10820
  path: maybeEnableTimelinePreview('assets'),
10747
10821
  config: config
10748
10822
  }));
10749
10823
  case 8:
10750
- _context19.prev = 8;
10751
- _context19.t0 = _context19["catch"](1);
10752
- errorHandler(_context19.t0);
10824
+ _context17.prev = 8;
10825
+ _context17.t0 = _context17["catch"](1);
10826
+ errorHandler(_context17.t0);
10753
10827
  case 11:
10754
10828
  case "end":
10755
- return _context19.stop();
10829
+ return _context17.stop();
10756
10830
  }
10757
- }, _callee19, null, [[1, 8]]);
10831
+ }, _callee17, null, [[1, 8]]);
10758
10832
  }));
10759
10833
  return _internalGetAssets.apply(this, arguments);
10760
10834
  }
10761
- function getTag(_x22) {
10835
+ function getTag(_x20) {
10762
10836
  return _getTag.apply(this, arguments);
10763
10837
  }
10764
10838
  function _getTag() {
10765
- _getTag = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee20(id) {
10766
- return _regeneratorRuntime.wrap(function _callee20$(_context20) {
10767
- while (1) switch (_context20.prev = _context20.next) {
10839
+ _getTag = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee18(id) {
10840
+ return _regeneratorRuntime.wrap(function _callee18$(_context18) {
10841
+ while (1) switch (_context18.prev = _context18.next) {
10768
10842
  case 0:
10769
- return _context20.abrupt("return", get({
10843
+ return _context18.abrupt("return", get({
10770
10844
  context: 'environment',
10771
10845
  path: "tags/".concat(id)
10772
10846
  }));
10773
10847
  case 1:
10774
10848
  case "end":
10775
- return _context20.stop();
10849
+ return _context18.stop();
10776
10850
  }
10777
- }, _callee20);
10851
+ }, _callee18);
10778
10852
  }));
10779
10853
  return _getTag.apply(this, arguments);
10780
10854
  }
@@ -10782,15 +10856,15 @@ var contentful = (function (exports) {
10782
10856
  return _getTags.apply(this, arguments);
10783
10857
  }
10784
10858
  function _getTags() {
10785
- _getTags = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee21() {
10859
+ _getTags = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee19() {
10786
10860
  var query,
10787
- _args21 = arguments;
10788
- return _regeneratorRuntime.wrap(function _callee21$(_context21) {
10789
- while (1) switch (_context21.prev = _context21.next) {
10861
+ _args19 = arguments;
10862
+ return _regeneratorRuntime.wrap(function _callee19$(_context19) {
10863
+ while (1) switch (_context19.prev = _context19.next) {
10790
10864
  case 0:
10791
- query = _args21.length > 0 && _args21[0] !== undefined ? _args21[0] : {};
10865
+ query = _args19.length > 0 && _args19[0] !== undefined ? _args19[0] : {};
10792
10866
  validateSearchParameters(query);
10793
- return _context21.abrupt("return", get({
10867
+ return _context19.abrupt("return", get({
10794
10868
  context: 'environment',
10795
10869
  path: 'tags',
10796
10870
  config: createRequestConfig({
@@ -10799,20 +10873,20 @@ var contentful = (function (exports) {
10799
10873
  }));
10800
10874
  case 3:
10801
10875
  case "end":
10802
- return _context21.stop();
10876
+ return _context19.stop();
10803
10877
  }
10804
- }, _callee21);
10878
+ }, _callee19);
10805
10879
  }));
10806
10880
  return _getTags.apply(this, arguments);
10807
10881
  }
10808
- function createAssetKey(_x23) {
10882
+ function createAssetKey(_x21) {
10809
10883
  return _createAssetKey.apply(this, arguments);
10810
10884
  }
10811
10885
  function _createAssetKey() {
10812
- _createAssetKey = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee22(expiresAt) {
10886
+ _createAssetKey = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee20(expiresAt) {
10813
10887
  var now, currentMaxLifetime;
10814
- return _regeneratorRuntime.wrap(function _callee22$(_context22) {
10815
- while (1) switch (_context22.prev = _context22.next) {
10888
+ return _regeneratorRuntime.wrap(function _callee20$(_context20) {
10889
+ while (1) switch (_context20.prev = _context20.next) {
10816
10890
  case 0:
10817
10891
  try {
10818
10892
  now = Math.floor(Date.now() / 1000);
@@ -10824,7 +10898,7 @@ var contentful = (function (exports) {
10824
10898
  } catch (error) {
10825
10899
  errorHandler(error);
10826
10900
  }
10827
- return _context22.abrupt("return", post({
10901
+ return _context20.abrupt("return", post({
10828
10902
  context: 'environment',
10829
10903
  path: 'asset_keys',
10830
10904
  data: {
@@ -10833,9 +10907,9 @@ var contentful = (function (exports) {
10833
10907
  }));
10834
10908
  case 2:
10835
10909
  case "end":
10836
- return _context22.stop();
10910
+ return _context20.stop();
10837
10911
  }
10838
- }, _callee22);
10912
+ }, _callee20);
10839
10913
  }));
10840
10914
  return _createAssetKey.apply(this, arguments);
10841
10915
  }
@@ -10843,15 +10917,15 @@ var contentful = (function (exports) {
10843
10917
  return _getLocales.apply(this, arguments);
10844
10918
  }
10845
10919
  function _getLocales() {
10846
- _getLocales = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee23() {
10920
+ _getLocales = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee21() {
10847
10921
  var query,
10848
- _args23 = arguments;
10849
- return _regeneratorRuntime.wrap(function _callee23$(_context23) {
10850
- while (1) switch (_context23.prev = _context23.next) {
10922
+ _args21 = arguments;
10923
+ return _regeneratorRuntime.wrap(function _callee21$(_context21) {
10924
+ while (1) switch (_context21.prev = _context21.next) {
10851
10925
  case 0:
10852
- query = _args23.length > 0 && _args23[0] !== undefined ? _args23[0] : {};
10926
+ query = _args21.length > 0 && _args21[0] !== undefined ? _args21[0] : {};
10853
10927
  validateSearchParameters(query);
10854
- return _context23.abrupt("return", get({
10928
+ return _context21.abrupt("return", get({
10855
10929
  context: 'environment',
10856
10930
  path: 'locales',
10857
10931
  config: createRequestConfig({
@@ -10860,46 +10934,46 @@ var contentful = (function (exports) {
10860
10934
  }));
10861
10935
  case 3:
10862
10936
  case "end":
10863
- return _context23.stop();
10937
+ return _context21.stop();
10864
10938
  }
10865
- }, _callee23);
10939
+ }, _callee21);
10866
10940
  }));
10867
10941
  return _getLocales.apply(this, arguments);
10868
10942
  }
10869
- function sync(_x24) {
10943
+ function sync(_x22) {
10870
10944
  return _sync.apply(this, arguments);
10871
10945
  }
10872
10946
  function _sync() {
10873
- _sync = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee24(query) {
10947
+ _sync = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee22(query) {
10874
10948
  var syncOptions,
10875
- _args24 = arguments;
10876
- return _regeneratorRuntime.wrap(function _callee24$(_context24) {
10877
- while (1) switch (_context24.prev = _context24.next) {
10949
+ _args22 = arguments;
10950
+ return _regeneratorRuntime.wrap(function _callee22$(_context22) {
10951
+ while (1) switch (_context22.prev = _context22.next) {
10878
10952
  case 0:
10879
- syncOptions = _args24.length > 1 && _args24[1] !== undefined ? _args24[1] : {
10953
+ syncOptions = _args22.length > 1 && _args22[1] !== undefined ? _args22[1] : {
10880
10954
  paginate: true
10881
10955
  };
10882
- return _context24.abrupt("return", makePagedSync(query, syncOptions, options));
10956
+ return _context22.abrupt("return", makePagedSync(query, syncOptions, options));
10883
10957
  case 2:
10884
10958
  case "end":
10885
- return _context24.stop();
10959
+ return _context22.stop();
10886
10960
  }
10887
- }, _callee24);
10961
+ }, _callee22);
10888
10962
  }));
10889
10963
  return _sync.apply(this, arguments);
10890
10964
  }
10891
- function makePagedSync(_x25, _x26) {
10965
+ function makePagedSync(_x23, _x24) {
10892
10966
  return _makePagedSync.apply(this, arguments);
10893
10967
  }
10894
10968
  function _makePagedSync() {
10895
- _makePagedSync = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee25(query, syncOptions) {
10969
+ _makePagedSync = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee23(query, syncOptions) {
10896
10970
  var options,
10897
10971
  combinedOptions,
10898
- _args25 = arguments;
10899
- return _regeneratorRuntime.wrap(function _callee25$(_context25) {
10900
- while (1) switch (_context25.prev = _context25.next) {
10972
+ _args23 = arguments;
10973
+ return _regeneratorRuntime.wrap(function _callee23$(_context23) {
10974
+ while (1) switch (_context23.prev = _context23.next) {
10901
10975
  case 0:
10902
- options = _args25.length > 2 && _args25[2] !== undefined ? _args25[2] : {
10976
+ options = _args23.length > 2 && _args23[2] !== undefined ? _args23[2] : {
10903
10977
  withAllLocales: false,
10904
10978
  withoutLinkResolution: false,
10905
10979
  withoutUnresolvableLinks: false,
@@ -10909,12 +10983,12 @@ var contentful = (function (exports) {
10909
10983
  validateRemoveUnresolvedParam(query);
10910
10984
  combinedOptions = Object.assign(Object.assign({}, syncOptions), options);
10911
10985
  switchToEnvironment(http);
10912
- return _context25.abrupt("return", pagedSync(http, query, combinedOptions));
10986
+ return _context23.abrupt("return", pagedSync(http, query, combinedOptions));
10913
10987
  case 6:
10914
10988
  case "end":
10915
- return _context25.stop();
10989
+ return _context23.stop();
10916
10990
  }
10917
- }, _callee25);
10991
+ }, _callee23);
10918
10992
  }));
10919
10993
  return _makePagedSync.apply(this, arguments);
10920
10994
  }
@@ -10939,19 +11013,19 @@ var contentful = (function (exports) {
10939
11013
  var query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
10940
11014
  return internalGetConceptScheme(id, query);
10941
11015
  }
10942
- function internalGetConceptScheme(_x27) {
11016
+ function internalGetConceptScheme(_x25) {
10943
11017
  return _internalGetConceptScheme.apply(this, arguments);
10944
11018
  }
10945
11019
  function _internalGetConceptScheme() {
10946
- _internalGetConceptScheme = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee26(id) {
11020
+ _internalGetConceptScheme = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee24(id) {
10947
11021
  var query,
10948
- _args26 = arguments;
10949
- return _regeneratorRuntime.wrap(function _callee26$(_context26) {
10950
- while (1) switch (_context26.prev = _context26.next) {
11022
+ _args24 = arguments;
11023
+ return _regeneratorRuntime.wrap(function _callee24$(_context24) {
11024
+ while (1) switch (_context24.prev = _context24.next) {
10951
11025
  case 0:
10952
- query = _args26.length > 1 && _args26[1] !== undefined ? _args26[1] : {};
10953
- _context26.prev = 1;
10954
- return _context26.abrupt("return", get({
11026
+ query = _args24.length > 1 && _args24[1] !== undefined ? _args24[1] : {};
11027
+ _context24.prev = 1;
11028
+ return _context24.abrupt("return", get({
10955
11029
  context: 'environment',
10956
11030
  path: "taxonomy/concept-schemes/".concat(id),
10957
11031
  config: createRequestConfig({
@@ -10959,14 +11033,14 @@ var contentful = (function (exports) {
10959
11033
  })
10960
11034
  }));
10961
11035
  case 5:
10962
- _context26.prev = 5;
10963
- _context26.t0 = _context26["catch"](1);
10964
- errorHandler(_context26.t0);
11036
+ _context24.prev = 5;
11037
+ _context24.t0 = _context24["catch"](1);
11038
+ errorHandler(_context24.t0);
10965
11039
  case 8:
10966
11040
  case "end":
10967
- return _context26.stop();
11041
+ return _context24.stop();
10968
11042
  }
10969
- }, _callee26, null, [[1, 5]]);
11043
+ }, _callee24, null, [[1, 5]]);
10970
11044
  }));
10971
11045
  return _internalGetConceptScheme.apply(this, arguments);
10972
11046
  }
@@ -10978,15 +11052,15 @@ var contentful = (function (exports) {
10978
11052
  return _internalGetConceptSchemes.apply(this, arguments);
10979
11053
  }
10980
11054
  function _internalGetConceptSchemes() {
10981
- _internalGetConceptSchemes = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee27() {
11055
+ _internalGetConceptSchemes = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee25() {
10982
11056
  var query,
10983
- _args27 = arguments;
10984
- return _regeneratorRuntime.wrap(function _callee27$(_context27) {
10985
- while (1) switch (_context27.prev = _context27.next) {
11057
+ _args25 = arguments;
11058
+ return _regeneratorRuntime.wrap(function _callee25$(_context25) {
11059
+ while (1) switch (_context25.prev = _context25.next) {
10986
11060
  case 0:
10987
- query = _args27.length > 0 && _args27[0] !== undefined ? _args27[0] : {};
10988
- _context27.prev = 1;
10989
- return _context27.abrupt("return", get({
11061
+ query = _args25.length > 0 && _args25[0] !== undefined ? _args25[0] : {};
11062
+ _context25.prev = 1;
11063
+ return _context25.abrupt("return", get({
10990
11064
  context: 'environment',
10991
11065
  path: 'taxonomy/concept-schemes',
10992
11066
  config: createRequestConfig({
@@ -10994,14 +11068,14 @@ var contentful = (function (exports) {
10994
11068
  })
10995
11069
  }));
10996
11070
  case 5:
10997
- _context27.prev = 5;
10998
- _context27.t0 = _context27["catch"](1);
10999
- errorHandler(_context27.t0);
11071
+ _context25.prev = 5;
11072
+ _context25.t0 = _context25["catch"](1);
11073
+ errorHandler(_context25.t0);
11000
11074
  case 8:
11001
11075
  case "end":
11002
- return _context27.stop();
11076
+ return _context25.stop();
11003
11077
  }
11004
- }, _callee27, null, [[1, 5]]);
11078
+ }, _callee25, null, [[1, 5]]);
11005
11079
  }));
11006
11080
  return _internalGetConceptSchemes.apply(this, arguments);
11007
11081
  }
@@ -11009,19 +11083,19 @@ var contentful = (function (exports) {
11009
11083
  var query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
11010
11084
  return internalGetConcept(id, query);
11011
11085
  }
11012
- function internalGetConcept(_x28) {
11086
+ function internalGetConcept(_x26) {
11013
11087
  return _internalGetConcept.apply(this, arguments);
11014
11088
  }
11015
11089
  function _internalGetConcept() {
11016
- _internalGetConcept = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee28(id) {
11090
+ _internalGetConcept = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee26(id) {
11017
11091
  var query,
11018
- _args28 = arguments;
11019
- return _regeneratorRuntime.wrap(function _callee28$(_context28) {
11020
- while (1) switch (_context28.prev = _context28.next) {
11092
+ _args26 = arguments;
11093
+ return _regeneratorRuntime.wrap(function _callee26$(_context26) {
11094
+ while (1) switch (_context26.prev = _context26.next) {
11021
11095
  case 0:
11022
- query = _args28.length > 1 && _args28[1] !== undefined ? _args28[1] : {};
11023
- _context28.prev = 1;
11024
- return _context28.abrupt("return", get({
11096
+ query = _args26.length > 1 && _args26[1] !== undefined ? _args26[1] : {};
11097
+ _context26.prev = 1;
11098
+ return _context26.abrupt("return", get({
11025
11099
  context: 'environment',
11026
11100
  path: "taxonomy/concepts/".concat(id),
11027
11101
  config: createRequestConfig({
@@ -11029,14 +11103,14 @@ var contentful = (function (exports) {
11029
11103
  })
11030
11104
  }));
11031
11105
  case 5:
11032
- _context28.prev = 5;
11033
- _context28.t0 = _context28["catch"](1);
11034
- errorHandler(_context28.t0);
11106
+ _context26.prev = 5;
11107
+ _context26.t0 = _context26["catch"](1);
11108
+ errorHandler(_context26.t0);
11035
11109
  case 8:
11036
11110
  case "end":
11037
- return _context28.stop();
11111
+ return _context26.stop();
11038
11112
  }
11039
- }, _callee28, null, [[1, 5]]);
11113
+ }, _callee26, null, [[1, 5]]);
11040
11114
  }));
11041
11115
  return _internalGetConcept.apply(this, arguments);
11042
11116
  }
@@ -11048,15 +11122,15 @@ var contentful = (function (exports) {
11048
11122
  return _internalGetConcepts.apply(this, arguments);
11049
11123
  }
11050
11124
  function _internalGetConcepts() {
11051
- _internalGetConcepts = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee29() {
11125
+ _internalGetConcepts = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee27() {
11052
11126
  var query,
11053
- _args29 = arguments;
11054
- return _regeneratorRuntime.wrap(function _callee29$(_context29) {
11055
- while (1) switch (_context29.prev = _context29.next) {
11127
+ _args27 = arguments;
11128
+ return _regeneratorRuntime.wrap(function _callee27$(_context27) {
11129
+ while (1) switch (_context27.prev = _context27.next) {
11056
11130
  case 0:
11057
- query = _args29.length > 0 && _args29[0] !== undefined ? _args29[0] : {};
11058
- _context29.prev = 1;
11059
- return _context29.abrupt("return", get({
11131
+ query = _args27.length > 0 && _args27[0] !== undefined ? _args27[0] : {};
11132
+ _context27.prev = 1;
11133
+ return _context27.abrupt("return", get({
11060
11134
  context: 'environment',
11061
11135
  path: 'taxonomy/concepts',
11062
11136
  config: createRequestConfig({
@@ -11064,14 +11138,14 @@ var contentful = (function (exports) {
11064
11138
  })
11065
11139
  }));
11066
11140
  case 5:
11067
- _context29.prev = 5;
11068
- _context29.t0 = _context29["catch"](1);
11069
- errorHandler(_context29.t0);
11141
+ _context27.prev = 5;
11142
+ _context27.t0 = _context27["catch"](1);
11143
+ errorHandler(_context27.t0);
11070
11144
  case 8:
11071
11145
  case "end":
11072
- return _context29.stop();
11146
+ return _context27.stop();
11073
11147
  }
11074
- }, _callee29, null, [[1, 5]]);
11148
+ }, _callee27, null, [[1, 5]]);
11075
11149
  }));
11076
11150
  return _internalGetConcepts.apply(this, arguments);
11077
11151
  }
@@ -11079,19 +11153,19 @@ var contentful = (function (exports) {
11079
11153
  var query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
11080
11154
  return internalGetConceptAncestors(id, query);
11081
11155
  }
11082
- function internalGetConceptAncestors(_x29) {
11156
+ function internalGetConceptAncestors(_x27) {
11083
11157
  return _internalGetConceptAncestors.apply(this, arguments);
11084
11158
  }
11085
11159
  function _internalGetConceptAncestors() {
11086
- _internalGetConceptAncestors = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee30(id) {
11160
+ _internalGetConceptAncestors = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee28(id) {
11087
11161
  var query,
11088
- _args30 = arguments;
11089
- return _regeneratorRuntime.wrap(function _callee30$(_context30) {
11090
- while (1) switch (_context30.prev = _context30.next) {
11162
+ _args28 = arguments;
11163
+ return _regeneratorRuntime.wrap(function _callee28$(_context28) {
11164
+ while (1) switch (_context28.prev = _context28.next) {
11091
11165
  case 0:
11092
- query = _args30.length > 1 && _args30[1] !== undefined ? _args30[1] : {};
11093
- _context30.prev = 1;
11094
- return _context30.abrupt("return", get({
11166
+ query = _args28.length > 1 && _args28[1] !== undefined ? _args28[1] : {};
11167
+ _context28.prev = 1;
11168
+ return _context28.abrupt("return", get({
11095
11169
  context: 'environment',
11096
11170
  path: "taxonomy/concepts/".concat(id, "/ancestors"),
11097
11171
  config: createRequestConfig({
@@ -11099,14 +11173,14 @@ var contentful = (function (exports) {
11099
11173
  })
11100
11174
  }));
11101
11175
  case 5:
11102
- _context30.prev = 5;
11103
- _context30.t0 = _context30["catch"](1);
11104
- errorHandler(_context30.t0);
11176
+ _context28.prev = 5;
11177
+ _context28.t0 = _context28["catch"](1);
11178
+ errorHandler(_context28.t0);
11105
11179
  case 8:
11106
11180
  case "end":
11107
- return _context30.stop();
11181
+ return _context28.stop();
11108
11182
  }
11109
- }, _callee30, null, [[1, 5]]);
11183
+ }, _callee28, null, [[1, 5]]);
11110
11184
  }));
11111
11185
  return _internalGetConceptAncestors.apply(this, arguments);
11112
11186
  }
@@ -11114,22 +11188,22 @@ var contentful = (function (exports) {
11114
11188
  var query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
11115
11189
  return internalGetConceptDescendants(id, query);
11116
11190
  }
11117
- function internalGetConceptDescendants(_x30) {
11191
+ function internalGetConceptDescendants(_x28) {
11118
11192
  return _internalGetConceptDescendants.apply(this, arguments);
11119
11193
  }
11120
11194
  /*
11121
11195
  * Switches BaseURL to use /environments path
11122
11196
  * */
11123
11197
  function _internalGetConceptDescendants() {
11124
- _internalGetConceptDescendants = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee31(id) {
11198
+ _internalGetConceptDescendants = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee29(id) {
11125
11199
  var query,
11126
- _args31 = arguments;
11127
- return _regeneratorRuntime.wrap(function _callee31$(_context31) {
11128
- while (1) switch (_context31.prev = _context31.next) {
11200
+ _args29 = arguments;
11201
+ return _regeneratorRuntime.wrap(function _callee29$(_context29) {
11202
+ while (1) switch (_context29.prev = _context29.next) {
11129
11203
  case 0:
11130
- query = _args31.length > 1 && _args31[1] !== undefined ? _args31[1] : {};
11131
- _context31.prev = 1;
11132
- return _context31.abrupt("return", get({
11204
+ query = _args29.length > 1 && _args29[1] !== undefined ? _args29[1] : {};
11205
+ _context29.prev = 1;
11206
+ return _context29.abrupt("return", get({
11133
11207
  context: 'environment',
11134
11208
  path: "taxonomy/concepts/".concat(id, "/descendants"),
11135
11209
  config: createRequestConfig({
@@ -11137,14 +11211,14 @@ var contentful = (function (exports) {
11137
11211
  })
11138
11212
  }));
11139
11213
  case 5:
11140
- _context31.prev = 5;
11141
- _context31.t0 = _context31["catch"](1);
11142
- errorHandler(_context31.t0);
11214
+ _context29.prev = 5;
11215
+ _context29.t0 = _context29["catch"](1);
11216
+ errorHandler(_context29.t0);
11143
11217
  case 8:
11144
11218
  case "end":
11145
- return _context31.stop();
11219
+ return _context29.stop();
11146
11220
  }
11147
- }, _callee31, null, [[1, 5]]);
11221
+ }, _callee29, null, [[1, 5]]);
11148
11222
  }));
11149
11223
  return _internalGetConceptDescendants.apply(this, arguments);
11150
11224
  }