oneentry 1.0.123 → 1.0.125

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/README.md +24 -22
  2. package/dist/admins/adminsApi.d.ts +30 -9
  3. package/dist/admins/adminsApi.js +30 -9
  4. package/dist/admins/adminsInterfaces.d.ts +77 -32
  5. package/dist/attribute-sets/attributeSetsApi.d.ts +36 -22
  6. package/dist/attribute-sets/attributeSetsApi.js +41 -25
  7. package/dist/attribute-sets/attributeSetsInterfaces.d.ts +133 -39
  8. package/dist/auth-provider/authProviderApi.d.ts +209 -88
  9. package/dist/auth-provider/authProviderApi.js +226 -87
  10. package/dist/auth-provider/authProvidersInterfaces.d.ts +345 -18
  11. package/dist/base/asyncModules.d.ts +38 -28
  12. package/dist/base/asyncModules.js +178 -47
  13. package/dist/base/result.js +23 -0
  14. package/dist/base/syncModules.d.ts +48 -44
  15. package/dist/base/syncModules.js +84 -64
  16. package/dist/base/utils.d.ts +1 -1
  17. package/dist/blocks/blocksApi.d.ts +48 -27
  18. package/dist/blocks/blocksApi.js +48 -27
  19. package/dist/blocks/blocksInterfaces.d.ts +126 -32
  20. package/dist/events/eventsApi.d.ts +45 -12
  21. package/dist/events/eventsApi.js +47 -12
  22. package/dist/events/eventsInterfaces.d.ts +50 -3
  23. package/dist/file-uploading/fileUploadingApi.d.ts +57 -29
  24. package/dist/file-uploading/fileUploadingApi.js +57 -30
  25. package/dist/file-uploading/fileUploadingInterfaces.d.ts +90 -17
  26. package/dist/forms/formsApi.d.ts +20 -9
  27. package/dist/forms/formsApi.js +19 -8
  28. package/dist/forms/formsInterfaces.d.ts +86 -23
  29. package/dist/formsData/formsDataApi.d.ts +33 -21
  30. package/dist/formsData/formsDataApi.js +33 -21
  31. package/dist/formsData/formsDataInterfaces.d.ts +212 -41
  32. package/dist/general-types/generalTypesApi.d.ts +11 -2
  33. package/dist/general-types/generalTypesApi.js +10 -1
  34. package/dist/general-types/generalTypesInterfaces.d.ts +17 -6
  35. package/dist/index.d.ts +2 -2
  36. package/dist/index.js +2 -2
  37. package/dist/integration-collections/integrationCollectionsApi.d.ts +134 -81
  38. package/dist/integration-collections/integrationCollectionsApi.js +135 -83
  39. package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +246 -43
  40. package/dist/locales/localesApi.d.ts +5 -1
  41. package/dist/locales/localesApi.js +5 -1
  42. package/dist/locales/localesInterfaces.d.ts +19 -12
  43. package/dist/menus/menusApi.d.ts +6 -3
  44. package/dist/menus/menusApi.js +6 -3
  45. package/dist/menus/menusInterfaces.d.ts +60 -21
  46. package/dist/orders/ordersApi.d.ts +84 -66
  47. package/dist/orders/ordersApi.js +91 -71
  48. package/dist/orders/ordersInterfaces.d.ts +282 -86
  49. package/dist/pages/pagesApi.d.ts +101 -42
  50. package/dist/pages/pagesApi.js +93 -39
  51. package/dist/pages/pagesInterfaces.d.ts +218 -75
  52. package/dist/payments/paymentsApi.d.ts +53 -39
  53. package/dist/payments/paymentsApi.js +55 -40
  54. package/dist/payments/paymentsInterfaces.d.ts +121 -56
  55. package/dist/product-statuses/productStatusesApi.d.ts +17 -17
  56. package/dist/product-statuses/productStatusesApi.js +16 -19
  57. package/dist/product-statuses/productStatusesInterfaces.d.ts +43 -14
  58. package/dist/products/productsApi.d.ts +309 -177
  59. package/dist/products/productsApi.js +313 -167
  60. package/dist/products/productsInterfaces.d.ts +447 -81
  61. package/dist/system/systemApi.d.ts +42 -12
  62. package/dist/system/systemApi.js +43 -10
  63. package/dist/system/systemInterfaces.d.ts +7 -0
  64. package/dist/templates/templatesApi.d.ts +24 -20
  65. package/dist/templates/templatesApi.js +22 -21
  66. package/dist/templates/templatesInterfaces.d.ts +48 -22
  67. package/dist/templates-preview/templatesPreviewApi.d.ts +17 -17
  68. package/dist/templates-preview/templatesPreviewApi.js +16 -19
  69. package/dist/templates-preview/templatesPreviewInterfaces.d.ts +85 -32
  70. package/dist/users/usersApi.d.ts +59 -35
  71. package/dist/users/usersApi.js +62 -35
  72. package/dist/users/usersInterfaces.d.ts +136 -14
  73. package/dist/web-socket/wsApi.d.ts +4 -5
  74. package/dist/web-socket/wsApi.js +4 -5
  75. package/dist/web-socket/wsInterfaces.d.ts +2 -1
  76. package/package.json +20 -18
@@ -1,6 +1,7 @@
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
- * Represents an interface object of Products Api.
4
+ * @interface IProductApi
4
5
  *
5
6
  * @property {function} getProducts - Search for all product page objects with pagination and filtering.
6
7
  * @property {function} getProductsEmptyPage - Search for all product page objects with pagination that do not have a category.
@@ -8,34 +9,329 @@ 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.
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.
19
+ * @description This interface defines methods for retrieving and managing products in the system.
14
20
  */
15
21
  interface IProductApi {
16
- getProducts(body?: Array<IFilterParams>, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse | IError>;
22
+ /**
23
+ * Search for all products with pagination and filter.
24
+ *
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
+ ]
49
+ * @param {string} [langCode] - Language code. Default: "en_US".
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
+ }
62
+ * @return {IProductsResponse} Array with ProductEntity objects
63
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
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.
65
+ */
66
+ getProducts(body?: IFilterParams[], langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse | IError>;
67
+ /**
68
+ * Search for all product page objects with pagination that do not have a category.
69
+ *
70
+ * @param {string} [langCode] - Language code. Default: "en_US".
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
+ }
83
+ * @return {IProductsResponse} Array with ProductEntity objects.
84
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
85
+ */
17
86
  getProductsEmptyPage(langCode?: LangType, userQuery?: IProductsQuery): Promise<IProductsResponse | IError>;
18
- getProductsByPageId(id: number, body?: Array<IFilterParams>, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse | IError>;
87
+ /**
88
+ * Search for all products with pagination for the selected category.
89
+ *
90
+ * @param {number} id - Page id. Example: 12345.
91
+ * @param {IFilterParams[]} [body] - Request body. Default: [].
92
+ * @param {string} [langCode] - Language code. Default "en_US".
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
+ }
105
+ * @return {IProductsResponse} Array with ProductEntity objects
106
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
107
+ */
108
+ getProductsByPageId(id: number, body?: IFilterParams[], langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse | IError>;
109
+ /**
110
+ * Search for information about products and prices for the selected category.
111
+ *
112
+ * @param {string} [url] - Page url. Example: "23-laminat-floorwood-maxima".
113
+ * @param {string} [langCode] - Language code. Default: "en_US".
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
+ }
126
+ * @return {IProductsInfo} Array with ProductInformation objects.
127
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
128
+ */
19
129
  getProductsPriceByPageUrl(url: string, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsInfo | IError>;
20
- getProductsByPageUrl(url: string, body?: Array<IFilterParams>, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse | IError>;
130
+ /**
131
+ * Search for all products with pagination for the selected category.
132
+ *
133
+ * @param {string} url - Page url. Example: "23-laminat-floorwood-maxima".
134
+ * @param {IFilterParams[]} [body] - Request body. Default: [].
135
+ * @param {string} [langCode] - Language code. Default: "en_US".
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
+ }
148
+ * @return {IProductsResponse} Array with ProductEntity objects.
149
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
150
+ */
151
+ getProductsByPageUrl(url: string, body?: IFilterParams[], langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse | IError>;
152
+ /**
153
+ * Find all related product page objects.
154
+ *
155
+ * @param {number} [id] - Product page identifier for which to find relationship. Example: 12345.
156
+ * @param {string} [langCode] - Language code. Default: "en_US".
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
+ }
169
+ * @return {IProductsResponse} Array with ProductEntity objects
170
+ * @throws {IError} If there is an error during the fetch operation, it will return an error object.
171
+ */
21
172
  getRelatedProductsById(id: number, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse | IError>;
22
- getProductById(id: number, langCode: string): Promise<IProductEntity | IError>;
23
- getProductBlockById(id: number): Promise<Array<IProductBlock> | IError>;
24
- searchProduct(name: string, langCode: string): Promise<Array<IProductsEntity> | IError>;
173
+ /**
174
+ * Find products by its ids.
175
+ *
176
+ * @param {string} [ids] - Product page identifiers for which to find relationships. Example: "12345,67890".
177
+ * @param {string} [langCode] - Language code. Default: "en_US".
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
191
+ * @throws {IError} If there is an error during the fetch operation, it will return an error object.
192
+ */
193
+ getProductsByIds(ids: string, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsEntity[] | IError>;
194
+ /**
195
+ * Retrieve one product object.
196
+ *
197
+ * @param {number} id - Product id. Example: 12345.
198
+ * @param {string} [langCode] - Language code. Default: "en_US".
199
+ * @return {IProductsEntity} ProductEntity object.
200
+ * @throws {IError} If there is an error during the fetch operation, it will return an error object.
201
+ */
202
+ getProductById(id: number, langCode?: string): Promise<IProductsEntity | IError>;
203
+ /**
204
+ * Getting a product block object by product id.
205
+ *
206
+ * @param {number} id - Product id. Example: 12345.
207
+ * @return {IProductBlock}
208
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
209
+ */
210
+ getProductBlockById(id: number): Promise<IProductBlock[] | IError>;
211
+ /**
212
+ * Quick search for product page objects with limited output.
213
+ *
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'.
215
+ * @param {string} [langCode] - Language code. Default: "en_US".
216
+ * @return {IProductsEntity[]} Array with ProductEntity objects
217
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
218
+ */
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>;
25
321
  }
26
322
  /**
27
- * Represents a product query parameters object.
323
+ * @interface IProductsQuery
28
324
  *
29
- * @interface
30
- * @property {number} offset - Parameter for pagination, default 0.
31
- * @property {number} limit - Parameter for pagination, default 30.
32
- * @property {string | null} statusMarker - Product page status id, default null.
33
- * @property {string | null} conditionValue - The value that is being searched for, default null.
34
- * @property {string | null} conditionMarker - Id of the filter condition by which the values are filtered, default null.
35
- * @property {string | null} attributeMarker - The text identifier of the indexed attribute by which values are filtered, default null.
36
- * @property {string} sortOrder - Sort order 'DESC' | 'ASC', default 'DESC'.
37
- * @property {string} langCode - localization language code (used only when searching with a filter, default 'en_US'.
38
- * @property {string} sortKey - Field for sorting (default - null)
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 | 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".
334
+ * @description This interface defines the structure of a query for retrieving products, including pagination, sorting, and filtering parameters.
39
335
  */
40
336
  interface IProductsQuery {
41
337
  offset: number;
@@ -50,117 +346,187 @@ interface IProductsQuery {
50
346
  [key: string]: any;
51
347
  }
52
348
  /**
53
- * Represents a product POST data object.
349
+ * @interface IFilterParams
54
350
  *
55
- * @interface
56
- * @property {number | null} conditionValue - The value that is being searched for, default null.
57
- * @property {string | null} conditionMarker - Id of the filter condition by which the values are filtered, default null.
58
- * @property {string | null} attributeMarker - The text identifier of the indexed attribute by which values are filtered, default null.
59
- * @property {Array<string> | null} pageUrl - Url of the category page object.
60
- * @property {string | null} statusMarker - Text identifier of the product page status (default not set).
61
- * @property {string | null} title - Product name.
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".
357
+ * @property {boolean} [isNested] - Flag for nested attributes, default false. Example: true.
358
+ * @description This interface defines the structure of filter parameters used for querying products, including conditions, attributes, and pagination.
62
359
  */
63
360
  interface IFilterParams {
64
361
  attributeMarker: string;
65
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;
66
363
  conditionValue: number | string | null;
67
- pageUrl?: Array<string> | null;
364
+ pageUrl?: string | null;
68
365
  statusMarker?: string;
69
366
  title?: string;
70
367
  isNested?: boolean;
71
368
  }
72
369
  /**
73
- * Represents a product entity object.
370
+ * @interface IProductsEntity
74
371
  *
75
- * @interface
76
- * @property {number} id - The unique identifier.
77
- * @property {object} additional - Additional value from the index.
78
- * @property {Record<string, any>} localizeInfos - The name of the products, taking into account localization.
79
- * @property {boolean} isVisible - A sign of page visibility.
80
- * @property {boolean} isPositionLocked - Sorting position lock indicator (optional).
81
- * @property {number | null} statusIdentifier - Product page status identifiers (may be null).
82
- * @property {Array<number>} relatedIds - Ids of related product pages.
83
- * @property {string} attributeSetIdentifier - Set of attributes id.
84
- * @property {boolean} isSync - Indication of page indexing.
85
- * @property {number} price - The value of the product page price taken from the index.
86
- * @property {string} templateIdentifier - User id of the linked template.
87
- * @property {string} shortDescTemplateIdentifier - User id of the linked template for a short description.
88
- * @property {Record<string, any>} statusLocalizeInfos - JSON description of the item status object, taking into account the language.
89
- * @property {number} position - Item number (for sorting).
372
+ * @property {number} id - The unique identifier. Example: 12345.
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]
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
+ ]
403
+ * @property {boolean} isPositionLocked - Sorting position lock indicator (optional). Example: false.
404
+ * @property {number[]} relatedIds - Ids of related product pages. Example: [12345, 67890].
405
+ * @description This interface defines the structure of a product entity, including its identifiers, attributes, and related information.
90
406
  */
91
407
  interface IProductsEntity {
92
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;
93
418
  additional: {
94
419
  prices: {
95
420
  min: number;
96
421
  max: number;
97
422
  };
98
423
  };
99
- isPositionLocked?: boolean;
100
- localizeInfos: Record<string, any>;
101
- isVisible: boolean;
102
- statusIdentifier: string | null;
103
- attributeSetIdentifier: string | null;
424
+ sku: string | null;
104
425
  isSync: number | boolean;
105
- price: number | null;
106
- templateIdentifier: string | null;
107
- shortDescTemplateIdentifier: string | null;
108
- statusLocalizeInfos: Record<string, any>;
109
426
  attributeValues: AttributeType;
110
- position: number;
111
- sku: string | null;
427
+ categories: string[];
428
+ isVisible: boolean;
429
+ productPages?: Array<Record<string, any>> | Record<string, any>;
430
+ blocks?: string[];
431
+ isPositionLocked?: boolean;
432
+ relatedIds?: number[];
112
433
  }
113
434
  /**
114
- * IProductEntity
435
+ * @interface IProductsResponse
115
436
  *
116
- * @interface
117
- * @property {Array<string>} blocks
118
- * @property {Array<Record<string, any>> | Record<string, any>} productPages
437
+ * @property {number} total - The total number of products found. Example: 100.
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
+ ]
449
+ * @description This interface defines the structure of a response containing multiple product entities, including the total count and an array of product items.
119
450
  */
120
- interface IProductEntity extends IProductsEntity {
121
- blocks?: Array<string>;
122
- productPages?: Array<Record<string, any>> | Record<string, any>;
451
+ interface IProductsResponse {
452
+ items: IProductsEntity[];
453
+ total: number;
123
454
  }
124
455
  /**
125
- * IProductsResponse
456
+ * @interface IProductsCount
126
457
  *
127
- * @interface
128
- * @property {number} total
129
- * @property {Array<IProductsEntity>} items
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.
130
462
  */
131
- interface IProductsResponse {
132
- total: number;
133
- items: Array<IProductsEntity>;
463
+ interface IProductsCount {
464
+ totalAll: number;
465
+ totalInCategory: number;
466
+ totalInCategoryWithNested: number;
134
467
  }
135
468
  /**
136
- * IProductsInfo
469
+ * @interface IProductsInfo
137
470
  *
138
- * @interface
139
- * @property {number} total
140
- * @property {Array<IProductInfo>} items
471
+ * @property {number} total - The total number of products found. Example: 100.
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
+ ]
483
+ * @description This interface defines the structure of a response containing product information, including the total count and an array of product items.
141
484
  */
142
485
  interface IProductsInfo {
143
- total: number;
144
486
  items: Array<IProductInfo>;
487
+ total: number;
145
488
  }
146
489
  /**
147
- * IProductInfo
490
+ * @interface IProductInfo
148
491
  *
149
- * @interface
150
- * @property {number} id
151
- * @property {number} price
492
+ * @property {number} id - The unique identifier of the product. Example: 12345.
493
+ * @property {number} price - The price of the product. Example: 150.00.
494
+ * @description This interface defines the structure of a product information object, including its identifier and price.
152
495
  */
153
496
  interface IProductInfo {
154
497
  id: number;
155
498
  price: number;
156
499
  }
157
500
  /**
158
- * IProductBlock
501
+ * @interface IProductBlock
502
+ *
503
+ * @property {number} id - Unique identifier of the product block. Example: 3289.
504
+ * @property {number | null} attributeSetIdentifier - Identifier of the attribute set used in the product block, or null if not applicable. Example: 67890.
505
+ * @property {ILocalizeInfo} localizeInfos - Localization information for the product block. Example:
506
+ {
507
+ "title": "Box"
508
+ }
509
+ * @property {number} version - Version of the product block entity. Example: 1.
510
+ * @property {number} position - Position of the product block in a list or layout. Example: 1.
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".
515
+ * @property {boolean} isVisible - Indicates whether the product block is visible. Example: true.
516
+ * @property {boolean} isSync - Indicates whether the product block is synchronized. Example: false.
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
+ ]
524
+ * @description This interface defines the structure of a product block entity, including its identifiers, attributes, and custom settings.
159
525
  */
160
526
  interface IProductBlock {
161
527
  id: number;
162
528
  attributeSetIdentifier: number | null;
163
- localizeInfos: Record<string, any>;
529
+ localizeInfos: ILocalizeInfo;
164
530
  version: number;
165
531
  position: number;
166
532
  identifier: string;
@@ -187,4 +553,4 @@ interface IProductBlock {
187
553
  isSync: boolean;
188
554
  attributeValues: AttributeType;
189
555
  }
190
- export type { IFilterParams, IProductApi, IProductBlock, IProductEntity, IProductInfo, IProductsEntity, IProductsInfo, IProductsQuery, IProductsResponse, };
556
+ export type { IFilterParams, IProductApi, IProductBlock, IProductInfo, IProductsCount, IProductsEntity, IProductsInfo, IProductsQuery, IProductsResponse, };