@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.
Files changed (133) hide show
  1. package/dist/cjs/helpers/header.helper.d.ts +13 -13
  2. package/dist/cjs/helpers/header.helper.js +22 -22
  3. package/dist/cjs/helpers/headers-helper.d.ts +3 -3
  4. package/dist/cjs/helpers/headers-helper.js +14 -14
  5. package/dist/cjs/helpers/index.d.ts +4 -5
  6. package/dist/cjs/helpers/index.js +20 -21
  7. package/dist/cjs/helpers/index.js.map +1 -1
  8. package/dist/cjs/helpers/retry-helper.d.ts +37 -37
  9. package/dist/cjs/helpers/retry-helper.js +148 -148
  10. package/dist/cjs/helpers/url.helper.d.ts +10 -10
  11. package/dist/cjs/helpers/url.helper.js +26 -26
  12. package/dist/cjs/http/http.debugger.d.ts +6 -6
  13. package/dist/cjs/http/http.debugger.js +22 -22
  14. package/dist/cjs/http/http.functions.d.ts +11 -11
  15. package/dist/cjs/http/http.functions.js +260 -260
  16. package/dist/cjs/http/http.models.d.ts +73 -73
  17. package/dist/cjs/http/http.models.js +2 -2
  18. package/dist/cjs/http/http.service.d.ts +19 -19
  19. package/dist/cjs/http/http.service.js +56 -56
  20. package/dist/cjs/http/ihttp.service.d.ts +9 -9
  21. package/dist/cjs/http/ihttp.service.js +2 -2
  22. package/dist/cjs/http/index.d.ts +6 -6
  23. package/dist/cjs/http/index.js +22 -22
  24. package/dist/cjs/http/test-http.service.d.ts +17 -17
  25. package/dist/cjs/http/test-http.service.js +44 -44
  26. package/dist/cjs/index.d.ts +3 -3
  27. package/dist/cjs/index.js +20 -20
  28. package/dist/cjs/models/index.d.ts +3 -3
  29. package/dist/cjs/models/index.js +19 -19
  30. package/dist/cjs/models/isdk-info.d.ts +14 -14
  31. package/dist/cjs/models/isdk-info.js +2 -2
  32. package/dist/cjs/models/parameters.d.ts +16 -16
  33. package/dist/cjs/models/parameters.js +28 -28
  34. package/dist/cjs/models/parameters.js.map +1 -1
  35. package/dist/cjs/models/url.models.d.ts +3 -3
  36. package/dist/cjs/models/url.models.js +2 -2
  37. package/dist/cjs/sdk-info.generated.d.ts +2 -2
  38. package/dist/cjs/sdk-info.generated.js +8 -8
  39. package/dist/es6/helpers/header.helper.d.ts +13 -13
  40. package/dist/es6/helpers/header.helper.js +18 -18
  41. package/dist/es6/helpers/headers-helper.d.ts +3 -3
  42. package/dist/es6/helpers/headers-helper.js +10 -10
  43. package/dist/es6/helpers/index.d.ts +4 -5
  44. package/dist/es6/helpers/index.js +4 -5
  45. package/dist/es6/helpers/index.js.map +1 -1
  46. package/dist/es6/helpers/retry-helper.d.ts +37 -37
  47. package/dist/es6/helpers/retry-helper.js +144 -144
  48. package/dist/es6/helpers/url.helper.d.ts +10 -10
  49. package/dist/es6/helpers/url.helper.js +22 -22
  50. package/dist/es6/http/http.debugger.d.ts +6 -6
  51. package/dist/es6/http/http.debugger.js +18 -18
  52. package/dist/es6/http/http.functions.d.ts +11 -11
  53. package/dist/es6/http/http.functions.js +251 -251
  54. package/dist/es6/http/http.models.d.ts +73 -73
  55. package/dist/es6/http/http.models.js +1 -1
  56. package/dist/es6/http/http.service.d.ts +19 -19
  57. package/dist/es6/http/http.service.js +52 -52
  58. package/dist/es6/http/ihttp.service.d.ts +9 -9
  59. package/dist/es6/http/ihttp.service.js +1 -1
  60. package/dist/es6/http/index.d.ts +6 -6
  61. package/dist/es6/http/index.js +6 -6
  62. package/dist/es6/http/test-http.service.d.ts +17 -17
  63. package/dist/es6/http/test-http.service.js +40 -40
  64. package/dist/es6/index.d.ts +3 -3
  65. package/dist/es6/index.js +4 -4
  66. package/dist/es6/models/index.d.ts +3 -3
  67. package/dist/es6/models/index.js +3 -3
  68. package/dist/es6/models/isdk-info.d.ts +14 -14
  69. package/dist/es6/models/isdk-info.js +1 -1
  70. package/dist/es6/models/parameters.d.ts +16 -16
  71. package/dist/es6/models/parameters.js +25 -25
  72. package/dist/es6/models/url.models.d.ts +3 -3
  73. package/dist/es6/models/url.models.js +1 -1
  74. package/dist/es6/sdk-info.generated.d.ts +2 -2
  75. package/dist/es6/sdk-info.generated.js +5 -5
  76. package/dist/esnext/helpers/header.helper.d.ts +13 -13
  77. package/dist/esnext/helpers/header.helper.js +18 -18
  78. package/dist/esnext/helpers/headers-helper.d.ts +3 -3
  79. package/dist/esnext/helpers/headers-helper.js +10 -10
  80. package/dist/esnext/helpers/index.d.ts +4 -5
  81. package/dist/esnext/helpers/index.js +4 -5
  82. package/dist/esnext/helpers/index.js.map +1 -1
  83. package/dist/esnext/helpers/retry-helper.d.ts +37 -37
  84. package/dist/esnext/helpers/retry-helper.js +144 -144
  85. package/dist/esnext/helpers/url.helper.d.ts +10 -10
  86. package/dist/esnext/helpers/url.helper.js +22 -22
  87. package/dist/esnext/http/http.debugger.d.ts +6 -6
  88. package/dist/esnext/http/http.debugger.js +18 -18
  89. package/dist/esnext/http/http.functions.d.ts +11 -11
  90. package/dist/esnext/http/http.functions.js +251 -251
  91. package/dist/esnext/http/http.models.d.ts +73 -73
  92. package/dist/esnext/http/http.models.js +1 -1
  93. package/dist/esnext/http/http.service.d.ts +19 -19
  94. package/dist/esnext/http/http.service.js +52 -52
  95. package/dist/esnext/http/ihttp.service.d.ts +9 -9
  96. package/dist/esnext/http/ihttp.service.js +1 -1
  97. package/dist/esnext/http/index.d.ts +6 -6
  98. package/dist/esnext/http/index.js +6 -6
  99. package/dist/esnext/http/test-http.service.d.ts +17 -17
  100. package/dist/esnext/http/test-http.service.js +40 -40
  101. package/dist/esnext/index.d.ts +3 -3
  102. package/dist/esnext/index.js +4 -4
  103. package/dist/esnext/models/index.d.ts +3 -3
  104. package/dist/esnext/models/index.js +3 -3
  105. package/dist/esnext/models/isdk-info.d.ts +14 -14
  106. package/dist/esnext/models/isdk-info.js +1 -1
  107. package/dist/esnext/models/parameters.d.ts +16 -16
  108. package/dist/esnext/models/parameters.js +25 -25
  109. package/dist/esnext/models/url.models.d.ts +3 -3
  110. package/dist/esnext/models/url.models.js +1 -1
  111. package/dist/esnext/sdk-info.generated.d.ts +2 -2
  112. package/dist/esnext/sdk-info.generated.js +5 -5
  113. package/dist/umd/kontent-core.umd.js +3431 -2740
  114. package/dist/umd/kontent-core.umd.js.map +1 -1
  115. package/dist/umd/kontent-core.umd.min.js +1 -1
  116. package/dist/umd/kontent-core.umd.min.js.map +1 -1
  117. package/dist/umd/report.json +1 -1
  118. package/dist/umd/report.min.json +1 -1
  119. package/dist/umd/stats.json +1185 -8545
  120. package/dist/umd/stats.min.json +1192 -8684
  121. package/lib/helpers/index.ts +0 -1
  122. package/lib/sdk-info.generated.ts +1 -1
  123. package/package.json +26 -25
  124. package/dist/cjs/helpers/enum.helper.d.ts +0 -8
  125. package/dist/cjs/helpers/enum.helper.js +0 -54
  126. package/dist/cjs/helpers/enum.helper.js.map +0 -1
  127. package/dist/es6/helpers/enum.helper.d.ts +0 -8
  128. package/dist/es6/helpers/enum.helper.js +0 -50
  129. package/dist/es6/helpers/enum.helper.js.map +0 -1
  130. package/dist/esnext/helpers/enum.helper.d.ts +0 -8
  131. package/dist/esnext/helpers/enum.helper.js +0 -50
  132. package/dist/esnext/helpers/enum.helper.js.map +0 -1
  133. package/lib/helpers/enum.helper.ts +0 -63
@@ -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,53 +1,53 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import axios from 'axios';
11
- import * as HttpFunctions from './http.functions';
12
- export class HttpService {
13
- constructor(opts) {
14
- this.opts = opts;
15
- this.axiosInstance = axios.create(opts === null || opts === void 0 ? void 0 : opts.axiosRequestConfig);
16
- this.functionsConfig = this.getFunctionsConfig();
17
- }
18
- getAsync(call, options) {
19
- return __awaiter(this, void 0, void 0, function* () {
20
- return yield HttpFunctions.getWithRetryAsync(this.axiosInstance, call, this.functionsConfig, options);
21
- });
22
- }
23
- postAsync(call, options) {
24
- return __awaiter(this, void 0, void 0, function* () {
25
- return yield HttpFunctions.postWithRetryAsync(this.axiosInstance, call, this.functionsConfig, options);
26
- });
27
- }
28
- putAsync(call, options) {
29
- return __awaiter(this, void 0, void 0, function* () {
30
- return yield HttpFunctions.putWithRetryAsync(this.axiosInstance, call, this.functionsConfig, options);
31
- });
32
- }
33
- patchAsync(call, options) {
34
- return __awaiter(this, void 0, void 0, function* () {
35
- return yield HttpFunctions.patchWithRetryAsync(this.axiosInstance, call, this.functionsConfig, options);
36
- });
37
- }
38
- deleteAsync(call, options) {
39
- return __awaiter(this, void 0, void 0, function* () {
40
- return yield HttpFunctions.deleteWithRetryAsync(this.axiosInstance, call, this.functionsConfig, options);
41
- });
42
- }
43
- createCancelToken() {
44
- return HttpFunctions.createCancelToken();
45
- }
46
- getFunctionsConfig() {
47
- var _a, _b;
48
- return {
49
- logErrorsToConsole: (_b = (_a = this.opts) === null || _a === void 0 ? void 0 : _a.logErrorsToConsole) !== null && _b !== void 0 ? _b : true
50
- };
51
- }
52
- }
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import axios from 'axios';
11
+ import * as HttpFunctions from './http.functions';
12
+ export class HttpService {
13
+ constructor(opts) {
14
+ this.opts = opts;
15
+ this.axiosInstance = axios.create(opts === null || opts === void 0 ? void 0 : opts.axiosRequestConfig);
16
+ this.functionsConfig = this.getFunctionsConfig();
17
+ }
18
+ getAsync(call, options) {
19
+ return __awaiter(this, void 0, void 0, function* () {
20
+ return yield HttpFunctions.getWithRetryAsync(this.axiosInstance, call, this.functionsConfig, options);
21
+ });
22
+ }
23
+ postAsync(call, options) {
24
+ return __awaiter(this, void 0, void 0, function* () {
25
+ return yield HttpFunctions.postWithRetryAsync(this.axiosInstance, call, this.functionsConfig, options);
26
+ });
27
+ }
28
+ putAsync(call, options) {
29
+ return __awaiter(this, void 0, void 0, function* () {
30
+ return yield HttpFunctions.putWithRetryAsync(this.axiosInstance, call, this.functionsConfig, options);
31
+ });
32
+ }
33
+ patchAsync(call, options) {
34
+ return __awaiter(this, void 0, void 0, function* () {
35
+ return yield HttpFunctions.patchWithRetryAsync(this.axiosInstance, call, this.functionsConfig, options);
36
+ });
37
+ }
38
+ deleteAsync(call, options) {
39
+ return __awaiter(this, void 0, void 0, function* () {
40
+ return yield HttpFunctions.deleteWithRetryAsync(this.axiosInstance, call, this.functionsConfig, options);
41
+ });
42
+ }
43
+ createCancelToken() {
44
+ return HttpFunctions.createCancelToken();
45
+ }
46
+ getFunctionsConfig() {
47
+ var _a, _b;
48
+ return {
49
+ logErrorsToConsole: (_b = (_a = this.opts) === null || _a === void 0 ? void 0 : _a.logErrorsToConsole) !== null && _b !== void 0 ? _b : true
50
+ };
51
+ }
52
+ }
53
53
  //# 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,2 +1,2 @@
1
- export {};
1
+ export {};
2
2
  //# sourceMappingURL=ihttp.service.js.map
@@ -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';
@@ -1,7 +1,7 @@
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';
7
7
  //# 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,41 +1,41 @@
1
- export class TestHttpService {
2
- constructor(config) {
3
- this.response = undefined;
4
- this.error = undefined;
5
- Object.assign(this, config);
6
- }
7
- getAsync(call, options) {
8
- return this.resolveTestCall();
9
- }
10
- postAsync(call, options) {
11
- return this.resolveTestCall();
12
- }
13
- putAsync(call, options) {
14
- return this.resolveTestCall();
15
- }
16
- patchAsync(call, options) {
17
- return this.resolveTestCall();
18
- }
19
- deleteAsync(call, options) {
20
- return this.resolveTestCall();
21
- }
22
- createCancelToken() {
23
- return {
24
- cancel: () => { },
25
- token: undefined
26
- };
27
- }
28
- resolveTestCall() {
29
- const promise = new Promise((resolve, reject) => {
30
- if (this.response) {
31
- resolve(this.response);
32
- }
33
- if (this.error) {
34
- reject(this.error);
35
- }
36
- throw Error(`Missing test data`);
37
- });
38
- return promise;
39
- }
40
- }
1
+ export class TestHttpService {
2
+ constructor(config) {
3
+ this.response = undefined;
4
+ this.error = undefined;
5
+ Object.assign(this, config);
6
+ }
7
+ getAsync(call, options) {
8
+ return this.resolveTestCall();
9
+ }
10
+ postAsync(call, options) {
11
+ return this.resolveTestCall();
12
+ }
13
+ putAsync(call, options) {
14
+ return this.resolveTestCall();
15
+ }
16
+ patchAsync(call, options) {
17
+ return this.resolveTestCall();
18
+ }
19
+ deleteAsync(call, options) {
20
+ return this.resolveTestCall();
21
+ }
22
+ createCancelToken() {
23
+ return {
24
+ cancel: () => { },
25
+ token: undefined
26
+ };
27
+ }
28
+ resolveTestCall() {
29
+ const promise = new Promise((resolve, reject) => {
30
+ if (this.response) {
31
+ resolve(this.response);
32
+ }
33
+ if (this.error) {
34
+ reject(this.error);
35
+ }
36
+ throw Error(`Missing test data`);
37
+ });
38
+ return promise;
39
+ }
40
+ }
41
41
  //# sourceMappingURL=test-http.service.js.map
@@ -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/es6/index.js CHANGED
@@ -1,5 +1,5 @@
1
- /* Public API */
2
- export * from './helpers';
3
- export * from './models';
4
- export * from './http';
1
+ /* Public API */
2
+ export * from './helpers';
3
+ export * from './models';
4
+ export * from './http';
5
5
  //# 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';
@@ -1,4 +1,4 @@
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';
4
4
  //# sourceMappingURL=index.js.map
@@ -1,14 +1,14 @@
1
- export interface ISDKInfo {
2
- /**
3
- * Name of SDK
4
- */
5
- name: string;
6
- /**
7
- * Version SDK
8
- */
9
- version: string;
10
- /**
11
- * Host of SDK
12
- */
13
- host: string;
14
- }
1
+ export interface ISDKInfo {
2
+ /**
3
+ * Name of SDK
4
+ */
5
+ name: string;
6
+ /**
7
+ * Version SDK
8
+ */
9
+ version: string;
10
+ /**
11
+ * Host of SDK
12
+ */
13
+ host: string;
14
+ }
@@ -1,2 +1,2 @@
1
- export {};
1
+ export {};
2
2
  //# sourceMappingURL=isdk-info.js.map
@@ -1,16 +1,16 @@
1
- import { IQueryParameter } from './url.models';
2
- export declare namespace Parameters {
3
- class CustomParameter implements IQueryParameter {
4
- name: string;
5
- value: string;
6
- /**
7
- * Custom parameter
8
- * @constructor
9
- * @param {string} name - Name of the parameter
10
- * @param {string} value - Value of the parameter
11
- */
12
- constructor(name: string, value: string);
13
- getParam(): string;
14
- getParamValue(): string;
15
- }
16
- }
1
+ import { IQueryParameter } from './url.models';
2
+ export declare namespace Parameters {
3
+ class CustomParameter implements IQueryParameter {
4
+ name: string;
5
+ value: string;
6
+ /**
7
+ * Custom parameter
8
+ * @constructor
9
+ * @param {string} name - Name of the parameter
10
+ * @param {string} value - Value of the parameter
11
+ */
12
+ constructor(name: string, value: string);
13
+ getParam(): string;
14
+ getParamValue(): string;
15
+ }
16
+ }
@@ -1,26 +1,26 @@
1
- export var Parameters;
2
- (function (Parameters) {
3
- class CustomParameter {
4
- /**
5
- * Custom parameter
6
- * @constructor
7
- * @param {string} name - Name of the parameter
8
- * @param {string} value - Value of the parameter
9
- */
10
- constructor(name, value) {
11
- this.name = name;
12
- this.value = value;
13
- if (!name) {
14
- throw Error(`Name of the custom parameter is not specified`);
15
- }
16
- }
17
- getParam() {
18
- return this.name;
19
- }
20
- getParamValue() {
21
- return this.value;
22
- }
23
- }
24
- Parameters.CustomParameter = CustomParameter;
25
- })(Parameters || (Parameters = {}));
1
+ export var Parameters;
2
+ (function (Parameters) {
3
+ class CustomParameter {
4
+ /**
5
+ * Custom parameter
6
+ * @constructor
7
+ * @param {string} name - Name of the parameter
8
+ * @param {string} value - Value of the parameter
9
+ */
10
+ constructor(name, value) {
11
+ this.name = name;
12
+ this.value = value;
13
+ if (!name) {
14
+ throw Error(`Name of the custom parameter is not specified`);
15
+ }
16
+ }
17
+ getParam() {
18
+ return this.name;
19
+ }
20
+ getParamValue() {
21
+ return this.value;
22
+ }
23
+ }
24
+ Parameters.CustomParameter = CustomParameter;
25
+ })(Parameters || (Parameters = {}));
26
26
  //# sourceMappingURL=parameters.js.map
@@ -1,3 +1,3 @@
1
- export interface IQueryParameter {
2
- getParam(): string;
3
- }
1
+ export interface IQueryParameter {
2
+ getParam(): string;
3
+ }
@@ -1,2 +1,2 @@
1
- export {};
1
+ export {};
2
2
  //# sourceMappingURL=url.models.js.map
@@ -1,2 +1,2 @@
1
- import { ISDKInfo } from '.';
2
- export declare const sdkInfo: ISDKInfo;
1
+ import { ISDKInfo } from '.';
2
+ export declare const sdkInfo: ISDKInfo;
@@ -1,6 +1,6 @@
1
- export const sdkInfo = {
2
- host: 'npmjs.com',
3
- version: '10.1.1',
4
- name: '@kontent-ai/core-sdk'
5
- };
1
+ export const sdkInfo = {
2
+ host: 'npmjs.com',
3
+ version: '10.2.0',
4
+ name: '@kontent-ai/core-sdk'
5
+ };
6
6
  //# sourceMappingURL=sdk-info.generated.js.map
@@ -1,13 +1,13 @@
1
- import { ISDKInfo } from '../models';
2
- import { IHeader } from '../http/http.models';
3
- export declare class HeaderHelper {
4
- /**
5
- * Header name for SDK usage
6
- */
7
- private readonly sdkVersionHeader;
8
- /**
9
- * Header identifying SDK type & version for internal purposes of Kontent.ai
10
- */
11
- getSdkIdHeader(info: ISDKInfo): IHeader;
12
- }
13
- export declare const headerHelper: HeaderHelper;
1
+ import { ISDKInfo } from '../models';
2
+ import { IHeader } from '../http/http.models';
3
+ export declare class HeaderHelper {
4
+ /**
5
+ * Header name for SDK usage
6
+ */
7
+ private readonly sdkVersionHeader;
8
+ /**
9
+ * Header identifying SDK type & version for internal purposes of Kontent.ai
10
+ */
11
+ getSdkIdHeader(info: ISDKInfo): IHeader;
12
+ }
13
+ export declare const headerHelper: HeaderHelper;
@@ -1,19 +1,19 @@
1
- export class HeaderHelper {
2
- constructor() {
3
- /**
4
- * Header name for SDK usage
5
- */
6
- this.sdkVersionHeader = 'X-KC-SDKID';
7
- }
8
- /**
9
- * Header identifying SDK type & version for internal purposes of Kontent.ai
10
- */
11
- getSdkIdHeader(info) {
12
- return {
13
- header: this.sdkVersionHeader,
14
- value: `${info.host};${info.name};${info.version}`
15
- };
16
- }
17
- }
18
- export const headerHelper = new HeaderHelper();
1
+ export class HeaderHelper {
2
+ constructor() {
3
+ /**
4
+ * Header name for SDK usage
5
+ */
6
+ this.sdkVersionHeader = 'X-KC-SDKID';
7
+ }
8
+ /**
9
+ * Header identifying SDK type & version for internal purposes of Kontent.ai
10
+ */
11
+ getSdkIdHeader(info) {
12
+ return {
13
+ header: this.sdkVersionHeader,
14
+ value: `${info.host};${info.name};${info.version}`
15
+ };
16
+ }
17
+ }
18
+ export const headerHelper = new HeaderHelper();
19
19
  //# sourceMappingURL=header.helper.js.map
@@ -1,3 +1,3 @@
1
- import { AxiosResponse } from 'axios';
2
- import { IHeader } from '../http/http.models';
3
- export declare function extractHeadersFromAxiosResponse(response: AxiosResponse): IHeader[];
1
+ import { AxiosResponse } from 'axios';
2
+ import { IHeader } from '../http/http.models';
3
+ export declare function extractHeadersFromAxiosResponse(response: AxiosResponse): IHeader[];
@@ -1,11 +1,11 @@
1
- export function extractHeadersFromAxiosResponse(response) {
2
- const headers = [];
3
- for (const headerKey of Object.keys(response.headers)) {
4
- headers.push({
5
- header: headerKey,
6
- value: response.headers[headerKey]
7
- });
8
- }
9
- return headers;
10
- }
1
+ export function extractHeadersFromAxiosResponse(response) {
2
+ const headers = [];
3
+ for (const headerKey of Object.keys(response.headers)) {
4
+ headers.push({
5
+ header: headerKey,
6
+ value: response.headers[headerKey]
7
+ });
8
+ }
9
+ return headers;
10
+ }
11
11
  //# sourceMappingURL=headers-helper.js.map
@@ -1,5 +1,4 @@
1
- export * from './url.helper';
2
- export * from './header.helper';
3
- export * from './enum.helper';
4
- export * from './retry-helper';
5
- export * from './headers-helper';
1
+ export * from './url.helper';
2
+ export * from './header.helper';
3
+ export * from './retry-helper';
4
+ export * from './headers-helper';
@@ -1,6 +1,5 @@
1
- export * from './url.helper';
2
- export * from './header.helper';
3
- export * from './enum.helper';
4
- export * from './retry-helper';
5
- export * from './headers-helper';
1
+ export * from './url.helper';
2
+ export * from './header.helper';
3
+ export * from './retry-helper';
4
+ export * from './headers-helper';
6
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC"}