oneentry 1.0.158 → 1.0.159
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/README.md +20 -0
- package/changelog.md +35 -0
- package/dist/admins/adminsApi.js +36 -2
- package/dist/attribute-sets/attributeSetsApi.js +39 -5
- package/dist/auth-provider/authProviderApi.js +38 -4
- package/dist/base/asyncModules.d.ts +6 -4
- package/dist/base/asyncModules.js +44 -8
- package/dist/blocks/blocksApi.js +38 -4
- package/dist/file-uploading/fileUploadingApi.js +36 -2
- package/dist/filters/filtersApi.js +36 -2
- package/dist/forms/formsApi.js +37 -3
- package/dist/forms-data/formsDataApi.js +38 -4
- package/dist/general-types/generalTypesApi.js +36 -2
- package/dist/index.d.ts +2 -2
- package/dist/integration-collections/integrationCollectionsApi.js +43 -9
- package/dist/locales/localesApi.js +36 -2
- package/dist/menus/menusApi.js +36 -2
- package/dist/orders/ordersApi.js +39 -5
- package/dist/pages/pagesApi.js +42 -8
- package/dist/payments/paymentsApi.js +39 -5
- package/dist/product-statuses/productStatusesApi.js +38 -4
- package/dist/products/productsApi.js +41 -7
- package/dist/subscriptions/subscriptionsApi.js +38 -4
- package/dist/templates/templatesApi.js +38 -4
- package/dist/templates-preview/templatesPreviewApi.js +37 -3
- package/dist/users/usersApi.js +45 -11
- package/dist/web-socket/wsApi.d.ts +2 -0
- package/dist/web-socket/wsApi.js +47 -10
- package/package.json +6 -1
|
@@ -1,12 +1,46 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
37
|
};
|
|
5
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
39
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
7
40
|
const asyncModules_1 = __importDefault(require("../base/asyncModules"));
|
|
41
|
+
const lazySchema_1 = __importDefault(require("../base/lazySchema"));
|
|
8
42
|
const fileUploadingApi_1 = __importDefault(require("../file-uploading/fileUploadingApi"));
|
|
9
|
-
const
|
|
43
|
+
const schema = (0, lazySchema_1.default)(() => Promise.resolve().then(() => __importStar(require('./formsDataSchemas'))));
|
|
10
44
|
/**
|
|
11
45
|
* Controllers for working with form data
|
|
12
46
|
* @handle /api/content/form-data
|
|
@@ -122,7 +156,7 @@ class FormsDataApi extends asyncModules_1.default {
|
|
|
122
156
|
body.formData = formData;
|
|
123
157
|
const result = await this._fetchPost(``, body);
|
|
124
158
|
// Validate response if validation is enabled
|
|
125
|
-
const validated = this._validateResponse(result,
|
|
159
|
+
const validated = await this._validateResponse(result, schema('PostFormResponseSchema'));
|
|
126
160
|
return this._normalizeData(validated);
|
|
127
161
|
}
|
|
128
162
|
/**
|
|
@@ -151,7 +185,7 @@ class FormsDataApi extends asyncModules_1.default {
|
|
|
151
185
|
async getFormsDataByMarker(marker, formModuleConfigId, body = {}, isExtended = 0, langCode = this.state.lang, offset = 0, limit = 30) {
|
|
152
186
|
const result = await this._fetchPost(`/marker/${marker}?formModuleConfigId=${formModuleConfigId}&isExtended=${isExtended}&langCode=${langCode}&offset=${offset}&limit=${limit}`, body);
|
|
153
187
|
// Validate response if validation is enabled
|
|
154
|
-
const validated = this._validateResponse(result,
|
|
188
|
+
const validated = await this._validateResponse(result, schema('FormsByMarkerDataResponseSchema'));
|
|
155
189
|
return this._normalizeData(validated, langCode);
|
|
156
190
|
}
|
|
157
191
|
/**
|
|
@@ -164,7 +198,7 @@ class FormsDataApi extends asyncModules_1.default {
|
|
|
164
198
|
async updateFormsDataByid(id, body = {}) {
|
|
165
199
|
const result = await this._fetchPut(`/${id}`, body);
|
|
166
200
|
// Validate response if validation is enabled
|
|
167
|
-
const validated = this._validateResponse(result,
|
|
201
|
+
const validated = await this._validateResponse(result, schema('UpdateFormsDataSchema'));
|
|
168
202
|
return validated;
|
|
169
203
|
}
|
|
170
204
|
/**
|
|
@@ -1,10 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
37
|
};
|
|
5
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
39
|
const asyncModules_1 = __importDefault(require("../base/asyncModules"));
|
|
7
|
-
const
|
|
40
|
+
const lazySchema_1 = __importDefault(require("../base/lazySchema"));
|
|
41
|
+
const schema = (0, lazySchema_1.default)(() => Promise.resolve().then(() => __importStar(require('./generalTypesSchemas'))));
|
|
8
42
|
/**
|
|
9
43
|
* Controllers for working with types
|
|
10
44
|
* @handle /api/content/general-types
|
|
@@ -32,7 +66,7 @@ class GeneralTypesApi extends asyncModules_1.default {
|
|
|
32
66
|
async getAllTypes() {
|
|
33
67
|
const result = await this._fetchGet('');
|
|
34
68
|
// Validate response if validation is enabled
|
|
35
|
-
const validated = this._validateResponse(result,
|
|
69
|
+
const validated = await this._validateResponse(result, schema('GeneralTypesResponseSchema'));
|
|
36
70
|
return validated;
|
|
37
71
|
}
|
|
38
72
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import AdminsApi from './admins/adminsApi';
|
|
5
5
|
import AttributesSetsApi from './attribute-sets/attributeSetsApi';
|
|
6
6
|
import AuthProviderApi from './auth-provider/authProviderApi';
|
|
7
|
-
import type {
|
|
7
|
+
import type { IConfig } from './base/utils';
|
|
8
8
|
import BlocksApi from './blocks/blocksApi';
|
|
9
9
|
import DiscountsApi from './discounts/discountsApi';
|
|
10
10
|
import EventsApi from './events/eventsApi';
|
|
@@ -30,7 +30,7 @@ import UserActivityApi from './user-activity/userActivityApi';
|
|
|
30
30
|
import UsersApi from './users/usersApi';
|
|
31
31
|
import WsApi from './web-socket/wsApi';
|
|
32
32
|
export { expandAttributeTimeIntervals, expandTimeIntervals, isTimeIntervalAttribute, } from './base/timeIntervals';
|
|
33
|
-
export type
|
|
33
|
+
export type * from './types';
|
|
34
34
|
/**
|
|
35
35
|
* IDefineApi interface
|
|
36
36
|
* @interface IDefineApi
|
|
@@ -1,11 +1,45 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
37
|
};
|
|
5
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
39
|
/* eslint-disable jsdoc/reject-any-type */
|
|
7
40
|
const asyncModules_1 = __importDefault(require("../base/asyncModules"));
|
|
8
|
-
const
|
|
41
|
+
const lazySchema_1 = __importDefault(require("../base/lazySchema"));
|
|
42
|
+
const schema = (0, lazySchema_1.default)(() => Promise.resolve().then(() => __importStar(require('./integrationCollectionsSchemas'))));
|
|
9
43
|
/**
|
|
10
44
|
* Controllers for working with attributes.
|
|
11
45
|
* @handle /api/content/integration-collections
|
|
@@ -51,7 +85,7 @@ class IntegrationCollectionsApi extends asyncModules_1.default {
|
|
|
51
85
|
const query = { ...this._defaultQuery, ...userQuery, langCode };
|
|
52
86
|
const result = await this._fetchGet(`?` + this._queryParamsToString(query));
|
|
53
87
|
// Validate response if validation is enabled
|
|
54
|
-
const validated = this._validateResponse(result,
|
|
88
|
+
const validated = await this._validateResponse(result, schema('CollectionsResponseSchema'));
|
|
55
89
|
return this._normalizeData(validated, langCode);
|
|
56
90
|
}
|
|
57
91
|
/**
|
|
@@ -66,7 +100,7 @@ class IntegrationCollectionsApi extends asyncModules_1.default {
|
|
|
66
100
|
async getICollectionById(id, langCode = this.state.lang) {
|
|
67
101
|
const result = await this._fetchGet(`/${id}?` + this._queryParamsToString({ langCode }));
|
|
68
102
|
// Validate response if validation is enabled
|
|
69
|
-
const validated = this._validateResponse(result,
|
|
103
|
+
const validated = await this._validateResponse(result, schema('CollectionEntitySchema'));
|
|
70
104
|
return this._normalizeData(validated, langCode);
|
|
71
105
|
}
|
|
72
106
|
/**
|
|
@@ -99,7 +133,7 @@ class IntegrationCollectionsApi extends asyncModules_1.default {
|
|
|
99
133
|
langCode,
|
|
100
134
|
}));
|
|
101
135
|
// Validate response if validation is enabled
|
|
102
|
-
const validated = this._validateResponse(result,
|
|
136
|
+
const validated = await this._validateResponse(result, schema('CollectionRowsResponseSchema'));
|
|
103
137
|
return this._normalizeData(validated, langCode);
|
|
104
138
|
}
|
|
105
139
|
/**
|
|
@@ -118,7 +152,7 @@ class IntegrationCollectionsApi extends asyncModules_1.default {
|
|
|
118
152
|
async validateICollectionMarker(marker) {
|
|
119
153
|
const result = await this._fetchGet(`/marker-validation/${marker}`);
|
|
120
154
|
// Validate response if validation is enabled
|
|
121
|
-
const validated = this._validateResponse(result,
|
|
155
|
+
const validated = await this._validateResponse(result, schema('CollectionIsValidSchema'));
|
|
122
156
|
return this._normalizeData(validated);
|
|
123
157
|
}
|
|
124
158
|
/**
|
|
@@ -133,7 +167,7 @@ class IntegrationCollectionsApi extends asyncModules_1.default {
|
|
|
133
167
|
async getICollectionRowsByMarker(marker, langCode = this.state.lang) {
|
|
134
168
|
const result = await this._fetchGet(`/marker/${marker}/rows?langCode=${langCode}`);
|
|
135
169
|
// Validate response if validation is enabled
|
|
136
|
-
const validated = this._validateResponse(result,
|
|
170
|
+
const validated = await this._validateResponse(result, schema('CollectionRowsResponseSchema'));
|
|
137
171
|
return this._normalizeData(validated, langCode);
|
|
138
172
|
}
|
|
139
173
|
/**
|
|
@@ -149,7 +183,7 @@ class IntegrationCollectionsApi extends asyncModules_1.default {
|
|
|
149
183
|
async getICollectionRowByMarkerAndId(marker, id, langCode = this.state.lang) {
|
|
150
184
|
const result = await this._fetchGet(`/marker/${marker}/rows/${id}?langCode=${langCode}`);
|
|
151
185
|
// Validate response if validation is enabled
|
|
152
|
-
const validated = this._validateResponse(result,
|
|
186
|
+
const validated = await this._validateResponse(result, schema('CollectionRowSchema'));
|
|
153
187
|
return this._normalizeData(validated, langCode);
|
|
154
188
|
}
|
|
155
189
|
/**
|
|
@@ -177,7 +211,7 @@ class IntegrationCollectionsApi extends asyncModules_1.default {
|
|
|
177
211
|
async createICollectionRow(marker, body, langCode = this.state.lang) {
|
|
178
212
|
const response = await this._fetchPost(`/marker/${marker}/rows?langCode=${langCode}`, body);
|
|
179
213
|
// Validate response if validation is enabled
|
|
180
|
-
const validated = this._validateResponse(response,
|
|
214
|
+
const validated = await this._validateResponse(response, schema('CollectionRowSchema'));
|
|
181
215
|
return this._normalizeData(validated, langCode);
|
|
182
216
|
}
|
|
183
217
|
/**
|
|
@@ -208,7 +242,7 @@ class IntegrationCollectionsApi extends asyncModules_1.default {
|
|
|
208
242
|
async updateICollectionRow(marker, id, body, langCode = this.state.lang) {
|
|
209
243
|
const response = await this._fetchPut(`/marker/${marker}/rows/${id}?` + `langCode=${langCode}`, body);
|
|
210
244
|
// Validate response if validation is enabled
|
|
211
|
-
const validated = this._validateResponse(response,
|
|
245
|
+
const validated = await this._validateResponse(response, schema('CollectionRowSchema'));
|
|
212
246
|
return this._normalizeData(validated, langCode);
|
|
213
247
|
}
|
|
214
248
|
/**
|
|
@@ -1,10 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
37
|
};
|
|
5
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
39
|
const asyncModules_1 = __importDefault(require("../base/asyncModules"));
|
|
7
|
-
const
|
|
40
|
+
const lazySchema_1 = __importDefault(require("../base/lazySchema"));
|
|
41
|
+
const schema = (0, lazySchema_1.default)(() => Promise.resolve().then(() => __importStar(require('./localesSchemas'))));
|
|
8
42
|
/**
|
|
9
43
|
* Controllers for working with localizations (content language)
|
|
10
44
|
* @handle /api/content/locales
|
|
@@ -31,7 +65,7 @@ class LocalesApi extends asyncModules_1.default {
|
|
|
31
65
|
async getLocales() {
|
|
32
66
|
const result = await this._fetchGet('/active/all');
|
|
33
67
|
// Validate response if validation is enabled
|
|
34
|
-
const validated = this._validateResponse(result,
|
|
68
|
+
const validated = await this._validateResponse(result, schema('LocalesResponseSchema'));
|
|
35
69
|
return validated;
|
|
36
70
|
}
|
|
37
71
|
}
|
package/dist/menus/menusApi.js
CHANGED
|
@@ -1,10 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
37
|
};
|
|
5
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
39
|
const asyncModules_1 = __importDefault(require("../base/asyncModules"));
|
|
7
|
-
const
|
|
40
|
+
const lazySchema_1 = __importDefault(require("../base/lazySchema"));
|
|
41
|
+
const schema = (0, lazySchema_1.default)(() => Promise.resolve().then(() => __importStar(require('./menusSchemas'))));
|
|
8
42
|
/**
|
|
9
43
|
* Controllers for working with menu objects
|
|
10
44
|
* @handle /api/content/menus
|
|
@@ -33,7 +67,7 @@ class MenusApi extends asyncModules_1.default {
|
|
|
33
67
|
async getMenusByMarker(marker, langCode = this.state.lang) {
|
|
34
68
|
const result = await this._fetchGet(`/marker/${marker}?langCode=${langCode}`);
|
|
35
69
|
// Validate response if validation is enabled
|
|
36
|
-
const validated = this._validateResponse(result,
|
|
70
|
+
const validated = await this._validateResponse(result, schema('MenuEntitySchema'));
|
|
37
71
|
return this._normalizeData(validated, langCode);
|
|
38
72
|
}
|
|
39
73
|
}
|
package/dist/orders/ordersApi.js
CHANGED
|
@@ -1,10 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
37
|
};
|
|
5
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
39
|
const asyncModules_1 = __importDefault(require("../base/asyncModules"));
|
|
7
|
-
const
|
|
40
|
+
const lazySchema_1 = __importDefault(require("../base/lazySchema"));
|
|
41
|
+
const schema = (0, lazySchema_1.default)(() => Promise.resolve().then(() => __importStar(require('./ordersSchemas'))));
|
|
8
42
|
/**
|
|
9
43
|
* Controllers for working with orders.
|
|
10
44
|
* @handle /api/content/orders-storage
|
|
@@ -54,7 +88,7 @@ class OrdersApi extends asyncModules_1.default {
|
|
|
54
88
|
async getAllOrdersByMarker(marker, langCode = this.state.lang, offset = 0, limit = 30) {
|
|
55
89
|
const result = await this._fetchGet(`/marker/${marker}/orders?langCode=${langCode}&limit=${limit}&offset=${offset}`);
|
|
56
90
|
// Validate response if validation is enabled
|
|
57
|
-
const validated = this._validateResponse(result,
|
|
91
|
+
const validated = await this._validateResponse(result, schema('OrdersResponseSchema'));
|
|
58
92
|
return this._normalizeData(validated);
|
|
59
93
|
}
|
|
60
94
|
/**
|
|
@@ -87,7 +121,7 @@ class OrdersApi extends asyncModules_1.default {
|
|
|
87
121
|
async getOrderByMarkerAndId(marker, id, langCode = this.state.lang) {
|
|
88
122
|
const result = await this._fetchGet(`/marker/${marker}/orders/${id}?langCode=${langCode}`);
|
|
89
123
|
// Validate response if validation is enabled
|
|
90
|
-
const validated = this._validateResponse(result,
|
|
124
|
+
const validated = await this._validateResponse(result, schema('OrderEntitySchema'));
|
|
91
125
|
return this._normalizeData(validated);
|
|
92
126
|
}
|
|
93
127
|
/**
|
|
@@ -142,7 +176,7 @@ class OrdersApi extends asyncModules_1.default {
|
|
|
142
176
|
body.formData = formData;
|
|
143
177
|
const result = await this._fetchPost(`/marker/${marker}/orders`, body);
|
|
144
178
|
// Validate response if validation is enabled
|
|
145
|
-
const validated = this._validateResponse(result,
|
|
179
|
+
const validated = await this._validateResponse(result, schema('CreateOrderResponseSchema'));
|
|
146
180
|
return this._normalizeData(validated);
|
|
147
181
|
}
|
|
148
182
|
/**
|
|
@@ -184,7 +218,7 @@ class OrdersApi extends asyncModules_1.default {
|
|
|
184
218
|
body.formData = formData;
|
|
185
219
|
const result = await this._fetchPut(`/marker/${marker}/orders/${id}?langCode=${langCode}`, body);
|
|
186
220
|
// Validate response if validation is enabled
|
|
187
|
-
const validated = this._validateResponse(result,
|
|
221
|
+
const validated = await this._validateResponse(result, schema('UpdateOrderResponseSchema'));
|
|
188
222
|
return this._normalizeData(validated);
|
|
189
223
|
}
|
|
190
224
|
/**
|
package/dist/pages/pagesApi.js
CHANGED
|
@@ -1,4 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
37
|
};
|
|
@@ -6,8 +39,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
39
|
/* eslint-disable jsdoc/reject-any-type */
|
|
7
40
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
8
41
|
const asyncModules_1 = __importDefault(require("../base/asyncModules"));
|
|
42
|
+
const lazySchema_1 = __importDefault(require("../base/lazySchema"));
|
|
9
43
|
const templatesApi_1 = __importDefault(require("../templates/templatesApi"));
|
|
10
|
-
const
|
|
44
|
+
const schema = (0, lazySchema_1.default)(() => Promise.resolve().then(() => __importStar(require('./pagesSchemas'))));
|
|
11
45
|
/**
|
|
12
46
|
* Controllers for working with page objects, including catalog pages
|
|
13
47
|
* @handle /api/content/pages
|
|
@@ -36,7 +70,7 @@ class PagesApi extends asyncModules_1.default {
|
|
|
36
70
|
// Fetch data from the server using a GET request to retrieve root pages for the specified language code
|
|
37
71
|
const data = await this._fetchGet(`/root?langCode=${langCode}`);
|
|
38
72
|
// Validate response if validation is enabled
|
|
39
|
-
const validated = this._validateResponse(data,
|
|
73
|
+
const validated = await this._validateResponse(data, schema('PagesResponseSchema'));
|
|
40
74
|
// Add template information to each page in the fetched root pages data
|
|
41
75
|
const withTemplate = await this.addTemplateToPages(validated);
|
|
42
76
|
// Normalize the data and return it; ensures consistent structure or handles errors
|
|
@@ -55,7 +89,7 @@ class PagesApi extends asyncModules_1.default {
|
|
|
55
89
|
// Fetch data from the server using a GET request to retrieve all pages for the specified language code
|
|
56
90
|
const data = await this._fetchGet(`?langCode=${langCode}`);
|
|
57
91
|
// Validate response if validation is enabled
|
|
58
|
-
const validated = this._validateResponse(data,
|
|
92
|
+
const validated = await this._validateResponse(data, schema('PagesResponseSchema'));
|
|
59
93
|
// Add template information to each page in the fetched data
|
|
60
94
|
const withTemplate = await this.addTemplateToPages(validated);
|
|
61
95
|
// Normalize the data and return it; ensures consistent structure or handles errors
|
|
@@ -75,7 +109,7 @@ class PagesApi extends asyncModules_1.default {
|
|
|
75
109
|
// Fetch data from the server using a GET request to retrieve page details by ID and language code
|
|
76
110
|
const data = await this._fetchGet(`/${id}?langCode=${langCode}`);
|
|
77
111
|
// Validate response if validation is enabled
|
|
78
|
-
const validated = this._validateResponse(data,
|
|
112
|
+
const validated = await this._validateResponse(data, schema('PageEntitySchema'));
|
|
79
113
|
// Add template information to the fetched page data
|
|
80
114
|
const withTemplate = await this.addTemplateToPage(validated);
|
|
81
115
|
// Normalize the data and return it; ensures consistent structure or handles errors
|
|
@@ -95,7 +129,7 @@ class PagesApi extends asyncModules_1.default {
|
|
|
95
129
|
// Fetch data from the server using a GET request with the specified URL and language code
|
|
96
130
|
const data = await this._fetchGet(`/url/${url}?langCode=${langCode}`);
|
|
97
131
|
// Validate response if validation is enabled
|
|
98
|
-
const validated = this._validateResponse(data,
|
|
132
|
+
const validated = await this._validateResponse(data, schema('PageEntitySchema'));
|
|
99
133
|
// Add template information to the fetched page data
|
|
100
134
|
const withTemplate = await this.addTemplateToPage(validated);
|
|
101
135
|
// Normalize the result data and return it; ensures consistent structure or handles errors
|
|
@@ -115,7 +149,7 @@ class PagesApi extends asyncModules_1.default {
|
|
|
115
149
|
// Fetch data from the server using a GET request to retrieve child pages for the specified parent URL and language code
|
|
116
150
|
const data = await this._fetchGet(`/${url}/children?langCode=${langCode}`);
|
|
117
151
|
// Validate response if validation is enabled
|
|
118
|
-
const validated = this._validateResponse(data,
|
|
152
|
+
const validated = await this._validateResponse(data, schema('PagesResponseSchema'));
|
|
119
153
|
// Add template information to each of the fetched child pages
|
|
120
154
|
const withTemplate = await this.addTemplateToPages(validated);
|
|
121
155
|
// Normalize the result data and return it; ensures consistent structure or handles errors
|
|
@@ -191,7 +225,7 @@ class PagesApi extends asyncModules_1.default {
|
|
|
191
225
|
// Fetch data from the server using a GET request to retrieve forms for the specified page URL and language code
|
|
192
226
|
const result = await this._fetchGet(`/${url}/config`);
|
|
193
227
|
// Validate response if validation is enabled
|
|
194
|
-
const validated = this._validateResponse(result,
|
|
228
|
+
const validated = await this._validateResponse(result, schema('PageConfigSchema'));
|
|
195
229
|
// return fetched data
|
|
196
230
|
return validated;
|
|
197
231
|
}
|
|
@@ -212,7 +246,7 @@ class PagesApi extends asyncModules_1.default {
|
|
|
212
246
|
const searchPages = await this._fetchGet(`/quick/search?${urlPart}lang=${encodeURIComponent(langCode)}&name=${encodeURIComponent(name)}`);
|
|
213
247
|
// /quick/search?url=catalog&langCode=en_US&name=cat
|
|
214
248
|
// Validate response if validation is enabled
|
|
215
|
-
const data = this._validateResponse(searchPages,
|
|
249
|
+
const data = (await this._validateResponse(searchPages, schema('PageSearchResponseSchema')));
|
|
216
250
|
// Check if there is no traffic limit set in the state
|
|
217
251
|
if (!this.state.traficLimit && Array.isArray(data)) {
|
|
218
252
|
// Initialize an empty array to store detailed page information
|
|
@@ -1,10 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
37
|
};
|
|
5
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
39
|
const asyncModules_1 = __importDefault(require("../base/asyncModules"));
|
|
7
|
-
const
|
|
40
|
+
const lazySchema_1 = __importDefault(require("../base/lazySchema"));
|
|
41
|
+
const schema = (0, lazySchema_1.default)(() => Promise.resolve().then(() => __importStar(require('./paymentsSchemas'))));
|
|
8
42
|
/**
|
|
9
43
|
* Controllers for working with payments
|
|
10
44
|
* @handle /api/content/payments
|
|
@@ -38,7 +72,7 @@ class PaymentsApi extends asyncModules_1.default {
|
|
|
38
72
|
};
|
|
39
73
|
const result = await this._fetchGet('/sessions/?' + this._queryParamsToString(query));
|
|
40
74
|
// Validate response if validation is enabled
|
|
41
|
-
const validated = this._validateResponse(result,
|
|
75
|
+
const validated = await this._validateResponse(result, schema('PaymentSessionsResponseSchema'));
|
|
42
76
|
return validated;
|
|
43
77
|
}
|
|
44
78
|
/**
|
|
@@ -68,7 +102,7 @@ class PaymentsApi extends asyncModules_1.default {
|
|
|
68
102
|
async getSessionByOrderId(id) {
|
|
69
103
|
const result = await this._fetchGet(`/sessions/order/${id}`);
|
|
70
104
|
// Validate response if validation is enabled
|
|
71
|
-
const validated = this._validateResponse(result,
|
|
105
|
+
const validated = await this._validateResponse(result, schema('SinglePaymentSessionSchema'));
|
|
72
106
|
return validated;
|
|
73
107
|
}
|
|
74
108
|
/**
|
|
@@ -90,7 +124,7 @@ class PaymentsApi extends asyncModules_1.default {
|
|
|
90
124
|
automaticTaxEnabled,
|
|
91
125
|
});
|
|
92
126
|
// Validate response if validation is enabled
|
|
93
|
-
const validated = this._validateResponse(result,
|
|
127
|
+
const validated = await this._validateResponse(result, schema('PaymentSessionSchema'));
|
|
94
128
|
return validated;
|
|
95
129
|
}
|
|
96
130
|
/**
|
|
@@ -105,7 +139,7 @@ class PaymentsApi extends asyncModules_1.default {
|
|
|
105
139
|
async getAccounts() {
|
|
106
140
|
const result = await this._fetchGet('/accounts');
|
|
107
141
|
// Validate response if validation is enabled
|
|
108
|
-
const validated = this._validateResponse(result,
|
|
142
|
+
const validated = await this._validateResponse(result, schema('PaymentAccountsResponseSchema'));
|
|
109
143
|
return this._normalizeData(validated);
|
|
110
144
|
}
|
|
111
145
|
/**
|