contentful-management 11.48.0 → 11.49.0-beta.1

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.
@@ -4746,9 +4746,13 @@ const makeRequest = async ({
4746
4746
  if (endpoint === undefined) {
4747
4747
  throw new Error('Unknown endpoint');
4748
4748
  }
4749
- return await endpoint(axiosInstance, params, payload, _objectSpread(_objectSpread({}, headers), userAgent ? {
4749
+ const response = await endpoint(axiosInstance, params, payload, _objectSpread(_objectSpread({}, headers), userAgent ? {
4750
4750
  'X-Contentful-User-Agent': userAgent
4751
4751
  } : {}));
4752
+ if (response instanceof ReadableStream) {
4753
+ return await new Response(response).json();
4754
+ }
4755
+ return response;
4752
4756
  };
4753
4757
 
4754
4758
  /***/ }),
@@ -24503,6 +24507,17 @@ module.exports = require("assert");
24503
24507
 
24504
24508
  /***/ }),
24505
24509
 
24510
+ /***/ "crypto":
24511
+ /*!*************************!*\
24512
+ !*** external "crypto" ***!
24513
+ \*************************/
24514
+ /***/ ((module) => {
24515
+
24516
+ "use strict";
24517
+ module.exports = require("crypto");
24518
+
24519
+ /***/ }),
24520
+
24506
24521
  /***/ "events":
24507
24522
  /*!*************************!*\
24508
24523
  !*** external "events" ***!
@@ -25254,7 +25269,7 @@ const buildAddressEntry = (address, family) => resolveFamily(_utils_js__WEBPACK_
25254
25269
  }
25255
25270
 
25256
25271
  // Parse url
25257
- const fullPath = (0,_core_buildFullPath_js__WEBPACK_IMPORTED_MODULE_12__["default"])(config.baseURL, config.url);
25272
+ const fullPath = (0,_core_buildFullPath_js__WEBPACK_IMPORTED_MODULE_12__["default"])(config.baseURL, config.url, config.allowAbsoluteUrls);
25258
25273
  const parsed = new URL(fullPath, _platform_index_js__WEBPACK_IMPORTED_MODULE_9__["default"].hasBrowserEnv ? _platform_index_js__WEBPACK_IMPORTED_MODULE_9__["default"].origin : undefined);
25259
25274
  const protocol = parsed.protocol || supportedProtocols[0];
25260
25275
 
@@ -26397,6 +26412,15 @@ class Axios {
26397
26412
  }
26398
26413
  }
26399
26414
 
26415
+ // Set config.allowAbsoluteUrls
26416
+ if (config.allowAbsoluteUrls !== undefined) {
26417
+ // do nothing
26418
+ } else if (this.defaults.allowAbsoluteUrls !== undefined) {
26419
+ config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
26420
+ } else {
26421
+ config.allowAbsoluteUrls = true;
26422
+ }
26423
+
26400
26424
  _helpers_validator_js__WEBPACK_IMPORTED_MODULE_0__["default"].assertOptions(config, {
26401
26425
  baseUrl: validators.spelling('baseURL'),
26402
26426
  withXsrfToken: validators.spelling('withXSRFToken')
@@ -26492,7 +26516,7 @@ class Axios {
26492
26516
 
26493
26517
  getUri(config) {
26494
26518
  config = (0,_mergeConfig_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this.defaults, config);
26495
- const fullPath = (0,_buildFullPath_js__WEBPACK_IMPORTED_MODULE_6__["default"])(config.baseURL, config.url);
26519
+ const fullPath = (0,_buildFullPath_js__WEBPACK_IMPORTED_MODULE_6__["default"])(config.baseURL, config.url, config.allowAbsoluteUrls);
26496
26520
  return (0,_helpers_buildURL_js__WEBPACK_IMPORTED_MODULE_7__["default"])(fullPath, config.params, config.paramsSerializer);
26497
26521
  }
26498
26522
  }
@@ -27088,8 +27112,9 @@ __webpack_require__.r(__webpack_exports__);
27088
27112
  *
27089
27113
  * @returns {string} The combined full path
27090
27114
  */
27091
- function buildFullPath(baseURL, requestedURL) {
27092
- if (baseURL && !(0,_helpers_isAbsoluteURL_js__WEBPACK_IMPORTED_MODULE_0__["default"])(requestedURL)) {
27115
+ function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
27116
+ let isRelativeUrl = !(0,_helpers_isAbsoluteURL_js__WEBPACK_IMPORTED_MODULE_0__["default"])(requestedURL);
27117
+ if (baseURL && isRelativeUrl || allowAbsoluteUrls == false) {
27093
27118
  return (0,_helpers_combineURLs_js__WEBPACK_IMPORTED_MODULE_1__["default"])(baseURL, requestedURL);
27094
27119
  }
27095
27120
  return requestedURL;
@@ -27628,7 +27653,7 @@ __webpack_require__.r(__webpack_exports__);
27628
27653
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
27629
27654
  /* harmony export */ VERSION: () => (/* binding */ VERSION)
27630
27655
  /* harmony export */ });
27631
- const VERSION = "1.7.9";
27656
+ const VERSION = "1.8.2";
27632
27657
 
27633
27658
  /***/ }),
27634
27659
 
@@ -28415,14 +28440,16 @@ __webpack_require__.r(__webpack_exports__);
28415
28440
  /* harmony export */ });
28416
28441
  /* harmony import */ var util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! util */ "util");
28417
28442
  /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! stream */ "stream");
28418
- /* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils.js */ "../node_modules/axios/lib/utils.js");
28419
- /* harmony import */ var _readBlob_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./readBlob.js */ "../node_modules/axios/lib/helpers/readBlob.js");
28443
+ /* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils.js */ "../node_modules/axios/lib/utils.js");
28444
+ /* harmony import */ var _readBlob_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./readBlob.js */ "../node_modules/axios/lib/helpers/readBlob.js");
28445
+ /* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../platform/index.js */ "../node_modules/axios/lib/platform/index.js");
28446
+
28420
28447
 
28421
28448
 
28422
28449
 
28423
28450
 
28424
28451
 
28425
- const BOUNDARY_ALPHABET = _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].ALPHABET.ALPHA_DIGIT + '-_';
28452
+ const BOUNDARY_ALPHABET = _platform_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].ALPHABET.ALPHA_DIGIT + '-_';
28426
28453
 
28427
28454
  const textEncoder = typeof TextEncoder === 'function' ? new TextEncoder() : new util__WEBPACK_IMPORTED_MODULE_0__.TextEncoder();
28428
28455
 
@@ -28433,7 +28460,7 @@ const CRLF_BYTES_COUNT = 2;
28433
28460
  class FormDataPart {
28434
28461
  constructor(name, value) {
28435
28462
  const {escapeName} = this.constructor;
28436
- const isStringValue = _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].isString(value);
28463
+ const isStringValue = _utils_js__WEBPACK_IMPORTED_MODULE_3__["default"].isString(value);
28437
28464
 
28438
28465
  let headers = `Content-Disposition: form-data; name="${escapeName(name)}"${
28439
28466
  !isStringValue && value.name ? `; filename="${escapeName(value.name)}"` : ''
@@ -28460,10 +28487,10 @@ class FormDataPart {
28460
28487
 
28461
28488
  const {value} = this;
28462
28489
 
28463
- if(_utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].isTypedArray(value)) {
28490
+ if(_utils_js__WEBPACK_IMPORTED_MODULE_3__["default"].isTypedArray(value)) {
28464
28491
  yield value;
28465
28492
  } else {
28466
- yield* (0,_readBlob_js__WEBPACK_IMPORTED_MODULE_3__["default"])(value);
28493
+ yield* (0,_readBlob_js__WEBPACK_IMPORTED_MODULE_4__["default"])(value);
28467
28494
  }
28468
28495
 
28469
28496
  yield CRLF_BYTES;
@@ -28482,10 +28509,10 @@ const formDataToStream = (form, headersHandler, options) => {
28482
28509
  const {
28483
28510
  tag = 'form-data-boundary',
28484
28511
  size = 25,
28485
- boundary = tag + '-' + _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].generateString(size, BOUNDARY_ALPHABET)
28512
+ boundary = tag + '-' + _platform_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].generateString(size, BOUNDARY_ALPHABET)
28486
28513
  } = options || {};
28487
28514
 
28488
- if(!_utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].isFormData(form)) {
28515
+ if(!_utils_js__WEBPACK_IMPORTED_MODULE_3__["default"].isFormData(form)) {
28489
28516
  throw TypeError('FormData instance required');
28490
28517
  }
28491
28518
 
@@ -28505,7 +28532,7 @@ const formDataToStream = (form, headersHandler, options) => {
28505
28532
 
28506
28533
  contentLength += boundaryBytes.byteLength * parts.length;
28507
28534
 
28508
- contentLength = _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].toFiniteNumber(contentLength);
28535
+ contentLength = _utils_js__WEBPACK_IMPORTED_MODULE_3__["default"].toFiniteNumber(contentLength);
28509
28536
 
28510
28537
  const computedHeaders = {
28511
28538
  'Content-Type': `multipart/form-data; boundary=${boundary}`
@@ -29762,18 +29789,45 @@ __webpack_require__.r(__webpack_exports__);
29762
29789
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
29763
29790
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
29764
29791
  /* harmony export */ });
29765
- /* harmony import */ var _classes_URLSearchParams_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./classes/URLSearchParams.js */ "../node_modules/axios/lib/platform/node/classes/URLSearchParams.js");
29766
- /* harmony import */ var _classes_FormData_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./classes/FormData.js */ "../node_modules/axios/lib/platform/node/classes/FormData.js");
29792
+ /* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! crypto */ "crypto");
29793
+ /* harmony import */ var _classes_URLSearchParams_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./classes/URLSearchParams.js */ "../node_modules/axios/lib/platform/node/classes/URLSearchParams.js");
29794
+ /* harmony import */ var _classes_FormData_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./classes/FormData.js */ "../node_modules/axios/lib/platform/node/classes/FormData.js");
29767
29795
 
29768
29796
 
29769
29797
 
29798
+
29799
+ const ALPHA = 'abcdefghijklmnopqrstuvwxyz'
29800
+
29801
+ const DIGIT = '0123456789';
29802
+
29803
+ const ALPHABET = {
29804
+ DIGIT,
29805
+ ALPHA,
29806
+ ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
29807
+ }
29808
+
29809
+ const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
29810
+ let str = '';
29811
+ const {length} = alphabet;
29812
+ const randomValues = new Uint32Array(size);
29813
+ crypto__WEBPACK_IMPORTED_MODULE_0__.randomFillSync(randomValues);
29814
+ for (let i = 0; i < size; i++) {
29815
+ str += alphabet[randomValues[i] % length];
29816
+ }
29817
+
29818
+ return str;
29819
+ }
29820
+
29821
+
29770
29822
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
29771
29823
  isNode: true,
29772
29824
  classes: {
29773
- URLSearchParams: _classes_URLSearchParams_js__WEBPACK_IMPORTED_MODULE_0__["default"],
29774
- FormData: _classes_FormData_js__WEBPACK_IMPORTED_MODULE_1__["default"],
29825
+ URLSearchParams: _classes_URLSearchParams_js__WEBPACK_IMPORTED_MODULE_1__["default"],
29826
+ FormData: _classes_FormData_js__WEBPACK_IMPORTED_MODULE_2__["default"],
29775
29827
  Blob: typeof Blob !== 'undefined' && Blob || null
29776
29828
  },
29829
+ ALPHABET,
29830
+ generateString,
29777
29831
  protocols: [ 'http', 'https', 'file', 'data' ]
29778
29832
  });
29779
29833
 
@@ -30396,26 +30450,6 @@ const toFiniteNumber = (value, defaultValue) => {
30396
30450
  return value != null && Number.isFinite(value = +value) ? value : defaultValue;
30397
30451
  }
30398
30452
 
30399
- const ALPHA = 'abcdefghijklmnopqrstuvwxyz'
30400
-
30401
- const DIGIT = '0123456789';
30402
-
30403
- const ALPHABET = {
30404
- DIGIT,
30405
- ALPHA,
30406
- ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
30407
- }
30408
-
30409
- const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
30410
- let str = '';
30411
- const {length} = alphabet;
30412
- while (size--) {
30413
- str += alphabet[Math.random() * length|0]
30414
- }
30415
-
30416
- return str;
30417
- }
30418
-
30419
30453
  /**
30420
30454
  * If the thing is a FormData object, return true, otherwise return false.
30421
30455
  *
@@ -30543,8 +30577,6 @@ const asap = typeof queueMicrotask !== 'undefined' ?
30543
30577
  findKey,
30544
30578
  global: _global,
30545
30579
  isContextDefined,
30546
- ALPHABET,
30547
- generateString,
30548
30580
  isSpecCompliantForm,
30549
30581
  toJSONObject,
30550
30582
  isAsyncFn,
@@ -32008,7 +32040,7 @@ function createClient(params, opts = {}) {
32008
32040
  const sdkMain = opts.type === 'plain' ? 'contentful-management-plain.js' : 'contentful-management.js';
32009
32041
  const userAgent = (0,contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__.getUserAgentHeader)(
32010
32042
  // @ts-expect-error
32011
- `${sdkMain}/${"11.48.0"}`, params.application, params.integration, params.feature);
32043
+ `${sdkMain}/${"11.49.0-beta.1"}`, params.application, params.integration, params.feature);
32012
32044
  const adapter = (0,_create_adapter__WEBPACK_IMPORTED_MODULE_1__.createAdapter)(_objectSpread(_objectSpread({}, params), {}, {
32013
32045
  userAgent
32014
32046
  }));