@kontent-ai/core-sdk 10.8.0 → 10.10.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.8.0',
6
+ version: '10.10.0',
7
7
  name: '@kontent-ai/core-sdk'
8
8
  };
9
9
  //# sourceMappingURL=sdk-info.generated.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sdk-info.generated.js","sourceRoot":"","sources":["../../lib/sdk-info.generated.ts"],"names":[],"mappings":";;;AAEa,QAAA,OAAO,GAAa;IAC7B,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,QAAQ;IACjB,IAAI,EAAE,sBAAsB;CAC/B,CAAC"}
1
+ {"version":3,"file":"sdk-info.generated.js","sourceRoot":"","sources":["../../lib/sdk-info.generated.ts"],"names":[],"mappings":";;;AAEa,QAAA,OAAO,GAAa;IAC7B,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,sBAAsB;CAC/B,CAAC"}
@@ -1,6 +1,6 @@
1
1
  export const sdkInfo = {
2
2
  host: 'npmjs.com',
3
- version: '10.8.0',
3
+ version: '10.10.0',
4
4
  name: '@kontent-ai/core-sdk'
5
5
  };
6
6
  //# sourceMappingURL=sdk-info.generated.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sdk-info.generated.js","sourceRoot":"","sources":["../../lib/sdk-info.generated.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,OAAO,GAAa;IAC7B,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,QAAQ;IACjB,IAAI,EAAE,sBAAsB;CAC/B,CAAC"}
1
+ {"version":3,"file":"sdk-info.generated.js","sourceRoot":"","sources":["../../lib/sdk-info.generated.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,OAAO,GAAa;IAC7B,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,sBAAsB;CAC/B,CAAC"}
@@ -1,6 +1,6 @@
1
1
  export const sdkInfo = {
2
2
  host: 'npmjs.com',
3
- version: '10.8.0',
3
+ version: '10.10.0',
4
4
  name: '@kontent-ai/core-sdk'
5
5
  };
6
6
  //# sourceMappingURL=sdk-info.generated.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sdk-info.generated.js","sourceRoot":"","sources":["../../lib/sdk-info.generated.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,OAAO,GAAa;IAC7B,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,QAAQ;IACjB,IAAI,EAAE,sBAAsB;CAC/B,CAAC"}
1
+ {"version":3,"file":"sdk-info.generated.js","sourceRoot":"","sources":["../../lib/sdk-info.generated.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,OAAO,GAAa;IAC7B,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,sBAAsB;CAC/B,CAAC"}
@@ -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.7.7 Copyright (c) 2024 Matt Zabriskie and contributors
902
+ /*! Axios v1.8.2 Copyright (c) 2025 Matt Zabriskie and contributors */
903
903
 
904
904
 
905
905
  function bind(fn, thisArg) {
@@ -1508,26 +1508,6 @@ const toFiniteNumber = (value, defaultValue) => {
1508
1508
  return value != null && Number.isFinite(value = +value) ? value : defaultValue;
1509
1509
  };
1510
1510
 
1511
- const ALPHA = 'abcdefghijklmnopqrstuvwxyz';
1512
-
1513
- const DIGIT = '0123456789';
1514
-
1515
- const ALPHABET = {
1516
- DIGIT,
1517
- ALPHA,
1518
- ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
1519
- };
1520
-
1521
- const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
1522
- let str = '';
1523
- const {length} = alphabet;
1524
- while (size--) {
1525
- str += alphabet[Math.random() * length|0];
1526
- }
1527
-
1528
- return str;
1529
- };
1530
-
1531
1511
  /**
1532
1512
  * If the thing is a FormData object, return true, otherwise return false.
1533
1513
  *
@@ -1655,8 +1635,6 @@ var utils$1 = {
1655
1635
  findKey,
1656
1636
  global: _global,
1657
1637
  isContextDefined,
1658
- ALPHABET,
1659
- generateString,
1660
1638
  isSpecCompliantForm,
1661
1639
  toJSONObject,
1662
1640
  isAsyncFn,
@@ -2053,7 +2031,7 @@ function encode(val) {
2053
2031
  *
2054
2032
  * @param {string} url The base of the url (e.g., http://www.google.com)
2055
2033
  * @param {object} [params] The params to be appended
2056
- * @param {?object} options
2034
+ * @param {?(object|Function)} options
2057
2035
  *
2058
2036
  * @returns {string} The formatted url
2059
2037
  */
@@ -2065,6 +2043,12 @@ function buildURL(url, params, options) {
2065
2043
 
2066
2044
  const _encode = options && options.encode || encode;
2067
2045
 
2046
+ if (utils$1.isFunction(options)) {
2047
+ options = {
2048
+ serialize: options
2049
+ };
2050
+ }
2051
+
2068
2052
  const serializeFn = options && options.serialize;
2069
2053
 
2070
2054
  let serializedParams;
@@ -3053,68 +3037,18 @@ const progressEventDecorator = (total, throttled) => {
3053
3037
 
3054
3038
  const asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args));
3055
3039
 
3056
- var isURLSameOrigin = platform.hasStandardBrowserEnv ?
3057
-
3058
- // Standard browser envs have full support of the APIs needed to test
3059
- // whether the request URL is of the same origin as current location.
3060
- (function standardBrowserEnv() {
3061
- const msie = platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent);
3062
- const urlParsingNode = document.createElement('a');
3063
- let originURL;
3064
-
3065
- /**
3066
- * Parse a URL to discover its components
3067
- *
3068
- * @param {String} url The URL to be parsed
3069
- * @returns {Object}
3070
- */
3071
- function resolveURL(url) {
3072
- let href = url;
3073
-
3074
- if (msie) {
3075
- // IE needs attribute set twice to normalize properties
3076
- urlParsingNode.setAttribute('href', href);
3077
- href = urlParsingNode.href;
3078
- }
3079
-
3080
- urlParsingNode.setAttribute('href', href);
3081
-
3082
- // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
3083
- return {
3084
- href: urlParsingNode.href,
3085
- protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
3086
- host: urlParsingNode.host,
3087
- search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
3088
- hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
3089
- hostname: urlParsingNode.hostname,
3090
- port: urlParsingNode.port,
3091
- pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
3092
- urlParsingNode.pathname :
3093
- '/' + urlParsingNode.pathname
3094
- };
3095
- }
3096
-
3097
- originURL = resolveURL(window.location.href);
3040
+ var isURLSameOrigin = platform.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => {
3041
+ url = new URL(url, platform.origin);
3098
3042
 
3099
- /**
3100
- * Determine if a URL shares the same origin as the current location
3101
- *
3102
- * @param {String} requestURL The URL to test
3103
- * @returns {boolean} True if URL shares the same origin, otherwise false
3104
- */
3105
- return function isURLSameOrigin(requestURL) {
3106
- const parsed = (utils$1.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
3107
- return (parsed.protocol === originURL.protocol &&
3108
- parsed.host === originURL.host);
3109
- };
3110
- })() :
3111
-
3112
- // Non standard browser envs (web workers, react-native) lack needed support.
3113
- (function nonStandardBrowserEnv() {
3114
- return function isURLSameOrigin() {
3115
- return true;
3116
- };
3117
- })();
3043
+ return (
3044
+ origin.protocol === url.protocol &&
3045
+ origin.host === url.host &&
3046
+ (isMSIE || origin.port === url.port)
3047
+ );
3048
+ })(
3049
+ new URL(platform.origin),
3050
+ platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
3051
+ ) : () => true;
3118
3052
 
3119
3053
  var cookies = platform.hasStandardBrowserEnv ?
3120
3054
 
@@ -3193,8 +3127,9 @@ function combineURLs(baseURL, relativeURL) {
3193
3127
  *
3194
3128
  * @returns {string} The combined full path
3195
3129
  */
3196
- function buildFullPath(baseURL, requestedURL) {
3197
- if (baseURL && !isAbsoluteURL(requestedURL)) {
3130
+ function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
3131
+ let isRelativeUrl = !isAbsoluteURL(requestedURL);
3132
+ if (baseURL && isRelativeUrl || allowAbsoluteUrls == false) {
3198
3133
  return combineURLs(baseURL, requestedURL);
3199
3134
  }
3200
3135
  return requestedURL;
@@ -3216,7 +3151,7 @@ function mergeConfig(config1, config2) {
3216
3151
  config2 = config2 || {};
3217
3152
  const config = {};
3218
3153
 
3219
- function getMergedValue(target, source, caseless) {
3154
+ function getMergedValue(target, source, prop, caseless) {
3220
3155
  if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
3221
3156
  return utils$1.merge.call({caseless}, target, source);
3222
3157
  } else if (utils$1.isPlainObject(source)) {
@@ -3228,11 +3163,11 @@ function mergeConfig(config1, config2) {
3228
3163
  }
3229
3164
 
3230
3165
  // eslint-disable-next-line consistent-return
3231
- function mergeDeepProperties(a, b, caseless) {
3166
+ function mergeDeepProperties(a, b, prop , caseless) {
3232
3167
  if (!utils$1.isUndefined(b)) {
3233
- return getMergedValue(a, b, caseless);
3168
+ return getMergedValue(a, b, prop , caseless);
3234
3169
  } else if (!utils$1.isUndefined(a)) {
3235
- return getMergedValue(undefined, a, caseless);
3170
+ return getMergedValue(undefined, a, prop , caseless);
3236
3171
  }
3237
3172
  }
3238
3173
 
@@ -3290,7 +3225,7 @@ function mergeConfig(config1, config2) {
3290
3225
  socketPath: defaultToConfig2,
3291
3226
  responseEncoding: defaultToConfig2,
3292
3227
  validateStatus: mergeDirectKeys,
3293
- headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
3228
+ headers: (a, b , prop) => mergeDeepProperties(headersToObject(a), headersToObject(b),prop, true)
3294
3229
  };
3295
3230
 
3296
3231
  utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
@@ -4034,7 +3969,7 @@ function dispatchRequest(config) {
4034
3969
  });
4035
3970
  }
4036
3971
 
4037
- const VERSION = "1.7.7";
3972
+ const VERSION = "1.8.2";
4038
3973
 
4039
3974
  const validators$1 = {};
4040
3975
 
@@ -4085,6 +4020,14 @@ validators$1.transitional = function transitional(validator, version, message) {
4085
4020
  };
4086
4021
  };
4087
4022
 
4023
+ validators$1.spelling = function spelling(correctSpelling) {
4024
+ return (value, opt) => {
4025
+ // eslint-disable-next-line no-console
4026
+ console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
4027
+ return true;
4028
+ }
4029
+ };
4030
+
4088
4031
  /**
4089
4032
  * Assert object's properties type
4090
4033
  *
@@ -4154,9 +4097,9 @@ class Axios {
4154
4097
  return await this._request(configOrUrl, config);
4155
4098
  } catch (err) {
4156
4099
  if (err instanceof Error) {
4157
- let dummy;
4100
+ let dummy = {};
4158
4101
 
4159
- Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error());
4102
+ Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());
4160
4103
 
4161
4104
  // slice off the Error: ... line
4162
4105
  const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
@@ -4211,6 +4154,18 @@ class Axios {
4211
4154
  }
4212
4155
  }
4213
4156
 
4157
+ // Set config.allowAbsoluteUrls
4158
+ if (config.allowAbsoluteUrls !== undefined) ; else if (this.defaults.allowAbsoluteUrls !== undefined) {
4159
+ config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
4160
+ } else {
4161
+ config.allowAbsoluteUrls = true;
4162
+ }
4163
+
4164
+ validator.assertOptions(config, {
4165
+ baseUrl: validators.spelling('baseURL'),
4166
+ withXsrfToken: validators.spelling('withXSRFToken')
4167
+ }, true);
4168
+
4214
4169
  // Set config.method
4215
4170
  config.method = (config.method || this.defaults.method || 'get').toLowerCase();
4216
4171
 
@@ -4301,7 +4256,7 @@ class Axios {
4301
4256
 
4302
4257
  getUri(config) {
4303
4258
  config = mergeConfig(this.defaults, config);
4304
- const fullPath = buildFullPath(config.baseURL, config.url);
4259
+ const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
4305
4260
  return buildURL(fullPath, config.params, config.paramsSerializer);
4306
4261
  }
4307
4262
  }