contentful-management 11.61.0 → 11.62.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.
@@ -2207,9 +2207,9 @@ var getMany = function getMany(http, _ref, headers) {
2207
2207
  environmentTemplateId = _ref.environmentTemplateId,
2208
2208
  spaceId = _ref.spaceId,
2209
2209
  environmentId = _ref.environmentId,
2210
- paginationProps = _objectWithoutProperties(_ref, _excluded);
2210
+ otherProps = _objectWithoutProperties(_ref, _excluded);
2211
2211
  return _raw__WEBPACK_IMPORTED_MODULE_0__.get(http, apiPath(organizationId, environmentTemplateId, 'template_installations'), {
2212
- params: _objectSpread(_objectSpread(_objectSpread({}, paginationProps), environmentId && {
2212
+ params: _objectSpread(_objectSpread(_objectSpread({}, otherProps), environmentId && {
2213
2213
  'environment.sys.id': environmentId
2214
2214
  }), spaceId && {
2215
2215
  'space.sys.id': spaceId
@@ -10422,7 +10422,7 @@ __webpack_require__.r(__webpack_exports__);
10422
10422
  /* harmony import */ var contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! contentful-sdk-core */ "../node_modules/contentful-sdk-core/dist/index.js");
10423
10423
  /* harmony import */ var _entities__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./entities */ "./entities/index.ts");
10424
10424
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
10425
- var _excluded = ["spaceId", "environmentId"];
10425
+ var _excluded = ["spaceId", "environmentId", "latestOnly"];
10426
10426
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
10427
10427
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
10428
10428
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
@@ -10575,6 +10575,7 @@ function createEnvironmentTemplateApi(makeRequest, organizationId) {
10575
10575
  * Gets a collection of all installations for the environment template
10576
10576
  * @param [installationParams.spaceId] - Space ID to filter installations by space and environment
10577
10577
  * @param [installationParams.environmentId] - Environment ID to filter installations by space and environment
10578
+ * @param [installationParams.latestOnly] - Boolean flag to only return the latest installation per environment
10578
10579
  * @return Promise for a collection of EnvironmentTemplateInstallations
10579
10580
  * ```javascript
10580
10581
  * const contentful = require('contentful-management')
@@ -10595,6 +10596,7 @@ function createEnvironmentTemplateApi(makeRequest, organizationId) {
10595
10596
  var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
10596
10597
  var spaceId = _ref2.spaceId,
10597
10598
  environmentId = _ref2.environmentId,
10599
+ latestOnly = _ref2.latestOnly,
10598
10600
  query = _objectWithoutProperties(_ref2, _excluded);
10599
10601
  var raw = this.toPlainObject();
10600
10602
  return makeRequest({
@@ -10607,7 +10609,8 @@ function createEnvironmentTemplateApi(makeRequest, organizationId) {
10607
10609
  query: query
10608
10610
  }).params),
10609
10611
  spaceId: spaceId,
10610
- environmentId: environmentId
10612
+ environmentId: environmentId,
10613
+ latestOnly: latestOnly
10611
10614
  }
10612
10615
  }).then(function (data) {
10613
10616
  return wrapEnvironmentTemplateInstallationCollection(makeRequest, data);
@@ -23649,79 +23652,124 @@ __webpack_require__.r(__webpack_exports__);
23649
23652
 
23650
23653
 
23651
23654
 
23655
+ /**
23656
+ * Known adapters mapping.
23657
+ * Provides environment-specific adapters for Axios:
23658
+ * - `http` for Node.js
23659
+ * - `xhr` for browsers
23660
+ * - `fetch` for fetch API-based requests
23661
+ *
23662
+ * @type {Object<string, Function|Object>}
23663
+ */
23652
23664
  const knownAdapters = {
23653
23665
  http: _http_js__WEBPACK_IMPORTED_MODULE_0__["default"],
23654
23666
  xhr: _xhr_js__WEBPACK_IMPORTED_MODULE_1__["default"],
23655
23667
  fetch: {
23656
23668
  get: _fetch_js__WEBPACK_IMPORTED_MODULE_2__.getFetch,
23657
23669
  }
23658
- }
23670
+ };
23659
23671
 
23672
+ // Assign adapter names for easier debugging and identification
23660
23673
  _utils_js__WEBPACK_IMPORTED_MODULE_3__["default"].forEach(knownAdapters, (fn, value) => {
23661
23674
  if (fn) {
23662
23675
  try {
23663
- Object.defineProperty(fn, 'name', {value});
23676
+ Object.defineProperty(fn, 'name', { value });
23664
23677
  } catch (e) {
23665
23678
  // eslint-disable-next-line no-empty
23666
23679
  }
23667
- Object.defineProperty(fn, 'adapterName', {value});
23680
+ Object.defineProperty(fn, 'adapterName', { value });
23668
23681
  }
23669
23682
  });
23670
23683
 
23684
+ /**
23685
+ * Render a rejection reason string for unknown or unsupported adapters
23686
+ *
23687
+ * @param {string} reason
23688
+ * @returns {string}
23689
+ */
23671
23690
  const renderReason = (reason) => `- ${reason}`;
23672
23691
 
23692
+ /**
23693
+ * Check if the adapter is resolved (function, null, or false)
23694
+ *
23695
+ * @param {Function|null|false} adapter
23696
+ * @returns {boolean}
23697
+ */
23673
23698
  const isResolvedHandle = (adapter) => _utils_js__WEBPACK_IMPORTED_MODULE_3__["default"].isFunction(adapter) || adapter === null || adapter === false;
23674
23699
 
23675
- /* harmony default export */ __webpack_exports__["default"] = ({
23676
- getAdapter: (adapters, config) => {
23677
- adapters = _utils_js__WEBPACK_IMPORTED_MODULE_3__["default"].isArray(adapters) ? adapters : [adapters];
23678
-
23679
- const {length} = adapters;
23680
- let nameOrAdapter;
23681
- let adapter;
23700
+ /**
23701
+ * Get the first suitable adapter from the provided list.
23702
+ * Tries each adapter in order until a supported one is found.
23703
+ * Throws an AxiosError if no adapter is suitable.
23704
+ *
23705
+ * @param {Array<string|Function>|string|Function} adapters - Adapter(s) by name or function.
23706
+ * @param {Object} config - Axios request configuration
23707
+ * @throws {AxiosError} If no suitable adapter is available
23708
+ * @returns {Function} The resolved adapter function
23709
+ */
23710
+ function getAdapter(adapters, config) {
23711
+ adapters = _utils_js__WEBPACK_IMPORTED_MODULE_3__["default"].isArray(adapters) ? adapters : [adapters];
23682
23712
 
23683
- const rejectedReasons = {};
23713
+ const { length } = adapters;
23714
+ let nameOrAdapter;
23715
+ let adapter;
23684
23716
 
23685
- for (let i = 0; i < length; i++) {
23686
- nameOrAdapter = adapters[i];
23687
- let id;
23717
+ const rejectedReasons = {};
23688
23718
 
23689
- adapter = nameOrAdapter;
23719
+ for (let i = 0; i < length; i++) {
23720
+ nameOrAdapter = adapters[i];
23721
+ let id;
23690
23722
 
23691
- if (!isResolvedHandle(nameOrAdapter)) {
23692
- adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
23723
+ adapter = nameOrAdapter;
23693
23724
 
23694
- if (adapter === undefined) {
23695
- throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_4__["default"](`Unknown adapter '${id}'`);
23696
- }
23697
- }
23725
+ if (!isResolvedHandle(nameOrAdapter)) {
23726
+ adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
23698
23727
 
23699
- if (adapter && (_utils_js__WEBPACK_IMPORTED_MODULE_3__["default"].isFunction(adapter) || (adapter = adapter.get(config)))) {
23700
- break;
23728
+ if (adapter === undefined) {
23729
+ throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_4__["default"](`Unknown adapter '${id}'`);
23701
23730
  }
23731
+ }
23702
23732
 
23703
- rejectedReasons[id || '#' + i] = adapter;
23733
+ if (adapter && (_utils_js__WEBPACK_IMPORTED_MODULE_3__["default"].isFunction(adapter) || (adapter = adapter.get(config)))) {
23734
+ break;
23704
23735
  }
23705
23736
 
23706
- if (!adapter) {
23737
+ rejectedReasons[id || '#' + i] = adapter;
23738
+ }
23707
23739
 
23708
- const reasons = Object.entries(rejectedReasons)
23709
- .map(([id, state]) => `adapter ${id} ` +
23710
- (state === false ? 'is not supported by the environment' : 'is not available in the build')
23711
- );
23740
+ if (!adapter) {
23741
+ const reasons = Object.entries(rejectedReasons)
23742
+ .map(([id, state]) => `adapter ${id} ` +
23743
+ (state === false ? 'is not supported by the environment' : 'is not available in the build')
23744
+ );
23712
23745
 
23713
- let s = length ?
23714
- (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) :
23715
- 'as no adapter specified';
23746
+ let s = length ?
23747
+ (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) :
23748
+ 'as no adapter specified';
23716
23749
 
23717
- throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_4__["default"](
23718
- `There is no suitable adapter to dispatch the request ` + s,
23719
- 'ERR_NOT_SUPPORT'
23720
- );
23721
- }
23750
+ throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_4__["default"](
23751
+ `There is no suitable adapter to dispatch the request ` + s,
23752
+ 'ERR_NOT_SUPPORT'
23753
+ );
23754
+ }
23722
23755
 
23723
- return adapter;
23724
- },
23756
+ return adapter;
23757
+ }
23758
+
23759
+ /**
23760
+ * Exports Axios adapters and utility to resolve an adapter
23761
+ */
23762
+ /* harmony default export */ __webpack_exports__["default"] = ({
23763
+ /**
23764
+ * Resolve an adapter from a list of adapter names or functions.
23765
+ * @type {Function}
23766
+ */
23767
+ getAdapter,
23768
+
23769
+ /**
23770
+ * Exposes all known adapters
23771
+ * @type {Object<string, Function|Object>}
23772
+ */
23725
23773
  adapters: knownAdapters
23726
23774
  });
23727
23775
 
@@ -24012,7 +24060,7 @@ const factory = (env) => {
24012
24060
  const seedCache = new Map();
24013
24061
 
24014
24062
  const getFetch = (config) => {
24015
- let env = config ? config.env : {};
24063
+ let env = (config && config.env) || {};
24016
24064
  const {fetch, Request, Response} = env;
24017
24065
  const seeds = [
24018
24066
  Request, Response, fetch
@@ -25339,7 +25387,7 @@ class InterceptorManager {
25339
25387
  *
25340
25388
  * @param {Number} id The ID that was returned by `use`
25341
25389
  *
25342
- * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
25390
+ * @returns {void}
25343
25391
  */
25344
25392
  eject(id) {
25345
25393
  if (this.handlers[id]) {
@@ -25569,11 +25617,11 @@ function mergeConfig(config1, config2) {
25569
25617
  }
25570
25618
 
25571
25619
  // eslint-disable-next-line consistent-return
25572
- function mergeDeepProperties(a, b, prop , caseless) {
25620
+ function mergeDeepProperties(a, b, prop, caseless) {
25573
25621
  if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(b)) {
25574
- return getMergedValue(a, b, prop , caseless);
25622
+ return getMergedValue(a, b, prop, caseless);
25575
25623
  } else if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(a)) {
25576
- return getMergedValue(undefined, a, prop , caseless);
25624
+ return getMergedValue(undefined, a, prop, caseless);
25577
25625
  }
25578
25626
  }
25579
25627
 
@@ -25631,7 +25679,7 @@ function mergeConfig(config1, config2) {
25631
25679
  socketPath: defaultToConfig2,
25632
25680
  responseEncoding: defaultToConfig2,
25633
25681
  validateStatus: mergeDirectKeys,
25634
- headers: (a, b , prop) => mergeDeepProperties(headersToObject(a), headersToObject(b),prop, true)
25682
+ headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)
25635
25683
  };
25636
25684
 
25637
25685
  _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].forEach(Object.keys({...config1, ...config2}), function computeConfigValue(prop) {
@@ -25945,7 +25993,7 @@ __webpack_require__.r(__webpack_exports__);
25945
25993
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
25946
25994
  /* harmony export */ VERSION: function() { return /* binding */ VERSION; }
25947
25995
  /* harmony export */ });
25948
- const VERSION = "1.12.2";
25996
+ const VERSION = "1.13.1";
25949
25997
 
25950
25998
  /***/ }),
25951
25999
 
@@ -26092,6 +26140,12 @@ const HttpStatusCode = {
26092
26140
  LoopDetected: 508,
26093
26141
  NotExtended: 510,
26094
26142
  NetworkAuthenticationRequired: 511,
26143
+ WebServerIsDown: 521,
26144
+ ConnectionTimedOut: 522,
26145
+ OriginIsUnreachable: 523,
26146
+ TimeoutOccurred: 524,
26147
+ SslHandshakeFailed: 525,
26148
+ InvalidSslCertificate: 526,
26095
26149
  };
26096
26150
 
26097
26151
  Object.entries(HttpStatusCode).forEach(([key, value]) => {
@@ -26116,6 +26170,13 @@ __webpack_require__.r(__webpack_exports__);
26116
26170
  /* harmony export */ });
26117
26171
 
26118
26172
 
26173
+ /**
26174
+ * Create a bound version of a function with a specified `this` context
26175
+ *
26176
+ * @param {Function} fn - The function to bind
26177
+ * @param {*} thisArg - The value to be passed as the `this` parameter
26178
+ * @returns {Function} A new function that will call the original function with the specified `this` context
26179
+ */
26119
26180
  function bind(fn, thisArg) {
26120
26181
  return function wrap() {
26121
26182
  return fn.apply(thisArg, arguments);
@@ -26319,27 +26380,38 @@ __webpack_require__.r(__webpack_exports__);
26319
26380
 
26320
26381
  // Standard browser envs support document.cookie
26321
26382
  {
26322
- write(name, value, expires, path, domain, secure) {
26323
- const cookie = [name + '=' + encodeURIComponent(value)];
26324
-
26325
- _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());
26383
+ write(name, value, expires, path, domain, secure, sameSite) {
26384
+ if (typeof document === 'undefined') return;
26326
26385
 
26327
- _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isString(path) && cookie.push('path=' + path);
26386
+ const cookie = [`${name}=${encodeURIComponent(value)}`];
26328
26387
 
26329
- _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isString(domain) && cookie.push('domain=' + domain);
26330
-
26331
- secure === true && cookie.push('secure');
26388
+ if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isNumber(expires)) {
26389
+ cookie.push(`expires=${new Date(expires).toUTCString()}`);
26390
+ }
26391
+ if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isString(path)) {
26392
+ cookie.push(`path=${path}`);
26393
+ }
26394
+ if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isString(domain)) {
26395
+ cookie.push(`domain=${domain}`);
26396
+ }
26397
+ if (secure === true) {
26398
+ cookie.push('secure');
26399
+ }
26400
+ if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isString(sameSite)) {
26401
+ cookie.push(`SameSite=${sameSite}`);
26402
+ }
26332
26403
 
26333
26404
  document.cookie = cookie.join('; ');
26334
26405
  },
26335
26406
 
26336
26407
  read(name) {
26337
- const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
26338
- return (match ? decodeURIComponent(match[3]) : null);
26408
+ if (typeof document === 'undefined') return null;
26409
+ const match = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)'));
26410
+ return match ? decodeURIComponent(match[1]) : null;
26339
26411
  },
26340
26412
 
26341
26413
  remove(name) {
26342
- this.write(name, '', Date.now() - 86400000);
26414
+ this.write(name, '', Date.now() - 86400000, '/');
26343
26415
  }
26344
26416
  }
26345
26417
 
@@ -29873,7 +29945,7 @@ function createClient(params) {
29873
29945
  var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
29874
29946
  var sdkMain = opts.type === 'plain' ? 'contentful-management-plain.js' : 'contentful-management.js';
29875
29947
  var userAgent = (0,contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__.getUserAgentHeader)(// @ts-expect-error
29876
- "".concat(sdkMain, "/").concat("11.61.0"), params.application, params.integration, params.feature);
29948
+ "".concat(sdkMain, "/").concat("11.62.0"), params.application, params.integration, params.feature);
29877
29949
  var adapter = (0,_create_adapter__WEBPACK_IMPORTED_MODULE_1__.createAdapter)(_objectSpread(_objectSpread({}, params), {}, {
29878
29950
  userAgent: userAgent
29879
29951
  }));