Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@kentico/kontent-core

Package Overview
Dependencies
Maintainers
4
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kentico/kontent-core - npm Package Compare versions

Comparing version 4.0.3 to 5.0.0

15

_bundles/http/http.functions.d.ts
import { AxiosInstance, AxiosResponse } from 'axios';
import { IHeader, IHttpDeleteQueryCall, IHttpGetQueryCall, IHttpPatchQueryCall, IHttpPostQueryCall, IHttpPutQueryCall, IHttpQueryOptions, IHttpRequestConfig, IHttpRequestResponse, IHttpRequestResult } from './http.models';
import { IHttpDeleteQueryCall, IHttpGetQueryCall, IHttpPatchQueryCall, IHttpPostQueryCall, IHttpPutQueryCall, IHttpQueryOptions, IHttpRequestConfig, IHttpRequestResponse, IHttpRequestResult } from './http.models';
export declare function registerResponseInterceptor(instance: AxiosInstance, interceptor: (response: IHttpRequestResponse) => IHttpRequestResponse): void;
export declare function registerRequestInterceptor(instance: AxiosInstance, interceptor: (config: IHttpRequestConfig) => IHttpRequestConfig): void;
export declare function getCallback<TError>(instance: AxiosInstance, call: IHttpGetQueryCall<TError>, options: IHttpQueryOptions | undefined, callback: (response: IHttpRequestResult<AxiosResponse>) => void): void;
export declare function putCallback<TError>(instance: AxiosInstance, call: IHttpPutQueryCall<TError>, options: IHttpQueryOptions | undefined, callback: (response: IHttpRequestResult<AxiosResponse>) => void): void;
export declare function patchCallback<TError>(instance: AxiosInstance, call: IHttpPatchQueryCall<TError>, options: IHttpQueryOptions | undefined, callback: (response: IHttpRequestResult<AxiosResponse>) => void): void;
export declare function deleteCallback<TError>(instance: AxiosInstance, call: IHttpDeleteQueryCall<TError>, options: IHttpQueryOptions | undefined, callback: (response: IHttpRequestResult<AxiosResponse>) => void): void;
export declare function postCallback<TError>(instance: AxiosInstance, call: IHttpPostQueryCall<TError>, options: IHttpQueryOptions | undefined, callback: (response: IHttpRequestResult<AxiosResponse>) => void): void;
export declare function getHeadersJson(headers: IHeader[], addContentTypeHeader: boolean): {
[header: string]: string;
};
export declare function getCallback<TError>(instance: AxiosInstance, call: IHttpGetQueryCall<TError>, options: IHttpQueryOptions | undefined): Promise<IHttpRequestResult<AxiosResponse>>;
export declare function putCallback<TError>(instance: AxiosInstance, call: IHttpPutQueryCall<TError>, options: IHttpQueryOptions | undefined): Promise<IHttpRequestResult<AxiosResponse>>;
export declare function patchCallback<TError>(instance: AxiosInstance, call: IHttpPatchQueryCall<TError>, options: IHttpQueryOptions | undefined): Promise<IHttpRequestResult<AxiosResponse>>;
export declare function deleteCallback<TError>(instance: AxiosInstance, call: IHttpDeleteQueryCall<TError>, options: IHttpQueryOptions | undefined): Promise<IHttpRequestResult<AxiosResponse>>;
export declare function postCallback<TError>(instance: AxiosInstance, call: IHttpPostQueryCall<TError>, options: IHttpQueryOptions | undefined): Promise<IHttpRequestResult<AxiosResponse>>;

2

_bundles/http/http.models.d.ts

@@ -123,3 +123,3 @@ export interface IBaseResponse<TRawData> {

}
export declare class IHttpRequestResult<TResponse> {
export declare class IHttpRequestResult<TResponse = any> {
response?: TResponse | undefined;

@@ -126,0 +126,0 @@ error?: any;

import { AxiosRequestConfig } from 'axios';
import { Observable } from 'rxjs';
import { IBaseResponse, IHttpDeleteQueryCall, IHttpGetQueryCall, IHttpPatchQueryCall, IHttpPostQueryCall, IHttpPutQueryCall, IHttpQueryOptions, IHttpRequestConfig, IHttpRequestResponse, IRetryStrategyOptions } from './http.models';
import { IBaseResponse, IHttpDeleteQueryCall, IHttpGetQueryCall, IHttpPatchQueryCall, IHttpPostQueryCall, IHttpPutQueryCall, IHttpQueryOptions, IHttpRequestConfig, IHttpRequestResponse } from './http.models';
import { IHttpService } from './ihttp.service';

@@ -12,8 +12,2 @@ export declare class HttpService implements IHttpService {

});
/**
* Retries given promise based on given configuration
* @param promise Promise to retry
* @param options Configuration options
*/
retryPromise<T>(promise: Promise<T>, options?: IRetryStrategyOptions): Promise<T>;
get<TError extends any, TRawData extends any>(call: IHttpGetQueryCall<TError>, options?: IHttpQueryOptions): Observable<IBaseResponse<TRawData>>;

@@ -20,0 +14,0 @@ post<TError extends any, TRawData extends any>(call: IHttpPostQueryCall<TError>, options?: IHttpQueryOptions): Observable<IBaseResponse<TRawData>>;

import { Observable } from 'rxjs';
import { IBaseResponse, IHttpDeleteQueryCall, IHttpGetQueryCall, IHttpPostQueryCall, IHttpPutQueryCall, IHttpQueryOptions, IHttpPatchQueryCall, IRetryStrategyOptions } from './http.models';
import { IBaseResponse, IHttpDeleteQueryCall, IHttpGetQueryCall, IHttpPostQueryCall, IHttpPutQueryCall, IHttpQueryOptions, IHttpPatchQueryCall } from './http.models';
export interface IHttpService {
retryPromise<T>(promise: Promise<T>, options?: IRetryStrategyOptions): Promise<T>;
post<TError extends any, TRawData extends any>(call: IHttpPostQueryCall<TError>, options?: IHttpQueryOptions): Observable<IBaseResponse<TRawData>>;

@@ -6,0 +5,0 @@ get<TError extends any, TRawData extends any>(call: IHttpGetQueryCall<TError>, options?: IHttpQueryOptions): Observable<IBaseResponse<TRawData>>;

export * from './ihttp.service';
export * from './observable-retry-strategy';
export * from './promise-retry-strategy';
export * from './http.service';

@@ -5,0 +4,0 @@ export * from './http.models';

@@ -6,4 +6,4 @@ import { Observable } from 'rxjs';

startTime: Date;
}) => (attempts: Observable<any>) => Observable<number>;
}) => (errorObs: Observable<any>) => Observable<number>;
}
export declare const observableRetryStrategy: ObservableRetryStrategy;
import { Observable } from 'rxjs';
import { IBaseResponse, IHttpDeleteQueryCall, IHttpGetQueryCall, IHttpPatchQueryCall, IHttpPostQueryCall, IHttpPutQueryCall, IHttpQueryOptions, IHeader, IRetryStrategyOptions } from './http.models';
import { IBaseResponse, IHeader, IHttpDeleteQueryCall, IHttpGetQueryCall, IHttpPatchQueryCall, IHttpPostQueryCall, IHttpPutQueryCall, IHttpQueryOptions } from './http.models';
import { IHttpService } from './ihttp.service';

@@ -17,3 +17,2 @@ export declare class TestHttpService implements IHttpService {

});
retryPromise<T>(promise: Promise<T>, options?: IRetryStrategyOptions): Promise<T>;
get<TError extends any, TRawData extends any>(call: IHttpGetQueryCall<TError>, options?: IHttpQueryOptions): Observable<IBaseResponse<TRawData>>;

@@ -20,0 +19,0 @@ post<TError extends any, TRawData extends any>(call: IHttpPostQueryCall<TError>, options?: IHttpQueryOptions): Observable<IBaseResponse<TRawData>>;

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("rxjs"),require("rxjs/operators")):"function"==typeof define&&define.amd?define("kontentCore",["rxjs","rxjs/operators"],t):"object"==typeof exports?exports.kontentCore=t(require("rxjs"),require("rxjs/operators")):e.kontentCore=t(e.rxjs,e.rxjs.operators)}(window,(function(e,t){return function(e){var t={};function r(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(o,n,function(t){return e[t]}.bind(null,n));return o},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=18)}([function(e,t,r){"use strict";var o=r(7),n=r(29),s=Object.prototype.toString;function i(e){return"[object Array]"===s.call(e)}function a(e){return null!==e&&"object"==typeof e}function u(e){return"[object Function]"===s.call(e)}function c(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(var r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.call(null,e[n],n,e)}e.exports={isArray:i,isArrayBuffer:function(e){return"[object ArrayBuffer]"===s.call(e)},isBuffer:n,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:a,isUndefined:function(e){return void 0===e},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:u,isStream:function(e){return a(e)&&u(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:c,merge:function e(){var t={};function r(r,o){"object"==typeof t[o]&&"object"==typeof r?t[o]=e(t[o],r):t[o]=r}for(var o=0,n=arguments.length;o<n;o++)c(arguments[o],r);return t},deepMerge:function e(){var t={};function r(r,o){"object"==typeof t[o]&&"object"==typeof r?t[o]=e(t[o],r):t[o]="object"==typeof r?e({},r):r}for(var o=0,n=arguments.length;o<n;o++)c(arguments[o],r);return t},extend:function(e,t,r){return c(t,(function(t,n){e[n]=r&&"function"==typeof t?o(t,r):t})),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=r(5),n=function(){function e(){this.retryAfterHeaderName="Retry-After",this.defaultRetryPolicy={addJitter:!0,useRetryForResponseCodes:[408,429,500,502,503,504],deltaBackoffMs:1e3,maxCumulativeWaitTimeMs:3e4}}return e.prototype.getRetryStrategyFromStrategyOptions=function(e){return e?{addJitter:this.getBoolOrDefault(e.addJitter,this.defaultRetryPolicy.addJitter),deltaBackoffMs:e.deltaBackoffMs?e.deltaBackoffMs:this.defaultRetryPolicy.deltaBackoffMs,maxCumulativeWaitTimeMs:e.maxCumulativeWaitTimeMs?e.maxCumulativeWaitTimeMs:this.defaultRetryPolicy.maxCumulativeWaitTimeMs,useRetryForResponseCodes:e.useRetryForResponseCodes?e.useRetryForResponseCodes:this.defaultRetryPolicy.useRetryForResponseCodes}:this.defaultRetryPolicy},e.prototype.getRetryStrategyFromHttpQueryOptions=function(e){return e?{addJitter:this.getBoolOrDefault(e.addJitterToRetryAttempts,this.defaultRetryPolicy.addJitter),deltaBackoffMs:e.deltaBackoffMs?e.deltaBackoffMs:this.defaultRetryPolicy.deltaBackoffMs,maxCumulativeWaitTimeMs:e.maxCumulativeWaitTimeMs?e.maxCumulativeWaitTimeMs:this.defaultRetryPolicy.maxCumulativeWaitTimeMs,useRetryForResponseCodes:e.useRetryForResponseCodes?e.useRetryForResponseCodes:this.defaultRetryPolicy.useRetryForResponseCodes}:this.defaultRetryPolicy},e.prototype.canRetry=function(e,t){var r=e.getTime();return(new Date).getTime()-r<t},e.prototype.debugLogAttempt=function(e,t){console.warn("Attempt "+e+": retrying in "+t+"ms")},e.prototype.getNextWaitTimeMs=function(e,t,r,o){if(o)return o;if(!e)return t*Math.pow(2,r);var n=.8*t,s=1.2*t*Math.pow(2,r);return this.randomNumberFromInterval(n,s)},e.prototype.canRetryStatusCode=function(e,t){return t.includes(e)},e.prototype.getStatusCodeFromError=function(e){var t=this.tryGetAxiosError(e);return t&&t.response?t.response.status:0},e.prototype.tryGetRetryAfterInMsFromError=function(e){var t=this,r=this.tryGetAxiosError(e);if(r&&r.response){var n=o.extractHeadersFromAxiosResponse(r.response).find((function(e){return e.header.toLowerCase()===t.retryAfterHeaderName.toLowerCase()}));if(n){var s=n.value;return isNaN(+s)?new Date(s).getTime()-(new Date).getTime():1e3*+s}}},e.prototype.tryGetAxiosError=function(e){if(console.warn("try get axios",e),e){if(e.isAxiosError)return e;var t=e.originalError;return t&&t.isAxiosError?t:void 0}},e.prototype.getBoolOrDefault=function(e,t){return void 0===e?t:e},e.prototype.randomNumberFromInterval=function(e,t){return Math.floor(Math.random()*(t-e+1)+e)},e}();t.RetryService=n,t.retryService=new n},function(t,r){t.exports=e},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=r(2),n=r(4),s=r(1),i=function(){this.strategy=function(e,t){return function(r){return console.log("get retry strategy",r),r.pipe(n.mergeMap((function(r,n){console.log("attempt",n);var i=n+1,a=s.retryService.getStatusCodeFromError(r),u=s.retryService.tryGetRetryAfterInMsFromError(r);if(console.log(a,u),!s.retryService.canRetryStatusCode(a,e.useRetryForResponseCodes))return console.log("no retry 1"),o.throwError(r);if(!s.retryService.canRetry(t.startTime,e.maxCumulativeWaitTimeMs))return console.log("no retry 1"),o.throwError(r);var c=s.retryService.getNextWaitTimeMs(e.addJitter,e.deltaBackoffMs,i,u);return s.retryService.debugLogAttempt(i,c),console.log("wait",c),o.timer(c)})))}}};t.ObservableRetryStrategy=i,t.observableRetryStrategy=new i},function(e,r){e.exports=t},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extractHeadersFromAxiosResponse=function(e){for(var t=[],r=0,o=Object.keys(e.headers);r<o.length;r++){var n=o[r];t.push({header:n,value:e.headers[n]})}return t}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=r(1),n=function(){function e(){}return e.prototype.getPromiseWithRetryStrategy=function(e,t,r){var n=this;return new Promise((function(s,i){return e.then((function(e){s(e)})).catch((function(a){try{r.retryAttempt++;var u=r.retryAttempt,c=o.retryService.getStatusCodeFromError(a),f=o.retryService.tryGetRetryAfterInMsFromError(a);if(!o.retryService.canRetryStatusCode(c,t.useRetryForResponseCodes))return i(a);if(!o.retryService.canRetry(r.startTime,t.maxCumulativeWaitTimeMs))return i(a);var p=o.retryService.getNextWaitTimeMs(t.addJitter,t.deltaBackoffMs,u,f);return o.retryService.debugLogAttempt(u,p),n.promiseRetryWait(p).then((function(){return n.getPromiseWithRetryStrategy(e,t,{retryAttempt:u,startTime:r.startTime})})).then((function(e){return s(e)})).catch((function(e){return i(e)}))}catch(e){i(e)}}))}))},e.prototype.promiseRetryWait=function(e){return new Promise((function(t){return setTimeout(t,e)}))},e}();t.PromiseRetryStrategy=n,t.promiseRetryStrategy=new n},function(e,t,r){"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),o=0;o<r.length;o++)r[o]=arguments[o];return e.apply(t,r)}}},function(e,t,r){"use strict";var o=r(0);function n(e){return encodeURIComponent(e).replace(/%40/gi,"@").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 s;if(r)s=r(t);else if(o.isURLSearchParams(t))s=t.toString();else{var i=[];o.forEach(t,(function(e,t){null!=e&&(o.isArray(e)?t+="[]":e=[e],o.forEach(e,(function(e){o.isDate(e)?e=e.toISOString():o.isObject(e)&&(e=JSON.stringify(e)),i.push(n(t)+"="+n(e))})))})),s=i.join("&")}if(s){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}},function(e,t,r){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,r){"use strict";(function(t){var o=r(0),n=r(35),s={"Content-Type":"application/x-www-form-urlencoded"};function i(e,t){!o.isUndefined(e)&&o.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var a,u={adapter:(void 0!==t&&"[object process]"===Object.prototype.toString.call(t)?a=r(11):"undefined"!=typeof XMLHttpRequest&&(a=r(11)),a),transformRequest:[function(e,t){return n(t,"Accept"),n(t,"Content-Type"),o.isFormData(e)||o.isArrayBuffer(e)||o.isBuffer(e)||o.isStream(e)||o.isFile(e)||o.isBlob(e)?e:o.isArrayBufferView(e)?e.buffer:o.isURLSearchParams(e)?(i(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):o.isObject(e)?(i(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,validateStatus:function(e){return e>=200&&e<300}};u.headers={common:{Accept:"application/json, text/plain, */*"}},o.forEach(["delete","get","head"],(function(e){u.headers[e]={}})),o.forEach(["post","put","patch"],(function(e){u.headers[e]=o.merge(s)})),e.exports=u}).call(this,r(34))},function(e,t,r){"use strict";var o=r(0),n=r(36),s=r(8),i=r(38),a=r(39),u=r(12);e.exports=function(e){return new Promise((function(t,c){var f=e.data,p=e.headers;o.isFormData(f)&&delete p["Content-Type"];var d=new XMLHttpRequest;if(e.auth){var l=e.auth.username||"",h=e.auth.password||"";p.Authorization="Basic "+btoa(l+":"+h)}if(d.open(e.method.toUpperCase(),s(e.url,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 r="getAllResponseHeaders"in d?i(d.getAllResponseHeaders()):null,o={data:e.responseType&&"text"!==e.responseType?d.response:d.responseText,status:d.status,statusText:d.statusText,headers:r,config:e,request:d};n(t,c,o),d=null}},d.onabort=function(){d&&(c(u("Request aborted",e,"ECONNABORTED",d)),d=null)},d.onerror=function(){c(u("Network Error",e,null,d)),d=null},d.ontimeout=function(){c(u("timeout of "+e.timeout+"ms exceeded",e,"ECONNABORTED",d)),d=null},o.isStandardBrowserEnv()){var y=r(40),m=(e.withCredentials||a(e.url))&&e.xsrfCookieName?y.read(e.xsrfCookieName):void 0;m&&(p[e.xsrfHeaderName]=m)}if("setRequestHeader"in d&&o.forEach(p,(function(e,t){void 0===f&&"content-type"===t.toLowerCase()?delete p[t]:d.setRequestHeader(t,e)})),e.withCredentials&&(d.withCredentials=!0),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(),c(e),d=null)})),void 0===f&&(f=null),d.send(f)}))}},function(e,t,r){"use strict";var o=r(37);e.exports=function(e,t,r,n,s){var i=new Error(e);return o(i,t,r,n,s)}},function(e,t,r){"use strict";var o=r(0);e.exports=function(e,t){t=t||{};var r={};return o.forEach(["url","method","params","data"],(function(e){void 0!==t[e]&&(r[e]=t[e])})),o.forEach(["headers","auth","proxy"],(function(n){o.isObject(t[n])?r[n]=o.deepMerge(e[n],t[n]):void 0!==t[n]?r[n]=t[n]:o.isObject(e[n])?r[n]=o.deepMerge(e[n]):void 0!==e[n]&&(r[n]=e[n])})),o.forEach(["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"],(function(o){void 0!==t[o]?r[o]=t[o]:void 0!==e[o]&&(r[o]=e[o])})),r}},function(e,t,r){"use strict";function o(e){this.message=e}o.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},o.prototype.__CANCEL__=!0,e.exports=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=r(16);function n(e,t){var r={};(e.forEach((function(e){r[e.header]=e.value})),t)&&(e.find((function(e){return e.header.toLowerCase()==="Content-Type".toLowerCase()}))||(r["Content-Type"]="application/json"));return r}t.registerResponseInterceptor=function(e,t){e.interceptors.response.use((function(e){return t(e)}),(function(e){return Promise.reject(e)}))},t.registerRequestInterceptor=function(e,t){e.interceptors.request.use((function(e){return t(e)}),(function(e){return Promise.reject(e)}))},t.getCallback=function(e,t,r,s){o.httpDebugger.debugStartHttpRequest(),e.get(t.url,{headers:n(r&&r.headers?r.headers:[],!1),responseType:r&&r.responseType?r.responseType:void 0}).then((function(e){o.httpDebugger.debugResolveHttpRequest(),s({response:e})}),(function(e){o.httpDebugger.debugFailedHttpRequest(),s({error:e})}))},t.putCallback=function(e,t,r,s){o.httpDebugger.debugStartHttpRequest(),e.put(t.url,t.body,{headers:n(r&&r.headers?r.headers:[],!0),responseType:r&&r.responseType?r.responseType:void 0}).then((function(e){o.httpDebugger.debugResolveHttpRequest(),s({response:e})}),(function(e){o.httpDebugger.debugFailedHttpRequest(),s({error:e})}))},t.patchCallback=function(e,t,r,s){o.httpDebugger.debugStartHttpRequest(),e.patch(t.url,t.body,{headers:n(r&&r.headers?r.headers:[],!0),responseType:r&&r.responseType?r.responseType:void 0}).then((function(e){o.httpDebugger.debugResolveHttpRequest(),s({response:e})}),(function(e){o.httpDebugger.debugFailedHttpRequest(),s({error:e})}))},t.deleteCallback=function(e,t,r,s){o.httpDebugger.debugStartHttpRequest(),e.delete(t.url,{headers:n(r&&r.headers?r.headers:[],!0),responseType:r&&r.responseType?r.responseType:void 0}).then((function(e){o.httpDebugger.debugResolveHttpRequest(),s({response:e})}),(function(e){o.httpDebugger.debugFailedHttpRequest(),s({error:e})}))},t.postCallback=function(e,t,r,s){o.httpDebugger.debugStartHttpRequest(),e.post(t.url,t.body,{headers:n(r&&r.headers?r.headers:[],!0),responseType:r&&r.responseType?r.responseType:void 0}).then((function(e){o.httpDebugger.debugResolveHttpRequest(),s({response:e})}),(function(e){o.httpDebugger.debugFailedHttpRequest(),s({error:e})}))},t.getHeadersJson=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(){}return e.prototype.debugStartHttpRequest=function(){},e.prototype.debugResolveHttpRequest=function(){},e.prototype.debugFailedHttpRequest=function(){},e}();t.HttpDebugger=o,t.httpDebugger=new o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){Object.assign(this,e)};t.BaseKontentError=o},function(e,t,r){"use strict";function o(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0}),o(r(19)),o(r(23)),o(r(25)),o(r(47))},function(e,t,r){"use strict";function o(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0}),o(r(20)),o(r(21)),o(r(22))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(){}return e.prototype.addOptionsToUrl=function(e,t){return t&&t.forEach((function(t){e=e.indexOf("?")>-1?e+"&"+t.getParam()+"="+t.getParamValue():e+"?"+t.getParam()+"="+t.getParamValue()})),e},e}();t.UrlHelper=o,t.urlHelper=new o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(){this.sdkVersionHeader="X-KC-SDKID"}return e.prototype.getSdkIdHeader=function(e){return{header:this.sdkVersionHeader,value:e.host+";"+e.name+";"+e.version}},e}();t.HeaderHelper=o,t.headerHelper=new o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(){}return e.prototype.getAllNames=function(e){var t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(r);return t},e.prototype.getAllValues=function(e){return Object.keys(e).map((function(t){return e[t]}))},e.prototype.getEnumFromValue=function(e,t){try{if(!t)return;if(this.isNumeric(t))return e[t];var r=this.getAllValues(e).find((function(e){return e.toLowerCase()===t.toString().toLowerCase()}));if(!r)return;return r}catch(e){return}},e.prototype.getEnumFromName=function(e,t){for(var r=0,o=this.getAllNames(e);r<o.length;r++){var n=o[r];if(n.toLowerCase()===t.toLowerCase())return e[n]}},e.prototype.isNumeric=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},e}();t.EnumHelper=o,t.enumHelper=new o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(24))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){var t=function(){function e(e,t){if(this.name=e,this.value=t,!e)throw Error("Name of the custom parameter is not specified")}return e.prototype.getParam=function(){return this.name},e.prototype.getParamValue=function(){return this.value},e}();e.CustomParameter=t}(t.Parameters||(t.Parameters={}))},function(e,t,r){"use strict";function o(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0}),o(r(3)),o(r(6)),o(r(26)),o(r(45)),o(r(15)),o(r(16)),o(r(46)),o(r(1))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=r(27),n=r(2),s=r(4),i=r(5),a=r(15),u=r(3),c=r(6),f=r(1),p=function(){function e(e){this.axiosInstance=o.default.create(e&&e.axiosRequestConfig?e.axiosRequestConfig:void 0),e&&(e.requestInterceptor&&a.registerRequestInterceptor(this.axiosInstance,e.requestInterceptor),e.responseInterceptor&&a.registerResponseInterceptor(this.axiosInstance,e.responseInterceptor))}return e.prototype.retryPromise=function(e,t){return c.promiseRetryStrategy.getPromiseWithRetryStrategy(e,f.retryService.getRetryStrategyFromStrategyOptions(t),{retryAttempt:0,startTime:new Date})},e.prototype.get=function(e,t){var r=n.bindCallback(a.getCallback);return this.mapAxiosObservable(this.axiosInstance,r,e,t)},e.prototype.post=function(e,t){var r=n.bindCallback(a.postCallback);return this.mapAxiosObservable(this.axiosInstance,r,e,t)},e.prototype.put=function(e,t){var r=n.bindCallback(a.putCallback);return this.mapAxiosObservable(this.axiosInstance,r,e,t)},e.prototype.patch=function(e,t){var r=n.bindCallback(a.patchCallback);return this.mapAxiosObservable(this.axiosInstance,r,e,t)},e.prototype.delete=function(e,t){var r=n.bindCallback(a.deleteCallback);return this.mapAxiosObservable(this.axiosInstance,r,e,t)},e.prototype.mapAxiosObservable=function(e,t,r,o){var i=this;return t(e,r,o).pipe(s.map((function(e){return i.mapResult(e)})),s.retryWhen(u.observableRetryStrategy.strategy(f.retryService.getRetryStrategyFromHttpQueryOptions(o),{startTime:new Date})),s.catchError((function(e){return o&&o.logErrorToConsole&&console.error("Kentico Kontent Core SDK encountered an error: ",e),n.throwError({originalError:e,mappedError:r.mapError(e)})})))},e.prototype.mapResult=function(e){if(e.error)throw e.error;if(!e.response)throw Error("Response is not set and no error was thrown");return{data:e.response.data,response:e.response,headers:i.extractHeadersFromAxiosResponse(e.response),status:e.response.status}},e}();t.HttpService=p},function(e,t,r){e.exports=r(28)},function(e,t,r){"use strict";var o=r(0),n=r(7),s=r(30),i=r(13);function a(e){var t=new s(e),r=n(s.prototype.request,t);return o.extend(r,s.prototype,t),o.extend(r,t),r}var u=a(r(10));u.Axios=s,u.create=function(e){return a(i(u.defaults,e))},u.Cancel=r(14),u.CancelToken=r(43),u.isCancel=r(9),u.all=function(e){return Promise.all(e)},u.spread=r(44),e.exports=u,e.exports.default=u},function(e,t){
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("rxjs"),require("rxjs/operators")):"function"==typeof define&&define.amd?define("kontentCore",["rxjs","rxjs/operators"],t):"object"==typeof exports?exports.kontentCore=t(require("rxjs"),require("rxjs/operators")):e.kontentCore=t(e.rxjs,e.rxjs.operators)}(window,(function(e,t){return function(e){var t={};function r(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(o,n,function(t){return e[t]}.bind(null,n));return o},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=17)}([function(e,t,r){"use strict";var o=r(6),n=r(28),s=Object.prototype.toString;function i(e){return"[object Array]"===s.call(e)}function a(e){return null!==e&&"object"==typeof e}function u(e){return"[object Function]"===s.call(e)}function c(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(var r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.call(null,e[n],n,e)}e.exports={isArray:i,isArrayBuffer:function(e){return"[object ArrayBuffer]"===s.call(e)},isBuffer:n,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:a,isUndefined:function(e){return void 0===e},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:u,isStream:function(e){return a(e)&&u(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:c,merge:function e(){var t={};function r(r,o){"object"==typeof t[o]&&"object"==typeof r?t[o]=e(t[o],r):t[o]=r}for(var o=0,n=arguments.length;o<n;o++)c(arguments[o],r);return t},deepMerge:function e(){var t={};function r(r,o){"object"==typeof t[o]&&"object"==typeof r?t[o]=e(t[o],r):t[o]="object"==typeof r?e({},r):r}for(var o=0,n=arguments.length;o<n;o++)c(arguments[o],r);return t},extend:function(e,t,r){return c(t,(function(t,n){e[n]=r&&"function"==typeof t?o(t,r):t})),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}}},function(t,r){t.exports=e},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=r(5),n=function(){function e(){this.retryAfterHeaderName="Retry-After",this.defaultRetryPolicy={addJitter:!0,useRetryForResponseCodes:[408,429,500,502,503,504],deltaBackoffMs:1e3,maxCumulativeWaitTimeMs:3e4}}return e.prototype.getRetryStrategyFromStrategyOptions=function(e){return e?{addJitter:this.getBoolOrDefault(e.addJitter,this.defaultRetryPolicy.addJitter),deltaBackoffMs:e.deltaBackoffMs?e.deltaBackoffMs:this.defaultRetryPolicy.deltaBackoffMs,maxCumulativeWaitTimeMs:e.maxCumulativeWaitTimeMs?e.maxCumulativeWaitTimeMs:this.defaultRetryPolicy.maxCumulativeWaitTimeMs,useRetryForResponseCodes:e.useRetryForResponseCodes?e.useRetryForResponseCodes:this.defaultRetryPolicy.useRetryForResponseCodes}:this.defaultRetryPolicy},e.prototype.getRetryStrategyFromHttpQueryOptions=function(e){return e?{addJitter:this.getBoolOrDefault(e.addJitterToRetryAttempts,this.defaultRetryPolicy.addJitter),deltaBackoffMs:e.deltaBackoffMs?e.deltaBackoffMs:this.defaultRetryPolicy.deltaBackoffMs,maxCumulativeWaitTimeMs:e.maxCumulativeWaitTimeMs?e.maxCumulativeWaitTimeMs:this.defaultRetryPolicy.maxCumulativeWaitTimeMs,useRetryForResponseCodes:e.useRetryForResponseCodes?e.useRetryForResponseCodes:this.defaultRetryPolicy.useRetryForResponseCodes}:this.defaultRetryPolicy},e.prototype.canRetry=function(e,t){var r=e.getTime();return(new Date).getTime()-r<t},e.prototype.debugLogAttempt=function(e,t){console.warn("Attempt "+e+": retrying in "+t+"ms")},e.prototype.getNextWaitTimeMs=function(e,t,r,o){if(o)return o;if(!e)return t*Math.pow(2,r);var n=.8*t,s=1.2*t*Math.pow(2,r);return this.randomNumberFromInterval(n,s)},e.prototype.canRetryStatusCode=function(e,t){return t.includes(e)},e.prototype.getStatusCodeFromError=function(e){var t=this.tryGetAxiosError(e);return t&&t.response?t.response.status:0},e.prototype.tryGetRetryAfterInMsFromError=function(e){var t=this,r=this.tryGetAxiosError(e);if(r&&r.response){var n=o.extractHeadersFromAxiosResponse(r.response).find((function(e){return e.header.toLowerCase()===t.retryAfterHeaderName.toLowerCase()}));if(n){var s=n.value;return isNaN(+s)?new Date(s).getTime()-(new Date).getTime():1e3*+s}}},e.prototype.tryGetAxiosError=function(e){if(console.warn("try get axios",e),e){if(e.isAxiosError)return e;var t=e.originalError;return t&&t.isAxiosError?t:void 0}},e.prototype.getBoolOrDefault=function(e,t){return void 0===e?t:e},e.prototype.randomNumberFromInterval=function(e,t){return Math.floor(Math.random()*(t-e+1)+e)},e}();t.RetryService=n,t.retryService=new n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=r(1),n=r(4),s=r(2),i=function(){this.strategy=function(e,t){return function(r){return r.pipe(n.flatMap((function(r,n){var i=n+1,a=s.retryService.getStatusCodeFromError(r),u=s.retryService.tryGetRetryAfterInMsFromError(r);if(!s.retryService.canRetryStatusCode(a,e.useRetryForResponseCodes))return o.throwError(r);if(!s.retryService.canRetry(t.startTime,e.maxCumulativeWaitTimeMs))return o.throwError(r);var c=s.retryService.getNextWaitTimeMs(e.addJitter,e.deltaBackoffMs,i,u);return s.retryService.debugLogAttempt(i,c),o.timer(c)})))}}};t.ObservableRetryStrategy=i,t.observableRetryStrategy=new i},function(e,r){e.exports=t},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extractHeadersFromAxiosResponse=function(e){for(var t=[],r=0,o=Object.keys(e.headers);r<o.length;r++){var n=o[r];t.push({header:n,value:e.headers[n]})}return t}},function(e,t,r){"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),o=0;o<r.length;o++)r[o]=arguments[o];return e.apply(t,r)}}},function(e,t,r){"use strict";var o=r(0);function n(e){return encodeURIComponent(e).replace(/%40/gi,"@").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 s;if(r)s=r(t);else if(o.isURLSearchParams(t))s=t.toString();else{var i=[];o.forEach(t,(function(e,t){null!=e&&(o.isArray(e)?t+="[]":e=[e],o.forEach(e,(function(e){o.isDate(e)?e=e.toISOString():o.isObject(e)&&(e=JSON.stringify(e)),i.push(n(t)+"="+n(e))})))})),s=i.join("&")}if(s){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}},function(e,t,r){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,r){"use strict";(function(t){var o=r(0),n=r(34),s={"Content-Type":"application/x-www-form-urlencoded"};function i(e,t){!o.isUndefined(e)&&o.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var a,u={adapter:(void 0!==t&&"[object process]"===Object.prototype.toString.call(t)?a=r(10):"undefined"!=typeof XMLHttpRequest&&(a=r(10)),a),transformRequest:[function(e,t){return n(t,"Accept"),n(t,"Content-Type"),o.isFormData(e)||o.isArrayBuffer(e)||o.isBuffer(e)||o.isStream(e)||o.isFile(e)||o.isBlob(e)?e:o.isArrayBufferView(e)?e.buffer:o.isURLSearchParams(e)?(i(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):o.isObject(e)?(i(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,validateStatus:function(e){return e>=200&&e<300}};u.headers={common:{Accept:"application/json, text/plain, */*"}},o.forEach(["delete","get","head"],(function(e){u.headers[e]={}})),o.forEach(["post","put","patch"],(function(e){u.headers[e]=o.merge(s)})),e.exports=u}).call(this,r(33))},function(e,t,r){"use strict";var o=r(0),n=r(35),s=r(7),i=r(37),a=r(38),u=r(11);e.exports=function(e){return new Promise((function(t,c){var f=e.data,p=e.headers;o.isFormData(f)&&delete p["Content-Type"];var d=new XMLHttpRequest;if(e.auth){var l=e.auth.username||"",h=e.auth.password||"";p.Authorization="Basic "+btoa(l+":"+h)}if(d.open(e.method.toUpperCase(),s(e.url,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 r="getAllResponseHeaders"in d?i(d.getAllResponseHeaders()):null,o={data:e.responseType&&"text"!==e.responseType?d.response:d.responseText,status:d.status,statusText:d.statusText,headers:r,config:e,request:d};n(t,c,o),d=null}},d.onabort=function(){d&&(c(u("Request aborted",e,"ECONNABORTED",d)),d=null)},d.onerror=function(){c(u("Network Error",e,null,d)),d=null},d.ontimeout=function(){c(u("timeout of "+e.timeout+"ms exceeded",e,"ECONNABORTED",d)),d=null},o.isStandardBrowserEnv()){var m=r(39),y=(e.withCredentials||a(e.url))&&e.xsrfCookieName?m.read(e.xsrfCookieName):void 0;y&&(p[e.xsrfHeaderName]=y)}if("setRequestHeader"in d&&o.forEach(p,(function(e,t){void 0===f&&"content-type"===t.toLowerCase()?delete p[t]:d.setRequestHeader(t,e)})),e.withCredentials&&(d.withCredentials=!0),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(),c(e),d=null)})),void 0===f&&(f=null),d.send(f)}))}},function(e,t,r){"use strict";var o=r(36);e.exports=function(e,t,r,n,s){var i=new Error(e);return o(i,t,r,n,s)}},function(e,t,r){"use strict";var o=r(0);e.exports=function(e,t){t=t||{};var r={};return o.forEach(["url","method","params","data"],(function(e){void 0!==t[e]&&(r[e]=t[e])})),o.forEach(["headers","auth","proxy"],(function(n){o.isObject(t[n])?r[n]=o.deepMerge(e[n],t[n]):void 0!==t[n]?r[n]=t[n]:o.isObject(e[n])?r[n]=o.deepMerge(e[n]):void 0!==e[n]&&(r[n]=e[n])})),o.forEach(["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"],(function(o){void 0!==t[o]?r[o]=t[o]:void 0!==e[o]&&(r[o]=e[o])})),r}},function(e,t,r){"use strict";function o(e){this.message=e}o.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},o.prototype.__CANCEL__=!0,e.exports=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=r(15);function n(e,t){var r={};(e.forEach((function(e){r[e.header]=e.value})),t)&&(e.find((function(e){return e.header.toLowerCase()==="Content-Type".toLowerCase()}))||(r["Content-Type"]="application/json"));return r}function s(e){return e.then((function(e){return o.httpDebugger.debugResolveHttpRequest(),{response:e}}),(function(e){return o.httpDebugger.debugFailedHttpRequest(),{error:e}}))}t.registerResponseInterceptor=function(e,t){e.interceptors.response.use((function(e){return t(e)}),(function(e){return Promise.reject(e)}))},t.registerRequestInterceptor=function(e,t){e.interceptors.request.use((function(e){return t(e)}),(function(e){return Promise.reject(e)}))},t.getCallback=function(e,t,r){return o.httpDebugger.debugStartHttpRequest(),s(e.get(t.url,{headers:n(r&&r.headers?r.headers:[],!1),responseType:r&&r.responseType?r.responseType:void 0}))},t.putCallback=function(e,t,r){return o.httpDebugger.debugStartHttpRequest(),s(e.put(t.url,t.body,{headers:n(r&&r.headers?r.headers:[],!0),responseType:r&&r.responseType?r.responseType:void 0}))},t.patchCallback=function(e,t,r){return o.httpDebugger.debugStartHttpRequest(),s(e.patch(t.url,t.body,{headers:n(r&&r.headers?r.headers:[],!0),responseType:r&&r.responseType?r.responseType:void 0}))},t.deleteCallback=function(e,t,r){return o.httpDebugger.debugStartHttpRequest(),s(e.delete(t.url,{headers:n(r&&r.headers?r.headers:[],!0),responseType:r&&r.responseType?r.responseType:void 0}))},t.postCallback=function(e,t,r){return o.httpDebugger.debugStartHttpRequest(),s(e.post(t.url,t.body,{headers:n(r&&r.headers?r.headers:[],!0),responseType:r&&r.responseType?r.responseType:void 0}))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(){}return e.prototype.debugStartHttpRequest=function(){},e.prototype.debugResolveHttpRequest=function(){},e.prototype.debugFailedHttpRequest=function(){},e}();t.HttpDebugger=o,t.httpDebugger=new o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){Object.assign(this,e)};t.BaseKontentError=o},function(e,t,r){"use strict";function o(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0}),o(r(18)),o(r(22)),o(r(24)),o(r(46))},function(e,t,r){"use strict";function o(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0}),o(r(19)),o(r(20)),o(r(21))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(){}return e.prototype.addOptionsToUrl=function(e,t){return t&&t.forEach((function(t){e=e.indexOf("?")>-1?e+"&"+t.getParam()+"="+t.getParamValue():e+"?"+t.getParam()+"="+t.getParamValue()})),e},e}();t.UrlHelper=o,t.urlHelper=new o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(){this.sdkVersionHeader="X-KC-SDKID"}return e.prototype.getSdkIdHeader=function(e){return{header:this.sdkVersionHeader,value:e.host+";"+e.name+";"+e.version}},e}();t.HeaderHelper=o,t.headerHelper=new o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(){}return e.prototype.getAllNames=function(e){var t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(r);return t},e.prototype.getAllValues=function(e){return Object.keys(e).map((function(t){return e[t]}))},e.prototype.getEnumFromValue=function(e,t){try{if(!t)return;if(this.isNumeric(t))return e[t];var r=this.getAllValues(e).find((function(e){return e.toLowerCase()===t.toString().toLowerCase()}));if(!r)return;return r}catch(e){return}},e.prototype.getEnumFromName=function(e,t){for(var r=0,o=this.getAllNames(e);r<o.length;r++){var n=o[r];if(n.toLowerCase()===t.toLowerCase())return e[n]}},e.prototype.isNumeric=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},e}();t.EnumHelper=o,t.enumHelper=new o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(23))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){var t=function(){function e(e,t){if(this.name=e,this.value=t,!e)throw Error("Name of the custom parameter is not specified")}return e.prototype.getParam=function(){return this.name},e.prototype.getParamValue=function(){return this.value},e}();e.CustomParameter=t}(t.Parameters||(t.Parameters={}))},function(e,t,r){"use strict";function o(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0}),o(r(3)),o(r(25)),o(r(44)),o(r(14)),o(r(15)),o(r(45)),o(r(2))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=r(26),n=r(1),s=r(4),i=r(5),a=r(14),u=r(3),c=r(2),f=function(){function e(e){this.axiosInstance=o.default.create(e&&e.axiosRequestConfig?e.axiosRequestConfig:void 0),e&&(e.requestInterceptor&&a.registerRequestInterceptor(this.axiosInstance,e.requestInterceptor),e.responseInterceptor&&a.registerResponseInterceptor(this.axiosInstance,e.responseInterceptor))}return e.prototype.get=function(e,t){var r=this,o=n.defer((function(){return n.from(a.getCallback(r.axiosInstance,e,t))}));return this.mapAxiosObservable(o,e,t)},e.prototype.post=function(e,t){var r=this,o=n.defer((function(){return n.from(a.postCallback(r.axiosInstance,e,t))}));return this.mapAxiosObservable(o,e,t)},e.prototype.put=function(e,t){var r=this,o=n.defer((function(){return n.from(a.putCallback(r.axiosInstance,e,t))}));return this.mapAxiosObservable(o,e,t)},e.prototype.patch=function(e,t){var r=this,o=n.defer((function(){return n.from(a.patchCallback(r.axiosInstance,e,t))}));return this.mapAxiosObservable(o,e,t)},e.prototype.delete=function(e,t){var r=this,o=n.defer((function(){return n.from(a.deleteCallback(r.axiosInstance,e,t))}));return this.mapAxiosObservable(o,e,t)},e.prototype.mapAxiosObservable=function(e,t,r){var o=this;return e.pipe(s.map((function(e){return o.mapResult(e)})),s.retryWhen(u.observableRetryStrategy.strategy(c.retryService.getRetryStrategyFromHttpQueryOptions(r),{startTime:new Date})),s.catchError((function(e){return r&&r.logErrorToConsole&&console.error("Kentico Kontent Core SDK encountered an error: ",e),n.throwError({originalError:e,mappedError:t.mapError(e)})})))},e.prototype.mapResult=function(e){if(e.error)throw e.error;if(!e.response)throw Error("Response is not set and no error was thrown");return{data:e.response.data,response:e.response,headers:i.extractHeadersFromAxiosResponse(e.response),status:e.response.status}},e}();t.HttpService=f},function(e,t,r){e.exports=r(27)},function(e,t,r){"use strict";var o=r(0),n=r(6),s=r(29),i=r(12);function a(e){var t=new s(e),r=n(s.prototype.request,t);return o.extend(r,s.prototype,t),o.extend(r,t),r}var u=a(r(9));u.Axios=s,u.create=function(e){return a(i(u.defaults,e))},u.Cancel=r(13),u.CancelToken=r(42),u.isCancel=r(8),u.all=function(e){return Promise.all(e)},u.spread=r(43),e.exports=u,e.exports.default=u},function(e,t){
/*!

@@ -8,3 +8,3 @@ * Determine if an object is a Buffer

*/
e.exports=function(e){return null!=e&&null!=e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}},function(e,t,r){"use strict";var o=r(0),n=r(8),s=r(31),i=r(32),a=r(13);function u(e){this.defaults=e,this.interceptors={request:new s,response:new s}}u.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=a(this.defaults,e)).method=e.method?e.method.toLowerCase():"get";var t=[i,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=a(this.defaults,e),n(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},o.forEach(["delete","get","head","options"],(function(e){u.prototype[e]=function(t,r){return this.request(o.merge(r||{},{method:e,url:t}))}})),o.forEach(["post","put","patch"],(function(e){u.prototype[e]=function(t,r,n){return this.request(o.merge(n||{},{method:e,url:t,data:r}))}})),e.exports=u},function(e,t,r){"use strict";var o=r(0);function n(){this.handlers=[]}n.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},n.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},n.prototype.forEach=function(e){o.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=n},function(e,t,r){"use strict";var o=r(0),n=r(33),s=r(9),i=r(10),a=r(41),u=r(42);function c(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return c(e),e.baseURL&&!a(e.url)&&(e.url=u(e.baseURL,e.url)),e.headers=e.headers||{},e.data=n(e.data,e.headers,e.transformRequest),e.headers=o.merge(e.headers.common||{},e.headers[e.method]||{},e.headers||{}),o.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||i.adapter)(e).then((function(t){return c(e),t.data=n(t.data,t.headers,e.transformResponse),t}),(function(t){return s(t)||(c(e),t&&t.response&&(t.response.data=n(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},function(e,t,r){"use strict";var o=r(0);e.exports=function(e,t,r){return o.forEach(r,(function(r){e=r(e,t)})),e}},function(e,t){var r,o,n=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(e){if(r===setTimeout)return setTimeout(e,0);if((r===s||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:s}catch(e){r=s}try{o="function"==typeof clearTimeout?clearTimeout:i}catch(e){o=i}}();var u,c=[],f=!1,p=-1;function d(){f&&u&&(f=!1,u.length?c=u.concat(c):p=-1,c.length&&l())}function l(){if(!f){var e=a(d);f=!0;for(var t=c.length;t;){for(u=c,c=[];++p<t;)u&&u[p].run();p=-1,t=c.length}u=null,f=!1,function(e){if(o===clearTimeout)return clearTimeout(e);if((o===i||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(e);try{o(e)}catch(t){try{return o.call(null,e)}catch(t){return o.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function y(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];c.push(new h(e,t)),1!==c.length||f||a(l)},h.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=y,n.addListener=y,n.once=y,n.off=y,n.removeListener=y,n.removeAllListeners=y,n.emit=y,n.prependListener=y,n.prependOnceListener=y,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},function(e,t,r){"use strict";var o=r(0);e.exports=function(e,t){o.forEach(e,(function(r,o){o!==t&&o.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[o])}))}},function(e,t,r){"use strict";var o=r(12);e.exports=function(e,t,r){var n=r.config.validateStatus;!n||n(r.status)?e(r):t(o("Request failed with status code "+r.status,r.config,null,r.request,r))}},function(e,t,r){"use strict";e.exports=function(e,t,r,o,n){return e.config=t,r&&(e.code=r),e.request=o,e.response=n,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}},function(e,t,r){"use strict";var o=r(0),n=["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,s,i={};return e?(o.forEach(e.split("\n"),(function(e){if(s=e.indexOf(":"),t=o.trim(e.substr(0,s)).toLowerCase(),r=o.trim(e.substr(s+1)),t){if(i[t]&&n.indexOf(t)>=0)return;i[t]="set-cookie"===t?(i[t]?i[t]:[]).concat([r]):i[t]?i[t]+", "+r:r}})),i):i}},function(e,t,r){"use strict";var o=r(0);e.exports=o.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function n(e){var o=e;return t&&(r.setAttribute("href",o),o=r.href),r.setAttribute("href",o),{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=n(window.location.href),function(t){var r=o.isString(t)?n(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},function(e,t,r){"use strict";var o=r(0);e.exports=o.isStandardBrowserEnv()?{write:function(e,t,r,n,s,i){var a=[];a.push(e+"="+encodeURIComponent(t)),o.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),o.isString(n)&&a.push("path="+n),o.isString(s)&&a.push("domain="+s),!0===i&&a.push("secure"),document.cookie=a.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(){}}},function(e,t,r){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t,r){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,r){"use strict";var o=r(14);function n(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 o(e),t(r.reason))}))}n.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},n.source=function(){var e;return{token:new n((function(t){e=t})),cancel:e}},e.exports=n},function(e,t,r){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(e,t){this.response=e,this.error=t};t.IHttpRequestResult=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=r(2),n=function(){function e(e){this.throwError=!1,this.fakeResponseJson=void 0,this.errorJson=void 0,this.fakeHeaders=[],this.fakeStatusCode=200,Object.assign(this,e)}return e.prototype.retryPromise=function(e,t){return console.log("Retry is not implemented in test service. Returning original Promise"),e},e.prototype.get=function(e,t){if(this.throwError){var r={response:{data:this.errorJson}};return o.throwError({originalError:r,mappedError:e.mapError(r),headers:this.fakeHeaders,status:this.fakeStatusCode})}return o.of({data:this.fakeResponseJson,response:void 0,headers:this.fakeHeaders,status:this.fakeStatusCode})},e.prototype.post=function(e,t){if(this.throwError){var r={response:{data:this.errorJson}};return o.throwError({originalError:r,mappedError:e.mapError(r),headers:this.fakeHeaders,status:this.fakeStatusCode})}return o.of({data:this.fakeResponseJson,response:void 0,headers:this.fakeHeaders,status:this.fakeStatusCode})},e.prototype.put=function(e,t){if(this.throwError){var r={response:{data:this.errorJson}};return o.throwError({originalError:r,mappedError:e.mapError(r),headers:this.fakeHeaders,status:this.fakeStatusCode})}return o.of({data:this.fakeResponseJson,response:void 0,headers:this.fakeHeaders,status:this.fakeStatusCode})},e.prototype.patch=function(e,t){if(this.throwError){var r={response:{data:this.errorJson}};return o.throwError({originalError:r,mappedError:e.mapError(r),headers:this.fakeHeaders,status:this.fakeStatusCode})}return o.of({data:this.fakeResponseJson,response:void 0,headers:[],status:this.fakeStatusCode})},e.prototype.delete=function(e,t){if(this.throwError){var r={response:{data:this.errorJson}};return o.throwError({originalError:r,mappedError:e.mapError(r),headers:this.fakeHeaders,status:this.fakeStatusCode})}return o.of({data:this.fakeResponseJson,response:void 0,headers:this.fakeHeaders,status:this.fakeStatusCode})},e}();t.TestHttpService=n},function(e,t,r){"use strict";function o(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0}),o(r(17)),o(r(48))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=r(17),n={errorCode:"error_code",message:"message",requestId:"request_id",specificCode:"specific_code"};t.mapBaseKontentError=function(e){if(e.response&&e.response.data&&e.response.data[n.requestId]){var t=e.response.data;return new o.BaseKontentError({requestId:t[n.requestId],message:t[n.message]?t[n.message]:"",errorCode:t[n.errorCode]?t[n.errorCode]:0,specificCode:t[n.specificCode]?t[n.specificCode]:0,originalError:e})}return e.request,e}}])}));
e.exports=function(e){return null!=e&&null!=e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}},function(e,t,r){"use strict";var o=r(0),n=r(7),s=r(30),i=r(31),a=r(12);function u(e){this.defaults=e,this.interceptors={request:new s,response:new s}}u.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=a(this.defaults,e)).method=e.method?e.method.toLowerCase():"get";var t=[i,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=a(this.defaults,e),n(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},o.forEach(["delete","get","head","options"],(function(e){u.prototype[e]=function(t,r){return this.request(o.merge(r||{},{method:e,url:t}))}})),o.forEach(["post","put","patch"],(function(e){u.prototype[e]=function(t,r,n){return this.request(o.merge(n||{},{method:e,url:t,data:r}))}})),e.exports=u},function(e,t,r){"use strict";var o=r(0);function n(){this.handlers=[]}n.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},n.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},n.prototype.forEach=function(e){o.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=n},function(e,t,r){"use strict";var o=r(0),n=r(32),s=r(8),i=r(9),a=r(40),u=r(41);function c(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return c(e),e.baseURL&&!a(e.url)&&(e.url=u(e.baseURL,e.url)),e.headers=e.headers||{},e.data=n(e.data,e.headers,e.transformRequest),e.headers=o.merge(e.headers.common||{},e.headers[e.method]||{},e.headers||{}),o.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||i.adapter)(e).then((function(t){return c(e),t.data=n(t.data,t.headers,e.transformResponse),t}),(function(t){return s(t)||(c(e),t&&t.response&&(t.response.data=n(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},function(e,t,r){"use strict";var o=r(0);e.exports=function(e,t,r){return o.forEach(r,(function(r){e=r(e,t)})),e}},function(e,t){var r,o,n=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(e){if(r===setTimeout)return setTimeout(e,0);if((r===s||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:s}catch(e){r=s}try{o="function"==typeof clearTimeout?clearTimeout:i}catch(e){o=i}}();var u,c=[],f=!1,p=-1;function d(){f&&u&&(f=!1,u.length?c=u.concat(c):p=-1,c.length&&l())}function l(){if(!f){var e=a(d);f=!0;for(var t=c.length;t;){for(u=c,c=[];++p<t;)u&&u[p].run();p=-1,t=c.length}u=null,f=!1,function(e){if(o===clearTimeout)return clearTimeout(e);if((o===i||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(e);try{o(e)}catch(t){try{return o.call(null,e)}catch(t){return o.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function m(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];c.push(new h(e,t)),1!==c.length||f||a(l)},h.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=m,n.addListener=m,n.once=m,n.off=m,n.removeListener=m,n.removeAllListeners=m,n.emit=m,n.prependListener=m,n.prependOnceListener=m,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},function(e,t,r){"use strict";var o=r(0);e.exports=function(e,t){o.forEach(e,(function(r,o){o!==t&&o.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[o])}))}},function(e,t,r){"use strict";var o=r(11);e.exports=function(e,t,r){var n=r.config.validateStatus;!n||n(r.status)?e(r):t(o("Request failed with status code "+r.status,r.config,null,r.request,r))}},function(e,t,r){"use strict";e.exports=function(e,t,r,o,n){return e.config=t,r&&(e.code=r),e.request=o,e.response=n,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}},function(e,t,r){"use strict";var o=r(0),n=["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,s,i={};return e?(o.forEach(e.split("\n"),(function(e){if(s=e.indexOf(":"),t=o.trim(e.substr(0,s)).toLowerCase(),r=o.trim(e.substr(s+1)),t){if(i[t]&&n.indexOf(t)>=0)return;i[t]="set-cookie"===t?(i[t]?i[t]:[]).concat([r]):i[t]?i[t]+", "+r:r}})),i):i}},function(e,t,r){"use strict";var o=r(0);e.exports=o.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function n(e){var o=e;return t&&(r.setAttribute("href",o),o=r.href),r.setAttribute("href",o),{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=n(window.location.href),function(t){var r=o.isString(t)?n(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},function(e,t,r){"use strict";var o=r(0);e.exports=o.isStandardBrowserEnv()?{write:function(e,t,r,n,s,i){var a=[];a.push(e+"="+encodeURIComponent(t)),o.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),o.isString(n)&&a.push("path="+n),o.isString(s)&&a.push("domain="+s),!0===i&&a.push("secure"),document.cookie=a.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(){}}},function(e,t,r){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t,r){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,r){"use strict";var o=r(13);function n(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 o(e),t(r.reason))}))}n.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},n.source=function(){var e;return{token:new n((function(t){e=t})),cancel:e}},e.exports=n},function(e,t,r){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(e,t){this.response=e,this.error=t};t.IHttpRequestResult=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=r(1),n=function(){function e(e){this.throwError=!1,this.fakeResponseJson=void 0,this.errorJson=void 0,this.fakeHeaders=[],this.fakeStatusCode=200,Object.assign(this,e)}return e.prototype.get=function(e,t){if(this.throwError){var r={response:{data:this.errorJson}};return o.throwError({originalError:r,mappedError:e.mapError(r),headers:this.fakeHeaders,status:this.fakeStatusCode})}return o.of({data:this.fakeResponseJson,response:void 0,headers:this.fakeHeaders,status:this.fakeStatusCode})},e.prototype.post=function(e,t){if(this.throwError){var r={response:{data:this.errorJson}};return o.throwError({originalError:r,mappedError:e.mapError(r),headers:this.fakeHeaders,status:this.fakeStatusCode})}return o.of({data:this.fakeResponseJson,response:void 0,headers:this.fakeHeaders,status:this.fakeStatusCode})},e.prototype.put=function(e,t){if(this.throwError){var r={response:{data:this.errorJson}};return o.throwError({originalError:r,mappedError:e.mapError(r),headers:this.fakeHeaders,status:this.fakeStatusCode})}return o.of({data:this.fakeResponseJson,response:void 0,headers:this.fakeHeaders,status:this.fakeStatusCode})},e.prototype.patch=function(e,t){if(this.throwError){var r={response:{data:this.errorJson}};return o.throwError({originalError:r,mappedError:e.mapError(r),headers:this.fakeHeaders,status:this.fakeStatusCode})}return o.of({data:this.fakeResponseJson,response:void 0,headers:[],status:this.fakeStatusCode})},e.prototype.delete=function(e,t){if(this.throwError){var r={response:{data:this.errorJson}};return o.throwError({originalError:r,mappedError:e.mapError(r),headers:this.fakeHeaders,status:this.fakeStatusCode})}return o.of({data:this.fakeResponseJson,response:void 0,headers:this.fakeHeaders,status:this.fakeStatusCode})},e}();t.TestHttpService=n},function(e,t,r){"use strict";function o(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0}),o(r(16)),o(r(47))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=r(16),n={errorCode:"error_code",message:"message",requestId:"request_id",specificCode:"specific_code"};t.mapBaseKontentError=function(e){if(e.response&&e.response.data&&e.response.data[n.requestId]){var t=e.response.data;return new o.BaseKontentError({requestId:t[n.requestId],message:t[n.message]?t[n.message]:"",errorCode:t[n.errorCode]?t[n.errorCode]:0,specificCode:t[n.specificCode]?t[n.specificCode]:0,originalError:e})}return e.request,e}}])}));
//# sourceMappingURL=kontent-core.umd.min.js.map
import { AxiosInstance, AxiosResponse } from 'axios';
import { IHeader, IHttpDeleteQueryCall, IHttpGetQueryCall, IHttpPatchQueryCall, IHttpPostQueryCall, IHttpPutQueryCall, IHttpQueryOptions, IHttpRequestConfig, IHttpRequestResponse, IHttpRequestResult } from './http.models';
import { IHttpDeleteQueryCall, IHttpGetQueryCall, IHttpPatchQueryCall, IHttpPostQueryCall, IHttpPutQueryCall, IHttpQueryOptions, IHttpRequestConfig, IHttpRequestResponse, IHttpRequestResult } from './http.models';
export declare function registerResponseInterceptor(instance: AxiosInstance, interceptor: (response: IHttpRequestResponse) => IHttpRequestResponse): void;
export declare function registerRequestInterceptor(instance: AxiosInstance, interceptor: (config: IHttpRequestConfig) => IHttpRequestConfig): void;
export declare function getCallback<TError>(instance: AxiosInstance, call: IHttpGetQueryCall<TError>, options: IHttpQueryOptions | undefined, callback: (response: IHttpRequestResult<AxiosResponse>) => void): void;
export declare function putCallback<TError>(instance: AxiosInstance, call: IHttpPutQueryCall<TError>, options: IHttpQueryOptions | undefined, callback: (response: IHttpRequestResult<AxiosResponse>) => void): void;
export declare function patchCallback<TError>(instance: AxiosInstance, call: IHttpPatchQueryCall<TError>, options: IHttpQueryOptions | undefined, callback: (response: IHttpRequestResult<AxiosResponse>) => void): void;
export declare function deleteCallback<TError>(instance: AxiosInstance, call: IHttpDeleteQueryCall<TError>, options: IHttpQueryOptions | undefined, callback: (response: IHttpRequestResult<AxiosResponse>) => void): void;
export declare function postCallback<TError>(instance: AxiosInstance, call: IHttpPostQueryCall<TError>, options: IHttpQueryOptions | undefined, callback: (response: IHttpRequestResult<AxiosResponse>) => void): void;
export declare function getHeadersJson(headers: IHeader[], addContentTypeHeader: boolean): {
[header: string]: string;
};
export declare function getCallback<TError>(instance: AxiosInstance, call: IHttpGetQueryCall<TError>, options: IHttpQueryOptions | undefined): Promise<IHttpRequestResult<AxiosResponse>>;
export declare function putCallback<TError>(instance: AxiosInstance, call: IHttpPutQueryCall<TError>, options: IHttpQueryOptions | undefined): Promise<IHttpRequestResult<AxiosResponse>>;
export declare function patchCallback<TError>(instance: AxiosInstance, call: IHttpPatchQueryCall<TError>, options: IHttpQueryOptions | undefined): Promise<IHttpRequestResult<AxiosResponse>>;
export declare function deleteCallback<TError>(instance: AxiosInstance, call: IHttpDeleteQueryCall<TError>, options: IHttpQueryOptions | undefined): Promise<IHttpRequestResult<AxiosResponse>>;
export declare function postCallback<TError>(instance: AxiosInstance, call: IHttpPostQueryCall<TError>, options: IHttpQueryOptions | undefined): Promise<IHttpRequestResult<AxiosResponse>>;

@@ -21,3 +21,3 @@ "use strict";

exports.registerRequestInterceptor = registerRequestInterceptor;
function getCallback(instance, call, options, callback) {
function getCallback(instance, call, options) {
http_debugger_1.httpDebugger.debugStartHttpRequest();

@@ -28,16 +28,6 @@ var axiosPromise = instance.get(call.url, {

});
axiosPromise.then(function (response) {
http_debugger_1.httpDebugger.debugResolveHttpRequest();
callback({
response: response
});
}, function (error) {
http_debugger_1.httpDebugger.debugFailedHttpRequest();
callback({
error: error
});
});
return mapRequestResult(axiosPromise);
}
exports.getCallback = getCallback;
function putCallback(instance, call, options, callback) {
function putCallback(instance, call, options) {
http_debugger_1.httpDebugger.debugStartHttpRequest();

@@ -48,16 +38,6 @@ var axiosPromise = instance.put(call.url, call.body, {

});
axiosPromise.then(function (response) {
http_debugger_1.httpDebugger.debugResolveHttpRequest();
callback({
response: response
});
}, function (error) {
http_debugger_1.httpDebugger.debugFailedHttpRequest();
callback({
error: error
});
});
return mapRequestResult(axiosPromise);
}
exports.putCallback = putCallback;
function patchCallback(instance, call, options, callback) {
function patchCallback(instance, call, options) {
http_debugger_1.httpDebugger.debugStartHttpRequest();

@@ -68,16 +48,6 @@ var axiosPromise = instance.patch(call.url, call.body, {

});
axiosPromise.then(function (response) {
http_debugger_1.httpDebugger.debugResolveHttpRequest();
callback({
response: response
});
}, function (error) {
http_debugger_1.httpDebugger.debugFailedHttpRequest();
callback({
error: error
});
});
return mapRequestResult(axiosPromise);
}
exports.patchCallback = patchCallback;
function deleteCallback(instance, call, options, callback) {
function deleteCallback(instance, call, options) {
http_debugger_1.httpDebugger.debugStartHttpRequest();

@@ -88,16 +58,6 @@ var axiosPromise = instance.delete(call.url, {

});
axiosPromise.then(function (response) {
http_debugger_1.httpDebugger.debugResolveHttpRequest();
callback({
response: response
});
}, function (error) {
http_debugger_1.httpDebugger.debugFailedHttpRequest();
callback({
error: error
});
});
return mapRequestResult(axiosPromise);
}
exports.deleteCallback = deleteCallback;
function postCallback(instance, call, options, callback) {
function postCallback(instance, call, options) {
http_debugger_1.httpDebugger.debugStartHttpRequest();

@@ -108,13 +68,3 @@ var axiosPromise = instance.post(call.url, call.body, {

});
axiosPromise.then(function (response) {
http_debugger_1.httpDebugger.debugResolveHttpRequest();
callback({
response: response
});
}, function (error) {
http_debugger_1.httpDebugger.debugFailedHttpRequest();
callback({
error: error
});
});
return mapRequestResult(axiosPromise);
}

@@ -136,3 +86,15 @@ exports.postCallback = postCallback;

}
exports.getHeadersJson = getHeadersJson;
function mapRequestResult(promise) {
return promise.then(function (response) {
http_debugger_1.httpDebugger.debugResolveHttpRequest();
return {
response: response
};
}, function (error) {
http_debugger_1.httpDebugger.debugFailedHttpRequest();
return {
error: error
};
});
}
//# sourceMappingURL=http.functions.js.map

@@ -123,3 +123,3 @@ export interface IBaseResponse<TRawData> {

}
export declare class IHttpRequestResult<TResponse> {
export declare class IHttpRequestResult<TResponse = any> {
response?: TResponse | undefined;

@@ -126,0 +126,0 @@ error?: any;

import { AxiosRequestConfig } from 'axios';
import { Observable } from 'rxjs';
import { IBaseResponse, IHttpDeleteQueryCall, IHttpGetQueryCall, IHttpPatchQueryCall, IHttpPostQueryCall, IHttpPutQueryCall, IHttpQueryOptions, IHttpRequestConfig, IHttpRequestResponse, IRetryStrategyOptions } from './http.models';
import { IBaseResponse, IHttpDeleteQueryCall, IHttpGetQueryCall, IHttpPatchQueryCall, IHttpPostQueryCall, IHttpPutQueryCall, IHttpQueryOptions, IHttpRequestConfig, IHttpRequestResponse } from './http.models';
import { IHttpService } from './ihttp.service';

@@ -12,8 +12,2 @@ export declare class HttpService implements IHttpService {

});
/**
* Retries given promise based on given configuration
* @param promise Promise to retry
* @param options Configuration options
*/
retryPromise<T>(promise: Promise<T>, options?: IRetryStrategyOptions): Promise<T>;
get<TError extends any, TRawData extends any>(call: IHttpGetQueryCall<TError>, options?: IHttpQueryOptions): Observable<IBaseResponse<TRawData>>;

@@ -20,0 +14,0 @@ post<TError extends any, TRawData extends any>(call: IHttpPostQueryCall<TError>, options?: IHttpQueryOptions): Observable<IBaseResponse<TRawData>>;

@@ -9,3 +9,2 @@ "use strict";

var observable_retry_strategy_1 = require("./observable-retry-strategy");
var promise_retry_strategy_1 = require("./promise-retry-strategy");
var retry_service_1 = require("./retry-service");

@@ -24,46 +23,40 @@ var HttpService = /** @class */ (function () {

}
/**
* Retries given promise based on given configuration
* @param promise Promise to retry
* @param options Configuration options
*/
HttpService.prototype.retryPromise = function (promise, options) {
return promise_retry_strategy_1.promiseRetryStrategy.getPromiseWithRetryStrategy(promise, retry_service_1.retryService.getRetryStrategyFromStrategyOptions(options), {
retryAttempt: 0,
startTime: new Date()
});
};
HttpService.prototype.get = function (call, options) {
var _this = this;
// bind callback from axios promise
var axiosObservable = rxjs_1.bindCallback(HttpFunctions.getCallback);
var axiosObservable = rxjs_1.defer(function () { return rxjs_1.from(HttpFunctions.getCallback(_this.axiosInstance, call, options)); });
// map axios observable
return this.mapAxiosObservable(this.axiosInstance, axiosObservable, call, options);
return this.mapAxiosObservable(axiosObservable, call, options);
};
HttpService.prototype.post = function (call, options) {
var _this = this;
// bind callback from axios promise
var axiosObservable = rxjs_1.bindCallback(HttpFunctions.postCallback);
var axiosObservable = rxjs_1.defer(function () { return rxjs_1.from(HttpFunctions.postCallback(_this.axiosInstance, call, options)); });
// map axios observable
return this.mapAxiosObservable(this.axiosInstance, axiosObservable, call, options);
return this.mapAxiosObservable(axiosObservable, call, options);
};
HttpService.prototype.put = function (call, options) {
var _this = this;
// bind callback from axios promise
var axiosObservable = rxjs_1.bindCallback(HttpFunctions.putCallback);
var axiosObservable = rxjs_1.defer(function () { return rxjs_1.from(HttpFunctions.putCallback(_this.axiosInstance, call, options)); });
// map axios observable
return this.mapAxiosObservable(this.axiosInstance, axiosObservable, call, options);
return this.mapAxiosObservable(axiosObservable, call, options);
};
HttpService.prototype.patch = function (call, options) {
var _this = this;
// bind callback from axios promise
var axiosObservable = rxjs_1.bindCallback(HttpFunctions.patchCallback);
var axiosObservable = rxjs_1.defer(function () { return rxjs_1.from(HttpFunctions.patchCallback(_this.axiosInstance, call, options)); });
// map axios observable
return this.mapAxiosObservable(this.axiosInstance, axiosObservable, call, options);
return this.mapAxiosObservable(axiosObservable, call, options);
};
HttpService.prototype.delete = function (call, options) {
var _this = this;
// bind callback from axios promise
var axiosObservable = rxjs_1.bindCallback(HttpFunctions.deleteCallback);
var axiosObservable = rxjs_1.defer(function () { return rxjs_1.from(HttpFunctions.deleteCallback(_this.axiosInstance, call, options)); });
// map axios observable
return this.mapAxiosObservable(this.axiosInstance, axiosObservable, call, options);
return this.mapAxiosObservable(axiosObservable, call, options);
};
HttpService.prototype.mapAxiosObservable = function (axiosInstance, axiosObservable, call, options) {
HttpService.prototype.mapAxiosObservable = function (axiosObservable, call, options) {
var _this = this;
return axiosObservable(axiosInstance, call, options).pipe(operators_1.map(function (result) { return _this.mapResult(result); }), operators_1.retryWhen(observable_retry_strategy_1.observableRetryStrategy.strategy(retry_service_1.retryService.getRetryStrategyFromHttpQueryOptions(options), {
return axiosObservable.pipe(operators_1.map(function (result) { return _this.mapResult(result); }), operators_1.retryWhen(observable_retry_strategy_1.observableRetryStrategy.strategy(retry_service_1.retryService.getRetryStrategyFromHttpQueryOptions(options), {
startTime: new Date()

@@ -70,0 +63,0 @@ })), operators_1.catchError(function (error) {

import { Observable } from 'rxjs';
import { IBaseResponse, IHttpDeleteQueryCall, IHttpGetQueryCall, IHttpPostQueryCall, IHttpPutQueryCall, IHttpQueryOptions, IHttpPatchQueryCall, IRetryStrategyOptions } from './http.models';
import { IBaseResponse, IHttpDeleteQueryCall, IHttpGetQueryCall, IHttpPostQueryCall, IHttpPutQueryCall, IHttpQueryOptions, IHttpPatchQueryCall } from './http.models';
export interface IHttpService {
retryPromise<T>(promise: Promise<T>, options?: IRetryStrategyOptions): Promise<T>;
post<TError extends any, TRawData extends any>(call: IHttpPostQueryCall<TError>, options?: IHttpQueryOptions): Observable<IBaseResponse<TRawData>>;

@@ -6,0 +5,0 @@ get<TError extends any, TRawData extends any>(call: IHttpGetQueryCall<TError>, options?: IHttpQueryOptions): Observable<IBaseResponse<TRawData>>;

export * from './ihttp.service';
export * from './observable-retry-strategy';
export * from './promise-retry-strategy';
export * from './http.service';

@@ -5,0 +4,0 @@ export * from './http.models';

@@ -7,3 +7,2 @@ "use strict";

__export(require("./observable-retry-strategy"));
__export(require("./promise-retry-strategy"));
__export(require("./http.service"));

@@ -10,0 +9,0 @@ __export(require("./http.models"));

@@ -6,4 +6,4 @@ import { Observable } from 'rxjs';

startTime: Date;
}) => (attempts: Observable<any>) => Observable<number>;
}) => (errorObs: Observable<any>) => Observable<number>;
}
export declare const observableRetryStrategy: ObservableRetryStrategy;

@@ -8,13 +8,9 @@ "use strict";

function ObservableRetryStrategy() {
this.strategy = function (options, internal) { return function (attempts) {
console.log('get retry strategy', attempts);
return attempts.pipe(operators_1.mergeMap(function (error, i) {
console.log('attempt', i);
this.strategy = function (options, internal) { return function (errorObs) {
return errorObs.pipe(operators_1.flatMap(function (error, i) {
var retryAttempt = i + 1;
var statusCode = retry_service_1.retryService.getStatusCodeFromError(error);
var retryAfter = retry_service_1.retryService.tryGetRetryAfterInMsFromError(error);
console.log(statusCode, retryAfter);
if (!retry_service_1.retryService.canRetryStatusCode(statusCode, options.useRetryForResponseCodes)) {
// request with given status code cannot be retried
console.log('no retry 1');
return rxjs_1.throwError(error);

@@ -24,3 +20,2 @@ }

// request should not be retried anymore
console.log('no retry 1');
return rxjs_1.throwError(error);

@@ -32,3 +27,2 @@ }

retry_service_1.retryService.debugLogAttempt(retryAttempt, waitTime);
console.log('wait', waitTime);
return rxjs_1.timer(waitTime);

@@ -35,0 +29,0 @@ }));

import { Observable } from 'rxjs';
import { IBaseResponse, IHttpDeleteQueryCall, IHttpGetQueryCall, IHttpPatchQueryCall, IHttpPostQueryCall, IHttpPutQueryCall, IHttpQueryOptions, IHeader, IRetryStrategyOptions } from './http.models';
import { IBaseResponse, IHeader, IHttpDeleteQueryCall, IHttpGetQueryCall, IHttpPatchQueryCall, IHttpPostQueryCall, IHttpPutQueryCall, IHttpQueryOptions } from './http.models';
import { IHttpService } from './ihttp.service';

@@ -17,3 +17,2 @@ export declare class TestHttpService implements IHttpService {

});
retryPromise<T>(promise: Promise<T>, options?: IRetryStrategyOptions): Promise<T>;
get<TError extends any, TRawData extends any>(call: IHttpGetQueryCall<TError>, options?: IHttpQueryOptions): Observable<IBaseResponse<TRawData>>;

@@ -20,0 +19,0 @@ post<TError extends any, TRawData extends any>(call: IHttpPostQueryCall<TError>, options?: IHttpQueryOptions): Observable<IBaseResponse<TRawData>>;

@@ -13,6 +13,2 @@ "use strict";

}
TestHttpService.prototype.retryPromise = function (promise, options) {
console.log('Retry is not implemented in test service. Returning original Promise');
return promise;
};
TestHttpService.prototype.get = function (call, options) {

@@ -30,3 +26,3 @@ // throw kontent error

headers: this.fakeHeaders,
status: this.fakeStatusCode,
status: this.fakeStatusCode
});

@@ -33,0 +29,0 @@ }

@@ -5,5 +5,5 @@ "use strict";

host: 'npmjs.com',
version: '4.0.3',
version: '5.0.0',
name: '@kentico/kontent-core'
};
//# sourceMappingURL=sdk-info.generated.js.map
import { AxiosInstance, AxiosResponse } from 'axios';
import { IHeader, IHttpDeleteQueryCall, IHttpGetQueryCall, IHttpPatchQueryCall, IHttpPostQueryCall, IHttpPutQueryCall, IHttpQueryOptions, IHttpRequestConfig, IHttpRequestResponse, IHttpRequestResult } from './http.models';
import { IHttpDeleteQueryCall, IHttpGetQueryCall, IHttpPatchQueryCall, IHttpPostQueryCall, IHttpPutQueryCall, IHttpQueryOptions, IHttpRequestConfig, IHttpRequestResponse, IHttpRequestResult } from './http.models';
export declare function registerResponseInterceptor(instance: AxiosInstance, interceptor: (response: IHttpRequestResponse) => IHttpRequestResponse): void;
export declare function registerRequestInterceptor(instance: AxiosInstance, interceptor: (config: IHttpRequestConfig) => IHttpRequestConfig): void;
export declare function getCallback<TError>(instance: AxiosInstance, call: IHttpGetQueryCall<TError>, options: IHttpQueryOptions | undefined, callback: (response: IHttpRequestResult<AxiosResponse>) => void): void;
export declare function putCallback<TError>(instance: AxiosInstance, call: IHttpPutQueryCall<TError>, options: IHttpQueryOptions | undefined, callback: (response: IHttpRequestResult<AxiosResponse>) => void): void;
export declare function patchCallback<TError>(instance: AxiosInstance, call: IHttpPatchQueryCall<TError>, options: IHttpQueryOptions | undefined, callback: (response: IHttpRequestResult<AxiosResponse>) => void): void;
export declare function deleteCallback<TError>(instance: AxiosInstance, call: IHttpDeleteQueryCall<TError>, options: IHttpQueryOptions | undefined, callback: (response: IHttpRequestResult<AxiosResponse>) => void): void;
export declare function postCallback<TError>(instance: AxiosInstance, call: IHttpPostQueryCall<TError>, options: IHttpQueryOptions | undefined, callback: (response: IHttpRequestResult<AxiosResponse>) => void): void;
export declare function getHeadersJson(headers: IHeader[], addContentTypeHeader: boolean): {
[header: string]: string;
};
export declare function getCallback<TError>(instance: AxiosInstance, call: IHttpGetQueryCall<TError>, options: IHttpQueryOptions | undefined): Promise<IHttpRequestResult<AxiosResponse>>;
export declare function putCallback<TError>(instance: AxiosInstance, call: IHttpPutQueryCall<TError>, options: IHttpQueryOptions | undefined): Promise<IHttpRequestResult<AxiosResponse>>;
export declare function patchCallback<TError>(instance: AxiosInstance, call: IHttpPatchQueryCall<TError>, options: IHttpQueryOptions | undefined): Promise<IHttpRequestResult<AxiosResponse>>;
export declare function deleteCallback<TError>(instance: AxiosInstance, call: IHttpDeleteQueryCall<TError>, options: IHttpQueryOptions | undefined): Promise<IHttpRequestResult<AxiosResponse>>;
export declare function postCallback<TError>(instance: AxiosInstance, call: IHttpPostQueryCall<TError>, options: IHttpQueryOptions | undefined): Promise<IHttpRequestResult<AxiosResponse>>;

@@ -17,3 +17,3 @@ import { httpDebugger } from './http.debugger';

}
export function getCallback(instance, call, options, callback) {
export function getCallback(instance, call, options) {
httpDebugger.debugStartHttpRequest();

@@ -24,15 +24,5 @@ var axiosPromise = instance.get(call.url, {

});
axiosPromise.then(function (response) {
httpDebugger.debugResolveHttpRequest();
callback({
response: response
});
}, function (error) {
httpDebugger.debugFailedHttpRequest();
callback({
error: error
});
});
return mapRequestResult(axiosPromise);
}
export function putCallback(instance, call, options, callback) {
export function putCallback(instance, call, options) {
httpDebugger.debugStartHttpRequest();

@@ -43,15 +33,5 @@ var axiosPromise = instance.put(call.url, call.body, {

});
axiosPromise.then(function (response) {
httpDebugger.debugResolveHttpRequest();
callback({
response: response
});
}, function (error) {
httpDebugger.debugFailedHttpRequest();
callback({
error: error
});
});
return mapRequestResult(axiosPromise);
}
export function patchCallback(instance, call, options, callback) {
export function patchCallback(instance, call, options) {
httpDebugger.debugStartHttpRequest();

@@ -62,15 +42,5 @@ var axiosPromise = instance.patch(call.url, call.body, {

});
axiosPromise.then(function (response) {
httpDebugger.debugResolveHttpRequest();
callback({
response: response
});
}, function (error) {
httpDebugger.debugFailedHttpRequest();
callback({
error: error
});
});
return mapRequestResult(axiosPromise);
}
export function deleteCallback(instance, call, options, callback) {
export function deleteCallback(instance, call, options) {
httpDebugger.debugStartHttpRequest();

@@ -81,15 +51,5 @@ var axiosPromise = instance.delete(call.url, {

});
axiosPromise.then(function (response) {
httpDebugger.debugResolveHttpRequest();
callback({
response: response
});
}, function (error) {
httpDebugger.debugFailedHttpRequest();
callback({
error: error
});
});
return mapRequestResult(axiosPromise);
}
export function postCallback(instance, call, options, callback) {
export function postCallback(instance, call, options) {
httpDebugger.debugStartHttpRequest();

@@ -100,15 +60,5 @@ var axiosPromise = instance.post(call.url, call.body, {

});
axiosPromise.then(function (response) {
httpDebugger.debugResolveHttpRequest();
callback({
response: response
});
}, function (error) {
httpDebugger.debugFailedHttpRequest();
callback({
error: error
});
});
return mapRequestResult(axiosPromise);
}
export function getHeadersJson(headers, addContentTypeHeader) {
function getHeadersJson(headers, addContentTypeHeader) {
var headerJson = {};

@@ -127,2 +77,15 @@ headers.forEach(function (header) {

}
function mapRequestResult(promise) {
return promise.then(function (response) {
httpDebugger.debugResolveHttpRequest();
return {
response: response
};
}, function (error) {
httpDebugger.debugFailedHttpRequest();
return {
error: error
};
});
}
//# sourceMappingURL=http.functions.js.map

@@ -123,3 +123,3 @@ export interface IBaseResponse<TRawData> {

}
export declare class IHttpRequestResult<TResponse> {
export declare class IHttpRequestResult<TResponse = any> {
response?: TResponse | undefined;

@@ -126,0 +126,0 @@ error?: any;

import { AxiosRequestConfig } from 'axios';
import { Observable } from 'rxjs';
import { IBaseResponse, IHttpDeleteQueryCall, IHttpGetQueryCall, IHttpPatchQueryCall, IHttpPostQueryCall, IHttpPutQueryCall, IHttpQueryOptions, IHttpRequestConfig, IHttpRequestResponse, IRetryStrategyOptions } from './http.models';
import { IBaseResponse, IHttpDeleteQueryCall, IHttpGetQueryCall, IHttpPatchQueryCall, IHttpPostQueryCall, IHttpPutQueryCall, IHttpQueryOptions, IHttpRequestConfig, IHttpRequestResponse } from './http.models';
import { IHttpService } from './ihttp.service';

@@ -12,8 +12,2 @@ export declare class HttpService implements IHttpService {

});
/**
* Retries given promise based on given configuration
* @param promise Promise to retry
* @param options Configuration options
*/
retryPromise<T>(promise: Promise<T>, options?: IRetryStrategyOptions): Promise<T>;
get<TError extends any, TRawData extends any>(call: IHttpGetQueryCall<TError>, options?: IHttpQueryOptions): Observable<IBaseResponse<TRawData>>;

@@ -20,0 +14,0 @@ post<TError extends any, TRawData extends any>(call: IHttpPostQueryCall<TError>, options?: IHttpQueryOptions): Observable<IBaseResponse<TRawData>>;

import axios from 'axios';
import { bindCallback, throwError } from 'rxjs';
import { defer, from, throwError } from 'rxjs';
import { catchError, map, retryWhen } from 'rxjs/operators';

@@ -7,3 +7,2 @@ import { extractHeadersFromAxiosResponse } from './headers-helper';

import { observableRetryStrategy } from './observable-retry-strategy';
import { promiseRetryStrategy } from './promise-retry-strategy';
import { retryService } from './retry-service';

@@ -22,46 +21,40 @@ var HttpService = /** @class */ (function () {

}
/**
* Retries given promise based on given configuration
* @param promise Promise to retry
* @param options Configuration options
*/
HttpService.prototype.retryPromise = function (promise, options) {
return promiseRetryStrategy.getPromiseWithRetryStrategy(promise, retryService.getRetryStrategyFromStrategyOptions(options), {
retryAttempt: 0,
startTime: new Date()
});
};
HttpService.prototype.get = function (call, options) {
var _this = this;
// bind callback from axios promise
var axiosObservable = bindCallback(HttpFunctions.getCallback);
var axiosObservable = defer(function () { return from(HttpFunctions.getCallback(_this.axiosInstance, call, options)); });
// map axios observable
return this.mapAxiosObservable(this.axiosInstance, axiosObservable, call, options);
return this.mapAxiosObservable(axiosObservable, call, options);
};
HttpService.prototype.post = function (call, options) {
var _this = this;
// bind callback from axios promise
var axiosObservable = bindCallback(HttpFunctions.postCallback);
var axiosObservable = defer(function () { return from(HttpFunctions.postCallback(_this.axiosInstance, call, options)); });
// map axios observable
return this.mapAxiosObservable(this.axiosInstance, axiosObservable, call, options);
return this.mapAxiosObservable(axiosObservable, call, options);
};
HttpService.prototype.put = function (call, options) {
var _this = this;
// bind callback from axios promise
var axiosObservable = bindCallback(HttpFunctions.putCallback);
var axiosObservable = defer(function () { return from(HttpFunctions.putCallback(_this.axiosInstance, call, options)); });
// map axios observable
return this.mapAxiosObservable(this.axiosInstance, axiosObservable, call, options);
return this.mapAxiosObservable(axiosObservable, call, options);
};
HttpService.prototype.patch = function (call, options) {
var _this = this;
// bind callback from axios promise
var axiosObservable = bindCallback(HttpFunctions.patchCallback);
var axiosObservable = defer(function () { return from(HttpFunctions.patchCallback(_this.axiosInstance, call, options)); });
// map axios observable
return this.mapAxiosObservable(this.axiosInstance, axiosObservable, call, options);
return this.mapAxiosObservable(axiosObservable, call, options);
};
HttpService.prototype.delete = function (call, options) {
var _this = this;
// bind callback from axios promise
var axiosObservable = bindCallback(HttpFunctions.deleteCallback);
var axiosObservable = defer(function () { return from(HttpFunctions.deleteCallback(_this.axiosInstance, call, options)); });
// map axios observable
return this.mapAxiosObservable(this.axiosInstance, axiosObservable, call, options);
return this.mapAxiosObservable(axiosObservable, call, options);
};
HttpService.prototype.mapAxiosObservable = function (axiosInstance, axiosObservable, call, options) {
HttpService.prototype.mapAxiosObservable = function (axiosObservable, call, options) {
var _this = this;
return axiosObservable(axiosInstance, call, options).pipe(map(function (result) { return _this.mapResult(result); }), retryWhen(observableRetryStrategy.strategy(retryService.getRetryStrategyFromHttpQueryOptions(options), {
return axiosObservable.pipe(map(function (result) { return _this.mapResult(result); }), retryWhen(observableRetryStrategy.strategy(retryService.getRetryStrategyFromHttpQueryOptions(options), {
startTime: new Date()

@@ -68,0 +61,0 @@ })), catchError(function (error) {

import { Observable } from 'rxjs';
import { IBaseResponse, IHttpDeleteQueryCall, IHttpGetQueryCall, IHttpPostQueryCall, IHttpPutQueryCall, IHttpQueryOptions, IHttpPatchQueryCall, IRetryStrategyOptions } from './http.models';
import { IBaseResponse, IHttpDeleteQueryCall, IHttpGetQueryCall, IHttpPostQueryCall, IHttpPutQueryCall, IHttpQueryOptions, IHttpPatchQueryCall } from './http.models';
export interface IHttpService {
retryPromise<T>(promise: Promise<T>, options?: IRetryStrategyOptions): Promise<T>;
post<TError extends any, TRawData extends any>(call: IHttpPostQueryCall<TError>, options?: IHttpQueryOptions): Observable<IBaseResponse<TRawData>>;

@@ -6,0 +5,0 @@ get<TError extends any, TRawData extends any>(call: IHttpGetQueryCall<TError>, options?: IHttpQueryOptions): Observable<IBaseResponse<TRawData>>;

export * from './ihttp.service';
export * from './observable-retry-strategy';
export * from './promise-retry-strategy';
export * from './http.service';

@@ -5,0 +4,0 @@ export * from './http.models';

export * from './observable-retry-strategy';
export * from './promise-retry-strategy';
export * from './http.service';

@@ -4,0 +3,0 @@ export * from './http.models';

@@ -6,4 +6,4 @@ import { Observable } from 'rxjs';

startTime: Date;
}) => (attempts: Observable<any>) => Observable<number>;
}) => (errorObs: Observable<any>) => Observable<number>;
}
export declare const observableRetryStrategy: ObservableRetryStrategy;
import { throwError, timer } from 'rxjs';
import { mergeMap } from 'rxjs/operators';
import { flatMap } from 'rxjs/operators';
import { retryService } from './retry-service';
var ObservableRetryStrategy = /** @class */ (function () {
function ObservableRetryStrategy() {
this.strategy = function (options, internal) { return function (attempts) {
console.log('get retry strategy', attempts);
return attempts.pipe(mergeMap(function (error, i) {
console.log('attempt', i);
this.strategy = function (options, internal) { return function (errorObs) {
return errorObs.pipe(flatMap(function (error, i) {
var retryAttempt = i + 1;
var statusCode = retryService.getStatusCodeFromError(error);
var retryAfter = retryService.tryGetRetryAfterInMsFromError(error);
console.log(statusCode, retryAfter);
if (!retryService.canRetryStatusCode(statusCode, options.useRetryForResponseCodes)) {
// request with given status code cannot be retried
console.log('no retry 1');
return throwError(error);

@@ -21,3 +17,2 @@ }

// request should not be retried anymore
console.log('no retry 1');
return throwError(error);

@@ -29,3 +24,2 @@ }

retryService.debugLogAttempt(retryAttempt, waitTime);
console.log('wait', waitTime);
return timer(waitTime);

@@ -32,0 +26,0 @@ }));

import { Observable } from 'rxjs';
import { IBaseResponse, IHttpDeleteQueryCall, IHttpGetQueryCall, IHttpPatchQueryCall, IHttpPostQueryCall, IHttpPutQueryCall, IHttpQueryOptions, IHeader, IRetryStrategyOptions } from './http.models';
import { IBaseResponse, IHeader, IHttpDeleteQueryCall, IHttpGetQueryCall, IHttpPatchQueryCall, IHttpPostQueryCall, IHttpPutQueryCall, IHttpQueryOptions } from './http.models';
import { IHttpService } from './ihttp.service';

@@ -17,3 +17,2 @@ export declare class TestHttpService implements IHttpService {

});
retryPromise<T>(promise: Promise<T>, options?: IRetryStrategyOptions): Promise<T>;
get<TError extends any, TRawData extends any>(call: IHttpGetQueryCall<TError>, options?: IHttpQueryOptions): Observable<IBaseResponse<TRawData>>;

@@ -20,0 +19,0 @@ post<TError extends any, TRawData extends any>(call: IHttpPostQueryCall<TError>, options?: IHttpQueryOptions): Observable<IBaseResponse<TRawData>>;

@@ -11,6 +11,2 @@ import { of, throwError } from 'rxjs';

}
TestHttpService.prototype.retryPromise = function (promise, options) {
console.log('Retry is not implemented in test service. Returning original Promise');
return promise;
};
TestHttpService.prototype.get = function (call, options) {

@@ -28,3 +24,3 @@ // throw kontent error

headers: this.fakeHeaders,
status: this.fakeStatusCode,
status: this.fakeStatusCode
});

@@ -31,0 +27,0 @@ }

export var sdkInfo = {
host: 'npmjs.com',
version: '4.0.3',
version: '5.0.0',
name: '@kentico/kontent-core'
};
//# sourceMappingURL=sdk-info.generated.js.map

@@ -5,2 +5,13 @@ # Changelog

## [5.0.0](https://github.com///compare/v4.0.3...v5.0.0) (2019-11-05)
### ⚠ BREAKING CHANGES
* Fixes retry strategy not making HTTP calls, removes Promise specific retry policy and relies on observable conversion
### Bug Fixes
* Fixes retry strategy not making HTTP calls, removes Promise specific retry policy and relies on observable conversion ([79f7341](https://github.com///commit/79f734109a73c6e53ec9125aee419641ab1b935e))
### [4.0.3](https://github.com///compare/v4.0.2...v4.0.3) (2019-10-31)

@@ -7,0 +18,0 @@

{
"name": "@kentico/kontent-core",
"version": "4.0.3",
"version": "5.0.0",
"repository": {

@@ -5,0 +5,0 @@ "type": "git",

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 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 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 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 not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc