contentful-management 7.48.0 → 7.50.2

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.
@@ -4349,11 +4349,24 @@ var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
4349
4349
  var booleanValueOf = Boolean.prototype.valueOf;
4350
4350
  var objectToString = Object.prototype.toString;
4351
4351
  var functionToString = Function.prototype.toString;
4352
- var match = String.prototype.match;
4352
+ var $match = String.prototype.match;
4353
+ var $slice = String.prototype.slice;
4354
+ var $replace = String.prototype.replace;
4355
+ var $toUpperCase = String.prototype.toUpperCase;
4356
+ var $toLowerCase = String.prototype.toLowerCase;
4357
+ var $test = RegExp.prototype.test;
4358
+ var $concat = Array.prototype.concat;
4359
+ var $join = Array.prototype.join;
4360
+ var $arrSlice = Array.prototype.slice;
4361
+ var $floor = Math.floor;
4353
4362
  var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;
4354
4363
  var gOPS = Object.getOwnPropertySymbols;
4355
4364
  var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;
4356
4365
  var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';
4366
+ // ie, `has-tostringtag/shams
4367
+ var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')
4368
+ ? Symbol.toStringTag
4369
+ : null;
4357
4370
  var isEnumerable = Object.prototype.propertyIsEnumerable;
4358
4371
 
4359
4372
  var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (
@@ -4364,9 +4377,30 @@ var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPr
4364
4377
  : null
4365
4378
  );
4366
4379
 
4380
+ function addNumericSeparator(num, str) {
4381
+ if (
4382
+ num === Infinity
4383
+ || num === -Infinity
4384
+ || num !== num
4385
+ || (num && num > -1000 && num < 1000)
4386
+ || $test.call(/e/, str)
4387
+ ) {
4388
+ return str;
4389
+ }
4390
+ var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
4391
+ if (typeof num === 'number') {
4392
+ var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)
4393
+ if (int !== num) {
4394
+ var intStr = String(int);
4395
+ var dec = $slice.call(str, intStr.length + 1);
4396
+ return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');
4397
+ }
4398
+ }
4399
+ return $replace.call(str, sepRegex, '$&_');
4400
+ }
4401
+
4367
4402
  var inspectCustom = __webpack_require__(/*! ./util.inspect */ 1).custom;
4368
4403
  var inspectSymbol = inspectCustom && isSymbol(inspectCustom) ? inspectCustom : null;
4369
- var toStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag !== 'undefined' ? Symbol.toStringTag : null;
4370
4404
 
4371
4405
  module.exports = function inspect_(obj, options, depth, seen) {
4372
4406
  var opts = options || {};
@@ -4393,8 +4427,12 @@ module.exports = function inspect_(obj, options, depth, seen) {
4393
4427
  && opts.indent !== '\t'
4394
4428
  && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)
4395
4429
  ) {
4396
- throw new TypeError('options "indent" must be "\\t", an integer > 0, or `null`');
4430
+ throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
4397
4431
  }
4432
+ if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {
4433
+ throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
4434
+ }
4435
+ var numericSeparator = opts.numericSeparator;
4398
4436
 
4399
4437
  if (typeof obj === 'undefined') {
4400
4438
  return 'undefined';
@@ -4413,10 +4451,12 @@ module.exports = function inspect_(obj, options, depth, seen) {
4413
4451
  if (obj === 0) {
4414
4452
  return Infinity / obj > 0 ? '0' : '-0';
4415
4453
  }
4416
- return String(obj);
4454
+ var str = String(obj);
4455
+ return numericSeparator ? addNumericSeparator(obj, str) : str;
4417
4456
  }
4418
4457
  if (typeof obj === 'bigint') {
4419
- return String(obj) + 'n';
4458
+ var bigIntStr = String(obj) + 'n';
4459
+ return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;
4420
4460
  }
4421
4461
 
4422
4462
  var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;
@@ -4435,7 +4475,7 @@ module.exports = function inspect_(obj, options, depth, seen) {
4435
4475
 
4436
4476
  function inspect(value, from, noIndent) {
4437
4477
  if (from) {
4438
- seen = seen.slice();
4478
+ seen = $arrSlice.call(seen);
4439
4479
  seen.push(from);
4440
4480
  }
4441
4481
  if (noIndent) {
@@ -4453,21 +4493,21 @@ module.exports = function inspect_(obj, options, depth, seen) {
4453
4493
  if (typeof obj === 'function') {
4454
4494
  var name = nameOf(obj);
4455
4495
  var keys = arrObjKeys(obj, inspect);
4456
- return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + keys.join(', ') + ' }' : '');
4496
+ return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');
4457
4497
  }
4458
4498
  if (isSymbol(obj)) {
4459
- var symString = hasShammedSymbols ? String(obj).replace(/^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj);
4499
+ var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj);
4460
4500
  return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;
4461
4501
  }
4462
4502
  if (isElement(obj)) {
4463
- var s = '<' + String(obj.nodeName).toLowerCase();
4503
+ var s = '<' + $toLowerCase.call(String(obj.nodeName));
4464
4504
  var attrs = obj.attributes || [];
4465
4505
  for (var i = 0; i < attrs.length; i++) {
4466
4506
  s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);
4467
4507
  }
4468
4508
  s += '>';
4469
4509
  if (obj.childNodes && obj.childNodes.length) { s += '...'; }
4470
- s += '</' + String(obj.nodeName).toLowerCase() + '>';
4510
+ s += '</' + $toLowerCase.call(String(obj.nodeName)) + '>';
4471
4511
  return s;
4472
4512
  }
4473
4513
  if (isArray(obj)) {
@@ -4476,12 +4516,15 @@ module.exports = function inspect_(obj, options, depth, seen) {
4476
4516
  if (indent && !singleLineValues(xs)) {
4477
4517
  return '[' + indentedJoin(xs, indent) + ']';
4478
4518
  }
4479
- return '[ ' + xs.join(', ') + ' ]';
4519
+ return '[ ' + $join.call(xs, ', ') + ' ]';
4480
4520
  }
4481
4521
  if (isError(obj)) {
4482
4522
  var parts = arrObjKeys(obj, inspect);
4523
+ if ('cause' in obj && !isEnumerable.call(obj, 'cause')) {
4524
+ return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';
4525
+ }
4483
4526
  if (parts.length === 0) { return '[' + String(obj) + ']'; }
4484
- return '{ [' + String(obj) + '] ' + parts.join(', ') + ' }';
4527
+ return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';
4485
4528
  }
4486
4529
  if (typeof obj === 'object' && customInspect) {
4487
4530
  if (inspectSymbol && typeof obj[inspectSymbol] === 'function') {
@@ -4529,14 +4572,14 @@ module.exports = function inspect_(obj, options, depth, seen) {
4529
4572
  var ys = arrObjKeys(obj, inspect);
4530
4573
  var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
4531
4574
  var protoTag = obj instanceof Object ? '' : 'null prototype';
4532
- var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? toStr(obj).slice(8, -1) : protoTag ? 'Object' : '';
4575
+ var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';
4533
4576
  var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';
4534
- var tag = constructorTag + (stringTag || protoTag ? '[' + [].concat(stringTag || [], protoTag || []).join(': ') + '] ' : '');
4577
+ var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');
4535
4578
  if (ys.length === 0) { return tag + '{}'; }
4536
4579
  if (indent) {
4537
4580
  return tag + '{' + indentedJoin(ys, indent) + '}';
4538
4581
  }
4539
- return tag + '{ ' + ys.join(', ') + ' }';
4582
+ return tag + '{ ' + $join.call(ys, ', ') + ' }';
4540
4583
  }
4541
4584
  return String(obj);
4542
4585
  };
@@ -4547,7 +4590,7 @@ function wrapQuotes(s, defaultStyle, opts) {
4547
4590
  }
4548
4591
 
4549
4592
  function quote(s) {
4550
- return String(s).replace(/"/g, '&quot;');
4593
+ return $replace.call(String(s), /"/g, '&quot;');
4551
4594
  }
4552
4595
 
4553
4596
  function isArray(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
@@ -4598,7 +4641,7 @@ function toStr(obj) {
4598
4641
 
4599
4642
  function nameOf(f) {
4600
4643
  if (f.name) { return f.name; }
4601
- var m = match.call(functionToString.call(f), /^function\s*([\w$]+)/);
4644
+ var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/);
4602
4645
  if (m) { return m[1]; }
4603
4646
  return null;
4604
4647
  }
@@ -4698,10 +4741,10 @@ function inspectString(str, opts) {
4698
4741
  if (str.length > opts.maxStringLength) {
4699
4742
  var remaining = str.length - opts.maxStringLength;
4700
4743
  var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');
4701
- return inspectString(str.slice(0, opts.maxStringLength), opts) + trailer;
4744
+ return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;
4702
4745
  }
4703
4746
  // eslint-disable-next-line no-control-regex
4704
- var s = str.replace(/(['\\])/g, '\\$1').replace(/[\x00-\x1f]/g, lowbyte);
4747
+ var s = $replace.call($replace.call(str, /(['\\])/g, '\\$1'), /[\x00-\x1f]/g, lowbyte);
4705
4748
  return wrapQuotes(s, 'single', opts);
4706
4749
  }
4707
4750
 
@@ -4715,7 +4758,7 @@ function lowbyte(c) {
4715
4758
  13: 'r'
4716
4759
  }[n];
4717
4760
  if (x) { return '\\' + x; }
4718
- return '\\x' + (n < 0x10 ? '0' : '') + n.toString(16).toUpperCase();
4761
+ return '\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));
4719
4762
  }
4720
4763
 
4721
4764
  function markBoxed(str) {
@@ -4727,7 +4770,7 @@ function weakCollectionOf(type) {
4727
4770
  }
4728
4771
 
4729
4772
  function collectionOf(type, size, entries, indent) {
4730
- var joinedEntries = indent ? indentedJoin(entries, indent) : entries.join(', ');
4773
+ var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');
4731
4774
  return type + ' (' + size + ') {' + joinedEntries + '}';
4732
4775
  }
4733
4776
 
@@ -4745,20 +4788,20 @@ function getIndent(opts, depth) {
4745
4788
  if (opts.indent === '\t') {
4746
4789
  baseIndent = '\t';
4747
4790
  } else if (typeof opts.indent === 'number' && opts.indent > 0) {
4748
- baseIndent = Array(opts.indent + 1).join(' ');
4791
+ baseIndent = $join.call(Array(opts.indent + 1), ' ');
4749
4792
  } else {
4750
4793
  return null;
4751
4794
  }
4752
4795
  return {
4753
4796
  base: baseIndent,
4754
- prev: Array(depth + 1).join(baseIndent)
4797
+ prev: $join.call(Array(depth + 1), baseIndent)
4755
4798
  };
4756
4799
  }
4757
4800
 
4758
4801
  function indentedJoin(xs, indent) {
4759
4802
  if (xs.length === 0) { return ''; }
4760
4803
  var lineJoiner = '\n' + indent.prev + indent.base;
4761
- return lineJoiner + xs.join(',' + lineJoiner) + '\n' + indent.prev;
4804
+ return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev;
4762
4805
  }
4763
4806
 
4764
4807
  function arrObjKeys(obj, inspect) {
@@ -4785,7 +4828,7 @@ function arrObjKeys(obj, inspect) {
4785
4828
  if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {
4786
4829
  // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section
4787
4830
  continue; // eslint-disable-line no-restricted-syntax, no-continue
4788
- } else if ((/[^\w$]/).test(key)) {
4831
+ } else if ($test.call(/[^\w$]/, key)) {
4789
4832
  xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));
4790
4833
  } else {
4791
4834
  xs.push(key + ': ' + inspect(obj[key], obj));
@@ -6558,6 +6601,10 @@ __webpack_require__.r(__webpack_exports__);
6558
6601
  /* harmony import */ var _raw__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./raw */ "./adapters/REST/endpoints/raw.ts");
6559
6602
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
6560
6603
 
6604
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
6605
+
6606
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
6607
+
6561
6608
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
6562
6609
 
6563
6610
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
@@ -6597,7 +6644,7 @@ var ValidationError = /*#__PURE__*/function (_Error) {
6597
6644
  return _this;
6598
6645
  }
6599
6646
 
6600
- return ValidationError;
6647
+ return _createClass(ValidationError);
6601
6648
  }( /*#__PURE__*/_wrapNativeSuper(Error));
6602
6649
 
6603
6650
  var validateTimestamp = function validateTimestamp(name, timestamp, options) {
@@ -7816,11 +7863,17 @@ __webpack_require__.r(__webpack_exports__);
7816
7863
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "get", function() { return get; });
7817
7864
  /* harmony import */ var _raw__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./raw */ "./adapters/REST/endpoints/raw.ts");
7818
7865
 
7819
- var getMany = function getMany(http) {
7820
- return _raw__WEBPACK_IMPORTED_MODULE_0__["get"](http, "/organizations");
7866
+ var getMany = function getMany(http, params) {
7867
+ return _raw__WEBPACK_IMPORTED_MODULE_0__["get"](http, "/organizations", {
7868
+ params: params === null || params === void 0 ? void 0 : params.query
7869
+ });
7821
7870
  };
7822
7871
  var get = function get(http, params) {
7823
- return getMany(http).then(function (data) {
7872
+ return getMany(http, {
7873
+ query: {
7874
+ limit: 100
7875
+ }
7876
+ }).then(function (data) {
7824
7877
  var org = data.items.find(function (org) {
7825
7878
  return org.sys.id === params.organizationId;
7826
7879
  });
@@ -9827,7 +9880,7 @@ function createClient(params) {
9827
9880
  var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
9828
9881
  var sdkMain = opts.type === 'plain' ? 'contentful-management-plain.js' : 'contentful-management.js';
9829
9882
  var userAgent = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["getUserAgentHeader"])( // @ts-expect-error
9830
- "".concat(sdkMain, "/").concat("7.48.0"), params.application, params.integration, params.feature);
9883
+ "".concat(sdkMain, "/").concat("7.50.2"), params.application, params.integration, params.feature);
9831
9884
  var adapter = Object(_create_adapter__WEBPACK_IMPORTED_MODULE_1__["createAdapter"])(params); // Parameters<?> and ReturnType<?> only return the types of the last overload
9832
9885
  // https://github.com/microsoft/TypeScript/issues/26591
9833
9886
  // @ts-expect-error
@@ -10240,9 +10293,15 @@ function createClientApi(makeRequest) {
10240
10293
  * ```
10241
10294
  */
10242
10295
  getOrganizations: function getOrganizations() {
10296
+ var query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
10243
10297
  return makeRequest({
10244
10298
  entityType: 'Organization',
10245
- action: 'getMany'
10299
+ action: 'getMany',
10300
+ params: {
10301
+ query: Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["createRequestConfig"])({
10302
+ query: query
10303
+ }).params
10304
+ }
10246
10305
  }).then(function (data) {
10247
10306
  return wrapOrganizationCollection(makeRequest, data);
10248
10307
  });
@@ -19110,6 +19169,10 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
19110
19169
 
19111
19170
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
19112
19171
 
19172
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
19173
+
19174
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
19175
+
19113
19176
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
19114
19177
 
19115
19178
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
@@ -19160,7 +19223,7 @@ var AsyncActionProcessingError = /*#__PURE__*/function (_Error) {
19160
19223
  return _this;
19161
19224
  }
19162
19225
 
19163
- return AsyncActionProcessingError;
19226
+ return _createClass(AsyncActionProcessingError);
19164
19227
  }( /*#__PURE__*/_wrapNativeSuper(Error));
19165
19228
  var AsyncActionFailedError = /*#__PURE__*/function (_AsyncActionProcessin) {
19166
19229
  _inherits(AsyncActionFailedError, _AsyncActionProcessin);
@@ -19173,7 +19236,7 @@ var AsyncActionFailedError = /*#__PURE__*/function (_AsyncActionProcessin) {
19173
19236
  return _super2.apply(this, arguments);
19174
19237
  }
19175
19238
 
19176
- return AsyncActionFailedError;
19239
+ return _createClass(AsyncActionFailedError);
19177
19240
  }(AsyncActionProcessingError);
19178
19241
 
19179
19242
  /**