@kontent-ai/delivery-sdk 12.2.0 → 12.4.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/bundles/kontent-delivery.umd.js +732 -876
- package/dist/bundles/kontent-delivery.umd.js.map +1 -1
- package/dist/bundles/kontent-delivery.umd.min.js +1 -1
- package/dist/bundles/kontent-delivery.umd.min.js.map +1 -1
- package/dist/bundles/report.json +1 -1
- package/dist/bundles/report.min.json +1 -1
- package/dist/bundles/stats.json +4437 -4731
- package/dist/bundles/stats.min.json +4837 -5741
- package/dist/cjs/client/delivery-client.d.ts +9 -1
- package/dist/cjs/client/delivery-client.js +12 -0
- package/dist/cjs/client/delivery-client.js.map +1 -1
- package/dist/cjs/client/idelivery-client.interface.d.ts +9 -1
- package/dist/cjs/contracts/contracts.d.ts +17 -6
- package/dist/cjs/mappers/generic-element.mapper.js +6 -5
- package/dist/cjs/mappers/generic-element.mapper.js.map +1 -1
- package/dist/cjs/mappers/index.d.ts +1 -0
- package/dist/cjs/mappers/index.js +1 -0
- package/dist/cjs/mappers/index.js.map +1 -1
- package/dist/cjs/mappers/sync.mapper.d.ts +5 -0
- package/dist/cjs/mappers/sync.mapper.js +18 -0
- package/dist/cjs/mappers/sync.mapper.js.map +1 -0
- package/dist/cjs/mappers/type.mapper.js.map +1 -1
- package/dist/cjs/models/element-models.d.ts +1 -1
- package/dist/cjs/models/index.d.ts +1 -0
- package/dist/cjs/models/index.js +1 -0
- package/dist/cjs/models/index.js.map +1 -1
- package/dist/cjs/models/responses.d.ts +11 -0
- package/dist/cjs/models/sync-models.d.ts +12 -0
- package/dist/cjs/models/sync-models.js +3 -0
- package/dist/cjs/models/sync-models.js.map +1 -0
- package/dist/cjs/query/common/base-item-listing-query.class.d.ts +116 -0
- package/dist/cjs/query/common/base-item-listing-query.class.js +178 -0
- package/dist/cjs/query/common/base-item-listing-query.class.js.map +1 -0
- package/dist/cjs/query/common/base-listing-query.class.d.ts +1 -108
- package/dist/cjs/query/common/base-listing-query.class.js +1 -165
- package/dist/cjs/query/common/base-listing-query.class.js.map +1 -1
- package/dist/cjs/query/element/element-query.class.js +1 -2
- package/dist/cjs/query/element/element-query.class.js.map +1 -1
- package/dist/cjs/query/index.d.ts +2 -0
- package/dist/cjs/query/index.js +2 -0
- package/dist/cjs/query/index.js.map +1 -1
- package/dist/cjs/query/item/multiple-items-query.class.d.ts +2 -2
- package/dist/cjs/query/item/multiple-items-query.class.js +2 -2
- package/dist/cjs/query/item/multiple-items-query.class.js.map +1 -1
- package/dist/cjs/query/items-feed/items-feed-query.class.d.ts +2 -2
- package/dist/cjs/query/items-feed/items-feed-query.class.js +3 -3
- package/dist/cjs/query/items-feed/items-feed-query.class.js.map +1 -1
- package/dist/cjs/query/language/languages-query.class.d.ts +0 -4
- package/dist/cjs/query/language/languages-query.class.js +0 -12
- package/dist/cjs/query/language/languages-query.class.js.map +1 -1
- package/dist/cjs/query/sync/initialize-sync-query.class.d.ts +35 -0
- package/dist/cjs/query/sync/initialize-sync-query.class.js +59 -0
- package/dist/cjs/query/sync/initialize-sync-query.class.js.map +1 -0
- package/dist/cjs/query/sync/sync-changes-query.class.d.ts +21 -0
- package/dist/cjs/query/sync/sync-changes-query.class.js +39 -0
- package/dist/cjs/query/sync/sync-changes-query.class.js.map +1 -0
- package/dist/cjs/query/taxonomy/taxonomies-query.class.d.ts +0 -4
- package/dist/cjs/query/taxonomy/taxonomies-query.class.js +0 -12
- package/dist/cjs/query/taxonomy/taxonomies-query.class.js.map +1 -1
- package/dist/cjs/query/type/multiple-type-query.class.d.ts +15 -0
- package/dist/cjs/query/type/multiple-type-query.class.js +25 -0
- package/dist/cjs/query/type/multiple-type-query.class.js.map +1 -1
- package/dist/cjs/sdk-info.generated.js +1 -1
- package/dist/cjs/services/base-delivery-query.service.d.ts +8 -0
- package/dist/cjs/services/base-delivery-query.service.js +29 -0
- package/dist/cjs/services/base-delivery-query.service.js.map +1 -1
- package/dist/cjs/services/delivery-query.service.d.ts +16 -1
- package/dist/cjs/services/delivery-query.service.js +25 -0
- package/dist/cjs/services/delivery-query.service.js.map +1 -1
- package/dist/cjs/services/mapping.service.d.ts +5 -0
- package/dist/cjs/services/mapping.service.js +11 -0
- package/dist/cjs/services/mapping.service.js.map +1 -1
- package/dist/es6/client/delivery-client.d.ts +9 -1
- package/dist/es6/client/delivery-client.js +13 -1
- package/dist/es6/client/delivery-client.js.map +1 -1
- package/dist/es6/client/idelivery-client.interface.d.ts +9 -1
- package/dist/es6/contracts/contracts.d.ts +17 -6
- package/dist/es6/mappers/generic-element.mapper.js +6 -5
- package/dist/es6/mappers/generic-element.mapper.js.map +1 -1
- package/dist/es6/mappers/index.d.ts +1 -0
- package/dist/es6/mappers/index.js +1 -0
- package/dist/es6/mappers/index.js.map +1 -1
- package/dist/es6/mappers/sync.mapper.d.ts +5 -0
- package/dist/es6/mappers/sync.mapper.js +14 -0
- package/dist/es6/mappers/sync.mapper.js.map +1 -0
- package/dist/es6/mappers/type.mapper.js.map +1 -1
- package/dist/es6/models/element-models.d.ts +1 -1
- package/dist/es6/models/index.d.ts +1 -0
- package/dist/es6/models/index.js +1 -0
- package/dist/es6/models/index.js.map +1 -1
- package/dist/es6/models/responses.d.ts +11 -0
- package/dist/es6/models/sync-models.d.ts +12 -0
- package/dist/es6/models/sync-models.js +2 -0
- package/dist/es6/models/sync-models.js.map +1 -0
- package/dist/es6/query/common/base-item-listing-query.class.d.ts +116 -0
- package/dist/es6/query/common/base-item-listing-query.class.js +174 -0
- package/dist/es6/query/common/base-item-listing-query.class.js.map +1 -0
- package/dist/es6/query/common/base-listing-query.class.d.ts +1 -108
- package/dist/es6/query/common/base-listing-query.class.js +2 -166
- package/dist/es6/query/common/base-listing-query.class.js.map +1 -1
- package/dist/es6/query/element/element-query.class.js +1 -2
- package/dist/es6/query/element/element-query.class.js.map +1 -1
- package/dist/es6/query/index.d.ts +2 -0
- package/dist/es6/query/index.js +2 -0
- package/dist/es6/query/index.js.map +1 -1
- package/dist/es6/query/item/multiple-items-query.class.d.ts +2 -2
- package/dist/es6/query/item/multiple-items-query.class.js +2 -2
- package/dist/es6/query/item/multiple-items-query.class.js.map +1 -1
- package/dist/es6/query/items-feed/items-feed-query.class.d.ts +2 -2
- package/dist/es6/query/items-feed/items-feed-query.class.js +3 -3
- package/dist/es6/query/items-feed/items-feed-query.class.js.map +1 -1
- package/dist/es6/query/language/languages-query.class.d.ts +0 -4
- package/dist/es6/query/language/languages-query.class.js +1 -13
- package/dist/es6/query/language/languages-query.class.js.map +1 -1
- package/dist/es6/query/sync/initialize-sync-query.class.d.ts +35 -0
- package/dist/es6/query/sync/initialize-sync-query.class.js +55 -0
- package/dist/es6/query/sync/initialize-sync-query.class.js.map +1 -0
- package/dist/es6/query/sync/sync-changes-query.class.d.ts +21 -0
- package/dist/es6/query/sync/sync-changes-query.class.js +35 -0
- package/dist/es6/query/sync/sync-changes-query.class.js.map +1 -0
- package/dist/es6/query/taxonomy/taxonomies-query.class.d.ts +0 -4
- package/dist/es6/query/taxonomy/taxonomies-query.class.js +1 -13
- package/dist/es6/query/taxonomy/taxonomies-query.class.js.map +1 -1
- package/dist/es6/query/type/multiple-type-query.class.d.ts +15 -0
- package/dist/es6/query/type/multiple-type-query.class.js +25 -0
- package/dist/es6/query/type/multiple-type-query.class.js.map +1 -1
- package/dist/es6/sdk-info.generated.js +1 -1
- package/dist/es6/services/base-delivery-query.service.d.ts +8 -0
- package/dist/es6/services/base-delivery-query.service.js +29 -0
- package/dist/es6/services/base-delivery-query.service.js.map +1 -1
- package/dist/es6/services/delivery-query.service.d.ts +16 -1
- package/dist/es6/services/delivery-query.service.js +25 -0
- package/dist/es6/services/delivery-query.service.js.map +1 -1
- package/dist/es6/services/mapping.service.d.ts +5 -0
- package/dist/es6/services/mapping.service.js +12 -1
- package/dist/es6/services/mapping.service.js.map +1 -1
- package/dist/esnext/client/delivery-client.d.ts +9 -1
- package/dist/esnext/client/delivery-client.js +13 -1
- package/dist/esnext/client/delivery-client.js.map +1 -1
- package/dist/esnext/client/idelivery-client.interface.d.ts +9 -1
- package/dist/esnext/contracts/contracts.d.ts +17 -6
- package/dist/esnext/mappers/generic-element.mapper.js +6 -5
- package/dist/esnext/mappers/generic-element.mapper.js.map +1 -1
- package/dist/esnext/mappers/index.d.ts +1 -0
- package/dist/esnext/mappers/index.js +1 -0
- package/dist/esnext/mappers/index.js.map +1 -1
- package/dist/esnext/mappers/sync.mapper.d.ts +5 -0
- package/dist/esnext/mappers/sync.mapper.js +14 -0
- package/dist/esnext/mappers/sync.mapper.js.map +1 -0
- package/dist/esnext/mappers/type.mapper.js.map +1 -1
- package/dist/esnext/models/element-models.d.ts +1 -1
- package/dist/esnext/models/index.d.ts +1 -0
- package/dist/esnext/models/index.js +1 -0
- package/dist/esnext/models/index.js.map +1 -1
- package/dist/esnext/models/responses.d.ts +11 -0
- package/dist/esnext/models/sync-models.d.ts +12 -0
- package/dist/esnext/models/sync-models.js +2 -0
- package/dist/esnext/models/sync-models.js.map +1 -0
- package/dist/esnext/query/common/base-item-listing-query.class.d.ts +116 -0
- package/dist/esnext/query/common/base-item-listing-query.class.js +174 -0
- package/dist/esnext/query/common/base-item-listing-query.class.js.map +1 -0
- package/dist/esnext/query/common/base-listing-query.class.d.ts +1 -108
- package/dist/esnext/query/common/base-listing-query.class.js +2 -166
- package/dist/esnext/query/common/base-listing-query.class.js.map +1 -1
- package/dist/esnext/query/element/element-query.class.js +1 -2
- package/dist/esnext/query/element/element-query.class.js.map +1 -1
- package/dist/esnext/query/index.d.ts +2 -0
- package/dist/esnext/query/index.js +2 -0
- package/dist/esnext/query/index.js.map +1 -1
- package/dist/esnext/query/item/multiple-items-query.class.d.ts +2 -2
- package/dist/esnext/query/item/multiple-items-query.class.js +2 -2
- package/dist/esnext/query/item/multiple-items-query.class.js.map +1 -1
- package/dist/esnext/query/items-feed/items-feed-query.class.d.ts +2 -2
- package/dist/esnext/query/items-feed/items-feed-query.class.js +3 -3
- package/dist/esnext/query/items-feed/items-feed-query.class.js.map +1 -1
- package/dist/esnext/query/language/languages-query.class.d.ts +0 -4
- package/dist/esnext/query/language/languages-query.class.js +1 -13
- package/dist/esnext/query/language/languages-query.class.js.map +1 -1
- package/dist/esnext/query/sync/initialize-sync-query.class.d.ts +35 -0
- package/dist/esnext/query/sync/initialize-sync-query.class.js +55 -0
- package/dist/esnext/query/sync/initialize-sync-query.class.js.map +1 -0
- package/dist/esnext/query/sync/sync-changes-query.class.d.ts +21 -0
- package/dist/esnext/query/sync/sync-changes-query.class.js +35 -0
- package/dist/esnext/query/sync/sync-changes-query.class.js.map +1 -0
- package/dist/esnext/query/taxonomy/taxonomies-query.class.d.ts +0 -4
- package/dist/esnext/query/taxonomy/taxonomies-query.class.js +1 -13
- package/dist/esnext/query/taxonomy/taxonomies-query.class.js.map +1 -1
- package/dist/esnext/query/type/multiple-type-query.class.d.ts +15 -0
- package/dist/esnext/query/type/multiple-type-query.class.js +25 -0
- package/dist/esnext/query/type/multiple-type-query.class.js.map +1 -1
- package/dist/esnext/sdk-info.generated.js +1 -1
- package/dist/esnext/services/base-delivery-query.service.d.ts +8 -0
- package/dist/esnext/services/base-delivery-query.service.js +29 -0
- package/dist/esnext/services/base-delivery-query.service.js.map +1 -1
- package/dist/esnext/services/delivery-query.service.d.ts +16 -1
- package/dist/esnext/services/delivery-query.service.js +25 -0
- package/dist/esnext/services/delivery-query.service.js.map +1 -1
- package/dist/esnext/services/mapping.service.d.ts +5 -0
- package/dist/esnext/services/mapping.service.js +12 -1
- package/dist/esnext/services/mapping.service.js.map +1 -1
- package/lib/client/delivery-client.ts +17 -1
- package/lib/client/idelivery-client.interface.ts +12 -0
- package/lib/contracts/contracts.ts +20 -6
- package/lib/mappers/generic-element.mapper.ts +7 -5
- package/lib/mappers/index.ts +1 -0
- package/lib/mappers/sync.mapper.ts +16 -0
- package/lib/mappers/type.mapper.ts +1 -1
- package/lib/models/element-models.ts +1 -1
- package/lib/models/index.ts +1 -0
- package/lib/models/responses.ts +19 -3
- package/lib/models/sync-models.ts +17 -0
- package/lib/query/common/base-item-listing-query.class.ts +205 -0
- package/lib/query/common/base-listing-query.class.ts +9 -191
- package/lib/query/element/element-query.class.ts +1 -3
- package/lib/query/index.ts +2 -0
- package/lib/query/item/multiple-items-query.class.ts +2 -2
- package/lib/query/items-feed/items-feed-query.class.ts +3 -3
- package/lib/query/language/languages-query.class.ts +0 -15
- package/lib/query/sync/initialize-sync-query.class.ts +78 -0
- package/lib/query/sync/sync-changes-query.class.ts +51 -0
- package/lib/query/taxonomy/taxonomies-query.class.ts +0 -15
- package/lib/query/type/multiple-type-query.class.ts +29 -6
- package/lib/sdk-info.generated.ts +1 -1
- package/lib/services/base-delivery-query.service.ts +40 -1
- package/lib/services/delivery-query.service.ts +35 -8
- package/lib/services/mapping.service.ts +17 -1
- package/package.json +6 -6
- package/readme.md +3 -3
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
return /******/ (() => { // webpackBootstrap
|
|
12
12
|
/******/ var __webpack_modules__ = ({
|
|
13
13
|
|
|
14
|
-
/***/ "./node_modules/@kontent-ai/core-sdk/dist/
|
|
14
|
+
/***/ "./node_modules/@kontent-ai/core-sdk/dist/es6/helpers/enum.helper.js":
|
|
15
15
|
/*!***************************************************************************!*\
|
|
16
|
-
!*** ./node_modules/@kontent-ai/core-sdk/dist/
|
|
16
|
+
!*** ./node_modules/@kontent-ai/core-sdk/dist/es6/helpers/enum.helper.js ***!
|
|
17
17
|
\***************************************************************************/
|
|
18
18
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
19
19
|
|
|
@@ -23,25 +23,21 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
23
23
|
/* harmony export */ "EnumHelper": () => (/* binding */ EnumHelper),
|
|
24
24
|
/* harmony export */ "enumHelper": () => (/* binding */ enumHelper)
|
|
25
25
|
/* harmony export */ });
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
EnumHelper.prototype.getAllNames = function (T) {
|
|
32
|
-
var enumNames = [];
|
|
33
|
-
for (var key in T) {
|
|
26
|
+
class EnumHelper {
|
|
27
|
+
getAllNames(T) {
|
|
28
|
+
const enumNames = [];
|
|
29
|
+
for (const key in T) {
|
|
34
30
|
if (T.hasOwnProperty(key)) {
|
|
35
31
|
enumNames.push(key);
|
|
36
32
|
}
|
|
37
33
|
}
|
|
38
34
|
return enumNames;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
}
|
|
36
|
+
getAllValues(T) {
|
|
37
|
+
const allEnumValues = Object.keys(T).map(key => T[key]);
|
|
42
38
|
return allEnumValues;
|
|
43
|
-
}
|
|
44
|
-
|
|
39
|
+
}
|
|
40
|
+
getEnumFromValue(T, value) {
|
|
45
41
|
try {
|
|
46
42
|
if (!value) {
|
|
47
43
|
return undefined;
|
|
@@ -51,8 +47,8 @@ var EnumHelper = /** @class */ (function () {
|
|
|
51
47
|
return T[value];
|
|
52
48
|
}
|
|
53
49
|
// for strings, we need to compare each value separately
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
const allEnumValues = this.getAllValues(T);
|
|
51
|
+
const result = allEnumValues.find(m => m.toLowerCase() === value.toString().toLowerCase());
|
|
56
52
|
if (!result) {
|
|
57
53
|
return undefined;
|
|
58
54
|
}
|
|
@@ -61,41 +57,28 @@ var EnumHelper = /** @class */ (function () {
|
|
|
61
57
|
catch (err) {
|
|
62
58
|
return undefined;
|
|
63
59
|
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
var enumName = allNames_1_1.value;
|
|
71
|
-
if (enumName.toLowerCase() === name.toLowerCase()) {
|
|
72
|
-
return T[enumName];
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
77
|
-
finally {
|
|
78
|
-
try {
|
|
79
|
-
if (allNames_1_1 && !allNames_1_1.done && (_a = allNames_1.return)) _a.call(allNames_1);
|
|
60
|
+
}
|
|
61
|
+
getEnumFromName(T, name) {
|
|
62
|
+
const allNames = this.getAllNames(T);
|
|
63
|
+
for (const enumName of allNames) {
|
|
64
|
+
if (enumName.toLowerCase() === name.toLowerCase()) {
|
|
65
|
+
return T[enumName];
|
|
80
66
|
}
|
|
81
|
-
finally { if (e_1) throw e_1.error; }
|
|
82
67
|
}
|
|
83
68
|
return undefined;
|
|
84
|
-
}
|
|
85
|
-
|
|
69
|
+
}
|
|
70
|
+
isNumeric(value) {
|
|
86
71
|
return !isNaN(parseFloat(value)) && isFinite(value);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
var enumHelper = new EnumHelper();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
const enumHelper = new EnumHelper();
|
|
92
75
|
//# sourceMappingURL=enum.helper.js.map
|
|
93
76
|
|
|
94
77
|
/***/ }),
|
|
95
78
|
|
|
96
|
-
/***/ "./node_modules/@kontent-ai/core-sdk/dist/
|
|
79
|
+
/***/ "./node_modules/@kontent-ai/core-sdk/dist/es6/helpers/header.helper.js":
|
|
97
80
|
/*!*****************************************************************************!*\
|
|
98
|
-
!*** ./node_modules/@kontent-ai/core-sdk/dist/
|
|
81
|
+
!*** ./node_modules/@kontent-ai/core-sdk/dist/es6/helpers/header.helper.js ***!
|
|
99
82
|
\*****************************************************************************/
|
|
100
83
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
101
84
|
|
|
@@ -105,8 +88,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
105
88
|
/* harmony export */ "HeaderHelper": () => (/* binding */ HeaderHelper),
|
|
106
89
|
/* harmony export */ "headerHelper": () => (/* binding */ headerHelper)
|
|
107
90
|
/* harmony export */ });
|
|
108
|
-
|
|
109
|
-
|
|
91
|
+
class HeaderHelper {
|
|
92
|
+
constructor() {
|
|
110
93
|
/**
|
|
111
94
|
* Header name for SDK usage
|
|
112
95
|
*/
|
|
@@ -115,23 +98,21 @@ var HeaderHelper = /** @class */ (function () {
|
|
|
115
98
|
/**
|
|
116
99
|
* Header identifying SDK type & version for internal purposes of Kontent.ai
|
|
117
100
|
*/
|
|
118
|
-
|
|
101
|
+
getSdkIdHeader(info) {
|
|
119
102
|
return {
|
|
120
103
|
header: this.sdkVersionHeader,
|
|
121
|
-
value:
|
|
104
|
+
value: `${info.host};${info.name};${info.version}`
|
|
122
105
|
};
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
var headerHelper = new HeaderHelper();
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
const headerHelper = new HeaderHelper();
|
|
128
109
|
//# sourceMappingURL=header.helper.js.map
|
|
129
110
|
|
|
130
111
|
/***/ }),
|
|
131
112
|
|
|
132
|
-
/***/ "./node_modules/@kontent-ai/core-sdk/dist/
|
|
113
|
+
/***/ "./node_modules/@kontent-ai/core-sdk/dist/es6/helpers/headers-helper.js":
|
|
133
114
|
/*!******************************************************************************!*\
|
|
134
|
-
!*** ./node_modules/@kontent-ai/core-sdk/dist/
|
|
115
|
+
!*** ./node_modules/@kontent-ai/core-sdk/dist/es6/helpers/headers-helper.js ***!
|
|
135
116
|
\******************************************************************************/
|
|
136
117
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
137
118
|
|
|
@@ -140,26 +121,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
140
121
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
141
122
|
/* harmony export */ "extractHeadersFromAxiosResponse": () => (/* binding */ extractHeadersFromAxiosResponse)
|
|
142
123
|
/* harmony export */ });
|
|
143
|
-
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
|
|
144
|
-
|
|
145
124
|
function extractHeadersFromAxiosResponse(response) {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
header: headerKey,
|
|
153
|
-
value: response.headers[headerKey]
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
158
|
-
finally {
|
|
159
|
-
try {
|
|
160
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
161
|
-
}
|
|
162
|
-
finally { if (e_1) throw e_1.error; }
|
|
125
|
+
const headers = [];
|
|
126
|
+
for (const headerKey of Object.keys(response.headers)) {
|
|
127
|
+
headers.push({
|
|
128
|
+
header: headerKey,
|
|
129
|
+
value: response.headers[headerKey]
|
|
130
|
+
});
|
|
163
131
|
}
|
|
164
132
|
return headers;
|
|
165
133
|
}
|
|
@@ -167,9 +135,9 @@ function extractHeadersFromAxiosResponse(response) {
|
|
|
167
135
|
|
|
168
136
|
/***/ }),
|
|
169
137
|
|
|
170
|
-
/***/ "./node_modules/@kontent-ai/core-sdk/dist/
|
|
138
|
+
/***/ "./node_modules/@kontent-ai/core-sdk/dist/es6/helpers/index.js":
|
|
171
139
|
/*!*********************************************************************!*\
|
|
172
|
-
!*** ./node_modules/@kontent-ai/core-sdk/dist/
|
|
140
|
+
!*** ./node_modules/@kontent-ai/core-sdk/dist/es6/helpers/index.js ***!
|
|
173
141
|
\*********************************************************************/
|
|
174
142
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
175
143
|
|
|
@@ -186,11 +154,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
186
154
|
/* harmony export */ "retryHelper": () => (/* reexport safe */ _retry_helper__WEBPACK_IMPORTED_MODULE_3__.retryHelper),
|
|
187
155
|
/* harmony export */ "urlHelper": () => (/* reexport safe */ _url_helper__WEBPACK_IMPORTED_MODULE_0__.urlHelper)
|
|
188
156
|
/* harmony export */ });
|
|
189
|
-
/* harmony import */ var _url_helper__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./url.helper */ "./node_modules/@kontent-ai/core-sdk/dist/
|
|
190
|
-
/* harmony import */ var _header_helper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./header.helper */ "./node_modules/@kontent-ai/core-sdk/dist/
|
|
191
|
-
/* harmony import */ var _enum_helper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./enum.helper */ "./node_modules/@kontent-ai/core-sdk/dist/
|
|
192
|
-
/* harmony import */ var _retry_helper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./retry-helper */ "./node_modules/@kontent-ai/core-sdk/dist/
|
|
193
|
-
/* harmony import */ var _headers_helper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./headers-helper */ "./node_modules/@kontent-ai/core-sdk/dist/
|
|
157
|
+
/* harmony import */ var _url_helper__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./url.helper */ "./node_modules/@kontent-ai/core-sdk/dist/es6/helpers/url.helper.js");
|
|
158
|
+
/* harmony import */ var _header_helper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./header.helper */ "./node_modules/@kontent-ai/core-sdk/dist/es6/helpers/header.helper.js");
|
|
159
|
+
/* harmony import */ var _enum_helper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./enum.helper */ "./node_modules/@kontent-ai/core-sdk/dist/es6/helpers/enum.helper.js");
|
|
160
|
+
/* harmony import */ var _retry_helper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./retry-helper */ "./node_modules/@kontent-ai/core-sdk/dist/es6/helpers/retry-helper.js");
|
|
161
|
+
/* harmony import */ var _headers_helper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./headers-helper */ "./node_modules/@kontent-ai/core-sdk/dist/es6/helpers/headers-helper.js");
|
|
194
162
|
|
|
195
163
|
|
|
196
164
|
|
|
@@ -200,9 +168,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
200
168
|
|
|
201
169
|
/***/ }),
|
|
202
170
|
|
|
203
|
-
/***/ "./node_modules/@kontent-ai/core-sdk/dist/
|
|
171
|
+
/***/ "./node_modules/@kontent-ai/core-sdk/dist/es6/helpers/retry-helper.js":
|
|
204
172
|
/*!****************************************************************************!*\
|
|
205
|
-
!*** ./node_modules/@kontent-ai/core-sdk/dist/
|
|
173
|
+
!*** ./node_modules/@kontent-ai/core-sdk/dist/es6/helpers/retry-helper.js ***!
|
|
206
174
|
\****************************************************************************/
|
|
207
175
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
208
176
|
|
|
@@ -212,11 +180,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
212
180
|
/* harmony export */ "RetryHelper": () => (/* binding */ RetryHelper),
|
|
213
181
|
/* harmony export */ "retryHelper": () => (/* binding */ retryHelper)
|
|
214
182
|
/* harmony export */ });
|
|
215
|
-
/* harmony import */ var _headers_helper__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./headers-helper */ "./node_modules/@kontent-ai/core-sdk/dist/
|
|
183
|
+
/* harmony import */ var _headers_helper__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./headers-helper */ "./node_modules/@kontent-ai/core-sdk/dist/es6/helpers/headers-helper.js");
|
|
216
184
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
var _this = this;
|
|
185
|
+
class RetryHelper {
|
|
186
|
+
constructor() {
|
|
220
187
|
this.requestCancelledMessagePrefix = 'Request cancelled';
|
|
221
188
|
this.retryAfterHeaderName = 'Retry-After';
|
|
222
189
|
this.defaultRetryStatusCodes = [408, 429, 500, 502, 503, 504];
|
|
@@ -224,10 +191,10 @@ var RetryHelper = /** @class */ (function () {
|
|
|
224
191
|
addJitter: true,
|
|
225
192
|
deltaBackoffMs: 1000,
|
|
226
193
|
maxAttempts: 5,
|
|
227
|
-
canRetryError:
|
|
194
|
+
canRetryError: (error) => this.canRetryErrorDefault(error)
|
|
228
195
|
};
|
|
229
196
|
}
|
|
230
|
-
|
|
197
|
+
getRetryErrorResult(data) {
|
|
231
198
|
var _a, _b, _c;
|
|
232
199
|
if (data.error && data.error.message) {
|
|
233
200
|
if (data.error.message.startsWith(this.requestCancelledMessagePrefix)) {
|
|
@@ -239,7 +206,7 @@ var RetryHelper = /** @class */ (function () {
|
|
|
239
206
|
};
|
|
240
207
|
}
|
|
241
208
|
}
|
|
242
|
-
|
|
209
|
+
const canRetryError = data.retryStrategy.canRetryError
|
|
243
210
|
? data.retryStrategy.canRetryError(data.error)
|
|
244
211
|
: this.defaultRetryStrategy.canRetryError(data.error);
|
|
245
212
|
if (!canRetryError) {
|
|
@@ -250,8 +217,8 @@ var RetryHelper = /** @class */ (function () {
|
|
|
250
217
|
maxRetries: 0
|
|
251
218
|
};
|
|
252
219
|
}
|
|
253
|
-
|
|
254
|
-
|
|
220
|
+
const maxRetries = ((_a = data.retryStrategy.maxAttempts) !== null && _a !== void 0 ? _a : this.defaultRetryStrategy.maxAttempts);
|
|
221
|
+
const maxRetriesReached = data.retryAttempt >= maxRetries;
|
|
255
222
|
if (maxRetriesReached) {
|
|
256
223
|
// request cannot be retried anymore due to maximum attempts
|
|
257
224
|
return {
|
|
@@ -261,7 +228,7 @@ var RetryHelper = /** @class */ (function () {
|
|
|
261
228
|
};
|
|
262
229
|
}
|
|
263
230
|
// get wait time
|
|
264
|
-
|
|
231
|
+
const retryResult = this.tryGetRetryAfterInMsFromError(data.error);
|
|
265
232
|
if (retryResult) {
|
|
266
233
|
// retry after header was provided
|
|
267
234
|
return {
|
|
@@ -271,103 +238,100 @@ var RetryHelper = /** @class */ (function () {
|
|
|
271
238
|
};
|
|
272
239
|
}
|
|
273
240
|
// wait time was not provided in header
|
|
274
|
-
|
|
241
|
+
const waitTimeMs = this.getNextWaitTimeMs((_b = data.retryStrategy.addJitter) !== null && _b !== void 0 ? _b : this.defaultRetryStrategy.addJitter, (_c = data.retryStrategy.deltaBackoffMs) !== null && _c !== void 0 ? _c : this.defaultRetryStrategy.deltaBackoffMs, data.retryAttempt);
|
|
275
242
|
return {
|
|
276
243
|
canRetry: true,
|
|
277
244
|
retryInMs: waitTimeMs,
|
|
278
245
|
maxRetries: maxRetries
|
|
279
246
|
};
|
|
280
|
-
}
|
|
281
|
-
|
|
247
|
+
}
|
|
248
|
+
getRetryStrategyFromStrategyOptions(retryOptions) {
|
|
282
249
|
if (!retryOptions) {
|
|
283
250
|
return this.defaultRetryStrategy;
|
|
284
251
|
}
|
|
285
252
|
return retryOptions;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
253
|
+
}
|
|
254
|
+
canRetryInTime(startTime, maxCumulativeWaitTimeMs) {
|
|
255
|
+
const start = startTime.getTime();
|
|
256
|
+
const now = new Date().getTime();
|
|
257
|
+
const differenceInMs = now - start;
|
|
291
258
|
return {
|
|
292
259
|
canRetry: differenceInMs < maxCumulativeWaitTimeMs,
|
|
293
260
|
differenceInMs: differenceInMs
|
|
294
261
|
};
|
|
295
|
-
}
|
|
296
|
-
|
|
262
|
+
}
|
|
263
|
+
getNextWaitTimeMs(addJitter, deltaBackoffMs, retryAttempts) {
|
|
297
264
|
if (!addJitter) {
|
|
298
265
|
return deltaBackoffMs * Math.pow(2, retryAttempts);
|
|
299
266
|
}
|
|
300
|
-
|
|
301
|
-
|
|
267
|
+
const from = 0.8 * deltaBackoffMs;
|
|
268
|
+
const to = 1.2 * deltaBackoffMs * Math.pow(2, retryAttempts);
|
|
302
269
|
return this.randomNumberFromInterval(from, to);
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
|
|
270
|
+
}
|
|
271
|
+
canRetryErrorDefault(error) {
|
|
272
|
+
const axiosError = this.tryGetAxiosError(error);
|
|
306
273
|
if (!axiosError) {
|
|
307
274
|
// by default non-axios errors are not retried
|
|
308
275
|
return false;
|
|
309
276
|
}
|
|
310
|
-
|
|
311
|
-
|
|
277
|
+
const statusCode = this.getStatusCodeFromError(error);
|
|
278
|
+
const canRetryStatusCode = this.canRetryStatusCode(statusCode, this.defaultRetryStatusCodes);
|
|
312
279
|
if (canRetryStatusCode) {
|
|
313
280
|
return true;
|
|
314
281
|
}
|
|
315
282
|
return false;
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
var axiosError = this.tryGetAxiosError(error);
|
|
283
|
+
}
|
|
284
|
+
tryGetRetryAfterInMsFromError(error) {
|
|
285
|
+
const axiosError = this.tryGetAxiosError(error);
|
|
320
286
|
if (!axiosError || !axiosError.response) {
|
|
321
287
|
return undefined;
|
|
322
288
|
}
|
|
323
|
-
|
|
324
|
-
|
|
289
|
+
const headers = (0,_headers_helper__WEBPACK_IMPORTED_MODULE_0__.extractHeadersFromAxiosResponse)(axiosError.response);
|
|
290
|
+
const retryValueHeader = headers.find((m) => m.header.toLowerCase() === this.retryAfterHeaderName.toLowerCase());
|
|
325
291
|
if (!retryValueHeader) {
|
|
326
292
|
return undefined;
|
|
327
293
|
}
|
|
328
|
-
|
|
294
|
+
const retryInSeconds = +retryValueHeader.value;
|
|
329
295
|
return retryInSeconds * 1000;
|
|
330
|
-
}
|
|
331
|
-
|
|
296
|
+
}
|
|
297
|
+
canRetryStatusCode(statusCode, useRetryForResponseCodes) {
|
|
332
298
|
return useRetryForResponseCodes.includes(statusCode);
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
|
|
299
|
+
}
|
|
300
|
+
getStatusCodeFromError(error) {
|
|
301
|
+
const axiosError = this.tryGetAxiosError(error);
|
|
336
302
|
if (!axiosError || !axiosError.response) {
|
|
337
303
|
return 0;
|
|
338
304
|
}
|
|
339
305
|
return axiosError.response.status;
|
|
340
|
-
}
|
|
341
|
-
|
|
306
|
+
}
|
|
307
|
+
tryGetAxiosError(error) {
|
|
342
308
|
if (!error) {
|
|
343
309
|
return undefined;
|
|
344
310
|
}
|
|
345
311
|
if (error.isAxiosError) {
|
|
346
312
|
return error;
|
|
347
313
|
}
|
|
348
|
-
|
|
314
|
+
const originalError = error.originalError;
|
|
349
315
|
if (originalError && originalError.isAxiosError) {
|
|
350
316
|
return originalError;
|
|
351
317
|
}
|
|
352
318
|
return undefined;
|
|
353
|
-
}
|
|
319
|
+
}
|
|
354
320
|
/**
|
|
355
321
|
* min and max included
|
|
356
322
|
*/
|
|
357
|
-
|
|
323
|
+
randomNumberFromInterval(min, max) {
|
|
358
324
|
return Math.floor(Math.random() * (max - min + 1) + min);
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
var retryHelper = new RetryHelper();
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
const retryHelper = new RetryHelper();
|
|
364
328
|
//# sourceMappingURL=retry-helper.js.map
|
|
365
329
|
|
|
366
330
|
/***/ }),
|
|
367
331
|
|
|
368
|
-
/***/ "./node_modules/@kontent-ai/core-sdk/dist/
|
|
332
|
+
/***/ "./node_modules/@kontent-ai/core-sdk/dist/es6/helpers/url.helper.js":
|
|
369
333
|
/*!**************************************************************************!*\
|
|
370
|
-
!*** ./node_modules/@kontent-ai/core-sdk/dist/
|
|
334
|
+
!*** ./node_modules/@kontent-ai/core-sdk/dist/es6/helpers/url.helper.js ***!
|
|
371
335
|
\**************************************************************************/
|
|
372
336
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
373
337
|
|
|
@@ -377,17 +341,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
377
341
|
/* harmony export */ "UrlHelper": () => (/* binding */ UrlHelper),
|
|
378
342
|
/* harmony export */ "urlHelper": () => (/* binding */ urlHelper)
|
|
379
343
|
/* harmony export */ });
|
|
380
|
-
|
|
381
|
-
function UrlHelper() {
|
|
382
|
-
}
|
|
344
|
+
class UrlHelper {
|
|
383
345
|
/**
|
|
384
346
|
* Adds query parameters to given url
|
|
385
347
|
* @param url Url to which options will be added
|
|
386
348
|
* @param options Query parameters to add
|
|
387
349
|
*/
|
|
388
|
-
|
|
350
|
+
addOptionsToUrl(url, options) {
|
|
389
351
|
if (options) {
|
|
390
|
-
options.forEach(
|
|
352
|
+
options.forEach(filter => {
|
|
391
353
|
if (url.indexOf('?') > -1) {
|
|
392
354
|
url += '&';
|
|
393
355
|
}
|
|
@@ -398,18 +360,16 @@ var UrlHelper = /** @class */ (function () {
|
|
|
398
360
|
});
|
|
399
361
|
}
|
|
400
362
|
return url;
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
var urlHelper = new UrlHelper();
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
const urlHelper = new UrlHelper();
|
|
406
366
|
//# sourceMappingURL=url.helper.js.map
|
|
407
367
|
|
|
408
368
|
/***/ }),
|
|
409
369
|
|
|
410
|
-
/***/ "./node_modules/@kontent-ai/core-sdk/dist/
|
|
370
|
+
/***/ "./node_modules/@kontent-ai/core-sdk/dist/es6/http/http.debugger.js":
|
|
411
371
|
/*!**************************************************************************!*\
|
|
412
|
-
!*** ./node_modules/@kontent-ai/core-sdk/dist/
|
|
372
|
+
!*** ./node_modules/@kontent-ai/core-sdk/dist/es6/http/http.debugger.js ***!
|
|
413
373
|
\**************************************************************************/
|
|
414
374
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
415
375
|
|
|
@@ -419,35 +379,31 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
419
379
|
/* harmony export */ "HttpDebugger": () => (/* binding */ HttpDebugger),
|
|
420
380
|
/* harmony export */ "httpDebugger": () => (/* binding */ httpDebugger)
|
|
421
381
|
/* harmony export */ });
|
|
422
|
-
|
|
423
|
-
function HttpDebugger() {
|
|
424
|
-
}
|
|
382
|
+
class HttpDebugger {
|
|
425
383
|
/*
|
|
426
384
|
Called when http request is started
|
|
427
385
|
*/
|
|
428
|
-
|
|
429
|
-
}
|
|
386
|
+
debugStartHttpRequest() {
|
|
387
|
+
}
|
|
430
388
|
/*
|
|
431
389
|
Called when http request is resolved
|
|
432
390
|
*/
|
|
433
|
-
|
|
434
|
-
}
|
|
391
|
+
debugSuccessHttpRequest() {
|
|
392
|
+
}
|
|
435
393
|
/*
|
|
436
394
|
Called when http request is being retried
|
|
437
395
|
*/
|
|
438
|
-
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
var httpDebugger = new HttpDebugger();
|
|
396
|
+
debugRetryHttpRequest() {
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
const httpDebugger = new HttpDebugger();
|
|
444
400
|
//# sourceMappingURL=http.debugger.js.map
|
|
445
401
|
|
|
446
402
|
/***/ }),
|
|
447
403
|
|
|
448
|
-
/***/ "./node_modules/@kontent-ai/core-sdk/dist/
|
|
404
|
+
/***/ "./node_modules/@kontent-ai/core-sdk/dist/es6/http/http.functions.js":
|
|
449
405
|
/*!***************************************************************************!*\
|
|
450
|
-
!*** ./node_modules/@kontent-ai/core-sdk/dist/
|
|
406
|
+
!*** ./node_modules/@kontent-ai/core-sdk/dist/es6/http/http.functions.js ***!
|
|
451
407
|
\***************************************************************************/
|
|
452
408
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
453
409
|
|
|
@@ -461,342 +417,256 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
461
417
|
/* harmony export */ "postWithRetryAsync": () => (/* binding */ postWithRetryAsync),
|
|
462
418
|
/* harmony export */ "putWithRetryAsync": () => (/* binding */ putWithRetryAsync)
|
|
463
419
|
/* harmony export */ });
|
|
464
|
-
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
|
|
465
420
|
/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! axios */ "./node_modules/axios/index.js");
|
|
466
421
|
/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_0__);
|
|
467
|
-
/* harmony import */ var _helpers_headers_helper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/headers-helper */ "./node_modules/@kontent-ai/core-sdk/dist/
|
|
468
|
-
/* harmony import */ var _http_debugger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./http.debugger */ "./node_modules/@kontent-ai/core-sdk/dist/
|
|
469
|
-
/* harmony import */ var _helpers_retry_helper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../helpers/retry-helper */ "./node_modules/@kontent-ai/core-sdk/dist/
|
|
470
|
-
|
|
422
|
+
/* harmony import */ var _helpers_headers_helper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/headers-helper */ "./node_modules/@kontent-ai/core-sdk/dist/es6/helpers/headers-helper.js");
|
|
423
|
+
/* harmony import */ var _http_debugger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./http.debugger */ "./node_modules/@kontent-ai/core-sdk/dist/es6/http/http.debugger.js");
|
|
424
|
+
/* harmony import */ var _helpers_retry_helper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../helpers/retry-helper */ "./node_modules/@kontent-ai/core-sdk/dist/es6/helpers/retry-helper.js");
|
|
425
|
+
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
426
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
427
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
428
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
429
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
430
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
431
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
432
|
+
});
|
|
433
|
+
};
|
|
471
434
|
|
|
472
435
|
|
|
473
436
|
|
|
474
437
|
|
|
475
438
|
function getWithRetryAsync(instance, call, functionsConfig, options) {
|
|
476
439
|
var _a;
|
|
477
|
-
return
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
rawResponse: axiosResponse,
|
|
506
|
-
headers: (0,_helpers_headers_helper__WEBPACK_IMPORTED_MODULE_1__.extractHeadersFromAxiosResponse)(axiosResponse),
|
|
507
|
-
status: axiosResponse.status,
|
|
508
|
-
retryStrategy: {
|
|
509
|
-
options: retryStrategyOptions,
|
|
510
|
-
retryAttempts: retryAttempt
|
|
511
|
-
}
|
|
512
|
-
};
|
|
513
|
-
_http_debugger__WEBPACK_IMPORTED_MODULE_2__.httpDebugger.debugSuccessHttpRequest();
|
|
514
|
-
return [2 /*return*/, response];
|
|
515
|
-
}
|
|
516
|
-
});
|
|
517
|
-
}); }
|
|
518
|
-
})];
|
|
519
|
-
case 1: return [2 /*return*/, _b.sent()];
|
|
520
|
-
}
|
|
440
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
441
|
+
const retryStrategyOptions = (_a = options === null || options === void 0 ? void 0 : options.retryStrategy) !== null && _a !== void 0 ? _a : _helpers_retry_helper__WEBPACK_IMPORTED_MODULE_3__.retryHelper.defaultRetryStrategy;
|
|
442
|
+
return yield runWithRetryAsync({
|
|
443
|
+
retryAttempt: 0,
|
|
444
|
+
url: call.url,
|
|
445
|
+
retryStrategy: retryStrategyOptions,
|
|
446
|
+
functionsConfig: functionsConfig,
|
|
447
|
+
call: (retryAttempt) => __awaiter(this, void 0, void 0, function* () {
|
|
448
|
+
var _b, _c;
|
|
449
|
+
_http_debugger__WEBPACK_IMPORTED_MODULE_2__.httpDebugger.debugStartHttpRequest();
|
|
450
|
+
const axiosResponse = yield instance.get(call.url, {
|
|
451
|
+
headers: getHeadersJson((_b = options === null || options === void 0 ? void 0 : options.headers) !== null && _b !== void 0 ? _b : [], false),
|
|
452
|
+
responseType: options === null || options === void 0 ? void 0 : options.responseType,
|
|
453
|
+
cancelToken: (_c = options === null || options === void 0 ? void 0 : options.cancelToken) === null || _c === void 0 ? void 0 : _c.token
|
|
454
|
+
});
|
|
455
|
+
const response = {
|
|
456
|
+
data: axiosResponse.data,
|
|
457
|
+
rawResponse: axiosResponse,
|
|
458
|
+
headers: (0,_helpers_headers_helper__WEBPACK_IMPORTED_MODULE_1__.extractHeadersFromAxiosResponse)(axiosResponse),
|
|
459
|
+
status: axiosResponse.status,
|
|
460
|
+
retryStrategy: {
|
|
461
|
+
options: retryStrategyOptions,
|
|
462
|
+
retryAttempts: retryAttempt
|
|
463
|
+
}
|
|
464
|
+
};
|
|
465
|
+
_http_debugger__WEBPACK_IMPORTED_MODULE_2__.httpDebugger.debugSuccessHttpRequest();
|
|
466
|
+
return response;
|
|
467
|
+
})
|
|
521
468
|
});
|
|
522
469
|
});
|
|
523
470
|
}
|
|
524
471
|
function postWithRetryAsync(instance, call, functionsConfig, options) {
|
|
525
472
|
var _a;
|
|
526
|
-
return
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
rawResponse: axiosResponse,
|
|
559
|
-
headers: (0,_helpers_headers_helper__WEBPACK_IMPORTED_MODULE_1__.extractHeadersFromAxiosResponse)(axiosResponse),
|
|
560
|
-
status: axiosResponse.status,
|
|
561
|
-
retryStrategy: {
|
|
562
|
-
options: retryStrategyOptions,
|
|
563
|
-
retryAttempts: retryAttempt
|
|
564
|
-
}
|
|
565
|
-
};
|
|
566
|
-
_http_debugger__WEBPACK_IMPORTED_MODULE_2__.httpDebugger.debugSuccessHttpRequest();
|
|
567
|
-
return [2 /*return*/, response];
|
|
568
|
-
}
|
|
569
|
-
});
|
|
570
|
-
}); }
|
|
571
|
-
})];
|
|
572
|
-
case 1: return [2 /*return*/, _b.sent()];
|
|
573
|
-
}
|
|
473
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
474
|
+
const retryStrategyOptions = (_a = options === null || options === void 0 ? void 0 : options.retryStrategy) !== null && _a !== void 0 ? _a : _helpers_retry_helper__WEBPACK_IMPORTED_MODULE_3__.retryHelper.defaultRetryStrategy;
|
|
475
|
+
return yield runWithRetryAsync({
|
|
476
|
+
retryAttempt: 0,
|
|
477
|
+
url: call.url,
|
|
478
|
+
retryStrategy: retryStrategyOptions,
|
|
479
|
+
functionsConfig: functionsConfig,
|
|
480
|
+
call: (retryAttempt) => __awaiter(this, void 0, void 0, function* () {
|
|
481
|
+
var _b, _c;
|
|
482
|
+
_http_debugger__WEBPACK_IMPORTED_MODULE_2__.httpDebugger.debugStartHttpRequest();
|
|
483
|
+
const axiosResponse = yield instance.post(call.url, call.body, {
|
|
484
|
+
headers: getHeadersJson((_b = options === null || options === void 0 ? void 0 : options.headers) !== null && _b !== void 0 ? _b : [], false),
|
|
485
|
+
responseType: options === null || options === void 0 ? void 0 : options.responseType,
|
|
486
|
+
// required for uploading large files
|
|
487
|
+
// https://github.com/axios/axios/issues/1362
|
|
488
|
+
maxContentLength: 'Infinity',
|
|
489
|
+
maxBodyLength: 'Infinity',
|
|
490
|
+
cancelToken: (_c = options === null || options === void 0 ? void 0 : options.cancelToken) === null || _c === void 0 ? void 0 : _c.token
|
|
491
|
+
});
|
|
492
|
+
const response = {
|
|
493
|
+
data: axiosResponse.data,
|
|
494
|
+
rawResponse: axiosResponse,
|
|
495
|
+
headers: (0,_helpers_headers_helper__WEBPACK_IMPORTED_MODULE_1__.extractHeadersFromAxiosResponse)(axiosResponse),
|
|
496
|
+
status: axiosResponse.status,
|
|
497
|
+
retryStrategy: {
|
|
498
|
+
options: retryStrategyOptions,
|
|
499
|
+
retryAttempts: retryAttempt
|
|
500
|
+
}
|
|
501
|
+
};
|
|
502
|
+
_http_debugger__WEBPACK_IMPORTED_MODULE_2__.httpDebugger.debugSuccessHttpRequest();
|
|
503
|
+
return response;
|
|
504
|
+
})
|
|
574
505
|
});
|
|
575
506
|
});
|
|
576
507
|
}
|
|
577
508
|
function putWithRetryAsync(instance, call, functionsConfig, options) {
|
|
578
509
|
var _a;
|
|
579
|
-
return
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
rawResponse: axiosResponse,
|
|
612
|
-
headers: (0,_helpers_headers_helper__WEBPACK_IMPORTED_MODULE_1__.extractHeadersFromAxiosResponse)(axiosResponse),
|
|
613
|
-
status: axiosResponse.status,
|
|
614
|
-
retryStrategy: {
|
|
615
|
-
options: retryStrategyOptions,
|
|
616
|
-
retryAttempts: retryAttempt
|
|
617
|
-
}
|
|
618
|
-
};
|
|
619
|
-
_http_debugger__WEBPACK_IMPORTED_MODULE_2__.httpDebugger.debugSuccessHttpRequest();
|
|
620
|
-
return [2 /*return*/, response];
|
|
621
|
-
}
|
|
622
|
-
});
|
|
623
|
-
}); }
|
|
624
|
-
})];
|
|
625
|
-
case 1: return [2 /*return*/, _b.sent()];
|
|
626
|
-
}
|
|
510
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
511
|
+
const retryStrategyOptions = (_a = options === null || options === void 0 ? void 0 : options.retryStrategy) !== null && _a !== void 0 ? _a : _helpers_retry_helper__WEBPACK_IMPORTED_MODULE_3__.retryHelper.defaultRetryStrategy;
|
|
512
|
+
return yield runWithRetryAsync({
|
|
513
|
+
retryAttempt: 0,
|
|
514
|
+
url: call.url,
|
|
515
|
+
retryStrategy: retryStrategyOptions,
|
|
516
|
+
functionsConfig: functionsConfig,
|
|
517
|
+
call: (retryAttempt) => __awaiter(this, void 0, void 0, function* () {
|
|
518
|
+
var _b, _c;
|
|
519
|
+
_http_debugger__WEBPACK_IMPORTED_MODULE_2__.httpDebugger.debugStartHttpRequest();
|
|
520
|
+
const axiosResponse = yield instance.put(call.url, call.body, {
|
|
521
|
+
headers: getHeadersJson((_b = options === null || options === void 0 ? void 0 : options.headers) !== null && _b !== void 0 ? _b : [], false),
|
|
522
|
+
responseType: options === null || options === void 0 ? void 0 : options.responseType,
|
|
523
|
+
// required for uploading large files
|
|
524
|
+
// https://github.com/axios/axios/issues/1362
|
|
525
|
+
maxContentLength: 'Infinity',
|
|
526
|
+
maxBodyLength: 'Infinity',
|
|
527
|
+
cancelToken: (_c = options === null || options === void 0 ? void 0 : options.cancelToken) === null || _c === void 0 ? void 0 : _c.token
|
|
528
|
+
});
|
|
529
|
+
const response = {
|
|
530
|
+
data: axiosResponse.data,
|
|
531
|
+
rawResponse: axiosResponse,
|
|
532
|
+
headers: (0,_helpers_headers_helper__WEBPACK_IMPORTED_MODULE_1__.extractHeadersFromAxiosResponse)(axiosResponse),
|
|
533
|
+
status: axiosResponse.status,
|
|
534
|
+
retryStrategy: {
|
|
535
|
+
options: retryStrategyOptions,
|
|
536
|
+
retryAttempts: retryAttempt
|
|
537
|
+
}
|
|
538
|
+
};
|
|
539
|
+
_http_debugger__WEBPACK_IMPORTED_MODULE_2__.httpDebugger.debugSuccessHttpRequest();
|
|
540
|
+
return response;
|
|
541
|
+
})
|
|
627
542
|
});
|
|
628
543
|
});
|
|
629
544
|
}
|
|
630
545
|
function patchWithRetryAsync(instance, call, functionsConfig, options) {
|
|
631
546
|
var _a;
|
|
632
|
-
return
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
rawResponse: axiosResponse,
|
|
665
|
-
headers: (0,_helpers_headers_helper__WEBPACK_IMPORTED_MODULE_1__.extractHeadersFromAxiosResponse)(axiosResponse),
|
|
666
|
-
status: axiosResponse.status,
|
|
667
|
-
retryStrategy: {
|
|
668
|
-
options: retryStrategyOptions,
|
|
669
|
-
retryAttempts: retryAttempt
|
|
670
|
-
}
|
|
671
|
-
};
|
|
672
|
-
_http_debugger__WEBPACK_IMPORTED_MODULE_2__.httpDebugger.debugSuccessHttpRequest();
|
|
673
|
-
return [2 /*return*/, response];
|
|
674
|
-
}
|
|
675
|
-
});
|
|
676
|
-
}); }
|
|
677
|
-
})];
|
|
678
|
-
case 1: return [2 /*return*/, _b.sent()];
|
|
679
|
-
}
|
|
547
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
548
|
+
const retryStrategyOptions = (_a = options === null || options === void 0 ? void 0 : options.retryStrategy) !== null && _a !== void 0 ? _a : _helpers_retry_helper__WEBPACK_IMPORTED_MODULE_3__.retryHelper.defaultRetryStrategy;
|
|
549
|
+
return yield runWithRetryAsync({
|
|
550
|
+
retryAttempt: 0,
|
|
551
|
+
url: call.url,
|
|
552
|
+
retryStrategy: retryStrategyOptions,
|
|
553
|
+
functionsConfig: functionsConfig,
|
|
554
|
+
call: (retryAttempt) => __awaiter(this, void 0, void 0, function* () {
|
|
555
|
+
var _b, _c;
|
|
556
|
+
_http_debugger__WEBPACK_IMPORTED_MODULE_2__.httpDebugger.debugStartHttpRequest();
|
|
557
|
+
const axiosResponse = yield instance.patch(call.url, call.body, {
|
|
558
|
+
headers: getHeadersJson((_b = options === null || options === void 0 ? void 0 : options.headers) !== null && _b !== void 0 ? _b : [], false),
|
|
559
|
+
responseType: options === null || options === void 0 ? void 0 : options.responseType,
|
|
560
|
+
// required for uploading large files
|
|
561
|
+
// https://github.com/axios/axios/issues/1362
|
|
562
|
+
maxContentLength: 'Infinity',
|
|
563
|
+
maxBodyLength: 'Infinity',
|
|
564
|
+
cancelToken: (_c = options === null || options === void 0 ? void 0 : options.cancelToken) === null || _c === void 0 ? void 0 : _c.token
|
|
565
|
+
});
|
|
566
|
+
const response = {
|
|
567
|
+
data: axiosResponse.data,
|
|
568
|
+
rawResponse: axiosResponse,
|
|
569
|
+
headers: (0,_helpers_headers_helper__WEBPACK_IMPORTED_MODULE_1__.extractHeadersFromAxiosResponse)(axiosResponse),
|
|
570
|
+
status: axiosResponse.status,
|
|
571
|
+
retryStrategy: {
|
|
572
|
+
options: retryStrategyOptions,
|
|
573
|
+
retryAttempts: retryAttempt
|
|
574
|
+
}
|
|
575
|
+
};
|
|
576
|
+
_http_debugger__WEBPACK_IMPORTED_MODULE_2__.httpDebugger.debugSuccessHttpRequest();
|
|
577
|
+
return response;
|
|
578
|
+
})
|
|
680
579
|
});
|
|
681
580
|
});
|
|
682
581
|
}
|
|
683
582
|
function deleteWithRetryAsync(instance, call, functionsConfig, options) {
|
|
684
583
|
var _a;
|
|
685
|
-
return
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
rawResponse: axiosResponse,
|
|
718
|
-
headers: (0,_helpers_headers_helper__WEBPACK_IMPORTED_MODULE_1__.extractHeadersFromAxiosResponse)(axiosResponse),
|
|
719
|
-
status: axiosResponse.status,
|
|
720
|
-
retryStrategy: {
|
|
721
|
-
options: retryStrategyOptions,
|
|
722
|
-
retryAttempts: retryAttempt
|
|
723
|
-
}
|
|
724
|
-
};
|
|
725
|
-
_http_debugger__WEBPACK_IMPORTED_MODULE_2__.httpDebugger.debugSuccessHttpRequest();
|
|
726
|
-
return [2 /*return*/, response];
|
|
727
|
-
}
|
|
728
|
-
});
|
|
729
|
-
}); }
|
|
730
|
-
})];
|
|
731
|
-
case 1: return [2 /*return*/, _b.sent()];
|
|
732
|
-
}
|
|
584
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
585
|
+
const retryStrategyOptions = (_a = options === null || options === void 0 ? void 0 : options.retryStrategy) !== null && _a !== void 0 ? _a : _helpers_retry_helper__WEBPACK_IMPORTED_MODULE_3__.retryHelper.defaultRetryStrategy;
|
|
586
|
+
return yield runWithRetryAsync({
|
|
587
|
+
retryAttempt: 0,
|
|
588
|
+
url: call.url,
|
|
589
|
+
retryStrategy: retryStrategyOptions,
|
|
590
|
+
functionsConfig: functionsConfig,
|
|
591
|
+
call: (retryAttempt) => __awaiter(this, void 0, void 0, function* () {
|
|
592
|
+
var _b, _c;
|
|
593
|
+
_http_debugger__WEBPACK_IMPORTED_MODULE_2__.httpDebugger.debugStartHttpRequest();
|
|
594
|
+
const axiosResponse = yield instance.delete(call.url, {
|
|
595
|
+
headers: getHeadersJson((_b = options === null || options === void 0 ? void 0 : options.headers) !== null && _b !== void 0 ? _b : [], false),
|
|
596
|
+
responseType: options === null || options === void 0 ? void 0 : options.responseType,
|
|
597
|
+
// required for uploading large files
|
|
598
|
+
// https://github.com/axios/axios/issues/1362
|
|
599
|
+
maxContentLength: 'Infinity',
|
|
600
|
+
maxBodyLength: 'Infinity',
|
|
601
|
+
cancelToken: (_c = options === null || options === void 0 ? void 0 : options.cancelToken) === null || _c === void 0 ? void 0 : _c.token
|
|
602
|
+
});
|
|
603
|
+
const response = {
|
|
604
|
+
data: axiosResponse.data,
|
|
605
|
+
rawResponse: axiosResponse,
|
|
606
|
+
headers: (0,_helpers_headers_helper__WEBPACK_IMPORTED_MODULE_1__.extractHeadersFromAxiosResponse)(axiosResponse),
|
|
607
|
+
status: axiosResponse.status,
|
|
608
|
+
retryStrategy: {
|
|
609
|
+
options: retryStrategyOptions,
|
|
610
|
+
retryAttempts: retryAttempt
|
|
611
|
+
}
|
|
612
|
+
};
|
|
613
|
+
_http_debugger__WEBPACK_IMPORTED_MODULE_2__.httpDebugger.debugSuccessHttpRequest();
|
|
614
|
+
return response;
|
|
615
|
+
})
|
|
733
616
|
});
|
|
734
617
|
});
|
|
735
618
|
}
|
|
736
619
|
function createCancelToken() {
|
|
737
|
-
|
|
738
|
-
|
|
620
|
+
let canceler;
|
|
621
|
+
const token = new (axios__WEBPACK_IMPORTED_MODULE_0___default().CancelToken)((c) => {
|
|
739
622
|
// An executor function receives a cancel function as a parameter
|
|
740
623
|
canceler = c;
|
|
741
624
|
});
|
|
742
625
|
return {
|
|
743
|
-
cancel:
|
|
744
|
-
return canceler("".concat(_helpers_retry_helper__WEBPACK_IMPORTED_MODULE_3__.retryHelper.requestCancelledMessagePrefix, ": ").concat(cancelMessage !== null && cancelMessage !== void 0 ? cancelMessage : 'User cancel'));
|
|
745
|
-
},
|
|
626
|
+
cancel: (cancelMessage) => canceler(`${_helpers_retry_helper__WEBPACK_IMPORTED_MODULE_3__.retryHelper.requestCancelledMessagePrefix}: ${cancelMessage !== null && cancelMessage !== void 0 ? cancelMessage : 'User cancel'}`),
|
|
746
627
|
token: token
|
|
747
628
|
};
|
|
748
629
|
}
|
|
749
630
|
function runWithRetryAsync(data) {
|
|
750
|
-
return
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
console.warn("Retry attempt '".concat(data.retryAttempt + 1, "' from a maximum of '").concat(retryResult_1.maxRetries, "' retries. Request url: '").concat(data.url, "'"));
|
|
774
|
-
return [4 /*yield*/, runWithRetryAsync({
|
|
775
|
-
call: data.call,
|
|
776
|
-
retryStrategy: data.retryStrategy,
|
|
777
|
-
retryAttempt: data.retryAttempt + 1,
|
|
778
|
-
url: data.url,
|
|
779
|
-
functionsConfig: data.functionsConfig
|
|
780
|
-
})];
|
|
781
|
-
case 4: return [2 /*return*/, _a.sent()];
|
|
782
|
-
case 5:
|
|
783
|
-
if (data.functionsConfig.logErrorsToConsole) {
|
|
784
|
-
console.error("Executing '".concat(data.url, "' failed. Request was retried '").concat(data.retryAttempt, "' times. "), error_1);
|
|
785
|
-
}
|
|
786
|
-
throw error_1;
|
|
787
|
-
case 6: return [2 /*return*/];
|
|
631
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
632
|
+
try {
|
|
633
|
+
return yield data.call(data.retryAttempt);
|
|
634
|
+
}
|
|
635
|
+
catch (error) {
|
|
636
|
+
const retryResult = _helpers_retry_helper__WEBPACK_IMPORTED_MODULE_3__.retryHelper.getRetryErrorResult({
|
|
637
|
+
error: error,
|
|
638
|
+
retryAttempt: data.retryAttempt,
|
|
639
|
+
retryStrategy: data.retryStrategy
|
|
640
|
+
});
|
|
641
|
+
if (retryResult.canRetry) {
|
|
642
|
+
_http_debugger__WEBPACK_IMPORTED_MODULE_2__.httpDebugger.debugRetryHttpRequest();
|
|
643
|
+
// wait time before retrying
|
|
644
|
+
yield new Promise((resolve) => setTimeout(resolve, retryResult.retryInMs));
|
|
645
|
+
// retry request
|
|
646
|
+
console.warn(`Retry attempt '${data.retryAttempt + 1}' from a maximum of '${retryResult.maxRetries}' retries. Request url: '${data.url}'`);
|
|
647
|
+
return yield runWithRetryAsync({
|
|
648
|
+
call: data.call,
|
|
649
|
+
retryStrategy: data.retryStrategy,
|
|
650
|
+
retryAttempt: data.retryAttempt + 1,
|
|
651
|
+
url: data.url,
|
|
652
|
+
functionsConfig: data.functionsConfig
|
|
653
|
+
});
|
|
788
654
|
}
|
|
789
|
-
|
|
655
|
+
if (data.functionsConfig.logErrorsToConsole) {
|
|
656
|
+
console.error(`Executing '${data.url}' failed. Request was retried '${data.retryAttempt}' times. `, error);
|
|
657
|
+
}
|
|
658
|
+
throw error;
|
|
659
|
+
}
|
|
790
660
|
});
|
|
791
661
|
}
|
|
792
662
|
function getHeadersJson(headers, addContentTypeHeader) {
|
|
793
|
-
|
|
794
|
-
headers.forEach(
|
|
663
|
+
const headerJson = {};
|
|
664
|
+
headers.forEach((header) => {
|
|
795
665
|
headerJson[header.header] = header.value;
|
|
796
666
|
});
|
|
797
667
|
if (addContentTypeHeader) {
|
|
798
668
|
// add default content type header if not present
|
|
799
|
-
|
|
669
|
+
const contentTypeHeader = headers.find((m) => m.header.toLowerCase() === 'Content-Type'.toLowerCase());
|
|
800
670
|
if (!contentTypeHeader) {
|
|
801
671
|
headerJson['Content-Type'] = 'application/json';
|
|
802
672
|
}
|
|
@@ -807,9 +677,9 @@ function getHeadersJson(headers, addContentTypeHeader) {
|
|
|
807
677
|
|
|
808
678
|
/***/ }),
|
|
809
679
|
|
|
810
|
-
/***/ "./node_modules/@kontent-ai/core-sdk/dist/
|
|
680
|
+
/***/ "./node_modules/@kontent-ai/core-sdk/dist/es6/http/http.models.js":
|
|
811
681
|
/*!************************************************************************!*\
|
|
812
|
-
!*** ./node_modules/@kontent-ai/core-sdk/dist/
|
|
682
|
+
!*** ./node_modules/@kontent-ai/core-sdk/dist/es6/http/http.models.js ***!
|
|
813
683
|
\************************************************************************/
|
|
814
684
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
815
685
|
|
|
@@ -820,9 +690,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
820
690
|
|
|
821
691
|
/***/ }),
|
|
822
692
|
|
|
823
|
-
/***/ "./node_modules/@kontent-ai/core-sdk/dist/
|
|
693
|
+
/***/ "./node_modules/@kontent-ai/core-sdk/dist/es6/http/http.service.js":
|
|
824
694
|
/*!*************************************************************************!*\
|
|
825
|
-
!*** ./node_modules/@kontent-ai/core-sdk/dist/
|
|
695
|
+
!*** ./node_modules/@kontent-ai/core-sdk/dist/es6/http/http.service.js ***!
|
|
826
696
|
\*************************************************************************/
|
|
827
697
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
828
698
|
|
|
@@ -831,88 +701,68 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
831
701
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
832
702
|
/* harmony export */ "HttpService": () => (/* binding */ HttpService)
|
|
833
703
|
/* harmony export */ });
|
|
834
|
-
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
|
|
835
704
|
/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! axios */ "./node_modules/axios/index.js");
|
|
836
705
|
/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_0__);
|
|
837
|
-
/* harmony import */ var _http_functions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./http.functions */ "./node_modules/@kontent-ai/core-sdk/dist/
|
|
838
|
-
|
|
706
|
+
/* harmony import */ var _http_functions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./http.functions */ "./node_modules/@kontent-ai/core-sdk/dist/es6/http/http.functions.js");
|
|
707
|
+
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
708
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
709
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
710
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
711
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
712
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
713
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
714
|
+
});
|
|
715
|
+
};
|
|
839
716
|
|
|
840
717
|
|
|
841
|
-
|
|
842
|
-
|
|
718
|
+
class HttpService {
|
|
719
|
+
constructor(opts) {
|
|
843
720
|
this.opts = opts;
|
|
844
721
|
this.axiosInstance = axios__WEBPACK_IMPORTED_MODULE_0___default().create(opts === null || opts === void 0 ? void 0 : opts.axiosRequestConfig);
|
|
845
722
|
this.functionsConfig = this.getFunctionsConfig();
|
|
846
723
|
}
|
|
847
|
-
|
|
848
|
-
return
|
|
849
|
-
return
|
|
850
|
-
switch (_a.label) {
|
|
851
|
-
case 0: return [4 /*yield*/, _http_functions__WEBPACK_IMPORTED_MODULE_1__.getWithRetryAsync(this.axiosInstance, call, this.functionsConfig, options)];
|
|
852
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
853
|
-
}
|
|
854
|
-
});
|
|
724
|
+
getAsync(call, options) {
|
|
725
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
726
|
+
return yield _http_functions__WEBPACK_IMPORTED_MODULE_1__.getWithRetryAsync(this.axiosInstance, call, this.functionsConfig, options);
|
|
855
727
|
});
|
|
856
|
-
}
|
|
857
|
-
|
|
858
|
-
return
|
|
859
|
-
return
|
|
860
|
-
switch (_a.label) {
|
|
861
|
-
case 0: return [4 /*yield*/, _http_functions__WEBPACK_IMPORTED_MODULE_1__.postWithRetryAsync(this.axiosInstance, call, this.functionsConfig, options)];
|
|
862
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
863
|
-
}
|
|
864
|
-
});
|
|
728
|
+
}
|
|
729
|
+
postAsync(call, options) {
|
|
730
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
731
|
+
return yield _http_functions__WEBPACK_IMPORTED_MODULE_1__.postWithRetryAsync(this.axiosInstance, call, this.functionsConfig, options);
|
|
865
732
|
});
|
|
866
|
-
}
|
|
867
|
-
|
|
868
|
-
return
|
|
869
|
-
return
|
|
870
|
-
switch (_a.label) {
|
|
871
|
-
case 0: return [4 /*yield*/, _http_functions__WEBPACK_IMPORTED_MODULE_1__.putWithRetryAsync(this.axiosInstance, call, this.functionsConfig, options)];
|
|
872
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
873
|
-
}
|
|
874
|
-
});
|
|
733
|
+
}
|
|
734
|
+
putAsync(call, options) {
|
|
735
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
736
|
+
return yield _http_functions__WEBPACK_IMPORTED_MODULE_1__.putWithRetryAsync(this.axiosInstance, call, this.functionsConfig, options);
|
|
875
737
|
});
|
|
876
|
-
}
|
|
877
|
-
|
|
878
|
-
return
|
|
879
|
-
return
|
|
880
|
-
switch (_a.label) {
|
|
881
|
-
case 0: return [4 /*yield*/, _http_functions__WEBPACK_IMPORTED_MODULE_1__.patchWithRetryAsync(this.axiosInstance, call, this.functionsConfig, options)];
|
|
882
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
883
|
-
}
|
|
884
|
-
});
|
|
738
|
+
}
|
|
739
|
+
patchAsync(call, options) {
|
|
740
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
741
|
+
return yield _http_functions__WEBPACK_IMPORTED_MODULE_1__.patchWithRetryAsync(this.axiosInstance, call, this.functionsConfig, options);
|
|
885
742
|
});
|
|
886
|
-
}
|
|
887
|
-
|
|
888
|
-
return
|
|
889
|
-
return
|
|
890
|
-
switch (_a.label) {
|
|
891
|
-
case 0: return [4 /*yield*/, _http_functions__WEBPACK_IMPORTED_MODULE_1__.deleteWithRetryAsync(this.axiosInstance, call, this.functionsConfig, options)];
|
|
892
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
893
|
-
}
|
|
894
|
-
});
|
|
743
|
+
}
|
|
744
|
+
deleteAsync(call, options) {
|
|
745
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
746
|
+
return yield _http_functions__WEBPACK_IMPORTED_MODULE_1__.deleteWithRetryAsync(this.axiosInstance, call, this.functionsConfig, options);
|
|
895
747
|
});
|
|
896
|
-
}
|
|
897
|
-
|
|
748
|
+
}
|
|
749
|
+
createCancelToken() {
|
|
898
750
|
return _http_functions__WEBPACK_IMPORTED_MODULE_1__.createCancelToken();
|
|
899
|
-
}
|
|
900
|
-
|
|
751
|
+
}
|
|
752
|
+
getFunctionsConfig() {
|
|
901
753
|
var _a, _b;
|
|
902
754
|
return {
|
|
903
755
|
logErrorsToConsole: (_b = (_a = this.opts) === null || _a === void 0 ? void 0 : _a.logErrorsToConsole) !== null && _b !== void 0 ? _b : true
|
|
904
756
|
};
|
|
905
|
-
}
|
|
906
|
-
|
|
907
|
-
}());
|
|
908
|
-
|
|
757
|
+
}
|
|
758
|
+
}
|
|
909
759
|
//# sourceMappingURL=http.service.js.map
|
|
910
760
|
|
|
911
761
|
/***/ }),
|
|
912
762
|
|
|
913
|
-
/***/ "./node_modules/@kontent-ai/core-sdk/dist/
|
|
763
|
+
/***/ "./node_modules/@kontent-ai/core-sdk/dist/es6/http/ihttp.service.js":
|
|
914
764
|
/*!**************************************************************************!*\
|
|
915
|
-
!*** ./node_modules/@kontent-ai/core-sdk/dist/
|
|
765
|
+
!*** ./node_modules/@kontent-ai/core-sdk/dist/es6/http/ihttp.service.js ***!
|
|
916
766
|
\**************************************************************************/
|
|
917
767
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
918
768
|
|
|
@@ -923,9 +773,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
923
773
|
|
|
924
774
|
/***/ }),
|
|
925
775
|
|
|
926
|
-
/***/ "./node_modules/@kontent-ai/core-sdk/dist/
|
|
776
|
+
/***/ "./node_modules/@kontent-ai/core-sdk/dist/es6/http/index.js":
|
|
927
777
|
/*!******************************************************************!*\
|
|
928
|
-
!*** ./node_modules/@kontent-ai/core-sdk/dist/
|
|
778
|
+
!*** ./node_modules/@kontent-ai/core-sdk/dist/es6/http/index.js ***!
|
|
929
779
|
\******************************************************************/
|
|
930
780
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
931
781
|
|
|
@@ -943,12 +793,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
943
793
|
/* harmony export */ "postWithRetryAsync": () => (/* reexport safe */ _http_functions__WEBPACK_IMPORTED_MODULE_3__.postWithRetryAsync),
|
|
944
794
|
/* harmony export */ "putWithRetryAsync": () => (/* reexport safe */ _http_functions__WEBPACK_IMPORTED_MODULE_3__.putWithRetryAsync)
|
|
945
795
|
/* harmony export */ });
|
|
946
|
-
/* harmony import */ var _ihttp_service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ihttp.service */ "./node_modules/@kontent-ai/core-sdk/dist/
|
|
947
|
-
/* harmony import */ var _http_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./http.service */ "./node_modules/@kontent-ai/core-sdk/dist/
|
|
948
|
-
/* harmony import */ var _http_models__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./http.models */ "./node_modules/@kontent-ai/core-sdk/dist/
|
|
949
|
-
/* harmony import */ var _http_functions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./http.functions */ "./node_modules/@kontent-ai/core-sdk/dist/
|
|
950
|
-
/* harmony import */ var _http_debugger__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./http.debugger */ "./node_modules/@kontent-ai/core-sdk/dist/
|
|
951
|
-
/* harmony import */ var _test_http_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./test-http.service */ "./node_modules/@kontent-ai/core-sdk/dist/
|
|
796
|
+
/* harmony import */ var _ihttp_service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ihttp.service */ "./node_modules/@kontent-ai/core-sdk/dist/es6/http/ihttp.service.js");
|
|
797
|
+
/* harmony import */ var _http_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./http.service */ "./node_modules/@kontent-ai/core-sdk/dist/es6/http/http.service.js");
|
|
798
|
+
/* harmony import */ var _http_models__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./http.models */ "./node_modules/@kontent-ai/core-sdk/dist/es6/http/http.models.js");
|
|
799
|
+
/* harmony import */ var _http_functions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./http.functions */ "./node_modules/@kontent-ai/core-sdk/dist/es6/http/http.functions.js");
|
|
800
|
+
/* harmony import */ var _http_debugger__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./http.debugger */ "./node_modules/@kontent-ai/core-sdk/dist/es6/http/http.debugger.js");
|
|
801
|
+
/* harmony import */ var _test_http_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./test-http.service */ "./node_modules/@kontent-ai/core-sdk/dist/es6/http/test-http.service.js");
|
|
952
802
|
|
|
953
803
|
|
|
954
804
|
|
|
@@ -959,9 +809,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
959
809
|
|
|
960
810
|
/***/ }),
|
|
961
811
|
|
|
962
|
-
/***/ "./node_modules/@kontent-ai/core-sdk/dist/
|
|
812
|
+
/***/ "./node_modules/@kontent-ai/core-sdk/dist/es6/http/test-http.service.js":
|
|
963
813
|
/*!******************************************************************************!*\
|
|
964
|
-
!*** ./node_modules/@kontent-ai/core-sdk/dist/
|
|
814
|
+
!*** ./node_modules/@kontent-ai/core-sdk/dist/es6/http/test-http.service.js ***!
|
|
965
815
|
\******************************************************************************/
|
|
966
816
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
967
817
|
|
|
@@ -970,56 +820,53 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
970
820
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
971
821
|
/* harmony export */ "TestHttpService": () => (/* binding */ TestHttpService)
|
|
972
822
|
/* harmony export */ });
|
|
973
|
-
|
|
974
|
-
|
|
823
|
+
class TestHttpService {
|
|
824
|
+
constructor(config) {
|
|
975
825
|
this.response = undefined;
|
|
976
826
|
this.error = undefined;
|
|
977
827
|
Object.assign(this, config);
|
|
978
828
|
}
|
|
979
|
-
|
|
829
|
+
getAsync(call, options) {
|
|
980
830
|
return this.resolveTestCall();
|
|
981
|
-
}
|
|
982
|
-
|
|
831
|
+
}
|
|
832
|
+
postAsync(call, options) {
|
|
983
833
|
return this.resolveTestCall();
|
|
984
|
-
}
|
|
985
|
-
|
|
834
|
+
}
|
|
835
|
+
putAsync(call, options) {
|
|
986
836
|
return this.resolveTestCall();
|
|
987
|
-
}
|
|
988
|
-
|
|
837
|
+
}
|
|
838
|
+
patchAsync(call, options) {
|
|
989
839
|
return this.resolveTestCall();
|
|
990
|
-
}
|
|
991
|
-
|
|
840
|
+
}
|
|
841
|
+
deleteAsync(call, options) {
|
|
992
842
|
return this.resolveTestCall();
|
|
993
|
-
}
|
|
994
|
-
|
|
843
|
+
}
|
|
844
|
+
createCancelToken() {
|
|
995
845
|
return {
|
|
996
|
-
cancel:
|
|
846
|
+
cancel: () => { },
|
|
997
847
|
token: undefined
|
|
998
848
|
};
|
|
999
|
-
}
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
resolve(_this.response);
|
|
849
|
+
}
|
|
850
|
+
resolveTestCall() {
|
|
851
|
+
const promise = new Promise((resolve, reject) => {
|
|
852
|
+
if (this.response) {
|
|
853
|
+
resolve(this.response);
|
|
1005
854
|
}
|
|
1006
|
-
if (
|
|
1007
|
-
reject(
|
|
855
|
+
if (this.error) {
|
|
856
|
+
reject(this.error);
|
|
1008
857
|
}
|
|
1009
|
-
throw Error(
|
|
858
|
+
throw Error(`Missing test data`);
|
|
1010
859
|
});
|
|
1011
860
|
return promise;
|
|
1012
|
-
}
|
|
1013
|
-
|
|
1014
|
-
}());
|
|
1015
|
-
|
|
861
|
+
}
|
|
862
|
+
}
|
|
1016
863
|
//# sourceMappingURL=test-http.service.js.map
|
|
1017
864
|
|
|
1018
865
|
/***/ }),
|
|
1019
866
|
|
|
1020
|
-
/***/ "./node_modules/@kontent-ai/core-sdk/dist/
|
|
867
|
+
/***/ "./node_modules/@kontent-ai/core-sdk/dist/es6/index.js":
|
|
1021
868
|
/*!*************************************************************!*\
|
|
1022
|
-
!*** ./node_modules/@kontent-ai/core-sdk/dist/
|
|
869
|
+
!*** ./node_modules/@kontent-ai/core-sdk/dist/es6/index.js ***!
|
|
1023
870
|
\*************************************************************/
|
|
1024
871
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1025
872
|
|
|
@@ -1047,9 +894,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1047
894
|
/* harmony export */ "retryHelper": () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_0__.retryHelper),
|
|
1048
895
|
/* harmony export */ "urlHelper": () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_0__.urlHelper)
|
|
1049
896
|
/* harmony export */ });
|
|
1050
|
-
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers */ "./node_modules/@kontent-ai/core-sdk/dist/
|
|
1051
|
-
/* harmony import */ var _models__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./models */ "./node_modules/@kontent-ai/core-sdk/dist/
|
|
1052
|
-
/* harmony import */ var _http__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./http */ "./node_modules/@kontent-ai/core-sdk/dist/
|
|
897
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers */ "./node_modules/@kontent-ai/core-sdk/dist/es6/helpers/index.js");
|
|
898
|
+
/* harmony import */ var _models__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./models */ "./node_modules/@kontent-ai/core-sdk/dist/es6/models/index.js");
|
|
899
|
+
/* harmony import */ var _http__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./http */ "./node_modules/@kontent-ai/core-sdk/dist/es6/http/index.js");
|
|
1053
900
|
/* Public API */
|
|
1054
901
|
|
|
1055
902
|
|
|
@@ -1058,9 +905,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1058
905
|
|
|
1059
906
|
/***/ }),
|
|
1060
907
|
|
|
1061
|
-
/***/ "./node_modules/@kontent-ai/core-sdk/dist/
|
|
908
|
+
/***/ "./node_modules/@kontent-ai/core-sdk/dist/es6/models/index.js":
|
|
1062
909
|
/*!********************************************************************!*\
|
|
1063
|
-
!*** ./node_modules/@kontent-ai/core-sdk/dist/
|
|
910
|
+
!*** ./node_modules/@kontent-ai/core-sdk/dist/es6/models/index.js ***!
|
|
1064
911
|
\********************************************************************/
|
|
1065
912
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1066
913
|
|
|
@@ -1069,9 +916,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1069
916
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1070
917
|
/* harmony export */ "Parameters": () => (/* reexport safe */ _parameters__WEBPACK_IMPORTED_MODULE_2__.Parameters)
|
|
1071
918
|
/* harmony export */ });
|
|
1072
|
-
/* harmony import */ var _url_models__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./url.models */ "./node_modules/@kontent-ai/core-sdk/dist/
|
|
1073
|
-
/* harmony import */ var _isdk_info__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isdk-info */ "./node_modules/@kontent-ai/core-sdk/dist/
|
|
1074
|
-
/* harmony import */ var _parameters__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./parameters */ "./node_modules/@kontent-ai/core-sdk/dist/
|
|
919
|
+
/* harmony import */ var _url_models__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./url.models */ "./node_modules/@kontent-ai/core-sdk/dist/es6/models/url.models.js");
|
|
920
|
+
/* harmony import */ var _isdk_info__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isdk-info */ "./node_modules/@kontent-ai/core-sdk/dist/es6/models/isdk-info.js");
|
|
921
|
+
/* harmony import */ var _parameters__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./parameters */ "./node_modules/@kontent-ai/core-sdk/dist/es6/models/parameters.js");
|
|
1075
922
|
|
|
1076
923
|
|
|
1077
924
|
|
|
@@ -1079,9 +926,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1079
926
|
|
|
1080
927
|
/***/ }),
|
|
1081
928
|
|
|
1082
|
-
/***/ "./node_modules/@kontent-ai/core-sdk/dist/
|
|
929
|
+
/***/ "./node_modules/@kontent-ai/core-sdk/dist/es6/models/isdk-info.js":
|
|
1083
930
|
/*!************************************************************************!*\
|
|
1084
|
-
!*** ./node_modules/@kontent-ai/core-sdk/dist/
|
|
931
|
+
!*** ./node_modules/@kontent-ai/core-sdk/dist/es6/models/isdk-info.js ***!
|
|
1085
932
|
\************************************************************************/
|
|
1086
933
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1087
934
|
|
|
@@ -1092,9 +939,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1092
939
|
|
|
1093
940
|
/***/ }),
|
|
1094
941
|
|
|
1095
|
-
/***/ "./node_modules/@kontent-ai/core-sdk/dist/
|
|
942
|
+
/***/ "./node_modules/@kontent-ai/core-sdk/dist/es6/models/parameters.js":
|
|
1096
943
|
/*!*************************************************************************!*\
|
|
1097
|
-
!*** ./node_modules/@kontent-ai/core-sdk/dist/
|
|
944
|
+
!*** ./node_modules/@kontent-ai/core-sdk/dist/es6/models/parameters.js ***!
|
|
1098
945
|
\*************************************************************************/
|
|
1099
946
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1100
947
|
|
|
@@ -1105,37 +952,36 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1105
952
|
/* harmony export */ });
|
|
1106
953
|
var Parameters;
|
|
1107
954
|
(function (Parameters) {
|
|
1108
|
-
|
|
955
|
+
class CustomParameter {
|
|
1109
956
|
/**
|
|
1110
957
|
* Custom parameter
|
|
1111
958
|
* @constructor
|
|
1112
959
|
* @param {string} name - Name of the parameter
|
|
1113
960
|
* @param {string} value - Value of the parameter
|
|
1114
961
|
*/
|
|
1115
|
-
|
|
962
|
+
constructor(name, value) {
|
|
1116
963
|
this.name = name;
|
|
1117
964
|
this.value = value;
|
|
1118
965
|
if (!name) {
|
|
1119
|
-
throw Error(
|
|
966
|
+
throw Error(`Name of the custom parameter is not specified`);
|
|
1120
967
|
}
|
|
1121
968
|
}
|
|
1122
|
-
|
|
969
|
+
getParam() {
|
|
1123
970
|
return this.name;
|
|
1124
|
-
}
|
|
1125
|
-
|
|
971
|
+
}
|
|
972
|
+
getParamValue() {
|
|
1126
973
|
return this.value;
|
|
1127
|
-
}
|
|
1128
|
-
|
|
1129
|
-
}());
|
|
974
|
+
}
|
|
975
|
+
}
|
|
1130
976
|
Parameters.CustomParameter = CustomParameter;
|
|
1131
977
|
})(Parameters || (Parameters = {}));
|
|
1132
978
|
//# sourceMappingURL=parameters.js.map
|
|
1133
979
|
|
|
1134
980
|
/***/ }),
|
|
1135
981
|
|
|
1136
|
-
/***/ "./node_modules/@kontent-ai/core-sdk/dist/
|
|
982
|
+
/***/ "./node_modules/@kontent-ai/core-sdk/dist/es6/models/url.models.js":
|
|
1137
983
|
/*!*************************************************************************!*\
|
|
1138
|
-
!*** ./node_modules/@kontent-ai/core-sdk/dist/
|
|
984
|
+
!*** ./node_modules/@kontent-ai/core-sdk/dist/es6/models/url.models.js ***!
|
|
1139
985
|
\*************************************************************************/
|
|
1140
986
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1141
987
|
|
|
@@ -3814,7 +3660,7 @@ exports.createDeliveryClient = createDeliveryClient;
|
|
|
3814
3660
|
|
|
3815
3661
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3816
3662
|
exports.DeliveryClient = void 0;
|
|
3817
|
-
const core_sdk_1 = __webpack_require__(/*! @kontent-ai/core-sdk */ "./node_modules/@kontent-ai/core-sdk/dist/
|
|
3663
|
+
const core_sdk_1 = __webpack_require__(/*! @kontent-ai/core-sdk */ "./node_modules/@kontent-ai/core-sdk/dist/es6/index.js");
|
|
3818
3664
|
const query_1 = __webpack_require__(/*! ../query */ "./lib/query/index.ts");
|
|
3819
3665
|
const sdk_info_generated_1 = __webpack_require__(/*! ../sdk-info.generated */ "./lib/sdk-info.generated.ts");
|
|
3820
3666
|
const services_1 = __webpack_require__(/*! ../services */ "./lib/services/index.ts");
|
|
@@ -3895,6 +3741,18 @@ class DeliveryClient {
|
|
|
3895
3741
|
element(typeCodename, elementCodename) {
|
|
3896
3742
|
return new query_1.ElementQuery(this.config, this.queryService, typeCodename, elementCodename);
|
|
3897
3743
|
}
|
|
3744
|
+
/**
|
|
3745
|
+
* Gets query for initializing sync
|
|
3746
|
+
*/
|
|
3747
|
+
initializeSync() {
|
|
3748
|
+
return new query_1.InitializeSyncQuery(this.config, this.queryService);
|
|
3749
|
+
}
|
|
3750
|
+
/**
|
|
3751
|
+
* Gets query fetching delta updates of content items
|
|
3752
|
+
*/
|
|
3753
|
+
syncChanges() {
|
|
3754
|
+
return new query_1.SyncChangesQuery(this.config, this.queryService);
|
|
3755
|
+
}
|
|
3898
3756
|
}
|
|
3899
3757
|
exports.DeliveryClient = DeliveryClient;
|
|
3900
3758
|
|
|
@@ -4394,7 +4252,7 @@ __exportStar(__webpack_require__(/*! ./utilities */ "./lib/utilities/index.ts"),
|
|
|
4394
4252
|
|
|
4395
4253
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4396
4254
|
exports.ElementMapper = void 0;
|
|
4397
|
-
const core_sdk_1 = __webpack_require__(/*! @kontent-ai/core-sdk */ "./node_modules/@kontent-ai/core-sdk/dist/
|
|
4255
|
+
const core_sdk_1 = __webpack_require__(/*! @kontent-ai/core-sdk */ "./node_modules/@kontent-ai/core-sdk/dist/es6/index.js");
|
|
4398
4256
|
const utilities_1 = __webpack_require__(/*! ../utilities */ "./lib/utilities/index.ts");
|
|
4399
4257
|
const elements_1 = __webpack_require__(/*! ../elements */ "./lib/elements/index.ts");
|
|
4400
4258
|
class ElementMapper {
|
|
@@ -4764,12 +4622,13 @@ class GenericElementMapper {
|
|
|
4764
4622
|
if (!response) {
|
|
4765
4623
|
throw Error(`Invalid response for mapping element`);
|
|
4766
4624
|
}
|
|
4625
|
+
const element = response.element;
|
|
4767
4626
|
return {
|
|
4768
|
-
codename:
|
|
4769
|
-
name:
|
|
4770
|
-
type:
|
|
4771
|
-
options:
|
|
4772
|
-
taxonomyGroup:
|
|
4627
|
+
codename: element.codename,
|
|
4628
|
+
name: element.name,
|
|
4629
|
+
type: element.type,
|
|
4630
|
+
options: element.options ? element.options : [],
|
|
4631
|
+
taxonomyGroup: element.taxonomy_group
|
|
4773
4632
|
};
|
|
4774
4633
|
}
|
|
4775
4634
|
}
|
|
@@ -4807,6 +4666,7 @@ __exportStar(__webpack_require__(/*! ./taxonomy.mapper */ "./lib/mappers/taxonom
|
|
|
4807
4666
|
__exportStar(__webpack_require__(/*! ./type.mapper */ "./lib/mappers/type.mapper.ts"), exports);
|
|
4808
4667
|
__exportStar(__webpack_require__(/*! ./generic-element.mapper */ "./lib/mappers/generic-element.mapper.ts"), exports);
|
|
4809
4668
|
__exportStar(__webpack_require__(/*! ./language.mapper */ "./lib/mappers/language.mapper.ts"), exports);
|
|
4669
|
+
__exportStar(__webpack_require__(/*! ./sync.mapper */ "./lib/mappers/sync.mapper.ts"), exports);
|
|
4810
4670
|
|
|
4811
4671
|
|
|
4812
4672
|
/***/ }),
|
|
@@ -4971,6 +4831,34 @@ class LanguageMapper {
|
|
|
4971
4831
|
exports.LanguageMapper = LanguageMapper;
|
|
4972
4832
|
|
|
4973
4833
|
|
|
4834
|
+
/***/ }),
|
|
4835
|
+
|
|
4836
|
+
/***/ "./lib/mappers/sync.mapper.ts":
|
|
4837
|
+
/*!************************************!*\
|
|
4838
|
+
!*** ./lib/mappers/sync.mapper.ts ***!
|
|
4839
|
+
\************************************/
|
|
4840
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
4841
|
+
|
|
4842
|
+
"use strict";
|
|
4843
|
+
|
|
4844
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4845
|
+
exports.SyncMapper = void 0;
|
|
4846
|
+
class SyncMapper {
|
|
4847
|
+
mapContentItemDelta(itemDeltaContract) {
|
|
4848
|
+
return {
|
|
4849
|
+
changeType: itemDeltaContract.change_type,
|
|
4850
|
+
codename: itemDeltaContract.codename,
|
|
4851
|
+
collection: itemDeltaContract.collection,
|
|
4852
|
+
id: itemDeltaContract.id,
|
|
4853
|
+
language: itemDeltaContract.language,
|
|
4854
|
+
timestamp: itemDeltaContract.timestamp,
|
|
4855
|
+
type: itemDeltaContract.type
|
|
4856
|
+
};
|
|
4857
|
+
}
|
|
4858
|
+
}
|
|
4859
|
+
exports.SyncMapper = SyncMapper;
|
|
4860
|
+
|
|
4861
|
+
|
|
4974
4862
|
/***/ }),
|
|
4975
4863
|
|
|
4976
4864
|
/***/ "./lib/mappers/taxonomy.mapper.ts":
|
|
@@ -5757,6 +5645,7 @@ __exportStar(__webpack_require__(/*! ./taxonomy-models */ "./lib/models/taxonomy
|
|
|
5757
5645
|
__exportStar(__webpack_require__(/*! ./content-type-models */ "./lib/models/content-type-models.ts"), exports);
|
|
5758
5646
|
__exportStar(__webpack_require__(/*! ./language-models */ "./lib/models/language-models.ts"), exports);
|
|
5759
5647
|
__exportStar(__webpack_require__(/*! ./responses */ "./lib/models/responses.ts"), exports);
|
|
5648
|
+
__exportStar(__webpack_require__(/*! ./sync-models */ "./lib/models/sync-models.ts"), exports);
|
|
5760
5649
|
|
|
5761
5650
|
|
|
5762
5651
|
/***/ }),
|
|
@@ -5798,6 +5687,19 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
5798
5687
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5799
5688
|
|
|
5800
5689
|
|
|
5690
|
+
/***/ }),
|
|
5691
|
+
|
|
5692
|
+
/***/ "./lib/models/sync-models.ts":
|
|
5693
|
+
/*!***********************************!*\
|
|
5694
|
+
!*** ./lib/models/sync-models.ts ***!
|
|
5695
|
+
\***********************************/
|
|
5696
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
5697
|
+
|
|
5698
|
+
"use strict";
|
|
5699
|
+
|
|
5700
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5701
|
+
|
|
5702
|
+
|
|
5801
5703
|
/***/ }),
|
|
5802
5704
|
|
|
5803
5705
|
/***/ "./lib/models/taxonomy-models.ts":
|
|
@@ -6294,19 +6196,19 @@ exports.parserHelper = new ParserHelper();
|
|
|
6294
6196
|
|
|
6295
6197
|
/***/ }),
|
|
6296
6198
|
|
|
6297
|
-
/***/ "./lib/query/common/base-listing-query.class.ts":
|
|
6298
|
-
|
|
6299
|
-
!*** ./lib/query/common/base-listing-query.class.ts ***!
|
|
6300
|
-
|
|
6199
|
+
/***/ "./lib/query/common/base-item-listing-query.class.ts":
|
|
6200
|
+
/*!***********************************************************!*\
|
|
6201
|
+
!*** ./lib/query/common/base-item-listing-query.class.ts ***!
|
|
6202
|
+
\***********************************************************/
|
|
6301
6203
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
6302
6204
|
|
|
6303
6205
|
"use strict";
|
|
6304
6206
|
|
|
6305
6207
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6306
|
-
exports.
|
|
6208
|
+
exports.BaseItemListingQuery = void 0;
|
|
6307
6209
|
const models_1 = __webpack_require__(/*! ../../models */ "./lib/models/index.ts");
|
|
6308
|
-
const
|
|
6309
|
-
class
|
|
6210
|
+
const base_listing_query_class_1 = __webpack_require__(/*! ./base-listing-query.class */ "./lib/query/common/base-listing-query.class.ts");
|
|
6211
|
+
class BaseItemListingQuery extends base_listing_query_class_1.BaseListingQuery {
|
|
6310
6212
|
constructor(config, queryService) {
|
|
6311
6213
|
super(config, queryService);
|
|
6312
6214
|
this.config = config;
|
|
@@ -6476,6 +6378,30 @@ class BaseListingQuery extends base_query_class_1.BaseQuery {
|
|
|
6476
6378
|
this.parameters.push(new models_1.Parameters.SkipParameter(skip));
|
|
6477
6379
|
return this;
|
|
6478
6380
|
}
|
|
6381
|
+
}
|
|
6382
|
+
exports.BaseItemListingQuery = BaseItemListingQuery;
|
|
6383
|
+
|
|
6384
|
+
|
|
6385
|
+
/***/ }),
|
|
6386
|
+
|
|
6387
|
+
/***/ "./lib/query/common/base-listing-query.class.ts":
|
|
6388
|
+
/*!******************************************************!*\
|
|
6389
|
+
!*** ./lib/query/common/base-listing-query.class.ts ***!
|
|
6390
|
+
\******************************************************/
|
|
6391
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
6392
|
+
|
|
6393
|
+
"use strict";
|
|
6394
|
+
|
|
6395
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6396
|
+
exports.BaseListingQuery = void 0;
|
|
6397
|
+
const models_1 = __webpack_require__(/*! ../../models */ "./lib/models/index.ts");
|
|
6398
|
+
const base_query_class_1 = __webpack_require__(/*! ./base-query.class */ "./lib/query/common/base-query.class.ts");
|
|
6399
|
+
class BaseListingQuery extends base_query_class_1.BaseQuery {
|
|
6400
|
+
constructor(config, queryService) {
|
|
6401
|
+
super(config, queryService);
|
|
6402
|
+
this.config = config;
|
|
6403
|
+
this.queryService = queryService;
|
|
6404
|
+
}
|
|
6479
6405
|
/**
|
|
6480
6406
|
* Sets continuation token header
|
|
6481
6407
|
*/
|
|
@@ -6483,7 +6409,7 @@ class BaseListingQuery extends base_query_class_1.BaseQuery {
|
|
|
6483
6409
|
var _a;
|
|
6484
6410
|
// remove previous continuation token if there is any
|
|
6485
6411
|
let queryHeaders = (_a = this._queryConfig.customHeaders) !== null && _a !== void 0 ? _a : [];
|
|
6486
|
-
queryHeaders = queryHeaders.filter(m => m.header !== models_1.continuationTokenHeaderName);
|
|
6412
|
+
queryHeaders = queryHeaders.filter((m) => m.header !== models_1.continuationTokenHeaderName);
|
|
6487
6413
|
this._queryConfig.customHeaders = queryHeaders;
|
|
6488
6414
|
this.withHeaders([
|
|
6489
6415
|
{
|
|
@@ -6671,8 +6597,7 @@ class ElementQuery extends base_query_class_1.BaseQuery {
|
|
|
6671
6597
|
return this.queryService.getElementAsync(this.getUrl(), (_a = this._queryConfig) !== null && _a !== void 0 ? _a : {});
|
|
6672
6598
|
}
|
|
6673
6599
|
getUrl() {
|
|
6674
|
-
|
|
6675
|
-
return super.resolveUrlInternal(action);
|
|
6600
|
+
return super.resolveUrlInternal(`/types/${this.typeCodename}/elements/${this.elementCodename}`);
|
|
6676
6601
|
}
|
|
6677
6602
|
map(json) {
|
|
6678
6603
|
return this.queryService.mappingService.viewContentTypeElementResponse(json);
|
|
@@ -6716,6 +6641,8 @@ __exportStar(__webpack_require__(/*! ./type/multiple-type-query.class */ "./lib/
|
|
|
6716
6641
|
__exportStar(__webpack_require__(/*! ./type/single-type-query.class */ "./lib/query/type/single-type-query.class.ts"), exports);
|
|
6717
6642
|
__exportStar(__webpack_require__(/*! ./items-feed/items-feed-query.class */ "./lib/query/items-feed/items-feed-query.class.ts"), exports);
|
|
6718
6643
|
__exportStar(__webpack_require__(/*! ./language/languages-query.class */ "./lib/query/language/languages-query.class.ts"), exports);
|
|
6644
|
+
__exportStar(__webpack_require__(/*! ./sync/initialize-sync-query.class */ "./lib/query/sync/initialize-sync-query.class.ts"), exports);
|
|
6645
|
+
__exportStar(__webpack_require__(/*! ./sync/sync-changes-query.class */ "./lib/query/sync/sync-changes-query.class.ts"), exports);
|
|
6719
6646
|
|
|
6720
6647
|
|
|
6721
6648
|
/***/ }),
|
|
@@ -6731,8 +6658,8 @@ __exportStar(__webpack_require__(/*! ./language/languages-query.class */ "./lib/
|
|
|
6731
6658
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6732
6659
|
exports.MultipleItemsQuery = void 0;
|
|
6733
6660
|
const models_1 = __webpack_require__(/*! ../../models */ "./lib/models/index.ts");
|
|
6734
|
-
const
|
|
6735
|
-
class MultipleItemsQuery extends
|
|
6661
|
+
const base_item_listing_query_class_1 = __webpack_require__(/*! ../common/base-item-listing-query.class */ "./lib/query/common/base-item-listing-query.class.ts");
|
|
6662
|
+
class MultipleItemsQuery extends base_item_listing_query_class_1.BaseItemListingQuery {
|
|
6736
6663
|
constructor(config, queryService) {
|
|
6737
6664
|
super(config, queryService);
|
|
6738
6665
|
this.config = config;
|
|
@@ -6916,8 +6843,8 @@ exports.SingleItemQuery = SingleItemQuery;
|
|
|
6916
6843
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6917
6844
|
exports.ItemsFeedQuery = void 0;
|
|
6918
6845
|
const models_1 = __webpack_require__(/*! ../../models */ "./lib/models/index.ts");
|
|
6919
|
-
const
|
|
6920
|
-
class ItemsFeedQuery extends
|
|
6846
|
+
const base_item_listing_query_class_1 = __webpack_require__(/*! ../common/base-item-listing-query.class */ "./lib/query/common/base-item-listing-query.class.ts");
|
|
6847
|
+
class ItemsFeedQuery extends base_item_listing_query_class_1.BaseItemListingQuery {
|
|
6921
6848
|
constructor(config, queryService) {
|
|
6922
6849
|
super(config, queryService);
|
|
6923
6850
|
this.config = config;
|
|
@@ -6980,7 +6907,7 @@ class ItemsFeedQuery extends base_listing_query_class_1.BaseListingQuery {
|
|
|
6980
6907
|
}
|
|
6981
6908
|
getUrl() {
|
|
6982
6909
|
const action = '/items-feed';
|
|
6983
|
-
// add default language is
|
|
6910
|
+
// add default language is necessary
|
|
6984
6911
|
this.processDefaultLanguageParameter();
|
|
6985
6912
|
return super.resolveUrlInternal(action);
|
|
6986
6913
|
}
|
|
@@ -7046,21 +6973,84 @@ class LanguagesQuery extends base_listing_query_class_1.BaseListingQuery {
|
|
|
7046
6973
|
this.parameters.push(new models_1.Parameters.SkipParameter(skip));
|
|
7047
6974
|
return this;
|
|
7048
6975
|
}
|
|
6976
|
+
toPromise() {
|
|
6977
|
+
var _a;
|
|
6978
|
+
return this.queryService.getLanguages(this.getUrl(), (_a = this._queryConfig) !== null && _a !== void 0 ? _a : {});
|
|
6979
|
+
}
|
|
6980
|
+
getUrl() {
|
|
6981
|
+
const action = '/' + this.endpoint;
|
|
6982
|
+
return super.resolveUrlInternal(action);
|
|
6983
|
+
}
|
|
7049
6984
|
/**
|
|
7050
|
-
*
|
|
7051
|
-
|
|
7052
|
-
|
|
7053
|
-
|
|
7054
|
-
|
|
7055
|
-
|
|
7056
|
-
|
|
7057
|
-
|
|
7058
|
-
|
|
6985
|
+
* Used to configure query
|
|
6986
|
+
* @param queryConfig Query configuration
|
|
6987
|
+
*/
|
|
6988
|
+
queryConfig(queryConfig) {
|
|
6989
|
+
this._queryConfig = queryConfig;
|
|
6990
|
+
return this;
|
|
6991
|
+
}
|
|
6992
|
+
map(json) {
|
|
6993
|
+
return this.queryService.mappingService.listLanguagesResponse(json);
|
|
6994
|
+
}
|
|
6995
|
+
allResponseFactory(items, responses) {
|
|
6996
|
+
return {
|
|
6997
|
+
items: items,
|
|
6998
|
+
responses: responses
|
|
6999
|
+
};
|
|
7000
|
+
}
|
|
7001
|
+
}
|
|
7002
|
+
exports.LanguagesQuery = LanguagesQuery;
|
|
7003
|
+
|
|
7004
|
+
|
|
7005
|
+
/***/ }),
|
|
7006
|
+
|
|
7007
|
+
/***/ "./lib/query/sync/initialize-sync-query.class.ts":
|
|
7008
|
+
/*!*******************************************************!*\
|
|
7009
|
+
!*** ./lib/query/sync/initialize-sync-query.class.ts ***!
|
|
7010
|
+
\*******************************************************/
|
|
7011
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
7012
|
+
|
|
7013
|
+
"use strict";
|
|
7014
|
+
|
|
7015
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7016
|
+
exports.InitializeSyncQuery = void 0;
|
|
7017
|
+
const models_1 = __webpack_require__(/*! ../../models */ "./lib/models/index.ts");
|
|
7018
|
+
const base_query_class_1 = __webpack_require__(/*! ../common/base-query.class */ "./lib/query/common/base-query.class.ts");
|
|
7019
|
+
class InitializeSyncQuery extends base_query_class_1.BaseQuery {
|
|
7020
|
+
constructor(config, queryService) {
|
|
7021
|
+
super(config, queryService);
|
|
7022
|
+
this.config = config;
|
|
7023
|
+
this.queryService = queryService;
|
|
7024
|
+
this.endpoint = 'sync/init';
|
|
7025
|
+
this._queryConfig = {};
|
|
7026
|
+
}
|
|
7027
|
+
/**
|
|
7028
|
+
* Gets only item of given type
|
|
7029
|
+
* @param type Codename of type to get
|
|
7030
|
+
*/
|
|
7031
|
+
type(type) {
|
|
7032
|
+
this.parameters.push(new models_1.Filters.TypeFilter(type));
|
|
7033
|
+
return this;
|
|
7034
|
+
}
|
|
7035
|
+
/**
|
|
7036
|
+
* Gets only item from given collection
|
|
7037
|
+
* @param collection Codename of collection to get
|
|
7038
|
+
*/
|
|
7039
|
+
collection(collection) {
|
|
7040
|
+
this.parameters.push(new models_1.Filters.CollectionFilter(collection));
|
|
7041
|
+
return this;
|
|
7042
|
+
}
|
|
7043
|
+
/**
|
|
7044
|
+
* Language codename
|
|
7045
|
+
* @param languageCodename Codename of the language
|
|
7046
|
+
*/
|
|
7047
|
+
languageParameter(languageCodename) {
|
|
7048
|
+
this.parameters.push(new models_1.Parameters.LanguageParameter(languageCodename));
|
|
7059
7049
|
return this;
|
|
7060
7050
|
}
|
|
7061
7051
|
toPromise() {
|
|
7062
7052
|
var _a;
|
|
7063
|
-
return this.queryService.
|
|
7053
|
+
return this.queryService.initializeSync(this.getUrl(), (_a = this._queryConfig) !== null && _a !== void 0 ? _a : {});
|
|
7064
7054
|
}
|
|
7065
7055
|
getUrl() {
|
|
7066
7056
|
const action = '/' + this.endpoint;
|
|
@@ -7075,7 +7065,50 @@ class LanguagesQuery extends base_listing_query_class_1.BaseListingQuery {
|
|
|
7075
7065
|
return this;
|
|
7076
7066
|
}
|
|
7077
7067
|
map(json) {
|
|
7078
|
-
return this.queryService.mappingService.
|
|
7068
|
+
return this.queryService.mappingService.initializeContentSync(json);
|
|
7069
|
+
}
|
|
7070
|
+
}
|
|
7071
|
+
exports.InitializeSyncQuery = InitializeSyncQuery;
|
|
7072
|
+
|
|
7073
|
+
|
|
7074
|
+
/***/ }),
|
|
7075
|
+
|
|
7076
|
+
/***/ "./lib/query/sync/sync-changes-query.class.ts":
|
|
7077
|
+
/*!****************************************************!*\
|
|
7078
|
+
!*** ./lib/query/sync/sync-changes-query.class.ts ***!
|
|
7079
|
+
\****************************************************/
|
|
7080
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
7081
|
+
|
|
7082
|
+
"use strict";
|
|
7083
|
+
|
|
7084
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7085
|
+
exports.SyncChangesQuery = void 0;
|
|
7086
|
+
const base_listing_query_class_1 = __webpack_require__(/*! ../common/base-listing-query.class */ "./lib/query/common/base-listing-query.class.ts");
|
|
7087
|
+
class SyncChangesQuery extends base_listing_query_class_1.BaseListingQuery {
|
|
7088
|
+
constructor(config, queryService) {
|
|
7089
|
+
super(config, queryService);
|
|
7090
|
+
this.config = config;
|
|
7091
|
+
this.queryService = queryService;
|
|
7092
|
+
this._queryConfig = {};
|
|
7093
|
+
this.action = '/sync';
|
|
7094
|
+
}
|
|
7095
|
+
toPromise() {
|
|
7096
|
+
var _a;
|
|
7097
|
+
return this.queryService.syncChanges(this.getUrl(), (_a = this._queryConfig) !== null && _a !== void 0 ? _a : {});
|
|
7098
|
+
}
|
|
7099
|
+
getUrl() {
|
|
7100
|
+
return super.resolveUrlInternal(this.action);
|
|
7101
|
+
}
|
|
7102
|
+
/**
|
|
7103
|
+
* Used to configure query
|
|
7104
|
+
* @param queryConfig Query configuration
|
|
7105
|
+
*/
|
|
7106
|
+
queryConfig(queryConfig) {
|
|
7107
|
+
this._queryConfig = queryConfig;
|
|
7108
|
+
return this;
|
|
7109
|
+
}
|
|
7110
|
+
map(json) {
|
|
7111
|
+
return this.queryService.mappingService.syncChanges(json);
|
|
7079
7112
|
}
|
|
7080
7113
|
allResponseFactory(items, responses) {
|
|
7081
7114
|
return {
|
|
@@ -7084,7 +7117,7 @@ class LanguagesQuery extends base_listing_query_class_1.BaseListingQuery {
|
|
|
7084
7117
|
};
|
|
7085
7118
|
}
|
|
7086
7119
|
}
|
|
7087
|
-
exports.
|
|
7120
|
+
exports.SyncChangesQuery = SyncChangesQuery;
|
|
7088
7121
|
|
|
7089
7122
|
|
|
7090
7123
|
/***/ }),
|
|
@@ -7132,18 +7165,6 @@ class TaxonomiesQuery extends base_listing_query_class_1.BaseListingQuery {
|
|
|
7132
7165
|
var _a;
|
|
7133
7166
|
return this.queryService.getTaxonomies(this.getUrl(), (_a = this._queryConfig) !== null && _a !== void 0 ? _a : {});
|
|
7134
7167
|
}
|
|
7135
|
-
/**
|
|
7136
|
-
* Sets continuation token header
|
|
7137
|
-
*/
|
|
7138
|
-
withContinuationToken(token) {
|
|
7139
|
-
this.withHeaders([
|
|
7140
|
-
{
|
|
7141
|
-
header: models_1.continuationTokenHeaderName,
|
|
7142
|
-
value: token
|
|
7143
|
-
}
|
|
7144
|
-
]);
|
|
7145
|
-
return this;
|
|
7146
|
-
}
|
|
7147
7168
|
getUrl() {
|
|
7148
7169
|
const action = '/' + this.taxonomiesEndpoint;
|
|
7149
7170
|
return super.resolveUrlInternal(action);
|
|
@@ -7216,6 +7237,7 @@ exports.TaxonomyQuery = TaxonomyQuery;
|
|
|
7216
7237
|
|
|
7217
7238
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7218
7239
|
exports.MultipleTypeQuery = void 0;
|
|
7240
|
+
const models_1 = __webpack_require__(/*! ../../models */ "./lib/models/index.ts");
|
|
7219
7241
|
const base_listing_query_class_1 = __webpack_require__(/*! ../common/base-listing-query.class */ "./lib/query/common/base-listing-query.class.ts");
|
|
7220
7242
|
class MultipleTypeQuery extends base_listing_query_class_1.BaseListingQuery {
|
|
7221
7243
|
constructor(config, queryService) {
|
|
@@ -7224,6 +7246,30 @@ class MultipleTypeQuery extends base_listing_query_class_1.BaseListingQuery {
|
|
|
7224
7246
|
this.queryService = queryService;
|
|
7225
7247
|
this._queryConfig = {};
|
|
7226
7248
|
}
|
|
7249
|
+
/**
|
|
7250
|
+
* Used to limit the number of elements returned by query.
|
|
7251
|
+
* @param elementCodenames Array of element codenames to fetch
|
|
7252
|
+
*/
|
|
7253
|
+
elementsParameter(elementCodenames) {
|
|
7254
|
+
this.parameters.push(new models_1.Parameters.ElementsParameter(elementCodenames));
|
|
7255
|
+
return this;
|
|
7256
|
+
}
|
|
7257
|
+
/**
|
|
7258
|
+
* Limits the number of taxonomies returned by query
|
|
7259
|
+
* @param limit Number of taxonomies to load
|
|
7260
|
+
*/
|
|
7261
|
+
limitParameter(limit) {
|
|
7262
|
+
this.parameters.push(new models_1.Parameters.LimitParameter(limit));
|
|
7263
|
+
return this;
|
|
7264
|
+
}
|
|
7265
|
+
/**
|
|
7266
|
+
* Skips the selected number of taxonomies
|
|
7267
|
+
* @param skip Number of taxonomies to skip
|
|
7268
|
+
*/
|
|
7269
|
+
skipParameter(skip) {
|
|
7270
|
+
this.parameters.push(new models_1.Parameters.SkipParameter(skip));
|
|
7271
|
+
return this;
|
|
7272
|
+
}
|
|
7227
7273
|
toPromise() {
|
|
7228
7274
|
var _a;
|
|
7229
7275
|
return this.queryService.getMultipleTypes(this.getUrl(), (_a = this._queryConfig) !== null && _a !== void 0 ? _a : {});
|
|
@@ -7868,7 +7914,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
7868
7914
|
exports.sdkInfo = void 0;
|
|
7869
7915
|
exports.sdkInfo = {
|
|
7870
7916
|
host: 'npmjs.com',
|
|
7871
|
-
version: '12.
|
|
7917
|
+
version: '12.4.0',
|
|
7872
7918
|
name: '@kontent-ai/delivery-sdk'
|
|
7873
7919
|
};
|
|
7874
7920
|
|
|
@@ -7894,7 +7940,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7894
7940
|
};
|
|
7895
7941
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7896
7942
|
exports.BaseDeliveryQueryService = void 0;
|
|
7897
|
-
const core_sdk_1 = __webpack_require__(/*! @kontent-ai/core-sdk */ "./node_modules/@kontent-ai/core-sdk/dist/
|
|
7943
|
+
const core_sdk_1 = __webpack_require__(/*! @kontent-ai/core-sdk */ "./node_modules/@kontent-ai/core-sdk/dist/es6/index.js");
|
|
7898
7944
|
const models_1 = __webpack_require__(/*! ../models */ "./lib/models/index.ts");
|
|
7899
7945
|
class BaseDeliveryQueryService {
|
|
7900
7946
|
constructor(
|
|
@@ -7984,6 +8030,35 @@ class BaseDeliveryQueryService {
|
|
|
7984
8030
|
}
|
|
7985
8031
|
return headers;
|
|
7986
8032
|
}
|
|
8033
|
+
/**
|
|
8034
|
+
* Http POST response
|
|
8035
|
+
* @param url Url of request
|
|
8036
|
+
* @param queryConfig Query config configuration
|
|
8037
|
+
*/
|
|
8038
|
+
postResponseAsync(url, body, queryConfig, serviceConfig) {
|
|
8039
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
8040
|
+
if (!queryConfig) {
|
|
8041
|
+
queryConfig = {};
|
|
8042
|
+
}
|
|
8043
|
+
if (!serviceConfig) {
|
|
8044
|
+
serviceConfig = {};
|
|
8045
|
+
}
|
|
8046
|
+
try {
|
|
8047
|
+
return yield this.httpService.postAsync({
|
|
8048
|
+
url: url,
|
|
8049
|
+
body: body
|
|
8050
|
+
}, {
|
|
8051
|
+
cancelToken: queryConfig === null || queryConfig === void 0 ? void 0 : queryConfig.cancelToken,
|
|
8052
|
+
responseType: 'json',
|
|
8053
|
+
retryStrategy: this.config.retryStrategy,
|
|
8054
|
+
headers: this.getHeaders(queryConfig, serviceConfig.headers ? serviceConfig.headers : [])
|
|
8055
|
+
});
|
|
8056
|
+
}
|
|
8057
|
+
catch (error) {
|
|
8058
|
+
throw this.mapDeliveryError(error);
|
|
8059
|
+
}
|
|
8060
|
+
});
|
|
8061
|
+
}
|
|
7987
8062
|
/**
|
|
7988
8063
|
* Http GET response
|
|
7989
8064
|
* @param url Url of request
|
|
@@ -8246,6 +8321,31 @@ class QueryService extends base_delivery_query_service_1.BaseDeliveryQueryServic
|
|
|
8246
8321
|
return this.mapNetworkResponse(this.mappingService.listContentTypesResponse(response.data), response);
|
|
8247
8322
|
});
|
|
8248
8323
|
}
|
|
8324
|
+
/**
|
|
8325
|
+
* Initializes synchronization of changes in content items based on the specified parameters. After the initialization,
|
|
8326
|
+
* you'll get an X-Continuation token in the response.
|
|
8327
|
+
* Use the token to synchronize changes in the content items matching the initialization criteria.
|
|
8328
|
+
* @param url Url
|
|
8329
|
+
* @param queryConfig Query configuration
|
|
8330
|
+
*/
|
|
8331
|
+
initializeSync(url, queryConfig) {
|
|
8332
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
8333
|
+
const response = yield this.postResponseAsync(url, queryConfig);
|
|
8334
|
+
return this.mapNetworkResponse(this.mappingService.initializeContentSync(response.data), response);
|
|
8335
|
+
});
|
|
8336
|
+
}
|
|
8337
|
+
/**
|
|
8338
|
+
* Retrieve a list of delta updates to recently changed content items in the specified project.
|
|
8339
|
+
* The types of items you get is determined by the X-Continuation token you use.
|
|
8340
|
+
* @param url Url used to get multiple types
|
|
8341
|
+
* @param queryConfig Query configuration
|
|
8342
|
+
*/
|
|
8343
|
+
syncChanges(url, queryConfig) {
|
|
8344
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
8345
|
+
const response = yield this.getResponseAsync(url, queryConfig);
|
|
8346
|
+
return this.mapNetworkResponse(this.mappingService.syncChanges(response.data), response);
|
|
8347
|
+
});
|
|
8348
|
+
}
|
|
8249
8349
|
/**
|
|
8250
8350
|
* Gets languages
|
|
8251
8351
|
* @param url Url
|
|
@@ -8396,6 +8496,7 @@ class MappingService {
|
|
|
8396
8496
|
this.itemMapper = new mappers_1.ItemMapper(config);
|
|
8397
8497
|
this.taxonomyMapper = new mappers_1.TaxonomyMapper();
|
|
8398
8498
|
this.genericElementMapper = new mappers_1.GenericElementMapper();
|
|
8499
|
+
this.syncMapper = new mappers_1.SyncMapper();
|
|
8399
8500
|
}
|
|
8400
8501
|
/**
|
|
8401
8502
|
* Gets response for list of languages
|
|
@@ -8490,6 +8591,16 @@ class MappingService {
|
|
|
8490
8591
|
element: this.genericElementMapper.mapElement(data)
|
|
8491
8592
|
};
|
|
8492
8593
|
}
|
|
8594
|
+
initializeContentSync(data) {
|
|
8595
|
+
return {
|
|
8596
|
+
items: data.items.map((m) => this.syncMapper.mapContentItemDelta(m))
|
|
8597
|
+
};
|
|
8598
|
+
}
|
|
8599
|
+
syncChanges(data) {
|
|
8600
|
+
return {
|
|
8601
|
+
items: data.items.map((m) => this.syncMapper.mapContentItemDelta(m))
|
|
8602
|
+
};
|
|
8603
|
+
}
|
|
8493
8604
|
mapPagination(paginationContract) {
|
|
8494
8605
|
var _a;
|
|
8495
8606
|
return {
|
|
@@ -8645,261 +8756,6 @@ exports.TextHelper = TextHelper;
|
|
|
8645
8756
|
exports.textHelper = new TextHelper();
|
|
8646
8757
|
|
|
8647
8758
|
|
|
8648
|
-
/***/ }),
|
|
8649
|
-
|
|
8650
|
-
/***/ "./node_modules/tslib/tslib.es6.js":
|
|
8651
|
-
/*!*****************************************!*\
|
|
8652
|
-
!*** ./node_modules/tslib/tslib.es6.js ***!
|
|
8653
|
-
\*****************************************/
|
|
8654
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
8655
|
-
|
|
8656
|
-
"use strict";
|
|
8657
|
-
__webpack_require__.r(__webpack_exports__);
|
|
8658
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
8659
|
-
/* harmony export */ "__assign": () => (/* binding */ __assign),
|
|
8660
|
-
/* harmony export */ "__asyncDelegator": () => (/* binding */ __asyncDelegator),
|
|
8661
|
-
/* harmony export */ "__asyncGenerator": () => (/* binding */ __asyncGenerator),
|
|
8662
|
-
/* harmony export */ "__asyncValues": () => (/* binding */ __asyncValues),
|
|
8663
|
-
/* harmony export */ "__await": () => (/* binding */ __await),
|
|
8664
|
-
/* harmony export */ "__awaiter": () => (/* binding */ __awaiter),
|
|
8665
|
-
/* harmony export */ "__classPrivateFieldGet": () => (/* binding */ __classPrivateFieldGet),
|
|
8666
|
-
/* harmony export */ "__classPrivateFieldSet": () => (/* binding */ __classPrivateFieldSet),
|
|
8667
|
-
/* harmony export */ "__createBinding": () => (/* binding */ __createBinding),
|
|
8668
|
-
/* harmony export */ "__decorate": () => (/* binding */ __decorate),
|
|
8669
|
-
/* harmony export */ "__exportStar": () => (/* binding */ __exportStar),
|
|
8670
|
-
/* harmony export */ "__extends": () => (/* binding */ __extends),
|
|
8671
|
-
/* harmony export */ "__generator": () => (/* binding */ __generator),
|
|
8672
|
-
/* harmony export */ "__importDefault": () => (/* binding */ __importDefault),
|
|
8673
|
-
/* harmony export */ "__importStar": () => (/* binding */ __importStar),
|
|
8674
|
-
/* harmony export */ "__makeTemplateObject": () => (/* binding */ __makeTemplateObject),
|
|
8675
|
-
/* harmony export */ "__metadata": () => (/* binding */ __metadata),
|
|
8676
|
-
/* harmony export */ "__param": () => (/* binding */ __param),
|
|
8677
|
-
/* harmony export */ "__read": () => (/* binding */ __read),
|
|
8678
|
-
/* harmony export */ "__rest": () => (/* binding */ __rest),
|
|
8679
|
-
/* harmony export */ "__spread": () => (/* binding */ __spread),
|
|
8680
|
-
/* harmony export */ "__spreadArrays": () => (/* binding */ __spreadArrays),
|
|
8681
|
-
/* harmony export */ "__values": () => (/* binding */ __values)
|
|
8682
|
-
/* harmony export */ });
|
|
8683
|
-
/*! *****************************************************************************
|
|
8684
|
-
Copyright (c) Microsoft Corporation.
|
|
8685
|
-
|
|
8686
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
8687
|
-
purpose with or without fee is hereby granted.
|
|
8688
|
-
|
|
8689
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
8690
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
8691
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
8692
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
8693
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
8694
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
8695
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
8696
|
-
***************************************************************************** */
|
|
8697
|
-
/* global Reflect, Promise */
|
|
8698
|
-
|
|
8699
|
-
var extendStatics = function(d, b) {
|
|
8700
|
-
extendStatics = Object.setPrototypeOf ||
|
|
8701
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
8702
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
8703
|
-
return extendStatics(d, b);
|
|
8704
|
-
};
|
|
8705
|
-
|
|
8706
|
-
function __extends(d, b) {
|
|
8707
|
-
extendStatics(d, b);
|
|
8708
|
-
function __() { this.constructor = d; }
|
|
8709
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
8710
|
-
}
|
|
8711
|
-
|
|
8712
|
-
var __assign = function() {
|
|
8713
|
-
__assign = Object.assign || function __assign(t) {
|
|
8714
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8715
|
-
s = arguments[i];
|
|
8716
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
8717
|
-
}
|
|
8718
|
-
return t;
|
|
8719
|
-
}
|
|
8720
|
-
return __assign.apply(this, arguments);
|
|
8721
|
-
}
|
|
8722
|
-
|
|
8723
|
-
function __rest(s, e) {
|
|
8724
|
-
var t = {};
|
|
8725
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
8726
|
-
t[p] = s[p];
|
|
8727
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
8728
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8729
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8730
|
-
t[p[i]] = s[p[i]];
|
|
8731
|
-
}
|
|
8732
|
-
return t;
|
|
8733
|
-
}
|
|
8734
|
-
|
|
8735
|
-
function __decorate(decorators, target, key, desc) {
|
|
8736
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
8737
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
8738
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
8739
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
8740
|
-
}
|
|
8741
|
-
|
|
8742
|
-
function __param(paramIndex, decorator) {
|
|
8743
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
8744
|
-
}
|
|
8745
|
-
|
|
8746
|
-
function __metadata(metadataKey, metadataValue) {
|
|
8747
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
|
8748
|
-
}
|
|
8749
|
-
|
|
8750
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
8751
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
8752
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
8753
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
8754
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
8755
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8756
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8757
|
-
});
|
|
8758
|
-
}
|
|
8759
|
-
|
|
8760
|
-
function __generator(thisArg, body) {
|
|
8761
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
8762
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
8763
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
8764
|
-
function step(op) {
|
|
8765
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
8766
|
-
while (_) try {
|
|
8767
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
8768
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
8769
|
-
switch (op[0]) {
|
|
8770
|
-
case 0: case 1: t = op; break;
|
|
8771
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
8772
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
8773
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
8774
|
-
default:
|
|
8775
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
8776
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
8777
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
8778
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
8779
|
-
if (t[2]) _.ops.pop();
|
|
8780
|
-
_.trys.pop(); continue;
|
|
8781
|
-
}
|
|
8782
|
-
op = body.call(thisArg, _);
|
|
8783
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
8784
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
8785
|
-
}
|
|
8786
|
-
}
|
|
8787
|
-
|
|
8788
|
-
function __createBinding(o, m, k, k2) {
|
|
8789
|
-
if (k2 === undefined) k2 = k;
|
|
8790
|
-
o[k2] = m[k];
|
|
8791
|
-
}
|
|
8792
|
-
|
|
8793
|
-
function __exportStar(m, exports) {
|
|
8794
|
-
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
8795
|
-
}
|
|
8796
|
-
|
|
8797
|
-
function __values(o) {
|
|
8798
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
8799
|
-
if (m) return m.call(o);
|
|
8800
|
-
if (o && typeof o.length === "number") return {
|
|
8801
|
-
next: function () {
|
|
8802
|
-
if (o && i >= o.length) o = void 0;
|
|
8803
|
-
return { value: o && o[i++], done: !o };
|
|
8804
|
-
}
|
|
8805
|
-
};
|
|
8806
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
8807
|
-
}
|
|
8808
|
-
|
|
8809
|
-
function __read(o, n) {
|
|
8810
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
8811
|
-
if (!m) return o;
|
|
8812
|
-
var i = m.call(o), r, ar = [], e;
|
|
8813
|
-
try {
|
|
8814
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
8815
|
-
}
|
|
8816
|
-
catch (error) { e = { error: error }; }
|
|
8817
|
-
finally {
|
|
8818
|
-
try {
|
|
8819
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
8820
|
-
}
|
|
8821
|
-
finally { if (e) throw e.error; }
|
|
8822
|
-
}
|
|
8823
|
-
return ar;
|
|
8824
|
-
}
|
|
8825
|
-
|
|
8826
|
-
function __spread() {
|
|
8827
|
-
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
8828
|
-
ar = ar.concat(__read(arguments[i]));
|
|
8829
|
-
return ar;
|
|
8830
|
-
}
|
|
8831
|
-
|
|
8832
|
-
function __spreadArrays() {
|
|
8833
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
8834
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
8835
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
8836
|
-
r[k] = a[j];
|
|
8837
|
-
return r;
|
|
8838
|
-
};
|
|
8839
|
-
|
|
8840
|
-
function __await(v) {
|
|
8841
|
-
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
8842
|
-
}
|
|
8843
|
-
|
|
8844
|
-
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
8845
|
-
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
8846
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
8847
|
-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
8848
|
-
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
8849
|
-
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
|
8850
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
8851
|
-
function fulfill(value) { resume("next", value); }
|
|
8852
|
-
function reject(value) { resume("throw", value); }
|
|
8853
|
-
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
|
8854
|
-
}
|
|
8855
|
-
|
|
8856
|
-
function __asyncDelegator(o) {
|
|
8857
|
-
var i, p;
|
|
8858
|
-
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
8859
|
-
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
|
8860
|
-
}
|
|
8861
|
-
|
|
8862
|
-
function __asyncValues(o) {
|
|
8863
|
-
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
8864
|
-
var m = o[Symbol.asyncIterator], i;
|
|
8865
|
-
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
8866
|
-
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
8867
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
8868
|
-
}
|
|
8869
|
-
|
|
8870
|
-
function __makeTemplateObject(cooked, raw) {
|
|
8871
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
8872
|
-
return cooked;
|
|
8873
|
-
};
|
|
8874
|
-
|
|
8875
|
-
function __importStar(mod) {
|
|
8876
|
-
if (mod && mod.__esModule) return mod;
|
|
8877
|
-
var result = {};
|
|
8878
|
-
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
8879
|
-
result.default = mod;
|
|
8880
|
-
return result;
|
|
8881
|
-
}
|
|
8882
|
-
|
|
8883
|
-
function __importDefault(mod) {
|
|
8884
|
-
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
8885
|
-
}
|
|
8886
|
-
|
|
8887
|
-
function __classPrivateFieldGet(receiver, privateMap) {
|
|
8888
|
-
if (!privateMap.has(receiver)) {
|
|
8889
|
-
throw new TypeError("attempted to get private field on non-instance");
|
|
8890
|
-
}
|
|
8891
|
-
return privateMap.get(receiver);
|
|
8892
|
-
}
|
|
8893
|
-
|
|
8894
|
-
function __classPrivateFieldSet(receiver, privateMap, value) {
|
|
8895
|
-
if (!privateMap.has(receiver)) {
|
|
8896
|
-
throw new TypeError("attempted to set private field on non-instance");
|
|
8897
|
-
}
|
|
8898
|
-
privateMap.set(receiver, value);
|
|
8899
|
-
return value;
|
|
8900
|
-
}
|
|
8901
|
-
|
|
8902
|
-
|
|
8903
8759
|
/***/ }),
|
|
8904
8760
|
|
|
8905
8761
|
/***/ "./node_modules/url-parse/index.js":
|