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.
@@ -4333,6 +4333,7 @@ __webpack_require__.r(__webpack_exports__);
4333
4333
  /* harmony export */ complete: () => (/* binding */ complete),
4334
4334
  /* harmony export */ create: () => (/* binding */ create),
4335
4335
  /* harmony export */ del: () => (/* binding */ del),
4336
+ /* harmony export */ get: () => (/* binding */ get),
4336
4337
  /* harmony export */ getMany: () => (/* binding */ getMany),
4337
4338
  /* harmony export */ update: () => (/* binding */ update)
4338
4339
  /* harmony export */ });
@@ -4356,6 +4357,9 @@ const getMany = (http, params, headers) => _raw__WEBPACK_IMPORTED_MODULE_1__.get
4356
4357
  headers,
4357
4358
  params: params.query
4358
4359
  });
4360
+ const get = (http, params, headers) => _raw__WEBPACK_IMPORTED_MODULE_1__.get(http, getWorkflowUrl(params), {
4361
+ headers
4362
+ });
4359
4363
  const create = (http, params, rawData, headers) => {
4360
4364
  const data = (0,fast_copy__WEBPACK_IMPORTED_MODULE_0__["default"])(rawData);
4361
4365
  return _raw__WEBPACK_IMPORTED_MODULE_1__.post(http, getBaseUrl(params), data, {
@@ -4456,7 +4460,11 @@ class RestAdapter {
4456
4460
  if (!params.accessToken) {
4457
4461
  throw new TypeError('Expected parameter accessToken');
4458
4462
  }
4459
- this.params = _objectSpread(_objectSpread({}, defaultHostParameters), (0,fast_copy__WEBPACK_IMPORTED_MODULE_1__["default"])(params));
4463
+ const copiedParams = (0,fast_copy__WEBPACK_IMPORTED_MODULE_1__["default"])(params);
4464
+ // httpAgent and httpsAgent cannot be copied because they can contain private fields
4465
+ copiedParams.httpAgent = params.httpAgent;
4466
+ copiedParams.httpsAgent = params.httpsAgent;
4467
+ this.params = _objectSpread(_objectSpread({}, defaultHostParameters), copiedParams);
4460
4468
  this.axiosInstance = (0,contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__.createHttpClient)(axios__WEBPACK_IMPORTED_MODULE_3__["default"], _objectSpread(_objectSpread({}, this.params), {}, {
4461
4469
  headers: _objectSpread(_objectSpread({
4462
4470
  'Content-Type': 'application/vnd.contentful.management.v1+json'
@@ -17038,6 +17046,7 @@ const createPlainClient = (makeRequest, defaults) => {
17038
17046
  delete: (0,_wrappers_wrap__WEBPACK_IMPORTED_MODULE_1__.wrap)(wrapParams, 'WorkflowDefinition', 'delete')
17039
17047
  },
17040
17048
  workflow: {
17049
+ get: (0,_wrappers_wrap__WEBPACK_IMPORTED_MODULE_1__.wrap)(wrapParams, 'Workflow', 'get'),
17041
17050
  getMany: (0,_wrappers_wrap__WEBPACK_IMPORTED_MODULE_1__.wrap)(wrapParams, 'Workflow', 'getMany'),
17042
17051
  create: (0,_wrappers_wrap__WEBPACK_IMPORTED_MODULE_1__.wrap)(wrapParams, 'Workflow', 'create'),
17043
17052
  update: (0,_wrappers_wrap__WEBPACK_IMPORTED_MODULE_1__.wrap)(wrapParams, 'Workflow', 'update'),
@@ -23837,7 +23846,7 @@ function dispatchBeforeRedirect(options, responseDetails) {
23837
23846
  function setProxy(options, configProxy, location) {
23838
23847
  let proxy = configProxy;
23839
23848
  if (!proxy && proxy !== false) {
23840
- const proxyUrl = (0,proxy_from_env__WEBPACK_IMPORTED_MODULE_0__.getProxyForUrl)(location);
23849
+ const proxyUrl = proxy_from_env__WEBPACK_IMPORTED_MODULE_0__.getProxyForUrl(location);
23841
23850
  if (proxyUrl) {
23842
23851
  proxy = new URL(proxyUrl);
23843
23852
  }
@@ -24068,7 +24077,7 @@ const buildAddressEntry = (address, family) => resolveFamily(_utils_js__WEBPACK_
24068
24077
  } catch (e) {
24069
24078
  }
24070
24079
  }
24071
- } else if (_utils_js__WEBPACK_IMPORTED_MODULE_8__["default"].isBlob(data)) {
24080
+ } else if (_utils_js__WEBPACK_IMPORTED_MODULE_8__["default"].isBlob(data) || _utils_js__WEBPACK_IMPORTED_MODULE_8__["default"].isFile(data)) {
24072
24081
  data.size && headers.setContentType(data.type || 'application/octet-stream');
24073
24082
  headers.setContentLength(data.size || 0);
24074
24083
  data = stream__WEBPACK_IMPORTED_MODULE_6__.Readable.from((0,_helpers_readBlob_js__WEBPACK_IMPORTED_MODULE_19__["default"])(data));
@@ -24323,7 +24332,7 @@ const buildAddressEntry = (address, family) => resolveFamily(_utils_js__WEBPACK_
24323
24332
  }
24324
24333
 
24325
24334
  const err = new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_15__["default"](
24326
- 'maxContentLength size of ' + config.maxContentLength + ' exceeded',
24335
+ 'stream has been aborted',
24327
24336
  _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_15__["default"].ERR_BAD_RESPONSE,
24328
24337
  config,
24329
24338
  lastRequest
@@ -25068,9 +25077,9 @@ class Axios {
25068
25077
  return await this._request(configOrUrl, config);
25069
25078
  } catch (err) {
25070
25079
  if (err instanceof Error) {
25071
- let dummy;
25080
+ let dummy = {};
25072
25081
 
25073
- Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error());
25082
+ Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());
25074
25083
 
25075
25084
  // slice off the Error: ... line
25076
25085
  const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
@@ -25125,6 +25134,11 @@ class Axios {
25125
25134
  }
25126
25135
  }
25127
25136
 
25137
+ _helpers_validator_js__WEBPACK_IMPORTED_MODULE_0__["default"].assertOptions(config, {
25138
+ baseUrl: validators.spelling('baseURL'),
25139
+ withXsrfToken: validators.spelling('withXSRFToken')
25140
+ }, true);
25141
+
25128
25142
  // Set config.method
25129
25143
  config.method = (config.method || this.defaults.method || 'get').toLowerCase();
25130
25144
 
@@ -25957,7 +25971,7 @@ function mergeConfig(config1, config2) {
25957
25971
  config2 = config2 || {};
25958
25972
  const config = {};
25959
25973
 
25960
- function getMergedValue(target, source, caseless) {
25974
+ function getMergedValue(target, source, prop, caseless) {
25961
25975
  if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isPlainObject(target) && _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isPlainObject(source)) {
25962
25976
  return _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].merge.call({caseless}, target, source);
25963
25977
  } else if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isPlainObject(source)) {
@@ -25969,11 +25983,11 @@ function mergeConfig(config1, config2) {
25969
25983
  }
25970
25984
 
25971
25985
  // eslint-disable-next-line consistent-return
25972
- function mergeDeepProperties(a, b, caseless) {
25986
+ function mergeDeepProperties(a, b, prop , caseless) {
25973
25987
  if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(b)) {
25974
- return getMergedValue(a, b, caseless);
25988
+ return getMergedValue(a, b, prop , caseless);
25975
25989
  } else if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(a)) {
25976
- return getMergedValue(undefined, a, caseless);
25990
+ return getMergedValue(undefined, a, prop , caseless);
25977
25991
  }
25978
25992
  }
25979
25993
 
@@ -26031,7 +26045,7 @@ function mergeConfig(config1, config2) {
26031
26045
  socketPath: defaultToConfig2,
26032
26046
  responseEncoding: defaultToConfig2,
26033
26047
  validateStatus: mergeDirectKeys,
26034
- headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
26048
+ headers: (a, b , prop) => mergeDeepProperties(headersToObject(a), headersToObject(b),prop, true)
26035
26049
  };
26036
26050
 
26037
26051
  _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
@@ -26351,7 +26365,7 @@ __webpack_require__.r(__webpack_exports__);
26351
26365
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
26352
26366
  /* harmony export */ VERSION: () => (/* binding */ VERSION)
26353
26367
  /* harmony export */ });
26354
- const VERSION = "1.7.7";
26368
+ const VERSION = "1.7.8";
26355
26369
 
26356
26370
  /***/ }),
26357
26371
 
@@ -26782,7 +26796,7 @@ function encode(val) {
26782
26796
  *
26783
26797
  * @param {string} url The base of the url (e.g., http://www.google.com)
26784
26798
  * @param {object} [params] The params to be appended
26785
- * @param {?object} options
26799
+ * @param {?(object|Function)} options
26786
26800
  *
26787
26801
  * @returns {string} The formatted url
26788
26802
  */
@@ -26794,6 +26808,12 @@ function buildURL(url, params, options) {
26794
26808
 
26795
26809
  const _encode = options && options.encode || encode;
26796
26810
 
26811
+ if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(options)) {
26812
+ options = {
26813
+ serialize: options
26814
+ };
26815
+ }
26816
+
26797
26817
  const serializeFn = options && options.serialize;
26798
26818
 
26799
26819
  let serializedParams;
@@ -27141,7 +27161,7 @@ __webpack_require__.r(__webpack_exports__);
27141
27161
 
27142
27162
  const BOUNDARY_ALPHABET = _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].ALPHABET.ALPHA_DIGIT + '-_';
27143
27163
 
27144
- const textEncoder = new util__WEBPACK_IMPORTED_MODULE_0__.TextEncoder();
27164
+ const textEncoder = typeof TextEncoder === 'function' ? new TextEncoder() : new util__WEBPACK_IMPORTED_MODULE_0__.TextEncoder();
27145
27165
 
27146
27166
  const CRLF = '\r\n';
27147
27167
  const CRLF_BYTES = textEncoder.encode(CRLF);
@@ -27391,75 +27411,21 @@ __webpack_require__.r(__webpack_exports__);
27391
27411
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
27392
27412
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
27393
27413
  /* harmony export */ });
27394
- /* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../utils.js */ "../node_modules/axios/lib/utils.js");
27395
27414
  /* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../platform/index.js */ "../node_modules/axios/lib/platform/index.js");
27396
27415
 
27397
27416
 
27417
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => {
27418
+ url = new URL(url, _platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].origin);
27398
27419
 
27399
-
27400
-
27401
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].hasStandardBrowserEnv ?
27402
-
27403
- // Standard browser envs have full support of the APIs needed to test
27404
- // whether the request URL is of the same origin as current location.
27405
- (function standardBrowserEnv() {
27406
- 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);
27407
- const urlParsingNode = document.createElement('a');
27408
- let originURL;
27409
-
27410
- /**
27411
- * Parse a URL to discover its components
27412
- *
27413
- * @param {String} url The URL to be parsed
27414
- * @returns {Object}
27415
- */
27416
- function resolveURL(url) {
27417
- let href = url;
27418
-
27419
- if (msie) {
27420
- // IE needs attribute set twice to normalize properties
27421
- urlParsingNode.setAttribute('href', href);
27422
- href = urlParsingNode.href;
27423
- }
27424
-
27425
- urlParsingNode.setAttribute('href', href);
27426
-
27427
- // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
27428
- return {
27429
- href: urlParsingNode.href,
27430
- protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
27431
- host: urlParsingNode.host,
27432
- search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
27433
- hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
27434
- hostname: urlParsingNode.hostname,
27435
- port: urlParsingNode.port,
27436
- pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
27437
- urlParsingNode.pathname :
27438
- '/' + urlParsingNode.pathname
27439
- };
27440
- }
27441
-
27442
- originURL = resolveURL(window.location.href);
27443
-
27444
- /**
27445
- * Determine if a URL shares the same origin as the current location
27446
- *
27447
- * @param {String} requestURL The URL to test
27448
- * @returns {boolean} True if URL shares the same origin, otherwise false
27449
- */
27450
- return function isURLSameOrigin(requestURL) {
27451
- const parsed = (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isString(requestURL)) ? resolveURL(requestURL) : requestURL;
27452
- return (parsed.protocol === originURL.protocol &&
27453
- parsed.host === originURL.host);
27454
- };
27455
- })() :
27456
-
27457
- // Non standard browser envs (web workers, react-native) lack needed support.
27458
- (function nonStandardBrowserEnv() {
27459
- return function isURLSameOrigin() {
27460
- return true;
27461
- };
27462
- })());
27420
+ return (
27421
+ origin.protocol === url.protocol &&
27422
+ origin.host === url.host &&
27423
+ (isMSIE || origin.port === url.port)
27424
+ );
27425
+ })(
27426
+ new URL(_platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].origin),
27427
+ _platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].navigator && /(msie|trident)/i.test(_platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].navigator.userAgent)
27428
+ ) : () => true);
27463
27429
 
27464
27430
 
27465
27431
  /***/ }),
@@ -28346,6 +28312,14 @@ validators.transitional = function transitional(validator, version, message) {
28346
28312
  };
28347
28313
  };
28348
28314
 
28315
+ validators.spelling = function spelling(correctSpelling) {
28316
+ return (value, opt) => {
28317
+ // eslint-disable-next-line no-console
28318
+ console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
28319
+ return true;
28320
+ }
28321
+ };
28322
+
28349
28323
  /**
28350
28324
  * Assert object's properties type
28351
28325
  *
@@ -30738,7 +30712,7 @@ function createClient(params, opts = {}) {
30738
30712
  const sdkMain = opts.type === 'plain' ? 'contentful-management-plain.js' : 'contentful-management.js';
30739
30713
  const userAgent = (0,contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__.getUserAgentHeader)(
30740
30714
  // @ts-expect-error
30741
- `${sdkMain}/${"11.39.1"}`, params.application, params.integration, params.feature);
30715
+ `${sdkMain}/${"11.40.0"}`, params.application, params.integration, params.feature);
30742
30716
  const adapter = (0,_create_adapter__WEBPACK_IMPORTED_MODULE_1__.createAdapter)(_objectSpread(_objectSpread({}, params), {}, {
30743
30717
  userAgent
30744
30718
  }));