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.
@@ -66,7 +66,8 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
66
66
  * @param {string} [langCode] - Language code. Default: "en_US".
67
67
  * @param {number} [offset] - Parameter for pagination. Default: 0.
68
68
  * @param {number} [limit] - Parameter for pagination. Default: 30.
69
- * @param {string} [signPrice] - Sign price.
69
+ * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
70
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
70
71
  * @param {number} [productId] - Optional product id to find similar products for.
71
72
  * @returns {Promise<IProductsResponse | IError>} Returns the total count and an array of product items in object by specified block marker.
72
73
  * @throws {IError} When isShell=false and an error occurs during the fetch
@@ -80,7 +81,8 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
80
81
  * @param {string} [langCode] - Language code. Default: "en_US".
81
82
  * @param {number} [offset] - Parameter for pagination. Default: 0.
82
83
  * @param {number} [limit] - Parameter for pagination. Default: 30.
83
- * @param {string} [signPrice] - Sign price.
84
+ * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
85
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
84
86
  * @returns {Promise<IProductsEntity[] | IError>} Return array of BlocksEntity object.
85
87
  * @throws {IError} When isShell=false and an error occurs during the fetch
86
88
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getProductsByBlockMarker getProductsByBlockMarker} documentation.
@@ -92,7 +94,8 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
92
94
  * @param {number} productId - Product id. Example: 1.
93
95
  * @param {string} marker - Block marker. Example: "frequently_ordered_block".
94
96
  * @param {string} [langCode] - Language code. Default: "en_US".
95
- * @param {string} [signPrice] - Sign price.
97
+ * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
98
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
96
99
  * @returns {Promise<IProductsResponse | IError>} Returns a products response with items and total.
97
100
  * @throws {IError} When isShell=false and an error occurs during the fetch
98
101
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getFrequentlyOrderedProducts getFrequentlyOrderedProducts} documentation.
@@ -113,7 +116,8 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
113
116
  * @handleName getCartComplement
114
117
  * @param {string} marker - Block marker. Example: "cart_complement_block".
115
118
  * @param {string} [langCode] - Language code. Default: "en_US".
116
- * @param {string} [signPrice] - Sign price.
119
+ * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
120
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
117
121
  * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
118
122
  * @throws {IError} When isShell=false and an error occurs during the fetch
119
123
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getCartComplement getCartComplement} documentation.
@@ -139,7 +143,8 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
139
143
  * @handleName getCartSimilar
140
144
  * @param {string} marker - Block marker. Example: "cart_similar_block".
141
145
  * @param {string} [langCode] - Language code. Default: "en_US".
142
- * @param {string} [signPrice] - Sign price.
146
+ * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
147
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
143
148
  * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
144
149
  * @throws {IError} When isShell=false and an error occurs during the fetch
145
150
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getCartSimilar getCartSimilar} documentation.
@@ -165,7 +170,8 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
165
170
  * @handleName getPersonalRecommendations
166
171
  * @param {string} marker - Block marker. Example: "personal_recommendations_block".
167
172
  * @param {string} [langCode] - Language code. Default: "en_US".
168
- * @param {string} [signPrice] - Sign price.
173
+ * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
174
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
169
175
  * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
170
176
  * @throws {IError} When isShell=false and an error occurs during the fetch
171
177
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getPersonalRecommendations getPersonalRecommendations} documentation.
@@ -176,7 +182,8 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
176
182
  * @handleName getRecentlyViewed
177
183
  * @param {string} marker - Block marker. Example: "recently_viewed_block".
178
184
  * @param {string} [langCode] - Language code. Default: "en_US".
179
- * @param {string} [signPrice] - Sign price.
185
+ * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
186
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
180
187
  * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
181
188
  * @throws {IError} When isShell=false and an error occurs during the fetch
182
189
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getRecentlyViewed getRecentlyViewed} documentation.
@@ -187,7 +194,8 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
187
194
  * @handleName getRepeatPurchase
188
195
  * @param {string} marker - Block marker. Example: "repeat_purchase_block".
189
196
  * @param {string} [langCode] - Language code. Default: "en_US".
190
- * @param {string} [signPrice] - Sign price.
197
+ * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
198
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
191
199
  * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
192
200
  * @throws {IError} When isShell=false and an error occurs during the fetch
193
201
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getRepeatPurchase getRepeatPurchase} documentation.
@@ -207,7 +215,8 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
207
215
  * @handleName getTrending
208
216
  * @param {string} marker - Block marker. Example: "trending_block".
209
217
  * @param {string} [langCode] - Language code. Default: "en_US".
210
- * @param {string} [signPrice] - Sign price.
218
+ * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
219
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
211
220
  * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
212
221
  * @throws {IError} When isShell=false and an error occurs during the fetch
213
222
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getTrending getTrending} documentation.
@@ -218,7 +227,8 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
218
227
  * @handleName getWishlistSimilar
219
228
  * @param {string} marker - Block marker. Example: "wishlist_similar_block".
220
229
  * @param {string} [langCode] - Language code. Default: "en_US".
221
- * @param {string} [signPrice] - Sign price.
230
+ * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
231
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
222
232
  * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
223
233
  * @throws {IError} When isShell=false and an error occurs during the fetch
224
234
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getWishlistSimilar getWishlistSimilar} documentation.
@@ -130,7 +130,8 @@ class BlocksApi extends asyncModules_1.default {
130
130
  * @param {string} [langCode] - Language code. Default: "en_US".
131
131
  * @param {number} [offset] - Parameter for pagination. Default: 0.
132
132
  * @param {number} [limit] - Parameter for pagination. Default: 30.
133
- * @param {string} [signPrice] - Sign price.
133
+ * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
134
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
134
135
  * @param {number} [productId] - Optional product id to find similar products for.
135
136
  * @returns {Promise<IProductsResponse | IError>} Returns the total count and an array of product items in object by specified block marker.
136
137
  * @throws {IError} When isShell=false and an error occurs during the fetch
@@ -154,7 +155,8 @@ class BlocksApi extends asyncModules_1.default {
154
155
  * @param {string} [langCode] - Language code. Default: "en_US".
155
156
  * @param {number} [offset] - Parameter for pagination. Default: 0.
156
157
  * @param {number} [limit] - Parameter for pagination. Default: 30.
157
- * @param {string} [signPrice] - Sign price.
158
+ * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
159
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
158
160
  * @returns {Promise<IProductsEntity[] | IError>} Return array of BlocksEntity object.
159
161
  * @throws {IError} When isShell=false and an error occurs during the fetch
160
162
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getProductsByBlockMarker getProductsByBlockMarker} documentation.
@@ -175,7 +177,8 @@ class BlocksApi extends asyncModules_1.default {
175
177
  * @param {number} productId - Product id. Example: 1.
176
178
  * @param {string} marker - Block marker. Example: "frequently_ordered_block".
177
179
  * @param {string} [langCode] - Language code. Default: "en_US".
178
- * @param {string} [signPrice] - Sign price.
180
+ * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
181
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
179
182
  * @returns {Promise<IProductsResponse | IError>} Returns a products response with items and total.
180
183
  * @throws {IError} When isShell=false and an error occurs during the fetch
181
184
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getFrequentlyOrderedProducts getFrequentlyOrderedProducts} documentation.
@@ -199,7 +202,7 @@ class BlocksApi extends asyncModules_1.default {
199
202
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/searchBlock searchBlock} documentation.
200
203
  */
201
204
  async searchBlock(name, langCode = this.state.lang) {
202
- const result = await this._fetchGet(`/quick/search?langCode=${langCode}&name=${name}`);
205
+ const result = await this._fetchGet(`/quick/search?langCode=${encodeURIComponent(langCode)}&name=${encodeURIComponent(name)}`);
203
206
  // Validate response if validation is enabled
204
207
  const validated = this._validateResponse(result, blocksSchemas_1.SearchBlocksResponseSchema);
205
208
  return validated;
@@ -209,7 +212,8 @@ class BlocksApi extends asyncModules_1.default {
209
212
  * @handleName getCartComplement
210
213
  * @param {string} marker - Block marker. Example: "cart_complement_block".
211
214
  * @param {string} [langCode] - Language code. Default: "en_US".
212
- * @param {string} [signPrice] - Sign price.
215
+ * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
216
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
213
217
  * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
214
218
  * @throws {IError} When isShell=false and an error occurs during the fetch
215
219
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getCartComplement getCartComplement} documentation.
@@ -242,7 +246,8 @@ class BlocksApi extends asyncModules_1.default {
242
246
  * @handleName getCartSimilar
243
247
  * @param {string} marker - Block marker. Example: "cart_similar_block".
244
248
  * @param {string} [langCode] - Language code. Default: "en_US".
245
- * @param {string} [signPrice] - Sign price.
249
+ * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
250
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
246
251
  * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
247
252
  * @throws {IError} When isShell=false and an error occurs during the fetch
248
253
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getCartSimilar getCartSimilar} documentation.
@@ -275,7 +280,8 @@ class BlocksApi extends asyncModules_1.default {
275
280
  * @handleName getPersonalRecommendations
276
281
  * @param {string} marker - Block marker. Example: "personal_recommendations_block".
277
282
  * @param {string} [langCode] - Language code. Default: "en_US".
278
- * @param {string} [signPrice] - Sign price.
283
+ * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
284
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
279
285
  * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
280
286
  * @throws {IError} When isShell=false and an error occurs during the fetch
281
287
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getPersonalRecommendations getPersonalRecommendations} documentation.
@@ -290,7 +296,8 @@ class BlocksApi extends asyncModules_1.default {
290
296
  * @handleName getRecentlyViewed
291
297
  * @param {string} marker - Block marker. Example: "recently_viewed_block".
292
298
  * @param {string} [langCode] - Language code. Default: "en_US".
293
- * @param {string} [signPrice] - Sign price.
299
+ * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
300
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
294
301
  * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
295
302
  * @throws {IError} When isShell=false and an error occurs during the fetch
296
303
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getRecentlyViewed getRecentlyViewed} documentation.
@@ -305,7 +312,8 @@ class BlocksApi extends asyncModules_1.default {
305
312
  * @handleName getRepeatPurchase
306
313
  * @param {string} marker - Block marker. Example: "repeat_purchase_block".
307
314
  * @param {string} [langCode] - Language code. Default: "en_US".
308
- * @param {string} [signPrice] - Sign price.
315
+ * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
316
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
309
317
  * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
310
318
  * @throws {IError} When isShell=false and an error occurs during the fetch
311
319
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getRepeatPurchase getRepeatPurchase} documentation.
@@ -332,7 +340,8 @@ class BlocksApi extends asyncModules_1.default {
332
340
  * @handleName getTrending
333
341
  * @param {string} marker - Block marker. Example: "trending_block".
334
342
  * @param {string} [langCode] - Language code. Default: "en_US".
335
- * @param {string} [signPrice] - Sign price.
343
+ * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
344
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
336
345
  * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
337
346
  * @throws {IError} When isShell=false and an error occurs during the fetch
338
347
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getTrending getTrending} documentation.
@@ -347,7 +356,8 @@ class BlocksApi extends asyncModules_1.default {
347
356
  * @handleName getWishlistSimilar
348
357
  * @param {string} marker - Block marker. Example: "wishlist_similar_block".
349
358
  * @param {string} [langCode] - Language code. Default: "en_US".
350
- * @param {string} [signPrice] - Sign price.
359
+ * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
360
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
351
361
  * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
352
362
  * @throws {IError} When isShell=false and an error occurs during the fetch
353
363
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getWishlistSimilar getWishlistSimilar} documentation.
@@ -46,7 +46,8 @@ interface IBlocks {
46
46
  * @param {number} productId - Product id. Example: 1.
47
47
  * @param {string} marker - Block marker. Example: "frequently_ordered_block".
48
48
  * @param {string} [langCode] - Language code. Default: "en_US".
49
- * @param {string} [signPrice] - Sign price.
49
+ * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
50
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
50
51
  * @returns {IProductsResponse} A promise that resolves to a products response (items + total) or an error.
51
52
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
52
53
  */
@@ -56,7 +57,8 @@ interface IBlocks {
56
57
  * @handleName getCartComplement
57
58
  * @param {string} marker - Block marker. Example: "cart_complement_block".
58
59
  * @param {string} [langCode] - Language code. Default: "en_US".
59
- * @param {string} [signPrice] - Sign price.
60
+ * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
61
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
60
62
  * @returns {IProductsEntity[]} A promise that resolves to an array of products or an error.
61
63
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
62
64
  */
@@ -80,7 +82,8 @@ interface IBlocks {
80
82
  * @handleName getCartSimilar
81
83
  * @param {string} marker - Block marker. Example: "cart_similar_block".
82
84
  * @param {string} [langCode] - Language code. Default: "en_US".
83
- * @param {string} [signPrice] - Sign price.
85
+ * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
86
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
84
87
  * @returns {IProductsEntity[]} A promise that resolves to an array of products or an error.
85
88
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
86
89
  */
@@ -104,7 +107,8 @@ interface IBlocks {
104
107
  * @handleName getPersonalRecommendations
105
108
  * @param {string} marker - Block marker. Example: "personal_recommendations_block".
106
109
  * @param {string} [langCode] - Language code. Default: "en_US".
107
- * @param {string} [signPrice] - Sign price.
110
+ * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
111
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
108
112
  * @returns {IProductsEntity[]} A promise that resolves to an array of products or an error.
109
113
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
110
114
  */
@@ -114,7 +118,8 @@ interface IBlocks {
114
118
  * @handleName getRecentlyViewed
115
119
  * @param {string} marker - Block marker. Example: "recently_viewed_block".
116
120
  * @param {string} [langCode] - Language code. Default: "en_US".
117
- * @param {string} [signPrice] - Sign price.
121
+ * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
122
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
118
123
  * @returns {IProductsEntity[]} A promise that resolves to an array of products or an error.
119
124
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
120
125
  */
@@ -124,7 +129,8 @@ interface IBlocks {
124
129
  * @handleName getRepeatPurchase
125
130
  * @param {string} marker - Block marker. Example: "repeat_purchase_block".
126
131
  * @param {string} [langCode] - Language code. Default: "en_US".
127
- * @param {string} [signPrice] - Sign price.
132
+ * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
133
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
128
134
  * @returns {IProductsEntity[]} A promise that resolves to an array of products or an error.
129
135
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
130
136
  */
@@ -142,7 +148,8 @@ interface IBlocks {
142
148
  * @handleName getTrending
143
149
  * @param {string} marker - Block marker. Example: "trending_block".
144
150
  * @param {string} [langCode] - Language code. Default: "en_US".
145
- * @param {string} [signPrice] - Sign price.
151
+ * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
152
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
146
153
  * @returns {IProductsEntity[]} A promise that resolves to an array of products or an error.
147
154
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
148
155
  */
@@ -152,7 +159,8 @@ interface IBlocks {
152
159
  * @handleName getWishlistSimilar
153
160
  * @param {string} marker - Block marker. Example: "wishlist_similar_block".
154
161
  * @param {string} [langCode] - Language code. Default: "en_US".
155
- * @param {string} [signPrice] - Sign price.
162
+ * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
163
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
156
164
  * @returns {IProductsEntity[]} A promise that resolves to an array of products or an error.
157
165
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
158
166
  */
@@ -302,7 +310,8 @@ type BlockType = 'product' | 'error_page' | 'catalog_page' | 'product_preview' |
302
310
  * @property {number[]} productIds - Product identifiers to look up. Example: [1, 2, 3].
303
311
  * @property {string} [langCode] - Language code. Default: "en_US".
304
312
  * @property {number} [limit] - Max number of products to return. Example: 10.
305
- * @property {string} [signPrice] - Sign price.
313
+ * @property {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
314
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
306
315
  * @description Body for the POST block product endpoints (cart-complement / cart-similar / wishlist-similar) that accept an explicit list of productIds.
307
316
  */
308
317
  interface IBlockProductsLookup {
package/dist/index.js CHANGED
@@ -53,6 +53,18 @@ const wsApi_1 = __importDefault(require("./web-socket/wsApi"));
53
53
  * @description Define API.
54
54
  */
55
55
  function defineOneEntry(url, config) {
56
+ if (typeof url !== 'string' || url.trim() === '') {
57
+ throw new Error('OneEntry SDK: project URL is required to initialize the SDK. ' +
58
+ 'Pass a non-empty URL as the first argument of defineOneEntry, e.g. ' +
59
+ 'defineOneEntry("https://your-project.oneentry.cloud", { token: "your-app-token" }).');
60
+ }
61
+ if (!config ||
62
+ typeof config.token !== 'string' ||
63
+ config.token.trim() === '') {
64
+ throw new Error('OneEntry SDK: app token is required to initialize the SDK. ' +
65
+ 'Pass it via config, e.g. ' +
66
+ 'defineOneEntry("https://your-project.oneentry.cloud", { token: "your-app-token" }).');
67
+ }
56
68
  const stateModule = new stateModule_1.default(url.endsWith('/') ? url.slice(0, -1) : url, config);
57
69
  const Admins = new adminsApi_1.default(stateModule);
58
70
  const AttributesSets = new attributeSetsApi_1.default(stateModule);
@@ -267,6 +267,7 @@ interface IOrdersFormData {
267
267
  * @property {number} productId - Product identifier. Example: 1.
268
268
  * @property {number} quantity - Quantity of the product. Example: 2.
269
269
  * @property {string} [signedPrice] - The signed price of the product is obtained along with the product data when `signPrice` is set. Example: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...".
270
+ * @see {@link https://js-sdk.oneentry.cloud/docs/orders/#Fixed-product-price-signedPrice Fixed product price} documentation.
270
271
  * @description Represents a product data in an order.
271
272
  */
272
273
  interface IOrderProductData {
@@ -208,7 +208,8 @@ class PagesApi extends asyncModules_1.default {
208
208
  */
209
209
  async searchPage(name, url, langCode = this.state.lang) {
210
210
  // Fetch data from the server using a GET request to perform a quick search by page name and language code
211
- const data = await this._fetchGet(`/quick/search?${url && 'url=' + url}&lang=${langCode}&name=${name}`);
211
+ const urlPart = url ? `url=${encodeURIComponent(url)}&` : '';
212
+ const data = await this._fetchGet(`/quick/search?${urlPart}lang=${encodeURIComponent(langCode)}&name=${encodeURIComponent(name)}`);
212
213
  // /quick/search?url=catalog&langCode=en_US&name=cat
213
214
  // Check if there is no traffic limit set in the state
214
215
  if (!this.state.traficLimit && Array.isArray(data)) {
@@ -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,53 +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.
67
63
  * @see {@link https://js-sdk.oneentry.cloud/docs/products/getProducts getProducts} documentation.
68
64
  */
69
- getProducts(body?: IFilterParams[], langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse | IError>;
65
+ getProducts(body?: IFilterParams[], langCode?: string, userQuery?: IProductsQueryBase): Promise<IProductsResponse | IError>;
70
66
  /**
71
67
  * Search for all product page objects with pagination (and aggregation) that do not have a category.
72
68
  * @handleName getProductsEmptyPage
73
69
  * @param {object} [body] - Request body. Default: {}.
74
70
  * @param {string} [langCode] - Language code. Default: "en_US".
75
- * @param {IProductsQuery} [userQuery] - Optional set query parameters.
71
+ * @param {IProductsQueryBase} [userQuery] - Optional set query parameters.
76
72
  * @example
77
73
  {
78
74
  "limit": 30,
79
75
  "offset": 0,
80
76
  "sortOrder": "DESC",
81
77
  "sortKey": "id",
82
- "signPrice": "orders",
83
- "templateMarker": "template_12345",
84
- "statusMarker": "in_stock",
85
- "conditionValue": "new",
86
- "conditionMarker": "eq",
87
- "attributeMarker": "color"
78
+ "signPrice": "orders"
88
79
  }
89
80
  * @returns {Promise<IAggregatedProductGroup[] | IError>} Array with AggregatedProductGroup objects.
90
81
  * @throws {IError} When isShell=false and an error occurs during the fetch
91
82
  * @description Search for all product page objects with pagination (and aggregation) that do not have a category.
92
83
  * @see {@link https://js-sdk.oneentry.cloud/docs/products/getProductsEmptyPage getProductsEmptyPage} documentation.
93
84
  */
94
- getProductsEmptyPage(body?: object, langCode?: string, userQuery?: IProductsQuery): Promise<IAggregatedProductGroup[] | IError>;
85
+ getProductsEmptyPage(body?: object, langCode?: string, userQuery?: IProductsQueryBase): Promise<IAggregatedProductGroup[] | IError>;
95
86
  /**
96
87
  * Search for all products with pagination for the selected category.
97
88
  * @handleName getProductsByPageId
@@ -122,51 +113,41 @@ export default class ProductsApi extends AsyncModules implements IProductsApi {
122
113
  }
123
114
  ]
124
115
  * @param {string} [langCode] - Language code. Default: "en_US".
125
- * @param {IProductsQuery} [userQuery] - Optional set query parameters.
116
+ * @param {IProductsQueryBase} [userQuery] - Optional set query parameters.
126
117
  * @example
127
118
  {
128
119
  "limit": 30,
129
120
  "offset": 0,
130
121
  "sortOrder": "DESC",
131
122
  "sortKey": "id",
132
- "signPrice": "orders",
133
- "templateMarker": "template_12345",
134
- "statusMarker": "in_stock",
135
- "conditionValue": "new",
136
- "conditionMarker": "eq",
137
- "attributeMarker": "color"
123
+ "signPrice": "orders"
138
124
  }
139
125
  * @returns {Promise<IProductsResponse | IError>} Array with ProductEntity objects
140
126
  * @throws {IError} When isShell=false and an error occurs during the fetch
141
127
  * @description Fetch products by page ID with optional filters and pagination.
142
128
  * @see {@link https://js-sdk.oneentry.cloud/docs/products/getProductsByPageId getProductsByPageId} documentation.
143
129
  */
144
- 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>;
145
131
  /**
146
132
  * Search for information about products and prices for the selected category.
147
133
  * @handleName getProductsPriceByPageUrl
148
134
  * @param {string} [url] - Page url. Example: "23-laminat-floorwood-maxima".
149
135
  * @param {string} [langCode] - Language code. Default: "en_US".
150
- * @param {IProductsQuery} [userQuery] - Optional set query parameters.
136
+ * @param {IProductsPriceQuery} [userQuery] - Optional set query parameters.
151
137
  * @example
152
138
  {
153
139
  "limit": 30,
154
140
  "offset": 0,
155
141
  "sortOrder": "DESC",
156
- "sortKey": "id",
157
142
  "signPrice": "orders",
158
- "templateMarker": "template_12345",
159
- "statusMarker": "in_stock",
160
- "conditionValue": "new",
161
- "conditionMarker": "eq",
162
- "attributeMarker": "color"
143
+ "statusMarker": "in_stock"
163
144
  }
164
145
  * @returns {Promise<IProductsInfo | IError>} Array with ProductInformation objects.
165
146
  * @throws {IError} When isShell=false and an error occurs during the fetch
166
147
  * @description Search for information about products and prices for the selected category.
167
148
  * @see {@link https://js-sdk.oneentry.cloud/docs/products/getProductsPriceByPageUrl getProductsPriceByPageUrl} documentation.
168
149
  */
169
- getProductsPriceByPageUrl(url: string, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsInfo | IError>;
150
+ getProductsPriceByPageUrl(url: string, langCode?: string, userQuery?: IProductsPriceQuery): Promise<IProductsInfo | IError>;
170
151
  /**
171
152
  * Search for all products with pagination for the selected category.
172
153
  * @handleName getProductsByPageUrl
@@ -197,32 +178,27 @@ export default class ProductsApi extends AsyncModules implements IProductsApi {
197
178
  }
198
179
  ]
199
180
  * @param {string} [langCode] - Language code. Default: "en_US".
200
- * @param {IProductsQuery} [userQuery] - Optional set query parameters.
181
+ * @param {IProductsQueryBase} [userQuery] - Optional set query parameters.
201
182
  * @example
202
183
  {
203
184
  "limit": 30,
204
185
  "offset": 0,
205
186
  "sortOrder": "DESC",
206
187
  "sortKey": "id",
207
- "signPrice": "orders",
208
- "templateMarker": "template_12345",
209
- "statusMarker": "in_stock",
210
- "conditionValue": "new",
211
- "conditionMarker": "eq",
212
- "attributeMarker": "color"
188
+ "signPrice": "orders"
213
189
  }
214
190
  * @returns {Promise<IProductsResponse | IError>} Array with ProductEntity objects.
215
191
  * @throws {IError} When isShell=false and an error occurs during the fetch
216
192
  * @description Search for all products with pagination for the selected category.
217
193
  * @see {@link https://js-sdk.oneentry.cloud/docs/products/getProductsByPageUrl getProductsByPageUrl} documentation.
218
194
  */
219
- 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>;
220
196
  /**
221
197
  * Find all related product page objects.
222
198
  * @handleName getRelatedProductsById
223
199
  * @param {number} [id] - Product page identifier for which to find relationship. Example: 12345.
224
200
  * @param {string} [langCode] - Language code. Default: "en_US".
225
- * @param {IProductsQuery} [userQuery] - Optional set query parameters.
201
+ * @param {IProductsRelatedQuery} [userQuery] - Optional set query parameters.
226
202
  * @example
227
203
  {
228
204
  "limit": 30,
@@ -230,11 +206,8 @@ export default class ProductsApi extends AsyncModules implements IProductsApi {
230
206
  "sortOrder": "DESC",
231
207
  "sortKey": "id",
232
208
  "signPrice": "orders",
233
- "templateMarker": "template_12345",
234
209
  "statusMarker": "in_stock",
235
- "conditionValue": "new",
236
- "conditionMarker": "eq",
237
- "attributeMarker": "color"
210
+ "templateMarker": "template_12345"
238
211
  }
239
212
  * @param {number} [userQuery.limit] - Optional parameter for pagination. Default: 30.
240
213
  * @param {number} [userQuery.offset] - Optional parameter for pagination. Default: 0.
@@ -245,40 +218,28 @@ export default class ProductsApi extends AsyncModules implements IProductsApi {
245
218
  * @description Find all related product page objects.
246
219
  * @see {@link https://js-sdk.oneentry.cloud/docs/products/getRelatedProductsById getRelatedProductsById} documentation.
247
220
  */
248
- getRelatedProductsById(id: number, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse | IError>;
221
+ getRelatedProductsById(id: number, langCode?: string, userQuery?: IProductsRelatedQuery): Promise<IProductsResponse | IError>;
249
222
  /**
250
223
  * Find products by its ids.
251
224
  * @handleName getProductsByIds
252
225
  * @param {string} ids - Product page identifiers for which to find relationships. Example: "12345,67890".
253
226
  * @param {string} [langCode] - Language code. Default "en_US".
254
- * @param {IProductsQuery} [userQuery] - Optional set query parameters.
227
+ * @param {IProductsByIdsQuery} [userQuery] - Optional set query parameters.
255
228
  * @example
256
229
  {
257
230
  "limit": 30,
258
231
  "offset": 0,
259
- "sortOrder": "DESC",
260
- "sortKey": "id",
261
- "signPrice": "orders",
262
- "templateMarker": "template_12345",
263
- "statusMarker": "in_stock",
264
- "conditionValue": "new",
265
- "conditionMarker": "eq",
266
- "attributeMarker": "color"
232
+ "signPrice": "orders"
267
233
  }
268
234
  * @param {number} [userQuery.limit] - Optional parameter for pagination. Default: 30.
269
235
  * @param {number} [userQuery.offset] - Optional parameter for pagination. Default: 0.
270
- * @param {string} [userQuery.sortOrder] - Optional sorting order "DESC" | "ASC". Example: "DESC".
271
- * @param {string} [userQuery.sortKey] - Optional field to sort by ("id", "title", "date", "price", "position", "status"). Example: "id".
272
- * @param {string} [userQuery.statusMarker] - Optional identifier of the product page status. Example: "in_stock".
273
- * @param {string} [userQuery.conditionValue] - Optional value that is being searched. Example: "new".
274
- * @param {string} [userQuery.conditionMarker] - Optional identifier of the filter condition by which values are filtered. Example: "eq".
275
- * @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.
276
237
  * @returns {Promise<IProductsEntity[] | IError>} Array with ProductEntity objects
277
238
  * @throws {IError} When isShell=false and an error occurs during the fetch
278
239
  * @description Find products by its ids.
279
240
  * @see {@link https://js-sdk.oneentry.cloud/docs/products/getProductsByIds getProductsByIds} documentation.
280
241
  */
281
- getProductsByIds(ids: string, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsEntity[] | IError>;
242
+ getProductsByIds(ids: string, langCode?: string, userQuery?: IProductsByIdsQuery): Promise<IProductsEntity[] | IError>;
282
243
  /**
283
244
  * Retrieve one product object.
284
245
  * @handleName getProductById