oneentry 1.0.142 → 1.0.144
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/configure.js +2 -2
- package/dist/admins/adminsApi.d.ts +50 -0
- package/dist/admins/adminsApi.js +65 -0
- package/dist/admins/adminsInterfaces.d.ts +98 -0
- package/dist/admins/adminsInterfaces.js +2 -0
- package/dist/admins/adminsSchemas.d.ts +30 -0
- package/dist/admins/adminsSchemas.js +27 -0
- package/dist/attribute-sets/attributeSetsApi.d.ts +63 -0
- package/dist/attribute-sets/attributeSetsApi.js +98 -0
- package/dist/attribute-sets/attributeSetsInterfaces.d.ts +185 -0
- package/dist/attribute-sets/attributeSetsInterfaces.js +2 -0
- package/dist/attribute-sets/attributeSetsSchemas.d.ts +90 -0
- package/dist/attribute-sets/attributeSetsSchemas.js +74 -0
- package/dist/auth-provider/authProviderApi.d.ts +249 -0
- package/dist/auth-provider/authProviderApi.js +354 -0
- package/dist/auth-provider/authProviderSchemas.d.ts +131 -0
- package/dist/auth-provider/authProviderSchemas.js +82 -0
- package/dist/auth-provider/authProvidersInterfaces.d.ts +412 -0
- package/dist/auth-provider/authProvidersInterfaces.js +2 -0
- package/dist/base/asyncModules.d.ts +80 -0
- package/dist/base/asyncModules.js +448 -0
- package/dist/base/result.d.ts +39 -0
- package/dist/base/result.js +154 -0
- package/dist/base/stateModule.d.ts +41 -0
- package/dist/base/stateModule.js +128 -0
- package/dist/base/syncModules.d.ts +286 -0
- package/dist/base/syncModules.js +716 -0
- package/dist/base/utils.d.ts +197 -0
- package/dist/base/utils.js +2 -0
- package/dist/base/validation.d.ts +118 -0
- package/dist/base/validation.js +132 -0
- package/dist/blocks/blocksApi.d.ts +88 -0
- package/dist/blocks/blocksApi.js +207 -0
- package/dist/blocks/blocksInterfaces.d.ts +179 -0
- package/dist/blocks/blocksInterfaces.js +2 -0
- package/dist/blocks/blocksSchemas.d.ts +195 -0
- package/dist/blocks/blocksSchemas.js +43 -0
- package/dist/discounts/discountsApi.d.ts +76 -0
- package/dist/discounts/discountsApi.js +116 -0
- package/dist/discounts/discountsInterfaces.d.ts +217 -0
- package/dist/discounts/discountsInterfaces.js +2 -0
- package/dist/events/eventsApi.d.ts +60 -0
- package/dist/events/eventsApi.js +97 -0
- package/dist/events/eventsInterfaces.d.ts +87 -0
- package/dist/events/eventsInterfaces.js +2 -0
- package/dist/file-uploading/fileUploadingApi.d.ts +88 -0
- package/dist/file-uploading/fileUploadingApi.js +129 -0
- package/dist/file-uploading/fileUploadingInterfaces.d.ts +114 -0
- package/dist/file-uploading/fileUploadingInterfaces.js +2 -0
- package/dist/file-uploading/fileUploadingSchemas.d.ts +22 -0
- package/dist/file-uploading/fileUploadingSchemas.js +21 -0
- package/dist/forms/formsApi.d.ts +42 -0
- package/dist/forms/formsApi.js +57 -0
- package/dist/forms/formsInterfaces.d.ts +144 -0
- package/dist/forms/formsInterfaces.js +2 -0
- package/dist/forms/formsSchemas.d.ts +53 -0
- package/dist/forms/formsSchemas.js +34 -0
- package/dist/forms-data/formsDataApi.d.ts +106 -0
- package/dist/forms-data/formsDataApi.js +189 -0
- package/dist/forms-data/formsDataInterfaces.d.ts +522 -0
- package/dist/forms-data/formsDataInterfaces.js +2 -0
- package/dist/forms-data/formsDataSchemas.d.ts +115 -0
- package/dist/forms-data/formsDataSchemas.js +86 -0
- package/dist/general-types/generalTypesApi.d.ts +28 -0
- package/dist/general-types/generalTypesApi.js +38 -0
- package/dist/general-types/generalTypesInterfaces.d.ts +29 -0
- package/dist/general-types/generalTypesInterfaces.js +2 -0
- package/dist/general-types/generalTypesSchemas.d.ts +52 -0
- package/dist/general-types/generalTypesSchemas.js +36 -0
- package/dist/index.d.ts +124 -0
- package/dist/index.js +103 -0
- package/dist/integration-collections/integrationCollectionsApi.d.ts +163 -0
- package/dist/integration-collections/integrationCollectionsApi.js +220 -0
- package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +313 -0
- package/dist/integration-collections/integrationCollectionsInterfaces.js +2 -0
- package/dist/integration-collections/integrationCollectionsSchemas.d.ts +80 -0
- package/dist/integration-collections/integrationCollectionsSchemas.js +61 -0
- package/dist/locales/localesApi.d.ts +27 -0
- package/dist/locales/localesApi.js +37 -0
- package/dist/locales/localesInterfaces.d.ts +40 -0
- package/dist/locales/localesInterfaces.js +2 -0
- package/dist/locales/localesSchemas.d.ts +32 -0
- package/dist/locales/localesSchemas.js +26 -0
- package/dist/menus/menusApi.d.ts +29 -0
- package/dist/menus/menusApi.js +39 -0
- package/dist/menus/menusInterfaces.d.ts +87 -0
- package/dist/menus/menusInterfaces.js +3 -0
- package/dist/menus/menusSchemas.d.ts +16 -0
- package/dist/menus/menusSchemas.js +28 -0
- package/dist/orders/ordersApi.d.ts +175 -0
- package/dist/orders/ordersApi.js +247 -0
- package/dist/orders/ordersInterfaces.d.ts +593 -0
- package/dist/orders/ordersInterfaces.js +2 -0
- package/dist/orders/ordersSchemas.d.ts +120 -0
- package/dist/orders/ordersSchemas.js +101 -0
- package/dist/pages/pagesApi.d.ts +151 -0
- package/dist/pages/pagesApi.js +390 -0
- package/dist/pages/pagesInterfaces.d.ts +286 -0
- package/dist/pages/pagesInterfaces.js +2 -0
- package/dist/pages/pagesSchemas.d.ts +85 -0
- package/dist/pages/pagesSchemas.js +46 -0
- package/dist/payments/paymentsApi.d.ts +82 -0
- package/dist/payments/paymentsApi.js +121 -0
- package/dist/payments/paymentsInterfaces.d.ts +200 -0
- package/dist/payments/paymentsInterfaces.js +2 -0
- package/dist/payments/paymentsSchemas.d.ts +100 -0
- package/dist/payments/paymentsSchemas.js +65 -0
- package/dist/product-statuses/productStatusesApi.d.ts +47 -0
- package/dist/product-statuses/productStatusesApi.js +70 -0
- package/dist/product-statuses/productStatusesInterfaces.d.ts +62 -0
- package/dist/product-statuses/productStatusesInterfaces.js +2 -0
- package/dist/product-statuses/productStatusesSchemas.d.ts +34 -0
- package/dist/product-statuses/productStatusesSchemas.js +30 -0
- package/dist/products/productsApi.d.ts +366 -0
- package/dist/products/productsApi.js +458 -0
- package/dist/products/productsInterfaces.d.ts +593 -0
- package/dist/products/productsInterfaces.js +2 -0
- package/dist/products/productsSchemas.d.ts +200 -0
- package/dist/products/productsSchemas.js +98 -0
- package/dist/sitemap/sitemapApi.d.ts +35 -0
- package/dist/sitemap/sitemapApi.js +45 -0
- package/dist/sitemap/sitemapInterfaces.d.ts +40 -0
- package/dist/sitemap/sitemapInterfaces.js +2 -0
- package/dist/system/systemApi.d.ts +43 -0
- package/dist/system/systemApi.js +56 -0
- package/dist/system/systemInterfaces.d.ts +29 -0
- package/dist/system/systemInterfaces.js +2 -0
- package/dist/templates/templatesApi.d.ts +49 -0
- package/dist/templates/templatesApi.js +75 -0
- package/dist/templates/templatesInterfaces.d.ts +67 -0
- package/dist/templates/templatesInterfaces.js +2 -0
- package/dist/templates/templatesSchemas.d.ts +48 -0
- package/dist/templates/templatesSchemas.js +31 -0
- package/dist/templates-preview/templatesPreviewApi.d.ts +38 -0
- package/dist/templates-preview/templatesPreviewApi.js +53 -0
- package/dist/templates-preview/templatesPreviewInterfaces.d.ts +119 -0
- package/dist/templates-preview/templatesPreviewInterfaces.js +2 -0
- package/dist/templates-preview/templatesPreviewSchemas.d.ts +83 -0
- package/dist/templates-preview/templatesPreviewSchemas.js +48 -0
- package/dist/users/usersApi.d.ts +143 -0
- package/dist/users/usersApi.js +171 -0
- package/dist/users/usersInterfaces.d.ts +231 -0
- package/dist/users/usersInterfaces.js +2 -0
- package/dist/users/usersSchemas.d.ts +38 -0
- package/dist/users/usersSchemas.js +28 -0
- package/dist/web-socket/wsApi.d.ts +25 -0
- package/dist/web-socket/wsApi.js +45 -0
- package/dist/web-socket/wsInterfaces.d.ts +16 -0
- package/dist/web-socket/wsInterfaces.js +2 -0
- package/package.json +2 -80
|
@@ -0,0 +1,593 @@
|
|
|
1
|
+
import type { AttributeType, IError, ILocalizeInfo, Types } from '../base/utils';
|
|
2
|
+
import type { IFormConfig } from '../forms/formsInterfaces';
|
|
3
|
+
/**
|
|
4
|
+
* @interface IProductsApi
|
|
5
|
+
* @description This interface defines methods for retrieving and managing products in the system.
|
|
6
|
+
*/
|
|
7
|
+
interface IProductsApi {
|
|
8
|
+
/**
|
|
9
|
+
* Search for all products with pagination and filter.
|
|
10
|
+
* @handleName getProducts
|
|
11
|
+
* @param {IFilterParams[]} [body] - Request body. Default [].
|
|
12
|
+
* @example
|
|
13
|
+
[
|
|
14
|
+
{
|
|
15
|
+
"attributeMarker": "price",
|
|
16
|
+
"conditionMarker": "mth",
|
|
17
|
+
"statusMarker": "waiting",
|
|
18
|
+
"conditionValue": 1,
|
|
19
|
+
"pageUrls": [
|
|
20
|
+
"23-laminat-floorwood-maxima"
|
|
21
|
+
],
|
|
22
|
+
"isNested": false,
|
|
23
|
+
"title": ""
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"attributeMarker": "price",
|
|
27
|
+
"conditionMarker": "lth",
|
|
28
|
+
"conditionValue": 3,
|
|
29
|
+
"pageUrls": [
|
|
30
|
+
"23-laminat-floorwood-maxima"
|
|
31
|
+
],
|
|
32
|
+
"isNested": false,
|
|
33
|
+
"title": ""
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
37
|
+
* @param {IProductsQuery} [userQuery] - Optional set query parameters.
|
|
38
|
+
* @example
|
|
39
|
+
{
|
|
40
|
+
"limit": 30,
|
|
41
|
+
"offset": 0,
|
|
42
|
+
"sortOrder": "DESC",
|
|
43
|
+
"sortKey": "id",
|
|
44
|
+
"statusId": 123,
|
|
45
|
+
"statusMarker": "in_stock",
|
|
46
|
+
"conditionValue": "new",
|
|
47
|
+
"conditionMarker": "equals",
|
|
48
|
+
"attributeMarker": "color"
|
|
49
|
+
}
|
|
50
|
+
* @returns {IProductsResponse} Array with ProductEntity objects
|
|
51
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
52
|
+
*/
|
|
53
|
+
getProducts(body?: IFilterParams[], langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse | IError>;
|
|
54
|
+
/**
|
|
55
|
+
* Search for all product page objects with pagination that do not have a category.
|
|
56
|
+
* @handleName getProductsEmptyPage
|
|
57
|
+
* @param body
|
|
58
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
59
|
+
* @param {IProductsQuery} [userQuery] - Optional set query parameters.
|
|
60
|
+
* @example
|
|
61
|
+
{
|
|
62
|
+
"limit": 30,
|
|
63
|
+
"offset": 0,
|
|
64
|
+
"sortOrder": "DESC",
|
|
65
|
+
"sortKey": "id",
|
|
66
|
+
"statusId": 123,
|
|
67
|
+
"statusMarker": "in_stock",
|
|
68
|
+
"conditionValue": "new",
|
|
69
|
+
"conditionMarker": "equals",
|
|
70
|
+
"attributeMarker": "color"
|
|
71
|
+
}
|
|
72
|
+
* @returns {IProductsResponse} Array with ProductEntity objects.
|
|
73
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
74
|
+
* @description This method searches for all product page objects with pagination that do not have a category.
|
|
75
|
+
*/
|
|
76
|
+
getProductsEmptyPage(body?: object, langCode?: string, userQuery?: IProductsQuery): Promise<IAggregatedProductGroup[] | IError>;
|
|
77
|
+
/**
|
|
78
|
+
* Search for all products with pagination for the selected category.
|
|
79
|
+
* @handleName getProductsByPageId
|
|
80
|
+
* @param {number} id - Page id. Example: 12345.
|
|
81
|
+
* @param {IFilterParams[]} [body] - Request body. Default: [].
|
|
82
|
+
* @param {string} [langCode] - Language code. Default "en_US".
|
|
83
|
+
* @param {IProductsQuery} [userQuery] - Optional set query parameters.
|
|
84
|
+
* @example
|
|
85
|
+
{
|
|
86
|
+
"limit": 30,
|
|
87
|
+
"offset": 0,
|
|
88
|
+
"sortOrder": "DESC",
|
|
89
|
+
"sortKey": "id",
|
|
90
|
+
"statusId": 123,
|
|
91
|
+
"statusMarker": "in_stock",
|
|
92
|
+
"conditionValue": "new",
|
|
93
|
+
"conditionMarker": "equals",
|
|
94
|
+
"attributeMarker": "color"
|
|
95
|
+
}
|
|
96
|
+
* @returns {IProductsResponse} Array with ProductEntity objects
|
|
97
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
98
|
+
* @description This method searches for all products with pagination for the selected category.
|
|
99
|
+
*/
|
|
100
|
+
getProductsByPageId(id: number, body?: IFilterParams[], langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse | IError>;
|
|
101
|
+
/**
|
|
102
|
+
* Search for information about products and prices for the selected category.
|
|
103
|
+
* @handleName getProductsPriceByPageUrl
|
|
104
|
+
* @param {string} [url] - Page url. Example: "23-laminat-floorwood-maxima".
|
|
105
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
106
|
+
* @param {IProductsQuery} [userQuery] - Optional set query parameters.
|
|
107
|
+
* @example
|
|
108
|
+
{
|
|
109
|
+
"limit": 30,
|
|
110
|
+
"offset": 0,
|
|
111
|
+
"sortOrder": "DESC",
|
|
112
|
+
"sortKey": "id",
|
|
113
|
+
"statusId": 123,
|
|
114
|
+
"statusMarker": "in_stock",
|
|
115
|
+
"conditionValue": "new",
|
|
116
|
+
"conditionMarker": "equals",
|
|
117
|
+
"attributeMarker": "color"
|
|
118
|
+
}
|
|
119
|
+
* @returns {IProductsInfo} Array with ProductInformation objects.
|
|
120
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
121
|
+
* @description This method searches for information about products prices for the selected category.
|
|
122
|
+
*/
|
|
123
|
+
getProductsPriceByPageUrl(url: string, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsInfo | IError>;
|
|
124
|
+
/**
|
|
125
|
+
* Search for all products with pagination for the selected category.
|
|
126
|
+
* @handleName getProductsByPageUrl
|
|
127
|
+
* @param {string} url - Page url. Example: "23-laminat-floorwood-maxima".
|
|
128
|
+
* @param {IFilterParams[]} [body] - Request body. Default: [].
|
|
129
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
130
|
+
* @param {IProductsQuery} [userQuery] - Optional set query parameters.
|
|
131
|
+
* @example
|
|
132
|
+
{
|
|
133
|
+
"limit": 30,
|
|
134
|
+
"offset": 0,
|
|
135
|
+
"sortOrder": "DESC",
|
|
136
|
+
"sortKey": "id",
|
|
137
|
+
"statusId": 123,
|
|
138
|
+
"statusMarker": "in_stock",
|
|
139
|
+
"conditionValue": "new",
|
|
140
|
+
"conditionMarker": "equals",
|
|
141
|
+
"attributeMarker": "color"
|
|
142
|
+
}
|
|
143
|
+
* @returns {IProductsResponse} Array with ProductEntity objects.
|
|
144
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
145
|
+
* @description This method searches for all products with pagination for the selected category.
|
|
146
|
+
*/
|
|
147
|
+
getProductsByPageUrl(url: string, body?: IFilterParams[], langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse | IError>;
|
|
148
|
+
/**
|
|
149
|
+
* Find all related product page objects.
|
|
150
|
+
* @handleName getRelatedProductsById
|
|
151
|
+
* @param {number} [id] - Product page identifier for which to find relationship. Example: 12345.
|
|
152
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
153
|
+
* @param {IProductsQuery} [userQuery] - Optional set query parameters.
|
|
154
|
+
* @example
|
|
155
|
+
{
|
|
156
|
+
"limit": 30,
|
|
157
|
+
"offset": 0,
|
|
158
|
+
"sortOrder": "DESC",
|
|
159
|
+
"sortKey": "id",
|
|
160
|
+
"statusId": 123,
|
|
161
|
+
"statusMarker": "in_stock",
|
|
162
|
+
"conditionValue": "new",
|
|
163
|
+
"conditionMarker": "equals",
|
|
164
|
+
"attributeMarker": "color"
|
|
165
|
+
}
|
|
166
|
+
* @returns {IProductsResponse} Array with ProductEntity objects
|
|
167
|
+
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
168
|
+
* @description This method finds all related product page objects for the selected product page.
|
|
169
|
+
*/
|
|
170
|
+
getRelatedProductsById(id: number, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse | IError>;
|
|
171
|
+
/**
|
|
172
|
+
* Find products by its ids.
|
|
173
|
+
* @handleName getProductsByIds
|
|
174
|
+
* @param {string} ids - Product page identifiers for which to find relationships. Example: "12345,67890".
|
|
175
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
176
|
+
* @param {IProductsQuery} [userQuery] - Optional set query parameters.
|
|
177
|
+
* @example
|
|
178
|
+
{
|
|
179
|
+
"limit": 30,
|
|
180
|
+
"offset": 0,
|
|
181
|
+
"sortOrder": "DESC",
|
|
182
|
+
"sortKey": "id",
|
|
183
|
+
"statusId": 123,
|
|
184
|
+
"statusMarker": "in_stock",
|
|
185
|
+
"conditionValue": "new",
|
|
186
|
+
"conditionMarker": "equals",
|
|
187
|
+
"attributeMarker": "color"
|
|
188
|
+
}
|
|
189
|
+
* @returns {IProductsEntity[]} Array with ProductEntity objects
|
|
190
|
+
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
191
|
+
* @description This method finds products by its ids.
|
|
192
|
+
*/
|
|
193
|
+
getProductsByIds(ids: string, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsEntity[] | IError>;
|
|
194
|
+
/**
|
|
195
|
+
* Retrieve one product object.
|
|
196
|
+
* @handleName getProductById
|
|
197
|
+
* @param {number} id - Product id. Example: 12345.
|
|
198
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
199
|
+
* @param {boolean} [isNormalized] - If true, the product object will be normalized.
|
|
200
|
+
* @returns {IProductsEntity} ProductEntity object.
|
|
201
|
+
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
202
|
+
* @description This method retrieves one product object.
|
|
203
|
+
*/
|
|
204
|
+
getProductById(id: number, langCode?: string, isNormalized?: boolean): Promise<IProductsEntity | IError>;
|
|
205
|
+
/**
|
|
206
|
+
* Getting a product block object by product id.
|
|
207
|
+
* @handleName getProductBlockById
|
|
208
|
+
* @param {number} id - Product id. Example: 12345.
|
|
209
|
+
* @returns {IProductBlock}
|
|
210
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
211
|
+
* @description This method gets a product block object by product id.
|
|
212
|
+
*/
|
|
213
|
+
getProductBlockById(id: number): Promise<IProductBlock[] | IError>;
|
|
214
|
+
/**
|
|
215
|
+
* Quick search for product page objects with limited output.
|
|
216
|
+
* @handleName searchProduct
|
|
217
|
+
* @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'.
|
|
218
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
219
|
+
* @returns {IProductsEntity[]} Array with ProductEntity objects
|
|
220
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
221
|
+
* @description This method performs a quick search for product page objects with limited output.
|
|
222
|
+
*/
|
|
223
|
+
searchProduct(name: string, langCode?: string): Promise<IProductsEntity[] | IError>;
|
|
224
|
+
/**
|
|
225
|
+
* Getting the number of products for the entire catalog.
|
|
226
|
+
* @handleName getProductsCount
|
|
227
|
+
* @param {object[]} [body] - Body parameters for filter. Deault: [].
|
|
228
|
+
* @example
|
|
229
|
+
[
|
|
230
|
+
{
|
|
231
|
+
"attributeMarker": "price",
|
|
232
|
+
"conditionMarker": "in",
|
|
233
|
+
"statusMarker": "status_1",
|
|
234
|
+
"conditionValue": {},
|
|
235
|
+
"pageUrls": [
|
|
236
|
+
"23-laminat-floorwood-maxima"
|
|
237
|
+
],
|
|
238
|
+
"title": "Iphone 17 Pro"
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"attributeMarker": "price",
|
|
242
|
+
"conditionMarker": "in",
|
|
243
|
+
"statusMarker": "status_1",
|
|
244
|
+
"conditionValue": {},
|
|
245
|
+
"pageUrls": [
|
|
246
|
+
"23-laminat-floorwood-maxima"
|
|
247
|
+
],
|
|
248
|
+
"title": "Iphone 17 Pro"
|
|
249
|
+
}
|
|
250
|
+
]
|
|
251
|
+
* @returns {IProductsCount} Object with product items count.
|
|
252
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
253
|
+
* @description This method calculates and returns the total number of products present across the entire catalog, optionally applying specified filters.
|
|
254
|
+
*/
|
|
255
|
+
getProductsCount(body?: object[]): Promise<IProductsCount | IError>;
|
|
256
|
+
/**
|
|
257
|
+
* Getting the number of products on a catalog page by page ID.
|
|
258
|
+
* @handleName getProductsCountByPageId
|
|
259
|
+
* @param {string} id - Page id. Example: 12345.
|
|
260
|
+
* @param {object[]} body - Body parameters for filter. Deault: [].
|
|
261
|
+
* @example
|
|
262
|
+
[
|
|
263
|
+
{
|
|
264
|
+
"attributeMarker": "price",
|
|
265
|
+
"conditionMarker": "in",
|
|
266
|
+
"statusMarker": "status_1",
|
|
267
|
+
"conditionValue": {},
|
|
268
|
+
"pageUrls": [
|
|
269
|
+
"23-laminat-floorwood-maxima"
|
|
270
|
+
],
|
|
271
|
+
"title": "Iphone 17 Pro"
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
"attributeMarker": "price",
|
|
275
|
+
"conditionMarker": "in",
|
|
276
|
+
"statusMarker": "status_1",
|
|
277
|
+
"conditionValue": {},
|
|
278
|
+
"pageUrls": [
|
|
279
|
+
"23-laminat-floorwood-maxima"
|
|
280
|
+
],
|
|
281
|
+
"title": "Iphone 17 Pro"
|
|
282
|
+
}
|
|
283
|
+
]
|
|
284
|
+
* @returns {IProductsCount} Object with product items count.
|
|
285
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
286
|
+
* @description This method calculates and returns the number of products available on a given catalog page, identified by its page ID, with optional filtering.
|
|
287
|
+
*/
|
|
288
|
+
getProductsCountByPageId(id: string, body?: object[]): Promise<IProductsCount | IError>;
|
|
289
|
+
/**
|
|
290
|
+
* Getting the number of products on a catalog page by page URL.
|
|
291
|
+
* @handleName getProductsCountByPageUrl
|
|
292
|
+
* @param {string} url - Page url. Example: "catalog".
|
|
293
|
+
* @param {string} body - Body parameters for filter. Deault: [].
|
|
294
|
+
* @example
|
|
295
|
+
[
|
|
296
|
+
{
|
|
297
|
+
"attributeMarker": "price",
|
|
298
|
+
"conditionMarker": "in",
|
|
299
|
+
"statusMarker": "status_1",
|
|
300
|
+
"conditionValue": {},
|
|
301
|
+
"pageUrls": [
|
|
302
|
+
"23-laminat-floorwood-maxima"
|
|
303
|
+
],
|
|
304
|
+
"title": "Iphone 17 Pro"
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
"attributeMarker": "price",
|
|
308
|
+
"conditionMarker": "in",
|
|
309
|
+
"statusMarker": "status_1",
|
|
310
|
+
"conditionValue": {},
|
|
311
|
+
"pageUrls": [
|
|
312
|
+
"23-laminat-floorwood-maxima"
|
|
313
|
+
],
|
|
314
|
+
"title": "Iphone 17 Pro"
|
|
315
|
+
}
|
|
316
|
+
]
|
|
317
|
+
* @returns {IProductsCount} Object with product items count.
|
|
318
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
319
|
+
* @description This method calculates and returns the number of products available on a given catalog page, identified by its URL, with optional filtering.
|
|
320
|
+
*/
|
|
321
|
+
getProductsCountByPageUrl(url: string, body?: object[]): Promise<IProductsCount | IError>;
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* @interface IProductsQuery
|
|
325
|
+
* @property {number} offset - Parameter for pagination. Default: 0.
|
|
326
|
+
* @property {number} limit - Parameter for pagination. Default: 30.
|
|
327
|
+
* @property {string} sortOrder - Sort order "DESC" | "ASC". Default: "DESC".
|
|
328
|
+
* @property {string} sortKey - Field for sorting (default - null). Possible values: "id", "position", "title", "date", "price". Default: null.
|
|
329
|
+
* @property {string} [signPrice] - Price sign. Default: null.
|
|
330
|
+
* @property {string | null} [templateMarker] - Product page template marker, default null. Example: "template_12345".
|
|
331
|
+
* @property {string | null} [statusMarker] - Product page status marker, default null. Example: "in_stock".
|
|
332
|
+
* @property {string | null} [conditionValue] - The value that is being searched for, default null. Example: "new".
|
|
333
|
+
* @property {string | null} [attributeMarker] - The text identifier of the indexed attribute by which values are filtered, default null. Example: "color".
|
|
334
|
+
* @property {string | null} [conditionMarker] - Marker of the filter condition by which the values are filtered, default null. Example: "equals".
|
|
335
|
+
* @description This interface defines the structure of a query for retrieving products, including pagination, sorting, and filtering parameters.
|
|
336
|
+
*/
|
|
337
|
+
interface IProductsQuery {
|
|
338
|
+
offset?: number;
|
|
339
|
+
limit?: number;
|
|
340
|
+
sortOrder?: 'DESC' | 'ASC' | null;
|
|
341
|
+
sortKey?: 'id' | 'position' | 'title' | 'date' | 'price' | null;
|
|
342
|
+
signPrice?: string;
|
|
343
|
+
templateMarker?: string | null;
|
|
344
|
+
statusMarker?: string | null;
|
|
345
|
+
conditionValue?: string | null;
|
|
346
|
+
attributeMarker?: string | null;
|
|
347
|
+
conditionMarker?: 'in' /** in - Contains */ | 'nin' /** nin - Does not contain */ | 'eq' /** 'eq' - Equal */ | 'neq' /** 'neq' - Not equal */ | 'mth' /** 'mth' - Greater than */ | 'lth' /** 'lth' - Less than */ | 'exs' /** 'exs' - Exists */ | 'nexs' /** 'nexs' - Does not exist */ | null;
|
|
348
|
+
[key: string]: unknown;
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* @interface IFilterParams
|
|
352
|
+
* @property {string | null} attributeMarker - The text identifier of the indexed attribute by which values are filtered. Default: null. Example: "color".
|
|
353
|
+
* @property {string | null} [conditionMarker] - Id of the filter condition by which the values are filtered. Default: null. Example: "equals".
|
|
354
|
+
* @property {number | null} conditionValue - The value that is being searched for, default null. Example: "new".
|
|
355
|
+
* @property {string | null} [pageUrl] - Url of the category page object. Example: ["23-laminat-floorwood-maxima"].
|
|
356
|
+
* @property {string[] | null} [pageUrls] - Url of the category page object. Example: ["23-laminat-floorwood-maxima"].
|
|
357
|
+
* @property {string | null} [statusMarker] - Text identifier of the product page status (default not set). Example: "in_stock".
|
|
358
|
+
* @property {string | null} [title] - Product name. Example: "Laminatboden Maxima".
|
|
359
|
+
* @property {boolean} [isNested] - Flag for nested attributes, default false. Example: true.
|
|
360
|
+
* @description This interface defines the structure of filter parameters used for querying products, including conditions, attributes, and pagination.
|
|
361
|
+
*/
|
|
362
|
+
interface IFilterParams {
|
|
363
|
+
attributeMarker: string;
|
|
364
|
+
conditionMarker?: 'in' /** 'in' - Contains */ | 'nin' /** 'nin' - Does not contain */ | 'eq' /** 'eq' - Equal */ | 'neq' /** 'neq' - Not equal */ | 'mth' /** 'mth' - Greater than */ | 'lth' /** 'lth' - Less than */ | 'exs' /** 'exs' - Exists */ | 'nexs' /** 'nexs' - Does not exist */ | null;
|
|
365
|
+
conditionValue: number | string | null;
|
|
366
|
+
pageUrl?: string | null;
|
|
367
|
+
pageUrls?: string[] | null;
|
|
368
|
+
statusMarker?: string;
|
|
369
|
+
title?: string;
|
|
370
|
+
isNested?: boolean;
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* @interface IProductsEntity
|
|
374
|
+
* @property {number} id - The unique identifier. Example: 12345.
|
|
375
|
+
* @property {ILocalizeInfo} localizeInfos - The name of the products, taking into account localization. Example: {}.
|
|
376
|
+
* @property {string | null} statusIdentifier - Product page status identifiers (may be null). Example: "in_stock".
|
|
377
|
+
* @property {Record<string, unknown>} statusLocalizeInfos - JSON description of the item status object, taking into account the language. Example: {}.
|
|
378
|
+
* @property {string | null} attributeSetIdentifier - Set of attributes id. Example: "set_12345".
|
|
379
|
+
* @property {number} position - Item number (for sorting). Example: 1.
|
|
380
|
+
* @property {number | null} price - The value of the product page price taken from the index. Example: 150.00.
|
|
381
|
+
* @property {object} additional - Additional value from the index.
|
|
382
|
+
* @example
|
|
383
|
+
{
|
|
384
|
+
"en": "In Stock",
|
|
385
|
+
"de": "Auf Lager"
|
|
386
|
+
}
|
|
387
|
+
* @property {string | null} sku - Product SKU (Stock Keeping Unit), may be null. Example: "SKU_12345".
|
|
388
|
+
* @property {boolean} isSync - Indication of page indexing. Example: true.
|
|
389
|
+
* @property {AttributeType} attributeValues - Array of attribute values from the index, represented.
|
|
390
|
+
* @example
|
|
391
|
+
[
|
|
392
|
+
{
|
|
393
|
+
"id": "color",
|
|
394
|
+
"value": "red"
|
|
395
|
+
}
|
|
396
|
+
]
|
|
397
|
+
* @property {string[]} categories - Product categories.
|
|
398
|
+
* @example
|
|
399
|
+
[
|
|
400
|
+
1,
|
|
401
|
+
2,
|
|
402
|
+
3
|
|
403
|
+
]
|
|
404
|
+
* @property {boolean} isVisible - A sign of page visibility. Example: true.
|
|
405
|
+
* @property {Array<IFormConfig>} [moduleFormConfigs] - Module form configurations (optional).
|
|
406
|
+
* @property {Record<string, unknown>} [rating] - Rating data.
|
|
407
|
+
* @property {boolean} isPositionLocked - Sorting position lock indicator (optional). Example: false.
|
|
408
|
+
* @property {number[]} relatedIds - Ids of related product pages.
|
|
409
|
+
* @example
|
|
410
|
+
[
|
|
411
|
+
12345,
|
|
412
|
+
67890
|
|
413
|
+
]
|
|
414
|
+
* @property {unknown} [paymentStages] - Payment stages data (may be null). Example: null.
|
|
415
|
+
* @property {Record<string, unknown>} [discountConfig] - Discount configuration object. Example: {}.
|
|
416
|
+
* @property {string | null} [templateIdentifier] - User id of the linked template. Example: "template_12345".
|
|
417
|
+
* @property {string | null} [shortDescTemplateIdentifier] - User id of the linked template for a short description. Example: "short_desc_template_12345".
|
|
418
|
+
* @property {string} [signedPrice] - Price sign.
|
|
419
|
+
* @property {Array<Record<string, unknown>> | Record<string, unknown>} [productPages] - Array of product pages or a single product page object. Example: [].
|
|
420
|
+
* @property {string[]} [blocks] - Array of block identifiers.
|
|
421
|
+
* @example
|
|
422
|
+
[
|
|
423
|
+
"block_12345",
|
|
424
|
+
"block_67890"
|
|
425
|
+
]
|
|
426
|
+
* @description This interface defines the structure of a product entity, including its identifiers, attributes, and related information.
|
|
427
|
+
*/
|
|
428
|
+
interface IProductsEntity {
|
|
429
|
+
id: number;
|
|
430
|
+
localizeInfos: ILocalizeInfo;
|
|
431
|
+
statusIdentifier: string | null;
|
|
432
|
+
statusLocalizeInfos: Record<string, unknown>;
|
|
433
|
+
attributeSetIdentifier: string | null;
|
|
434
|
+
position: number;
|
|
435
|
+
price: number | null;
|
|
436
|
+
additional: {
|
|
437
|
+
prices: {
|
|
438
|
+
min: number;
|
|
439
|
+
max: number;
|
|
440
|
+
};
|
|
441
|
+
};
|
|
442
|
+
sku: string | null;
|
|
443
|
+
isSync: boolean;
|
|
444
|
+
attributeValues: AttributeType;
|
|
445
|
+
categories: string[];
|
|
446
|
+
isVisible: boolean;
|
|
447
|
+
moduleFormConfigs?: Array<IFormConfig>;
|
|
448
|
+
rating?: Record<string, unknown>;
|
|
449
|
+
templateIdentifier?: string | null;
|
|
450
|
+
shortDescTemplateIdentifier?: string | null;
|
|
451
|
+
signedPrice?: string;
|
|
452
|
+
productPages?: Array<Record<string, unknown>> | Record<string, unknown>;
|
|
453
|
+
blocks?: string[];
|
|
454
|
+
isPositionLocked?: boolean;
|
|
455
|
+
relatedIds?: number[];
|
|
456
|
+
paymentStages?: unknown;
|
|
457
|
+
discountConfig?: Record<string, unknown>;
|
|
458
|
+
}
|
|
459
|
+
/**
|
|
460
|
+
* @interface IProductsResponse
|
|
461
|
+
* @property {number} total - The total number of products found. Example: 100.
|
|
462
|
+
* @property {IProductsEntity[]} items - An array of product entities.
|
|
463
|
+
* @example
|
|
464
|
+
[
|
|
465
|
+
{
|
|
466
|
+
"id": 12345,
|
|
467
|
+
"title": "Product 1"
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
"id": 67890,
|
|
471
|
+
"title": "Product 2"
|
|
472
|
+
}
|
|
473
|
+
]
|
|
474
|
+
* @description This interface defines the structure of a response containing multiple product entities, including the total count and an array of product items.
|
|
475
|
+
*/
|
|
476
|
+
interface IProductsResponse {
|
|
477
|
+
items: IProductsEntity[];
|
|
478
|
+
total: number;
|
|
479
|
+
}
|
|
480
|
+
/**
|
|
481
|
+
* @interface IProductsCount
|
|
482
|
+
* @property {number} totalAll - The total number of products found. Example: 100.
|
|
483
|
+
* @property {number} totalInCategory - The total number of products found in category. Example: 50.
|
|
484
|
+
* @property {number} totalInCategoryWithNested - The total number of products found in nested category. Example: 10.
|
|
485
|
+
* @description This interface defines the structure of a response with total count of product items.
|
|
486
|
+
*/
|
|
487
|
+
interface IProductsCount {
|
|
488
|
+
totalAll: number;
|
|
489
|
+
totalInCategory: number;
|
|
490
|
+
totalInCategoryWithNested: number;
|
|
491
|
+
}
|
|
492
|
+
/**
|
|
493
|
+
* @interface IProductsInfo
|
|
494
|
+
* @property {number} total - The total number of products found. Example: 100.
|
|
495
|
+
* @property {IProductInfo[]} items - An array of product information objects.
|
|
496
|
+
* @example
|
|
497
|
+
[
|
|
498
|
+
{
|
|
499
|
+
"id": 12345,
|
|
500
|
+
"price": 150.00
|
|
501
|
+
},
|
|
502
|
+
{
|
|
503
|
+
"id": 67890,
|
|
504
|
+
"price": 200.00
|
|
505
|
+
}
|
|
506
|
+
]
|
|
507
|
+
* @description This interface defines the structure of a response containing product information, including the total count and an array of product items.
|
|
508
|
+
*/
|
|
509
|
+
interface IProductsInfo {
|
|
510
|
+
items: Array<IProductInfo>;
|
|
511
|
+
total: number;
|
|
512
|
+
}
|
|
513
|
+
/**
|
|
514
|
+
* @interface IProductInfo
|
|
515
|
+
* @property {number} id - The unique identifier of the product. Example: 12345.
|
|
516
|
+
* @property {number} price - The price of the product. Example: 150.00.
|
|
517
|
+
* @description This interface defines the structure of a product information object, including its identifier and price.
|
|
518
|
+
*/
|
|
519
|
+
interface IProductInfo {
|
|
520
|
+
id: number;
|
|
521
|
+
price: number;
|
|
522
|
+
}
|
|
523
|
+
/**
|
|
524
|
+
* @interface IProductBlock
|
|
525
|
+
* @property {number} id - Unique identifier of the product block. Example: 3289.
|
|
526
|
+
* @property {string | null} attributeSetIdentifier - Identifier of the attribute set used in the product block, or null if not applicable. Example: "product_block".
|
|
527
|
+
* @property {ILocalizeInfo} localizeInfos - Localization information for the product block.
|
|
528
|
+
* @example
|
|
529
|
+
{
|
|
530
|
+
"title": "Box"
|
|
531
|
+
}
|
|
532
|
+
* @property {number} version - Version of the product block entity. Example: 1.
|
|
533
|
+
* @property {number} position - Position of the product block in a list or layout. Example: 1.
|
|
534
|
+
* @property {string} identifier - Unique string identifier for the product block. Example: "product_block_12345".
|
|
535
|
+
* @property {Types} type - Type of the product block, such as "product", "error_page", etc. Example: "product".
|
|
536
|
+
* @property {object} customSettings - Custom settings for the product block, including slider delay, product configuration, similar product rules, and conditions. Example: {}
|
|
537
|
+
* @property {string | null} templateIdentifier - Identifier for the template used by the product block, or null if not applicable. Example: "template_12345".
|
|
538
|
+
* @property {boolean} isVisible - Indicates whether the product block is visible. Example: true.
|
|
539
|
+
* @property {boolean} isSync - Indicates whether the product block is synchronized. Example: false.
|
|
540
|
+
* @property {AttributeType} attributeValues - Array of attribute values from the index, represented as a pair of user attribute id and attribute value.
|
|
541
|
+
* @example
|
|
542
|
+
[
|
|
543
|
+
{
|
|
544
|
+
"id": "color",
|
|
545
|
+
"value": "red"
|
|
546
|
+
}
|
|
547
|
+
]
|
|
548
|
+
* @description This interface defines the structure of a product block entity, including its identifiers, attributes, and custom settings.
|
|
549
|
+
*/
|
|
550
|
+
interface IProductBlock {
|
|
551
|
+
id: number;
|
|
552
|
+
attributeSetIdentifier: string | null;
|
|
553
|
+
localizeInfos: ILocalizeInfo;
|
|
554
|
+
version: number;
|
|
555
|
+
position: number;
|
|
556
|
+
identifier: string;
|
|
557
|
+
type: Types;
|
|
558
|
+
customSettings: {
|
|
559
|
+
sliderDelay: number | null;
|
|
560
|
+
sliderDelayType: string | null;
|
|
561
|
+
productConfig: {
|
|
562
|
+
quantity: string | number;
|
|
563
|
+
countElementsPerRow: string | number;
|
|
564
|
+
sortType?: string | number;
|
|
565
|
+
sortOrder?: string | number;
|
|
566
|
+
};
|
|
567
|
+
similarProductRules: Array<{
|
|
568
|
+
property: string;
|
|
569
|
+
includes: string;
|
|
570
|
+
keywords: string;
|
|
571
|
+
strict: string;
|
|
572
|
+
}>;
|
|
573
|
+
condition: Record<string, unknown>;
|
|
574
|
+
};
|
|
575
|
+
templateIdentifier: string | null;
|
|
576
|
+
isVisible: boolean;
|
|
577
|
+
isSync: boolean;
|
|
578
|
+
attributeValues: AttributeType;
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* @interface IAggregatedProductGroup
|
|
582
|
+
* @property {string} attrValue - Attribute value.
|
|
583
|
+
* @property {IProductsEntity[]} items - Array of product entities.
|
|
584
|
+
* @property {string[]} productIds - Array of product ids.
|
|
585
|
+
* @property {number} total - Total count.
|
|
586
|
+
*/
|
|
587
|
+
interface IAggregatedProductGroup {
|
|
588
|
+
attrValue: string;
|
|
589
|
+
items: IProductsEntity[];
|
|
590
|
+
productIds: string[];
|
|
591
|
+
total: number;
|
|
592
|
+
}
|
|
593
|
+
export type { IAggregatedProductGroup, IFilterParams, IProductBlock, IProductInfo, IProductsApi, IProductsCount, IProductsEntity, IProductsInfo, IProductsQuery, IProductsResponse, };
|