oneentry 1.0.124 → 1.0.126

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