oneentry 1.0.152 → 1.0.154

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 (70) hide show
  1. package/changelog.md +49 -0
  2. package/dist/admins/adminsApi.d.ts +2 -1
  3. package/dist/admins/adminsApi.js +2 -1
  4. package/dist/admins/adminsInterfaces.d.ts +1 -1
  5. package/dist/attribute-sets/attributeSetsApi.d.ts +4 -0
  6. package/dist/attribute-sets/attributeSetsApi.js +4 -0
  7. package/dist/auth-provider/authProviderApi.d.ts +14 -1
  8. package/dist/auth-provider/authProviderApi.js +14 -1
  9. package/dist/base/asyncModules.d.ts +21 -2
  10. package/dist/base/asyncModules.js +74 -225
  11. package/dist/base/stateModule.d.ts +4 -13
  12. package/dist/base/stateModule.js +12 -96
  13. package/dist/base/syncModules.d.ts +4 -0
  14. package/dist/base/syncModules.js +5 -1
  15. package/dist/blocks/blocksApi.d.ts +54 -11
  16. package/dist/blocks/blocksApi.js +90 -73
  17. package/dist/blocks/blocksInterfaces.d.ts +18 -9
  18. package/dist/discounts/discountsApi.d.ts +5 -0
  19. package/dist/discounts/discountsApi.js +5 -0
  20. package/dist/events/eventsApi.d.ts +7 -0
  21. package/dist/events/eventsApi.js +11 -28
  22. package/dist/file-uploading/fileUploadingApi.d.ts +4 -1
  23. package/dist/file-uploading/fileUploadingApi.js +4 -1
  24. package/dist/file-uploading/fileUploadingInterfaces.d.ts +1 -1
  25. package/dist/filters/filtersApi.d.ts +1 -0
  26. package/dist/filters/filtersApi.js +1 -0
  27. package/dist/forms/formsApi.d.ts +2 -0
  28. package/dist/forms/formsApi.js +2 -0
  29. package/dist/forms-data/formsDataApi.d.ts +5 -0
  30. package/dist/forms-data/formsDataApi.js +5 -0
  31. package/dist/general-types/generalTypesApi.d.ts +1 -0
  32. package/dist/general-types/generalTypesApi.js +1 -0
  33. package/dist/index.js +12 -0
  34. package/dist/integration-collections/integrationCollectionsApi.d.ts +10 -1
  35. package/dist/integration-collections/integrationCollectionsApi.js +10 -1
  36. package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +1 -1
  37. package/dist/locales/localesApi.d.ts +1 -0
  38. package/dist/locales/localesApi.js +1 -0
  39. package/dist/menus/menusApi.d.ts +1 -0
  40. package/dist/menus/menusApi.js +1 -0
  41. package/dist/orders/ordersApi.d.ts +25 -1
  42. package/dist/orders/ordersApi.js +36 -12
  43. package/dist/orders/ordersInterfaces.d.ts +5 -2
  44. package/dist/pages/pagesApi.d.ts +9 -0
  45. package/dist/pages/pagesApi.js +35 -39
  46. package/dist/pages/pagesInterfaces.d.ts +5 -0
  47. package/dist/payments/paymentsApi.d.ts +6 -0
  48. package/dist/payments/paymentsApi.js +6 -0
  49. package/dist/product-statuses/productStatusesApi.d.ts +3 -0
  50. package/dist/product-statuses/productStatusesApi.js +3 -0
  51. package/dist/products/productsApi.d.ts +39 -64
  52. package/dist/products/productsApi.js +33 -61
  53. package/dist/products/productsInterfaces.d.ts +76 -72
  54. package/dist/sitemap/sitemapApi.d.ts +2 -0
  55. package/dist/sitemap/sitemapApi.js +2 -0
  56. package/dist/subscriptions/subscriptionsApi.d.ts +5 -0
  57. package/dist/subscriptions/subscriptionsApi.js +7 -14
  58. package/dist/system/systemApi.d.ts +3 -0
  59. package/dist/system/systemApi.js +3 -0
  60. package/dist/templates/templatesApi.d.ts +3 -0
  61. package/dist/templates/templatesApi.js +3 -0
  62. package/dist/templates-preview/templatesPreviewApi.d.ts +2 -0
  63. package/dist/templates-preview/templatesPreviewApi.js +2 -0
  64. package/dist/user-activity/userActivityApi.d.ts +1 -0
  65. package/dist/user-activity/userActivityApi.js +1 -0
  66. package/dist/users/usersApi.d.ts +14 -0
  67. package/dist/users/usersApi.js +14 -0
  68. package/dist/web-socket/wsApi.d.ts +1 -1
  69. package/dist/web-socket/wsApi.js +1 -1
  70. package/package.json +4 -1
@@ -1,7 +1,7 @@
1
1
  import AsyncModules from '../base/asyncModules';
2
2
  import type StateModule from '../base/stateModule';
3
3
  import type { IError } from '../base/utils';
4
- import type { IAggregatedProductGroup, IFilterParams, IProductBlock, IProductsApi, IProductsCount, IProductsEntity, IProductsInfo, IProductsQuery, IProductsResponse, IVectorSearchProducts } from './productsInterfaces';
4
+ import type { IAggregatedProductGroup, IFilterParams, IProductBlock, IProductsApi, IProductsByIdsQuery, IProductsCount, IProductsEntity, IProductsInfo, IProductsPriceQuery, IProductsQueryBase, IProductsRelatedQuery, IProductsResponse, IVectorSearchProducts } from './productsInterfaces';
5
5
  /**
6
6
  * Controllers for working with product pages
7
7
  * @handle /api/content/products
@@ -45,51 +45,44 @@ export default class ProductsApi extends AsyncModules implements IProductsApi {
45
45
  }
46
46
  ]
47
47
  * @param {string} [langCode] - Language code. Default: "en_US".
48
- * @param {IProductsQuery} [userQuery] - Optional set query parameters.
48
+ * @param {IProductsQueryBase} [userQuery] - Optional set query parameters.
49
49
  * @example
50
50
  {
51
51
  "limit": 30,
52
52
  "offset": 0,
53
53
  "sortOrder": "DESC",
54
54
  "sortKey": "id",
55
- "signPrice": "orders",
56
- "templateMarker": "template_12345",
57
- "statusMarker": "in_stock",
58
- "conditionValue": "new",
59
- "conditionMarker": "eq",
60
- "attributeMarker": "color"
55
+ "signPrice": "orders"
61
56
  }
62
- * @param {string} [userQuery.signPrice] - Order storage marker for price fixing.
57
+ * @param {string} [userQuery.signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time. Example: "orders_storage".
58
+ * @see {@link https://js-sdk.oneentry.cloud/docs/products/#Fixing-the-price-signPrice Fixing the price} documentation.
63
59
  * @param {string} [userQuery.sortOrder] - Sorting order parameter.
64
60
  * @returns {Promise<IProductsResponse | IError>} Products response, or IError when isShell=true
65
61
  * @throws {IError} When isShell=false and an error occurs during the fetch
66
62
  * @description Fetch products with optional filters and pagination.
63
+ * @see {@link https://js-sdk.oneentry.cloud/docs/products/getProducts getProducts} documentation.
67
64
  */
68
- getProducts(body?: IFilterParams[], langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse | IError>;
65
+ getProducts(body?: IFilterParams[], langCode?: string, userQuery?: IProductsQueryBase): Promise<IProductsResponse | IError>;
69
66
  /**
70
67
  * Search for all product page objects with pagination (and aggregation) that do not have a category.
71
68
  * @handleName getProductsEmptyPage
72
69
  * @param {object} [body] - Request body. Default: {}.
73
70
  * @param {string} [langCode] - Language code. Default: "en_US".
74
- * @param {IProductsQuery} [userQuery] - Optional set query parameters.
71
+ * @param {IProductsQueryBase} [userQuery] - Optional set query parameters.
75
72
  * @example
76
73
  {
77
74
  "limit": 30,
78
75
  "offset": 0,
79
76
  "sortOrder": "DESC",
80
77
  "sortKey": "id",
81
- "signPrice": "orders",
82
- "templateMarker": "template_12345",
83
- "statusMarker": "in_stock",
84
- "conditionValue": "new",
85
- "conditionMarker": "eq",
86
- "attributeMarker": "color"
78
+ "signPrice": "orders"
87
79
  }
88
80
  * @returns {Promise<IAggregatedProductGroup[] | IError>} Array with AggregatedProductGroup objects.
89
81
  * @throws {IError} When isShell=false and an error occurs during the fetch
90
82
  * @description Search for all product page objects with pagination (and aggregation) that do not have a category.
83
+ * @see {@link https://js-sdk.oneentry.cloud/docs/products/getProductsEmptyPage getProductsEmptyPage} documentation.
91
84
  */
92
- getProductsEmptyPage(body?: object, langCode?: string, userQuery?: IProductsQuery): Promise<IAggregatedProductGroup[] | IError>;
85
+ getProductsEmptyPage(body?: object, langCode?: string, userQuery?: IProductsQueryBase): Promise<IAggregatedProductGroup[] | IError>;
93
86
  /**
94
87
  * Search for all products with pagination for the selected category.
95
88
  * @handleName getProductsByPageId
@@ -120,49 +113,41 @@ export default class ProductsApi extends AsyncModules implements IProductsApi {
120
113
  }
121
114
  ]
122
115
  * @param {string} [langCode] - Language code. Default: "en_US".
123
- * @param {IProductsQuery} [userQuery] - Optional set query parameters.
116
+ * @param {IProductsQueryBase} [userQuery] - Optional set query parameters.
124
117
  * @example
125
118
  {
126
119
  "limit": 30,
127
120
  "offset": 0,
128
121
  "sortOrder": "DESC",
129
122
  "sortKey": "id",
130
- "signPrice": "orders",
131
- "templateMarker": "template_12345",
132
- "statusMarker": "in_stock",
133
- "conditionValue": "new",
134
- "conditionMarker": "eq",
135
- "attributeMarker": "color"
123
+ "signPrice": "orders"
136
124
  }
137
125
  * @returns {Promise<IProductsResponse | IError>} Array with ProductEntity objects
138
126
  * @throws {IError} When isShell=false and an error occurs during the fetch
139
127
  * @description Fetch products by page ID with optional filters and pagination.
128
+ * @see {@link https://js-sdk.oneentry.cloud/docs/products/getProductsByPageId getProductsByPageId} documentation.
140
129
  */
141
- getProductsByPageId(id: number, body?: IFilterParams[], langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse | IError>;
130
+ getProductsByPageId(id: number, body?: IFilterParams[], langCode?: string, userQuery?: IProductsQueryBase): Promise<IProductsResponse | IError>;
142
131
  /**
143
132
  * Search for information about products and prices for the selected category.
144
133
  * @handleName getProductsPriceByPageUrl
145
134
  * @param {string} [url] - Page url. Example: "23-laminat-floorwood-maxima".
146
135
  * @param {string} [langCode] - Language code. Default: "en_US".
147
- * @param {IProductsQuery} [userQuery] - Optional set query parameters.
136
+ * @param {IProductsPriceQuery} [userQuery] - Optional set query parameters.
148
137
  * @example
149
138
  {
150
139
  "limit": 30,
151
140
  "offset": 0,
152
141
  "sortOrder": "DESC",
153
- "sortKey": "id",
154
142
  "signPrice": "orders",
155
- "templateMarker": "template_12345",
156
- "statusMarker": "in_stock",
157
- "conditionValue": "new",
158
- "conditionMarker": "eq",
159
- "attributeMarker": "color"
143
+ "statusMarker": "in_stock"
160
144
  }
161
145
  * @returns {Promise<IProductsInfo | IError>} Array with ProductInformation objects.
162
146
  * @throws {IError} When isShell=false and an error occurs during the fetch
163
147
  * @description Search for information about products and prices for the selected category.
148
+ * @see {@link https://js-sdk.oneentry.cloud/docs/products/getProductsPriceByPageUrl getProductsPriceByPageUrl} documentation.
164
149
  */
165
- getProductsPriceByPageUrl(url: string, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsInfo | IError>;
150
+ getProductsPriceByPageUrl(url: string, langCode?: string, userQuery?: IProductsPriceQuery): Promise<IProductsInfo | IError>;
166
151
  /**
167
152
  * Search for all products with pagination for the selected category.
168
153
  * @handleName getProductsByPageUrl
@@ -193,31 +178,27 @@ export default class ProductsApi extends AsyncModules implements IProductsApi {
193
178
  }
194
179
  ]
195
180
  * @param {string} [langCode] - Language code. Default: "en_US".
196
- * @param {IProductsQuery} [userQuery] - Optional set query parameters.
181
+ * @param {IProductsQueryBase} [userQuery] - Optional set query parameters.
197
182
  * @example
198
183
  {
199
184
  "limit": 30,
200
185
  "offset": 0,
201
186
  "sortOrder": "DESC",
202
187
  "sortKey": "id",
203
- "signPrice": "orders",
204
- "templateMarker": "template_12345",
205
- "statusMarker": "in_stock",
206
- "conditionValue": "new",
207
- "conditionMarker": "eq",
208
- "attributeMarker": "color"
188
+ "signPrice": "orders"
209
189
  }
210
190
  * @returns {Promise<IProductsResponse | IError>} Array with ProductEntity objects.
211
191
  * @throws {IError} When isShell=false and an error occurs during the fetch
212
192
  * @description Search for all products with pagination for the selected category.
193
+ * @see {@link https://js-sdk.oneentry.cloud/docs/products/getProductsByPageUrl getProductsByPageUrl} documentation.
213
194
  */
214
- getProductsByPageUrl(url: string, body?: IFilterParams[], langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse | IError>;
195
+ getProductsByPageUrl(url: string, body?: IFilterParams[], langCode?: string, userQuery?: IProductsQueryBase): Promise<IProductsResponse | IError>;
215
196
  /**
216
197
  * Find all related product page objects.
217
198
  * @handleName getRelatedProductsById
218
199
  * @param {number} [id] - Product page identifier for which to find relationship. Example: 12345.
219
200
  * @param {string} [langCode] - Language code. Default: "en_US".
220
- * @param {IProductsQuery} [userQuery] - Optional set query parameters.
201
+ * @param {IProductsRelatedQuery} [userQuery] - Optional set query parameters.
221
202
  * @example
222
203
  {
223
204
  "limit": 30,
@@ -225,11 +206,8 @@ export default class ProductsApi extends AsyncModules implements IProductsApi {
225
206
  "sortOrder": "DESC",
226
207
  "sortKey": "id",
227
208
  "signPrice": "orders",
228
- "templateMarker": "template_12345",
229
209
  "statusMarker": "in_stock",
230
- "conditionValue": "new",
231
- "conditionMarker": "eq",
232
- "attributeMarker": "color"
210
+ "templateMarker": "template_12345"
233
211
  }
234
212
  * @param {number} [userQuery.limit] - Optional parameter for pagination. Default: 30.
235
213
  * @param {number} [userQuery.offset] - Optional parameter for pagination. Default: 0.
@@ -238,40 +216,30 @@ export default class ProductsApi extends AsyncModules implements IProductsApi {
238
216
  * @returns {Promise<IProductsResponse | IError>} Array with ProductEntity objects
239
217
  * @throws {IError} When isShell=false and an error occurs during the fetch
240
218
  * @description Find all related product page objects.
219
+ * @see {@link https://js-sdk.oneentry.cloud/docs/products/getRelatedProductsById getRelatedProductsById} documentation.
241
220
  */
242
- getRelatedProductsById(id: number, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse | IError>;
221
+ getRelatedProductsById(id: number, langCode?: string, userQuery?: IProductsRelatedQuery): Promise<IProductsResponse | IError>;
243
222
  /**
244
223
  * Find products by its ids.
245
224
  * @handleName getProductsByIds
246
225
  * @param {string} ids - Product page identifiers for which to find relationships. Example: "12345,67890".
247
226
  * @param {string} [langCode] - Language code. Default "en_US".
248
- * @param {IProductsQuery} [userQuery] - Optional set query parameters.
227
+ * @param {IProductsByIdsQuery} [userQuery] - Optional set query parameters.
249
228
  * @example
250
229
  {
251
230
  "limit": 30,
252
231
  "offset": 0,
253
- "sortOrder": "DESC",
254
- "sortKey": "id",
255
- "signPrice": "orders",
256
- "templateMarker": "template_12345",
257
- "statusMarker": "in_stock",
258
- "conditionValue": "new",
259
- "conditionMarker": "eq",
260
- "attributeMarker": "color"
232
+ "signPrice": "orders"
261
233
  }
262
234
  * @param {number} [userQuery.limit] - Optional parameter for pagination. Default: 30.
263
235
  * @param {number} [userQuery.offset] - Optional parameter for pagination. Default: 0.
264
- * @param {string} [userQuery.sortOrder] - Optional sorting order "DESC" | "ASC". Example: "DESC".
265
- * @param {string} [userQuery.sortKey] - Optional field to sort by ("id", "title", "date", "price", "position", "status"). Example: "id".
266
- * @param {string} [userQuery.statusMarker] - Optional identifier of the product page status. Example: "in_stock".
267
- * @param {string} [userQuery.conditionValue] - Optional value that is being searched. Example: "new".
268
- * @param {string} [userQuery.conditionMarker] - Optional identifier of the filter condition by which values are filtered. Example: "eq".
269
- * @param {string} [userQuery.attributeMarker] - Optional text identifier of the indexed attribute by which values are filtered. Example: "color".
236
+ * @param {string} [userQuery.signPrice] - Order storage marker for price fixing.
270
237
  * @returns {Promise<IProductsEntity[] | IError>} Array with ProductEntity objects
271
238
  * @throws {IError} When isShell=false and an error occurs during the fetch
272
239
  * @description Find products by its ids.
240
+ * @see {@link https://js-sdk.oneentry.cloud/docs/products/getProductsByIds getProductsByIds} documentation.
273
241
  */
274
- getProductsByIds(ids: string, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsEntity[] | IError>;
242
+ getProductsByIds(ids: string, langCode?: string, userQuery?: IProductsByIdsQuery): Promise<IProductsEntity[] | IError>;
275
243
  /**
276
244
  * Retrieve one product object.
277
245
  * @handleName getProductById
@@ -281,6 +249,7 @@ export default class ProductsApi extends AsyncModules implements IProductsApi {
281
249
  * @returns {Promise<IProductsEntity | IError>} ProductEntity object.
282
250
  * @throws {IError} When isShell=false and an error occurs during the fetch
283
251
  * @description Retrieve one product object.
252
+ * @see {@link https://js-sdk.oneentry.cloud/docs/products/getProductById getProductById} documentation.
284
253
  */
285
254
  getProductById(id: number, langCode?: string, isNormalized?: boolean): Promise<IProductsEntity | IError>;
286
255
  /**
@@ -290,6 +259,7 @@ export default class ProductsApi extends AsyncModules implements IProductsApi {
290
259
  * @returns {Promise<IProductBlock | IError>} - Product block object.
291
260
  * @throws {IError} When isShell=false and an error occurs during the fetch
292
261
  * @description Getting a product block object by product id.
262
+ * @see {@link https://js-sdk.oneentry.cloud/docs/products/getProductBlockById getProductBlockById} documentation.
293
263
  */
294
264
  getProductBlockById(id: number): Promise<IProductBlock[] | IError>;
295
265
  /**
@@ -300,6 +270,7 @@ export default class ProductsApi extends AsyncModules implements IProductsApi {
300
270
  * @returns {Promise<IProductsEntity[] | IError>} Array with ProductEntity objects
301
271
  * @throws {IError} When isShell=false and an error occurs during the fetch
302
272
  * @description Quick search for product page objects with limited output.
273
+ * @see {@link https://js-sdk.oneentry.cloud/docs/products/searchProduct searchProduct} documentation.
303
274
  */
304
275
  searchProduct(name: string, langCode?: string): Promise<IProductsEntity[] | IError>;
305
276
  /**
@@ -322,6 +293,7 @@ export default class ProductsApi extends AsyncModules implements IProductsApi {
322
293
  * @returns {Promise<IProductsCount | IError>} Object with product items count.
323
294
  * @throws {IError} When isShell=false and an error occurs during the fetch
324
295
  * @description This method calculates and returns the total number of products present across the entire catalog, optionally applying specified filters.
296
+ * @see {@link https://js-sdk.oneentry.cloud/docs/products/getProductsCount getProductsCount} documentation.
325
297
  */
326
298
  getProductsCount(body?: any[]): Promise<IProductsCount | IError>;
327
299
  /**
@@ -345,6 +317,7 @@ export default class ProductsApi extends AsyncModules implements IProductsApi {
345
317
  * @returns {Promise<IProductsCount | IError>} Object with product items count.
346
318
  * @throws {IError} When isShell=false and an error occurs during the fetch
347
319
  * @description This method calculates and returns the number of products available on a given catalog page, identified by its page ID, with optional filtering.
320
+ * @see {@link https://js-sdk.oneentry.cloud/docs/products/getProductsCountByPageId getProductsCountByPageId} documentation.
348
321
  */
349
322
  getProductsCountByPageId(id: string, body?: any[]): Promise<IProductsCount | IError>;
350
323
  /**
@@ -368,6 +341,7 @@ export default class ProductsApi extends AsyncModules implements IProductsApi {
368
341
  * @returns {Promise<IProductsCount | IError>} Object with product items count.
369
342
  * @throws {IError} When isShell=false and an error occurs during the fetch
370
343
  * @description This method calculates and returns the number of products available on a given catalog page, identified by its URL, with optional filtering.
344
+ * @see {@link https://js-sdk.oneentry.cloud/docs/products/getProductsCountByPageUrl getProductsCountByPageUrl} documentation.
371
345
  */
372
346
  /**
373
347
  * Semantic (vector) search for products.
@@ -379,6 +353,7 @@ export default class ProductsApi extends AsyncModules implements IProductsApi {
379
353
  * @returns {Promise<IProductsEntity[] | IError>} Array with ProductEntity objects.
380
354
  * @throws {IError} When isShell=false and an error occurs during the fetch
381
355
  * @description This method performs a semantic (vector) search for products.
356
+ * @see {@link https://js-sdk.oneentry.cloud/docs/products/getProductsByVectorSearch getProductsByVectorSearch} documentation.
382
357
  */
383
358
  getProductsByVectorSearch(body: IVectorSearchProducts, langCode?: string, offset?: number, limit?: number): Promise<IProductsEntity[] | IError>;
384
359
  /**
@@ -50,25 +50,22 @@ class ProductsApi extends asyncModules_1.default {
50
50
  }
51
51
  ]
52
52
  * @param {string} [langCode] - Language code. Default: "en_US".
53
- * @param {IProductsQuery} [userQuery] - Optional set query parameters.
53
+ * @param {IProductsQueryBase} [userQuery] - Optional set query parameters.
54
54
  * @example
55
55
  {
56
56
  "limit": 30,
57
57
  "offset": 0,
58
58
  "sortOrder": "DESC",
59
59
  "sortKey": "id",
60
- "signPrice": "orders",
61
- "templateMarker": "template_12345",
62
- "statusMarker": "in_stock",
63
- "conditionValue": "new",
64
- "conditionMarker": "eq",
65
- "attributeMarker": "color"
60
+ "signPrice": "orders"
66
61
  }
67
- * @param {string} [userQuery.signPrice] - Order storage marker for price fixing.
62
+ * @param {string} [userQuery.signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time. Example: "orders_storage".
63
+ * @see {@link https://js-sdk.oneentry.cloud/docs/products/#Fixing-the-price-signPrice Fixing the price} documentation.
68
64
  * @param {string} [userQuery.sortOrder] - Sorting order parameter.
69
65
  * @returns {Promise<IProductsResponse | IError>} Products response, or IError when isShell=true
70
66
  * @throws {IError} When isShell=false and an error occurs during the fetch
71
67
  * @description Fetch products with optional filters and pagination.
68
+ * @see {@link https://js-sdk.oneentry.cloud/docs/products/getProducts getProducts} documentation.
72
69
  */
73
70
  async getProducts(body = [], langCode = this.state.lang, userQuery) {
74
71
  const query = {
@@ -85,23 +82,19 @@ class ProductsApi extends asyncModules_1.default {
85
82
  * @handleName getProductsEmptyPage
86
83
  * @param {object} [body] - Request body. Default: {}.
87
84
  * @param {string} [langCode] - Language code. Default: "en_US".
88
- * @param {IProductsQuery} [userQuery] - Optional set query parameters.
85
+ * @param {IProductsQueryBase} [userQuery] - Optional set query parameters.
89
86
  * @example
90
87
  {
91
88
  "limit": 30,
92
89
  "offset": 0,
93
90
  "sortOrder": "DESC",
94
91
  "sortKey": "id",
95
- "signPrice": "orders",
96
- "templateMarker": "template_12345",
97
- "statusMarker": "in_stock",
98
- "conditionValue": "new",
99
- "conditionMarker": "eq",
100
- "attributeMarker": "color"
92
+ "signPrice": "orders"
101
93
  }
102
94
  * @returns {Promise<IAggregatedProductGroup[] | IError>} Array with AggregatedProductGroup objects.
103
95
  * @throws {IError} When isShell=false and an error occurs during the fetch
104
96
  * @description Search for all product page objects with pagination (and aggregation) that do not have a category.
97
+ * @see {@link https://js-sdk.oneentry.cloud/docs/products/getProductsEmptyPage getProductsEmptyPage} documentation.
105
98
  */
106
99
  async getProductsEmptyPage(body = {}, langCode = this.state.lang, userQuery) {
107
100
  const query = { ...userQuery, langCode };
@@ -138,23 +131,19 @@ class ProductsApi extends asyncModules_1.default {
138
131
  }
139
132
  ]
140
133
  * @param {string} [langCode] - Language code. Default: "en_US".
141
- * @param {IProductsQuery} [userQuery] - Optional set query parameters.
134
+ * @param {IProductsQueryBase} [userQuery] - Optional set query parameters.
142
135
  * @example
143
136
  {
144
137
  "limit": 30,
145
138
  "offset": 0,
146
139
  "sortOrder": "DESC",
147
140
  "sortKey": "id",
148
- "signPrice": "orders",
149
- "templateMarker": "template_12345",
150
- "statusMarker": "in_stock",
151
- "conditionValue": "new",
152
- "conditionMarker": "eq",
153
- "attributeMarker": "color"
141
+ "signPrice": "orders"
154
142
  }
155
143
  * @returns {Promise<IProductsResponse | IError>} Array with ProductEntity objects
156
144
  * @throws {IError} When isShell=false and an error occurs during the fetch
157
145
  * @description Fetch products by page ID with optional filters and pagination.
146
+ * @see {@link https://js-sdk.oneentry.cloud/docs/products/getProductsByPageId getProductsByPageId} documentation.
158
147
  */
159
148
  async getProductsByPageId(id, body = [], langCode = this.state.lang, userQuery) {
160
149
  const query = { ...userQuery };
@@ -168,23 +157,19 @@ class ProductsApi extends asyncModules_1.default {
168
157
  * @handleName getProductsPriceByPageUrl
169
158
  * @param {string} [url] - Page url. Example: "23-laminat-floorwood-maxima".
170
159
  * @param {string} [langCode] - Language code. Default: "en_US".
171
- * @param {IProductsQuery} [userQuery] - Optional set query parameters.
160
+ * @param {IProductsPriceQuery} [userQuery] - Optional set query parameters.
172
161
  * @example
173
162
  {
174
163
  "limit": 30,
175
164
  "offset": 0,
176
165
  "sortOrder": "DESC",
177
- "sortKey": "id",
178
166
  "signPrice": "orders",
179
- "templateMarker": "template_12345",
180
- "statusMarker": "in_stock",
181
- "conditionValue": "new",
182
- "conditionMarker": "eq",
183
- "attributeMarker": "color"
167
+ "statusMarker": "in_stock"
184
168
  }
185
169
  * @returns {Promise<IProductsInfo | IError>} Array with ProductInformation objects.
186
170
  * @throws {IError} When isShell=false and an error occurs during the fetch
187
171
  * @description Search for information about products and prices for the selected category.
172
+ * @see {@link https://js-sdk.oneentry.cloud/docs/products/getProductsPriceByPageUrl getProductsPriceByPageUrl} documentation.
188
173
  */
189
174
  async getProductsPriceByPageUrl(url, langCode = this.state.lang, userQuery) {
190
175
  const query = {
@@ -224,23 +209,19 @@ class ProductsApi extends asyncModules_1.default {
224
209
  }
225
210
  ]
226
211
  * @param {string} [langCode] - Language code. Default: "en_US".
227
- * @param {IProductsQuery} [userQuery] - Optional set query parameters.
212
+ * @param {IProductsQueryBase} [userQuery] - Optional set query parameters.
228
213
  * @example
229
214
  {
230
215
  "limit": 30,
231
216
  "offset": 0,
232
217
  "sortOrder": "DESC",
233
218
  "sortKey": "id",
234
- "signPrice": "orders",
235
- "templateMarker": "template_12345",
236
- "statusMarker": "in_stock",
237
- "conditionValue": "new",
238
- "conditionMarker": "eq",
239
- "attributeMarker": "color"
219
+ "signPrice": "orders"
240
220
  }
241
221
  * @returns {Promise<IProductsResponse | IError>} Array with ProductEntity objects.
242
222
  * @throws {IError} When isShell=false and an error occurs during the fetch
243
223
  * @description Search for all products with pagination for the selected category.
224
+ * @see {@link https://js-sdk.oneentry.cloud/docs/products/getProductsByPageUrl getProductsByPageUrl} documentation.
244
225
  */
245
226
  async getProductsByPageUrl(url, body = [], langCode = this.state.lang, userQuery) {
246
227
  const query = { ...userQuery };
@@ -255,7 +236,7 @@ class ProductsApi extends asyncModules_1.default {
255
236
  * @handleName getRelatedProductsById
256
237
  * @param {number} [id] - Product page identifier for which to find relationship. Example: 12345.
257
238
  * @param {string} [langCode] - Language code. Default: "en_US".
258
- * @param {IProductsQuery} [userQuery] - Optional set query parameters.
239
+ * @param {IProductsRelatedQuery} [userQuery] - Optional set query parameters.
259
240
  * @example
260
241
  {
261
242
  "limit": 30,
@@ -263,11 +244,8 @@ class ProductsApi extends asyncModules_1.default {
263
244
  "sortOrder": "DESC",
264
245
  "sortKey": "id",
265
246
  "signPrice": "orders",
266
- "templateMarker": "template_12345",
267
247
  "statusMarker": "in_stock",
268
- "conditionValue": "new",
269
- "conditionMarker": "eq",
270
- "attributeMarker": "color"
248
+ "templateMarker": "template_12345"
271
249
  }
272
250
  * @param {number} [userQuery.limit] - Optional parameter for pagination. Default: 30.
273
251
  * @param {number} [userQuery.offset] - Optional parameter for pagination. Default: 0.
@@ -276,6 +254,7 @@ class ProductsApi extends asyncModules_1.default {
276
254
  * @returns {Promise<IProductsResponse | IError>} Array with ProductEntity objects
277
255
  * @throws {IError} When isShell=false and an error occurs during the fetch
278
256
  * @description Find all related product page objects.
257
+ * @see {@link https://js-sdk.oneentry.cloud/docs/products/getRelatedProductsById getRelatedProductsById} documentation.
279
258
  */
280
259
  async getRelatedProductsById(id, langCode = this.state.lang, userQuery) {
281
260
  const query = { ...userQuery };
@@ -289,31 +268,20 @@ class ProductsApi extends asyncModules_1.default {
289
268
  * @handleName getProductsByIds
290
269
  * @param {string} ids - Product page identifiers for which to find relationships. Example: "12345,67890".
291
270
  * @param {string} [langCode] - Language code. Default "en_US".
292
- * @param {IProductsQuery} [userQuery] - Optional set query parameters.
271
+ * @param {IProductsByIdsQuery} [userQuery] - Optional set query parameters.
293
272
  * @example
294
273
  {
295
274
  "limit": 30,
296
275
  "offset": 0,
297
- "sortOrder": "DESC",
298
- "sortKey": "id",
299
- "signPrice": "orders",
300
- "templateMarker": "template_12345",
301
- "statusMarker": "in_stock",
302
- "conditionValue": "new",
303
- "conditionMarker": "eq",
304
- "attributeMarker": "color"
276
+ "signPrice": "orders"
305
277
  }
306
278
  * @param {number} [userQuery.limit] - Optional parameter for pagination. Default: 30.
307
279
  * @param {number} [userQuery.offset] - Optional parameter for pagination. Default: 0.
308
- * @param {string} [userQuery.sortOrder] - Optional sorting order "DESC" | "ASC". Example: "DESC".
309
- * @param {string} [userQuery.sortKey] - Optional field to sort by ("id", "title", "date", "price", "position", "status"). Example: "id".
310
- * @param {string} [userQuery.statusMarker] - Optional identifier of the product page status. Example: "in_stock".
311
- * @param {string} [userQuery.conditionValue] - Optional value that is being searched. Example: "new".
312
- * @param {string} [userQuery.conditionMarker] - Optional identifier of the filter condition by which values are filtered. Example: "eq".
313
- * @param {string} [userQuery.attributeMarker] - Optional text identifier of the indexed attribute by which values are filtered. Example: "color".
280
+ * @param {string} [userQuery.signPrice] - Order storage marker for price fixing.
314
281
  * @returns {Promise<IProductsEntity[] | IError>} Array with ProductEntity objects
315
282
  * @throws {IError} When isShell=false and an error occurs during the fetch
316
283
  * @description Find products by its ids.
284
+ * @see {@link https://js-sdk.oneentry.cloud/docs/products/getProductsByIds getProductsByIds} documentation.
317
285
  */
318
286
  async getProductsByIds(ids, langCode = this.state.lang, userQuery) {
319
287
  const query = {
@@ -333,6 +301,7 @@ class ProductsApi extends asyncModules_1.default {
333
301
  * @returns {Promise<IProductsEntity | IError>} ProductEntity object.
334
302
  * @throws {IError} When isShell=false and an error occurs during the fetch
335
303
  * @description Retrieve one product object.
304
+ * @see {@link https://js-sdk.oneentry.cloud/docs/products/getProductById getProductById} documentation.
336
305
  */
337
306
  async getProductById(id, langCode = this.state.lang, isNormalized) {
338
307
  const query = { langCode };
@@ -350,6 +319,7 @@ class ProductsApi extends asyncModules_1.default {
350
319
  * @returns {Promise<IProductBlock | IError>} - Product block object.
351
320
  * @throws {IError} When isShell=false and an error occurs during the fetch
352
321
  * @description Getting a product block object by product id.
322
+ * @see {@link https://js-sdk.oneentry.cloud/docs/products/getProductBlockById getProductBlockById} documentation.
353
323
  */
354
324
  async getProductBlockById(id) {
355
325
  const response = await this._fetchGet(`/${id}/blocks`);
@@ -363,18 +333,16 @@ class ProductsApi extends asyncModules_1.default {
363
333
  * @returns {Promise<IProductsEntity[] | IError>} Array with ProductEntity objects
364
334
  * @throws {IError} When isShell=false and an error occurs during the fetch
365
335
  * @description Quick search for product page objects with limited output.
336
+ * @see {@link https://js-sdk.oneentry.cloud/docs/products/searchProduct searchProduct} documentation.
366
337
  */
367
338
  async searchProduct(name, langCode = this.state.lang) {
368
- const searchProducts = await this._fetchGet(`/quick/search?langCode=${langCode}&name=${name}`);
339
+ const searchProducts = await this._fetchGet(`/quick/search?langCode=${encodeURIComponent(langCode)}&name=${encodeURIComponent(name)}`);
369
340
  if (!this.state.traficLimit && Array.isArray(searchProducts)) {
370
341
  if (searchProducts.length === 0)
371
342
  return searchProducts;
372
343
  const ids = searchProducts.map((product) => product.id);
373
344
  // One /ids request instead of one getProductById per result.
374
- // limit is set to the number of ids so the default 30 does not truncate.
375
- const products = await this.getProductsByIds(ids.join(','), langCode, {
376
- limit: ids.length,
377
- });
345
+ const products = await this.getProductsByIds(ids.join(','), langCode);
378
346
  if (!Array.isArray(products))
379
347
  return products;
380
348
  // /ids re-sorts by id (DESC) by default, so restore the original
@@ -406,6 +374,7 @@ class ProductsApi extends asyncModules_1.default {
406
374
  * @returns {Promise<IProductsCount | IError>} Object with product items count.
407
375
  * @throws {IError} When isShell=false and an error occurs during the fetch
408
376
  * @description This method calculates and returns the total number of products present across the entire catalog, optionally applying specified filters.
377
+ * @see {@link https://js-sdk.oneentry.cloud/docs/products/getProductsCount getProductsCount} documentation.
409
378
  */
410
379
  async getProductsCount(
411
380
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -434,6 +403,7 @@ class ProductsApi extends asyncModules_1.default {
434
403
  * @returns {Promise<IProductsCount | IError>} Object with product items count.
435
404
  * @throws {IError} When isShell=false and an error occurs during the fetch
436
405
  * @description This method calculates and returns the number of products available on a given catalog page, identified by its page ID, with optional filtering.
406
+ * @see {@link https://js-sdk.oneentry.cloud/docs/products/getProductsCountByPageId getProductsCountByPageId} documentation.
437
407
  */
438
408
  async getProductsCountByPageId(id,
439
409
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -462,6 +432,7 @@ class ProductsApi extends asyncModules_1.default {
462
432
  * @returns {Promise<IProductsCount | IError>} Object with product items count.
463
433
  * @throws {IError} When isShell=false and an error occurs during the fetch
464
434
  * @description This method calculates and returns the number of products available on a given catalog page, identified by its URL, with optional filtering.
435
+ * @see {@link https://js-sdk.oneentry.cloud/docs/products/getProductsCountByPageUrl getProductsCountByPageUrl} documentation.
465
436
  */
466
437
  /**
467
438
  * Semantic (vector) search for products.
@@ -473,6 +444,7 @@ class ProductsApi extends asyncModules_1.default {
473
444
  * @returns {Promise<IProductsEntity[] | IError>} Array with ProductEntity objects.
474
445
  * @throws {IError} When isShell=false and an error occurs during the fetch
475
446
  * @description This method performs a semantic (vector) search for products.
447
+ * @see {@link https://js-sdk.oneentry.cloud/docs/products/getProductsByVectorSearch getProductsByVectorSearch} documentation.
476
448
  */
477
449
  async getProductsByVectorSearch(body, langCode = this.state.lang, offset = 0, limit = 30) {
478
450
  const query = {