oneentry 1.0.123 → 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 +30 -9
- package/dist/admins/adminsApi.js +30 -9
- package/dist/admins/adminsInterfaces.d.ts +77 -32
- package/dist/attribute-sets/attributeSetsApi.d.ts +36 -22
- package/dist/attribute-sets/attributeSetsApi.js +41 -25
- package/dist/attribute-sets/attributeSetsInterfaces.d.ts +133 -39
- package/dist/auth-provider/authProviderApi.d.ts +209 -88
- package/dist/auth-provider/authProviderApi.js +226 -87
- package/dist/auth-provider/authProvidersInterfaces.d.ts +345 -18
- package/dist/base/asyncModules.d.ts +38 -28
- package/dist/base/asyncModules.js +178 -47
- package/dist/base/result.js +23 -0
- package/dist/base/syncModules.d.ts +48 -44
- package/dist/base/syncModules.js +84 -64
- package/dist/base/utils.d.ts +1 -1
- package/dist/blocks/blocksApi.d.ts +48 -27
- package/dist/blocks/blocksApi.js +48 -27
- package/dist/blocks/blocksInterfaces.d.ts +126 -32
- package/dist/events/eventsApi.d.ts +45 -12
- package/dist/events/eventsApi.js +47 -12
- package/dist/events/eventsInterfaces.d.ts +50 -3
- package/dist/file-uploading/fileUploadingApi.d.ts +57 -29
- package/dist/file-uploading/fileUploadingApi.js +57 -30
- package/dist/file-uploading/fileUploadingInterfaces.d.ts +90 -17
- package/dist/forms/formsApi.d.ts +20 -9
- package/dist/forms/formsApi.js +19 -8
- package/dist/forms/formsInterfaces.d.ts +86 -23
- package/dist/formsData/formsDataApi.d.ts +33 -21
- package/dist/formsData/formsDataApi.js +33 -21
- package/dist/formsData/formsDataInterfaces.d.ts +212 -41
- package/dist/general-types/generalTypesApi.d.ts +11 -2
- package/dist/general-types/generalTypesApi.js +10 -1
- package/dist/general-types/generalTypesInterfaces.d.ts +17 -6
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/integration-collections/integrationCollectionsApi.d.ts +134 -81
- package/dist/integration-collections/integrationCollectionsApi.js +135 -83
- package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +246 -43
- package/dist/locales/localesApi.d.ts +5 -1
- package/dist/locales/localesApi.js +5 -1
- package/dist/locales/localesInterfaces.d.ts +19 -12
- package/dist/menus/menusApi.d.ts +6 -3
- package/dist/menus/menusApi.js +6 -3
- package/dist/menus/menusInterfaces.d.ts +60 -21
- package/dist/orders/ordersApi.d.ts +84 -66
- package/dist/orders/ordersApi.js +91 -71
- package/dist/orders/ordersInterfaces.d.ts +282 -86
- package/dist/pages/pagesApi.d.ts +101 -42
- package/dist/pages/pagesApi.js +93 -39
- package/dist/pages/pagesInterfaces.d.ts +218 -75
- package/dist/payments/paymentsApi.d.ts +53 -39
- package/dist/payments/paymentsApi.js +55 -40
- package/dist/payments/paymentsInterfaces.d.ts +121 -56
- package/dist/product-statuses/productStatusesApi.d.ts +17 -17
- package/dist/product-statuses/productStatusesApi.js +16 -19
- package/dist/product-statuses/productStatusesInterfaces.d.ts +43 -14
- package/dist/products/productsApi.d.ts +309 -177
- package/dist/products/productsApi.js +313 -167
- package/dist/products/productsInterfaces.d.ts +447 -81
- package/dist/system/systemApi.d.ts +42 -12
- package/dist/system/systemApi.js +43 -10
- package/dist/system/systemInterfaces.d.ts +7 -0
- package/dist/templates/templatesApi.d.ts +24 -20
- package/dist/templates/templatesApi.js +22 -21
- package/dist/templates/templatesInterfaces.d.ts +48 -22
- package/dist/templates-preview/templatesPreviewApi.d.ts +17 -17
- package/dist/templates-preview/templatesPreviewApi.js +16 -19
- package/dist/templates-preview/templatesPreviewInterfaces.d.ts +85 -32
- package/dist/users/usersApi.d.ts +59 -35
- package/dist/users/usersApi.js +62 -35
- package/dist/users/usersInterfaces.d.ts +136 -14
- package/dist/web-socket/wsApi.d.ts +4 -5
- package/dist/web-socket/wsApi.js +4 -5
- package/dist/web-socket/wsInterfaces.d.ts +2 -1
- package/package.json +20 -18
|
@@ -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
|
|
@@ -23,46 +22,48 @@ class ProductApi extends asyncModules_1.default {
|
|
|
23
22
|
/**
|
|
24
23
|
* Search for all products with pagination and filter.
|
|
25
24
|
*
|
|
26
|
-
* @
|
|
27
|
-
* @param {string} [langCode] - Language code parameter. Default "en_US"
|
|
28
|
-
* @param {IProductsQuery} [userQuery] - Optional set query parameters.
|
|
25
|
+
* @handleName getProducts
|
|
29
26
|
*
|
|
30
|
-
* @param {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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
|
+
]
|
|
51
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
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
|
+
}
|
|
64
|
+
* @return {IProductsResponse} Array with ProductEntity objects
|
|
65
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
66
|
+
* @description Fetch products with optional filters and pagination.
|
|
66
67
|
*/
|
|
67
68
|
async getProducts(body = [], langCode = this.state.lang, userQuery) {
|
|
68
69
|
const query = {
|
|
@@ -76,19 +77,24 @@ class ProductApi extends asyncModules_1.default {
|
|
|
76
77
|
/**
|
|
77
78
|
* Search for all product page objects with pagination that do not have a category.
|
|
78
79
|
*
|
|
79
|
-
* @
|
|
80
|
-
* @param {IProductsQuery} [userQuery] - Optional set query parameters.
|
|
80
|
+
* @handleName getProductsEmptyPage
|
|
81
81
|
*
|
|
82
|
-
* @param {
|
|
83
|
-
* @param {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
82
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
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
|
+
}
|
|
95
|
+
* @return {IProductsResponse} Array with ProductEntity objects.
|
|
96
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
97
|
+
* @description Search for all product page objects with pagination that do not have a category.
|
|
92
98
|
*/
|
|
93
99
|
async getProductsEmptyPage(langCode = this.state.lang, userQuery) {
|
|
94
100
|
const query = { ...this._defaultQuery, ...userQuery };
|
|
@@ -98,46 +104,49 @@ class ProductApi extends asyncModules_1.default {
|
|
|
98
104
|
/**
|
|
99
105
|
* Search for all products with pagination for the selected category.
|
|
100
106
|
*
|
|
101
|
-
* @
|
|
102
|
-
* @param {Array<IFilterParams>} body - Request body.
|
|
103
|
-
* @param {string} [langCode] - Language code parameter. Default "en_US"
|
|
104
|
-
* @param {IProductsQuery} [userQuery] - Optional set query parameters.
|
|
107
|
+
* @handleName getProductsByPageId
|
|
105
108
|
*
|
|
106
|
-
* @param {number}
|
|
107
|
-
* @param {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
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
|
+
]
|
|
134
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
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
|
+
}
|
|
147
|
+
* @return {IProductsResponse} Array with ProductEntity objects
|
|
148
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
149
|
+
* @description Fetch products by page ID with optional filters and pagination.
|
|
141
150
|
*/
|
|
142
151
|
async getProductsByPageId(id, body = [], langCode = this.state.lang, userQuery) {
|
|
143
152
|
const query = { ...this._defaultQuery, ...userQuery };
|
|
@@ -147,20 +156,25 @@ class ProductApi extends asyncModules_1.default {
|
|
|
147
156
|
/**
|
|
148
157
|
* Search for information about products and prices for the selected category.
|
|
149
158
|
*
|
|
150
|
-
* @
|
|
151
|
-
* @param {string} [langCode] - Language code.
|
|
152
|
-
* @param {IProductsQuery} [userQuery] - Optional set query parameters.
|
|
153
|
-
*
|
|
154
|
-
* @param {number} [userQuery.offset] - Optional parameter for pagination, default is 30
|
|
155
|
-
* @param {number} [userQuery.limit] - Optional parameter for pagination, default is 0
|
|
156
|
-
* @param {string} [userQuery.statusMarker] - Optional identifier of the product page status
|
|
157
|
-
* @param {string} [userQuery.conditionValue] - Optional value that is being searched
|
|
158
|
-
* @param {string} [userQuery.conditionMarker] - Optional identifier of the filter condition by which values are filtered
|
|
159
|
-
* @param {string} [userQuery.attributeMarker] - Optional text identifier of the indexed attribute by which values are filtered
|
|
160
|
-
* @param {string} [userQuery.sortOrder] - Optional sorting order DESC | ASC
|
|
161
|
-
* @param {string} [userQuery.sortKey] - Optional field to sort by (id, title, date, price, position, status)
|
|
159
|
+
* @handleName getProductsPriceByPageUrl
|
|
162
160
|
*
|
|
163
|
-
* @
|
|
161
|
+
* @param {string} [url] - Page url. Example: "23-laminat-floorwood-maxima".
|
|
162
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
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
|
+
}
|
|
175
|
+
* @return {IProductsInfo} Array with ProductInformation objects.
|
|
176
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
177
|
+
* @description Search for information about products and prices for the selected category.
|
|
164
178
|
*/
|
|
165
179
|
async getProductsPriceByPageUrl(url, langCode = this.state.lang, userQuery) {
|
|
166
180
|
const query = {
|
|
@@ -174,46 +188,49 @@ class ProductApi extends asyncModules_1.default {
|
|
|
174
188
|
/**
|
|
175
189
|
* Search for all products with pagination for the selected category.
|
|
176
190
|
*
|
|
177
|
-
* @
|
|
178
|
-
* @param {Array<IFilterParams>} [body] - Request body.
|
|
179
|
-
* @param {string} [langCode] - Language code parameter. Default "en_US"
|
|
180
|
-
* @param {IProductsQuery} [userQuery] - Optional set query parameters.
|
|
181
|
-
*
|
|
182
|
-
* @param {number} [userQuery.offset] - Optional parameter for pagination, default is 30
|
|
183
|
-
* @param {number} [userQuery.limit] - Optional parameter for pagination, default is 0
|
|
184
|
-
* @param {string} [userQuery.statusMarker] - Optional identifier of the product page status
|
|
185
|
-
* @param {string} [userQuery.conditionValue] - Optional value that is being searched
|
|
186
|
-
* @param {string} [userQuery.conditionMarker] - Optional identifier of the filter condition by which values are filtered
|
|
187
|
-
* @param {string} [userQuery.attributeMarker] - Optional text identifier of the indexed attribute by which values are filtered
|
|
188
|
-
* @param {string} [userQuery.sortOrder] - Optional sorting order DESC | ASC
|
|
189
|
-
* @param {string} [userQuery.sortKey] - Optional field to sort by (id, title, date, price, position, status)
|
|
190
|
-
*
|
|
191
|
-
* @example
|
|
192
|
-
* const body = [
|
|
193
|
-
* {
|
|
194
|
-
* "attributeMarker": "price",
|
|
195
|
-
* "conditionMarker": "mth",
|
|
196
|
-
* "statusMarker": "waiting",
|
|
197
|
-
* "conditionValue": 1,
|
|
198
|
-
* "pageUrls": [
|
|
199
|
-
* "23-laminat-floorwood-maxima"
|
|
200
|
-
* ],
|
|
201
|
-
* "isNested": false,
|
|
202
|
-
* "title": ""
|
|
203
|
-
* },
|
|
204
|
-
* {
|
|
205
|
-
* "attributeMarker": "price",
|
|
206
|
-
* "conditionMarker": "lth",
|
|
207
|
-
* "conditionValue": 3,
|
|
208
|
-
* "pageUrls": [
|
|
209
|
-
* "23-laminat-floorwood-maxima"
|
|
210
|
-
* ],
|
|
211
|
-
* "isNested": false,
|
|
212
|
-
* "title": ""
|
|
213
|
-
* }
|
|
214
|
-
* ]
|
|
191
|
+
* @handleName getProductsByPageUrl
|
|
215
192
|
*
|
|
216
|
-
* @
|
|
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
|
+
]
|
|
218
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
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
|
+
}
|
|
231
|
+
* @return {IProductsResponse} Array with ProductEntity objects.
|
|
232
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
233
|
+
* @description Search for all products with pagination for the selected category.
|
|
217
234
|
*/
|
|
218
235
|
async getProductsByPageUrl(url, body = [], langCode = this.state.lang, userQuery) {
|
|
219
236
|
const query = { ...this._defaultQuery, ...userQuery };
|
|
@@ -224,16 +241,30 @@ class ProductApi extends asyncModules_1.default {
|
|
|
224
241
|
/**
|
|
225
242
|
* Find all related product page objects.
|
|
226
243
|
*
|
|
227
|
-
* @
|
|
228
|
-
* @param {string} [langCode] - Language code parameter. Default "en_US"
|
|
229
|
-
* @param {IProductsQuery} [userQuery] - Optional set query parameters.
|
|
244
|
+
* @handleName getRelatedProductsById
|
|
230
245
|
*
|
|
231
|
-
* @param {number} [
|
|
232
|
-
* @param {
|
|
233
|
-
* @param {
|
|
234
|
-
|
|
246
|
+
* @param {number} [id] - Product page identifier for which to find relationship. Example: 12345.
|
|
247
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
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
|
+
}
|
|
260
|
+
* @param {number} [userQuery.limit] - Optional parameter for pagination. Default: 30.
|
|
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".
|
|
235
264
|
*
|
|
236
|
-
* @
|
|
265
|
+
* @return {IProductsResponse} Array with ProductEntity objects
|
|
266
|
+
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
267
|
+
* @description Find all related product page objects.
|
|
237
268
|
*/
|
|
238
269
|
async getRelatedProductsById(id, langCode = this.state.lang, userQuery) {
|
|
239
270
|
const query = { ...this._defaultQuery, ...userQuery };
|
|
@@ -243,16 +274,34 @@ class ProductApi extends asyncModules_1.default {
|
|
|
243
274
|
/**
|
|
244
275
|
* Find products by its ids.
|
|
245
276
|
*
|
|
246
|
-
* @
|
|
247
|
-
* @param {string} [langCode] - Language code parameter. Default "en_US"
|
|
248
|
-
* @param {IProductsQuery} [userQuery] - Optional set query parameters.
|
|
277
|
+
* @handleName getProductsByIds
|
|
249
278
|
*
|
|
250
|
-
* @param {
|
|
251
|
-
* @param {
|
|
252
|
-
* @param {
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
279
|
+
* @param {string} [ids] - Product page identifiers for which to find relationships. Example: "12345,67890".
|
|
280
|
+
* @param {string} [langCode] - Language code. Default "en_US".
|
|
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
|
+
}
|
|
293
|
+
* @param {number} [userQuery.limit] - Optional parameter for pagination. Default: 30.
|
|
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
|
|
303
|
+
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
304
|
+
* @description Find products by its ids.
|
|
256
305
|
*/
|
|
257
306
|
async getProductsByIds(ids, langCode = this.state.lang, userQuery) {
|
|
258
307
|
const query = {
|
|
@@ -267,10 +316,13 @@ class ProductApi extends asyncModules_1.default {
|
|
|
267
316
|
/**
|
|
268
317
|
* Retrieve one product object.
|
|
269
318
|
*
|
|
270
|
-
* @
|
|
271
|
-
* @param {string} [langCode] - Language code parameter. Default "en_US".
|
|
319
|
+
* @handleName getProductById
|
|
272
320
|
*
|
|
273
|
-
* @
|
|
321
|
+
* @param {number} [id] - Product id. Example: 12345.
|
|
322
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
323
|
+
* @return {IProductsEntity} ProductEntity object.
|
|
324
|
+
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
325
|
+
* @description Retrieve one product object.
|
|
274
326
|
*/
|
|
275
327
|
async getProductById(id, langCode = this.state.lang) {
|
|
276
328
|
const result = await this._fetchGet(`/${id}?langCode=${langCode}`);
|
|
@@ -279,7 +331,12 @@ class ProductApi extends asyncModules_1.default {
|
|
|
279
331
|
/**
|
|
280
332
|
* Getting a product block object by product id.
|
|
281
333
|
*
|
|
282
|
-
* @
|
|
334
|
+
* @handleName getProductBlockById
|
|
335
|
+
*
|
|
336
|
+
* @param {number} id - Product id. Example: 12345.
|
|
337
|
+
* @return {IProductBlock} - Product block object.
|
|
338
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
339
|
+
* @description Getting a product block object by product id.
|
|
283
340
|
*/
|
|
284
341
|
async getProductBlockById(id) {
|
|
285
342
|
const response = await this._fetchGet(`/${id}/blocks`);
|
|
@@ -288,10 +345,13 @@ class ProductApi extends asyncModules_1.default {
|
|
|
288
345
|
/**
|
|
289
346
|
* Quick search for product page objects with limited output.
|
|
290
347
|
*
|
|
291
|
-
* @
|
|
292
|
-
* @param {string} [langCode] - Language code
|
|
348
|
+
* @handleName searchProduct
|
|
293
349
|
*
|
|
294
|
-
* @
|
|
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".
|
|
351
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
352
|
+
* @return {IProductsEntity[]} Array with ProductEntity objects
|
|
353
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
354
|
+
* @description Quick search for product page objects with limited output.
|
|
295
355
|
*/
|
|
296
356
|
async searchProduct(name, langCode = this.state.lang) {
|
|
297
357
|
const searchProducts = await this._fetchGet(`/quick/search?langCode=${langCode}&name=${name}`);
|
|
@@ -307,5 +367,91 @@ class ProductApi extends asyncModules_1.default {
|
|
|
307
367
|
}
|
|
308
368
|
return searchProducts;
|
|
309
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
|
+
}
|
|
310
456
|
}
|
|
311
457
|
exports.default = ProductApi;
|