contentful-management 12.0.0-beta.12 → 12.0.0-beta.13

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.
Files changed (27) hide show
  1. package/dist/contentful-management.bundle.browser.js +561 -499
  2. package/dist/contentful-management.bundle.browser.js.map +1 -1
  3. package/dist/contentful-management.bundle.browser.min.js +1 -1
  4. package/dist/contentful-management.bundle.browser.min.js.map +1 -1
  5. package/dist/contentful-management.bundle.node.cjs +350 -175
  6. package/dist/contentful-management.bundle.node.cjs.map +1 -1
  7. package/dist/esm/adapters/REST/endpoints/environment-template-installation.js +2 -2
  8. package/dist/esm/adapters/REST/endpoints/environment-template-installation.js.map +1 -1
  9. package/dist/esm/common-types.js.map +1 -1
  10. package/dist/esm/create-contentful-api.js +1 -1
  11. package/dist/esm/create-environment-template-api.js +3 -1
  12. package/dist/esm/create-environment-template-api.js.map +1 -1
  13. package/dist/esm/entities/environment-template-installation.js.map +1 -1
  14. package/dist/esm/index.js +1 -1
  15. package/dist/esm/plain/plain-client.js +1 -1
  16. package/dist/stats-browser-min.html +1 -1
  17. package/dist/types/adapters/REST/endpoints/environment-template-installation.js +2 -2
  18. package/dist/types/adapters/REST/endpoints/environment-template-installation.js.map +1 -1
  19. package/dist/types/common-types.d.ts +2 -0
  20. package/dist/types/common-types.js.map +1 -1
  21. package/dist/types/create-environment-template-api.d.ts +3 -1
  22. package/dist/types/create-environment-template-api.js +3 -1
  23. package/dist/types/create-environment-template-api.js.map +1 -1
  24. package/dist/types/entities/environment-template-installation.d.ts +1 -0
  25. package/dist/types/entities/environment-template-installation.js.map +1 -1
  26. package/dist/types/plain/common-types.d.ts +2 -0
  27. package/package.json +22 -26
@@ -9,11 +9,12 @@ var require$$4 = require('https');
9
9
  var require$$0$2 = require('url');
10
10
  var require$$6 = require('fs');
11
11
  var require$$8 = require('crypto');
12
+ var require$$3$1 = require('http2');
12
13
  var require$$4$1 = require('assert');
13
- var require$$1$2 = require('tty');
14
+ var require$$0$4 = require('tty');
14
15
  var require$$0$3 = require('os');
15
- var require$$8$1 = require('zlib');
16
- var require$$10 = require('events');
16
+ var require$$9 = require('zlib');
17
+ var require$$11 = require('events');
17
18
 
18
19
  function _OverloadYield(e, d) {
19
20
  this.v = e, this.k = d;
@@ -2444,48 +2445,6 @@ function requireGetProto() {
2444
2445
  return getProto;
2445
2446
  }
2446
2447
 
2447
- var asyncFunction;
2448
- var hasRequiredAsyncFunction;
2449
- function requireAsyncFunction() {
2450
- if (hasRequiredAsyncFunction) return asyncFunction;
2451
- hasRequiredAsyncFunction = 1;
2452
-
2453
- // eslint-disable-next-line no-extra-parens, no-empty-function
2454
- const cached = /** @type {import('.').AsyncFunctionConstructor} */async function () {}.constructor;
2455
-
2456
- /** @type {import('.')} */
2457
- asyncFunction = () => cached;
2458
- return asyncFunction;
2459
- }
2460
-
2461
- var generatorFunction;
2462
- var hasRequiredGeneratorFunction;
2463
- function requireGeneratorFunction() {
2464
- if (hasRequiredGeneratorFunction) return generatorFunction;
2465
- hasRequiredGeneratorFunction = 1;
2466
-
2467
- // eslint-disable-next-line no-extra-parens, no-empty-function
2468
- const cached = /** @type {GeneratorFunctionConstructor} */function* () {}.constructor;
2469
-
2470
- /** @type {import('.')} */
2471
- generatorFunction = () => cached;
2472
- return generatorFunction;
2473
- }
2474
-
2475
- var asyncGeneratorFunction;
2476
- var hasRequiredAsyncGeneratorFunction;
2477
- function requireAsyncGeneratorFunction() {
2478
- if (hasRequiredAsyncGeneratorFunction) return asyncGeneratorFunction;
2479
- hasRequiredAsyncGeneratorFunction = 1;
2480
-
2481
- // eslint-disable-next-line no-extra-parens, no-empty-function
2482
- const cached = /** @type {import('.').AsyncGeneratorFunctionConstructor} */_wrapAsyncGenerator(function* () {}).constructor;
2483
-
2484
- /** @type {import('.')} */
2485
- asyncGeneratorFunction = () => cached;
2486
- return asyncGeneratorFunction;
2487
- }
2488
-
2489
2448
  var hasown;
2490
2449
  var hasRequiredHasown;
2491
2450
  function requireHasown() {
@@ -2521,6 +2480,14 @@ function requireGetIntrinsic() {
2521
2480
  var pow = /*@__PURE__*/requirePow();
2522
2481
  var round = /*@__PURE__*/requireRound();
2523
2482
  var sign = /*@__PURE__*/requireSign();
2483
+ var $Function = Function;
2484
+
2485
+ // eslint-disable-next-line consistent-return
2486
+ var getEvalledConstructor = function (expressionSyntax) {
2487
+ try {
2488
+ return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
2489
+ } catch (e) {}
2490
+ };
2524
2491
  var $gOPD = /*@__PURE__*/requireGopd();
2525
2492
  var $defineProperty = /*@__PURE__*/requireEsDefineProperty();
2526
2493
  var throwTypeError = function () {
@@ -2578,7 +2545,7 @@ function requireGetIntrinsic() {
2578
2545
  '%Float32Array%': typeof Float32Array === 'undefined' ? undefined$1 : Float32Array,
2579
2546
  '%Float64Array%': typeof Float64Array === 'undefined' ? undefined$1 : Float64Array,
2580
2547
  '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined$1 : FinalizationRegistry,
2581
- '%Function%': Function,
2548
+ '%Function%': $Function,
2582
2549
  '%GeneratorFunction%': needsEval,
2583
2550
  '%Int8Array%': typeof Int8Array === 'undefined' ? undefined$1 : Int8Array,
2584
2551
  '%Int16Array%': typeof Int16Array === 'undefined' ? undefined$1 : Int16Array,
@@ -2641,17 +2608,14 @@ function requireGetIntrinsic() {
2641
2608
  INTRINSICS['%Error.prototype%'] = errorProto;
2642
2609
  }
2643
2610
  }
2644
- var getAsyncFunction = requireAsyncFunction();
2645
- var getGeneratorFunction = /*@__PURE__*/requireGeneratorFunction();
2646
- var getAsyncGeneratorFunction = requireAsyncGeneratorFunction();
2647
2611
  var doEval = function doEval(name) {
2648
2612
  var value;
2649
2613
  if (name === '%AsyncFunction%') {
2650
- value = getAsyncFunction() || void undefined$1;
2614
+ value = getEvalledConstructor('async function () {}');
2651
2615
  } else if (name === '%GeneratorFunction%') {
2652
- value = getGeneratorFunction() || void undefined$1;
2616
+ value = getEvalledConstructor('function* () {}');
2653
2617
  } else if (name === '%AsyncGeneratorFunction%') {
2654
- value = getAsyncGeneratorFunction() || void undefined$1;
2618
+ value = getEvalledConstructor('async function* () {}');
2655
2619
  } else if (name === '%AsyncGenerator%') {
2656
2620
  var fn = doEval('%AsyncGeneratorFunction%');
2657
2621
  if (fn) {
@@ -17041,11 +17005,12 @@ var hasRequiredHasFlag;
17041
17005
  function requireHasFlag() {
17042
17006
  if (hasRequiredHasFlag) return hasFlag;
17043
17007
  hasRequiredHasFlag = 1;
17044
- hasFlag = (flag, argv = process.argv) => {
17008
+ hasFlag = (flag, argv) => {
17009
+ argv = argv || process.argv;
17045
17010
  const prefix = flag.startsWith('-') ? '' : flag.length === 1 ? '-' : '--';
17046
- const position = argv.indexOf(prefix + flag);
17047
- const terminatorPosition = argv.indexOf('--');
17048
- return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
17011
+ const pos = argv.indexOf(prefix + flag);
17012
+ const terminatorPos = argv.indexOf('--');
17013
+ return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
17049
17014
  };
17050
17015
  return hasFlag;
17051
17016
  }
@@ -17056,25 +17021,16 @@ function requireSupportsColor() {
17056
17021
  if (hasRequiredSupportsColor) return supportsColor_1;
17057
17022
  hasRequiredSupportsColor = 1;
17058
17023
  const os = require$$0$3;
17059
- const tty = require$$1$2;
17060
17024
  const hasFlag = requireHasFlag();
17061
- const {
17062
- env
17063
- } = process;
17025
+ const env = process.env;
17064
17026
  let forceColor;
17065
- if (hasFlag('no-color') || hasFlag('no-colors') || hasFlag('color=false') || hasFlag('color=never')) {
17066
- forceColor = 0;
17027
+ if (hasFlag('no-color') || hasFlag('no-colors') || hasFlag('color=false')) {
17028
+ forceColor = false;
17067
17029
  } else if (hasFlag('color') || hasFlag('colors') || hasFlag('color=true') || hasFlag('color=always')) {
17068
- forceColor = 1;
17030
+ forceColor = true;
17069
17031
  }
17070
17032
  if ('FORCE_COLOR' in env) {
17071
- if (env.FORCE_COLOR === 'true') {
17072
- forceColor = 1;
17073
- } else if (env.FORCE_COLOR === 'false') {
17074
- forceColor = 0;
17075
- } else {
17076
- forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
17077
- }
17033
+ forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;
17078
17034
  }
17079
17035
  function translateLevel(level) {
17080
17036
  if (level === 0) {
@@ -17087,8 +17043,8 @@ function requireSupportsColor() {
17087
17043
  has16m: level >= 3
17088
17044
  };
17089
17045
  }
17090
- function supportsColor(haveStream, streamIsTTY) {
17091
- if (forceColor === 0) {
17046
+ function supportsColor(stream) {
17047
+ if (forceColor === false) {
17092
17048
  return 0;
17093
17049
  }
17094
17050
  if (hasFlag('color=16m') || hasFlag('color=full') || hasFlag('color=truecolor')) {
@@ -17097,24 +17053,25 @@ function requireSupportsColor() {
17097
17053
  if (hasFlag('color=256')) {
17098
17054
  return 2;
17099
17055
  }
17100
- if (haveStream && !streamIsTTY && forceColor === undefined) {
17056
+ if (stream && !stream.isTTY && forceColor !== true) {
17101
17057
  return 0;
17102
17058
  }
17103
- const min = forceColor || 0;
17104
- if (env.TERM === 'dumb') {
17105
- return min;
17106
- }
17059
+ const min = forceColor ? 1 : 0;
17107
17060
  if (process.platform === 'win32') {
17108
- // Windows 10 build 10586 is the first Windows release that supports 256 colors.
17109
- // Windows 10 build 14931 is the first release that supports 16m/TrueColor.
17061
+ // Node.js 7.5.0 is the first version of Node.js to include a patch to
17062
+ // libuv that enables 256 color output on Windows. Anything earlier and it
17063
+ // won't work. However, here we target Node.js 8 at minimum as it is an LTS
17064
+ // release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows
17065
+ // release that supports 256 colors. Windows 10 build 14931 is the first release
17066
+ // that supports 16m/TrueColor.
17110
17067
  const osRelease = os.release().split('.');
17111
- if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
17068
+ if (Number(process.versions.node.split('.')[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
17112
17069
  return Number(osRelease[2]) >= 14931 ? 3 : 2;
17113
17070
  }
17114
17071
  return 1;
17115
17072
  }
17116
17073
  if ('CI' in env) {
17117
- if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
17074
+ if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
17118
17075
  return 1;
17119
17076
  }
17120
17077
  return min;
@@ -17144,16 +17101,19 @@ function requireSupportsColor() {
17144
17101
  if ('COLORTERM' in env) {
17145
17102
  return 1;
17146
17103
  }
17104
+ if (env.TERM === 'dumb') {
17105
+ return min;
17106
+ }
17147
17107
  return min;
17148
17108
  }
17149
17109
  function getSupportLevel(stream) {
17150
- const level = supportsColor(stream, stream && stream.isTTY);
17110
+ const level = supportsColor(stream);
17151
17111
  return translateLevel(level);
17152
17112
  }
17153
17113
  supportsColor_1 = {
17154
17114
  supportsColor: getSupportLevel,
17155
- stdout: translateLevel(supportsColor(true, tty.isatty(1))),
17156
- stderr: translateLevel(supportsColor(true, tty.isatty(2)))
17115
+ stdout: getSupportLevel(process.stdout),
17116
+ stderr: getSupportLevel(process.stderr)
17157
17117
  };
17158
17118
  return supportsColor_1;
17159
17119
  }
@@ -17166,7 +17126,7 @@ function requireNode() {
17166
17126
  if (hasRequiredNode) return node.exports;
17167
17127
  hasRequiredNode = 1;
17168
17128
  (function (module, exports) {
17169
- const tty = require$$1$2;
17129
+ const tty = require$$0$4;
17170
17130
  const util = require$$1;
17171
17131
 
17172
17132
  /**
@@ -18035,14 +17995,15 @@ function requireAxios() {
18035
17995
  const FormData$1 = requireForm_data();
18036
17996
  const crypto = require$$8;
18037
17997
  const url = require$$0$2;
17998
+ const http2 = require$$3$1;
18038
17999
  const proxyFromEnv = requireProxyFromEnv();
18039
18000
  const http = require$$3;
18040
18001
  const https = require$$4;
18041
18002
  const util = require$$1;
18042
18003
  const followRedirects = requireFollowRedirects();
18043
- const zlib = require$$8$1;
18004
+ const zlib = require$$9;
18044
18005
  const stream = require$$0$1;
18045
- const events = require$$10;
18006
+ const events = require$$11;
18046
18007
  function _interopDefaultLegacy(e) {
18047
18008
  return e && typeof e === 'object' && 'default' in e ? e : {
18048
18009
  'default': e
@@ -18058,6 +18019,14 @@ function requireAxios() {
18058
18019
  const followRedirects__default = /*#__PURE__*/_interopDefaultLegacy(followRedirects);
18059
18020
  const zlib__default = /*#__PURE__*/_interopDefaultLegacy(zlib);
18060
18021
  const stream__default = /*#__PURE__*/_interopDefaultLegacy(stream);
18022
+
18023
+ /**
18024
+ * Create a bound version of a function with a specified `this` context
18025
+ *
18026
+ * @param {Function} fn - The function to bind
18027
+ * @param {*} thisArg - The value to be passed as the `this` parameter
18028
+ * @returns {Function} A new function that will call the original function with the specified `this` context
18029
+ */
18061
18030
  function bind(fn, thisArg) {
18062
18031
  return function wrap() {
18063
18032
  return fn.apply(thisArg, arguments);
@@ -19191,7 +19160,7 @@ function requireAxios() {
19191
19160
  *
19192
19161
  * @param {Number} id The ID that was returned by `use`
19193
19162
  *
19194
- * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
19163
+ * @returns {void}
19195
19164
  */
19196
19165
  eject(id) {
19197
19166
  if (this.handlers[id]) {
@@ -19895,7 +19864,7 @@ function requireAxios() {
19895
19864
  }
19896
19865
  return requestedURL;
19897
19866
  }
19898
- const VERSION = "1.12.2";
19867
+ const VERSION = "1.13.1";
19899
19868
  function parseProtocol(url) {
19900
19869
  const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
19901
19870
  return match && match[1] || '';
@@ -20375,6 +20344,12 @@ function requireAxios() {
20375
20344
  flush: zlib__default["default"].constants.BROTLI_OPERATION_FLUSH,
20376
20345
  finishFlush: zlib__default["default"].constants.BROTLI_OPERATION_FLUSH
20377
20346
  };
20347
+ const {
20348
+ HTTP2_HEADER_SCHEME,
20349
+ HTTP2_HEADER_METHOD,
20350
+ HTTP2_HEADER_PATH,
20351
+ HTTP2_HEADER_STATUS
20352
+ } = http2.constants;
20378
20353
  const isBrotliSupported = utils$1.isFunction(zlib__default["default"].createBrotliDecompress);
20379
20354
  const {
20380
20355
  http: httpFollow,
@@ -20388,6 +20363,77 @@ function requireAxios() {
20388
20363
  stream.on('end', flush).on('error', flush);
20389
20364
  return throttled;
20390
20365
  };
20366
+ class Http2Sessions {
20367
+ constructor() {
20368
+ this.sessions = Object.create(null);
20369
+ }
20370
+ getSession(authority, options) {
20371
+ options = Object.assign({
20372
+ sessionTimeout: 1000
20373
+ }, options);
20374
+ let authoritySessions;
20375
+ if (authoritySessions = this.sessions[authority]) {
20376
+ let len = authoritySessions.length;
20377
+ for (let i = 0; i < len; i++) {
20378
+ const [sessionHandle, sessionOptions] = authoritySessions[i];
20379
+ if (!sessionHandle.destroyed && !sessionHandle.closed && util__default["default"].isDeepStrictEqual(sessionOptions, options)) {
20380
+ return sessionHandle;
20381
+ }
20382
+ }
20383
+ }
20384
+ const session = http2.connect(authority, options);
20385
+ let removed;
20386
+ const removeSession = () => {
20387
+ if (removed) {
20388
+ return;
20389
+ }
20390
+ removed = true;
20391
+ let entries = authoritySessions,
20392
+ len = entries.length,
20393
+ i = len;
20394
+ while (i--) {
20395
+ if (entries[i][0] === session) {
20396
+ entries.splice(i, 1);
20397
+ if (len === 1) {
20398
+ delete this.sessions[authority];
20399
+ return;
20400
+ }
20401
+ }
20402
+ }
20403
+ };
20404
+ const originalRequestFn = session.request;
20405
+ const {
20406
+ sessionTimeout
20407
+ } = options;
20408
+ if (sessionTimeout != null) {
20409
+ let timer;
20410
+ let streamsCount = 0;
20411
+ session.request = function () {
20412
+ const stream = originalRequestFn.apply(this, arguments);
20413
+ streamsCount++;
20414
+ if (timer) {
20415
+ clearTimeout(timer);
20416
+ timer = null;
20417
+ }
20418
+ stream.once('close', () => {
20419
+ if (! --streamsCount) {
20420
+ timer = setTimeout(() => {
20421
+ timer = null;
20422
+ removeSession();
20423
+ }, sessionTimeout);
20424
+ }
20425
+ });
20426
+ return stream;
20427
+ };
20428
+ }
20429
+ session.once('close', removeSession);
20430
+ let entries = this.sessions[authority],
20431
+ entry = [session, options];
20432
+ entries ? this.sessions[authority].push(entry) : authoritySessions = this.sessions[authority] = [entry];
20433
+ return session;
20434
+ }
20435
+ }
20436
+ const http2Sessions = new Http2Sessions();
20391
20437
 
20392
20438
  /**
20393
20439
  * If the proxy or config beforeRedirects functions are defined, call them with the options
@@ -20493,6 +20539,36 @@ function requireAxios() {
20493
20539
  address,
20494
20540
  family
20495
20541
  });
20542
+ const http2Transport = {
20543
+ request(options, cb) {
20544
+ const authority = options.protocol + '//' + options.hostname + ':' + (options.port || 80);
20545
+ const {
20546
+ http2Options,
20547
+ headers
20548
+ } = options;
20549
+ const session = http2Sessions.getSession(authority, http2Options);
20550
+ const http2Headers = {
20551
+ [HTTP2_HEADER_SCHEME]: options.protocol.replace(':', ''),
20552
+ [HTTP2_HEADER_METHOD]: options.method,
20553
+ [HTTP2_HEADER_PATH]: options.path
20554
+ };
20555
+ utils$1.forEach(headers, (header, name) => {
20556
+ name.charAt(0) !== ':' && (http2Headers[name] = header);
20557
+ });
20558
+ const req = session.request(http2Headers);
20559
+ req.once('response', responseHeaders => {
20560
+ const response = req; //duplex
20561
+
20562
+ responseHeaders = Object.assign({}, responseHeaders);
20563
+ const status = responseHeaders[HTTP2_HEADER_STATUS];
20564
+ delete responseHeaders[HTTP2_HEADER_STATUS];
20565
+ response.headers = responseHeaders;
20566
+ response.statusCode = +status;
20567
+ cb(response);
20568
+ });
20569
+ return req;
20570
+ }
20571
+ };
20496
20572
 
20497
20573
  /*eslint consistent-return:0*/
20498
20574
  const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
@@ -20500,7 +20576,9 @@ function requireAxios() {
20500
20576
  let {
20501
20577
  data,
20502
20578
  lookup,
20503
- family
20579
+ family,
20580
+ httpVersion = 1,
20581
+ http2Options
20504
20582
  } = config;
20505
20583
  const {
20506
20584
  responseType,
@@ -20510,6 +20588,14 @@ function requireAxios() {
20510
20588
  let isDone;
20511
20589
  let rejected = false;
20512
20590
  let req;
20591
+ httpVersion = +httpVersion;
20592
+ if (Number.isNaN(httpVersion)) {
20593
+ throw TypeError(`Invalid protocol version: '${config.httpVersion}' is not a number`);
20594
+ }
20595
+ if (httpVersion !== 1 && httpVersion !== 2) {
20596
+ throw TypeError(`Unsupported protocol version '${httpVersion}'`);
20597
+ }
20598
+ const isHttp2 = httpVersion === 2;
20513
20599
  if (lookup) {
20514
20600
  const _lookup = callbackify$1(lookup, value => utils$1.isArray(value) ? value : [value]);
20515
20601
  // hotfix to support opt.all option which is required for node 20.x
@@ -20523,9 +20609,15 @@ function requireAxios() {
20523
20609
  });
20524
20610
  };
20525
20611
  }
20526
-
20527
- // temporary internal emitter until the AxiosRequest class will be implemented
20528
- const emitter = new events.EventEmitter();
20612
+ const abortEmitter = new events.EventEmitter();
20613
+ function abort(reason) {
20614
+ try {
20615
+ abortEmitter.emit('abort', !reason || reason.type ? new CanceledError(null, config, req) : reason);
20616
+ } catch (err) {
20617
+ console.warn('emit error', err);
20618
+ }
20619
+ }
20620
+ abortEmitter.once('abort', reject);
20529
20621
  const onFinished = () => {
20530
20622
  if (config.cancelToken) {
20531
20623
  config.cancelToken.unsubscribe(abort);
@@ -20533,25 +20625,33 @@ function requireAxios() {
20533
20625
  if (config.signal) {
20534
20626
  config.signal.removeEventListener('abort', abort);
20535
20627
  }
20536
- emitter.removeAllListeners();
20628
+ abortEmitter.removeAllListeners();
20537
20629
  };
20538
- onDone((value, isRejected) => {
20539
- isDone = true;
20540
- if (isRejected) {
20541
- rejected = true;
20542
- onFinished();
20543
- }
20544
- });
20545
- function abort(reason) {
20546
- emitter.emit('abort', !reason || reason.type ? new CanceledError(null, config, req) : reason);
20547
- }
20548
- emitter.once('abort', reject);
20549
20630
  if (config.cancelToken || config.signal) {
20550
20631
  config.cancelToken && config.cancelToken.subscribe(abort);
20551
20632
  if (config.signal) {
20552
20633
  config.signal.aborted ? abort() : config.signal.addEventListener('abort', abort);
20553
20634
  }
20554
20635
  }
20636
+ onDone((response, isRejected) => {
20637
+ isDone = true;
20638
+ if (isRejected) {
20639
+ rejected = true;
20640
+ onFinished();
20641
+ return;
20642
+ }
20643
+ const {
20644
+ data
20645
+ } = response;
20646
+ if (data instanceof stream__default["default"].Readable || data instanceof stream__default["default"].Duplex) {
20647
+ const offListeners = stream__default["default"].finished(data, () => {
20648
+ offListeners();
20649
+ onFinished();
20650
+ });
20651
+ } else {
20652
+ onFinished();
20653
+ }
20654
+ });
20555
20655
 
20556
20656
  // Parse url
20557
20657
  const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
@@ -20710,7 +20810,8 @@ function requireAxios() {
20710
20810
  protocol,
20711
20811
  family,
20712
20812
  beforeRedirect: dispatchBeforeRedirect,
20713
- beforeRedirects: {}
20813
+ beforeRedirects: {},
20814
+ http2Options
20714
20815
  };
20715
20816
 
20716
20817
  // cacheable-lookup integration hotfix
@@ -20725,18 +20826,22 @@ function requireAxios() {
20725
20826
  let transport;
20726
20827
  const isHttpsRequest = isHttps.test(options.protocol);
20727
20828
  options.agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;
20728
- if (config.transport) {
20729
- transport = config.transport;
20730
- } else if (config.maxRedirects === 0) {
20731
- transport = isHttpsRequest ? https__default["default"] : http__default["default"];
20829
+ if (isHttp2) {
20830
+ transport = http2Transport;
20732
20831
  } else {
20733
- if (config.maxRedirects) {
20734
- options.maxRedirects = config.maxRedirects;
20735
- }
20736
- if (config.beforeRedirect) {
20737
- options.beforeRedirects.config = config.beforeRedirect;
20832
+ if (config.transport) {
20833
+ transport = config.transport;
20834
+ } else if (config.maxRedirects === 0) {
20835
+ transport = isHttpsRequest ? https__default["default"] : http__default["default"];
20836
+ } else {
20837
+ if (config.maxRedirects) {
20838
+ options.maxRedirects = config.maxRedirects;
20839
+ }
20840
+ if (config.beforeRedirect) {
20841
+ options.beforeRedirects.config = config.beforeRedirect;
20842
+ }
20843
+ transport = isHttpsRequest ? httpsFollow : httpFollow;
20738
20844
  }
20739
- transport = isHttpsRequest ? httpsFollow : httpFollow;
20740
20845
  }
20741
20846
  if (config.maxBodyLength > -1) {
20742
20847
  options.maxBodyLength = config.maxBodyLength;
@@ -20752,7 +20857,7 @@ function requireAxios() {
20752
20857
  req = transport.request(options, function handleResponse(res) {
20753
20858
  if (req.destroyed) return;
20754
20859
  const streams = [res];
20755
- const responseLength = +res.headers['content-length'];
20860
+ const responseLength = utils$1.toFiniteNumber(res.headers['content-length']);
20756
20861
  if (onDownloadProgress || maxDownloadRate) {
20757
20862
  const transformStream = new AxiosTransformStream$1({
20758
20863
  maxRate: utils$1.toFiniteNumber(maxDownloadRate)
@@ -20803,10 +20908,6 @@ function requireAxios() {
20803
20908
  }
20804
20909
  }
20805
20910
  responseStream = streams.length > 1 ? stream__default["default"].pipeline(streams, utils$1.noop) : streams[0];
20806
- const offListeners = stream__default["default"].finished(responseStream, () => {
20807
- offListeners();
20808
- onFinished();
20809
- });
20810
20911
  const response = {
20811
20912
  status: res.statusCode,
20812
20913
  statusText: res.statusMessage,
@@ -20829,7 +20930,7 @@ function requireAxios() {
20829
20930
  // stream.destroy() emit aborted event before calling reject() on Node.js v16
20830
20931
  rejected = true;
20831
20932
  responseStream.destroy();
20832
- reject(new AxiosError('maxContentLength size of ' + config.maxContentLength + ' exceeded', AxiosError.ERR_BAD_RESPONSE, config, lastRequest));
20933
+ abort(new AxiosError('maxContentLength size of ' + config.maxContentLength + ' exceeded', AxiosError.ERR_BAD_RESPONSE, config, lastRequest));
20833
20934
  }
20834
20935
  });
20835
20936
  responseStream.on('aborted', function handlerStreamAborted() {
@@ -20860,16 +20961,19 @@ function requireAxios() {
20860
20961
  settle(resolve, reject, response);
20861
20962
  });
20862
20963
  }
20863
- emitter.once('abort', err => {
20964
+ abortEmitter.once('abort', err => {
20864
20965
  if (!responseStream.destroyed) {
20865
20966
  responseStream.emit('error', err);
20866
20967
  responseStream.destroy();
20867
20968
  }
20868
20969
  });
20869
20970
  });
20870
- emitter.once('abort', err => {
20871
- reject(err);
20872
- req.destroy(err);
20971
+ abortEmitter.once('abort', err => {
20972
+ if (req.close) {
20973
+ req.close();
20974
+ } else {
20975
+ req.destroy(err);
20976
+ }
20873
20977
  });
20874
20978
 
20875
20979
  // Handle errors
@@ -20890,7 +20994,7 @@ function requireAxios() {
20890
20994
  // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types.
20891
20995
  const timeout = parseInt(config.timeout, 10);
20892
20996
  if (Number.isNaN(timeout)) {
20893
- reject(new AxiosError('error trying to parse `config.timeout` to int', AxiosError.ERR_BAD_OPTION_VALUE, config, req));
20997
+ abort(new AxiosError('error trying to parse `config.timeout` to int', AxiosError.ERR_BAD_OPTION_VALUE, config, req));
20894
20998
  return;
20895
20999
  }
20896
21000
 
@@ -20906,8 +21010,7 @@ function requireAxios() {
20906
21010
  if (config.timeoutErrorMessage) {
20907
21011
  timeoutErrorMessage = config.timeoutErrorMessage;
20908
21012
  }
20909
- reject(new AxiosError(timeoutErrorMessage, transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, config, req));
20910
- abort();
21013
+ abort(new AxiosError(timeoutErrorMessage, transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, config, req));
20911
21014
  });
20912
21015
  }
20913
21016
 
@@ -20929,7 +21032,8 @@ function requireAxios() {
20929
21032
  });
20930
21033
  data.pipe(req);
20931
21034
  } else {
20932
- req.end(data);
21035
+ data && req.write(data);
21036
+ req.end();
20933
21037
  }
20934
21038
  });
20935
21039
  };
@@ -20940,20 +21044,33 @@ function requireAxios() {
20940
21044
  const cookies = platform.hasStandardBrowserEnv ?
20941
21045
  // Standard browser envs support document.cookie
20942
21046
  {
20943
- write(name, value, expires, path, domain, secure) {
20944
- const cookie = [name + '=' + encodeURIComponent(value)];
20945
- utils$1.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());
20946
- utils$1.isString(path) && cookie.push('path=' + path);
20947
- utils$1.isString(domain) && cookie.push('domain=' + domain);
20948
- secure === true && cookie.push('secure');
21047
+ write(name, value, expires, path, domain, secure, sameSite) {
21048
+ if (typeof document === 'undefined') return;
21049
+ const cookie = [`${name}=${encodeURIComponent(value)}`];
21050
+ if (utils$1.isNumber(expires)) {
21051
+ cookie.push(`expires=${new Date(expires).toUTCString()}`);
21052
+ }
21053
+ if (utils$1.isString(path)) {
21054
+ cookie.push(`path=${path}`);
21055
+ }
21056
+ if (utils$1.isString(domain)) {
21057
+ cookie.push(`domain=${domain}`);
21058
+ }
21059
+ if (secure === true) {
21060
+ cookie.push('secure');
21061
+ }
21062
+ if (utils$1.isString(sameSite)) {
21063
+ cookie.push(`SameSite=${sameSite}`);
21064
+ }
20949
21065
  document.cookie = cookie.join('; ');
20950
21066
  },
20951
21067
  read(name) {
20952
- const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
20953
- return match ? decodeURIComponent(match[3]) : null;
21068
+ if (typeof document === 'undefined') return null;
21069
+ const match = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)'));
21070
+ return match ? decodeURIComponent(match[1]) : null;
20954
21071
  },
20955
21072
  remove(name) {
20956
- this.write(name, '', Date.now() - 86400000);
21073
+ this.write(name, '', Date.now() - 86400000, '/');
20957
21074
  }
20958
21075
  } :
20959
21076
  // Non-standard browser env (web workers, react-native) lack needed support.
@@ -21621,7 +21738,7 @@ function requireAxios() {
21621
21738
  };
21622
21739
  const seedCache = new Map();
21623
21740
  const getFetch = config => {
21624
- let env = config ? config.env : {};
21741
+ let env = config && config.env || {};
21625
21742
  const {
21626
21743
  fetch,
21627
21744
  Request,
@@ -21642,6 +21759,16 @@ function requireAxios() {
21642
21759
  return target;
21643
21760
  };
21644
21761
  getFetch();
21762
+
21763
+ /**
21764
+ * Known adapters mapping.
21765
+ * Provides environment-specific adapters for Axios:
21766
+ * - `http` for Node.js
21767
+ * - `xhr` for browsers
21768
+ * - `fetch` for fetch API-based requests
21769
+ *
21770
+ * @type {Object<string, Function|Object>}
21771
+ */
21645
21772
  const knownAdapters = {
21646
21773
  http: httpAdapter,
21647
21774
  xhr: xhrAdapter,
@@ -21649,6 +21776,8 @@ function requireAxios() {
21649
21776
  get: getFetch
21650
21777
  }
21651
21778
  };
21779
+
21780
+ // Assign adapter names for easier debugging and identification
21652
21781
  utils$1.forEach(knownAdapters, (fn, value) => {
21653
21782
  if (fn) {
21654
21783
  try {
@@ -21663,39 +21792,77 @@ function requireAxios() {
21663
21792
  });
21664
21793
  }
21665
21794
  });
21795
+
21796
+ /**
21797
+ * Render a rejection reason string for unknown or unsupported adapters
21798
+ *
21799
+ * @param {string} reason
21800
+ * @returns {string}
21801
+ */
21666
21802
  const renderReason = reason => `- ${reason}`;
21803
+
21804
+ /**
21805
+ * Check if the adapter is resolved (function, null, or false)
21806
+ *
21807
+ * @param {Function|null|false} adapter
21808
+ * @returns {boolean}
21809
+ */
21667
21810
  const isResolvedHandle = adapter => utils$1.isFunction(adapter) || adapter === null || adapter === false;
21668
- const adapters = {
21669
- getAdapter: (adapters, config) => {
21670
- adapters = utils$1.isArray(adapters) ? adapters : [adapters];
21671
- const {
21672
- length
21673
- } = adapters;
21674
- let nameOrAdapter;
21675
- let adapter;
21676
- const rejectedReasons = {};
21677
- for (let i = 0; i < length; i++) {
21678
- nameOrAdapter = adapters[i];
21679
- let id;
21680
- adapter = nameOrAdapter;
21681
- if (!isResolvedHandle(nameOrAdapter)) {
21682
- adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
21683
- if (adapter === undefined) {
21684
- throw new AxiosError(`Unknown adapter '${id}'`);
21685
- }
21686
- }
21687
- if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) {
21688
- break;
21811
+
21812
+ /**
21813
+ * Get the first suitable adapter from the provided list.
21814
+ * Tries each adapter in order until a supported one is found.
21815
+ * Throws an AxiosError if no adapter is suitable.
21816
+ *
21817
+ * @param {Array<string|Function>|string|Function} adapters - Adapter(s) by name or function.
21818
+ * @param {Object} config - Axios request configuration
21819
+ * @throws {AxiosError} If no suitable adapter is available
21820
+ * @returns {Function} The resolved adapter function
21821
+ */
21822
+ function getAdapter(adapters, config) {
21823
+ adapters = utils$1.isArray(adapters) ? adapters : [adapters];
21824
+ const {
21825
+ length
21826
+ } = adapters;
21827
+ let nameOrAdapter;
21828
+ let adapter;
21829
+ const rejectedReasons = {};
21830
+ for (let i = 0; i < length; i++) {
21831
+ nameOrAdapter = adapters[i];
21832
+ let id;
21833
+ adapter = nameOrAdapter;
21834
+ if (!isResolvedHandle(nameOrAdapter)) {
21835
+ adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
21836
+ if (adapter === undefined) {
21837
+ throw new AxiosError(`Unknown adapter '${id}'`);
21689
21838
  }
21690
- rejectedReasons[id || '#' + i] = adapter;
21691
21839
  }
21692
- if (!adapter) {
21693
- const reasons = Object.entries(rejectedReasons).map(([id, state]) => `adapter ${id} ` + (state === false ? 'is not supported by the environment' : 'is not available in the build'));
21694
- let s = length ? reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0]) : 'as no adapter specified';
21695
- throw new AxiosError(`There is no suitable adapter to dispatch the request ` + s, 'ERR_NOT_SUPPORT');
21840
+ if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) {
21841
+ break;
21696
21842
  }
21697
- return adapter;
21698
- },
21843
+ rejectedReasons[id || '#' + i] = adapter;
21844
+ }
21845
+ if (!adapter) {
21846
+ const reasons = Object.entries(rejectedReasons).map(([id, state]) => `adapter ${id} ` + (state === false ? 'is not supported by the environment' : 'is not available in the build'));
21847
+ let s = length ? reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0]) : 'as no adapter specified';
21848
+ throw new AxiosError(`There is no suitable adapter to dispatch the request ` + s, 'ERR_NOT_SUPPORT');
21849
+ }
21850
+ return adapter;
21851
+ }
21852
+
21853
+ /**
21854
+ * Exports Axios adapters and utility to resolve an adapter
21855
+ */
21856
+ const adapters = {
21857
+ /**
21858
+ * Resolve an adapter from a list of adapter names or functions.
21859
+ * @type {Function}
21860
+ */
21861
+ getAdapter,
21862
+ /**
21863
+ * Exposes all known adapters
21864
+ * @type {Object<string, Function|Object>}
21865
+ */
21699
21866
  adapters: knownAdapters
21700
21867
  };
21701
21868
 
@@ -22245,7 +22412,13 @@ function requireAxios() {
22245
22412
  InsufficientStorage: 507,
22246
22413
  LoopDetected: 508,
22247
22414
  NotExtended: 510,
22248
- NetworkAuthenticationRequired: 511
22415
+ NetworkAuthenticationRequired: 511,
22416
+ WebServerIsDown: 521,
22417
+ ConnectionTimedOut: 522,
22418
+ OriginIsUnreachable: 523,
22419
+ TimeoutOccurred: 524,
22420
+ SslHandshakeFailed: 525,
22421
+ InvalidSslCertificate: 526
22249
22422
  };
22250
22423
  Object.entries(HttpStatusCode).forEach(([key, value]) => {
22251
22424
  HttpStatusCode[value] = key;
@@ -24187,9 +24360,9 @@ var EnvironmentTemplate = /*#__PURE__*/Object.freeze({
24187
24360
  });
24188
24361
 
24189
24362
  const apiPath = (organizationId, ...pathSegments) => `/organizations/${organizationId}/environment_templates/` + pathSegments.join('/');
24190
- const getMany$o = (http, { organizationId, environmentTemplateId, spaceId, environmentId, ...paginationProps }, headers) => get$W(http, apiPath(organizationId, environmentTemplateId, 'template_installations'), {
24363
+ const getMany$o = (http, { organizationId, environmentTemplateId, spaceId, environmentId, ...otherProps }, headers) => get$W(http, apiPath(organizationId, environmentTemplateId, 'template_installations'), {
24191
24364
  params: {
24192
- ...paginationProps,
24365
+ ...otherProps,
24193
24366
  ...(environmentId && { 'environment.sys.id': environmentId }),
24194
24367
  ...(spaceId && { 'space.sys.id': spaceId }),
24195
24368
  },
@@ -34187,6 +34360,7 @@ function createEnvironmentTemplateApi(makeRequest, organizationId) {
34187
34360
  * Gets a collection of all installations for the environment template
34188
34361
  * @param [installationParams.spaceId] - Space ID to filter installations by space and environment
34189
34362
  * @param [installationParams.environmentId] - Environment ID to filter installations by space and environment
34363
+ * @param [installationParams.latestOnly] - Boolean flag to only return the latest installation per environment
34190
34364
  * @return Promise for a collection of EnvironmentTemplateInstallations
34191
34365
  * ```javascript
34192
34366
  * const contentful = require('contentful-management')
@@ -34203,7 +34377,7 @@ function createEnvironmentTemplateApi(makeRequest, organizationId) {
34203
34377
  * .catch(console.error)
34204
34378
  * ```
34205
34379
  */
34206
- getInstallations: function getEnvironmentTemplateInstallations({ spaceId, environmentId, ...query } = {}) {
34380
+ getInstallations: function getEnvironmentTemplateInstallations({ spaceId, environmentId, latestOnly, ...query } = {}) {
34207
34381
  const raw = this.toPlainObject();
34208
34382
  return makeRequest({
34209
34383
  entityType: 'EnvironmentTemplateInstallation',
@@ -34214,6 +34388,7 @@ function createEnvironmentTemplateApi(makeRequest, organizationId) {
34214
34388
  query: { ...createRequestConfig({ query }).params },
34215
34389
  spaceId,
34216
34390
  environmentId,
34391
+ latestOnly,
34217
34392
  },
34218
34393
  }).then((data) => wrapEnvironmentTemplateInstallationCollection(makeRequest, data));
34219
34394
  },
@@ -34429,7 +34604,7 @@ const wrapOAuthApplicationCollection = wrapCursorPaginatedCollection(wrapOAuthAp
34429
34604
  */
34430
34605
  function createClientApi(makeRequest) {
34431
34606
  return {
34432
- version: "12.0.0-beta.12",
34607
+ version: "12.0.0-beta.13",
34433
34608
  /**
34434
34609
  * Gets all environment templates for a given organization with the lasted version
34435
34610
  * @param organizationId - Organization ID
@@ -35028,7 +35203,7 @@ const wrap = ({ makeRequest, defaults }, entityType, action) => {
35028
35203
  const createPlainClient = (makeRequest, defaults) => {
35029
35204
  const wrapParams = { makeRequest, defaults };
35030
35205
  return {
35031
- version: "12.0.0-beta.12",
35206
+ version: "12.0.0-beta.13",
35032
35207
  raw: {
35033
35208
  getDefaultParams: () => defaults,
35034
35209
  get: (url, config) => makeRequest({
@@ -35979,7 +36154,7 @@ var WorkflowStepActionType;
35979
36154
  */
35980
36155
  function createClient(params, opts = {}) {
35981
36156
  const sdkMain = opts.type === 'plain' ? 'contentful-management-plain.js' : 'contentful-management.js';
35982
- const userAgent = getUserAgentHeader(`${sdkMain}/${"12.0.0-beta.12"}`, params.application, params.integration, params.feature);
36157
+ const userAgent = getUserAgentHeader(`${sdkMain}/${"12.0.0-beta.13"}`, params.application, params.integration, params.feature);
35983
36158
  const adapter = createAdapter({ ...params, userAgent });
35984
36159
  // Parameters<?> and ReturnType<?> only return the types of the last overload
35985
36160
  // https://github.com/microsoft/TypeScript/issues/26591