oneentry 1.0.153 → 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.
- package/changelog.md +37 -0
- package/dist/base/asyncModules.d.ts +10 -2
- package/dist/base/asyncModules.js +57 -227
- package/dist/base/stateModule.d.ts +4 -13
- package/dist/base/stateModule.js +12 -96
- package/dist/base/syncModules.d.ts +4 -0
- package/dist/base/syncModules.js +5 -1
- package/dist/blocks/blocksApi.d.ts +20 -10
- package/dist/blocks/blocksApi.js +21 -11
- package/dist/blocks/blocksInterfaces.d.ts +18 -9
- package/dist/index.js +12 -0
- package/dist/orders/ordersInterfaces.d.ts +1 -0
- package/dist/pages/pagesApi.js +2 -1
- package/dist/products/productsApi.d.ts +25 -64
- package/dist/products/productsApi.js +19 -61
- package/dist/products/productsInterfaces.d.ts +74 -70
- package/package.json +4 -1
|
@@ -50,21 +50,17 @@ class ProductsApi extends asyncModules_1.default {
|
|
|
50
50
|
}
|
|
51
51
|
]
|
|
52
52
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
53
|
-
* @param {
|
|
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
|
|
@@ -86,19 +82,14 @@ class ProductsApi extends asyncModules_1.default {
|
|
|
86
82
|
* @handleName getProductsEmptyPage
|
|
87
83
|
* @param {object} [body] - Request body. Default: {}.
|
|
88
84
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
89
|
-
* @param {
|
|
85
|
+
* @param {IProductsQueryBase} [userQuery] - Optional set query parameters.
|
|
90
86
|
* @example
|
|
91
87
|
{
|
|
92
88
|
"limit": 30,
|
|
93
89
|
"offset": 0,
|
|
94
90
|
"sortOrder": "DESC",
|
|
95
91
|
"sortKey": "id",
|
|
96
|
-
"signPrice": "orders"
|
|
97
|
-
"templateMarker": "template_12345",
|
|
98
|
-
"statusMarker": "in_stock",
|
|
99
|
-
"conditionValue": "new",
|
|
100
|
-
"conditionMarker": "eq",
|
|
101
|
-
"attributeMarker": "color"
|
|
92
|
+
"signPrice": "orders"
|
|
102
93
|
}
|
|
103
94
|
* @returns {Promise<IAggregatedProductGroup[] | IError>} Array with AggregatedProductGroup objects.
|
|
104
95
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
@@ -140,19 +131,14 @@ class ProductsApi extends asyncModules_1.default {
|
|
|
140
131
|
}
|
|
141
132
|
]
|
|
142
133
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
143
|
-
* @param {
|
|
134
|
+
* @param {IProductsQueryBase} [userQuery] - Optional set query parameters.
|
|
144
135
|
* @example
|
|
145
136
|
{
|
|
146
137
|
"limit": 30,
|
|
147
138
|
"offset": 0,
|
|
148
139
|
"sortOrder": "DESC",
|
|
149
140
|
"sortKey": "id",
|
|
150
|
-
"signPrice": "orders"
|
|
151
|
-
"templateMarker": "template_12345",
|
|
152
|
-
"statusMarker": "in_stock",
|
|
153
|
-
"conditionValue": "new",
|
|
154
|
-
"conditionMarker": "eq",
|
|
155
|
-
"attributeMarker": "color"
|
|
141
|
+
"signPrice": "orders"
|
|
156
142
|
}
|
|
157
143
|
* @returns {Promise<IProductsResponse | IError>} Array with ProductEntity objects
|
|
158
144
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
@@ -171,19 +157,14 @@ class ProductsApi extends asyncModules_1.default {
|
|
|
171
157
|
* @handleName getProductsPriceByPageUrl
|
|
172
158
|
* @param {string} [url] - Page url. Example: "23-laminat-floorwood-maxima".
|
|
173
159
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
174
|
-
* @param {
|
|
160
|
+
* @param {IProductsPriceQuery} [userQuery] - Optional set query parameters.
|
|
175
161
|
* @example
|
|
176
162
|
{
|
|
177
163
|
"limit": 30,
|
|
178
164
|
"offset": 0,
|
|
179
165
|
"sortOrder": "DESC",
|
|
180
|
-
"sortKey": "id",
|
|
181
166
|
"signPrice": "orders",
|
|
182
|
-
"
|
|
183
|
-
"statusMarker": "in_stock",
|
|
184
|
-
"conditionValue": "new",
|
|
185
|
-
"conditionMarker": "eq",
|
|
186
|
-
"attributeMarker": "color"
|
|
167
|
+
"statusMarker": "in_stock"
|
|
187
168
|
}
|
|
188
169
|
* @returns {Promise<IProductsInfo | IError>} Array with ProductInformation objects.
|
|
189
170
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
@@ -228,19 +209,14 @@ class ProductsApi extends asyncModules_1.default {
|
|
|
228
209
|
}
|
|
229
210
|
]
|
|
230
211
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
231
|
-
* @param {
|
|
212
|
+
* @param {IProductsQueryBase} [userQuery] - Optional set query parameters.
|
|
232
213
|
* @example
|
|
233
214
|
{
|
|
234
215
|
"limit": 30,
|
|
235
216
|
"offset": 0,
|
|
236
217
|
"sortOrder": "DESC",
|
|
237
218
|
"sortKey": "id",
|
|
238
|
-
"signPrice": "orders"
|
|
239
|
-
"templateMarker": "template_12345",
|
|
240
|
-
"statusMarker": "in_stock",
|
|
241
|
-
"conditionValue": "new",
|
|
242
|
-
"conditionMarker": "eq",
|
|
243
|
-
"attributeMarker": "color"
|
|
219
|
+
"signPrice": "orders"
|
|
244
220
|
}
|
|
245
221
|
* @returns {Promise<IProductsResponse | IError>} Array with ProductEntity objects.
|
|
246
222
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
@@ -260,7 +236,7 @@ class ProductsApi extends asyncModules_1.default {
|
|
|
260
236
|
* @handleName getRelatedProductsById
|
|
261
237
|
* @param {number} [id] - Product page identifier for which to find relationship. Example: 12345.
|
|
262
238
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
263
|
-
* @param {
|
|
239
|
+
* @param {IProductsRelatedQuery} [userQuery] - Optional set query parameters.
|
|
264
240
|
* @example
|
|
265
241
|
{
|
|
266
242
|
"limit": 30,
|
|
@@ -268,11 +244,8 @@ class ProductsApi extends asyncModules_1.default {
|
|
|
268
244
|
"sortOrder": "DESC",
|
|
269
245
|
"sortKey": "id",
|
|
270
246
|
"signPrice": "orders",
|
|
271
|
-
"templateMarker": "template_12345",
|
|
272
247
|
"statusMarker": "in_stock",
|
|
273
|
-
"
|
|
274
|
-
"conditionMarker": "eq",
|
|
275
|
-
"attributeMarker": "color"
|
|
248
|
+
"templateMarker": "template_12345"
|
|
276
249
|
}
|
|
277
250
|
* @param {number} [userQuery.limit] - Optional parameter for pagination. Default: 30.
|
|
278
251
|
* @param {number} [userQuery.offset] - Optional parameter for pagination. Default: 0.
|
|
@@ -295,28 +268,16 @@ class ProductsApi extends asyncModules_1.default {
|
|
|
295
268
|
* @handleName getProductsByIds
|
|
296
269
|
* @param {string} ids - Product page identifiers for which to find relationships. Example: "12345,67890".
|
|
297
270
|
* @param {string} [langCode] - Language code. Default "en_US".
|
|
298
|
-
* @param {
|
|
271
|
+
* @param {IProductsByIdsQuery} [userQuery] - Optional set query parameters.
|
|
299
272
|
* @example
|
|
300
273
|
{
|
|
301
274
|
"limit": 30,
|
|
302
275
|
"offset": 0,
|
|
303
|
-
"
|
|
304
|
-
"sortKey": "id",
|
|
305
|
-
"signPrice": "orders",
|
|
306
|
-
"templateMarker": "template_12345",
|
|
307
|
-
"statusMarker": "in_stock",
|
|
308
|
-
"conditionValue": "new",
|
|
309
|
-
"conditionMarker": "eq",
|
|
310
|
-
"attributeMarker": "color"
|
|
276
|
+
"signPrice": "orders"
|
|
311
277
|
}
|
|
312
278
|
* @param {number} [userQuery.limit] - Optional parameter for pagination. Default: 30.
|
|
313
279
|
* @param {number} [userQuery.offset] - Optional parameter for pagination. Default: 0.
|
|
314
|
-
* @param {string} [userQuery.
|
|
315
|
-
* @param {string} [userQuery.sortKey] - Optional field to sort by ("id", "title", "date", "price", "position", "status"). Example: "id".
|
|
316
|
-
* @param {string} [userQuery.statusMarker] - Optional identifier of the product page status. Example: "in_stock".
|
|
317
|
-
* @param {string} [userQuery.conditionValue] - Optional value that is being searched. Example: "new".
|
|
318
|
-
* @param {string} [userQuery.conditionMarker] - Optional identifier of the filter condition by which values are filtered. Example: "eq".
|
|
319
|
-
* @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.
|
|
320
281
|
* @returns {Promise<IProductsEntity[] | IError>} Array with ProductEntity objects
|
|
321
282
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
322
283
|
* @description Find products by its ids.
|
|
@@ -375,16 +336,13 @@ class ProductsApi extends asyncModules_1.default {
|
|
|
375
336
|
* @see {@link https://js-sdk.oneentry.cloud/docs/products/searchProduct searchProduct} documentation.
|
|
376
337
|
*/
|
|
377
338
|
async searchProduct(name, langCode = this.state.lang) {
|
|
378
|
-
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)}`);
|
|
379
340
|
if (!this.state.traficLimit && Array.isArray(searchProducts)) {
|
|
380
341
|
if (searchProducts.length === 0)
|
|
381
342
|
return searchProducts;
|
|
382
343
|
const ids = searchProducts.map((product) => product.id);
|
|
383
344
|
// One /ids request instead of one getProductById per result.
|
|
384
|
-
|
|
385
|
-
const products = await this.getProductsByIds(ids.join(','), langCode, {
|
|
386
|
-
limit: ids.length,
|
|
387
|
-
});
|
|
345
|
+
const products = await this.getProductsByIds(ids.join(','), langCode);
|
|
388
346
|
if (!Array.isArray(products))
|
|
389
347
|
return products;
|
|
390
348
|
// /ids re-sorts by id (DESC) by default, so restore the original
|
|
@@ -35,163 +35,135 @@ interface IProductsApi {
|
|
|
35
35
|
}
|
|
36
36
|
]
|
|
37
37
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
38
|
-
* @param {
|
|
38
|
+
* @param {IProductsQueryBase} [userQuery] - Optional set query parameters.
|
|
39
39
|
* @example
|
|
40
40
|
{
|
|
41
41
|
"limit": 30,
|
|
42
42
|
"offset": 0,
|
|
43
43
|
"sortOrder": "DESC",
|
|
44
44
|
"sortKey": "id",
|
|
45
|
-
"
|
|
46
|
-
"statusMarker": "in_stock",
|
|
47
|
-
"conditionValue": "new",
|
|
48
|
-
"conditionMarker": "equals",
|
|
49
|
-
"attributeMarker": "color"
|
|
45
|
+
"signPrice": "orders"
|
|
50
46
|
}
|
|
51
47
|
* @returns {IProductsResponse} Array with ProductEntity objects
|
|
52
48
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
53
49
|
*/
|
|
54
|
-
getProducts(body?: IFilterParams[], langCode?: string, userQuery?:
|
|
50
|
+
getProducts(body?: IFilterParams[], langCode?: string, userQuery?: IProductsQueryBase): Promise<IProductsResponse | IError>;
|
|
55
51
|
/**
|
|
56
52
|
* Search for all product page objects with pagination that do not have a category.
|
|
57
53
|
* @handleName getProductsEmptyPage
|
|
58
54
|
* @param body
|
|
59
55
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
60
|
-
* @param {
|
|
56
|
+
* @param {IProductsQueryBase} [userQuery] - Optional set query parameters.
|
|
61
57
|
* @example
|
|
62
58
|
{
|
|
63
59
|
"limit": 30,
|
|
64
60
|
"offset": 0,
|
|
65
61
|
"sortOrder": "DESC",
|
|
66
62
|
"sortKey": "id",
|
|
67
|
-
"
|
|
68
|
-
"statusMarker": "in_stock",
|
|
69
|
-
"conditionValue": "new",
|
|
70
|
-
"conditionMarker": "equals",
|
|
71
|
-
"attributeMarker": "color"
|
|
63
|
+
"signPrice": "orders"
|
|
72
64
|
}
|
|
73
65
|
* @returns {IProductsResponse} Array with ProductEntity objects.
|
|
74
66
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
75
67
|
* @description This method searches for all product page objects with pagination that do not have a category.
|
|
76
68
|
*/
|
|
77
|
-
getProductsEmptyPage(body?: object, langCode?: string, userQuery?:
|
|
69
|
+
getProductsEmptyPage(body?: object, langCode?: string, userQuery?: IProductsQueryBase): Promise<IAggregatedProductGroup[] | IError>;
|
|
78
70
|
/**
|
|
79
71
|
* Search for all products with pagination for the selected category.
|
|
80
72
|
* @handleName getProductsByPageId
|
|
81
73
|
* @param {number} id - Page id. Example: 12345.
|
|
82
74
|
* @param {IFilterParams[]} [body] - Request body. Default: [].
|
|
83
75
|
* @param {string} [langCode] - Language code. Default "en_US".
|
|
84
|
-
* @param {
|
|
76
|
+
* @param {IProductsQueryBase} [userQuery] - Optional set query parameters.
|
|
85
77
|
* @example
|
|
86
78
|
{
|
|
87
79
|
"limit": 30,
|
|
88
80
|
"offset": 0,
|
|
89
81
|
"sortOrder": "DESC",
|
|
90
82
|
"sortKey": "id",
|
|
91
|
-
"
|
|
92
|
-
"statusMarker": "in_stock",
|
|
93
|
-
"conditionValue": "new",
|
|
94
|
-
"conditionMarker": "equals",
|
|
95
|
-
"attributeMarker": "color"
|
|
83
|
+
"signPrice": "orders"
|
|
96
84
|
}
|
|
97
85
|
* @returns {IProductsResponse} Array with ProductEntity objects
|
|
98
86
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
99
87
|
* @description This method searches for all products with pagination for the selected category.
|
|
100
88
|
*/
|
|
101
|
-
getProductsByPageId(id: number, body?: IFilterParams[], langCode?: string, userQuery?:
|
|
89
|
+
getProductsByPageId(id: number, body?: IFilterParams[], langCode?: string, userQuery?: IProductsQueryBase): Promise<IProductsResponse | IError>;
|
|
102
90
|
/**
|
|
103
91
|
* Search for information about products and prices for the selected category.
|
|
104
92
|
* @handleName getProductsPriceByPageUrl
|
|
105
93
|
* @param {string} [url] - Page url. Example: "23-laminat-floorwood-maxima".
|
|
106
94
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
107
|
-
* @param {
|
|
95
|
+
* @param {IProductsPriceQuery} [userQuery] - Optional set query parameters.
|
|
108
96
|
* @example
|
|
109
97
|
{
|
|
110
98
|
"limit": 30,
|
|
111
99
|
"offset": 0,
|
|
112
100
|
"sortOrder": "DESC",
|
|
113
|
-
"
|
|
114
|
-
"
|
|
115
|
-
"statusMarker": "in_stock",
|
|
116
|
-
"conditionValue": "new",
|
|
117
|
-
"conditionMarker": "equals",
|
|
118
|
-
"attributeMarker": "color"
|
|
101
|
+
"signPrice": "orders",
|
|
102
|
+
"statusMarker": "in_stock"
|
|
119
103
|
}
|
|
120
104
|
* @returns {IProductsInfo} Array with ProductInformation objects.
|
|
121
105
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
122
106
|
* @description This method searches for information about products prices for the selected category.
|
|
123
107
|
*/
|
|
124
|
-
getProductsPriceByPageUrl(url: string, langCode?: string, userQuery?:
|
|
108
|
+
getProductsPriceByPageUrl(url: string, langCode?: string, userQuery?: IProductsPriceQuery): Promise<IProductsInfo | IError>;
|
|
125
109
|
/**
|
|
126
110
|
* Search for all products with pagination for the selected category.
|
|
127
111
|
* @handleName getProductsByPageUrl
|
|
128
112
|
* @param {string} url - Page url. Example: "23-laminat-floorwood-maxima".
|
|
129
113
|
* @param {IFilterParams[]} [body] - Request body. Default: [].
|
|
130
114
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
131
|
-
* @param {
|
|
115
|
+
* @param {IProductsQueryBase} [userQuery] - Optional set query parameters.
|
|
132
116
|
* @example
|
|
133
117
|
{
|
|
134
118
|
"limit": 30,
|
|
135
119
|
"offset": 0,
|
|
136
120
|
"sortOrder": "DESC",
|
|
137
121
|
"sortKey": "id",
|
|
138
|
-
"
|
|
139
|
-
"statusMarker": "in_stock",
|
|
140
|
-
"conditionValue": "new",
|
|
141
|
-
"conditionMarker": "equals",
|
|
142
|
-
"attributeMarker": "color"
|
|
122
|
+
"signPrice": "orders"
|
|
143
123
|
}
|
|
144
124
|
* @returns {IProductsResponse} Array with ProductEntity objects.
|
|
145
125
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
146
126
|
* @description This method searches for all products with pagination for the selected category.
|
|
147
127
|
*/
|
|
148
|
-
getProductsByPageUrl(url: string, body?: IFilterParams[], langCode?: string, userQuery?:
|
|
128
|
+
getProductsByPageUrl(url: string, body?: IFilterParams[], langCode?: string, userQuery?: IProductsQueryBase): Promise<IProductsResponse | IError>;
|
|
149
129
|
/**
|
|
150
130
|
* Find all related product page objects.
|
|
151
131
|
* @handleName getRelatedProductsById
|
|
152
132
|
* @param {number} [id] - Product page identifier for which to find relationship. Example: 12345.
|
|
153
133
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
154
|
-
* @param {
|
|
134
|
+
* @param {IProductsRelatedQuery} [userQuery] - Optional set query parameters.
|
|
155
135
|
* @example
|
|
156
136
|
{
|
|
157
137
|
"limit": 30,
|
|
158
138
|
"offset": 0,
|
|
159
139
|
"sortOrder": "DESC",
|
|
160
140
|
"sortKey": "id",
|
|
161
|
-
"
|
|
141
|
+
"signPrice": "orders",
|
|
162
142
|
"statusMarker": "in_stock",
|
|
163
|
-
"
|
|
164
|
-
"conditionMarker": "equals",
|
|
165
|
-
"attributeMarker": "color"
|
|
143
|
+
"templateMarker": "template_12345"
|
|
166
144
|
}
|
|
167
145
|
* @returns {IProductsResponse} Array with ProductEntity objects
|
|
168
146
|
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
169
147
|
* @description This method finds all related product page objects for the selected product page.
|
|
170
148
|
*/
|
|
171
|
-
getRelatedProductsById(id: number, langCode?: string, userQuery?:
|
|
149
|
+
getRelatedProductsById(id: number, langCode?: string, userQuery?: IProductsRelatedQuery): Promise<IProductsResponse | IError>;
|
|
172
150
|
/**
|
|
173
151
|
* Find products by its ids.
|
|
174
152
|
* @handleName getProductsByIds
|
|
175
153
|
* @param {string} ids - Product page identifiers for which to find relationships. Example: "12345,67890".
|
|
176
154
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
177
|
-
* @param {
|
|
155
|
+
* @param {IProductsByIdsQuery} [userQuery] - Optional set query parameters.
|
|
178
156
|
* @example
|
|
179
157
|
{
|
|
180
158
|
"limit": 30,
|
|
181
159
|
"offset": 0,
|
|
182
|
-
"
|
|
183
|
-
"sortKey": "id",
|
|
184
|
-
"statusId": 123,
|
|
185
|
-
"statusMarker": "in_stock",
|
|
186
|
-
"conditionValue": "new",
|
|
187
|
-
"conditionMarker": "equals",
|
|
188
|
-
"attributeMarker": "color"
|
|
160
|
+
"signPrice": "orders"
|
|
189
161
|
}
|
|
190
162
|
* @returns {IProductsEntity[]} Array with ProductEntity objects
|
|
191
163
|
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
192
164
|
* @description This method finds products by its ids.
|
|
193
165
|
*/
|
|
194
|
-
getProductsByIds(ids: string, langCode?: string, userQuery?:
|
|
166
|
+
getProductsByIds(ids: string, langCode?: string, userQuery?: IProductsByIdsQuery): Promise<IProductsEntity[] | IError>;
|
|
195
167
|
/**
|
|
196
168
|
* Retrieve one product object.
|
|
197
169
|
* @handleName getProductById
|
|
@@ -334,35 +306,63 @@ interface IProductsApi {
|
|
|
334
306
|
getProductsByVectorSearch(body: IVectorSearchProducts, langCode?: string, offset?: number, limit?: number): Promise<IProductsEntity[] | IError>;
|
|
335
307
|
}
|
|
336
308
|
/**
|
|
337
|
-
* @interface
|
|
309
|
+
* @interface IProductsQueryBase
|
|
338
310
|
* @property {number} offset - Parameter for pagination. Default: 0.
|
|
339
311
|
* @property {number} limit - Parameter for pagination. Default: 30.
|
|
340
312
|
* @property {string} sortOrder - Sort order "DESC" | "ASC". Default: "DESC".
|
|
341
313
|
* @property {string} sortKey - Field for sorting (default - null). Possible values: "id", "position", "title", "date", "price". Default: null.
|
|
342
|
-
* @property {string} [signPrice] -
|
|
343
|
-
* @
|
|
344
|
-
* @
|
|
345
|
-
* @property {string | null} [conditionValue] - The value that is being searched for, default null. Example: "new".
|
|
346
|
-
* @property {string | null} [attributeMarker] - The text identifier of the indexed attribute by which values are filtered, default null. Example: "color".
|
|
347
|
-
* @property {string | null} [conditionMarker] - Marker of the filter condition by which the values are filtered, default null. Example: "equals".
|
|
348
|
-
* @property {string} [langCode] - Language code. Default: "en_US".
|
|
349
|
-
* @property {string} [ids] - Comma-separated list of product ids — used by `getProductsByIds`. Example: "1,2,3".
|
|
350
|
-
* @description This interface defines the structure of a query for retrieving products, including pagination, sorting, and filtering parameters.
|
|
314
|
+
* @property {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
|
|
315
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/products/#Fixing-the-price-signPrice Fixing the price} documentation.
|
|
316
|
+
* @description Base query parameters shared by the product listing endpoints (getProducts, getProductsEmptyPage, getProductsByPageId, getProductsByPageUrl): pagination, sorting and price fixing.
|
|
351
317
|
*/
|
|
352
|
-
interface
|
|
318
|
+
interface IProductsQueryBase {
|
|
353
319
|
offset?: number;
|
|
354
320
|
limit?: number;
|
|
355
|
-
langCode?: string;
|
|
356
|
-
ids?: string;
|
|
357
321
|
sortOrder?: 'DESC' | 'ASC' | null;
|
|
358
322
|
sortKey?: 'id' | 'position' | 'title' | 'date' | 'price' | null;
|
|
359
323
|
signPrice?: string;
|
|
360
|
-
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* @interface IProductsRelatedQuery
|
|
327
|
+
* @augments IProductsQueryBase
|
|
328
|
+
* @property {string | null} [statusMarker] - Product page status marker, default null. Example: "in_stock".
|
|
329
|
+
* @property {string | null} [templateMarker] - Product page template marker, default null. Example: "template_12345".
|
|
330
|
+
* @description Query parameters for getRelatedProductsById: the base query plus product page status and template markers.
|
|
331
|
+
*/
|
|
332
|
+
interface IProductsRelatedQuery extends IProductsQueryBase {
|
|
361
333
|
statusMarker?: string | null;
|
|
362
|
-
|
|
363
|
-
attributeMarker?: string | null;
|
|
364
|
-
conditionMarker?: 'in' /** in - Contains */ | 'nin' /** nin - Does not contain */ | 'eq' /** 'eq' - Equal */ | 'neq' /** 'neq' - Not equal */ | 'mth' /** 'mth' - Greater than */ | 'lth' /** 'lth' - Less than */ | 'exs' /** 'exs' - Exists */ | 'nexs' /** 'nexs' - Does not exist */ | null;
|
|
334
|
+
templateMarker?: string | null;
|
|
365
335
|
}
|
|
336
|
+
/**
|
|
337
|
+
* Query parameters for getProductsPriceByPageUrl: the base query without
|
|
338
|
+
* `sortKey`, plus the product page status marker.
|
|
339
|
+
* @typedef {object} IProductsPriceQuery
|
|
340
|
+
* @property {number} [offset] - Parameter for pagination. Default: 0.
|
|
341
|
+
* @property {number} [limit] - Parameter for pagination. Default: 30.
|
|
342
|
+
* @property {string} [sortOrder] - Sort order "DESC" | "ASC". Default: "DESC".
|
|
343
|
+
* @property {string} [signPrice] - Order storage marker for price fixing.
|
|
344
|
+
* @property {string | null} [statusMarker] - Product page status marker, default null. Example: "in_stock".
|
|
345
|
+
*/
|
|
346
|
+
type IProductsPriceQuery = Omit<IProductsQueryBase, 'sortKey'> & {
|
|
347
|
+
statusMarker?: string | null;
|
|
348
|
+
};
|
|
349
|
+
/**
|
|
350
|
+
* Query parameters for getProductsByIds: only price fixing — `ids` is passed
|
|
351
|
+
* as a dedicated method argument.
|
|
352
|
+
* @typedef {object} IProductsByIdsQuery
|
|
353
|
+
* @property {string} [signPrice] - Order storage marker for price fixing.
|
|
354
|
+
*/
|
|
355
|
+
type IProductsByIdsQuery = Pick<IProductsQueryBase, 'signPrice'>;
|
|
356
|
+
/**
|
|
357
|
+
* Query parameters for retrieving products.
|
|
358
|
+
* @deprecated Use the per-method query types instead — IProductsQueryBase
|
|
359
|
+
* (getProducts / getProductsEmptyPage / getProductsByPageId / getProductsByPageUrl),
|
|
360
|
+
* IProductsRelatedQuery (getRelatedProductsById), IProductsPriceQuery
|
|
361
|
+
* (getProductsPriceByPageUrl) or IProductsByIdsQuery (getProductsByIds).
|
|
362
|
+
* Kept as an alias of the base query for backward compatibility.
|
|
363
|
+
* @typedef {IProductsQueryBase} IProductsQuery
|
|
364
|
+
*/
|
|
365
|
+
type IProductsQuery = IProductsQueryBase;
|
|
366
366
|
/**
|
|
367
367
|
* @interface IFilterParams
|
|
368
368
|
* @property {string | null} attributeMarker - The text identifier of the indexed attribute by which values are filtered. Default: null. Example: "color".
|
|
@@ -470,7 +470,8 @@ interface IProductPageRef {
|
|
|
470
470
|
* @property {Record<string, unknown>} [discountConfig] - Discount configuration object. Example: {}.
|
|
471
471
|
* @property {string | null} [templateIdentifier] - User id of the linked template. Example: "template_12345".
|
|
472
472
|
* @property {string | null} [shortDescTemplateIdentifier] - User id of the linked template for a short description. Example: "short_desc_template_12345".
|
|
473
|
-
* @property {string} [signedPrice] -
|
|
473
|
+
* @property {string} [signedPrice] - The signed price of the product is obtained along with the product data when `signPrice` is set. Example: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
|
|
474
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/orders/#Fixed-product-price-signedPrice Fixed product price} documentation.
|
|
474
475
|
* @property {IProductPageRef[]} [productPages] - Array of product page references linking the product to its pages.
|
|
475
476
|
* @example
|
|
476
477
|
[
|
|
@@ -575,11 +576,14 @@ interface IProductsInfo {
|
|
|
575
576
|
* @interface IProductInfo
|
|
576
577
|
* @property {number} id - The unique identifier of the product. Example: 12345.
|
|
577
578
|
* @property {number} price - The price of the product. Example: 150.00.
|
|
579
|
+
* @property {string} [signedPrice] - The signed (fixed) price of the product, returned when `signPrice` is set. Example: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...".
|
|
580
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/orders/#Fixed-product-price-signedPrice Fixed product price} documentation.
|
|
578
581
|
* @description This interface defines the structure of a product information object, including its identifier and price.
|
|
579
582
|
*/
|
|
580
583
|
interface IProductInfo {
|
|
581
584
|
id: number;
|
|
582
585
|
price: number;
|
|
586
|
+
signedPrice?: string;
|
|
583
587
|
}
|
|
584
588
|
/**
|
|
585
589
|
* @interface IProductBlock
|
|
@@ -696,4 +700,4 @@ interface IVectorSearchProducts {
|
|
|
696
700
|
maxHits?: number;
|
|
697
701
|
debug?: boolean;
|
|
698
702
|
}
|
|
699
|
-
export type { IAggregatedProductGroup, IFilterParams, IProductBlock, IProductInfo, IProductsApi, IProductsCount, IProductsEntity, IProductsInfo, IProductsQuery, IProductsResponse, IVectorSearchProducts, };
|
|
703
|
+
export type { IAggregatedProductGroup, IFilterParams, IProductBlock, IProductInfo, IProductsApi, IProductsByIdsQuery, IProductsCount, IProductsEntity, IProductsInfo, IProductsPriceQuery, IProductsQuery, IProductsQueryBase, IProductsRelatedQuery, IProductsResponse, IVectorSearchProducts, };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oneentry",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.154",
|
|
4
4
|
"description": "OneEntry NPM package",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -13,6 +13,9 @@
|
|
|
13
13
|
},
|
|
14
14
|
"author": "ONEENTRY PORTAL CO.",
|
|
15
15
|
"license": "ISC",
|
|
16
|
+
"engines": {
|
|
17
|
+
"node": ">=18"
|
|
18
|
+
},
|
|
16
19
|
"dependencies": {
|
|
17
20
|
"socket.io-client": "^4.8.3",
|
|
18
21
|
"zod": "^4.3.6"
|