oneentry 1.0.124 → 1.0.125
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 +24 -22
- package/dist/admins/adminsApi.d.ts +17 -4
- package/dist/admins/adminsApi.js +16 -3
- package/dist/admins/adminsInterfaces.d.ts +47 -26
- package/dist/attribute-sets/attributeSetsApi.d.ts +10 -18
- package/dist/attribute-sets/attributeSetsApi.js +9 -17
- package/dist/attribute-sets/attributeSetsInterfaces.d.ts +92 -44
- package/dist/auth-provider/authProviderApi.d.ts +146 -36
- package/dist/auth-provider/authProviderApi.js +163 -37
- package/dist/auth-provider/authProvidersInterfaces.d.ts +189 -40
- package/dist/base/asyncModules.d.ts +7 -1
- package/dist/base/asyncModules.js +127 -21
- package/dist/base/result.js +23 -0
- package/dist/base/syncModules.d.ts +4 -0
- package/dist/base/syncModules.js +19 -1
- package/dist/base/utils.d.ts +1 -1
- package/dist/blocks/blocksApi.d.ts +7 -17
- package/dist/blocks/blocksApi.js +7 -17
- package/dist/blocks/blocksInterfaces.d.ts +77 -32
- package/dist/events/eventsApi.d.ts +7 -8
- package/dist/events/eventsApi.js +12 -7
- package/dist/events/eventsInterfaces.d.ts +16 -11
- package/dist/file-uploading/fileUploadingApi.d.ts +22 -14
- package/dist/file-uploading/fileUploadingApi.js +20 -12
- package/dist/file-uploading/fileUploadingInterfaces.d.ts +42 -18
- package/dist/forms/formsApi.d.ts +3 -7
- package/dist/forms/formsApi.js +2 -6
- package/dist/forms/formsInterfaces.d.ts +44 -28
- package/dist/formsData/formsDataApi.d.ts +21 -9
- package/dist/formsData/formsDataApi.js +21 -9
- package/dist/formsData/formsDataInterfaces.d.ts +128 -45
- package/dist/general-types/generalTypesApi.d.ts +1 -3
- package/dist/general-types/generalTypesApi.js +0 -2
- package/dist/general-types/generalTypesInterfaces.d.ts +2 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/integration-collections/integrationCollectionsApi.d.ts +74 -47
- package/dist/integration-collections/integrationCollectionsApi.js +64 -45
- package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +144 -63
- package/dist/locales/localesApi.d.ts +1 -2
- package/dist/locales/localesApi.js +1 -2
- package/dist/locales/localesInterfaces.d.ts +2 -4
- package/dist/menus/menusApi.d.ts +1 -3
- package/dist/menus/menusApi.js +1 -3
- package/dist/menus/menusInterfaces.d.ts +39 -13
- package/dist/orders/ordersApi.d.ts +36 -18
- package/dist/orders/ordersApi.js +40 -22
- package/dist/orders/ordersInterfaces.d.ts +163 -81
- package/dist/pages/pagesApi.d.ts +48 -48
- package/dist/pages/pagesApi.js +40 -45
- package/dist/pages/pagesInterfaces.d.ts +147 -98
- package/dist/payments/paymentsApi.d.ts +25 -45
- package/dist/payments/paymentsApi.js +27 -46
- package/dist/payments/paymentsInterfaces.d.ts +42 -60
- package/dist/product-statuses/productStatusesApi.d.ts +6 -12
- package/dist/product-statuses/productStatusesApi.js +5 -11
- package/dist/product-statuses/productStatusesInterfaces.d.ts +16 -15
- package/dist/products/productsApi.d.ts +256 -104
- package/dist/products/productsApi.js +263 -97
- package/dist/products/productsInterfaces.d.ts +343 -160
- package/dist/system/systemApi.d.ts +21 -10
- package/dist/system/systemApi.js +22 -8
- package/dist/system/systemInterfaces.d.ts +0 -1
- package/dist/templates/templatesApi.d.ts +6 -12
- package/dist/templates/templatesApi.js +4 -10
- package/dist/templates/templatesInterfaces.d.ts +20 -20
- package/dist/templates-preview/templatesPreviewApi.d.ts +2 -6
- package/dist/templates-preview/templatesPreviewApi.js +1 -5
- package/dist/templates-preview/templatesPreviewInterfaces.d.ts +50 -25
- package/dist/users/usersApi.d.ts +33 -13
- package/dist/users/usersApi.js +38 -15
- package/dist/users/usersInterfaces.d.ts +78 -27
- package/dist/web-socket/wsApi.d.ts +1 -5
- package/dist/web-socket/wsApi.js +1 -5
- package/dist/web-socket/wsInterfaces.d.ts +0 -1
- package/package.json +18 -16
|
@@ -4,7 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const asyncModules_1 = __importDefault(require("../base/asyncModules"));
|
|
7
|
-
// import { IProductInfo } from './productsInterfaces';
|
|
8
7
|
/**
|
|
9
8
|
* Controllers for working with product pages
|
|
10
9
|
* @handle /api/content/products
|
|
@@ -25,25 +24,46 @@ class ProductApi extends asyncModules_1.default {
|
|
|
25
24
|
*
|
|
26
25
|
* @handleName getProducts
|
|
27
26
|
*
|
|
28
|
-
* @param {
|
|
27
|
+
* @param {IFilterParams[]} [body] - Request body. Default: []. Example:
|
|
28
|
+
[
|
|
29
|
+
{
|
|
30
|
+
"attributeMarker": "price",
|
|
31
|
+
"conditionMarker": "mth",
|
|
32
|
+
"statusMarker": "waiting",
|
|
33
|
+
"conditionValue": 1,
|
|
34
|
+
"pageUrls": [
|
|
35
|
+
"23-laminat-floorwood-maxima"
|
|
36
|
+
],
|
|
37
|
+
"isNested": false,
|
|
38
|
+
"title": ""
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"attributeMarker": "price",
|
|
42
|
+
"conditionMarker": "lth",
|
|
43
|
+
"conditionValue": 3,
|
|
44
|
+
"pageUrls": [
|
|
45
|
+
"23-laminat-floorwood-maxima"
|
|
46
|
+
],
|
|
47
|
+
"isNested": false,
|
|
48
|
+
"title": ""
|
|
49
|
+
}
|
|
50
|
+
]
|
|
29
51
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
30
|
-
* @param {IProductsQuery} [userQuery] - Optional set query parameters.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
52
|
+
* @param {IProductsQuery} [userQuery] - Optional set query parameters. Example:
|
|
53
|
+
{
|
|
54
|
+
"limit": 30,
|
|
55
|
+
"offset": 0,
|
|
56
|
+
"sortOrder": "DESC",
|
|
57
|
+
"sortKey": "id",
|
|
58
|
+
"statusId": 123,
|
|
59
|
+
"statusMarker": "in_stock",
|
|
60
|
+
"conditionValue": "new",
|
|
61
|
+
"conditionMarker": "equals",
|
|
62
|
+
"attributeMarker": "color"
|
|
63
|
+
}
|
|
42
64
|
* @return {IProductsResponse} Array with ProductEntity objects
|
|
43
65
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
44
|
-
*
|
|
45
66
|
* @description Fetch products with optional filters and pagination.
|
|
46
|
-
*
|
|
47
67
|
*/
|
|
48
68
|
async getProducts(body = [], langCode = this.state.lang, userQuery) {
|
|
49
69
|
const query = {
|
|
@@ -60,21 +80,21 @@ class ProductApi extends asyncModules_1.default {
|
|
|
60
80
|
* @handleName getProductsEmptyPage
|
|
61
81
|
*
|
|
62
82
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
63
|
-
* @param {IProductsQuery} [userQuery] - Optional set query parameters.
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
83
|
+
* @param {IProductsQuery} [userQuery] - Optional set query parameters. Example:
|
|
84
|
+
{
|
|
85
|
+
"limit": 30,
|
|
86
|
+
"offset": 0,
|
|
87
|
+
"sortOrder": "DESC",
|
|
88
|
+
"sortKey": "id",
|
|
89
|
+
"statusId": 123,
|
|
90
|
+
"statusMarker": "in_stock",
|
|
91
|
+
"conditionValue": "new",
|
|
92
|
+
"conditionMarker": "equals",
|
|
93
|
+
"attributeMarker": "color"
|
|
94
|
+
}
|
|
74
95
|
* @return {IProductsResponse} Array with ProductEntity objects.
|
|
75
96
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
76
|
-
*
|
|
77
|
-
* @description Fetch products with optional filters and pagination.
|
|
97
|
+
* @description Search for all product page objects with pagination that do not have a category.
|
|
78
98
|
*/
|
|
79
99
|
async getProductsEmptyPage(langCode = this.state.lang, userQuery) {
|
|
80
100
|
const query = { ...this._defaultQuery, ...userQuery };
|
|
@@ -86,25 +106,47 @@ class ProductApi extends asyncModules_1.default {
|
|
|
86
106
|
*
|
|
87
107
|
* @handleName getProductsByPageId
|
|
88
108
|
*
|
|
89
|
-
* @param {number} id - Page id.
|
|
90
|
-
* @param {
|
|
109
|
+
* @param {number} id - Page id. Example: 2492.
|
|
110
|
+
* @param {IFilterParams[]} [body] - Request body. Default: []. Example:
|
|
111
|
+
[
|
|
112
|
+
{
|
|
113
|
+
"attributeMarker": "price",
|
|
114
|
+
"conditionMarker": "mth",
|
|
115
|
+
"statusMarker": "waiting",
|
|
116
|
+
"conditionValue": 1,
|
|
117
|
+
"pageUrls": [
|
|
118
|
+
"23-laminat-floorwood-maxima"
|
|
119
|
+
],
|
|
120
|
+
"isNested": false,
|
|
121
|
+
"title": ""
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"attributeMarker": "price",
|
|
125
|
+
"conditionMarker": "lth",
|
|
126
|
+
"conditionValue": 3,
|
|
127
|
+
"pageUrls": [
|
|
128
|
+
"23-laminat-floorwood-maxima"
|
|
129
|
+
],
|
|
130
|
+
"isNested": false,
|
|
131
|
+
"title": ""
|
|
132
|
+
}
|
|
133
|
+
]
|
|
91
134
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
92
|
-
* @param {IProductsQuery} [userQuery] - Optional set query parameters.
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
135
|
+
* @param {IProductsQuery} [userQuery] - Optional set query parameters. Example:
|
|
136
|
+
{
|
|
137
|
+
"limit": 30,
|
|
138
|
+
"offset": 0,
|
|
139
|
+
"sortOrder": "DESC",
|
|
140
|
+
"sortKey": "id",
|
|
141
|
+
"statusId": 123,
|
|
142
|
+
"statusMarker": "in_stock",
|
|
143
|
+
"conditionValue": "new",
|
|
144
|
+
"conditionMarker": "equals",
|
|
145
|
+
"attributeMarker": "color"
|
|
146
|
+
}
|
|
103
147
|
* @return {IProductsResponse} Array with ProductEntity objects
|
|
104
148
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
105
|
-
*
|
|
106
149
|
* @description Fetch products by page ID with optional filters and pagination.
|
|
107
|
-
*
|
|
108
150
|
*/
|
|
109
151
|
async getProductsByPageId(id, body = [], langCode = this.state.lang, userQuery) {
|
|
110
152
|
const query = { ...this._defaultQuery, ...userQuery };
|
|
@@ -116,23 +158,23 @@ class ProductApi extends asyncModules_1.default {
|
|
|
116
158
|
*
|
|
117
159
|
* @handleName getProductsPriceByPageUrl
|
|
118
160
|
*
|
|
119
|
-
* @param {string} [url] - Page url. Example:
|
|
161
|
+
* @param {string} [url] - Page url. Example: "23-laminat-floorwood-maxima".
|
|
120
162
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
121
|
-
* @param {IProductsQuery} [userQuery] - Optional set query parameters.
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
163
|
+
* @param {IProductsQuery} [userQuery] - Optional set query parameters. Example:
|
|
164
|
+
{
|
|
165
|
+
"limit": 30,
|
|
166
|
+
"offset": 0,
|
|
167
|
+
"sortOrder": "DESC",
|
|
168
|
+
"sortKey": "id",
|
|
169
|
+
"statusId": 123,
|
|
170
|
+
"statusMarker": "in_stock",
|
|
171
|
+
"conditionValue": "new",
|
|
172
|
+
"conditionMarker": "equals",
|
|
173
|
+
"attributeMarker": "color"
|
|
174
|
+
}
|
|
132
175
|
* @return {IProductsInfo} Array with ProductInformation objects.
|
|
133
176
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
134
|
-
*
|
|
135
|
-
* @description
|
|
177
|
+
* @description Search for information about products and prices for the selected category.
|
|
136
178
|
*/
|
|
137
179
|
async getProductsPriceByPageUrl(url, langCode = this.state.lang, userQuery) {
|
|
138
180
|
const query = {
|
|
@@ -148,25 +190,47 @@ class ProductApi extends asyncModules_1.default {
|
|
|
148
190
|
*
|
|
149
191
|
* @handleName getProductsByPageUrl
|
|
150
192
|
*
|
|
151
|
-
* @param {string} url - Page url.
|
|
152
|
-
* @param {
|
|
193
|
+
* @param {string} url - Page url. Example: "catalog".
|
|
194
|
+
* @param {IFilterParams[]} [body] - Request body. Default: []. Example:
|
|
195
|
+
[
|
|
196
|
+
{
|
|
197
|
+
"attributeMarker": "price",
|
|
198
|
+
"conditionMarker": "mth",
|
|
199
|
+
"statusMarker": "waiting",
|
|
200
|
+
"conditionValue": 1,
|
|
201
|
+
"pageUrls": [
|
|
202
|
+
"23-laminat-floorwood-maxima"
|
|
203
|
+
],
|
|
204
|
+
"isNested": false,
|
|
205
|
+
"title": ""
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"attributeMarker": "price",
|
|
209
|
+
"conditionMarker": "lth",
|
|
210
|
+
"conditionValue": 3,
|
|
211
|
+
"pageUrls": [
|
|
212
|
+
"23-laminat-floorwood-maxima"
|
|
213
|
+
],
|
|
214
|
+
"isNested": false,
|
|
215
|
+
"title": ""
|
|
216
|
+
}
|
|
217
|
+
]
|
|
153
218
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
154
|
-
* @param {IProductsQuery} [userQuery] - Optional set query parameters.
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
219
|
+
* @param {IProductsQuery} [userQuery] - Optional set query parameters. Example:
|
|
220
|
+
{
|
|
221
|
+
"limit": 30,
|
|
222
|
+
"offset": 0,
|
|
223
|
+
"sortOrder": "DESC",
|
|
224
|
+
"sortKey": "id",
|
|
225
|
+
"statusId": 123,
|
|
226
|
+
"statusMarker": "in_stock",
|
|
227
|
+
"conditionValue": "new",
|
|
228
|
+
"conditionMarker": "equals",
|
|
229
|
+
"attributeMarker": "color"
|
|
230
|
+
}
|
|
165
231
|
* @return {IProductsResponse} Array with ProductEntity objects.
|
|
166
232
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
167
|
-
*
|
|
168
233
|
* @description Search for all products with pagination for the selected category.
|
|
169
|
-
*
|
|
170
234
|
*/
|
|
171
235
|
async getProductsByPageUrl(url, body = [], langCode = this.state.lang, userQuery) {
|
|
172
236
|
const query = { ...this._defaultQuery, ...userQuery };
|
|
@@ -181,16 +245,25 @@ class ProductApi extends asyncModules_1.default {
|
|
|
181
245
|
*
|
|
182
246
|
* @param {number} [id] - Product page identifier for which to find relationship. Example: 12345.
|
|
183
247
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
184
|
-
* @param {IProductsQuery} [userQuery] - Optional set query parameters. Example:
|
|
185
|
-
|
|
186
|
-
|
|
248
|
+
* @param {IProductsQuery} [userQuery] - Optional set query parameters. Example:
|
|
249
|
+
{
|
|
250
|
+
"limit": 30,
|
|
251
|
+
"offset": 0,
|
|
252
|
+
"sortOrder": "DESC",
|
|
253
|
+
"sortKey": "id",
|
|
254
|
+
"statusId": 123,
|
|
255
|
+
"statusMarker": "in_stock",
|
|
256
|
+
"conditionValue": "new",
|
|
257
|
+
"conditionMarker": "equals",
|
|
258
|
+
"attributeMarker": "color"
|
|
259
|
+
}
|
|
187
260
|
* @param {number} [userQuery.limit] - Optional parameter for pagination. Default: 30.
|
|
188
|
-
* @param {
|
|
189
|
-
* @param {string} [userQuery.
|
|
261
|
+
* @param {number} [userQuery.offset] - Optional parameter for pagination. Default: 0.
|
|
262
|
+
* @param {string} [userQuery.sortOrder] - Optional sorting order "DESC" | "ASC". Example: "DESC".
|
|
263
|
+
* @param {string} [userQuery.sortKey] - Optional field to sort by ("id", "title", "date", "price", "position", "status"). Example: "id".
|
|
190
264
|
*
|
|
191
265
|
* @return {IProductsResponse} Array with ProductEntity objects
|
|
192
266
|
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
193
|
-
*
|
|
194
267
|
* @description Find all related product page objects.
|
|
195
268
|
*/
|
|
196
269
|
async getRelatedProductsById(id, langCode = this.state.lang, userQuery) {
|
|
@@ -203,18 +276,31 @@ class ProductApi extends asyncModules_1.default {
|
|
|
203
276
|
*
|
|
204
277
|
* @handleName getProductsByIds
|
|
205
278
|
*
|
|
206
|
-
* @param {string} [ids] - Product page identifiers for which to find relationships. Example:
|
|
279
|
+
* @param {string} [ids] - Product page identifiers for which to find relationships. Example: "12345,67890".
|
|
207
280
|
* @param {string} [langCode] - Language code. Default "en_US".
|
|
208
|
-
* @param {IProductsQuery} [userQuery] - Optional set query parameters. Example:
|
|
209
|
-
|
|
210
|
-
|
|
281
|
+
* @param {IProductsQuery} [userQuery] - Optional set query parameters. Example:
|
|
282
|
+
{
|
|
283
|
+
"limit": 30,
|
|
284
|
+
"offset": 0,
|
|
285
|
+
"sortOrder": "DESC",
|
|
286
|
+
"sortKey": "id",
|
|
287
|
+
"statusId": 123,
|
|
288
|
+
"statusMarker": "in_stock",
|
|
289
|
+
"conditionValue": "new",
|
|
290
|
+
"conditionMarker": "equals",
|
|
291
|
+
"attributeMarker": "color"
|
|
292
|
+
}
|
|
211
293
|
* @param {number} [userQuery.limit] - Optional parameter for pagination. Default: 30.
|
|
212
|
-
* @param {
|
|
213
|
-
* @param {string} [userQuery.
|
|
214
|
-
*
|
|
215
|
-
* @
|
|
294
|
+
* @param {number} [userQuery.offset] - Optional parameter for pagination. Default: 0.
|
|
295
|
+
* @param {string} [userQuery.sortOrder] - Optional sorting order "DESC" | "ASC". Example: "DESC".
|
|
296
|
+
* @param {string} [userQuery.sortKey] - Optional field to sort by ("id", "title", "date", "price", "position", "status"). Example: "id".
|
|
297
|
+
* @param {number} [userQuery.statusId] - Optional parameter - search by status id. Example: 123.
|
|
298
|
+
* @param {string} [userQuery.statusMarker] - Optional identifier of the product page status. Example: "in_stock".
|
|
299
|
+
* @param {string} [userQuery.conditionValue] - Optional value that is being searched. Example: "new".
|
|
300
|
+
* @param {string} [userQuery.conditionMarker] - Optional identifier of the filter condition by which values are filtered. Example: "equals".
|
|
301
|
+
* @param {string} [userQuery.attributeMarker] - Optional text identifier of the indexed attribute by which values are filtered. Example: "color".
|
|
302
|
+
* @return {IProductsEntity[]} Array with ProductEntity objects
|
|
216
303
|
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
217
|
-
*
|
|
218
304
|
* @description Find products by its ids.
|
|
219
305
|
*/
|
|
220
306
|
async getProductsByIds(ids, langCode = this.state.lang, userQuery) {
|
|
@@ -234,10 +320,8 @@ class ProductApi extends asyncModules_1.default {
|
|
|
234
320
|
*
|
|
235
321
|
* @param {number} [id] - Product id. Example: 12345.
|
|
236
322
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
237
|
-
*
|
|
238
|
-
* @return {IProductEntity} ProductEntity object.
|
|
323
|
+
* @return {IProductsEntity} ProductEntity object.
|
|
239
324
|
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
240
|
-
*
|
|
241
325
|
* @description Retrieve one product object.
|
|
242
326
|
*/
|
|
243
327
|
async getProductById(id, langCode = this.state.lang) {
|
|
@@ -250,10 +334,8 @@ class ProductApi extends asyncModules_1.default {
|
|
|
250
334
|
* @handleName getProductBlockById
|
|
251
335
|
*
|
|
252
336
|
* @param {number} id - Product id. Example: 12345.
|
|
253
|
-
*
|
|
254
|
-
* @return {IProductBlock}
|
|
337
|
+
* @return {IProductBlock} - Product block object.
|
|
255
338
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
256
|
-
*
|
|
257
339
|
* @description Getting a product block object by product id.
|
|
258
340
|
*/
|
|
259
341
|
async getProductBlockById(id) {
|
|
@@ -265,12 +347,10 @@ class ProductApi extends asyncModules_1.default {
|
|
|
265
347
|
*
|
|
266
348
|
* @handleName searchProduct
|
|
267
349
|
*
|
|
268
|
-
* @param {string} name - Text to search product page objects (search is based on the title field of the localizeInfos object with language consideration). Example:
|
|
350
|
+
* @param {string} name - Text to search product page objects (search is based on the title field of the localizeInfos object with language consideration). Example: "laminat".
|
|
269
351
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
270
|
-
*
|
|
271
352
|
* @return {IProductsEntity[]} Array with ProductEntity objects
|
|
272
353
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
273
|
-
*
|
|
274
354
|
* @description Quick search for product page objects with limited output.
|
|
275
355
|
*/
|
|
276
356
|
async searchProduct(name, langCode = this.state.lang) {
|
|
@@ -287,5 +367,91 @@ class ProductApi extends asyncModules_1.default {
|
|
|
287
367
|
}
|
|
288
368
|
return searchProducts;
|
|
289
369
|
}
|
|
370
|
+
/**
|
|
371
|
+
* Getting the number of products for the entire catalog.
|
|
372
|
+
*
|
|
373
|
+
* @handleName getProductsCount
|
|
374
|
+
*
|
|
375
|
+
* @param {any[]} body - Body parameters for filter. Deault: []. Example:
|
|
376
|
+
[
|
|
377
|
+
{
|
|
378
|
+
"attributeMarker": "price",
|
|
379
|
+
"conditionMarker": "in",
|
|
380
|
+
"statusMarker": "status_1",
|
|
381
|
+
"conditionValue": {},
|
|
382
|
+
"pageUrls": [
|
|
383
|
+
"23-laminat-floorwood-maxima"
|
|
384
|
+
],
|
|
385
|
+
"title": "Iphone 17 Pro"
|
|
386
|
+
}
|
|
387
|
+
]
|
|
388
|
+
* @return {IProductsCount} Object with product items count.
|
|
389
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
390
|
+
* @description This method calculates and returns the total number of products present across the entire catalog, optionally applying specified filters.
|
|
391
|
+
*/
|
|
392
|
+
async getProductsCount(
|
|
393
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
394
|
+
body = []) {
|
|
395
|
+
const result = await this._fetchPost(`/all/counts`, body);
|
|
396
|
+
return result;
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* Getting the number of products on a catalog page by page ID.
|
|
400
|
+
*
|
|
401
|
+
* @handleName getProductsCountByPageId
|
|
402
|
+
*
|
|
403
|
+
* @param {string} id
|
|
404
|
+
* @param {any[]} body - Body parameters for filter. Deault: []. Example:
|
|
405
|
+
[
|
|
406
|
+
{
|
|
407
|
+
"attributeMarker": "price",
|
|
408
|
+
"conditionMarker": "in",
|
|
409
|
+
"statusMarker": "status_1",
|
|
410
|
+
"conditionValue": {},
|
|
411
|
+
"pageUrls": [
|
|
412
|
+
"23-laminat-floorwood-maxima"
|
|
413
|
+
],
|
|
414
|
+
"title": "Iphone 17 Pro"
|
|
415
|
+
}
|
|
416
|
+
]
|
|
417
|
+
* @return {IProductsCount} Object with product items count.
|
|
418
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
419
|
+
* @description This method calculates and returns the number of products available on a given catalog page, identified by its page ID, with optional filtering.
|
|
420
|
+
*/
|
|
421
|
+
async getProductsCountByPageId(id,
|
|
422
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
423
|
+
body = []) {
|
|
424
|
+
const result = await this._fetchPost(`/page/${id}/counts`, body);
|
|
425
|
+
return result;
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* Getting the number of products for the catalog page by page url.
|
|
429
|
+
*
|
|
430
|
+
* @handleName getProductsCountByPageUrl
|
|
431
|
+
*
|
|
432
|
+
* @param {string} url -
|
|
433
|
+
* @param {any[]} body - Body parameters for filter. Deault: []. Example:
|
|
434
|
+
[
|
|
435
|
+
{
|
|
436
|
+
"attributeMarker": "price",
|
|
437
|
+
"conditionMarker": "in",
|
|
438
|
+
"statusMarker": "status_1",
|
|
439
|
+
"conditionValue": {},
|
|
440
|
+
"pageUrls": [
|
|
441
|
+
"23-laminat-floorwood-maxima"
|
|
442
|
+
],
|
|
443
|
+
"title": "Iphone 17 Pro"
|
|
444
|
+
}
|
|
445
|
+
]
|
|
446
|
+
* @return {IProductsCount} Object with product items count.
|
|
447
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
448
|
+
* @description This method calculates and returns the number of products available on a given catalog page, identified by its URL, with optional filtering.
|
|
449
|
+
*/
|
|
450
|
+
async getProductsCountByPageUrl(url,
|
|
451
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
452
|
+
body = []) {
|
|
453
|
+
const result = await this._fetchPost(`/page/url/${url}/counts`, body);
|
|
454
|
+
return result;
|
|
455
|
+
}
|
|
290
456
|
}
|
|
291
457
|
exports.default = ProductApi;
|