@kontent-ai/core-sdk 10.8.0 → 10.9.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.9.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.8.0',
3
+ version: '10.9.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.8.0',
3
+ version: '10.9.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.7.7 Copyright (c) 2024 Matt Zabriskie and contributors
902
+ // Axios v1.7.9 Copyright (c) 2024 Matt Zabriskie and contributors
903
903
 
904
904
 
905
905
  function bind(fn, thisArg) {
@@ -2053,7 +2053,7 @@ function encode(val) {
2053
2053
  *
2054
2054
  * @param {string} url The base of the url (e.g., http://www.google.com)
2055
2055
  * @param {object} [params] The params to be appended
2056
- * @param {?object} options
2056
+ * @param {?(object|Function)} options
2057
2057
  *
2058
2058
  * @returns {string} The formatted url
2059
2059
  */
@@ -2065,6 +2065,12 @@ function buildURL(url, params, options) {
2065
2065
 
2066
2066
  const _encode = options && options.encode || encode;
2067
2067
 
2068
+ if (utils$1.isFunction(options)) {
2069
+ options = {
2070
+ serialize: options
2071
+ };
2072
+ }
2073
+
2068
2074
  const serializeFn = options && options.serialize;
2069
2075
 
2070
2076
  let serializedParams;
@@ -3053,68 +3059,18 @@ const progressEventDecorator = (total, throttled) => {
3053
3059
 
3054
3060
  const asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args));
3055
3061
 
3056
- var isURLSameOrigin = platform.hasStandardBrowserEnv ?
3062
+ var isURLSameOrigin = platform.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => {
3063
+ url = new URL(url, platform.origin);
3057
3064
 
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);
3098
-
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
- })();
3065
+ return (
3066
+ origin.protocol === url.protocol &&
3067
+ origin.host === url.host &&
3068
+ (isMSIE || origin.port === url.port)
3069
+ );
3070
+ })(
3071
+ new URL(platform.origin),
3072
+ platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
3073
+ ) : () => true;
3118
3074
 
3119
3075
  var cookies = platform.hasStandardBrowserEnv ?
3120
3076
 
@@ -3216,7 +3172,7 @@ function mergeConfig(config1, config2) {
3216
3172
  config2 = config2 || {};
3217
3173
  const config = {};
3218
3174
 
3219
- function getMergedValue(target, source, caseless) {
3175
+ function getMergedValue(target, source, prop, caseless) {
3220
3176
  if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
3221
3177
  return utils$1.merge.call({caseless}, target, source);
3222
3178
  } else if (utils$1.isPlainObject(source)) {
@@ -3228,11 +3184,11 @@ function mergeConfig(config1, config2) {
3228
3184
  }
3229
3185
 
3230
3186
  // eslint-disable-next-line consistent-return
3231
- function mergeDeepProperties(a, b, caseless) {
3187
+ function mergeDeepProperties(a, b, prop , caseless) {
3232
3188
  if (!utils$1.isUndefined(b)) {
3233
- return getMergedValue(a, b, caseless);
3189
+ return getMergedValue(a, b, prop , caseless);
3234
3190
  } else if (!utils$1.isUndefined(a)) {
3235
- return getMergedValue(undefined, a, caseless);
3191
+ return getMergedValue(undefined, a, prop , caseless);
3236
3192
  }
3237
3193
  }
3238
3194
 
@@ -3290,7 +3246,7 @@ function mergeConfig(config1, config2) {
3290
3246
  socketPath: defaultToConfig2,
3291
3247
  responseEncoding: defaultToConfig2,
3292
3248
  validateStatus: mergeDirectKeys,
3293
- headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
3249
+ headers: (a, b , prop) => mergeDeepProperties(headersToObject(a), headersToObject(b),prop, true)
3294
3250
  };
3295
3251
 
3296
3252
  utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
@@ -4034,7 +3990,7 @@ function dispatchRequest(config) {
4034
3990
  });
4035
3991
  }
4036
3992
 
4037
- const VERSION = "1.7.7";
3993
+ const VERSION = "1.7.9";
4038
3994
 
4039
3995
  const validators$1 = {};
4040
3996
 
@@ -4085,6 +4041,14 @@ validators$1.transitional = function transitional(validator, version, message) {
4085
4041
  };
4086
4042
  };
4087
4043
 
4044
+ validators$1.spelling = function spelling(correctSpelling) {
4045
+ return (value, opt) => {
4046
+ // eslint-disable-next-line no-console
4047
+ console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
4048
+ return true;
4049
+ }
4050
+ };
4051
+
4088
4052
  /**
4089
4053
  * Assert object's properties type
4090
4054
  *
@@ -4154,9 +4118,9 @@ class Axios {
4154
4118
  return await this._request(configOrUrl, config);
4155
4119
  } catch (err) {
4156
4120
  if (err instanceof Error) {
4157
- let dummy;
4121
+ let dummy = {};
4158
4122
 
4159
- Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error());
4123
+ Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());
4160
4124
 
4161
4125
  // slice off the Error: ... line
4162
4126
  const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
@@ -4211,6 +4175,11 @@ class Axios {
4211
4175
  }
4212
4176
  }
4213
4177
 
4178
+ validator.assertOptions(config, {
4179
+ baseUrl: validators.spelling('baseURL'),
4180
+ withXsrfToken: validators.spelling('withXSRFToken')
4181
+ }, true);
4182
+
4214
4183
  // Set config.method
4215
4184
  config.method = (config.method || this.defaults.method || 'get').toLowerCase();
4216
4185