@kontent-ai/core-sdk 10.10.1 → 10.12.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.
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.sdkInfo = void 0;
4
4
  exports.sdkInfo = {
5
5
  host: 'npmjs.com',
6
- version: '10.10.1',
6
+ version: '10.12.0',
7
7
  name: '@kontent-ai/core-sdk'
8
8
  };
9
9
  //# sourceMappingURL=sdk-info.generated.js.map
@@ -1,6 +1,6 @@
1
1
  export const sdkInfo = {
2
2
  host: 'npmjs.com',
3
- version: '10.10.1',
3
+ version: '10.12.0',
4
4
  name: '@kontent-ai/core-sdk'
5
5
  };
6
6
  //# sourceMappingURL=sdk-info.generated.js.map
@@ -1,6 +1,6 @@
1
1
  export const sdkInfo = {
2
2
  host: 'npmjs.com',
3
- version: '10.10.1',
3
+ version: '10.12.0',
4
4
  name: '@kontent-ai/core-sdk'
5
5
  };
6
6
  //# sourceMappingURL=sdk-info.generated.js.map
@@ -899,7 +899,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
899
899
  \***************************************************/
900
900
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
901
901
 
902
- /*! Axios v1.8.4 Copyright (c) 2025 Matt Zabriskie and contributors */
902
+ /*! Axios v1.11.0 Copyright (c) 2025 Matt Zabriskie and contributors */
903
903
 
904
904
 
905
905
  function bind(fn, thisArg) {
@@ -912,6 +912,7 @@ function bind(fn, thisArg) {
912
912
 
913
913
  const {toString} = Object.prototype;
914
914
  const {getPrototypeOf} = Object;
915
+ const {iterator, toStringTag} = Symbol;
915
916
 
916
917
  const kindOf = (cache => thing => {
917
918
  const str = toString.call(thing);
@@ -1038,7 +1039,28 @@ const isPlainObject = (val) => {
1038
1039
  }
1039
1040
 
1040
1041
  const prototype = getPrototypeOf(val);
1041
- return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
1042
+ return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);
1043
+ };
1044
+
1045
+ /**
1046
+ * Determine if a value is an empty object (safely handles Buffers)
1047
+ *
1048
+ * @param {*} val The value to test
1049
+ *
1050
+ * @returns {boolean} True if value is an empty object, otherwise false
1051
+ */
1052
+ const isEmptyObject = (val) => {
1053
+ // Early return for non-objects or Buffers to prevent RangeError
1054
+ if (!isObject(val) || isBuffer(val)) {
1055
+ return false;
1056
+ }
1057
+
1058
+ try {
1059
+ return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
1060
+ } catch (e) {
1061
+ // Fallback for any other objects that might cause RangeError with Object.keys()
1062
+ return false;
1063
+ }
1042
1064
  };
1043
1065
 
1044
1066
  /**
@@ -1163,6 +1185,11 @@ function forEach(obj, fn, {allOwnKeys = false} = {}) {
1163
1185
  fn.call(null, obj[i], i, obj);
1164
1186
  }
1165
1187
  } else {
1188
+ // Buffer check
1189
+ if (isBuffer(obj)) {
1190
+ return;
1191
+ }
1192
+
1166
1193
  // Iterate over object keys
1167
1194
  const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
1168
1195
  const len = keys.length;
@@ -1176,6 +1203,10 @@ function forEach(obj, fn, {allOwnKeys = false} = {}) {
1176
1203
  }
1177
1204
 
1178
1205
  function findKey(obj, key) {
1206
+ if (isBuffer(obj)){
1207
+ return null;
1208
+ }
1209
+
1179
1210
  key = key.toLowerCase();
1180
1211
  const keys = Object.keys(obj);
1181
1212
  let i = keys.length;
@@ -1389,13 +1420,13 @@ const isTypedArray = (TypedArray => {
1389
1420
  * @returns {void}
1390
1421
  */
1391
1422
  const forEachEntry = (obj, fn) => {
1392
- const generator = obj && obj[Symbol.iterator];
1423
+ const generator = obj && obj[iterator];
1393
1424
 
1394
- const iterator = generator.call(obj);
1425
+ const _iterator = generator.call(obj);
1395
1426
 
1396
1427
  let result;
1397
1428
 
1398
- while ((result = iterator.next()) && !result.done) {
1429
+ while ((result = _iterator.next()) && !result.done) {
1399
1430
  const pair = result.value;
1400
1431
  fn.call(obj, pair[0], pair[1]);
1401
1432
  }
@@ -1516,7 +1547,7 @@ const toFiniteNumber = (value, defaultValue) => {
1516
1547
  * @returns {boolean}
1517
1548
  */
1518
1549
  function isSpecCompliantForm(thing) {
1519
- return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);
1550
+ return !!(thing && isFunction(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]);
1520
1551
  }
1521
1552
 
1522
1553
  const toJSONObject = (obj) => {
@@ -1529,6 +1560,11 @@ const toJSONObject = (obj) => {
1529
1560
  return;
1530
1561
  }
1531
1562
 
1563
+ //Buffer check
1564
+ if (isBuffer(source)) {
1565
+ return source;
1566
+ }
1567
+
1532
1568
  if(!('toJSON' in source)) {
1533
1569
  stack[i] = source;
1534
1570
  const target = isArray(source) ? [] : {};
@@ -1585,6 +1621,10 @@ const asap = typeof queueMicrotask !== 'undefined' ?
1585
1621
 
1586
1622
  // *********************
1587
1623
 
1624
+
1625
+ const isIterable = (thing) => thing != null && isFunction(thing[iterator]);
1626
+
1627
+
1588
1628
  var utils$1 = {
1589
1629
  isArray,
1590
1630
  isArrayBuffer,
@@ -1596,6 +1636,7 @@ var utils$1 = {
1596
1636
  isBoolean,
1597
1637
  isObject,
1598
1638
  isPlainObject,
1639
+ isEmptyObject,
1599
1640
  isReadableStream,
1600
1641
  isRequest,
1601
1642
  isResponse,
@@ -1640,7 +1681,8 @@ var utils$1 = {
1640
1681
  isAsyncFn,
1641
1682
  isThenable,
1642
1683
  setImmediate: _setImmediate,
1643
- asap
1684
+ asap,
1685
+ isIterable
1644
1686
  };
1645
1687
 
1646
1688
  /**
@@ -1859,6 +1901,10 @@ function toFormData(obj, formData, options) {
1859
1901
  return value.toISOString();
1860
1902
  }
1861
1903
 
1904
+ if (utils$1.isBoolean(value)) {
1905
+ return value.toString();
1906
+ }
1907
+
1862
1908
  if (!useBlob && utils$1.isBlob(value)) {
1863
1909
  throw new AxiosError('Blob is not supported. Use a Buffer instead.');
1864
1910
  }
@@ -2222,7 +2268,7 @@ var platform = {
2222
2268
  };
2223
2269
 
2224
2270
  function toURLEncodedForm(data, options) {
2225
- return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({
2271
+ return toFormData(data, new platform.classes.URLSearchParams(), {
2226
2272
  visitor: function(value, key, path, helpers) {
2227
2273
  if (platform.isNode && utils$1.isBuffer(value)) {
2228
2274
  this.append(key, value.toString('base64'));
@@ -2230,8 +2276,9 @@ function toURLEncodedForm(data, options) {
2230
2276
  }
2231
2277
 
2232
2278
  return helpers.defaultVisitor.apply(this, arguments);
2233
- }
2234
- }, options));
2279
+ },
2280
+ ...options
2281
+ });
2235
2282
  }
2236
2283
 
2237
2284
  /**
@@ -2625,10 +2672,18 @@ class AxiosHeaders {
2625
2672
  setHeaders(header, valueOrRewrite);
2626
2673
  } else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
2627
2674
  setHeaders(parseHeaders(header), valueOrRewrite);
2628
- } else if (utils$1.isHeaders(header)) {
2629
- for (const [key, value] of header.entries()) {
2630
- setHeader(value, key, rewrite);
2675
+ } else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
2676
+ let obj = {}, dest, key;
2677
+ for (const entry of header) {
2678
+ if (!utils$1.isArray(entry)) {
2679
+ throw TypeError('Object iterator must return a key-value pair');
2680
+ }
2681
+
2682
+ obj[key = entry[0]] = (dest = obj[key]) ?
2683
+ (utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]]) : entry[1];
2631
2684
  }
2685
+
2686
+ setHeaders(obj, valueOrRewrite);
2632
2687
  } else {
2633
2688
  header != null && setHeader(valueOrRewrite, header, rewrite);
2634
2689
  }
@@ -2770,6 +2825,10 @@ class AxiosHeaders {
2770
2825
  return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n');
2771
2826
  }
2772
2827
 
2828
+ getSetCookie() {
2829
+ return this.get("set-cookie") || [];
2830
+ }
2831
+
2773
2832
  get [Symbol.toStringTag]() {
2774
2833
  return 'AxiosHeaders';
2775
2834
  }
@@ -2972,7 +3031,7 @@ function throttle(fn, freq) {
2972
3031
  clearTimeout(timer);
2973
3032
  timer = null;
2974
3033
  }
2975
- fn.apply(null, args);
3034
+ fn(...args);
2976
3035
  };
2977
3036
 
2978
3037
  const throttled = (...args) => {
@@ -3228,7 +3287,7 @@ function mergeConfig(config1, config2) {
3228
3287
  headers: (a, b , prop) => mergeDeepProperties(headersToObject(a), headersToObject(b),prop, true)
3229
3288
  };
3230
3289
 
3231
- utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
3290
+ utils$1.forEach(Object.keys({...config1, ...config2}), function computeConfigValue(prop) {
3232
3291
  const merge = mergeMap[prop] || mergeDeepProperties;
3233
3292
  const configValue = merge(config1[prop], config2[prop], prop);
3234
3293
  (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
@@ -3763,7 +3822,7 @@ var fetchAdapter = isFetchSupported && (async (config) => {
3763
3822
  credentials: isCredentialsSupported ? withCredentials : undefined
3764
3823
  });
3765
3824
 
3766
- let response = await fetch(request);
3825
+ let response = await fetch(request, fetchOptions);
3767
3826
 
3768
3827
  const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
3769
3828
 
@@ -3809,7 +3868,7 @@ var fetchAdapter = isFetchSupported && (async (config) => {
3809
3868
  } catch (err) {
3810
3869
  unsubscribe && unsubscribe();
3811
3870
 
3812
- if (err && err.name === 'TypeError' && /fetch/i.test(err.message)) {
3871
+ if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
3813
3872
  throw Object.assign(
3814
3873
  new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request),
3815
3874
  {
@@ -3969,7 +4028,7 @@ function dispatchRequest(config) {
3969
4028
  });
3970
4029
  }
3971
4030
 
3972
- const VERSION = "1.8.4";
4031
+ const VERSION = "1.11.0";
3973
4032
 
3974
4033
  const validators$1 = {};
3975
4034
 
@@ -4077,7 +4136,7 @@ const validators = validator.validators;
4077
4136
  */
4078
4137
  class Axios {
4079
4138
  constructor(instanceConfig) {
4080
- this.defaults = instanceConfig;
4139
+ this.defaults = instanceConfig || {};
4081
4140
  this.interceptors = {
4082
4141
  request: new InterceptorManager$1(),
4083
4142
  response: new InterceptorManager$1()
@@ -4208,8 +4267,8 @@ class Axios {
4208
4267
 
4209
4268
  if (!synchronousRequestInterceptors) {
4210
4269
  const chain = [dispatchRequest.bind(this), undefined];
4211
- chain.unshift.apply(chain, requestInterceptorChain);
4212
- chain.push.apply(chain, responseInterceptorChain);
4270
+ chain.unshift(...requestInterceptorChain);
4271
+ chain.push(...responseInterceptorChain);
4213
4272
  len = chain.length;
4214
4273
 
4215
4274
  promise = Promise.resolve(config);