contentful-management 7.45.3 → 7.45.7

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.
@@ -4353,6 +4353,7 @@ var match = String.prototype.match;
4353
4353
  var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;
4354
4354
  var gOPS = Object.getOwnPropertySymbols;
4355
4355
  var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;
4356
+ var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';
4356
4357
  var isEnumerable = Object.prototype.propertyIsEnumerable;
4357
4358
 
4358
4359
  var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (
@@ -4365,7 +4366,7 @@ var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPr
4365
4366
 
4366
4367
  var inspectCustom = __webpack_require__(/*! ./util.inspect */ 1).custom;
4367
4368
  var inspectSymbol = inspectCustom && isSymbol(inspectCustom) ? inspectCustom : null;
4368
- var toStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol' ? Symbol.toStringTag : null;
4369
+ var toStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag !== 'undefined' ? Symbol.toStringTag : null;
4369
4370
 
4370
4371
  module.exports = function inspect_(obj, options, depth, seen) {
4371
4372
  var opts = options || {};
@@ -4382,8 +4383,8 @@ module.exports = function inspect_(obj, options, depth, seen) {
4382
4383
  throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
4383
4384
  }
4384
4385
  var customInspect = has(opts, 'customInspect') ? opts.customInspect : true;
4385
- if (typeof customInspect !== 'boolean') {
4386
- throw new TypeError('option "customInspect", if provided, must be `true` or `false`');
4386
+ if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {
4387
+ throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`');
4387
4388
  }
4388
4389
 
4389
4390
  if (
@@ -4455,8 +4456,8 @@ module.exports = function inspect_(obj, options, depth, seen) {
4455
4456
  return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + keys.join(', ') + ' }' : '');
4456
4457
  }
4457
4458
  if (isSymbol(obj)) {
4458
- var symString = symToString.call(obj);
4459
- return typeof obj === 'object' ? markBoxed(symString) : symString;
4459
+ var symString = hasShammedSymbols ? String(obj).replace(/^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj);
4460
+ return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;
4460
4461
  }
4461
4462
  if (isElement(obj)) {
4462
4463
  var s = '<' + String(obj.nodeName).toLowerCase();
@@ -4485,7 +4486,7 @@ module.exports = function inspect_(obj, options, depth, seen) {
4485
4486
  if (typeof obj === 'object' && customInspect) {
4486
4487
  if (inspectSymbol && typeof obj[inspectSymbol] === 'function') {
4487
4488
  return obj[inspectSymbol]();
4488
- } else if (typeof obj.inspect === 'function') {
4489
+ } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {
4489
4490
  return obj.inspect();
4490
4491
  }
4491
4492
  }
@@ -4559,6 +4560,9 @@ function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toString
4559
4560
 
4560
4561
  // Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives
4561
4562
  function isSymbol(obj) {
4563
+ if (hasShammedSymbols) {
4564
+ return obj && typeof obj === 'object' && obj instanceof Symbol;
4565
+ }
4562
4566
  if (typeof obj === 'symbol') {
4563
4567
  return true;
4564
4568
  }
@@ -4766,17 +4770,28 @@ function arrObjKeys(obj, inspect) {
4766
4770
  xs[i] = has(obj, i) ? inspect(obj[i], obj) : '';
4767
4771
  }
4768
4772
  }
4773
+ var syms = typeof gOPS === 'function' ? gOPS(obj) : [];
4774
+ var symMap;
4775
+ if (hasShammedSymbols) {
4776
+ symMap = {};
4777
+ for (var k = 0; k < syms.length; k++) {
4778
+ symMap['$' + syms[k]] = syms[k];
4779
+ }
4780
+ }
4781
+
4769
4782
  for (var key in obj) { // eslint-disable-line no-restricted-syntax
4770
4783
  if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
4771
4784
  if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
4772
- if ((/[^\w$]/).test(key)) {
4785
+ if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {
4786
+ // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section
4787
+ continue; // eslint-disable-line no-restricted-syntax, no-continue
4788
+ } else if ((/[^\w$]/).test(key)) {
4773
4789
  xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));
4774
4790
  } else {
4775
4791
  xs.push(key + ': ' + inspect(obj[key], obj));
4776
4792
  }
4777
4793
  }
4778
4794
  if (typeof gOPS === 'function') {
4779
- var syms = gOPS(obj);
4780
4795
  for (var j = 0; j < syms.length; j++) {
4781
4796
  if (isEnumerable.call(obj, syms[j])) {
4782
4797
  xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));
@@ -7202,9 +7217,10 @@ var references = function references(http, params) {
7202
7217
  var spaceId = params.spaceId,
7203
7218
  environmentId = params.environmentId,
7204
7219
  entryId = params.entryId,
7205
- _params$maxDepth = params.maxDepth,
7206
- maxDepth = _params$maxDepth === void 0 ? 2 : _params$maxDepth;
7207
- return _raw__WEBPACK_IMPORTED_MODULE_1__["get"](http, "/spaces/".concat(spaceId, "/environments/").concat(environmentId, "/entries/").concat(entryId, "/references?include=").concat(maxDepth));
7220
+ maxDepth = params.maxDepth,
7221
+ include = params.include;
7222
+ var level = include || maxDepth || 2;
7223
+ return _raw__WEBPACK_IMPORTED_MODULE_1__["get"](http, "/spaces/".concat(spaceId, "/environments/").concat(environmentId, "/entries/").concat(entryId, "/references?include=").concat(level));
7208
7224
  };
7209
7225
 
7210
7226
  /***/ }),
@@ -9146,18 +9162,32 @@ var RestAdapter = /*#__PURE__*/function () {
9146
9162
  return RestAdapter;
9147
9163
  }();
9148
9164
 
9165
+ /***/ }),
9166
+
9167
+ /***/ "./common-types.ts":
9168
+ /*!*************************!*\
9169
+ !*** ./common-types.ts ***!
9170
+ \*************************/
9171
+ /*! no exports provided */
9172
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
9173
+
9174
+ "use strict";
9175
+ __webpack_require__.r(__webpack_exports__);
9176
+
9177
+
9149
9178
  /***/ }),
9150
9179
 
9151
9180
  /***/ "./common-utils.ts":
9152
9181
  /*!*************************!*\
9153
9182
  !*** ./common-utils.ts ***!
9154
9183
  \*************************/
9155
- /*! exports provided: wrapCollection */
9184
+ /*! exports provided: wrapCollection, wrapCursorPaginatedCollection */
9156
9185
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
9157
9186
 
9158
9187
  "use strict";
9159
9188
  __webpack_require__.r(__webpack_exports__);
9160
9189
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapCollection", function() { return wrapCollection; });
9190
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapCursorPaginatedCollection", function() { return wrapCursorPaginatedCollection; });
9161
9191
  /* harmony import */ var contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! contentful-sdk-core */ "../node_modules/contentful-sdk-core/dist/index.es-modules.js");
9162
9192
  /* harmony import */ var fast_copy__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! fast-copy */ "../node_modules/fast-copy/dist/fast-copy.js");
9163
9193
  /* harmony import */ var fast_copy__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(fast_copy__WEBPACK_IMPORTED_MODULE_1__);
@@ -9183,6 +9213,21 @@ var wrapCollection = function wrapCollection(fn) {
9183
9213
  return collectionData;
9184
9214
  };
9185
9215
  };
9216
+ var wrapCursorPaginatedCollection = function wrapCursorPaginatedCollection(fn) {
9217
+ return function (makeRequest, data) {
9218
+ for (var _len2 = arguments.length, rest = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
9219
+ rest[_key2 - 2] = arguments[_key2];
9220
+ }
9221
+
9222
+ var collectionData = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["toPlainObject"])(fast_copy__WEBPACK_IMPORTED_MODULE_1___default()(data)); // @ts-expect-error
9223
+
9224
+ collectionData.items = collectionData.items.map(function (entity) {
9225
+ return fn.apply(void 0, [makeRequest, entity].concat(rest));
9226
+ }); // @ts-expect-error
9227
+
9228
+ return collectionData;
9229
+ };
9230
+ };
9186
9231
 
9187
9232
  /***/ }),
9188
9233
 
@@ -9668,7 +9713,8 @@ __webpack_require__.r(__webpack_exports__);
9668
9713
  /* harmony import */ var _adapters_REST_rest_adapter__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./adapters/REST/rest-adapter */ "./adapters/REST/rest-adapter.ts");
9669
9714
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RestAdapter", function() { return _adapters_REST_rest_adapter__WEBPACK_IMPORTED_MODULE_7__["RestAdapter"]; });
9670
9715
 
9671
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
9716
+ /* harmony import */ var _export_types__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./export-types */ "./export-types.ts");
9717
+ /* empty/unused harmony star reexport */function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
9672
9718
 
9673
9719
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
9674
9720
 
@@ -9690,11 +9736,12 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
9690
9736
 
9691
9737
 
9692
9738
 
9739
+
9693
9740
  function createClient(params) {
9694
9741
  var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
9695
9742
  var sdkMain = opts.type === 'plain' ? 'contentful-management-plain.js' : 'contentful-management.js';
9696
9743
  var userAgent = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["getUserAgentHeader"])( // @ts-expect-error
9697
- "".concat(sdkMain, "/").concat("7.45.3"), params.application, params.integration, params.feature);
9744
+ "".concat(sdkMain, "/").concat("7.45.7"), params.application, params.integration, params.feature);
9698
9745
  var adapter = Object(_create_adapter__WEBPACK_IMPORTED_MODULE_1__["createAdapter"])(params); // Parameters<?> and ReturnType<?> only return the types of the last overload
9699
9746
  // https://github.com/microsoft/TypeScript/issues/26591
9700
9747
  // @ts-expect-error
@@ -10934,7 +10981,7 @@ function createEntryApi(makeRequest) {
10934
10981
  spaceId: raw.sys.space.sys.id,
10935
10982
  environmentId: raw.sys.environment.sys.id,
10936
10983
  entryId: raw.sys.id,
10937
- maxDepth: options === null || options === void 0 ? void 0 : options.maxDepth
10984
+ maxDepth: (options === null || options === void 0 ? void 0 : options.include) || (options === null || options === void 0 ? void 0 : options.maxDepth)
10938
10985
  }
10939
10986
  }).then(function (response) {
10940
10987
  return wrapEntryCollection(makeRequest, response);
@@ -11774,7 +11821,8 @@ function createEnvironmentApi(makeRequest) {
11774
11821
  /**
11775
11822
  * Get entry references
11776
11823
  * @param entryId - Entry ID
11777
- * @param {Object} options.maxDepth - Level of the entry descendants from 1 up to 10 maximum
11824
+ * @param {Object} options.include - Level of the entry descendants from 1 up to 10 maximum
11825
+ * @param {Object} options.maxDepth - alias for `include`. Deprecated, please use `include`
11778
11826
  * @returns Promise of Entry references
11779
11827
  * @example ```javascript
11780
11828
  * const contentful = require('contentful-management');
@@ -11786,10 +11834,10 @@ function createEnvironmentApi(makeRequest) {
11786
11834
  * // Get entry references
11787
11835
  * client.getSpace('<space_id>')
11788
11836
  * .then((space) => space.getEnvironment('<environment_id>'))
11789
- * .then((environment) => environment.getEntryReferences('<entry_id>', {maxDepth: number}))
11837
+ * .then((environment) => environment.getEntryReferences('<entry_id>', {include: number}))
11790
11838
  * .then((entry) => console.log(entry.includes))
11791
11839
  * // or
11792
- * .then((environment) => environment.getEntry('<entry_id>')).then((entry) => entry.references({maxDepth: number}))
11840
+ * .then((environment) => environment.getEntry('<entry_id>')).then((entry) => entry.references({include: number}))
11793
11841
  * .catch(console.error)
11794
11842
  * ```
11795
11843
  */
@@ -11802,7 +11850,11 @@ function createEnvironmentApi(makeRequest) {
11802
11850
  spaceId: raw.sys.space.sys.id,
11803
11851
  environmentId: raw.sys.id,
11804
11852
  entryId: entryId,
11805
- maxDepth: options === null || options === void 0 ? void 0 : options.maxDepth
11853
+
11854
+ /**
11855
+ * @deprecated use `include` instead
11856
+ */
11857
+ maxDepth: (options === null || options === void 0 ? void 0 : options.include) || (options === null || options === void 0 ? void 0 : options.maxDepth)
11806
11858
  }
11807
11859
  }).then(function (response) {
11808
11860
  return wrapEntryCollection(makeRequest, response);
@@ -15316,13 +15368,15 @@ function createSpaceApi(makeRequest) {
15316
15368
  * }
15317
15369
  * },
15318
15370
  * environment: {
15319
- * type: 'Link',
15320
- * linkType: 'Environment',
15321
- * id: '<environment_id>'
15371
+ * sys: {
15372
+ * type: 'Link',
15373
+ * linkType: 'Environment',
15374
+ * id: '<environment_id>'
15375
+ * }
15322
15376
  * },
15323
15377
  * action: 'publish',
15324
15378
  * scheduledFor: {
15325
- * dateTime: <ISO_date_string>,
15379
+ * datetime: <ISO_date_string>,
15326
15380
  * timezone: 'Europe/Berlin'
15327
15381
  * }
15328
15382
  * }))
@@ -15369,13 +15423,15 @@ function createSpaceApi(makeRequest) {
15369
15423
  * }
15370
15424
  * },
15371
15425
  * environment: {
15372
- * type: 'Link',
15373
- * linkType: 'Environment',
15374
- * id: '<environment_id>'
15426
+ * sys: {
15427
+ * type: 'Link',
15428
+ * linkType: 'Environment',
15429
+ * id: '<environment_id>'
15430
+ * }
15375
15431
  * },
15376
15432
  * action: 'publish',
15377
15433
  * scheduledFor: {
15378
- * dateTime: <ISO_date_string>,
15434
+ * datetime: <ISO_date_string>,
15379
15435
  * timezone: 'Europe/Berlin'
15380
15436
  * }
15381
15437
  * })
@@ -17686,7 +17742,7 @@ function wrapRelease(makeRequest, data) {
17686
17742
  * @private
17687
17743
  */
17688
17744
 
17689
- var wrapReleaseCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_2__["wrapCollection"])(wrapRelease);
17745
+ var wrapReleaseCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_2__["wrapCursorPaginatedCollection"])(wrapRelease);
17690
17746
 
17691
17747
  /***/ }),
17692
17748
 
@@ -17845,13 +17901,15 @@ function getInstanceMethods(makeRequest) {
17845
17901
  * }
17846
17902
  * },
17847
17903
  * environment: {
17848
- * type: 'Link',
17849
- * linkType: 'Environment',
17850
- * id: '<environment_id>'
17904
+ * sys: {
17905
+ * type: 'Link',
17906
+ * linkType: 'Environment',
17907
+ * id: '<environment_id>'
17908
+ * }
17851
17909
  * },
17852
17910
  * action: 'publish',
17853
17911
  * scheduledFor: {
17854
- * dateTime: <ISO_date_string>,
17912
+ * datetime: <ISO_date_string>,
17855
17913
  * timezone: 'Europe/Berlin'
17856
17914
  * }
17857
17915
  * })
@@ -17908,13 +17966,15 @@ function getInstanceMethods(makeRequest) {
17908
17966
  * }
17909
17967
  * },
17910
17968
  * environment: {
17911
- * type: 'Link',
17912
- * linkType: 'Environment',
17913
- * id: '<environment_id>'
17969
+ * sys: {
17970
+ * type: 'Link',
17971
+ * linkType: 'Environment',
17972
+ * id: '<environment_id>'
17973
+ * }
17914
17974
  * },
17915
17975
  * action: 'publish',
17916
17976
  * scheduledFor: {
17917
- * dateTime: <ISO_date_string>,
17977
+ * datetime: <ISO_date_string>,
17918
17978
  * timezone: 'Europe/Berlin'
17919
17979
  * }
17920
17980
  * })
@@ -18845,6 +18905,21 @@ function wrapWebhook(makeRequest, data) {
18845
18905
 
18846
18906
  var wrapWebhookCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_2__["wrapCollection"])(wrapWebhook);
18847
18907
 
18908
+ /***/ }),
18909
+
18910
+ /***/ "./export-types.ts":
18911
+ /*!*************************!*\
18912
+ !*** ./export-types.ts ***!
18913
+ \*************************/
18914
+ /*! no exports provided */
18915
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
18916
+
18917
+ "use strict";
18918
+ __webpack_require__.r(__webpack_exports__);
18919
+ /* harmony import */ var _common_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common-types */ "./common-types.ts");
18920
+ /* empty/unused harmony star reexport */
18921
+
18922
+
18848
18923
  /***/ }),
18849
18924
 
18850
18925
  /***/ "./methods/action.ts":