contentful-management 12.0.0-beta.1 → 12.0.0-beta.2

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.
@@ -18049,6 +18049,10 @@ function requireAxios() {
18049
18049
  const {
18050
18050
  getPrototypeOf
18051
18051
  } = Object;
18052
+ const {
18053
+ iterator,
18054
+ toStringTag
18055
+ } = Symbol;
18052
18056
  const kindOf = (cache => thing => {
18053
18057
  const str = toString.call(thing);
18054
18058
  return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
@@ -18171,7 +18175,7 @@ function requireAxios() {
18171
18175
  return false;
18172
18176
  }
18173
18177
  const prototype = getPrototypeOf(val);
18174
- return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
18178
+ return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);
18175
18179
  };
18176
18180
 
18177
18181
  /**
@@ -18512,10 +18516,10 @@ function requireAxios() {
18512
18516
  * @returns {void}
18513
18517
  */
18514
18518
  const forEachEntry = (obj, fn) => {
18515
- const generator = obj && obj[Symbol.iterator];
18516
- const iterator = generator.call(obj);
18519
+ const generator = obj && obj[iterator];
18520
+ const _iterator = generator.call(obj);
18517
18521
  let result;
18518
- while ((result = iterator.next()) && !result.done) {
18522
+ while ((result = _iterator.next()) && !result.done) {
18519
18523
  const pair = result.value;
18520
18524
  fn.call(obj, pair[0], pair[1]);
18521
18525
  }
@@ -18619,7 +18623,7 @@ function requireAxios() {
18619
18623
  * @returns {boolean}
18620
18624
  */
18621
18625
  function isSpecCompliantForm(thing) {
18622
- return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);
18626
+ return !!(thing && isFunction(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]);
18623
18627
  }
18624
18628
  const toJSONObject = obj => {
18625
18629
  const stack = new Array(10);
@@ -18672,6 +18676,7 @@ function requireAxios() {
18672
18676
 
18673
18677
  // *********************
18674
18678
 
18679
+ const isIterable = thing => thing != null && isFunction(thing[iterator]);
18675
18680
  const utils$1 = {
18676
18681
  isArray,
18677
18682
  isArrayBuffer,
@@ -18728,7 +18733,8 @@ function requireAxios() {
18728
18733
  isAsyncFn,
18729
18734
  isThenable,
18730
18735
  setImmediate: _setImmediate,
18731
- asap
18736
+ asap,
18737
+ isIterable
18732
18738
  };
18733
18739
 
18734
18740
  /**
@@ -19553,10 +19559,17 @@ function requireAxios() {
19553
19559
  setHeaders(header, valueOrRewrite);
19554
19560
  } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
19555
19561
  setHeaders(parseHeaders(header), valueOrRewrite);
19556
- } else if (utils$1.isHeaders(header)) {
19557
- for (const [key, value] of header.entries()) {
19558
- setHeader(value, key, rewrite);
19562
+ } else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
19563
+ let obj = {},
19564
+ dest,
19565
+ key;
19566
+ for (const entry of header) {
19567
+ if (!utils$1.isArray(entry)) {
19568
+ throw TypeError('Object iterator must return a key-value pair');
19569
+ }
19570
+ obj[key = entry[0]] = (dest = obj[key]) ? utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]] : entry[1];
19559
19571
  }
19572
+ setHeaders(obj, valueOrRewrite);
19560
19573
  } else {
19561
19574
  header != null && setHeader(valueOrRewrite, header, rewrite);
19562
19575
  }
@@ -19660,6 +19673,9 @@ function requireAxios() {
19660
19673
  toString() {
19661
19674
  return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n');
19662
19675
  }
19676
+ getSetCookie() {
19677
+ return this.get("set-cookie") || [];
19678
+ }
19663
19679
  get [Symbol.toStringTag]() {
19664
19680
  return 'AxiosHeaders';
19665
19681
  }
@@ -19807,7 +19823,7 @@ function requireAxios() {
19807
19823
  }
19808
19824
  return requestedURL;
19809
19825
  }
19810
- const VERSION = "1.8.4";
19826
+ const VERSION = "1.9.0";
19811
19827
  function parseProtocol(url) {
19812
19828
  const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
19813
19829
  return match && match[1] || '';
@@ -20044,7 +20060,7 @@ function requireAxios() {
20044
20060
  throw Error('boundary must be 10-70 characters long');
20045
20061
  }
20046
20062
  const boundaryBytes = textEncoder.encode('--' + boundary + CRLF);
20047
- const footerBytes = textEncoder.encode('--' + boundary + '--' + CRLF + CRLF);
20063
+ const footerBytes = textEncoder.encode('--' + boundary + '--' + CRLF);
20048
20064
  let contentLength = footerBytes.byteLength;
20049
20065
  const parts = Array.from(form.entries()).map(([name, value]) => {
20050
20066
  const part = new FormDataPart(name, value);
@@ -21172,7 +21188,7 @@ function requireAxios() {
21172
21188
  var _didIteratorError = false;
21173
21189
  var _iteratorError;
21174
21190
  try {
21175
- for (var _iterator = _asyncIterator(readStream(iterable)), _step; _iteratorAbruptCompletion = !(_step = yield _awaitAsyncGenerator(_iterator.next())).done; _iteratorAbruptCompletion = false) {
21191
+ for (var _iterator2 = _asyncIterator(readStream(iterable)), _step; _iteratorAbruptCompletion = !(_step = yield _awaitAsyncGenerator(_iterator2.next())).done; _iteratorAbruptCompletion = false) {
21176
21192
  const chunk = _step.value;
21177
21193
  {
21178
21194
  yield* _asyncGeneratorDelegate(_asyncIterator(streamChunk(chunk, chunkSize)), _awaitAsyncGenerator);
@@ -21183,8 +21199,8 @@ function requireAxios() {
21183
21199
  _iteratorError = err;
21184
21200
  } finally {
21185
21201
  try {
21186
- if (_iteratorAbruptCompletion && _iterator.return != null) {
21187
- yield _awaitAsyncGenerator(_iterator.return());
21202
+ if (_iteratorAbruptCompletion && _iterator2.return != null) {
21203
+ yield _awaitAsyncGenerator(_iterator2.return());
21188
21204
  }
21189
21205
  } finally {
21190
21206
  if (_didIteratorError) {
@@ -21410,7 +21426,7 @@ function requireAxios() {
21410
21426
  });
21411
21427
  } catch (err) {
21412
21428
  unsubscribe && unsubscribe();
21413
- if (err && err.name === 'TypeError' && /fetch/i.test(err.message)) {
21429
+ if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
21414
21430
  throw Object.assign(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request), {
21415
21431
  cause: err.cause || err
21416
21432
  });
@@ -21618,7 +21634,7 @@ function requireAxios() {
21618
21634
  */
21619
21635
  class Axios {
21620
21636
  constructor(instanceConfig) {
21621
- this.defaults = instanceConfig;
21637
+ this.defaults = instanceConfig || {};
21622
21638
  this.interceptors = {
21623
21639
  request: new InterceptorManager$1(),
21624
21640
  response: new InterceptorManager$1()
@@ -35323,7 +35339,7 @@ function createClientApi(makeRequest) {
35323
35339
  wrapOAuthApplicationCollection
35324
35340
  } = entities.oauthApplication;
35325
35341
  return {
35326
- version: "12.0.0-beta.1",
35342
+ version: "12.0.0-beta.2",
35327
35343
  /**
35328
35344
  * Gets all environment templates for a given organization with the lasted version
35329
35345
  * @param organizationId - Organization ID
@@ -35979,7 +35995,7 @@ const createPlainClient = (makeRequest, defaults) => {
35979
35995
  defaults
35980
35996
  };
35981
35997
  return {
35982
- version: "12.0.0-beta.1",
35998
+ version: "12.0.0-beta.2",
35983
35999
  raw: {
35984
36000
  getDefaultParams: () => defaults,
35985
36001
  get: (url, config) => makeRequest({
@@ -36980,7 +36996,7 @@ async function fetchAll(fetchFn, params) {
36980
36996
  */
36981
36997
  function createClient(params, opts = {}) {
36982
36998
  const sdkMain = opts.type === 'plain' ? 'contentful-management-plain.js' : 'contentful-management.js';
36983
- const userAgent = getUserAgentHeader(`${sdkMain}/${"12.0.0-beta.1"}`, params.application, params.integration, params.feature);
36999
+ const userAgent = getUserAgentHeader(`${sdkMain}/${"12.0.0-beta.2"}`, params.application, params.integration, params.feature);
36984
37000
  const adapter = createAdapter(Object.assign(Object.assign({}, params), {
36985
37001
  userAgent
36986
37002
  }));
@@ -16,7 +16,7 @@ function createClientApi(makeRequest) {
16
16
  const { wrapEnvironmentTemplate, wrapEnvironmentTemplateCollection } = entities.environmentTemplate;
17
17
  const { wrapOAuthApplication, wrapOAuthApplicationCollection } = entities.oauthApplication;
18
18
  return {
19
- version: "12.0.0-beta.1",
19
+ version: "12.0.0-beta.2",
20
20
  /**
21
21
  * Gets all environment templates for a given organization with the lasted version
22
22
  * @param organizationId - Organization ID
package/dist/esm/index.js CHANGED
@@ -19,7 +19,7 @@ export { WorkflowStepPermissionAction, WorkflowStepPermissionEffect, WorkflowSte
19
19
  */
20
20
  function createClient(params, opts = {}) {
21
21
  const sdkMain = opts.type === 'plain' ? 'contentful-management-plain.js' : 'contentful-management.js';
22
- const userAgent = getUserAgentHeader(`${sdkMain}/${"12.0.0-beta.1"}`, params.application, params.integration, params.feature);
22
+ const userAgent = getUserAgentHeader(`${sdkMain}/${"12.0.0-beta.2"}`, params.application, params.integration, params.feature);
23
23
  const adapter = createAdapter(Object.assign(Object.assign({}, params), { userAgent }));
24
24
  // Parameters<?> and ReturnType<?> only return the types of the last overload
25
25
  // https://github.com/microsoft/TypeScript/issues/26591
@@ -7,7 +7,7 @@ import { wrap } from './wrappers/wrap.js';
7
7
  const createPlainClient = (makeRequest, defaults) => {
8
8
  const wrapParams = { makeRequest, defaults };
9
9
  return {
10
- version: "12.0.0-beta.1",
10
+ version: "12.0.0-beta.2",
11
11
  raw: {
12
12
  getDefaultParams: () => defaults,
13
13
  get: (url, config) => makeRequest({