oneentry 1.0.126 → 1.0.128
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 +0 -2
- package/configure.js +25 -18
- package/dist/admins/adminsApi.d.ts +18 -13
- package/dist/admins/adminsApi.js +18 -13
- package/dist/admins/adminsInterfaces.d.ts +16 -25
- package/dist/attribute-sets/attributeSetsApi.d.ts +14 -15
- package/dist/attribute-sets/attributeSetsApi.js +14 -15
- package/dist/attribute-sets/attributeSetsInterfaces.d.ts +78 -84
- package/dist/auth-provider/authProviderApi.d.ts +53 -79
- package/dist/auth-provider/authProviderApi.js +52 -78
- package/dist/auth-provider/authProvidersInterfaces.d.ts +98 -94
- package/dist/base/asyncModules.d.ts +23 -21
- package/dist/base/asyncModules.js +39 -29
- package/dist/base/result.d.ts +31 -0
- package/dist/base/result.js +32 -5
- package/dist/base/stateModule.d.ts +10 -0
- package/dist/base/stateModule.js +50 -2
- package/dist/base/syncModules.d.ts +42 -50
- package/dist/base/syncModules.js +106 -58
- package/dist/base/utils.d.ts +33 -2
- package/dist/blocks/blocksApi.d.ts +9 -18
- package/dist/blocks/blocksApi.js +9 -18
- package/dist/blocks/blocksInterfaces.d.ts +41 -46
- package/dist/config.d.ts +13 -0
- package/dist/config.js +30 -0
- package/dist/events/eventsApi.d.ts +10 -27
- package/dist/events/eventsApi.js +26 -40
- package/dist/events/eventsInterfaces.d.ts +33 -28
- package/dist/file-uploading/fileUploadingApi.d.ts +12 -17
- package/dist/file-uploading/fileUploadingApi.js +14 -17
- package/dist/file-uploading/fileUploadingInterfaces.d.ts +8 -19
- package/dist/forms/formsApi.d.ts +10 -9
- package/dist/forms/formsApi.js +10 -9
- package/dist/forms/formsInterfaces.d.ts +20 -12
- package/dist/forms-data/formsDataApi.d.ts +24 -28
- package/dist/forms-data/formsDataApi.js +25 -28
- package/dist/forms-data/formsDataInterfaces.d.ts +71 -71
- package/dist/general-types/generalTypesApi.d.ts +5 -5
- package/dist/general-types/generalTypesApi.js +5 -5
- package/dist/general-types/generalTypesInterfaces.d.ts +5 -8
- package/dist/index.d.ts +3 -4
- package/dist/index.js +3 -4
- package/dist/integration-collections/integrationCollectionsApi.d.ts +29 -47
- package/dist/integration-collections/integrationCollectionsApi.js +31 -51
- package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +62 -58
- package/dist/locales/localesApi.d.ts +7 -3
- package/dist/locales/localesApi.js +7 -3
- package/dist/locales/localesInterfaces.d.ts +6 -5
- package/dist/menus/menusApi.d.ts +7 -3
- package/dist/menus/menusApi.js +7 -3
- package/dist/menus/menusInterfaces.d.ts +5 -10
- package/dist/menus/menusInterfaces.js +1 -0
- package/dist/orders/ordersApi.d.ts +17 -25
- package/dist/orders/ordersApi.js +17 -26
- package/dist/orders/ordersInterfaces.d.ts +94 -53
- package/dist/pages/pagesApi.d.ts +47 -60
- package/dist/pages/pagesApi.js +51 -61
- package/dist/pages/pagesInterfaces.d.ts +44 -48
- package/dist/payments/paymentsApi.d.ts +17 -27
- package/dist/payments/paymentsApi.js +17 -31
- package/dist/payments/paymentsInterfaces.d.ts +35 -29
- package/dist/product-statuses/productStatusesApi.d.ts +9 -9
- package/dist/product-statuses/productStatusesApi.js +9 -9
- package/dist/product-statuses/productStatusesInterfaces.d.ts +14 -12
- package/dist/products/productsApi.d.ts +23 -44
- package/dist/products/productsApi.js +24 -44
- package/dist/products/productsInterfaces.d.ts +51 -57
- package/dist/system/systemApi.d.ts +11 -13
- package/dist/system/systemApi.js +12 -13
- package/dist/system/systemInterfaces.d.ts +14 -3
- package/dist/templates/templatesApi.d.ts +8 -11
- package/dist/templates/templatesApi.js +8 -11
- package/dist/templates/templatesInterfaces.d.ts +13 -12
- package/dist/templates-preview/templatesPreviewApi.d.ts +7 -8
- package/dist/templates-preview/templatesPreviewApi.js +7 -8
- package/dist/templates-preview/templatesPreviewInterfaces.d.ts +15 -18
- package/dist/users/usersApi.d.ts +13 -20
- package/dist/users/usersApi.js +13 -20
- package/dist/users/usersInterfaces.d.ts +26 -30
- package/dist/web-socket/wsApi.d.ts +5 -3
- package/dist/web-socket/wsApi.js +6 -3
- package/dist/web-socket/wsInterfaces.d.ts +7 -2
- package/package.json +16 -12
|
@@ -2,26 +2,25 @@ import type { IFormConfig } from 'forms/formsInterfaces';
|
|
|
2
2
|
import type { AttributeType, IError, ILocalizeInfo, LangType, Types } from '../base/utils';
|
|
3
3
|
/**
|
|
4
4
|
* @interface IProductApi
|
|
5
|
-
*
|
|
6
|
-
* @property {
|
|
7
|
-
* @property {
|
|
8
|
-
* @property {
|
|
9
|
-
* @property {
|
|
10
|
-
* @property {
|
|
11
|
-
* @property {
|
|
12
|
-
* @property {
|
|
13
|
-
* @property {
|
|
14
|
-
* @property {
|
|
15
|
-
* @property {
|
|
16
|
-
* @property {
|
|
17
|
-
* @property {
|
|
18
|
-
* @property {function} getProductsCountByPageUrl - Retrieves the number of products on a specific catalog page identified by its URL.
|
|
5
|
+
* @property {Function} getProducts - Search for all product page objects with pagination and filtering.
|
|
6
|
+
* @property {Function} getProductsEmptyPage - Search for all product page objects with pagination that do not have a category.
|
|
7
|
+
* @property {Function} getProductsByPageId - Search for all products with pagination for the selected category.
|
|
8
|
+
* @property {Function} getProductsPriceByPageUrl - Search for information about products and prices for the selected category.
|
|
9
|
+
* @property {Function} getProductsByPageUrl - Search for all products with pagination for the selected category.
|
|
10
|
+
* @property {Function} getRelatedProductsById - Find all related product page objects.
|
|
11
|
+
* @property {Function} getProductsByIds - Find products by its ids.
|
|
12
|
+
* @property {Function} getProductById - Retrieve one product object.
|
|
13
|
+
* @property {Function} getProductBlockById - Getting a product block object by product id.
|
|
14
|
+
* @property {Function} searchProduct - Quick search for product page objects with limited output.
|
|
15
|
+
* @property {Function} getProductsCount - Retrieves the total number of products available in the entire catalog.
|
|
16
|
+
* @property {Function} getProductsCountByPageId - Retrieves the number of products on a specific catalog page identified by its page ID.
|
|
17
|
+
* @property {Function} getProductsCountByPageUrl - Retrieves the number of products on a specific catalog page identified by its URL.
|
|
19
18
|
* @description This interface defines methods for retrieving and managing products in the system.
|
|
20
19
|
*/
|
|
21
20
|
interface IProductApi {
|
|
22
21
|
/**
|
|
23
22
|
* Search for all products with pagination and filter.
|
|
24
|
-
*
|
|
23
|
+
* @handleName getProducts
|
|
25
24
|
* @param {IFilterParams[]} [body] - Request body. Default []. Example:
|
|
26
25
|
[
|
|
27
26
|
{
|
|
@@ -59,14 +58,14 @@ interface IProductApi {
|
|
|
59
58
|
"conditionMarker": "equals",
|
|
60
59
|
"attributeMarker": "color"
|
|
61
60
|
}
|
|
62
|
-
* @
|
|
61
|
+
* @returns {IProductsResponse} Array with ProductEntity objects
|
|
63
62
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
64
63
|
* @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
|
|
65
64
|
*/
|
|
66
65
|
getProducts(body?: IFilterParams[], langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse | IError>;
|
|
67
66
|
/**
|
|
68
67
|
* Search for all product page objects with pagination that do not have a category.
|
|
69
|
-
*
|
|
68
|
+
* @handleName getProductsEmptyPage
|
|
70
69
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
71
70
|
* @param {IProductsQuery} [userQuery] - Optional set query parameters. Example:
|
|
72
71
|
{
|
|
@@ -80,13 +79,14 @@ interface IProductApi {
|
|
|
80
79
|
"conditionMarker": "equals",
|
|
81
80
|
"attributeMarker": "color"
|
|
82
81
|
}
|
|
83
|
-
* @
|
|
82
|
+
* @returns {IProductsResponse} Array with ProductEntity objects.
|
|
84
83
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
84
|
+
* @description This method searches for all product page objects with pagination that do not have a category.
|
|
85
85
|
*/
|
|
86
86
|
getProductsEmptyPage(langCode?: LangType, userQuery?: IProductsQuery): Promise<IProductsResponse | IError>;
|
|
87
87
|
/**
|
|
88
88
|
* Search for all products with pagination for the selected category.
|
|
89
|
-
*
|
|
89
|
+
* @handleName getProductsByPageId
|
|
90
90
|
* @param {number} id - Page id. Example: 12345.
|
|
91
91
|
* @param {IFilterParams[]} [body] - Request body. Default: [].
|
|
92
92
|
* @param {string} [langCode] - Language code. Default "en_US".
|
|
@@ -102,13 +102,14 @@ interface IProductApi {
|
|
|
102
102
|
"conditionMarker": "equals",
|
|
103
103
|
"attributeMarker": "color"
|
|
104
104
|
}
|
|
105
|
-
* @
|
|
105
|
+
* @returns {IProductsResponse} Array with ProductEntity objects
|
|
106
106
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
107
|
+
* @description This method searches for all products with pagination for the selected category.
|
|
107
108
|
*/
|
|
108
109
|
getProductsByPageId(id: number, body?: IFilterParams[], langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse | IError>;
|
|
109
110
|
/**
|
|
110
111
|
* Search for information about products and prices for the selected category.
|
|
111
|
-
*
|
|
112
|
+
* @handleName getProductsPriceByPageUrl
|
|
112
113
|
* @param {string} [url] - Page url. Example: "23-laminat-floorwood-maxima".
|
|
113
114
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
114
115
|
* @param {IProductsQuery} [userQuery] - Optional set query parameters. Example:
|
|
@@ -123,13 +124,14 @@ interface IProductApi {
|
|
|
123
124
|
"conditionMarker": "equals",
|
|
124
125
|
"attributeMarker": "color"
|
|
125
126
|
}
|
|
126
|
-
* @
|
|
127
|
+
* @returns {IProductsInfo} Array with ProductInformation objects.
|
|
127
128
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
129
|
+
* @description This method searches for information about products prices for the selected category.
|
|
128
130
|
*/
|
|
129
131
|
getProductsPriceByPageUrl(url: string, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsInfo | IError>;
|
|
130
132
|
/**
|
|
131
133
|
* Search for all products with pagination for the selected category.
|
|
132
|
-
*
|
|
134
|
+
* @handleName getProductsByPageUrl
|
|
133
135
|
* @param {string} url - Page url. Example: "23-laminat-floorwood-maxima".
|
|
134
136
|
* @param {IFilterParams[]} [body] - Request body. Default: [].
|
|
135
137
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
@@ -145,13 +147,14 @@ interface IProductApi {
|
|
|
145
147
|
"conditionMarker": "equals",
|
|
146
148
|
"attributeMarker": "color"
|
|
147
149
|
}
|
|
148
|
-
* @
|
|
150
|
+
* @returns {IProductsResponse} Array with ProductEntity objects.
|
|
149
151
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
152
|
+
* @description This method searches for all products with pagination for the selected category.
|
|
150
153
|
*/
|
|
151
154
|
getProductsByPageUrl(url: string, body?: IFilterParams[], langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse | IError>;
|
|
152
155
|
/**
|
|
153
156
|
* Find all related product page objects.
|
|
154
|
-
*
|
|
157
|
+
* @handleName getRelatedProductsById
|
|
155
158
|
* @param {number} [id] - Product page identifier for which to find relationship. Example: 12345.
|
|
156
159
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
157
160
|
* @param {IProductsQuery} [userQuery] - Optional set query parameters. Example:
|
|
@@ -166,13 +169,14 @@ interface IProductApi {
|
|
|
166
169
|
"conditionMarker": "equals",
|
|
167
170
|
"attributeMarker": "color"
|
|
168
171
|
}
|
|
169
|
-
* @
|
|
172
|
+
* @returns {IProductsResponse} Array with ProductEntity objects
|
|
170
173
|
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
174
|
+
* @description This method finds all related product page objects for the selected product page.
|
|
171
175
|
*/
|
|
172
176
|
getRelatedProductsById(id: number, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse | IError>;
|
|
173
177
|
/**
|
|
174
178
|
* Find products by its ids.
|
|
175
|
-
*
|
|
179
|
+
* @handleName getProductsByIds
|
|
176
180
|
* @param {string} [ids] - Product page identifiers for which to find relationships. Example: "12345,67890".
|
|
177
181
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
178
182
|
* @param {IProductsQuery} [userQuery] - Optional set query parameters. Example:
|
|
@@ -187,41 +191,43 @@ interface IProductApi {
|
|
|
187
191
|
"conditionMarker": "equals",
|
|
188
192
|
"attributeMarker": "color"
|
|
189
193
|
}
|
|
190
|
-
* @
|
|
194
|
+
* @returns {IProductsEntity[]} Array with ProductEntity objects
|
|
191
195
|
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
196
|
+
* @description This method finds products by its ids.
|
|
192
197
|
*/
|
|
193
198
|
getProductsByIds(ids: string, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsEntity[] | IError>;
|
|
194
199
|
/**
|
|
195
200
|
* Retrieve one product object.
|
|
196
|
-
*
|
|
201
|
+
* @handleName getProductById
|
|
197
202
|
* @param {number} id - Product id. Example: 12345.
|
|
198
203
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
199
|
-
* @
|
|
204
|
+
* @returns {IProductsEntity} ProductEntity object.
|
|
200
205
|
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
206
|
+
* @description This method retrieves one product object.
|
|
201
207
|
*/
|
|
202
208
|
getProductById(id: number, langCode?: string): Promise<IProductsEntity | IError>;
|
|
203
209
|
/**
|
|
204
210
|
* Getting a product block object by product id.
|
|
205
|
-
*
|
|
211
|
+
* @handleName getProductBlockById
|
|
206
212
|
* @param {number} id - Product id. Example: 12345.
|
|
207
|
-
* @
|
|
213
|
+
* @returns {IProductBlock}
|
|
208
214
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
215
|
+
* @description This method gets a product block object by product id.
|
|
209
216
|
*/
|
|
210
217
|
getProductBlockById(id: number): Promise<IProductBlock[] | IError>;
|
|
211
218
|
/**
|
|
212
219
|
* Quick search for product page objects with limited output.
|
|
213
|
-
*
|
|
220
|
+
* @handleName searchProduct
|
|
214
221
|
* @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'.
|
|
215
222
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
216
|
-
* @
|
|
223
|
+
* @returns {IProductsEntity[]} Array with ProductEntity objects
|
|
217
224
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
225
|
+
* @description This method performs a quick search for product page objects with limited output.
|
|
218
226
|
*/
|
|
219
227
|
searchProduct(name: string, langCode: string): Promise<IProductsEntity[] | IError>;
|
|
220
228
|
/**
|
|
221
229
|
* Getting the number of products for the entire catalog.
|
|
222
|
-
*
|
|
223
230
|
* @handleName getProductsCount
|
|
224
|
-
*
|
|
225
231
|
* @param {string} [body] - Body parameters for filter. Deault: []. Example:
|
|
226
232
|
[
|
|
227
233
|
{
|
|
@@ -230,7 +236,7 @@ interface IProductApi {
|
|
|
230
236
|
"statusMarker": "status_1",
|
|
231
237
|
"conditionValue": {},
|
|
232
238
|
"pageUrls": [
|
|
233
|
-
|
|
239
|
+
"23-laminat-floorwood-maxima"
|
|
234
240
|
],
|
|
235
241
|
"title": "Iphone 17 Pro"
|
|
236
242
|
},
|
|
@@ -240,21 +246,19 @@ interface IProductApi {
|
|
|
240
246
|
"statusMarker": "status_1",
|
|
241
247
|
"conditionValue": {},
|
|
242
248
|
"pageUrls": [
|
|
243
|
-
|
|
249
|
+
"23-laminat-floorwood-maxima"
|
|
244
250
|
],
|
|
245
251
|
"title": "Iphone 17 Pro"
|
|
246
252
|
}
|
|
247
253
|
]
|
|
248
|
-
* @
|
|
254
|
+
* @returns {IProductsCount} Object with product items count.
|
|
249
255
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
250
256
|
* @description This method calculates and returns the total number of products present across the entire catalog, optionally applying specified filters.
|
|
251
257
|
*/
|
|
252
258
|
getProductsCount(body: any): Promise<IProductsCount | IError>;
|
|
253
259
|
/**
|
|
254
260
|
* Getting the number of products on a catalog page by page ID.
|
|
255
|
-
*
|
|
256
261
|
* @handleName getProductsCountByPageId
|
|
257
|
-
*
|
|
258
262
|
* @param {string} id - Page id. Example: 12345.
|
|
259
263
|
* @param {string} body - Body parameters for filter. Deault: []. Example:
|
|
260
264
|
[
|
|
@@ -264,7 +268,7 @@ interface IProductApi {
|
|
|
264
268
|
"statusMarker": "status_1",
|
|
265
269
|
"conditionValue": {},
|
|
266
270
|
"pageUrls": [
|
|
267
|
-
|
|
271
|
+
"23-laminat-floorwood-maxima"
|
|
268
272
|
],
|
|
269
273
|
"title": "Iphone 17 Pro"
|
|
270
274
|
},
|
|
@@ -274,21 +278,19 @@ interface IProductApi {
|
|
|
274
278
|
"statusMarker": "status_1",
|
|
275
279
|
"conditionValue": {},
|
|
276
280
|
"pageUrls": [
|
|
277
|
-
|
|
281
|
+
"23-laminat-floorwood-maxima"
|
|
278
282
|
],
|
|
279
283
|
"title": "Iphone 17 Pro"
|
|
280
284
|
}
|
|
281
285
|
]
|
|
282
|
-
* @
|
|
286
|
+
* @returns {IProductsCount} Object with product items count.
|
|
283
287
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
284
288
|
* @description This method calculates and returns the number of products available on a given catalog page, identified by its page ID, with optional filtering.
|
|
285
289
|
*/
|
|
286
290
|
getProductsCountByPageId(id: string, body: any): Promise<IProductsCount | IError>;
|
|
287
291
|
/**
|
|
288
292
|
* Getting the number of products on a catalog page by page URL.
|
|
289
|
-
*
|
|
290
293
|
* @handleName getProductsCountByPageUrl
|
|
291
|
-
*
|
|
292
294
|
* @param {string} url - Page url. Example: "catalog".
|
|
293
295
|
* @param {string} body - Body parameters for filter. Deault: []. Example:
|
|
294
296
|
[
|
|
@@ -298,7 +300,7 @@ interface IProductApi {
|
|
|
298
300
|
"statusMarker": "status_1",
|
|
299
301
|
"conditionValue": {},
|
|
300
302
|
"pageUrls": [
|
|
301
|
-
|
|
303
|
+
"23-laminat-floorwood-maxima"
|
|
302
304
|
],
|
|
303
305
|
"title": "Iphone 17 Pro"
|
|
304
306
|
},
|
|
@@ -308,12 +310,12 @@ interface IProductApi {
|
|
|
308
310
|
"statusMarker": "status_1",
|
|
309
311
|
"conditionValue": {},
|
|
310
312
|
"pageUrls": [
|
|
311
|
-
|
|
313
|
+
"23-laminat-floorwood-maxima"
|
|
312
314
|
],
|
|
313
315
|
"title": "Iphone 17 Pro"
|
|
314
316
|
}
|
|
315
317
|
]
|
|
316
|
-
* @
|
|
318
|
+
* @returns {IProductsCount} Object with product items count.
|
|
317
319
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
318
320
|
* @description This method calculates and returns the number of products available on a given catalog page, identified by its URL, with optional filtering.
|
|
319
321
|
*/
|
|
@@ -321,7 +323,6 @@ interface IProductApi {
|
|
|
321
323
|
}
|
|
322
324
|
/**
|
|
323
325
|
* @interface IProductsQuery
|
|
324
|
-
*
|
|
325
326
|
* @property {number} offset - Parameter for pagination. Default: 0.
|
|
326
327
|
* @property {number} limit - Parameter for pagination. Default: 30.
|
|
327
328
|
* @property {string} sortOrder - Sort order "DESC" | "ASC". Default: "DESC".
|
|
@@ -347,7 +348,6 @@ interface IProductsQuery {
|
|
|
347
348
|
}
|
|
348
349
|
/**
|
|
349
350
|
* @interface IFilterParams
|
|
350
|
-
*
|
|
351
351
|
* @property {string | null} attributeMarker - The text identifier of the indexed attribute by which values are filtered. Default: null. Example: "color".
|
|
352
352
|
* @property {string | null} [conditionMarker] - Id of the filter condition by which the values are filtered. Default: null. Example: "equals".
|
|
353
353
|
* @property {number | null} conditionValue - The value that is being searched for, default null. Example: "new".
|
|
@@ -368,7 +368,6 @@ interface IFilterParams {
|
|
|
368
368
|
}
|
|
369
369
|
/**
|
|
370
370
|
* @interface IProductsEntity
|
|
371
|
-
*
|
|
372
371
|
* @property {number} id - The unique identifier. Example: 12345.
|
|
373
372
|
* @property {ILocalizeInfo} localizeInfos - The name of the products, taking into account localization. Example:
|
|
374
373
|
* @property {string | null} statusIdentifier - Product page status identifiers (may be null). Example: "in_stock".
|
|
@@ -433,7 +432,6 @@ interface IProductsEntity {
|
|
|
433
432
|
}
|
|
434
433
|
/**
|
|
435
434
|
* @interface IProductsResponse
|
|
436
|
-
*
|
|
437
435
|
* @property {number} total - The total number of products found. Example: 100.
|
|
438
436
|
* @property {IProductsEntity[]} items - An array of product entities. Example:
|
|
439
437
|
[
|
|
@@ -454,7 +452,6 @@ interface IProductsResponse {
|
|
|
454
452
|
}
|
|
455
453
|
/**
|
|
456
454
|
* @interface IProductsCount
|
|
457
|
-
*
|
|
458
455
|
* @property {number} totalAll - The total number of products found. Example: 100.
|
|
459
456
|
* @property {number} totalInCategory - The total number of products found in category. Example: 50.
|
|
460
457
|
* @property {number} totalInCategoryWithNested - The total number of products found in nested category. Example: 10.
|
|
@@ -467,7 +464,6 @@ interface IProductsCount {
|
|
|
467
464
|
}
|
|
468
465
|
/**
|
|
469
466
|
* @interface IProductsInfo
|
|
470
|
-
*
|
|
471
467
|
* @property {number} total - The total number of products found. Example: 100.
|
|
472
468
|
* @property {IProductInfo[]} items - An array of product information objects. Example:
|
|
473
469
|
[
|
|
@@ -488,7 +484,6 @@ interface IProductsInfo {
|
|
|
488
484
|
}
|
|
489
485
|
/**
|
|
490
486
|
* @interface IProductInfo
|
|
491
|
-
*
|
|
492
487
|
* @property {number} id - The unique identifier of the product. Example: 12345.
|
|
493
488
|
* @property {number} price - The price of the product. Example: 150.00.
|
|
494
489
|
* @description This interface defines the structure of a product information object, including its identifier and price.
|
|
@@ -499,7 +494,6 @@ interface IProductInfo {
|
|
|
499
494
|
}
|
|
500
495
|
/**
|
|
501
496
|
* @interface IProductBlock
|
|
502
|
-
*
|
|
503
497
|
* @property {number} id - Unique identifier of the product block. Example: 3289.
|
|
504
498
|
* @property {number | null} attributeSetIdentifier - Identifier of the attribute set used in the product block, or null if not applicable. Example: 67890.
|
|
505
499
|
* @property {ILocalizeInfo} localizeInfos - Localization information for the product block. Example:
|
|
@@ -5,37 +5,37 @@ import type { ISystem } from './systemInterfaces';
|
|
|
5
5
|
/**
|
|
6
6
|
* Controllers for working with system - system
|
|
7
7
|
* @handle /api/content/system
|
|
8
|
+
* @description Controllers for working with system - system
|
|
8
9
|
*/
|
|
9
10
|
export default class SystemApi extends AsyncModules implements ISystem {
|
|
10
11
|
protected state: StateModule;
|
|
11
12
|
protected _url: string;
|
|
13
|
+
/**
|
|
14
|
+
* Constructor
|
|
15
|
+
* @param {StateModule} state - The state module.
|
|
16
|
+
* @description Constructor initializes the SystemApi with a given state.
|
|
17
|
+
*/
|
|
12
18
|
constructor(state: StateModule);
|
|
13
19
|
/**
|
|
14
20
|
* Sends a GET request to the '/test404' endpoint and returns the result.
|
|
15
|
-
*
|
|
16
21
|
* @handleName test404
|
|
17
|
-
*
|
|
18
|
-
* @return {any} The response from the server after fetching data from the '/test404' endpoint.
|
|
22
|
+
* @returns {any} The response from the server after fetching data from the '/test404' endpoint.
|
|
19
23
|
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
20
24
|
* @description This method is used to test the 404 error handling by sending a GET request to a specific endpoint.
|
|
21
25
|
*/
|
|
22
26
|
test404(): Promise<any | IError>;
|
|
23
27
|
/**
|
|
24
28
|
* Sends a GET request to the '/test500' endpoint and returns the result.
|
|
25
|
-
*
|
|
26
29
|
* @handleName test500
|
|
27
|
-
*
|
|
28
|
-
* @return {any} The response from the server after fetching data from the '/test500' endpoint.
|
|
30
|
+
* @returns {any} The response from the server after fetching data from the '/test500' endpoint.
|
|
29
31
|
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
30
32
|
* @description This method is used to test the 500 error handling by sending a GET request to a specific endpoint.
|
|
31
33
|
*/
|
|
32
34
|
test500(): Promise<any | IError>;
|
|
33
35
|
/**
|
|
34
36
|
* Validates a CAPTCHA token by sending it to the server for verification.
|
|
35
|
-
*
|
|
36
37
|
* @handleName validateCapcha
|
|
37
|
-
*
|
|
38
|
-
* @param {Object} event - The event object containing CAPTCHA data. Example:
|
|
38
|
+
* @param {object} event - The event object containing CAPTCHA data. Example:
|
|
39
39
|
{
|
|
40
40
|
"token": "03AGdBq24...",
|
|
41
41
|
"expectedAction": "login",
|
|
@@ -44,7 +44,7 @@ export default class SystemApi extends AsyncModules implements ISystem {
|
|
|
44
44
|
* @param {string} event.token - The CAPTCHA token to be validated. Example: "03AGdBq24...".
|
|
45
45
|
* @param {string} event.expectedAction - The expected action associated with the CAPTCHA. Example: "login".
|
|
46
46
|
* @param {string} event.siteKey - The site key used for the CAPTCHA. Example: "6Lc_aCMTAAAAAB...".
|
|
47
|
-
* @
|
|
47
|
+
* @returns {any} The response from the server after validating the CAPTCHA, or an error object if validation fails.
|
|
48
48
|
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
49
49
|
* @description This method sends the CAPTCHA token and related information to the server endpoint '/captcha/validate' to verify its validity.
|
|
50
50
|
*/
|
|
@@ -55,10 +55,8 @@ export default class SystemApi extends AsyncModules implements ISystem {
|
|
|
55
55
|
}): Promise<any | IError>;
|
|
56
56
|
/**
|
|
57
57
|
* Getting the number of requests to API.
|
|
58
|
-
*
|
|
59
58
|
* @handleName getApiStat
|
|
60
|
-
*
|
|
61
|
-
* @return {any} Return object with date and count.
|
|
59
|
+
* @returns {any} Return object with date and count.
|
|
62
60
|
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
63
61
|
* @description Getting the number of requests to API.
|
|
64
62
|
*/
|
package/dist/system/systemApi.js
CHANGED
|
@@ -3,23 +3,28 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
/* eslint-disable jsdoc/reject-any-type */
|
|
6
7
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
7
8
|
const asyncModules_1 = __importDefault(require("../base/asyncModules"));
|
|
8
9
|
/**
|
|
9
10
|
* Controllers for working with system - system
|
|
10
11
|
* @handle /api/content/system
|
|
12
|
+
* @description Controllers for working with system - system
|
|
11
13
|
*/
|
|
12
14
|
class SystemApi extends asyncModules_1.default {
|
|
15
|
+
/**
|
|
16
|
+
* Constructor
|
|
17
|
+
* @param {StateModule} state - The state module.
|
|
18
|
+
* @description Constructor initializes the SystemApi with a given state.
|
|
19
|
+
*/
|
|
13
20
|
constructor(state) {
|
|
14
21
|
super(state);
|
|
15
22
|
this._url = state.url + '/api/content/system';
|
|
16
23
|
}
|
|
17
24
|
/**
|
|
18
25
|
* Sends a GET request to the '/test404' endpoint and returns the result.
|
|
19
|
-
*
|
|
20
26
|
* @handleName test404
|
|
21
|
-
*
|
|
22
|
-
* @return {any} The response from the server after fetching data from the '/test404' endpoint.
|
|
27
|
+
* @returns {any} The response from the server after fetching data from the '/test404' endpoint.
|
|
23
28
|
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
24
29
|
* @description This method is used to test the 404 error handling by sending a GET request to a specific endpoint.
|
|
25
30
|
*/
|
|
@@ -29,10 +34,8 @@ class SystemApi extends asyncModules_1.default {
|
|
|
29
34
|
}
|
|
30
35
|
/**
|
|
31
36
|
* Sends a GET request to the '/test500' endpoint and returns the result.
|
|
32
|
-
*
|
|
33
37
|
* @handleName test500
|
|
34
|
-
*
|
|
35
|
-
* @return {any} The response from the server after fetching data from the '/test500' endpoint.
|
|
38
|
+
* @returns {any} The response from the server after fetching data from the '/test500' endpoint.
|
|
36
39
|
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
37
40
|
* @description This method is used to test the 500 error handling by sending a GET request to a specific endpoint.
|
|
38
41
|
*/
|
|
@@ -42,10 +45,8 @@ class SystemApi extends asyncModules_1.default {
|
|
|
42
45
|
}
|
|
43
46
|
/**
|
|
44
47
|
* Validates a CAPTCHA token by sending it to the server for verification.
|
|
45
|
-
*
|
|
46
48
|
* @handleName validateCapcha
|
|
47
|
-
*
|
|
48
|
-
* @param {Object} event - The event object containing CAPTCHA data. Example:
|
|
49
|
+
* @param {object} event - The event object containing CAPTCHA data. Example:
|
|
49
50
|
{
|
|
50
51
|
"token": "03AGdBq24...",
|
|
51
52
|
"expectedAction": "login",
|
|
@@ -54,7 +55,7 @@ class SystemApi extends asyncModules_1.default {
|
|
|
54
55
|
* @param {string} event.token - The CAPTCHA token to be validated. Example: "03AGdBq24...".
|
|
55
56
|
* @param {string} event.expectedAction - The expected action associated with the CAPTCHA. Example: "login".
|
|
56
57
|
* @param {string} event.siteKey - The site key used for the CAPTCHA. Example: "6Lc_aCMTAAAAAB...".
|
|
57
|
-
* @
|
|
58
|
+
* @returns {any} The response from the server after validating the CAPTCHA, or an error object if validation fails.
|
|
58
59
|
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
59
60
|
* @description This method sends the CAPTCHA token and related information to the server endpoint '/captcha/validate' to verify its validity.
|
|
60
61
|
*/
|
|
@@ -67,10 +68,8 @@ class SystemApi extends asyncModules_1.default {
|
|
|
67
68
|
}
|
|
68
69
|
/**
|
|
69
70
|
* Getting the number of requests to API.
|
|
70
|
-
*
|
|
71
71
|
* @handleName getApiStat
|
|
72
|
-
*
|
|
73
|
-
* @return {any} Return object with date and count.
|
|
72
|
+
* @returns {any} Return object with date and count.
|
|
74
73
|
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
75
74
|
* @description Getting the number of requests to API.
|
|
76
75
|
*/
|
|
@@ -1,12 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @interface ISystem
|
|
3
|
-
*
|
|
4
|
-
* @property {
|
|
5
|
-
* @property {function} test500 - Test 500 error.
|
|
3
|
+
* @property {Function} test404 - Test 404 error.
|
|
4
|
+
* @property {Function} test500 - Test 500 error.
|
|
6
5
|
* @description Represents a interface object of System Api.
|
|
7
6
|
*/
|
|
8
7
|
interface ISystem {
|
|
8
|
+
/**
|
|
9
|
+
* Test 404 error.
|
|
10
|
+
* @handleName test404
|
|
11
|
+
* @returns {any} Returns a Promise that resolves with any data.
|
|
12
|
+
* @description This method tests 404 error.
|
|
13
|
+
*/
|
|
9
14
|
test404(): Promise<any>;
|
|
15
|
+
/**
|
|
16
|
+
* Test 500 error.
|
|
17
|
+
* @handleName test500
|
|
18
|
+
* @returns {any} Returns a Promise that resolves with any data.
|
|
19
|
+
* @description This method tests 500 error.
|
|
20
|
+
*/
|
|
10
21
|
test500(): Promise<any>;
|
|
11
22
|
}
|
|
12
23
|
export type { ISystem };
|
|
@@ -4,47 +4,44 @@ import type { IError, Types } from '../base/utils';
|
|
|
4
4
|
import type { ITemplateEntity, ITemplatesApi } from './templatesInterfaces';
|
|
5
5
|
/**
|
|
6
6
|
* Controllers for working with template objects
|
|
7
|
-
*
|
|
8
7
|
* @module TemplateController
|
|
9
8
|
* @handle /api/content/templates
|
|
10
|
-
*
|
|
11
9
|
* @description This module provides a set of controllers for handling operations related to template objects.
|
|
12
10
|
*/
|
|
13
11
|
export default class TemplatesPreviewApi extends AsyncModules implements ITemplatesApi {
|
|
14
12
|
protected state: StateModule;
|
|
15
13
|
protected _url: string;
|
|
14
|
+
/**
|
|
15
|
+
* Constructor for TemplatesApi class.
|
|
16
|
+
* @param {StateModule} state - The state module instance.
|
|
17
|
+
* @description Initializes the TemplatesApi class with the provided state module instance.
|
|
18
|
+
*/
|
|
16
19
|
constructor(state: StateModule);
|
|
17
20
|
/**
|
|
18
21
|
* Get all template objects grouped by types.
|
|
19
|
-
*
|
|
20
22
|
* @handleName getAllTemplates
|
|
21
|
-
*
|
|
22
23
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
23
|
-
* @
|
|
24
|
+
* @returns {Record<Types, ITemplateEntity[]>} Returns an object GroupedTemplatesObject, which contains an array of template objects TemplateEntity
|
|
24
25
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
25
26
|
* @description This function is designed to fetch organized template objects in groups based on their types.
|
|
26
27
|
*/
|
|
27
28
|
getAllTemplates(langCode?: string): Promise<Record<Types, ITemplateEntity[]> | IError>;
|
|
28
29
|
/**
|
|
29
30
|
* Get template objects by type.
|
|
30
|
-
*
|
|
31
31
|
* @handleName getTemplateByType
|
|
32
|
-
*
|
|
33
32
|
* @param {Types} type - The type of templates to retrieve. This parameter specifies the category or classification of templates being requested. Example: "product".
|
|
34
33
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
35
|
-
* @
|
|
34
|
+
* @returns {ITemplateEntity[]} Returns a TemplateEntity object.
|
|
36
35
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
37
36
|
* @description Fetch template objects that belong to a specific type, with an optional filter by language.
|
|
38
37
|
*/
|
|
39
38
|
getTemplateByType(type: Types, langCode?: string): Promise<ITemplateEntity[] | IError>;
|
|
40
39
|
/**
|
|
41
40
|
* Get one template object by marker.
|
|
42
|
-
*
|
|
43
41
|
* @handleName getTemplateByMarker
|
|
44
|
-
*
|
|
45
42
|
* @param {string} marker - The unique marker of the template to retrieve. Example: "template_12345".
|
|
46
43
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
47
|
-
* @
|
|
44
|
+
* @returns {ITemplateEntity} Returns a TemplateEntity object
|
|
48
45
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
49
46
|
* @description Fetch a specific template object based on its unique marker.
|
|
50
47
|
*/
|
|
@@ -7,24 +7,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
const asyncModules_1 = __importDefault(require("../base/asyncModules"));
|
|
8
8
|
/**
|
|
9
9
|
* Controllers for working with template objects
|
|
10
|
-
*
|
|
11
10
|
* @module TemplateController
|
|
12
11
|
* @handle /api/content/templates
|
|
13
|
-
*
|
|
14
12
|
* @description This module provides a set of controllers for handling operations related to template objects.
|
|
15
13
|
*/
|
|
16
14
|
class TemplatesPreviewApi extends asyncModules_1.default {
|
|
15
|
+
/**
|
|
16
|
+
* Constructor for TemplatesApi class.
|
|
17
|
+
* @param {StateModule} state - The state module instance.
|
|
18
|
+
* @description Initializes the TemplatesApi class with the provided state module instance.
|
|
19
|
+
*/
|
|
17
20
|
constructor(state) {
|
|
18
21
|
super(state);
|
|
19
22
|
this._url = state.url + '/api/content/templates';
|
|
20
23
|
}
|
|
21
24
|
/**
|
|
22
25
|
* Get all template objects grouped by types.
|
|
23
|
-
*
|
|
24
26
|
* @handleName getAllTemplates
|
|
25
|
-
*
|
|
26
27
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
27
|
-
* @
|
|
28
|
+
* @returns {Record<Types, ITemplateEntity[]>} Returns an object GroupedTemplatesObject, which contains an array of template objects TemplateEntity
|
|
28
29
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
29
30
|
* @description This function is designed to fetch organized template objects in groups based on their types.
|
|
30
31
|
*/
|
|
@@ -39,12 +40,10 @@ class TemplatesPreviewApi extends asyncModules_1.default {
|
|
|
39
40
|
}
|
|
40
41
|
/**
|
|
41
42
|
* Get template objects by type.
|
|
42
|
-
*
|
|
43
43
|
* @handleName getTemplateByType
|
|
44
|
-
*
|
|
45
44
|
* @param {Types} type - The type of templates to retrieve. This parameter specifies the category or classification of templates being requested. Example: "product".
|
|
46
45
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
47
|
-
* @
|
|
46
|
+
* @returns {ITemplateEntity[]} Returns a TemplateEntity object.
|
|
48
47
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
49
48
|
* @description Fetch template objects that belong to a specific type, with an optional filter by language.
|
|
50
49
|
*/
|
|
@@ -54,12 +53,10 @@ class TemplatesPreviewApi extends asyncModules_1.default {
|
|
|
54
53
|
}
|
|
55
54
|
/**
|
|
56
55
|
* Get one template object by marker.
|
|
57
|
-
*
|
|
58
56
|
* @handleName getTemplateByMarker
|
|
59
|
-
*
|
|
60
57
|
* @param {string} marker - The unique marker of the template to retrieve. Example: "template_12345".
|
|
61
58
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
62
|
-
* @
|
|
59
|
+
* @returns {ITemplateEntity} Returns a TemplateEntity object
|
|
63
60
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
64
61
|
* @description Fetch a specific template object based on its unique marker.
|
|
65
62
|
*/
|