contentful-management 11.39.1 → 11.40.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.
@@ -4293,6 +4293,7 @@ __webpack_require__.r(__webpack_exports__);
4293
4293
  /* harmony export */ complete: function() { return /* binding */ complete; },
4294
4294
  /* harmony export */ create: function() { return /* binding */ create; },
4295
4295
  /* harmony export */ del: function() { return /* binding */ del; },
4296
+ /* harmony export */ get: function() { return /* binding */ get; },
4296
4297
  /* harmony export */ getMany: function() { return /* binding */ getMany; },
4297
4298
  /* harmony export */ update: function() { return /* binding */ update; }
4298
4299
  /* harmony export */ });
@@ -4325,6 +4326,11 @@ var getMany = function getMany(http, params, headers) {
4325
4326
  params: params.query
4326
4327
  });
4327
4328
  };
4329
+ var get = function get(http, params, headers) {
4330
+ return _raw__WEBPACK_IMPORTED_MODULE_1__.get(http, getWorkflowUrl(params), {
4331
+ headers: headers
4332
+ });
4333
+ };
4328
4334
  var create = function create(http, params, rawData, headers) {
4329
4335
  var data = (0,fast_copy__WEBPACK_IMPORTED_MODULE_0__["default"])(rawData);
4330
4336
  return _raw__WEBPACK_IMPORTED_MODULE_1__.post(http, getBaseUrl(params), data, {
@@ -4433,7 +4439,11 @@ var RestAdapter = /*#__PURE__*/function () {
4433
4439
  if (!params.accessToken) {
4434
4440
  throw new TypeError('Expected parameter accessToken');
4435
4441
  }
4436
- this.params = _objectSpread(_objectSpread({}, defaultHostParameters), (0,fast_copy__WEBPACK_IMPORTED_MODULE_1__["default"])(params));
4442
+ var copiedParams = (0,fast_copy__WEBPACK_IMPORTED_MODULE_1__["default"])(params);
4443
+ // httpAgent and httpsAgent cannot be copied because they can contain private fields
4444
+ copiedParams.httpAgent = params.httpAgent;
4445
+ copiedParams.httpsAgent = params.httpsAgent;
4446
+ this.params = _objectSpread(_objectSpread({}, defaultHostParameters), copiedParams);
4437
4447
  this.axiosInstance = (0,contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__.createHttpClient)(axios__WEBPACK_IMPORTED_MODULE_3__["default"], _objectSpread(_objectSpread({}, this.params), {}, {
4438
4448
  headers: _objectSpread(_objectSpread({
4439
4449
  'Content-Type': 'application/vnd.contentful.management.v1+json'
@@ -18013,6 +18023,7 @@ var createPlainClient = function createPlainClient(makeRequest, defaults) {
18013
18023
  delete: (0,_wrappers_wrap__WEBPACK_IMPORTED_MODULE_1__.wrap)(wrapParams, 'WorkflowDefinition', 'delete')
18014
18024
  },
18015
18025
  workflow: {
18026
+ get: (0,_wrappers_wrap__WEBPACK_IMPORTED_MODULE_1__.wrap)(wrapParams, 'Workflow', 'get'),
18016
18027
  getMany: (0,_wrappers_wrap__WEBPACK_IMPORTED_MODULE_1__.wrap)(wrapParams, 'Workflow', 'getMany'),
18017
18028
  create: (0,_wrappers_wrap__WEBPACK_IMPORTED_MODULE_1__.wrap)(wrapParams, 'Workflow', 'create'),
18018
18029
  update: (0,_wrappers_wrap__WEBPACK_IMPORTED_MODULE_1__.wrap)(wrapParams, 'Workflow', 'update'),
@@ -22216,9 +22227,9 @@ class Axios {
22216
22227
  return await this._request(configOrUrl, config);
22217
22228
  } catch (err) {
22218
22229
  if (err instanceof Error) {
22219
- let dummy;
22230
+ let dummy = {};
22220
22231
 
22221
- Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error());
22232
+ Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());
22222
22233
 
22223
22234
  // slice off the Error: ... line
22224
22235
  const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
@@ -22273,6 +22284,11 @@ class Axios {
22273
22284
  }
22274
22285
  }
22275
22286
 
22287
+ _helpers_validator_js__WEBPACK_IMPORTED_MODULE_0__["default"].assertOptions(config, {
22288
+ baseUrl: validators.spelling('baseURL'),
22289
+ withXsrfToken: validators.spelling('withXSRFToken')
22290
+ }, true);
22291
+
22276
22292
  // Set config.method
22277
22293
  config.method = (config.method || this.defaults.method || 'get').toLowerCase();
22278
22294
 
@@ -23096,7 +23112,7 @@ function mergeConfig(config1, config2) {
23096
23112
  config2 = config2 || {};
23097
23113
  const config = {};
23098
23114
 
23099
- function getMergedValue(target, source, caseless) {
23115
+ function getMergedValue(target, source, prop, caseless) {
23100
23116
  if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isPlainObject(target) && _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isPlainObject(source)) {
23101
23117
  return _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].merge.call({caseless}, target, source);
23102
23118
  } else if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isPlainObject(source)) {
@@ -23108,11 +23124,11 @@ function mergeConfig(config1, config2) {
23108
23124
  }
23109
23125
 
23110
23126
  // eslint-disable-next-line consistent-return
23111
- function mergeDeepProperties(a, b, caseless) {
23127
+ function mergeDeepProperties(a, b, prop , caseless) {
23112
23128
  if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(b)) {
23113
- return getMergedValue(a, b, caseless);
23129
+ return getMergedValue(a, b, prop , caseless);
23114
23130
  } else if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(a)) {
23115
- return getMergedValue(undefined, a, caseless);
23131
+ return getMergedValue(undefined, a, prop , caseless);
23116
23132
  }
23117
23133
  }
23118
23134
 
@@ -23170,7 +23186,7 @@ function mergeConfig(config1, config2) {
23170
23186
  socketPath: defaultToConfig2,
23171
23187
  responseEncoding: defaultToConfig2,
23172
23188
  validateStatus: mergeDirectKeys,
23173
- headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
23189
+ headers: (a, b , prop) => mergeDeepProperties(headersToObject(a), headersToObject(b),prop, true)
23174
23190
  };
23175
23191
 
23176
23192
  _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
@@ -23484,7 +23500,7 @@ __webpack_require__.r(__webpack_exports__);
23484
23500
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
23485
23501
  /* harmony export */ VERSION: function() { return /* binding */ VERSION; }
23486
23502
  /* harmony export */ });
23487
- const VERSION = "1.7.7";
23503
+ const VERSION = "1.7.8";
23488
23504
 
23489
23505
  /***/ }),
23490
23506
 
@@ -23705,7 +23721,7 @@ function encode(val) {
23705
23721
  *
23706
23722
  * @param {string} url The base of the url (e.g., http://www.google.com)
23707
23723
  * @param {object} [params] The params to be appended
23708
- * @param {?object} options
23724
+ * @param {?(object|Function)} options
23709
23725
  *
23710
23726
  * @returns {string} The formatted url
23711
23727
  */
@@ -23717,6 +23733,12 @@ function buildURL(url, params, options) {
23717
23733
 
23718
23734
  const _encode = options && options.encode || encode;
23719
23735
 
23736
+ if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(options)) {
23737
+ options = {
23738
+ serialize: options
23739
+ };
23740
+ }
23741
+
23720
23742
  const serializeFn = options && options.serialize;
23721
23743
 
23722
23744
  let serializedParams;
@@ -24069,75 +24091,21 @@ function isAxiosError(payload) {
24069
24091
 
24070
24092
  "use strict";
24071
24093
  __webpack_require__.r(__webpack_exports__);
24072
- /* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../utils.js */ "../node_modules/axios/lib/utils.js");
24073
24094
  /* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../platform/index.js */ "../node_modules/axios/lib/platform/index.js");
24074
24095
 
24075
24096
 
24097
+ /* harmony default export */ __webpack_exports__["default"] = (_platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => {
24098
+ url = new URL(url, _platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].origin);
24076
24099
 
24077
-
24078
-
24079
- /* harmony default export */ __webpack_exports__["default"] = (_platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].hasStandardBrowserEnv ?
24080
-
24081
- // Standard browser envs have full support of the APIs needed to test
24082
- // whether the request URL is of the same origin as current location.
24083
- (function standardBrowserEnv() {
24084
- const msie = _platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].navigator && /(msie|trident)/i.test(_platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].navigator.userAgent);
24085
- const urlParsingNode = document.createElement('a');
24086
- let originURL;
24087
-
24088
- /**
24089
- * Parse a URL to discover its components
24090
- *
24091
- * @param {String} url The URL to be parsed
24092
- * @returns {Object}
24093
- */
24094
- function resolveURL(url) {
24095
- let href = url;
24096
-
24097
- if (msie) {
24098
- // IE needs attribute set twice to normalize properties
24099
- urlParsingNode.setAttribute('href', href);
24100
- href = urlParsingNode.href;
24101
- }
24102
-
24103
- urlParsingNode.setAttribute('href', href);
24104
-
24105
- // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
24106
- return {
24107
- href: urlParsingNode.href,
24108
- protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
24109
- host: urlParsingNode.host,
24110
- search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
24111
- hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
24112
- hostname: urlParsingNode.hostname,
24113
- port: urlParsingNode.port,
24114
- pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
24115
- urlParsingNode.pathname :
24116
- '/' + urlParsingNode.pathname
24117
- };
24118
- }
24119
-
24120
- originURL = resolveURL(window.location.href);
24121
-
24122
- /**
24123
- * Determine if a URL shares the same origin as the current location
24124
- *
24125
- * @param {String} requestURL The URL to test
24126
- * @returns {boolean} True if URL shares the same origin, otherwise false
24127
- */
24128
- return function isURLSameOrigin(requestURL) {
24129
- const parsed = (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isString(requestURL)) ? resolveURL(requestURL) : requestURL;
24130
- return (parsed.protocol === originURL.protocol &&
24131
- parsed.host === originURL.host);
24132
- };
24133
- })() :
24134
-
24135
- // Non standard browser envs (web workers, react-native) lack needed support.
24136
- (function nonStandardBrowserEnv() {
24137
- return function isURLSameOrigin() {
24138
- return true;
24139
- };
24140
- })());
24100
+ return (
24101
+ origin.protocol === url.protocol &&
24102
+ origin.host === url.host &&
24103
+ (isMSIE || origin.port === url.port)
24104
+ );
24105
+ })(
24106
+ new URL(_platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].origin),
24107
+ _platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].navigator && /(msie|trident)/i.test(_platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].navigator.userAgent)
24108
+ ) : () => true);
24141
24109
 
24142
24110
 
24143
24111
  /***/ }),
@@ -24990,6 +24958,14 @@ validators.transitional = function transitional(validator, version, message) {
24990
24958
  };
24991
24959
  };
24992
24960
 
24961
+ validators.spelling = function spelling(correctSpelling) {
24962
+ return (value, opt) => {
24963
+ // eslint-disable-next-line no-console
24964
+ console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
24965
+ return true;
24966
+ }
24967
+ };
24968
+
24993
24969
  /**
24994
24970
  * Assert object's properties type
24995
24971
  *
@@ -27382,7 +27358,7 @@ function createClient(params) {
27382
27358
  var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
27383
27359
  var sdkMain = opts.type === 'plain' ? 'contentful-management-plain.js' : 'contentful-management.js';
27384
27360
  var userAgent = (0,contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__.getUserAgentHeader)(// @ts-expect-error
27385
- "".concat(sdkMain, "/").concat("11.39.1"), params.application, params.integration, params.feature);
27361
+ "".concat(sdkMain, "/").concat("11.40.0"), params.application, params.integration, params.feature);
27386
27362
  var adapter = (0,_create_adapter__WEBPACK_IMPORTED_MODULE_1__.createAdapter)(_objectSpread(_objectSpread({}, params), {}, {
27387
27363
  userAgent: userAgent
27388
27364
  }));