@kentico/kontent-core
Advanced tools
Comparing version 9.0.1 to 9.1.0
@@ -5,2 +5,14 @@ # Changelog | ||
## [9.1.0](https://github.com/Kentico/kontent-core-js/compare/v9.0.1...v9.1.0) (2021-08-12) | ||
### Features | ||
* updates dependencies ([2e62c07](https://github.com/Kentico/kontent-core-js/commit/2e62c077691c828e600dd69e32d2969b2cd75137)) | ||
### Bug Fixes | ||
* removes console log used for test purposes ([bcb70d9](https://github.com/Kentico/kontent-core-js/commit/bcb70d90aa393a83b49e72e7e3363ae6b32cff68)) | ||
### [9.0.1](https://github.com/Kentico/kontent-core-js/compare/v9.0.0...v9.0.1) (2021-06-15) | ||
@@ -7,0 +19,0 @@ |
@@ -100,3 +100,2 @@ "use strict"; | ||
var canRetryStatusCode = this.canRetryStatusCode(statusCode, this.defaultRetryStatusCodes); | ||
console.log('STATUS', statusCode, canRetryStatusCode); | ||
if (canRetryStatusCode) { | ||
@@ -103,0 +102,0 @@ return true; |
@@ -6,5 +6,5 @@ "use strict"; | ||
host: 'npmjs.com', | ||
version: '9.0.1', | ||
version: '9.1.0', | ||
name: '@kentico/kontent-core' | ||
}; | ||
//# sourceMappingURL=sdk-info.generated.js.map |
@@ -96,3 +96,2 @@ import { extractHeadersFromAxiosResponse } from './headers-helper'; | ||
const canRetryStatusCode = this.canRetryStatusCode(statusCode, this.defaultRetryStatusCodes); | ||
console.log('STATUS', statusCode, canRetryStatusCode); | ||
if (canRetryStatusCode) { | ||
@@ -99,0 +98,0 @@ return true; |
export const sdkInfo = { | ||
host: 'npmjs.com', | ||
version: '9.0.1', | ||
version: '9.1.0', | ||
name: '@kentico/kontent-core' | ||
}; | ||
//# sourceMappingURL=sdk-info.generated.js.map |
@@ -97,3 +97,2 @@ import { extractHeadersFromAxiosResponse } from './headers-helper'; | ||
var canRetryStatusCode = this.canRetryStatusCode(statusCode, this.defaultRetryStatusCodes); | ||
console.log('STATUS', statusCode, canRetryStatusCode); | ||
if (canRetryStatusCode) { | ||
@@ -100,0 +99,0 @@ return true; |
export var sdkInfo = { | ||
host: 'npmjs.com', | ||
version: '9.0.1', | ||
version: '9.1.0', | ||
name: '@kentico/kontent-core' | ||
}; | ||
//# sourceMappingURL=sdk-info.generated.js.map |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("kontentCore",[],t):"object"==typeof exports?exports.kontentCore=t():e.kontentCore=t()}(self,(function(){return(()=>{var e={669:(e,t,r)=>{e.exports=r(609)},448:(e,t,r)=>{"use strict";var n=r(867),s=r(26),o=r(372),a=r(327),i=r(97),u=r(109),c=r(985),f=r(61);e.exports=function(e){return new Promise((function(t,r){var p=e.data,l=e.headers;n.isFormData(p)&&delete l["Content-Type"];var d=new XMLHttpRequest;if(e.auth){var y=e.auth.username||"",h=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";l.Authorization="Basic "+btoa(y+":"+h)}var m=i(e.baseURL,e.url);if(d.open(e.method.toUpperCase(),a(m,e.params,e.paramsSerializer),!0),d.timeout=e.timeout,d.onreadystatechange=function(){if(d&&4===d.readyState&&(0!==d.status||d.responseURL&&0===d.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in d?u(d.getAllResponseHeaders()):null,o={data:e.responseType&&"text"!==e.responseType?d.response:d.responseText,status:d.status,statusText:d.statusText,headers:n,config:e,request:d};s(t,r,o),d=null}},d.onabort=function(){d&&(r(f("Request aborted",e,"ECONNABORTED",d)),d=null)},d.onerror=function(){r(f("Network Error",e,null,d)),d=null},d.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(f(t,e,"ECONNABORTED",d)),d=null},n.isStandardBrowserEnv()){var g=(e.withCredentials||c(m))&&e.xsrfCookieName?o.read(e.xsrfCookieName):void 0;g&&(l[e.xsrfHeaderName]=g)}if("setRequestHeader"in d&&n.forEach(l,(function(e,t){void 0===p&&"content-type"===t.toLowerCase()?delete l[t]:d.setRequestHeader(t,e)})),n.isUndefined(e.withCredentials)||(d.withCredentials=!!e.withCredentials),e.responseType)try{d.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&d.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&d.upload&&d.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){d&&(d.abort(),r(e),d=null)})),p||(p=null),d.send(p)}))}},609:(e,t,r)=>{"use strict";var n=r(867),s=r(849),o=r(321),a=r(185);function i(e){var t=new o(e),r=s(o.prototype.request,t);return n.extend(r,o.prototype,t),n.extend(r,t),r}var u=i(r(655));u.Axios=o,u.create=function(e){return i(a(u.defaults,e))},u.Cancel=r(263),u.CancelToken=r(972),u.isCancel=r(502),u.all=function(e){return Promise.all(e)},u.spread=r(713),u.isAxiosError=r(268),e.exports=u,e.exports.default=u},263:e=>{"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},972:(e,t,r)=>{"use strict";var n=r(263);function s(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;e((function(e){r.reason||(r.reason=new n(e),t(r.reason))}))}s.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},s.source=function(){var e;return{token:new s((function(t){e=t})),cancel:e}},e.exports=s},502:e=>{"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},321:(e,t,r)=>{"use strict";var n=r(867),s=r(327),o=r(782),a=r(572),i=r(185);function u(e){this.defaults=e,this.interceptors={request:new o,response:new o}}u.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=i(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[a,void 0],r=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)r=r.then(t.shift(),t.shift());return r},u.prototype.getUri=function(e){return e=i(this.defaults,e),s(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},n.forEach(["delete","get","head","options"],(function(e){u.prototype[e]=function(t,r){return this.request(i(r||{},{method:e,url:t,data:(r||{}).data}))}})),n.forEach(["post","put","patch"],(function(e){u.prototype[e]=function(t,r,n){return this.request(i(n||{},{method:e,url:t,data:r}))}})),e.exports=u},782:(e,t,r)=>{"use strict";var n=r(867);function s(){this.handlers=[]}s.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},s.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},s.prototype.forEach=function(e){n.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=s},97:(e,t,r)=>{"use strict";var n=r(793),s=r(303);e.exports=function(e,t){return e&&!n(t)?s(e,t):t}},61:(e,t,r)=>{"use strict";var n=r(481);e.exports=function(e,t,r,s,o){var a=new Error(e);return n(a,t,r,s,o)}},572:(e,t,r)=>{"use strict";var n=r(867),s=r(527),o=r(502),a=r(655);function i(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return i(e),e.headers=e.headers||{},e.data=s(e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||a.adapter)(e).then((function(t){return i(e),t.data=s(t.data,t.headers,e.transformResponse),t}),(function(t){return o(t)||(i(e),t&&t.response&&(t.response.data=s(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},481:e=>{"use strict";e.exports=function(e,t,r,n,s){return e.config=t,r&&(e.code=r),e.request=n,e.response=s,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},185:(e,t,r)=>{"use strict";var n=r(867);e.exports=function(e,t){t=t||{};var r={},s=["url","method","data"],o=["headers","auth","proxy","params"],a=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],i=["validateStatus"];function u(e,t){return n.isPlainObject(e)&&n.isPlainObject(t)?n.merge(e,t):n.isPlainObject(t)?n.merge({},t):n.isArray(t)?t.slice():t}function c(s){n.isUndefined(t[s])?n.isUndefined(e[s])||(r[s]=u(void 0,e[s])):r[s]=u(e[s],t[s])}n.forEach(s,(function(e){n.isUndefined(t[e])||(r[e]=u(void 0,t[e]))})),n.forEach(o,c),n.forEach(a,(function(s){n.isUndefined(t[s])?n.isUndefined(e[s])||(r[s]=u(void 0,e[s])):r[s]=u(void 0,t[s])})),n.forEach(i,(function(n){n in t?r[n]=u(e[n],t[n]):n in e&&(r[n]=u(void 0,e[n]))}));var f=s.concat(o).concat(a).concat(i),p=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===f.indexOf(e)}));return n.forEach(p,c),r}},26:(e,t,r)=>{"use strict";var n=r(61);e.exports=function(e,t,r){var s=r.config.validateStatus;r.status&&s&&!s(r.status)?t(n("Request failed with status code "+r.status,r.config,null,r.request,r)):e(r)}},527:(e,t,r)=>{"use strict";var n=r(867);e.exports=function(e,t,r){return n.forEach(r,(function(r){e=r(e,t)})),e}},655:(e,t,r)=>{"use strict";var n=r(867),s=r(16),o={"Content-Type":"application/x-www-form-urlencoded"};function a(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var i,u={adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(i=r(448)),i),transformRequest:[function(e,t){return s(t,"Accept"),s(t,"Content-Type"),n.isFormData(e)||n.isArrayBuffer(e)||n.isBuffer(e)||n.isStream(e)||n.isFile(e)||n.isBlob(e)?e:n.isArrayBufferView(e)?e.buffer:n.isURLSearchParams(e)?(a(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):n.isObject(e)?(a(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],(function(e){u.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){u.headers[e]=n.merge(o)})),e.exports=u},849:e=>{"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}}},327:(e,t,r)=>{"use strict";var n=r(867);function s(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,r){if(!t)return e;var o;if(r)o=r(t);else if(n.isURLSearchParams(t))o=t.toString();else{var a=[];n.forEach(t,(function(e,t){null!=e&&(n.isArray(e)?t+="[]":e=[e],n.forEach(e,(function(e){n.isDate(e)?e=e.toISOString():n.isObject(e)&&(e=JSON.stringify(e)),a.push(s(t)+"="+s(e))})))})),o=a.join("&")}if(o){var i=e.indexOf("#");-1!==i&&(e=e.slice(0,i)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}},303:e=>{"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},372:(e,t,r)=>{"use strict";var n=r(867);e.exports=n.isStandardBrowserEnv()?{write:function(e,t,r,s,o,a){var i=[];i.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&i.push("expires="+new Date(r).toGMTString()),n.isString(s)&&i.push("path="+s),n.isString(o)&&i.push("domain="+o),!0===a&&i.push("secure"),document.cookie=i.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},793:e=>{"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},268:e=>{"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},985:(e,t,r)=>{"use strict";var n=r(867);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function s(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=s(window.location.href),function(t){var r=n.isString(t)?s(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},16:(e,t,r)=>{"use strict";var n=r(867);e.exports=function(e,t){n.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))}},109:(e,t,r)=>{"use strict";var n=r(867),s=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,r,o,a={};return e?(n.forEach(e.split("\n"),(function(e){if(o=e.indexOf(":"),t=n.trim(e.substr(0,o)).toLowerCase(),r=n.trim(e.substr(o+1)),t){if(a[t]&&s.indexOf(t)>=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([r]):a[t]?a[t]+", "+r:r}})),a):a}},713:e=>{"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},867:(e,t,r)=>{"use strict";var n=r(849),s=Object.prototype.toString;function o(e){return"[object Array]"===s.call(e)}function a(e){return void 0===e}function i(e){return null!==e&&"object"==typeof e}function u(e){if("[object Object]"!==s.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function c(e){return"[object Function]"===s.call(e)}function f(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),o(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.call(null,e[s],s,e)}e.exports={isArray:o,isArrayBuffer:function(e){return"[object ArrayBuffer]"===s.call(e)},isBuffer:function(e){return null!==e&&!a(e)&&null!==e.constructor&&!a(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:i,isPlainObject:u,isUndefined:a,isDate:function(e){return"[object Date]"===s.call(e)},isFile:function(e){return"[object File]"===s.call(e)},isBlob:function(e){return"[object Blob]"===s.call(e)},isFunction:c,isStream:function(e){return i(e)&&c(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:f,merge:function e(){var t={};function r(r,n){u(t[n])&&u(r)?t[n]=e(t[n],r):u(r)?t[n]=e({},r):o(r)?t[n]=r.slice():t[n]=r}for(var n=0,s=arguments.length;n<s;n++)f(arguments[n],r);return t},extend:function(e,t,r){return f(t,(function(t,s){e[s]=r&&"function"==typeof t?n(t,r):t})),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}}},t={};function r(n){var s=t[n];if(void 0!==s)return s.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{EnumHelper:()=>a,HeaderHelper:()=>s,HttpDebugger:()=>y,HttpService:()=>b,Parameters:()=>p,RetryHelper:()=>c,TestHttpService:()=>C,UrlHelper:()=>e,createCancelToken:()=>w,deletehWithRetryAsync:()=>v,enumHelper:()=>i,extractHeadersFromAxiosResponse:()=>u,getWithRetryAsync:()=>m,headerHelper:()=>o,httpDebugger:()=>h,patchWithRetryAsync:()=>R,postWithRetryAsync:()=>g,putWithRetryAsync:()=>x,retryHelper:()=>f,urlHelper:()=>t});class e{addOptionsToUrl(e,t){return t&&t.forEach((t=>{e.indexOf("?")>-1?e+="&":e+="?",e+=t.getParam()})),e}}const t=new e;class s{constructor(){this.sdkVersionHeader="X-KC-SDKID"}getSdkIdHeader(e){return{header:this.sdkVersionHeader,value:`${e.host};${e.name};${e.version}`}}}const o=new s;class a{getAllNames(e){const t=[];for(const r in e)e.hasOwnProperty(r)&&t.push(r);return t}getAllValues(e){return Object.keys(e).map((t=>e[t]))}getEnumFromValue(e,t){try{if(!t)return;if(this.isNumeric(t))return e[t];const r=this.getAllValues(e).find((e=>e.toLowerCase()===t.toString().toLowerCase()));if(!r)return;return r}catch(e){return}}getEnumFromName(e,t){const r=this.getAllNames(e);for(const n of r)if(n.toLowerCase()===t.toLowerCase())return e[n]}isNumeric(e){return!isNaN(parseFloat(e))&&isFinite(e)}}const i=new a;function u(e){const t=[];for(const r of Object.keys(e.headers))t.push({header:r,value:e.headers[r]});return t}class c{constructor(){this.requestCancelledMessagePrefix="Request cancelled",this.retryAfterHeaderName="Retry-After",this.defaultRetryStatusCodes=[408,429,500,502,503,504],this.defaultRetryStrategy={addJitter:!0,deltaBackoffMs:1e3,maxAttempts:5,canRetryError:e=>this.canRetryErrorDefault(e)}}getRetryErrorResult(e){if(e.error&&e.error.message&&e.error.message.startsWith(this.requestCancelledMessagePrefix))return{canRetry:!1,retryInMs:0,maxRetries:0};if(!(e.retryStrategy.canRetryError?e.retryStrategy.canRetryError(e.error):this.defaultRetryStrategy.canRetryError(e.error)))return{canRetry:!1,retryInMs:0,maxRetries:0};const t=e.retryStrategy.maxAttempts??this.defaultRetryStrategy.maxAttempts;if(e.retryAttempt>=t)return{canRetry:!1,retryInMs:0,maxRetries:t};const r=this.tryGetRetryAfterInMsFromError(e.error);return r?{canRetry:!0,retryInMs:r,maxRetries:t}:{canRetry:!0,retryInMs:this.getNextWaitTimeMs(e.retryStrategy.addJitter??this.defaultRetryStrategy.addJitter,e.retryStrategy.deltaBackoffMs??this.defaultRetryStrategy.deltaBackoffMs,e.retryAttempt),maxRetries:t}}getRetryStrategyFromStrategyOptions(e){return e||this.defaultRetryStrategy}canRetryInTime(e,t){const r=e.getTime(),n=(new Date).getTime()-r;return{canRetry:n<t,differenceInMs:n}}getNextWaitTimeMs(e,t,r){if(!e)return t*Math.pow(2,r);const n=.8*t,s=1.2*t*Math.pow(2,r);return this.randomNumberFromInterval(n,s)}canRetryErrorDefault(e){if(!this.tryGetAxiosError(e))return!1;const t=this.getStatusCodeFromError(e),r=this.canRetryStatusCode(t,this.defaultRetryStatusCodes);return console.log("STATUS",t,r),!!r}tryGetRetryAfterInMsFromError(e){const t=this.tryGetAxiosError(e);if(!t||!t.response)return;const r=u(t.response).find((e=>e.header.toLowerCase()===this.retryAfterHeaderName.toLowerCase()));return r?1e3*+r.value:void 0}canRetryStatusCode(e,t){return t.includes(e)}getStatusCodeFromError(e){const t=this.tryGetAxiosError(e);return t&&t.response?t.response.status:0}tryGetAxiosError(e){if(!e)return;if(e.isAxiosError)return e;const t=e.originalError;return t&&t.isAxiosError?t:void 0}randomNumberFromInterval(e,t){return Math.floor(Math.random()*(t-e+1)+e)}}const f=new c;var p;!function(e){e.CustomParameter=class{constructor(e,t){if(this.name=e,this.value=t,!e)throw Error("Name of the custom parameter is not specified")}getParam(){return this.name}getParamValue(){return this.value}}}(p||(p={}));var l=r(669),d=r.n(l);class y{debugStartHttpRequest(){}debugSuccessHttpRequest(){}debugRetryHttpRequest(){}}const h=new y;async function m(e,t,r){const n=r?.retryStrategy??f.defaultRetryStrategy;return await S({retryAttempt:0,url:t.url,retryStrategy:n,call:async s=>{h.debugStartHttpRequest();const o=await e.get(t.url,{headers:A(r?.headers??[],!1),responseType:r?.responseType,cancelToken:r?.cancelToken?.token}),a={data:o.data,rawResponse:o,headers:u(o),status:o.status,retryStrategy:{options:n,retryAttempts:s}};return h.debugSuccessHttpRequest(),a}})}async function g(e,t,r){const n=r?.retryStrategy??f.defaultRetryStrategy;return await S({retryAttempt:0,url:t.url,retryStrategy:n,call:async s=>{h.debugStartHttpRequest();const o=await e.post(t.url,t.body,{headers:A(r?.headers??[],!1),responseType:r?.responseType,maxContentLength:"Infinity",maxBodyLength:"Infinity",cancelToken:r?.cancelToken?.token}),a={data:o.data,rawResponse:o,headers:u(o),status:o.status,retryStrategy:{options:n,retryAttempts:s}};return h.debugSuccessHttpRequest(),a}})}async function x(e,t,r){const n=r?.retryStrategy??f.defaultRetryStrategy;return await S({retryAttempt:0,url:t.url,retryStrategy:n,call:async s=>{h.debugStartHttpRequest();const o=await e.put(t.url,t.body,{headers:A(r?.headers??[],!1),responseType:r?.responseType,maxContentLength:"Infinity",maxBodyLength:"Infinity",cancelToken:r?.cancelToken?.token}),a={data:o.data,rawResponse:o,headers:u(o),status:o.status,retryStrategy:{options:n,retryAttempts:s}};return h.debugSuccessHttpRequest(),a}})}async function R(e,t,r){const n=r?.retryStrategy??f.defaultRetryStrategy;return await S({retryAttempt:0,url:t.url,retryStrategy:n,call:async s=>{h.debugStartHttpRequest();const o=await e.patch(t.url,t.body,{headers:A(r?.headers??[],!1),responseType:r?.responseType,maxContentLength:"Infinity",maxBodyLength:"Infinity",cancelToken:r?.cancelToken?.token}),a={data:o.data,rawResponse:o,headers:u(o),status:o.status,retryStrategy:{options:n,retryAttempts:s}};return h.debugSuccessHttpRequest(),a}})}async function v(e,t,r){const n=r?.retryStrategy??f.defaultRetryStrategy;return await S({retryAttempt:0,url:t.url,retryStrategy:n,call:async s=>{h.debugStartHttpRequest();const o=await e.delete(t.url,{headers:A(r?.headers??[],!1),responseType:r?.responseType,maxContentLength:"Infinity",maxBodyLength:"Infinity",cancelToken:r?.cancelToken?.token}),a={data:o.data,rawResponse:o,headers:u(o),status:o.status,retryStrategy:{options:n,retryAttempts:s}};return h.debugSuccessHttpRequest(),a}})}function w(){let e;return{cancel:t=>e(`${f.requestCancelledMessagePrefix}: ${t??"User cancel"}`),token:new(d().CancelToken)((t=>{e=t}))}}async function S(e){try{return await e.call(e.retryAttempt)}catch(t){const r=f.getRetryErrorResult({error:t,retryAttempt:e.retryAttempt,retryStrategy:e.retryStrategy});if(r.canRetry)return h.debugRetryHttpRequest(),await new Promise((e=>setTimeout(e,r.retryInMs))),console.warn(`Retry attempt '${e.retryAttempt+1}' from a maximum of '${r.maxRetries}' retries. Request url: '${e.url}'`),await S({call:e.call,retryStrategy:e.retryStrategy,retryAttempt:e.retryAttempt+1,url:e.url});throw console.error(`Executing '${e.url}' failed. Request was retried '${e.retryAttempt}' times. `,t),t}}function A(e,t){const r={};return e.forEach((e=>{r[e.header]=e.value})),t&&(e.find((e=>e.header.toLowerCase()==="Content-Type".toLowerCase()))||(r["Content-Type"]="application/json")),r}class b{constructor(e){this.axiosInstance=d().create(e?.axiosRequestConfig)}async getAsync(e,t){return await m(this.axiosInstance,e,t)}async postAsync(e,t){return await g(this.axiosInstance,e,t)}async putAsync(e,t){return await x(this.axiosInstance,e,t)}async patchAsync(e,t){return await R(this.axiosInstance,e,t)}async deleteAsync(e,t){return await v(this.axiosInstance,e,t)}createCancelToken(){return w()}}class C{constructor(e){this.response=void 0,this.error=void 0,Object.assign(this,e)}getAsync(e,t){return this.resolveTestCall()}postAsync(e,t){return this.resolveTestCall()}putAsync(e,t){return this.resolveTestCall()}patchAsync(e,t){return this.resolveTestCall()}deleteAsync(e,t){return this.resolveTestCall()}createCancelToken(){return{cancel:()=>{},token:void 0}}resolveTestCall(){return new Promise(((e,t)=>{throw this.response&&e(this.response),this.error&&t(this.error),Error("Missing test data")}))}}})(),n})()})); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("kontentCore",[],t):"object"==typeof exports?exports.kontentCore=t():e.kontentCore=t()}(self,(function(){return(()=>{var e={669:(e,t,r)=>{e.exports=r(609)},448:(e,t,r)=>{"use strict";var n=r(867),s=r(26),o=r(372),a=r(327),i=r(97),u=r(109),c=r(985),f=r(61);e.exports=function(e){return new Promise((function(t,r){var p=e.data,l=e.headers;n.isFormData(p)&&delete l["Content-Type"];var d=new XMLHttpRequest;if(e.auth){var y=e.auth.username||"",h=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";l.Authorization="Basic "+btoa(y+":"+h)}var m=i(e.baseURL,e.url);if(d.open(e.method.toUpperCase(),a(m,e.params,e.paramsSerializer),!0),d.timeout=e.timeout,d.onreadystatechange=function(){if(d&&4===d.readyState&&(0!==d.status||d.responseURL&&0===d.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in d?u(d.getAllResponseHeaders()):null,o={data:e.responseType&&"text"!==e.responseType?d.response:d.responseText,status:d.status,statusText:d.statusText,headers:n,config:e,request:d};s(t,r,o),d=null}},d.onabort=function(){d&&(r(f("Request aborted",e,"ECONNABORTED",d)),d=null)},d.onerror=function(){r(f("Network Error",e,null,d)),d=null},d.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(f(t,e,"ECONNABORTED",d)),d=null},n.isStandardBrowserEnv()){var g=(e.withCredentials||c(m))&&e.xsrfCookieName?o.read(e.xsrfCookieName):void 0;g&&(l[e.xsrfHeaderName]=g)}if("setRequestHeader"in d&&n.forEach(l,(function(e,t){void 0===p&&"content-type"===t.toLowerCase()?delete l[t]:d.setRequestHeader(t,e)})),n.isUndefined(e.withCredentials)||(d.withCredentials=!!e.withCredentials),e.responseType)try{d.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&d.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&d.upload&&d.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){d&&(d.abort(),r(e),d=null)})),p||(p=null),d.send(p)}))}},609:(e,t,r)=>{"use strict";var n=r(867),s=r(849),o=r(321),a=r(185);function i(e){var t=new o(e),r=s(o.prototype.request,t);return n.extend(r,o.prototype,t),n.extend(r,t),r}var u=i(r(655));u.Axios=o,u.create=function(e){return i(a(u.defaults,e))},u.Cancel=r(263),u.CancelToken=r(972),u.isCancel=r(502),u.all=function(e){return Promise.all(e)},u.spread=r(713),u.isAxiosError=r(268),e.exports=u,e.exports.default=u},263:e=>{"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},972:(e,t,r)=>{"use strict";var n=r(263);function s(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;e((function(e){r.reason||(r.reason=new n(e),t(r.reason))}))}s.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},s.source=function(){var e;return{token:new s((function(t){e=t})),cancel:e}},e.exports=s},502:e=>{"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},321:(e,t,r)=>{"use strict";var n=r(867),s=r(327),o=r(782),a=r(572),i=r(185);function u(e){this.defaults=e,this.interceptors={request:new o,response:new o}}u.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=i(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[a,void 0],r=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)r=r.then(t.shift(),t.shift());return r},u.prototype.getUri=function(e){return e=i(this.defaults,e),s(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},n.forEach(["delete","get","head","options"],(function(e){u.prototype[e]=function(t,r){return this.request(i(r||{},{method:e,url:t,data:(r||{}).data}))}})),n.forEach(["post","put","patch"],(function(e){u.prototype[e]=function(t,r,n){return this.request(i(n||{},{method:e,url:t,data:r}))}})),e.exports=u},782:(e,t,r)=>{"use strict";var n=r(867);function s(){this.handlers=[]}s.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},s.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},s.prototype.forEach=function(e){n.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=s},97:(e,t,r)=>{"use strict";var n=r(793),s=r(303);e.exports=function(e,t){return e&&!n(t)?s(e,t):t}},61:(e,t,r)=>{"use strict";var n=r(481);e.exports=function(e,t,r,s,o){var a=new Error(e);return n(a,t,r,s,o)}},572:(e,t,r)=>{"use strict";var n=r(867),s=r(527),o=r(502),a=r(655);function i(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return i(e),e.headers=e.headers||{},e.data=s(e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||a.adapter)(e).then((function(t){return i(e),t.data=s(t.data,t.headers,e.transformResponse),t}),(function(t){return o(t)||(i(e),t&&t.response&&(t.response.data=s(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},481:e=>{"use strict";e.exports=function(e,t,r,n,s){return e.config=t,r&&(e.code=r),e.request=n,e.response=s,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},185:(e,t,r)=>{"use strict";var n=r(867);e.exports=function(e,t){t=t||{};var r={},s=["url","method","data"],o=["headers","auth","proxy","params"],a=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],i=["validateStatus"];function u(e,t){return n.isPlainObject(e)&&n.isPlainObject(t)?n.merge(e,t):n.isPlainObject(t)?n.merge({},t):n.isArray(t)?t.slice():t}function c(s){n.isUndefined(t[s])?n.isUndefined(e[s])||(r[s]=u(void 0,e[s])):r[s]=u(e[s],t[s])}n.forEach(s,(function(e){n.isUndefined(t[e])||(r[e]=u(void 0,t[e]))})),n.forEach(o,c),n.forEach(a,(function(s){n.isUndefined(t[s])?n.isUndefined(e[s])||(r[s]=u(void 0,e[s])):r[s]=u(void 0,t[s])})),n.forEach(i,(function(n){n in t?r[n]=u(e[n],t[n]):n in e&&(r[n]=u(void 0,e[n]))}));var f=s.concat(o).concat(a).concat(i),p=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===f.indexOf(e)}));return n.forEach(p,c),r}},26:(e,t,r)=>{"use strict";var n=r(61);e.exports=function(e,t,r){var s=r.config.validateStatus;r.status&&s&&!s(r.status)?t(n("Request failed with status code "+r.status,r.config,null,r.request,r)):e(r)}},527:(e,t,r)=>{"use strict";var n=r(867);e.exports=function(e,t,r){return n.forEach(r,(function(r){e=r(e,t)})),e}},655:(e,t,r)=>{"use strict";var n=r(867),s=r(16),o={"Content-Type":"application/x-www-form-urlencoded"};function a(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var i,u={adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(i=r(448)),i),transformRequest:[function(e,t){return s(t,"Accept"),s(t,"Content-Type"),n.isFormData(e)||n.isArrayBuffer(e)||n.isBuffer(e)||n.isStream(e)||n.isFile(e)||n.isBlob(e)?e:n.isArrayBufferView(e)?e.buffer:n.isURLSearchParams(e)?(a(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):n.isObject(e)?(a(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],(function(e){u.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){u.headers[e]=n.merge(o)})),e.exports=u},849:e=>{"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}}},327:(e,t,r)=>{"use strict";var n=r(867);function s(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,r){if(!t)return e;var o;if(r)o=r(t);else if(n.isURLSearchParams(t))o=t.toString();else{var a=[];n.forEach(t,(function(e,t){null!=e&&(n.isArray(e)?t+="[]":e=[e],n.forEach(e,(function(e){n.isDate(e)?e=e.toISOString():n.isObject(e)&&(e=JSON.stringify(e)),a.push(s(t)+"="+s(e))})))})),o=a.join("&")}if(o){var i=e.indexOf("#");-1!==i&&(e=e.slice(0,i)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}},303:e=>{"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},372:(e,t,r)=>{"use strict";var n=r(867);e.exports=n.isStandardBrowserEnv()?{write:function(e,t,r,s,o,a){var i=[];i.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&i.push("expires="+new Date(r).toGMTString()),n.isString(s)&&i.push("path="+s),n.isString(o)&&i.push("domain="+o),!0===a&&i.push("secure"),document.cookie=i.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},793:e=>{"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},268:e=>{"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},985:(e,t,r)=>{"use strict";var n=r(867);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function s(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=s(window.location.href),function(t){var r=n.isString(t)?s(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},16:(e,t,r)=>{"use strict";var n=r(867);e.exports=function(e,t){n.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))}},109:(e,t,r)=>{"use strict";var n=r(867),s=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,r,o,a={};return e?(n.forEach(e.split("\n"),(function(e){if(o=e.indexOf(":"),t=n.trim(e.substr(0,o)).toLowerCase(),r=n.trim(e.substr(o+1)),t){if(a[t]&&s.indexOf(t)>=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([r]):a[t]?a[t]+", "+r:r}})),a):a}},713:e=>{"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},867:(e,t,r)=>{"use strict";var n=r(849),s=Object.prototype.toString;function o(e){return"[object Array]"===s.call(e)}function a(e){return void 0===e}function i(e){return null!==e&&"object"==typeof e}function u(e){if("[object Object]"!==s.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function c(e){return"[object Function]"===s.call(e)}function f(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),o(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.call(null,e[s],s,e)}e.exports={isArray:o,isArrayBuffer:function(e){return"[object ArrayBuffer]"===s.call(e)},isBuffer:function(e){return null!==e&&!a(e)&&null!==e.constructor&&!a(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:i,isPlainObject:u,isUndefined:a,isDate:function(e){return"[object Date]"===s.call(e)},isFile:function(e){return"[object File]"===s.call(e)},isBlob:function(e){return"[object Blob]"===s.call(e)},isFunction:c,isStream:function(e){return i(e)&&c(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:f,merge:function e(){var t={};function r(r,n){u(t[n])&&u(r)?t[n]=e(t[n],r):u(r)?t[n]=e({},r):o(r)?t[n]=r.slice():t[n]=r}for(var n=0,s=arguments.length;n<s;n++)f(arguments[n],r);return t},extend:function(e,t,r){return f(t,(function(t,s){e[s]=r&&"function"==typeof t?n(t,r):t})),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}}},t={};function r(n){var s=t[n];if(void 0!==s)return s.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{EnumHelper:()=>a,HeaderHelper:()=>s,HttpDebugger:()=>y,HttpService:()=>b,Parameters:()=>p,RetryHelper:()=>c,TestHttpService:()=>C,UrlHelper:()=>e,createCancelToken:()=>w,deletehWithRetryAsync:()=>R,enumHelper:()=>i,extractHeadersFromAxiosResponse:()=>u,getWithRetryAsync:()=>m,headerHelper:()=>o,httpDebugger:()=>h,patchWithRetryAsync:()=>v,postWithRetryAsync:()=>g,putWithRetryAsync:()=>x,retryHelper:()=>f,urlHelper:()=>t});class e{addOptionsToUrl(e,t){return t&&t.forEach((t=>{e.indexOf("?")>-1?e+="&":e+="?",e+=t.getParam()})),e}}const t=new e;class s{sdkVersionHeader="X-KC-SDKID";getSdkIdHeader(e){return{header:this.sdkVersionHeader,value:`${e.host};${e.name};${e.version}`}}}const o=new s;class a{getAllNames(e){const t=[];for(const r in e)e.hasOwnProperty(r)&&t.push(r);return t}getAllValues(e){return Object.keys(e).map((t=>e[t]))}getEnumFromValue(e,t){try{if(!t)return;if(this.isNumeric(t))return e[t];const r=this.getAllValues(e).find((e=>e.toLowerCase()===t.toString().toLowerCase()));if(!r)return;return r}catch(e){return}}getEnumFromName(e,t){const r=this.getAllNames(e);for(const n of r)if(n.toLowerCase()===t.toLowerCase())return e[n]}isNumeric(e){return!isNaN(parseFloat(e))&&isFinite(e)}}const i=new a;function u(e){const t=[];for(const r of Object.keys(e.headers))t.push({header:r,value:e.headers[r]});return t}class c{requestCancelledMessagePrefix="Request cancelled";retryAfterHeaderName="Retry-After";defaultRetryStatusCodes=[408,429,500,502,503,504];defaultRetryStrategy={addJitter:!0,deltaBackoffMs:1e3,maxAttempts:5,canRetryError:e=>this.canRetryErrorDefault(e)};getRetryErrorResult(e){if(e.error&&e.error.message&&e.error.message.startsWith(this.requestCancelledMessagePrefix))return{canRetry:!1,retryInMs:0,maxRetries:0};if(!(e.retryStrategy.canRetryError?e.retryStrategy.canRetryError(e.error):this.defaultRetryStrategy.canRetryError(e.error)))return{canRetry:!1,retryInMs:0,maxRetries:0};const t=e.retryStrategy.maxAttempts??this.defaultRetryStrategy.maxAttempts;if(e.retryAttempt>=t)return{canRetry:!1,retryInMs:0,maxRetries:t};const r=this.tryGetRetryAfterInMsFromError(e.error);return r?{canRetry:!0,retryInMs:r,maxRetries:t}:{canRetry:!0,retryInMs:this.getNextWaitTimeMs(e.retryStrategy.addJitter??this.defaultRetryStrategy.addJitter,e.retryStrategy.deltaBackoffMs??this.defaultRetryStrategy.deltaBackoffMs,e.retryAttempt),maxRetries:t}}getRetryStrategyFromStrategyOptions(e){return e||this.defaultRetryStrategy}canRetryInTime(e,t){const r=e.getTime(),n=(new Date).getTime()-r;return{canRetry:n<t,differenceInMs:n}}getNextWaitTimeMs(e,t,r){if(!e)return t*Math.pow(2,r);const n=.8*t,s=1.2*t*Math.pow(2,r);return this.randomNumberFromInterval(n,s)}canRetryErrorDefault(e){if(!this.tryGetAxiosError(e))return!1;const t=this.getStatusCodeFromError(e);return!!this.canRetryStatusCode(t,this.defaultRetryStatusCodes)}tryGetRetryAfterInMsFromError(e){const t=this.tryGetAxiosError(e);if(!t||!t.response)return;const r=u(t.response).find((e=>e.header.toLowerCase()===this.retryAfterHeaderName.toLowerCase()));return r?1e3*+r.value:void 0}canRetryStatusCode(e,t){return t.includes(e)}getStatusCodeFromError(e){const t=this.tryGetAxiosError(e);return t&&t.response?t.response.status:0}tryGetAxiosError(e){if(!e)return;if(e.isAxiosError)return e;const t=e.originalError;return t&&t.isAxiosError?t:void 0}randomNumberFromInterval(e,t){return Math.floor(Math.random()*(t-e+1)+e)}}const f=new c;var p;!function(e){e.CustomParameter=class{name;value;constructor(e,t){if(this.name=e,this.value=t,!e)throw Error("Name of the custom parameter is not specified")}getParam(){return this.name}getParamValue(){return this.value}}}(p||(p={}));var l=r(669),d=r.n(l);class y{debugStartHttpRequest(){}debugSuccessHttpRequest(){}debugRetryHttpRequest(){}}const h=new y;async function m(e,t,r){const n=r?.retryStrategy??f.defaultRetryStrategy;return await S({retryAttempt:0,url:t.url,retryStrategy:n,call:async s=>{h.debugStartHttpRequest();const o=await e.get(t.url,{headers:A(r?.headers??[],!1),responseType:r?.responseType,cancelToken:r?.cancelToken?.token}),a={data:o.data,rawResponse:o,headers:u(o),status:o.status,retryStrategy:{options:n,retryAttempts:s}};return h.debugSuccessHttpRequest(),a}})}async function g(e,t,r){const n=r?.retryStrategy??f.defaultRetryStrategy;return await S({retryAttempt:0,url:t.url,retryStrategy:n,call:async s=>{h.debugStartHttpRequest();const o=await e.post(t.url,t.body,{headers:A(r?.headers??[],!1),responseType:r?.responseType,maxContentLength:"Infinity",maxBodyLength:"Infinity",cancelToken:r?.cancelToken?.token}),a={data:o.data,rawResponse:o,headers:u(o),status:o.status,retryStrategy:{options:n,retryAttempts:s}};return h.debugSuccessHttpRequest(),a}})}async function x(e,t,r){const n=r?.retryStrategy??f.defaultRetryStrategy;return await S({retryAttempt:0,url:t.url,retryStrategy:n,call:async s=>{h.debugStartHttpRequest();const o=await e.put(t.url,t.body,{headers:A(r?.headers??[],!1),responseType:r?.responseType,maxContentLength:"Infinity",maxBodyLength:"Infinity",cancelToken:r?.cancelToken?.token}),a={data:o.data,rawResponse:o,headers:u(o),status:o.status,retryStrategy:{options:n,retryAttempts:s}};return h.debugSuccessHttpRequest(),a}})}async function v(e,t,r){const n=r?.retryStrategy??f.defaultRetryStrategy;return await S({retryAttempt:0,url:t.url,retryStrategy:n,call:async s=>{h.debugStartHttpRequest();const o=await e.patch(t.url,t.body,{headers:A(r?.headers??[],!1),responseType:r?.responseType,maxContentLength:"Infinity",maxBodyLength:"Infinity",cancelToken:r?.cancelToken?.token}),a={data:o.data,rawResponse:o,headers:u(o),status:o.status,retryStrategy:{options:n,retryAttempts:s}};return h.debugSuccessHttpRequest(),a}})}async function R(e,t,r){const n=r?.retryStrategy??f.defaultRetryStrategy;return await S({retryAttempt:0,url:t.url,retryStrategy:n,call:async s=>{h.debugStartHttpRequest();const o=await e.delete(t.url,{headers:A(r?.headers??[],!1),responseType:r?.responseType,maxContentLength:"Infinity",maxBodyLength:"Infinity",cancelToken:r?.cancelToken?.token}),a={data:o.data,rawResponse:o,headers:u(o),status:o.status,retryStrategy:{options:n,retryAttempts:s}};return h.debugSuccessHttpRequest(),a}})}function w(){let e;return{cancel:t=>e(`${f.requestCancelledMessagePrefix}: ${t??"User cancel"}`),token:new(d().CancelToken)((t=>{e=t}))}}async function S(e){try{return await e.call(e.retryAttempt)}catch(t){const r=f.getRetryErrorResult({error:t,retryAttempt:e.retryAttempt,retryStrategy:e.retryStrategy});if(r.canRetry)return h.debugRetryHttpRequest(),await new Promise((e=>setTimeout(e,r.retryInMs))),console.warn(`Retry attempt '${e.retryAttempt+1}' from a maximum of '${r.maxRetries}' retries. Request url: '${e.url}'`),await S({call:e.call,retryStrategy:e.retryStrategy,retryAttempt:e.retryAttempt+1,url:e.url});throw console.error(`Executing '${e.url}' failed. Request was retried '${e.retryAttempt}' times. `,t),t}}function A(e,t){const r={};return e.forEach((e=>{r[e.header]=e.value})),t&&(e.find((e=>e.header.toLowerCase()==="Content-Type".toLowerCase()))||(r["Content-Type"]="application/json")),r}class b{axiosInstance;constructor(e){this.axiosInstance=d().create(e?.axiosRequestConfig)}async getAsync(e,t){return await m(this.axiosInstance,e,t)}async postAsync(e,t){return await g(this.axiosInstance,e,t)}async putAsync(e,t){return await x(this.axiosInstance,e,t)}async patchAsync(e,t){return await v(this.axiosInstance,e,t)}async deleteAsync(e,t){return await R(this.axiosInstance,e,t)}createCancelToken(){return w()}}class C{response=void 0;error=void 0;constructor(e){Object.assign(this,e)}getAsync(e,t){return this.resolveTestCall()}postAsync(e,t){return this.resolveTestCall()}putAsync(e,t){return this.resolveTestCall()}patchAsync(e,t){return this.resolveTestCall()}deleteAsync(e,t){return this.resolveTestCall()}createCancelToken(){return{cancel:()=>{},token:void 0}}resolveTestCall(){return new Promise(((e,t)=>{throw this.response&&e(this.response),this.error&&t(this.error),Error("Missing test data")}))}}})(),n})()})); | ||
//# sourceMappingURL=kontent-core.umd.min.js.map |
@@ -1,1 +0,1 @@ | ||
[{"label":"kontent-core.umd.js","isAsset":true,"statSize":63354,"parsedSize":94860,"gzipSize":17497,"groups":[{"label":"lib","path":"./lib","statSize":21112,"groups":[{"label":"helpers","path":"./lib/helpers","statSize":8526,"groups":[{"id":"./lib/helpers/enum.helper.ts","label":"enum.helper.ts","path":"./lib/helpers/enum.helper.ts","statSize":1503},{"id":"./lib/helpers/header.helper.ts","label":"header.helper.ts","path":"./lib/helpers/header.helper.ts","statSize":486},{"id":"./lib/helpers/headers-helper.ts","label":"headers-helper.ts","path":"./lib/helpers/headers-helper.ts","statSize":296},{"id":"./lib/helpers/index.ts","label":"index.ts","path":"./lib/helpers/index.ts","statSize":165},{"id":"./lib/helpers/retry-helper.ts","label":"retry-helper.ts","path":"./lib/helpers/retry-helper.ts","statSize":5475},{"id":"./lib/helpers/url.helper.ts","label":"url.helper.ts","path":"./lib/helpers/url.helper.ts","statSize":601}],"parsedSize":0,"gzipSize":0},{"label":"http","path":"./lib/http","statSize":11636,"groups":[{"id":"./lib/http/http.debugger.ts","label":"http.debugger.ts","path":"./lib/http/http.debugger.ts","statSize":375},{"id":"./lib/http/http.functions.ts","label":"http.functions.ts","path":"./lib/http/http.functions.ts","statSize":9002},{"id":"./lib/http/http.models.ts","label":"http.models.ts","path":"./lib/http/http.models.ts","statSize":12},{"id":"./lib/http/http.service.ts","label":"http.service.ts","path":"./lib/http/http.service.ts","statSize":981},{"id":"./lib/http/ihttp.service.ts","label":"ihttp.service.ts","path":"./lib/http/ihttp.service.ts","statSize":12},{"id":"./lib/http/index.ts","label":"index.ts","path":"./lib/http/index.ts","statSize":206},{"id":"./lib/http/test-http.service.ts","label":"test-http.service.ts","path":"./lib/http/test-http.service.ts","statSize":1048}],"parsedSize":0,"gzipSize":0},{"id":"./lib/index.ts","label":"index.ts","path":"./lib/index.ts","statSize":98,"parsedSize":94860,"gzipSize":17497},{"label":"models","path":"./lib/models","statSize":852,"groups":[{"id":"./lib/models/index.ts","label":"index.ts","path":"./lib/models/index.ts","statSize":92},{"id":"./lib/models/isdk-info.ts","label":"isdk-info.ts","path":"./lib/models/isdk-info.ts","statSize":12},{"id":"./lib/models/parameters.ts","label":"parameters.ts","path":"./lib/models/parameters.ts","statSize":736},{"id":"./lib/models/url.models.ts","label":"url.models.ts","path":"./lib/models/url.models.ts","statSize":12}],"parsedSize":0,"gzipSize":0}],"parsedSize":94860,"gzipSize":17497},{"label":"node_modules/axios","path":"./node_modules/axios","statSize":42242,"groups":[{"id":"./node_modules/axios/index.js","label":"index.js","path":"./node_modules/axios/index.js","statSize":40},{"label":"lib","path":"./node_modules/axios/lib","statSize":42202,"groups":[{"label":"adapters","path":"./node_modules/axios/lib/adapters","statSize":5869,"groups":[{"id":"./node_modules/axios/lib/adapters/xhr.js","label":"xhr.js","path":"./node_modules/axios/lib/adapters/xhr.js","statSize":5869}],"parsedSize":0,"gzipSize":0},{"id":"./node_modules/axios/lib/axios.js","label":"axios.js","path":"./node_modules/axios/lib/axios.js","statSize":1503},{"label":"cancel","path":"./node_modules/axios/lib/cancel","statSize":1727,"groups":[{"id":"./node_modules/axios/lib/cancel/Cancel.js","label":"Cancel.js","path":"./node_modules/axios/lib/cancel/Cancel.js","statSize":385},{"id":"./node_modules/axios/lib/cancel/CancelToken.js","label":"CancelToken.js","path":"./node_modules/axios/lib/cancel/CancelToken.js","statSize":1240},{"id":"./node_modules/axios/lib/cancel/isCancel.js","label":"isCancel.js","path":"./node_modules/axios/lib/cancel/isCancel.js","statSize":102}],"parsedSize":0,"gzipSize":0},{"label":"core","path":"./node_modules/axios/lib/core","statSize":12353,"groups":[{"id":"./node_modules/axios/lib/core/Axios.js","label":"Axios.js","path":"./node_modules/axios/lib/core/Axios.js","statSize":2648},{"id":"./node_modules/axios/lib/core/InterceptorManager.js","label":"InterceptorManager.js","path":"./node_modules/axios/lib/core/InterceptorManager.js","statSize":1251},{"id":"./node_modules/axios/lib/core/buildFullPath.js","label":"buildFullPath.js","path":"./node_modules/axios/lib/core/buildFullPath.js","statSize":695},{"id":"./node_modules/axios/lib/core/createError.js","label":"createError.js","path":"./node_modules/axios/lib/core/createError.js","statSize":625},{"id":"./node_modules/axios/lib/core/dispatchRequest.js","label":"dispatchRequest.js","path":"./node_modules/axios/lib/core/dispatchRequest.js","statSize":1934},{"id":"./node_modules/axios/lib/core/enhanceError.js","label":"enhanceError.js","path":"./node_modules/axios/lib/core/enhanceError.js","statSize":1049},{"id":"./node_modules/axios/lib/core/mergeConfig.js","label":"mergeConfig.js","path":"./node_modules/axios/lib/core/mergeConfig.js","statSize":2895},{"id":"./node_modules/axios/lib/core/settle.js","label":"settle.js","path":"./node_modules/axios/lib/core/settle.js","statSize":706},{"id":"./node_modules/axios/lib/core/transformData.js","label":"transformData.js","path":"./node_modules/axios/lib/core/transformData.js","statSize":550}],"parsedSize":0,"gzipSize":0},{"id":"./node_modules/axios/lib/defaults.js","label":"defaults.js","path":"./node_modules/axios/lib/defaults.js","statSize":2563},{"label":"helpers","path":"./node_modules/axios/lib/helpers","statSize":9240,"groups":[{"id":"./node_modules/axios/lib/helpers/bind.js","label":"bind.js","path":"./node_modules/axios/lib/helpers/bind.js","statSize":256},{"id":"./node_modules/axios/lib/helpers/buildURL.js","label":"buildURL.js","path":"./node_modules/axios/lib/helpers/buildURL.js","statSize":1644},{"id":"./node_modules/axios/lib/helpers/combineURLs.js","label":"combineURLs.js","path":"./node_modules/axios/lib/helpers/combineURLs.js","statSize":380},{"id":"./node_modules/axios/lib/helpers/cookies.js","label":"cookies.js","path":"./node_modules/axios/lib/helpers/cookies.js","statSize":1435},{"id":"./node_modules/axios/lib/helpers/isAbsoluteURL.js","label":"isAbsoluteURL.js","path":"./node_modules/axios/lib/helpers/isAbsoluteURL.js","statSize":563},{"id":"./node_modules/axios/lib/helpers/isAxiosError.js","label":"isAxiosError.js","path":"./node_modules/axios/lib/helpers/isAxiosError.js","statSize":343},{"id":"./node_modules/axios/lib/helpers/isURLSameOrigin.js","label":"isURLSameOrigin.js","path":"./node_modules/axios/lib/helpers/isURLSameOrigin.js","statSize":2305},{"id":"./node_modules/axios/lib/helpers/normalizeHeaderName.js","label":"normalizeHeaderName.js","path":"./node_modules/axios/lib/helpers/normalizeHeaderName.js","statSize":357},{"id":"./node_modules/axios/lib/helpers/parseHeaders.js","label":"parseHeaders.js","path":"./node_modules/axios/lib/helpers/parseHeaders.js","statSize":1393},{"id":"./node_modules/axios/lib/helpers/spread.js","label":"spread.js","path":"./node_modules/axios/lib/helpers/spread.js","statSize":564}],"parsedSize":0,"gzipSize":0},{"id":"./node_modules/axios/lib/utils.js","label":"utils.js","path":"./node_modules/axios/lib/utils.js","statSize":8947}],"parsedSize":0,"gzipSize":0}],"parsedSize":0,"gzipSize":0}]}] | ||
[{"label":"kontent-core.umd.js","isAsset":true,"statSize":63190,"parsedSize":94696,"gzipSize":17490,"groups":[{"label":"lib","path":"./lib","statSize":20948,"groups":[{"label":"helpers","path":"./lib/helpers","statSize":8329,"groups":[{"id":"./lib/helpers/enum.helper.ts","label":"enum.helper.ts","path":"./lib/helpers/enum.helper.ts","statSize":1503},{"id":"./lib/helpers/header.helper.ts","label":"header.helper.ts","path":"./lib/helpers/header.helper.ts","statSize":437},{"id":"./lib/helpers/headers-helper.ts","label":"headers-helper.ts","path":"./lib/helpers/headers-helper.ts","statSize":296},{"id":"./lib/helpers/index.ts","label":"index.ts","path":"./lib/helpers/index.ts","statSize":165},{"id":"./lib/helpers/retry-helper.ts","label":"retry-helper.ts","path":"./lib/helpers/retry-helper.ts","statSize":5327},{"id":"./lib/helpers/url.helper.ts","label":"url.helper.ts","path":"./lib/helpers/url.helper.ts","statSize":601}],"parsedSize":0,"gzipSize":0},{"label":"http","path":"./lib/http","statSize":11638,"groups":[{"id":"./lib/http/http.debugger.ts","label":"http.debugger.ts","path":"./lib/http/http.debugger.ts","statSize":375},{"id":"./lib/http/http.functions.ts","label":"http.functions.ts","path":"./lib/http/http.functions.ts","statSize":9002},{"id":"./lib/http/http.models.ts","label":"http.models.ts","path":"./lib/http/http.models.ts","statSize":12},{"id":"./lib/http/http.service.ts","label":"http.service.ts","path":"./lib/http/http.service.ts","statSize":1001},{"id":"./lib/http/ihttp.service.ts","label":"ihttp.service.ts","path":"./lib/http/ihttp.service.ts","statSize":12},{"id":"./lib/http/index.ts","label":"index.ts","path":"./lib/http/index.ts","statSize":206},{"id":"./lib/http/test-http.service.ts","label":"test-http.service.ts","path":"./lib/http/test-http.service.ts","statSize":1030}],"parsedSize":0,"gzipSize":0},{"id":"./lib/index.ts","label":"index.ts","path":"./lib/index.ts","statSize":98,"parsedSize":94696,"gzipSize":17490},{"label":"models","path":"./lib/models","statSize":883,"groups":[{"id":"./lib/models/index.ts","label":"index.ts","path":"./lib/models/index.ts","statSize":92},{"id":"./lib/models/isdk-info.ts","label":"isdk-info.ts","path":"./lib/models/isdk-info.ts","statSize":12},{"id":"./lib/models/parameters.ts","label":"parameters.ts","path":"./lib/models/parameters.ts","statSize":767},{"id":"./lib/models/url.models.ts","label":"url.models.ts","path":"./lib/models/url.models.ts","statSize":12}],"parsedSize":0,"gzipSize":0}],"parsedSize":94696,"gzipSize":17490},{"label":"node_modules/axios","path":"./node_modules/axios","statSize":42242,"groups":[{"id":"./node_modules/axios/index.js","label":"index.js","path":"./node_modules/axios/index.js","statSize":40},{"label":"lib","path":"./node_modules/axios/lib","statSize":42202,"groups":[{"label":"adapters","path":"./node_modules/axios/lib/adapters","statSize":5869,"groups":[{"id":"./node_modules/axios/lib/adapters/xhr.js","label":"xhr.js","path":"./node_modules/axios/lib/adapters/xhr.js","statSize":5869}],"parsedSize":0,"gzipSize":0},{"id":"./node_modules/axios/lib/axios.js","label":"axios.js","path":"./node_modules/axios/lib/axios.js","statSize":1503},{"label":"cancel","path":"./node_modules/axios/lib/cancel","statSize":1727,"groups":[{"id":"./node_modules/axios/lib/cancel/Cancel.js","label":"Cancel.js","path":"./node_modules/axios/lib/cancel/Cancel.js","statSize":385},{"id":"./node_modules/axios/lib/cancel/CancelToken.js","label":"CancelToken.js","path":"./node_modules/axios/lib/cancel/CancelToken.js","statSize":1240},{"id":"./node_modules/axios/lib/cancel/isCancel.js","label":"isCancel.js","path":"./node_modules/axios/lib/cancel/isCancel.js","statSize":102}],"parsedSize":0,"gzipSize":0},{"label":"core","path":"./node_modules/axios/lib/core","statSize":12353,"groups":[{"id":"./node_modules/axios/lib/core/Axios.js","label":"Axios.js","path":"./node_modules/axios/lib/core/Axios.js","statSize":2648},{"id":"./node_modules/axios/lib/core/InterceptorManager.js","label":"InterceptorManager.js","path":"./node_modules/axios/lib/core/InterceptorManager.js","statSize":1251},{"id":"./node_modules/axios/lib/core/buildFullPath.js","label":"buildFullPath.js","path":"./node_modules/axios/lib/core/buildFullPath.js","statSize":695},{"id":"./node_modules/axios/lib/core/createError.js","label":"createError.js","path":"./node_modules/axios/lib/core/createError.js","statSize":625},{"id":"./node_modules/axios/lib/core/dispatchRequest.js","label":"dispatchRequest.js","path":"./node_modules/axios/lib/core/dispatchRequest.js","statSize":1934},{"id":"./node_modules/axios/lib/core/enhanceError.js","label":"enhanceError.js","path":"./node_modules/axios/lib/core/enhanceError.js","statSize":1049},{"id":"./node_modules/axios/lib/core/mergeConfig.js","label":"mergeConfig.js","path":"./node_modules/axios/lib/core/mergeConfig.js","statSize":2895},{"id":"./node_modules/axios/lib/core/settle.js","label":"settle.js","path":"./node_modules/axios/lib/core/settle.js","statSize":706},{"id":"./node_modules/axios/lib/core/transformData.js","label":"transformData.js","path":"./node_modules/axios/lib/core/transformData.js","statSize":550}],"parsedSize":0,"gzipSize":0},{"id":"./node_modules/axios/lib/defaults.js","label":"defaults.js","path":"./node_modules/axios/lib/defaults.js","statSize":2563},{"label":"helpers","path":"./node_modules/axios/lib/helpers","statSize":9240,"groups":[{"id":"./node_modules/axios/lib/helpers/bind.js","label":"bind.js","path":"./node_modules/axios/lib/helpers/bind.js","statSize":256},{"id":"./node_modules/axios/lib/helpers/buildURL.js","label":"buildURL.js","path":"./node_modules/axios/lib/helpers/buildURL.js","statSize":1644},{"id":"./node_modules/axios/lib/helpers/combineURLs.js","label":"combineURLs.js","path":"./node_modules/axios/lib/helpers/combineURLs.js","statSize":380},{"id":"./node_modules/axios/lib/helpers/cookies.js","label":"cookies.js","path":"./node_modules/axios/lib/helpers/cookies.js","statSize":1435},{"id":"./node_modules/axios/lib/helpers/isAbsoluteURL.js","label":"isAbsoluteURL.js","path":"./node_modules/axios/lib/helpers/isAbsoluteURL.js","statSize":563},{"id":"./node_modules/axios/lib/helpers/isAxiosError.js","label":"isAxiosError.js","path":"./node_modules/axios/lib/helpers/isAxiosError.js","statSize":343},{"id":"./node_modules/axios/lib/helpers/isURLSameOrigin.js","label":"isURLSameOrigin.js","path":"./node_modules/axios/lib/helpers/isURLSameOrigin.js","statSize":2305},{"id":"./node_modules/axios/lib/helpers/normalizeHeaderName.js","label":"normalizeHeaderName.js","path":"./node_modules/axios/lib/helpers/normalizeHeaderName.js","statSize":357},{"id":"./node_modules/axios/lib/helpers/parseHeaders.js","label":"parseHeaders.js","path":"./node_modules/axios/lib/helpers/parseHeaders.js","statSize":1393},{"id":"./node_modules/axios/lib/helpers/spread.js","label":"spread.js","path":"./node_modules/axios/lib/helpers/spread.js","statSize":564}],"parsedSize":0,"gzipSize":0},{"id":"./node_modules/axios/lib/utils.js","label":"utils.js","path":"./node_modules/axios/lib/utils.js","statSize":8947}],"parsedSize":0,"gzipSize":0}],"parsedSize":0,"gzipSize":0}]}] |
@@ -1,1 +0,1 @@ | ||
[{"label":"kontent-core.umd.min.js","isAsset":true,"statSize":63306,"parsedSize":22598,"gzipSize":7127,"groups":[{"label":"lib","path":"./lib","statSize":21064,"groups":[{"id":208,"label":"index.ts + 13 modules (concatenated)","path":"./lib/index.ts + 13 modules (concatenated)","statSize":21064,"parsedSize":22598,"gzipSize":7127,"concatenated":true,"groups":[{"label":"lib","path":"./lib/index.ts + 13 modules (concatenated)/lib","statSize":21064,"groups":[{"id":null,"label":"index.ts","path":"./lib/index.ts + 13 modules (concatenated)/lib/index.ts","statSize":98,"parsedSize":105,"gzipSize":33,"inaccurateSizes":true},{"label":"helpers","path":"./lib/index.ts + 13 modules (concatenated)/lib/helpers","statSize":8526,"groups":[{"id":null,"label":"index.ts","path":"./lib/index.ts + 13 modules (concatenated)/lib/helpers/index.ts","statSize":165,"parsedSize":177,"gzipSize":55,"inaccurateSizes":true},{"id":null,"label":"url.helper.ts","path":"./lib/index.ts + 13 modules (concatenated)/lib/helpers/url.helper.ts","statSize":601,"parsedSize":644,"gzipSize":203,"inaccurateSizes":true},{"id":null,"label":"header.helper.ts","path":"./lib/index.ts + 13 modules (concatenated)/lib/helpers/header.helper.ts","statSize":486,"parsedSize":521,"gzipSize":164,"inaccurateSizes":true},{"id":null,"label":"enum.helper.ts","path":"./lib/index.ts + 13 modules (concatenated)/lib/helpers/enum.helper.ts","statSize":1503,"parsedSize":1612,"gzipSize":508,"inaccurateSizes":true},{"id":null,"label":"retry-helper.ts","path":"./lib/index.ts + 13 modules (concatenated)/lib/helpers/retry-helper.ts","statSize":5475,"parsedSize":5873,"gzipSize":1852,"inaccurateSizes":true},{"id":null,"label":"headers-helper.ts","path":"./lib/index.ts + 13 modules (concatenated)/lib/helpers/headers-helper.ts","statSize":296,"parsedSize":317,"gzipSize":100,"inaccurateSizes":true}],"parsedSize":9146,"gzipSize":2884,"inaccurateSizes":true},{"label":"models","path":"./lib/index.ts + 13 modules (concatenated)/lib/models","statSize":828,"groups":[{"id":null,"label":"index.ts","path":"./lib/index.ts + 13 modules (concatenated)/lib/models/index.ts","statSize":92,"parsedSize":98,"gzipSize":31,"inaccurateSizes":true},{"id":null,"label":"parameters.ts","path":"./lib/index.ts + 13 modules (concatenated)/lib/models/parameters.ts","statSize":736,"parsedSize":789,"gzipSize":249,"inaccurateSizes":true}],"parsedSize":888,"gzipSize":280,"inaccurateSizes":true},{"label":"http","path":"./lib/index.ts + 13 modules (concatenated)/lib/http","statSize":11612,"groups":[{"id":null,"label":"index.ts","path":"./lib/index.ts + 13 modules (concatenated)/lib/http/index.ts","statSize":206,"parsedSize":221,"gzipSize":69,"inaccurateSizes":true},{"id":null,"label":"http.service.ts","path":"./lib/index.ts + 13 modules (concatenated)/lib/http/http.service.ts","statSize":981,"parsedSize":1052,"gzipSize":331,"inaccurateSizes":true},{"id":null,"label":"http.functions.ts","path":"./lib/index.ts + 13 modules (concatenated)/lib/http/http.functions.ts","statSize":9002,"parsedSize":9657,"gzipSize":3045,"inaccurateSizes":true},{"id":null,"label":"http.debugger.ts","path":"./lib/index.ts + 13 modules (concatenated)/lib/http/http.debugger.ts","statSize":375,"parsedSize":402,"gzipSize":126,"inaccurateSizes":true},{"id":null,"label":"test-http.service.ts","path":"./lib/index.ts + 13 modules (concatenated)/lib/http/test-http.service.ts","statSize":1048,"parsedSize":1124,"gzipSize":354,"inaccurateSizes":true}],"parsedSize":12457,"gzipSize":3928,"inaccurateSizes":true}],"parsedSize":22598,"gzipSize":7127,"inaccurateSizes":true}]}],"parsedSize":22598,"gzipSize":7127},{"label":"node_modules/axios","path":"./node_modules/axios","statSize":42242,"groups":[{"id":669,"label":"index.js","path":"./node_modules/axios/index.js","statSize":40},{"label":"lib","path":"./node_modules/axios/lib","statSize":42202,"groups":[{"label":"adapters","path":"./node_modules/axios/lib/adapters","statSize":5869,"groups":[{"id":448,"label":"xhr.js","path":"./node_modules/axios/lib/adapters/xhr.js","statSize":5869}],"parsedSize":0,"gzipSize":0},{"id":609,"label":"axios.js","path":"./node_modules/axios/lib/axios.js","statSize":1503},{"label":"cancel","path":"./node_modules/axios/lib/cancel","statSize":1727,"groups":[{"id":263,"label":"Cancel.js","path":"./node_modules/axios/lib/cancel/Cancel.js","statSize":385},{"id":972,"label":"CancelToken.js","path":"./node_modules/axios/lib/cancel/CancelToken.js","statSize":1240},{"id":502,"label":"isCancel.js","path":"./node_modules/axios/lib/cancel/isCancel.js","statSize":102}],"parsedSize":0,"gzipSize":0},{"label":"core","path":"./node_modules/axios/lib/core","statSize":12353,"groups":[{"id":321,"label":"Axios.js","path":"./node_modules/axios/lib/core/Axios.js","statSize":2648},{"id":782,"label":"InterceptorManager.js","path":"./node_modules/axios/lib/core/InterceptorManager.js","statSize":1251},{"id":97,"label":"buildFullPath.js","path":"./node_modules/axios/lib/core/buildFullPath.js","statSize":695},{"id":61,"label":"createError.js","path":"./node_modules/axios/lib/core/createError.js","statSize":625},{"id":572,"label":"dispatchRequest.js","path":"./node_modules/axios/lib/core/dispatchRequest.js","statSize":1934},{"id":481,"label":"enhanceError.js","path":"./node_modules/axios/lib/core/enhanceError.js","statSize":1049},{"id":185,"label":"mergeConfig.js","path":"./node_modules/axios/lib/core/mergeConfig.js","statSize":2895},{"id":26,"label":"settle.js","path":"./node_modules/axios/lib/core/settle.js","statSize":706},{"id":527,"label":"transformData.js","path":"./node_modules/axios/lib/core/transformData.js","statSize":550}],"parsedSize":0,"gzipSize":0},{"id":655,"label":"defaults.js","path":"./node_modules/axios/lib/defaults.js","statSize":2563},{"label":"helpers","path":"./node_modules/axios/lib/helpers","statSize":9240,"groups":[{"id":849,"label":"bind.js","path":"./node_modules/axios/lib/helpers/bind.js","statSize":256},{"id":327,"label":"buildURL.js","path":"./node_modules/axios/lib/helpers/buildURL.js","statSize":1644},{"id":303,"label":"combineURLs.js","path":"./node_modules/axios/lib/helpers/combineURLs.js","statSize":380},{"id":372,"label":"cookies.js","path":"./node_modules/axios/lib/helpers/cookies.js","statSize":1435},{"id":793,"label":"isAbsoluteURL.js","path":"./node_modules/axios/lib/helpers/isAbsoluteURL.js","statSize":563},{"id":268,"label":"isAxiosError.js","path":"./node_modules/axios/lib/helpers/isAxiosError.js","statSize":343},{"id":985,"label":"isURLSameOrigin.js","path":"./node_modules/axios/lib/helpers/isURLSameOrigin.js","statSize":2305},{"id":16,"label":"normalizeHeaderName.js","path":"./node_modules/axios/lib/helpers/normalizeHeaderName.js","statSize":357},{"id":109,"label":"parseHeaders.js","path":"./node_modules/axios/lib/helpers/parseHeaders.js","statSize":1393},{"id":713,"label":"spread.js","path":"./node_modules/axios/lib/helpers/spread.js","statSize":564}],"parsedSize":0,"gzipSize":0},{"id":867,"label":"utils.js","path":"./node_modules/axios/lib/utils.js","statSize":8947}],"parsedSize":0,"gzipSize":0}],"parsedSize":0,"gzipSize":0}]}] | ||
[{"label":"kontent-core.umd.min.js","isAsset":true,"statSize":63142,"parsedSize":22529,"gzipSize":7118,"groups":[{"label":"lib","path":"./lib","statSize":20900,"groups":[{"id":208,"label":"index.ts + 13 modules (concatenated)","path":"./lib/index.ts + 13 modules (concatenated)","statSize":20900,"parsedSize":22529,"gzipSize":7118,"concatenated":true,"groups":[{"label":"lib","path":"./lib/index.ts + 13 modules (concatenated)/lib","statSize":20900,"groups":[{"id":null,"label":"index.ts","path":"./lib/index.ts + 13 modules (concatenated)/lib/index.ts","statSize":98,"parsedSize":105,"gzipSize":33,"inaccurateSizes":true},{"label":"helpers","path":"./lib/index.ts + 13 modules (concatenated)/lib/helpers","statSize":8329,"groups":[{"id":null,"label":"index.ts","path":"./lib/index.ts + 13 modules (concatenated)/lib/helpers/index.ts","statSize":165,"parsedSize":177,"gzipSize":56,"inaccurateSizes":true},{"id":null,"label":"url.helper.ts","path":"./lib/index.ts + 13 modules (concatenated)/lib/helpers/url.helper.ts","statSize":601,"parsedSize":647,"gzipSize":204,"inaccurateSizes":true},{"id":null,"label":"header.helper.ts","path":"./lib/index.ts + 13 modules (concatenated)/lib/helpers/header.helper.ts","statSize":437,"parsedSize":471,"gzipSize":148,"inaccurateSizes":true},{"id":null,"label":"enum.helper.ts","path":"./lib/index.ts + 13 modules (concatenated)/lib/helpers/enum.helper.ts","statSize":1503,"parsedSize":1620,"gzipSize":511,"inaccurateSizes":true},{"id":null,"label":"retry-helper.ts","path":"./lib/index.ts + 13 modules (concatenated)/lib/helpers/retry-helper.ts","statSize":5327,"parsedSize":5742,"gzipSize":1814,"inaccurateSizes":true},{"id":null,"label":"headers-helper.ts","path":"./lib/index.ts + 13 modules (concatenated)/lib/helpers/headers-helper.ts","statSize":296,"parsedSize":319,"gzipSize":100,"inaccurateSizes":true}],"parsedSize":8978,"gzipSize":2836,"inaccurateSizes":true},{"label":"models","path":"./lib/index.ts + 13 modules (concatenated)/lib/models","statSize":859,"groups":[{"id":null,"label":"index.ts","path":"./lib/index.ts + 13 modules (concatenated)/lib/models/index.ts","statSize":92,"parsedSize":99,"gzipSize":31,"inaccurateSizes":true},{"id":null,"label":"parameters.ts","path":"./lib/index.ts + 13 modules (concatenated)/lib/models/parameters.ts","statSize":767,"parsedSize":826,"gzipSize":261,"inaccurateSizes":true}],"parsedSize":925,"gzipSize":292,"inaccurateSizes":true},{"label":"http","path":"./lib/index.ts + 13 modules (concatenated)/lib/http","statSize":11614,"groups":[{"id":null,"label":"index.ts","path":"./lib/index.ts + 13 modules (concatenated)/lib/http/index.ts","statSize":206,"parsedSize":222,"gzipSize":70,"inaccurateSizes":true},{"id":null,"label":"http.service.ts","path":"./lib/index.ts + 13 modules (concatenated)/lib/http/http.service.ts","statSize":1001,"parsedSize":1079,"gzipSize":340,"inaccurateSizes":true},{"id":null,"label":"http.functions.ts","path":"./lib/index.ts + 13 modules (concatenated)/lib/http/http.functions.ts","statSize":9002,"parsedSize":9703,"gzipSize":3065,"inaccurateSizes":true},{"id":null,"label":"http.debugger.ts","path":"./lib/index.ts + 13 modules (concatenated)/lib/http/http.debugger.ts","statSize":375,"parsedSize":404,"gzipSize":127,"inaccurateSizes":true},{"id":null,"label":"test-http.service.ts","path":"./lib/index.ts + 13 modules (concatenated)/lib/http/test-http.service.ts","statSize":1030,"parsedSize":1110,"gzipSize":350,"inaccurateSizes":true}],"parsedSize":12519,"gzipSize":3955,"inaccurateSizes":true}],"parsedSize":22529,"gzipSize":7118,"inaccurateSizes":true}]}],"parsedSize":22529,"gzipSize":7118},{"label":"node_modules/axios","path":"./node_modules/axios","statSize":42242,"groups":[{"id":669,"label":"index.js","path":"./node_modules/axios/index.js","statSize":40},{"label":"lib","path":"./node_modules/axios/lib","statSize":42202,"groups":[{"label":"adapters","path":"./node_modules/axios/lib/adapters","statSize":5869,"groups":[{"id":448,"label":"xhr.js","path":"./node_modules/axios/lib/adapters/xhr.js","statSize":5869}],"parsedSize":0,"gzipSize":0},{"id":609,"label":"axios.js","path":"./node_modules/axios/lib/axios.js","statSize":1503},{"label":"cancel","path":"./node_modules/axios/lib/cancel","statSize":1727,"groups":[{"id":263,"label":"Cancel.js","path":"./node_modules/axios/lib/cancel/Cancel.js","statSize":385},{"id":972,"label":"CancelToken.js","path":"./node_modules/axios/lib/cancel/CancelToken.js","statSize":1240},{"id":502,"label":"isCancel.js","path":"./node_modules/axios/lib/cancel/isCancel.js","statSize":102}],"parsedSize":0,"gzipSize":0},{"label":"core","path":"./node_modules/axios/lib/core","statSize":12353,"groups":[{"id":321,"label":"Axios.js","path":"./node_modules/axios/lib/core/Axios.js","statSize":2648},{"id":782,"label":"InterceptorManager.js","path":"./node_modules/axios/lib/core/InterceptorManager.js","statSize":1251},{"id":97,"label":"buildFullPath.js","path":"./node_modules/axios/lib/core/buildFullPath.js","statSize":695},{"id":61,"label":"createError.js","path":"./node_modules/axios/lib/core/createError.js","statSize":625},{"id":572,"label":"dispatchRequest.js","path":"./node_modules/axios/lib/core/dispatchRequest.js","statSize":1934},{"id":481,"label":"enhanceError.js","path":"./node_modules/axios/lib/core/enhanceError.js","statSize":1049},{"id":185,"label":"mergeConfig.js","path":"./node_modules/axios/lib/core/mergeConfig.js","statSize":2895},{"id":26,"label":"settle.js","path":"./node_modules/axios/lib/core/settle.js","statSize":706},{"id":527,"label":"transformData.js","path":"./node_modules/axios/lib/core/transformData.js","statSize":550}],"parsedSize":0,"gzipSize":0},{"id":655,"label":"defaults.js","path":"./node_modules/axios/lib/defaults.js","statSize":2563},{"label":"helpers","path":"./node_modules/axios/lib/helpers","statSize":9240,"groups":[{"id":849,"label":"bind.js","path":"./node_modules/axios/lib/helpers/bind.js","statSize":256},{"id":327,"label":"buildURL.js","path":"./node_modules/axios/lib/helpers/buildURL.js","statSize":1644},{"id":303,"label":"combineURLs.js","path":"./node_modules/axios/lib/helpers/combineURLs.js","statSize":380},{"id":372,"label":"cookies.js","path":"./node_modules/axios/lib/helpers/cookies.js","statSize":1435},{"id":793,"label":"isAbsoluteURL.js","path":"./node_modules/axios/lib/helpers/isAbsoluteURL.js","statSize":563},{"id":268,"label":"isAxiosError.js","path":"./node_modules/axios/lib/helpers/isAxiosError.js","statSize":343},{"id":985,"label":"isURLSameOrigin.js","path":"./node_modules/axios/lib/helpers/isURLSameOrigin.js","statSize":2305},{"id":16,"label":"normalizeHeaderName.js","path":"./node_modules/axios/lib/helpers/normalizeHeaderName.js","statSize":357},{"id":109,"label":"parseHeaders.js","path":"./node_modules/axios/lib/helpers/parseHeaders.js","statSize":1393},{"id":713,"label":"spread.js","path":"./node_modules/axios/lib/helpers/spread.js","statSize":564}],"parsedSize":0,"gzipSize":0},{"id":867,"label":"utils.js","path":"./node_modules/axios/lib/utils.js","statSize":8947}],"parsedSize":0,"gzipSize":0}],"parsedSize":0,"gzipSize":0}]}] |
@@ -137,4 +137,2 @@ import { AxiosError } from 'axios'; | ||
console.log('STATUS', statusCode, canRetryStatusCode); | ||
if (canRetryStatusCode) { | ||
@@ -141,0 +139,0 @@ return true; |
@@ -5,4 +5,4 @@ | ||
host: 'npmjs.com', | ||
version: '9.0.1', | ||
version: '9.1.0', | ||
name: '@kentico/kontent-core' | ||
}; |
{ | ||
"name": "@kentico/kontent-core", | ||
"version": "9.0.1", | ||
"version": "9.1.0", | ||
"repository": { | ||
@@ -58,13 +58,13 @@ "type": "git", | ||
"devDependencies": { | ||
"@types/jasmine": "3.6.10", | ||
"@types/node": "15.0.1", | ||
"@types/jasmine": "3.8.2", | ||
"@types/node": "16.6.0", | ||
"colors": "1.4.0", | ||
"core-js": "3.11.1", | ||
"jasmine-core": "3.7.1", | ||
"core-js": "3.16.1", | ||
"jasmine-core": "3.8.0", | ||
"jasmine-spec-reporter": "7.0.0", | ||
"karma": "6.3.2", | ||
"karma": "6.3.4", | ||
"karma-chrome-launcher": "3.1.0", | ||
"karma-cli": "2.0.0", | ||
"karma-jasmine": "4.0.1", | ||
"karma-jasmine-html-reporter": "1.5.4", | ||
"karma-jasmine-html-reporter": "1.7.0", | ||
"karma-sourcemap-loader": "0.3.8", | ||
@@ -74,12 +74,12 @@ "karma-typescript": "5.5.1", | ||
"karma-webpack": "5.0.0", | ||
"mocha": "8.3.2", | ||
"standard-version": "9.2.0", | ||
"ts-loader": "9.1.1", | ||
"ts-node": "9.1.1", | ||
"mocha": "9.0.3", | ||
"standard-version": "9.3.1", | ||
"ts-loader": "9.2.5", | ||
"ts-node": "10.2.0", | ||
"tslint": "6.1.3", | ||
"typescript": "4.2.4", | ||
"webpack": "5.36.2", | ||
"webpack-bundle-analyzer": "4.4.1", | ||
"webpack-cli": "4.6.0" | ||
"typescript": "4.3.5", | ||
"webpack": "5.50.0", | ||
"webpack-bundle-analyzer": "4.4.2", | ||
"webpack-cli": "4.7.2" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1595478
29351