contentful 11.5.15 → 11.5.16

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.
@@ -13918,6 +13918,10 @@ const {
13918
13918
  const {
13919
13919
  getPrototypeOf: getPrototypeOf$3
13920
13920
  } = Object;
13921
+ const {
13922
+ iterator,
13923
+ toStringTag: toStringTag$1
13924
+ } = Symbol;
13921
13925
  const kindOf = (cache => thing => {
13922
13926
  const str = toString.call(thing);
13923
13927
  return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
@@ -14040,7 +14044,7 @@ const isPlainObject$2 = val => {
14040
14044
  return false;
14041
14045
  }
14042
14046
  const prototype = getPrototypeOf$3(val);
14043
- return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
14047
+ return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag$1 in val) && !(iterator in val);
14044
14048
  };
14045
14049
 
14046
14050
  /**
@@ -14381,10 +14385,10 @@ const isTypedArray = (TypedArray => {
14381
14385
  * @returns {void}
14382
14386
  */
14383
14387
  const forEachEntry = (obj, fn) => {
14384
- const generator = obj && obj[Symbol.iterator];
14385
- const iterator = generator.call(obj);
14388
+ const generator = obj && obj[iterator];
14389
+ const _iterator = generator.call(obj);
14386
14390
  let result;
14387
- while ((result = iterator.next()) && !result.done) {
14391
+ while ((result = _iterator.next()) && !result.done) {
14388
14392
  const pair = result.value;
14389
14393
  fn.call(obj, pair[0], pair[1]);
14390
14394
  }
@@ -14488,7 +14492,7 @@ const toFiniteNumber = (value, defaultValue) => {
14488
14492
  * @returns {boolean}
14489
14493
  */
14490
14494
  function isSpecCompliantForm(thing) {
14491
- return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);
14495
+ return !!(thing && isFunction(thing.append) && thing[toStringTag$1] === 'FormData' && thing[iterator]);
14492
14496
  }
14493
14497
  const toJSONObject = obj => {
14494
14498
  const stack = new Array(10);
@@ -14541,6 +14545,7 @@ const asap = typeof queueMicrotask !== 'undefined' ? queueMicrotask.bind(_global
14541
14545
 
14542
14546
  // *********************
14543
14547
 
14548
+ const isIterable = thing => thing != null && isFunction(thing[iterator]);
14544
14549
  const utils$1$1 = {
14545
14550
  isArray: isArray$8,
14546
14551
  isArrayBuffer,
@@ -14597,7 +14602,8 @@ const utils$1$1 = {
14597
14602
  isAsyncFn,
14598
14603
  isThenable,
14599
14604
  setImmediate: _setImmediate,
14600
- asap
14605
+ asap,
14606
+ isIterable
14601
14607
  };
14602
14608
 
14603
14609
  /**
@@ -15422,10 +15428,17 @@ class AxiosHeaders {
15422
15428
  setHeaders(header, valueOrRewrite);
15423
15429
  } else if (utils$1$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
15424
15430
  setHeaders(parseHeaders(header), valueOrRewrite);
15425
- } else if (utils$1$1.isHeaders(header)) {
15426
- for (const [key, value] of header.entries()) {
15427
- setHeader(value, key, rewrite);
15431
+ } else if (utils$1$1.isObject(header) && utils$1$1.isIterable(header)) {
15432
+ let obj = {},
15433
+ dest,
15434
+ key;
15435
+ for (const entry of header) {
15436
+ if (!utils$1$1.isArray(entry)) {
15437
+ throw TypeError('Object iterator must return a key-value pair');
15438
+ }
15439
+ obj[key = entry[0]] = (dest = obj[key]) ? utils$1$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]] : entry[1];
15428
15440
  }
15441
+ setHeaders(obj, valueOrRewrite);
15429
15442
  } else {
15430
15443
  header != null && setHeader(valueOrRewrite, header, rewrite);
15431
15444
  }
@@ -15529,6 +15542,9 @@ class AxiosHeaders {
15529
15542
  toString() {
15530
15543
  return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n');
15531
15544
  }
15545
+ getSetCookie() {
15546
+ return this.get("set-cookie") || [];
15547
+ }
15532
15548
  get [Symbol.toStringTag]() {
15533
15549
  return 'AxiosHeaders';
15534
15550
  }
@@ -15676,7 +15692,7 @@ function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
15676
15692
  }
15677
15693
  return requestedURL;
15678
15694
  }
15679
- const VERSION = "1.8.4";
15695
+ const VERSION = "1.9.0";
15680
15696
  function parseProtocol(url) {
15681
15697
  const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
15682
15698
  return match && match[1] || '';
@@ -15913,7 +15929,7 @@ const formDataToStream = (form, headersHandler, options) => {
15913
15929
  throw Error('boundary must be 10-70 characters long');
15914
15930
  }
15915
15931
  const boundaryBytes = textEncoder.encode('--' + boundary + CRLF);
15916
- const footerBytes = textEncoder.encode('--' + boundary + '--' + CRLF + CRLF);
15932
+ const footerBytes = textEncoder.encode('--' + boundary + '--' + CRLF);
15917
15933
  let contentLength = footerBytes.byteLength;
15918
15934
  const parts = Array.from(form.entries()).map(([name, value]) => {
15919
15935
  const part = new FormDataPart(name, value);
@@ -17041,7 +17057,7 @@ const readBytes = /*#__PURE__*/function () {
17041
17057
  var _didIteratorError = false;
17042
17058
  var _iteratorError;
17043
17059
  try {
17044
- for (var _iterator = _asyncIterator(readStream(iterable)), _step; _iteratorAbruptCompletion = !(_step = yield _awaitAsyncGenerator(_iterator.next())).done; _iteratorAbruptCompletion = false) {
17060
+ for (var _iterator2 = _asyncIterator(readStream(iterable)), _step; _iteratorAbruptCompletion = !(_step = yield _awaitAsyncGenerator(_iterator2.next())).done; _iteratorAbruptCompletion = false) {
17045
17061
  const chunk = _step.value;
17046
17062
  {
17047
17063
  yield* _asyncGeneratorDelegate(_asyncIterator(streamChunk(chunk, chunkSize)), _awaitAsyncGenerator);
@@ -17052,8 +17068,8 @@ const readBytes = /*#__PURE__*/function () {
17052
17068
  _iteratorError = err;
17053
17069
  } finally {
17054
17070
  try {
17055
- if (_iteratorAbruptCompletion && _iterator.return != null) {
17056
- yield _awaitAsyncGenerator(_iterator.return());
17071
+ if (_iteratorAbruptCompletion && _iterator2.return != null) {
17072
+ yield _awaitAsyncGenerator(_iterator2.return());
17057
17073
  }
17058
17074
  } finally {
17059
17075
  if (_didIteratorError) {
@@ -17279,7 +17295,7 @@ const fetchAdapter = isFetchSupported && (async config => {
17279
17295
  });
17280
17296
  } catch (err) {
17281
17297
  unsubscribe && unsubscribe();
17282
- if (err && err.name === 'TypeError' && /fetch/i.test(err.message)) {
17298
+ if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
17283
17299
  throw Object.assign(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request), {
17284
17300
  cause: err.cause || err
17285
17301
  });
@@ -17487,7 +17503,7 @@ const validators = validator.validators;
17487
17503
  */
17488
17504
  class Axios {
17489
17505
  constructor(instanceConfig) {
17490
- this.defaults = instanceConfig;
17506
+ this.defaults = instanceConfig || {};
17491
17507
  this.interceptors = {
17492
17508
  request: new InterceptorManager$1(),
17493
17509
  response: new InterceptorManager$1()
@@ -22987,7 +23003,7 @@ function createContentfulApi({
22987
23003
  http.defaults.baseURL = getGlobalOptions().environmentBaseUrl;
22988
23004
  }
22989
23005
  return {
22990
- version: "11.5.15",
23006
+ version: "11.5.16",
22991
23007
  getSpace,
22992
23008
  getContentType,
22993
23009
  getContentTypes,
@@ -23110,7 +23126,7 @@ function createClient(params) {
23110
23126
  environment: 'master'
23111
23127
  };
23112
23128
  const config = Object.assign(Object.assign({}, defaultConfig), params);
23113
- const userAgentHeader = getUserAgentHeader(`contentful.js/${"11.5.15"}`, config.application, config.integration);
23129
+ const userAgentHeader = getUserAgentHeader(`contentful.js/${"11.5.16"}`, config.application, config.integration);
23114
23130
  config.headers = Object.assign(Object.assign({}, config.headers), {
23115
23131
  'Content-Type': 'application/vnd.contentful.delivery.v1+json',
23116
23132
  'X-Contentful-User-Agent': userAgentHeader
@@ -37,7 +37,7 @@ function createClient(params) {
37
37
  environment: 'master',
38
38
  };
39
39
  const config = Object.assign(Object.assign({}, defaultConfig), params);
40
- const userAgentHeader = getUserAgentHeader(`contentful.js/${"11.5.15"}`, config.application, config.integration);
40
+ const userAgentHeader = getUserAgentHeader(`contentful.js/${"11.5.16"}`, config.application, config.integration);
41
41
  config.headers = Object.assign(Object.assign({}, config.headers), { 'Content-Type': 'application/vnd.contentful.delivery.v1+json', 'X-Contentful-User-Agent': userAgentHeader });
42
42
  const http = createHttpClient(axios, config);
43
43
  if (!http.defaults.baseURL) {
@@ -368,7 +368,7 @@ function createContentfulApi({ http, getGlobalOptions }, options) {
368
368
  http.defaults.baseURL = getGlobalOptions().environmentBaseUrl;
369
369
  }
370
370
  return {
371
- version: "11.5.15",
371
+ version: "11.5.16",
372
372
  getSpace,
373
373
  getContentType,
374
374
  getContentTypes,