contentful-management 7.38.2 → 7.39.0

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.
@@ -3904,156 +3904,6 @@ var bind = __webpack_require__(/*! function-bind */ "../node_modules/function-bi
3904
3904
  module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty);
3905
3905
 
3906
3906
 
3907
- /***/ }),
3908
-
3909
- /***/ "../node_modules/lodash.isplainobject/index.js":
3910
- /*!*****************************************************!*\
3911
- !*** ../node_modules/lodash.isplainobject/index.js ***!
3912
- \*****************************************************/
3913
- /*! no static exports found */
3914
- /***/ (function(module, exports) {
3915
-
3916
- /**
3917
- * lodash (Custom Build) <https://lodash.com/>
3918
- * Build: `lodash modularize exports="npm" -o ./`
3919
- * Copyright jQuery Foundation and other contributors <https://jquery.org/>
3920
- * Released under MIT license <https://lodash.com/license>
3921
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
3922
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
3923
- */
3924
-
3925
- /** `Object#toString` result references. */
3926
- var objectTag = '[object Object]';
3927
-
3928
- /**
3929
- * Checks if `value` is a host object in IE < 9.
3930
- *
3931
- * @private
3932
- * @param {*} value The value to check.
3933
- * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
3934
- */
3935
- function isHostObject(value) {
3936
- // Many host objects are `Object` objects that can coerce to strings
3937
- // despite having improperly defined `toString` methods.
3938
- var result = false;
3939
- if (value != null && typeof value.toString != 'function') {
3940
- try {
3941
- result = !!(value + '');
3942
- } catch (e) {}
3943
- }
3944
- return result;
3945
- }
3946
-
3947
- /**
3948
- * Creates a unary function that invokes `func` with its argument transformed.
3949
- *
3950
- * @private
3951
- * @param {Function} func The function to wrap.
3952
- * @param {Function} transform The argument transform.
3953
- * @returns {Function} Returns the new function.
3954
- */
3955
- function overArg(func, transform) {
3956
- return function(arg) {
3957
- return func(transform(arg));
3958
- };
3959
- }
3960
-
3961
- /** Used for built-in method references. */
3962
- var funcProto = Function.prototype,
3963
- objectProto = Object.prototype;
3964
-
3965
- /** Used to resolve the decompiled source of functions. */
3966
- var funcToString = funcProto.toString;
3967
-
3968
- /** Used to check objects for own properties. */
3969
- var hasOwnProperty = objectProto.hasOwnProperty;
3970
-
3971
- /** Used to infer the `Object` constructor. */
3972
- var objectCtorString = funcToString.call(Object);
3973
-
3974
- /**
3975
- * Used to resolve the
3976
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
3977
- * of values.
3978
- */
3979
- var objectToString = objectProto.toString;
3980
-
3981
- /** Built-in value references. */
3982
- var getPrototype = overArg(Object.getPrototypeOf, Object);
3983
-
3984
- /**
3985
- * Checks if `value` is object-like. A value is object-like if it's not `null`
3986
- * and has a `typeof` result of "object".
3987
- *
3988
- * @static
3989
- * @memberOf _
3990
- * @since 4.0.0
3991
- * @category Lang
3992
- * @param {*} value The value to check.
3993
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
3994
- * @example
3995
- *
3996
- * _.isObjectLike({});
3997
- * // => true
3998
- *
3999
- * _.isObjectLike([1, 2, 3]);
4000
- * // => true
4001
- *
4002
- * _.isObjectLike(_.noop);
4003
- * // => false
4004
- *
4005
- * _.isObjectLike(null);
4006
- * // => false
4007
- */
4008
- function isObjectLike(value) {
4009
- return !!value && typeof value == 'object';
4010
- }
4011
-
4012
- /**
4013
- * Checks if `value` is a plain object, that is, an object created by the
4014
- * `Object` constructor or one with a `[[Prototype]]` of `null`.
4015
- *
4016
- * @static
4017
- * @memberOf _
4018
- * @since 0.8.0
4019
- * @category Lang
4020
- * @param {*} value The value to check.
4021
- * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
4022
- * @example
4023
- *
4024
- * function Foo() {
4025
- * this.a = 1;
4026
- * }
4027
- *
4028
- * _.isPlainObject(new Foo);
4029
- * // => false
4030
- *
4031
- * _.isPlainObject([1, 2, 3]);
4032
- * // => false
4033
- *
4034
- * _.isPlainObject({ 'x': 0, 'y': 0 });
4035
- * // => true
4036
- *
4037
- * _.isPlainObject(Object.create(null));
4038
- * // => true
4039
- */
4040
- function isPlainObject(value) {
4041
- if (!isObjectLike(value) ||
4042
- objectToString.call(value) != objectTag || isHostObject(value)) {
4043
- return false;
4044
- }
4045
- var proto = getPrototype(value);
4046
- if (proto === null) {
4047
- return true;
4048
- }
4049
- var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
4050
- return (typeof Ctor == 'function' &&
4051
- Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString);
4052
- }
4053
-
4054
- module.exports = isPlainObject;
4055
-
4056
-
4057
3907
  /***/ }),
4058
3908
 
4059
3909
  /***/ "../node_modules/lodash/lodash.js":
@@ -23476,9 +23326,9 @@ __webpack_require__.r(__webpack_exports__);
23476
23326
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFromFiles", function() { return createFromFiles; });
23477
23327
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "processForLocale", function() { return processForLocale; });
23478
23328
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "processForAllLocales", function() { return processForAllLocales; });
23479
- /* harmony import */ var fast_copy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! fast-copy */ "../node_modules/fast-copy/dist/fast-copy.js");
23480
- /* harmony import */ var fast_copy__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fast_copy__WEBPACK_IMPORTED_MODULE_0__);
23481
- /* harmony import */ var _error_handler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../error-handler */ "./error-handler.ts");
23329
+ /* 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");
23330
+ /* harmony import */ var fast_copy__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! fast-copy */ "../node_modules/fast-copy/dist/fast-copy.js");
23331
+ /* harmony import */ var fast_copy__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(fast_copy__WEBPACK_IMPORTED_MODULE_1__);
23482
23332
  /* harmony import */ var _upload_http_client__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../upload-http-client */ "./upload-http-client.ts");
23483
23333
  /* harmony import */ var _raw__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./raw */ "./adapters/REST/endpoints/raw.ts");
23484
23334
  /* harmony import */ var _upload__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./upload */ "./adapters/REST/endpoints/upload.ts");
@@ -23516,7 +23366,7 @@ var getMany = function getMany(http, params) {
23516
23366
  var update = function update(http, params, rawData, headers) {
23517
23367
  var _rawData$sys$version;
23518
23368
 
23519
- var data = fast_copy__WEBPACK_IMPORTED_MODULE_0___default()(rawData);
23369
+ var data = fast_copy__WEBPACK_IMPORTED_MODULE_1___default()(rawData);
23520
23370
  delete data.sys;
23521
23371
  return _raw__WEBPACK_IMPORTED_MODULE_3__["put"](http, "/spaces/".concat(params.spaceId, "/environments/").concat(params.environmentId, "/assets/").concat(params.assetId), data, {
23522
23372
  headers: _objectSpread({
@@ -23546,11 +23396,11 @@ var unarchive = function unarchive(http, params) {
23546
23396
  return _raw__WEBPACK_IMPORTED_MODULE_3__["del"](http, "/spaces/".concat(params.spaceId, "/environments/").concat(params.environmentId, "/assets/").concat(params.assetId, "/archived"));
23547
23397
  };
23548
23398
  var create = function create(http, params, rawData) {
23549
- var data = fast_copy__WEBPACK_IMPORTED_MODULE_0___default()(rawData);
23399
+ var data = fast_copy__WEBPACK_IMPORTED_MODULE_1___default()(rawData);
23550
23400
  return _raw__WEBPACK_IMPORTED_MODULE_3__["post"](http, "/spaces/".concat(params.spaceId, "/environments/").concat(params.environmentId, "/assets"), data);
23551
23401
  };
23552
23402
  var createWithId = function createWithId(http, params, rawData) {
23553
- var data = fast_copy__WEBPACK_IMPORTED_MODULE_0___default()(rawData);
23403
+ var data = fast_copy__WEBPACK_IMPORTED_MODULE_1___default()(rawData);
23554
23404
  return _raw__WEBPACK_IMPORTED_MODULE_3__["put"](http, "/spaces/".concat(params.spaceId, "/environments/").concat(params.environmentId, "/assets/").concat(params.assetId), data);
23555
23405
  };
23556
23406
  var createFromFiles = function createFromFiles(http, params, data) {
@@ -23585,7 +23435,7 @@ var createFromFiles = function createFromFiles(http, params, data) {
23585
23435
  });
23586
23436
 
23587
23437
  return create(http, params, asset);
23588
- }).catch(_error_handler__WEBPACK_IMPORTED_MODULE_1__["default"]);
23438
+ }).catch(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["errorHandler"]);
23589
23439
  };
23590
23440
  /**
23591
23441
  * Asset processing
@@ -24653,7 +24503,7 @@ __webpack_require__.r(__webpack_exports__);
24653
24503
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "put", function() { return put; });
24654
24504
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "del", function() { return del; });
24655
24505
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "http", function() { return http; });
24656
- /* harmony import */ var _error_handler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../error-handler */ "./error-handler.ts");
24506
+ /* 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");
24657
24507
  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; }
24658
24508
 
24659
24509
  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; }
@@ -24674,42 +24524,42 @@ function get(http, url, config) {
24674
24524
  baseURL: getBaseUrl(http)
24675
24525
  }, config)).then(function (response) {
24676
24526
  return response.data;
24677
- }, _error_handler__WEBPACK_IMPORTED_MODULE_0__["default"]);
24527
+ }, contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["errorHandler"]);
24678
24528
  }
24679
24529
  function patch(http, url, payload, config) {
24680
24530
  return http.patch(url, payload, _objectSpread({
24681
24531
  baseURL: getBaseUrl(http)
24682
24532
  }, config)).then(function (response) {
24683
24533
  return response.data;
24684
- }, _error_handler__WEBPACK_IMPORTED_MODULE_0__["default"]);
24534
+ }, contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["errorHandler"]);
24685
24535
  }
24686
24536
  function post(http, url, payload, config) {
24687
24537
  return http.post(url, payload, _objectSpread({
24688
24538
  baseURL: getBaseUrl(http)
24689
24539
  }, config)).then(function (response) {
24690
24540
  return response.data;
24691
- }, _error_handler__WEBPACK_IMPORTED_MODULE_0__["default"]);
24541
+ }, contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["errorHandler"]);
24692
24542
  }
24693
24543
  function put(http, url, payload, config) {
24694
24544
  return http.put(url, payload, _objectSpread({
24695
24545
  baseURL: getBaseUrl(http)
24696
24546
  }, config)).then(function (response) {
24697
24547
  return response.data;
24698
- }, _error_handler__WEBPACK_IMPORTED_MODULE_0__["default"]);
24548
+ }, contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["errorHandler"]);
24699
24549
  }
24700
24550
  function del(http, url, config) {
24701
24551
  return http.delete(url, _objectSpread({
24702
24552
  baseURL: getBaseUrl(http)
24703
24553
  }, config)).then(function (response) {
24704
24554
  return response.data;
24705
- }, _error_handler__WEBPACK_IMPORTED_MODULE_0__["default"]);
24555
+ }, contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["errorHandler"]);
24706
24556
  }
24707
24557
  function http(http, url, config) {
24708
24558
  return http(url, _objectSpread({
24709
24559
  baseURL: getBaseUrl(http)
24710
24560
  }, config)).then(function (response) {
24711
24561
  return response.data;
24712
- }, _error_handler__WEBPACK_IMPORTED_MODULE_0__["default"]);
24562
+ }, contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["errorHandler"]);
24713
24563
  }
24714
24564
 
24715
24565
  /***/ }),
@@ -26458,7 +26308,7 @@ function createClient(params) {
26458
26308
  var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
26459
26309
  var sdkMain = opts.type === 'plain' ? 'contentful-management-plain.js' : 'contentful-management.js';
26460
26310
  var userAgent = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["getUserAgentHeader"])( // @ts-expect-error
26461
- "".concat(sdkMain, "/").concat("7.38.2"), params.application, params.integration, params.feature);
26311
+ "".concat(sdkMain, "/").concat("7.39.0"), params.application, params.integration, params.feature);
26462
26312
  var adapter = Object(_create_adapter__WEBPACK_IMPORTED_MODULE_1__["createAdapter"])(params); // Parameters<?> and ReturnType<?> only return the types of the last overload
26463
26313
  // https://github.com/microsoft/TypeScript/issues/26591
26464
26314
  // @ts-expect-error
@@ -35268,95 +35118,6 @@ var wrapWebhookCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_2__["w
35268
35118
 
35269
35119
  /***/ }),
35270
35120
 
35271
- /***/ "./error-handler.ts":
35272
- /*!**************************!*\
35273
- !*** ./error-handler.ts ***!
35274
- \**************************/
35275
- /*! exports provided: default */
35276
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
35277
-
35278
- "use strict";
35279
- __webpack_require__.r(__webpack_exports__);
35280
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return errorHandler; });
35281
- /* harmony import */ var lodash_isplainobject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.isplainobject */ "../node_modules/lodash.isplainobject/index.js");
35282
- /* harmony import */ var lodash_isplainobject__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_isplainobject__WEBPACK_IMPORTED_MODULE_0__);
35283
-
35284
-
35285
- /**
35286
- * Handles errors received from the server. Parses the error into a more useful
35287
- * format, places it in an exception and throws it.
35288
- * See https://www.contentful.com/developers/docs/references/errors/
35289
- * for more details on the data received on the errorResponse.data property
35290
- * and the expected error codes.
35291
- * @private
35292
- */
35293
- function errorHandler(errorResponse) {
35294
- var config = errorResponse.config,
35295
- response = errorResponse.response;
35296
- var errorName; // Obscure the Management token
35297
-
35298
- if (config && config.headers && config.headers['Authorization']) {
35299
- var token = "...".concat(config.headers['Authorization'].substr(-5));
35300
- config.headers['Authorization'] = "Bearer ".concat(token);
35301
- }
35302
-
35303
- if (!lodash_isplainobject__WEBPACK_IMPORTED_MODULE_0___default()(response) || !lodash_isplainobject__WEBPACK_IMPORTED_MODULE_0___default()(config)) {
35304
- throw errorResponse;
35305
- }
35306
-
35307
- var data = response === null || response === void 0 ? void 0 : response.data;
35308
- var errorData = {
35309
- status: response === null || response === void 0 ? void 0 : response.status,
35310
- statusText: response === null || response === void 0 ? void 0 : response.statusText,
35311
- message: '',
35312
- details: {}
35313
- };
35314
-
35315
- if (lodash_isplainobject__WEBPACK_IMPORTED_MODULE_0___default()(config)) {
35316
- errorData.request = {
35317
- url: config.url,
35318
- headers: config.headers,
35319
- method: config.method,
35320
- payloadData: config.data
35321
- };
35322
- }
35323
-
35324
- if (data && lodash_isplainobject__WEBPACK_IMPORTED_MODULE_0___default()(data)) {
35325
- if ('requestId' in data) {
35326
- errorData.requestId = data.requestId || 'UNKNOWN';
35327
- }
35328
-
35329
- if ('message' in data) {
35330
- errorData.message = data.message || '';
35331
- }
35332
-
35333
- if ('details' in data) {
35334
- errorData.details = data.details || {};
35335
- }
35336
-
35337
- if ('sys' in data) {
35338
- if ('id' in data.sys) {
35339
- errorName = data.sys.id;
35340
- }
35341
- }
35342
- }
35343
-
35344
- var error = new Error();
35345
- error.name = errorName && errorName !== 'Unknown' ? errorName : "".concat(response === null || response === void 0 ? void 0 : response.status, " ").concat(response === null || response === void 0 ? void 0 : response.statusText);
35346
-
35347
- try {
35348
- error.message = JSON.stringify(errorData, null, ' ');
35349
- } catch (_unused) {
35350
- var _errorData$message;
35351
-
35352
- error.message = (_errorData$message = errorData === null || errorData === void 0 ? void 0 : errorData.message) !== null && _errorData$message !== void 0 ? _errorData$message : '';
35353
- }
35354
-
35355
- throw error;
35356
- }
35357
-
35358
- /***/ }),
35359
-
35360
35121
  /***/ "./methods/action.ts":
35361
35122
  /*!***************************!*\
35362
35123
  !*** ./methods/action.ts ***!