@kontent-ai/core-sdk 10.1.1 → 10.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/helpers/header.helper.d.ts +13 -13
- package/dist/cjs/helpers/header.helper.js +22 -22
- package/dist/cjs/helpers/headers-helper.d.ts +3 -3
- package/dist/cjs/helpers/headers-helper.js +14 -14
- package/dist/cjs/helpers/index.d.ts +4 -5
- package/dist/cjs/helpers/index.js +20 -21
- package/dist/cjs/helpers/index.js.map +1 -1
- package/dist/cjs/helpers/retry-helper.d.ts +37 -37
- package/dist/cjs/helpers/retry-helper.js +148 -148
- package/dist/cjs/helpers/url.helper.d.ts +10 -10
- package/dist/cjs/helpers/url.helper.js +26 -26
- package/dist/cjs/http/http.debugger.d.ts +6 -6
- package/dist/cjs/http/http.debugger.js +22 -22
- package/dist/cjs/http/http.functions.d.ts +11 -11
- package/dist/cjs/http/http.functions.js +260 -260
- package/dist/cjs/http/http.models.d.ts +73 -73
- package/dist/cjs/http/http.models.js +2 -2
- package/dist/cjs/http/http.service.d.ts +19 -19
- package/dist/cjs/http/http.service.js +56 -56
- package/dist/cjs/http/ihttp.service.d.ts +9 -9
- package/dist/cjs/http/ihttp.service.js +2 -2
- package/dist/cjs/http/index.d.ts +6 -6
- package/dist/cjs/http/index.js +22 -22
- package/dist/cjs/http/test-http.service.d.ts +17 -17
- package/dist/cjs/http/test-http.service.js +44 -44
- package/dist/cjs/index.d.ts +3 -3
- package/dist/cjs/index.js +20 -20
- package/dist/cjs/models/index.d.ts +3 -3
- package/dist/cjs/models/index.js +19 -19
- package/dist/cjs/models/isdk-info.d.ts +14 -14
- package/dist/cjs/models/isdk-info.js +2 -2
- package/dist/cjs/models/parameters.d.ts +16 -16
- package/dist/cjs/models/parameters.js +28 -28
- package/dist/cjs/models/parameters.js.map +1 -1
- package/dist/cjs/models/url.models.d.ts +3 -3
- package/dist/cjs/models/url.models.js +2 -2
- package/dist/cjs/sdk-info.generated.d.ts +2 -2
- package/dist/cjs/sdk-info.generated.js +8 -8
- package/dist/es6/helpers/header.helper.d.ts +13 -13
- package/dist/es6/helpers/header.helper.js +18 -18
- package/dist/es6/helpers/headers-helper.d.ts +3 -3
- package/dist/es6/helpers/headers-helper.js +10 -10
- package/dist/es6/helpers/index.d.ts +4 -5
- package/dist/es6/helpers/index.js +4 -5
- package/dist/es6/helpers/index.js.map +1 -1
- package/dist/es6/helpers/retry-helper.d.ts +37 -37
- package/dist/es6/helpers/retry-helper.js +144 -144
- package/dist/es6/helpers/url.helper.d.ts +10 -10
- package/dist/es6/helpers/url.helper.js +22 -22
- package/dist/es6/http/http.debugger.d.ts +6 -6
- package/dist/es6/http/http.debugger.js +18 -18
- package/dist/es6/http/http.functions.d.ts +11 -11
- package/dist/es6/http/http.functions.js +251 -251
- package/dist/es6/http/http.models.d.ts +73 -73
- package/dist/es6/http/http.models.js +1 -1
- package/dist/es6/http/http.service.d.ts +19 -19
- package/dist/es6/http/http.service.js +52 -52
- package/dist/es6/http/ihttp.service.d.ts +9 -9
- package/dist/es6/http/ihttp.service.js +1 -1
- package/dist/es6/http/index.d.ts +6 -6
- package/dist/es6/http/index.js +6 -6
- package/dist/es6/http/test-http.service.d.ts +17 -17
- package/dist/es6/http/test-http.service.js +40 -40
- package/dist/es6/index.d.ts +3 -3
- package/dist/es6/index.js +4 -4
- package/dist/es6/models/index.d.ts +3 -3
- package/dist/es6/models/index.js +3 -3
- package/dist/es6/models/isdk-info.d.ts +14 -14
- package/dist/es6/models/isdk-info.js +1 -1
- package/dist/es6/models/parameters.d.ts +16 -16
- package/dist/es6/models/parameters.js +25 -25
- package/dist/es6/models/url.models.d.ts +3 -3
- package/dist/es6/models/url.models.js +1 -1
- package/dist/es6/sdk-info.generated.d.ts +2 -2
- package/dist/es6/sdk-info.generated.js +5 -5
- package/dist/esnext/helpers/header.helper.d.ts +13 -13
- package/dist/esnext/helpers/header.helper.js +18 -18
- package/dist/esnext/helpers/headers-helper.d.ts +3 -3
- package/dist/esnext/helpers/headers-helper.js +10 -10
- package/dist/esnext/helpers/index.d.ts +4 -5
- package/dist/esnext/helpers/index.js +4 -5
- package/dist/esnext/helpers/index.js.map +1 -1
- package/dist/esnext/helpers/retry-helper.d.ts +37 -37
- package/dist/esnext/helpers/retry-helper.js +144 -144
- package/dist/esnext/helpers/url.helper.d.ts +10 -10
- package/dist/esnext/helpers/url.helper.js +22 -22
- package/dist/esnext/http/http.debugger.d.ts +6 -6
- package/dist/esnext/http/http.debugger.js +18 -18
- package/dist/esnext/http/http.functions.d.ts +11 -11
- package/dist/esnext/http/http.functions.js +251 -251
- package/dist/esnext/http/http.models.d.ts +73 -73
- package/dist/esnext/http/http.models.js +1 -1
- package/dist/esnext/http/http.service.d.ts +19 -19
- package/dist/esnext/http/http.service.js +52 -52
- package/dist/esnext/http/ihttp.service.d.ts +9 -9
- package/dist/esnext/http/ihttp.service.js +1 -1
- package/dist/esnext/http/index.d.ts +6 -6
- package/dist/esnext/http/index.js +6 -6
- package/dist/esnext/http/test-http.service.d.ts +17 -17
- package/dist/esnext/http/test-http.service.js +40 -40
- package/dist/esnext/index.d.ts +3 -3
- package/dist/esnext/index.js +4 -4
- package/dist/esnext/models/index.d.ts +3 -3
- package/dist/esnext/models/index.js +3 -3
- package/dist/esnext/models/isdk-info.d.ts +14 -14
- package/dist/esnext/models/isdk-info.js +1 -1
- package/dist/esnext/models/parameters.d.ts +16 -16
- package/dist/esnext/models/parameters.js +25 -25
- package/dist/esnext/models/url.models.d.ts +3 -3
- package/dist/esnext/models/url.models.js +1 -1
- package/dist/esnext/sdk-info.generated.d.ts +2 -2
- package/dist/esnext/sdk-info.generated.js +5 -5
- package/dist/umd/kontent-core.umd.js +3431 -2740
- package/dist/umd/kontent-core.umd.js.map +1 -1
- package/dist/umd/kontent-core.umd.min.js +1 -1
- package/dist/umd/kontent-core.umd.min.js.map +1 -1
- package/dist/umd/report.json +1 -1
- package/dist/umd/report.min.json +1 -1
- package/dist/umd/stats.json +1185 -8545
- package/dist/umd/stats.min.json +1192 -8684
- package/lib/helpers/index.ts +0 -1
- package/lib/sdk-info.generated.ts +1 -1
- package/package.json +26 -25
- package/dist/cjs/helpers/enum.helper.d.ts +0 -8
- package/dist/cjs/helpers/enum.helper.js +0 -54
- package/dist/cjs/helpers/enum.helper.js.map +0 -1
- package/dist/es6/helpers/enum.helper.d.ts +0 -8
- package/dist/es6/helpers/enum.helper.js +0 -50
- package/dist/es6/helpers/enum.helper.js.map +0 -1
- package/dist/esnext/helpers/enum.helper.d.ts +0 -8
- package/dist/esnext/helpers/enum.helper.js +0 -50
- package/dist/esnext/helpers/enum.helper.js.map +0 -1
- package/lib/helpers/enum.helper.ts +0 -63
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
import { ResponseType } from 'axios';
|
|
2
|
-
export interface IResponseRetryStrategyResult {
|
|
3
|
-
options: IRetryStrategyOptions;
|
|
4
|
-
retryAttempts: number;
|
|
5
|
-
}
|
|
6
|
-
export interface IResponse<TRawData> {
|
|
7
|
-
data: TRawData;
|
|
8
|
-
headers: IHeader[];
|
|
9
|
-
rawResponse: any;
|
|
10
|
-
status: number;
|
|
11
|
-
retryStrategy: IResponseRetryStrategyResult;
|
|
12
|
-
}
|
|
13
|
-
export interface IRetryStrategyOptions {
|
|
14
|
-
/**
|
|
15
|
-
* back-off interval between retries
|
|
16
|
-
*/
|
|
17
|
-
deltaBackoffMs?: number;
|
|
18
|
-
/**
|
|
19
|
-
* Maximum allowed number of attempts
|
|
20
|
-
*/
|
|
21
|
-
maxAttempts?: number;
|
|
22
|
-
/**
|
|
23
|
-
* Indicates if jitter is added to retry
|
|
24
|
-
*/
|
|
25
|
-
addJitter?: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Determines if error can be retried. There are errors that are never retried
|
|
28
|
-
* such as when request is cancelled or the response status is 404 and so on...
|
|
29
|
-
*/
|
|
30
|
-
canRetryError?: (error: any) => boolean;
|
|
31
|
-
}
|
|
32
|
-
export interface IHttpQueryCall {
|
|
33
|
-
url: string;
|
|
34
|
-
}
|
|
35
|
-
export interface IHttpPostQueryCall extends IHttpQueryCall {
|
|
36
|
-
body: any;
|
|
37
|
-
}
|
|
38
|
-
export interface IHttpPutQueryCall extends IHttpQueryCall {
|
|
39
|
-
body: any;
|
|
40
|
-
}
|
|
41
|
-
export interface IHttpPatchQueryCall extends IHttpQueryCall {
|
|
42
|
-
body: any;
|
|
43
|
-
}
|
|
44
|
-
export interface IHttpDeleteQueryCall extends IHttpQueryCall {
|
|
45
|
-
}
|
|
46
|
-
export interface IHttpGetQueryCall extends IHttpQueryCall {
|
|
47
|
-
}
|
|
48
|
-
export interface IHttpCancelRequestToken<TCancelToken> {
|
|
49
|
-
token: TCancelToken;
|
|
50
|
-
cancel: (cancelMessage?: string) => void;
|
|
51
|
-
}
|
|
52
|
-
export interface IHttpQueryOptions<TCancelToken> {
|
|
53
|
-
/**
|
|
54
|
-
* retry strategy
|
|
55
|
-
*/
|
|
56
|
-
retryStrategy?: IRetryStrategyOptions;
|
|
57
|
-
/**
|
|
58
|
-
* Request headers
|
|
59
|
-
*/
|
|
60
|
-
headers?: IHeader[];
|
|
61
|
-
/**
|
|
62
|
-
* Response type
|
|
63
|
-
*/
|
|
64
|
-
responseType?: ResponseType;
|
|
65
|
-
/**
|
|
66
|
-
* Cancel token
|
|
67
|
-
*/
|
|
68
|
-
cancelToken?: IHttpCancelRequestToken<TCancelToken>;
|
|
69
|
-
}
|
|
70
|
-
export interface IHeader {
|
|
71
|
-
header: string;
|
|
72
|
-
value: string;
|
|
73
|
-
}
|
|
1
|
+
import { ResponseType } from 'axios';
|
|
2
|
+
export interface IResponseRetryStrategyResult {
|
|
3
|
+
options: IRetryStrategyOptions;
|
|
4
|
+
retryAttempts: number;
|
|
5
|
+
}
|
|
6
|
+
export interface IResponse<TRawData> {
|
|
7
|
+
data: TRawData;
|
|
8
|
+
headers: IHeader[];
|
|
9
|
+
rawResponse: any;
|
|
10
|
+
status: number;
|
|
11
|
+
retryStrategy: IResponseRetryStrategyResult;
|
|
12
|
+
}
|
|
13
|
+
export interface IRetryStrategyOptions {
|
|
14
|
+
/**
|
|
15
|
+
* back-off interval between retries
|
|
16
|
+
*/
|
|
17
|
+
deltaBackoffMs?: number;
|
|
18
|
+
/**
|
|
19
|
+
* Maximum allowed number of attempts
|
|
20
|
+
*/
|
|
21
|
+
maxAttempts?: number;
|
|
22
|
+
/**
|
|
23
|
+
* Indicates if jitter is added to retry
|
|
24
|
+
*/
|
|
25
|
+
addJitter?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Determines if error can be retried. There are errors that are never retried
|
|
28
|
+
* such as when request is cancelled or the response status is 404 and so on...
|
|
29
|
+
*/
|
|
30
|
+
canRetryError?: (error: any) => boolean;
|
|
31
|
+
}
|
|
32
|
+
export interface IHttpQueryCall {
|
|
33
|
+
url: string;
|
|
34
|
+
}
|
|
35
|
+
export interface IHttpPostQueryCall extends IHttpQueryCall {
|
|
36
|
+
body: any;
|
|
37
|
+
}
|
|
38
|
+
export interface IHttpPutQueryCall extends IHttpQueryCall {
|
|
39
|
+
body: any;
|
|
40
|
+
}
|
|
41
|
+
export interface IHttpPatchQueryCall extends IHttpQueryCall {
|
|
42
|
+
body: any;
|
|
43
|
+
}
|
|
44
|
+
export interface IHttpDeleteQueryCall extends IHttpQueryCall {
|
|
45
|
+
}
|
|
46
|
+
export interface IHttpGetQueryCall extends IHttpQueryCall {
|
|
47
|
+
}
|
|
48
|
+
export interface IHttpCancelRequestToken<TCancelToken> {
|
|
49
|
+
token: TCancelToken;
|
|
50
|
+
cancel: (cancelMessage?: string) => void;
|
|
51
|
+
}
|
|
52
|
+
export interface IHttpQueryOptions<TCancelToken> {
|
|
53
|
+
/**
|
|
54
|
+
* retry strategy
|
|
55
|
+
*/
|
|
56
|
+
retryStrategy?: IRetryStrategyOptions;
|
|
57
|
+
/**
|
|
58
|
+
* Request headers
|
|
59
|
+
*/
|
|
60
|
+
headers?: IHeader[];
|
|
61
|
+
/**
|
|
62
|
+
* Response type
|
|
63
|
+
*/
|
|
64
|
+
responseType?: ResponseType;
|
|
65
|
+
/**
|
|
66
|
+
* Cancel token
|
|
67
|
+
*/
|
|
68
|
+
cancelToken?: IHttpCancelRequestToken<TCancelToken>;
|
|
69
|
+
}
|
|
70
|
+
export interface IHeader {
|
|
71
|
+
header: string;
|
|
72
|
+
value: string;
|
|
73
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=http.models.js.map
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { AxiosRequestConfig, CancelToken } from 'axios';
|
|
2
|
-
import { IResponse, IHttpDeleteQueryCall, IHttpGetQueryCall, IHttpPatchQueryCall, IHttpPostQueryCall, IHttpPutQueryCall, IHttpQueryOptions, IHttpCancelRequestToken } from './http.models';
|
|
3
|
-
import { IHttpService } from './ihttp.service';
|
|
4
|
-
export declare class HttpService implements IHttpService<CancelToken> {
|
|
5
|
-
private opts?;
|
|
6
|
-
private readonly axiosInstance;
|
|
7
|
-
private readonly functionsConfig;
|
|
8
|
-
constructor(opts?: {
|
|
9
|
-
axiosRequestConfig?: AxiosRequestConfig<any> | undefined;
|
|
10
|
-
logErrorsToConsole?: boolean | undefined;
|
|
11
|
-
} | undefined);
|
|
12
|
-
getAsync<TRawData>(call: IHttpGetQueryCall, options?: IHttpQueryOptions<CancelToken>): Promise<IResponse<TRawData>>;
|
|
13
|
-
postAsync<TRawData>(call: IHttpPostQueryCall, options?: IHttpQueryOptions<CancelToken>): Promise<IResponse<TRawData>>;
|
|
14
|
-
putAsync<TRawData>(call: IHttpPutQueryCall, options?: IHttpQueryOptions<CancelToken>): Promise<IResponse<TRawData>>;
|
|
15
|
-
patchAsync<TRawData>(call: IHttpPatchQueryCall, options?: IHttpQueryOptions<CancelToken>): Promise<IResponse<TRawData>>;
|
|
16
|
-
deleteAsync<TRawData>(call: IHttpDeleteQueryCall, options?: IHttpQueryOptions<CancelToken>): Promise<IResponse<TRawData>>;
|
|
17
|
-
createCancelToken(): IHttpCancelRequestToken<CancelToken>;
|
|
18
|
-
private getFunctionsConfig;
|
|
19
|
-
}
|
|
1
|
+
import { AxiosRequestConfig, CancelToken } from 'axios';
|
|
2
|
+
import { IResponse, IHttpDeleteQueryCall, IHttpGetQueryCall, IHttpPatchQueryCall, IHttpPostQueryCall, IHttpPutQueryCall, IHttpQueryOptions, IHttpCancelRequestToken } from './http.models';
|
|
3
|
+
import { IHttpService } from './ihttp.service';
|
|
4
|
+
export declare class HttpService implements IHttpService<CancelToken> {
|
|
5
|
+
private opts?;
|
|
6
|
+
private readonly axiosInstance;
|
|
7
|
+
private readonly functionsConfig;
|
|
8
|
+
constructor(opts?: {
|
|
9
|
+
axiosRequestConfig?: AxiosRequestConfig<any> | undefined;
|
|
10
|
+
logErrorsToConsole?: boolean | undefined;
|
|
11
|
+
} | undefined);
|
|
12
|
+
getAsync<TRawData>(call: IHttpGetQueryCall, options?: IHttpQueryOptions<CancelToken>): Promise<IResponse<TRawData>>;
|
|
13
|
+
postAsync<TRawData>(call: IHttpPostQueryCall, options?: IHttpQueryOptions<CancelToken>): Promise<IResponse<TRawData>>;
|
|
14
|
+
putAsync<TRawData>(call: IHttpPutQueryCall, options?: IHttpQueryOptions<CancelToken>): Promise<IResponse<TRawData>>;
|
|
15
|
+
patchAsync<TRawData>(call: IHttpPatchQueryCall, options?: IHttpQueryOptions<CancelToken>): Promise<IResponse<TRawData>>;
|
|
16
|
+
deleteAsync<TRawData>(call: IHttpDeleteQueryCall, options?: IHttpQueryOptions<CancelToken>): Promise<IResponse<TRawData>>;
|
|
17
|
+
createCancelToken(): IHttpCancelRequestToken<CancelToken>;
|
|
18
|
+
private getFunctionsConfig;
|
|
19
|
+
}
|
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.HttpService = void 0;
|
|
13
|
-
const axios_1 = require("axios");
|
|
14
|
-
const HttpFunctions = require("./http.functions");
|
|
15
|
-
class HttpService {
|
|
16
|
-
constructor(opts) {
|
|
17
|
-
this.opts = opts;
|
|
18
|
-
this.axiosInstance = axios_1.default.create(opts === null || opts === void 0 ? void 0 : opts.axiosRequestConfig);
|
|
19
|
-
this.functionsConfig = this.getFunctionsConfig();
|
|
20
|
-
}
|
|
21
|
-
getAsync(call, options) {
|
|
22
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
-
return yield HttpFunctions.getWithRetryAsync(this.axiosInstance, call, this.functionsConfig, options);
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
postAsync(call, options) {
|
|
27
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
-
return yield HttpFunctions.postWithRetryAsync(this.axiosInstance, call, this.functionsConfig, options);
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
putAsync(call, options) {
|
|
32
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
-
return yield HttpFunctions.putWithRetryAsync(this.axiosInstance, call, this.functionsConfig, options);
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
patchAsync(call, options) {
|
|
37
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
-
return yield HttpFunctions.patchWithRetryAsync(this.axiosInstance, call, this.functionsConfig, options);
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
deleteAsync(call, options) {
|
|
42
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
-
return yield HttpFunctions.deleteWithRetryAsync(this.axiosInstance, call, this.functionsConfig, options);
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
createCancelToken() {
|
|
47
|
-
return HttpFunctions.createCancelToken();
|
|
48
|
-
}
|
|
49
|
-
getFunctionsConfig() {
|
|
50
|
-
var _a, _b;
|
|
51
|
-
return {
|
|
52
|
-
logErrorsToConsole: (_b = (_a = this.opts) === null || _a === void 0 ? void 0 : _a.logErrorsToConsole) !== null && _b !== void 0 ? _b : true
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
exports.HttpService = HttpService;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.HttpService = void 0;
|
|
13
|
+
const axios_1 = require("axios");
|
|
14
|
+
const HttpFunctions = require("./http.functions");
|
|
15
|
+
class HttpService {
|
|
16
|
+
constructor(opts) {
|
|
17
|
+
this.opts = opts;
|
|
18
|
+
this.axiosInstance = axios_1.default.create(opts === null || opts === void 0 ? void 0 : opts.axiosRequestConfig);
|
|
19
|
+
this.functionsConfig = this.getFunctionsConfig();
|
|
20
|
+
}
|
|
21
|
+
getAsync(call, options) {
|
|
22
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
return yield HttpFunctions.getWithRetryAsync(this.axiosInstance, call, this.functionsConfig, options);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
postAsync(call, options) {
|
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
return yield HttpFunctions.postWithRetryAsync(this.axiosInstance, call, this.functionsConfig, options);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
putAsync(call, options) {
|
|
32
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
+
return yield HttpFunctions.putWithRetryAsync(this.axiosInstance, call, this.functionsConfig, options);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
patchAsync(call, options) {
|
|
37
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
return yield HttpFunctions.patchWithRetryAsync(this.axiosInstance, call, this.functionsConfig, options);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
deleteAsync(call, options) {
|
|
42
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
return yield HttpFunctions.deleteWithRetryAsync(this.axiosInstance, call, this.functionsConfig, options);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
createCancelToken() {
|
|
47
|
+
return HttpFunctions.createCancelToken();
|
|
48
|
+
}
|
|
49
|
+
getFunctionsConfig() {
|
|
50
|
+
var _a, _b;
|
|
51
|
+
return {
|
|
52
|
+
logErrorsToConsole: (_b = (_a = this.opts) === null || _a === void 0 ? void 0 : _a.logErrorsToConsole) !== null && _b !== void 0 ? _b : true
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.HttpService = HttpService;
|
|
57
57
|
//# sourceMappingURL=http.service.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { IResponse, IHttpDeleteQueryCall, IHttpGetQueryCall, IHttpPostQueryCall, IHttpPutQueryCall, IHttpQueryOptions, IHttpPatchQueryCall, IHttpCancelRequestToken } from './http.models';
|
|
2
|
-
export interface IHttpService<TCancelToken> {
|
|
3
|
-
getAsync<TRawData>(call: IHttpGetQueryCall, options?: IHttpQueryOptions<TCancelToken>): Promise<IResponse<TRawData>>;
|
|
4
|
-
postAsync<TRawData>(call: IHttpPostQueryCall, options?: IHttpQueryOptions<TCancelToken>): Promise<IResponse<TRawData>>;
|
|
5
|
-
putAsync<TRawData>(call: IHttpPutQueryCall, options?: IHttpQueryOptions<TCancelToken>): Promise<IResponse<TRawData>>;
|
|
6
|
-
patchAsync<TRawData>(call: IHttpPatchQueryCall, options?: IHttpQueryOptions<TCancelToken>): Promise<IResponse<TRawData>>;
|
|
7
|
-
deleteAsync<TRawData>(call: IHttpDeleteQueryCall, options?: IHttpQueryOptions<TCancelToken>): Promise<IResponse<TRawData>>;
|
|
8
|
-
createCancelToken(): IHttpCancelRequestToken<TCancelToken>;
|
|
9
|
-
}
|
|
1
|
+
import { IResponse, IHttpDeleteQueryCall, IHttpGetQueryCall, IHttpPostQueryCall, IHttpPutQueryCall, IHttpQueryOptions, IHttpPatchQueryCall, IHttpCancelRequestToken } from './http.models';
|
|
2
|
+
export interface IHttpService<TCancelToken> {
|
|
3
|
+
getAsync<TRawData>(call: IHttpGetQueryCall, options?: IHttpQueryOptions<TCancelToken>): Promise<IResponse<TRawData>>;
|
|
4
|
+
postAsync<TRawData>(call: IHttpPostQueryCall, options?: IHttpQueryOptions<TCancelToken>): Promise<IResponse<TRawData>>;
|
|
5
|
+
putAsync<TRawData>(call: IHttpPutQueryCall, options?: IHttpQueryOptions<TCancelToken>): Promise<IResponse<TRawData>>;
|
|
6
|
+
patchAsync<TRawData>(call: IHttpPatchQueryCall, options?: IHttpQueryOptions<TCancelToken>): Promise<IResponse<TRawData>>;
|
|
7
|
+
deleteAsync<TRawData>(call: IHttpDeleteQueryCall, options?: IHttpQueryOptions<TCancelToken>): Promise<IResponse<TRawData>>;
|
|
8
|
+
createCancelToken(): IHttpCancelRequestToken<TCancelToken>;
|
|
9
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=ihttp.service.js.map
|
package/dist/cjs/http/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './ihttp.service';
|
|
2
|
-
export * from './http.service';
|
|
3
|
-
export * from './http.models';
|
|
4
|
-
export * from './http.functions';
|
|
5
|
-
export * from './http.debugger';
|
|
6
|
-
export * from './test-http.service';
|
|
1
|
+
export * from './ihttp.service';
|
|
2
|
+
export * from './http.service';
|
|
3
|
+
export * from './http.models';
|
|
4
|
+
export * from './http.functions';
|
|
5
|
+
export * from './http.debugger';
|
|
6
|
+
export * from './test-http.service';
|
package/dist/cjs/http/index.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./ihttp.service"), exports);
|
|
18
|
-
__exportStar(require("./http.service"), exports);
|
|
19
|
-
__exportStar(require("./http.models"), exports);
|
|
20
|
-
__exportStar(require("./http.functions"), exports);
|
|
21
|
-
__exportStar(require("./http.debugger"), exports);
|
|
22
|
-
__exportStar(require("./test-http.service"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./ihttp.service"), exports);
|
|
18
|
+
__exportStar(require("./http.service"), exports);
|
|
19
|
+
__exportStar(require("./http.models"), exports);
|
|
20
|
+
__exportStar(require("./http.functions"), exports);
|
|
21
|
+
__exportStar(require("./http.debugger"), exports);
|
|
22
|
+
__exportStar(require("./test-http.service"), exports);
|
|
23
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { IResponse, IHttpDeleteQueryCall, IHttpGetQueryCall, IHttpPatchQueryCall, IHttpPostQueryCall, IHttpPutQueryCall, IHttpQueryOptions, IHttpCancelRequestToken } from './http.models';
|
|
2
|
-
import { IHttpService } from './ihttp.service';
|
|
3
|
-
export declare class TestHttpService implements IHttpService<undefined> {
|
|
4
|
-
response?: IResponse<any>;
|
|
5
|
-
error?: any;
|
|
6
|
-
constructor(config: {
|
|
7
|
-
response?: IResponse<any>;
|
|
8
|
-
error?: any;
|
|
9
|
-
});
|
|
10
|
-
getAsync<TRawData>(call: IHttpGetQueryCall, options?: IHttpQueryOptions<undefined>): Promise<IResponse<TRawData>>;
|
|
11
|
-
postAsync<TRawData>(call: IHttpPostQueryCall, options?: IHttpQueryOptions<undefined>): Promise<IResponse<TRawData>>;
|
|
12
|
-
putAsync<TRawData>(call: IHttpPutQueryCall, options?: IHttpQueryOptions<undefined>): Promise<IResponse<TRawData>>;
|
|
13
|
-
patchAsync<TRawData>(call: IHttpPatchQueryCall, options?: IHttpQueryOptions<undefined>): Promise<IResponse<TRawData>>;
|
|
14
|
-
deleteAsync<TRawData>(call: IHttpDeleteQueryCall, options?: IHttpQueryOptions<undefined>): Promise<IResponse<TRawData>>;
|
|
15
|
-
createCancelToken(): IHttpCancelRequestToken<undefined>;
|
|
16
|
-
private resolveTestCall;
|
|
17
|
-
}
|
|
1
|
+
import { IResponse, IHttpDeleteQueryCall, IHttpGetQueryCall, IHttpPatchQueryCall, IHttpPostQueryCall, IHttpPutQueryCall, IHttpQueryOptions, IHttpCancelRequestToken } from './http.models';
|
|
2
|
+
import { IHttpService } from './ihttp.service';
|
|
3
|
+
export declare class TestHttpService implements IHttpService<undefined> {
|
|
4
|
+
response?: IResponse<any>;
|
|
5
|
+
error?: any;
|
|
6
|
+
constructor(config: {
|
|
7
|
+
response?: IResponse<any>;
|
|
8
|
+
error?: any;
|
|
9
|
+
});
|
|
10
|
+
getAsync<TRawData>(call: IHttpGetQueryCall, options?: IHttpQueryOptions<undefined>): Promise<IResponse<TRawData>>;
|
|
11
|
+
postAsync<TRawData>(call: IHttpPostQueryCall, options?: IHttpQueryOptions<undefined>): Promise<IResponse<TRawData>>;
|
|
12
|
+
putAsync<TRawData>(call: IHttpPutQueryCall, options?: IHttpQueryOptions<undefined>): Promise<IResponse<TRawData>>;
|
|
13
|
+
patchAsync<TRawData>(call: IHttpPatchQueryCall, options?: IHttpQueryOptions<undefined>): Promise<IResponse<TRawData>>;
|
|
14
|
+
deleteAsync<TRawData>(call: IHttpDeleteQueryCall, options?: IHttpQueryOptions<undefined>): Promise<IResponse<TRawData>>;
|
|
15
|
+
createCancelToken(): IHttpCancelRequestToken<undefined>;
|
|
16
|
+
private resolveTestCall;
|
|
17
|
+
}
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TestHttpService = void 0;
|
|
4
|
-
class TestHttpService {
|
|
5
|
-
constructor(config) {
|
|
6
|
-
this.response = undefined;
|
|
7
|
-
this.error = undefined;
|
|
8
|
-
Object.assign(this, config);
|
|
9
|
-
}
|
|
10
|
-
getAsync(call, options) {
|
|
11
|
-
return this.resolveTestCall();
|
|
12
|
-
}
|
|
13
|
-
postAsync(call, options) {
|
|
14
|
-
return this.resolveTestCall();
|
|
15
|
-
}
|
|
16
|
-
putAsync(call, options) {
|
|
17
|
-
return this.resolveTestCall();
|
|
18
|
-
}
|
|
19
|
-
patchAsync(call, options) {
|
|
20
|
-
return this.resolveTestCall();
|
|
21
|
-
}
|
|
22
|
-
deleteAsync(call, options) {
|
|
23
|
-
return this.resolveTestCall();
|
|
24
|
-
}
|
|
25
|
-
createCancelToken() {
|
|
26
|
-
return {
|
|
27
|
-
cancel: () => { },
|
|
28
|
-
token: undefined
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
resolveTestCall() {
|
|
32
|
-
const promise = new Promise((resolve, reject) => {
|
|
33
|
-
if (this.response) {
|
|
34
|
-
resolve(this.response);
|
|
35
|
-
}
|
|
36
|
-
if (this.error) {
|
|
37
|
-
reject(this.error);
|
|
38
|
-
}
|
|
39
|
-
throw Error(`Missing test data`);
|
|
40
|
-
});
|
|
41
|
-
return promise;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
exports.TestHttpService = TestHttpService;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TestHttpService = void 0;
|
|
4
|
+
class TestHttpService {
|
|
5
|
+
constructor(config) {
|
|
6
|
+
this.response = undefined;
|
|
7
|
+
this.error = undefined;
|
|
8
|
+
Object.assign(this, config);
|
|
9
|
+
}
|
|
10
|
+
getAsync(call, options) {
|
|
11
|
+
return this.resolveTestCall();
|
|
12
|
+
}
|
|
13
|
+
postAsync(call, options) {
|
|
14
|
+
return this.resolveTestCall();
|
|
15
|
+
}
|
|
16
|
+
putAsync(call, options) {
|
|
17
|
+
return this.resolveTestCall();
|
|
18
|
+
}
|
|
19
|
+
patchAsync(call, options) {
|
|
20
|
+
return this.resolveTestCall();
|
|
21
|
+
}
|
|
22
|
+
deleteAsync(call, options) {
|
|
23
|
+
return this.resolveTestCall();
|
|
24
|
+
}
|
|
25
|
+
createCancelToken() {
|
|
26
|
+
return {
|
|
27
|
+
cancel: () => { },
|
|
28
|
+
token: undefined
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
resolveTestCall() {
|
|
32
|
+
const promise = new Promise((resolve, reject) => {
|
|
33
|
+
if (this.response) {
|
|
34
|
+
resolve(this.response);
|
|
35
|
+
}
|
|
36
|
+
if (this.error) {
|
|
37
|
+
reject(this.error);
|
|
38
|
+
}
|
|
39
|
+
throw Error(`Missing test data`);
|
|
40
|
+
});
|
|
41
|
+
return promise;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.TestHttpService = TestHttpService;
|
|
45
45
|
//# sourceMappingURL=test-http.service.js.map
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './helpers';
|
|
2
|
-
export * from './models';
|
|
3
|
-
export * from './http';
|
|
1
|
+
export * from './helpers';
|
|
2
|
+
export * from './models';
|
|
3
|
+
export * from './http';
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
/* Public API */
|
|
18
|
-
__exportStar(require("./helpers"), exports);
|
|
19
|
-
__exportStar(require("./models"), exports);
|
|
20
|
-
__exportStar(require("./http"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/* Public API */
|
|
18
|
+
__exportStar(require("./helpers"), exports);
|
|
19
|
+
__exportStar(require("./models"), exports);
|
|
20
|
+
__exportStar(require("./http"), exports);
|
|
21
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './url.models';
|
|
2
|
-
export * from './isdk-info';
|
|
3
|
-
export * from './parameters';
|
|
1
|
+
export * from './url.models';
|
|
2
|
+
export * from './isdk-info';
|
|
3
|
+
export * from './parameters';
|
package/dist/cjs/models/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./url.models"), exports);
|
|
18
|
-
__exportStar(require("./isdk-info"), exports);
|
|
19
|
-
__exportStar(require("./parameters"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./url.models"), exports);
|
|
18
|
+
__exportStar(require("./isdk-info"), exports);
|
|
19
|
+
__exportStar(require("./parameters"), exports);
|
|
20
20
|
//# sourceMappingURL=index.js.map
|