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.
- package/changelog.md +49 -0
- package/dist/admins/adminsApi.d.ts +2 -1
- package/dist/admins/adminsApi.js +2 -1
- package/dist/admins/adminsInterfaces.d.ts +1 -1
- package/dist/attribute-sets/attributeSetsApi.d.ts +4 -0
- package/dist/attribute-sets/attributeSetsApi.js +4 -0
- package/dist/auth-provider/authProviderApi.d.ts +14 -1
- package/dist/auth-provider/authProviderApi.js +14 -1
- package/dist/base/asyncModules.d.ts +21 -2
- package/dist/base/asyncModules.js +74 -225
- 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 +54 -11
- package/dist/blocks/blocksApi.js +90 -73
- package/dist/blocks/blocksInterfaces.d.ts +18 -9
- package/dist/discounts/discountsApi.d.ts +5 -0
- package/dist/discounts/discountsApi.js +5 -0
- package/dist/events/eventsApi.d.ts +7 -0
- package/dist/events/eventsApi.js +11 -28
- package/dist/file-uploading/fileUploadingApi.d.ts +4 -1
- package/dist/file-uploading/fileUploadingApi.js +4 -1
- package/dist/file-uploading/fileUploadingInterfaces.d.ts +1 -1
- package/dist/filters/filtersApi.d.ts +1 -0
- package/dist/filters/filtersApi.js +1 -0
- package/dist/forms/formsApi.d.ts +2 -0
- package/dist/forms/formsApi.js +2 -0
- package/dist/forms-data/formsDataApi.d.ts +5 -0
- package/dist/forms-data/formsDataApi.js +5 -0
- package/dist/general-types/generalTypesApi.d.ts +1 -0
- package/dist/general-types/generalTypesApi.js +1 -0
- package/dist/index.js +12 -0
- package/dist/integration-collections/integrationCollectionsApi.d.ts +10 -1
- package/dist/integration-collections/integrationCollectionsApi.js +10 -1
- package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +1 -1
- package/dist/locales/localesApi.d.ts +1 -0
- package/dist/locales/localesApi.js +1 -0
- package/dist/menus/menusApi.d.ts +1 -0
- package/dist/menus/menusApi.js +1 -0
- package/dist/orders/ordersApi.d.ts +25 -1
- package/dist/orders/ordersApi.js +36 -12
- package/dist/orders/ordersInterfaces.d.ts +5 -2
- package/dist/pages/pagesApi.d.ts +9 -0
- package/dist/pages/pagesApi.js +35 -39
- package/dist/pages/pagesInterfaces.d.ts +5 -0
- package/dist/payments/paymentsApi.d.ts +6 -0
- package/dist/payments/paymentsApi.js +6 -0
- package/dist/product-statuses/productStatusesApi.d.ts +3 -0
- package/dist/product-statuses/productStatusesApi.js +3 -0
- package/dist/products/productsApi.d.ts +39 -64
- package/dist/products/productsApi.js +33 -61
- package/dist/products/productsInterfaces.d.ts +76 -72
- package/dist/sitemap/sitemapApi.d.ts +2 -0
- package/dist/sitemap/sitemapApi.js +2 -0
- package/dist/subscriptions/subscriptionsApi.d.ts +5 -0
- package/dist/subscriptions/subscriptionsApi.js +7 -14
- package/dist/system/systemApi.d.ts +3 -0
- package/dist/system/systemApi.js +3 -0
- package/dist/templates/templatesApi.d.ts +3 -0
- package/dist/templates/templatesApi.js +3 -0
- package/dist/templates-preview/templatesPreviewApi.d.ts +2 -0
- package/dist/templates-preview/templatesPreviewApi.js +2 -0
- package/dist/user-activity/userActivityApi.d.ts +1 -0
- package/dist/user-activity/userActivityApi.js +1 -0
- package/dist/users/usersApi.d.ts +14 -0
- package/dist/users/usersApi.js +14 -0
- package/dist/web-socket/wsApi.d.ts +1 -1
- package/dist/web-socket/wsApi.js +1 -1
- package/package.json +4 -1
|
@@ -27,6 +27,7 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
|
|
|
27
27
|
* @param {number} [limit] - Parameter for pagination. Default: 30.
|
|
28
28
|
* @returns {Promise<IBlocksResponse | IError>} Returns BlocksEntity object.
|
|
29
29
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
30
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getBlocks getBlocks} documentation.
|
|
30
31
|
*/
|
|
31
32
|
getBlocks(type?: BlockType, langCode?: string, offset?: number, limit?: number): Promise<IBlocksResponse | IError>;
|
|
32
33
|
/**
|
|
@@ -39,8 +40,25 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
|
|
|
39
40
|
* @returns {Promise<IBlockEntity | IError>} - Returns a BlockEntity object.
|
|
40
41
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
41
42
|
* @description This method retrieves a block by its marker and includes additional information such as similar products or products associated with the block.
|
|
43
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getBlockByMarker getBlockByMarker} documentation.
|
|
42
44
|
*/
|
|
43
45
|
getBlockByMarker(marker: string, langCode?: string, offset?: number, limit?: number): Promise<IBlockEntity | IError>;
|
|
46
|
+
/**
|
|
47
|
+
* Enrich a single block in place.
|
|
48
|
+
*
|
|
49
|
+
* Lifts product display settings from `customSettings.productConfig` to
|
|
50
|
+
* numeric top-level fields, strips internal-only fields, and — when
|
|
51
|
+
* `loadProducts` is true — fetches the related products for
|
|
52
|
+
* `similar_products_block` / `product_block` blocks. Shared by `getBlocks`
|
|
53
|
+
* (array) and `getBlockByMarker` (single block). Mutates `block` in place.
|
|
54
|
+
* @param {any} block - Normalized block to enrich (mutated in place).
|
|
55
|
+
* @param {string} langCode - Language code passed to product sub-requests.
|
|
56
|
+
* @param {number} offset - Pagination offset for product sub-requests.
|
|
57
|
+
* @param {number} limit - Pagination limit for product sub-requests.
|
|
58
|
+
* @param {boolean} loadProducts - Whether to fetch related products.
|
|
59
|
+
* @returns {Promise<void>} Resolves when enrichment (incl. sub-requests) is done.
|
|
60
|
+
*/
|
|
61
|
+
private _enrichBlock;
|
|
44
62
|
/**
|
|
45
63
|
* Get similar products by block marker.
|
|
46
64
|
* @handleName getSimilarProducts
|
|
@@ -48,10 +66,12 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
|
|
|
48
66
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
49
67
|
* @param {number} [offset] - Parameter for pagination. Default: 0.
|
|
50
68
|
* @param {number} [limit] - Parameter for pagination. Default: 30.
|
|
51
|
-
* @param {string} [signPrice] -
|
|
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.
|
|
52
71
|
* @param {number} [productId] - Optional product id to find similar products for.
|
|
53
|
-
* @returns {Promise<IProductsResponse | IError>}
|
|
72
|
+
* @returns {Promise<IProductsResponse | IError>} Returns the total count and an array of product items in object by specified block marker.
|
|
54
73
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
74
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getSimilarProducts getSimilarProducts} documentation.
|
|
55
75
|
*/
|
|
56
76
|
private getSimilarProducts;
|
|
57
77
|
/**
|
|
@@ -61,9 +81,11 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
|
|
|
61
81
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
62
82
|
* @param {number} [offset] - Parameter for pagination. Default: 0.
|
|
63
83
|
* @param {number} [limit] - Parameter for pagination. Default: 30.
|
|
64
|
-
* @param {string} [signPrice] -
|
|
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.
|
|
65
86
|
* @returns {Promise<IProductsEntity[] | IError>} Return array of BlocksEntity object.
|
|
66
87
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
88
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getProductsByBlockMarker getProductsByBlockMarker} documentation.
|
|
67
89
|
*/
|
|
68
90
|
private getProductsByBlockMarker;
|
|
69
91
|
/**
|
|
@@ -72,9 +94,11 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
|
|
|
72
94
|
* @param {number} productId - Product id. Example: 1.
|
|
73
95
|
* @param {string} marker - Block marker. Example: "frequently_ordered_block".
|
|
74
96
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
75
|
-
* @param {string} [signPrice] -
|
|
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.
|
|
76
99
|
* @returns {Promise<IProductsResponse | IError>} Returns a products response with items and total.
|
|
77
100
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
101
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getFrequentlyOrderedProducts getFrequentlyOrderedProducts} documentation.
|
|
78
102
|
*/
|
|
79
103
|
getFrequentlyOrderedProducts(productId: number, marker: string, langCode?: string, signPrice?: string): Promise<IProductsResponse | IError>;
|
|
80
104
|
/**
|
|
@@ -84,6 +108,7 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
|
|
|
84
108
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
85
109
|
* @returns {Promise<ISearchBlock[] | IError>} Returns an array of ISearchBlock objects.
|
|
86
110
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
111
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/blocks/searchBlock searchBlock} documentation.
|
|
87
112
|
*/
|
|
88
113
|
searchBlock(name: string, langCode?: string): Promise<ISearchBlock[] | IError>;
|
|
89
114
|
/**
|
|
@@ -91,9 +116,11 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
|
|
|
91
116
|
* @handleName getCartComplement
|
|
92
117
|
* @param {string} marker - Block marker. Example: "cart_complement_block".
|
|
93
118
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
94
|
-
* @param {string} [signPrice] -
|
|
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.
|
|
95
121
|
* @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
|
|
96
122
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
123
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getCartComplement getCartComplement} documentation.
|
|
97
124
|
*/
|
|
98
125
|
getCartComplement(marker: string, langCode?: string, signPrice?: string): Promise<IProductsEntity[] | IError>;
|
|
99
126
|
/**
|
|
@@ -108,6 +135,7 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
|
|
|
108
135
|
}
|
|
109
136
|
* @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
|
|
110
137
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
138
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getCartComplementByProductIds getCartComplementByProductIds} documentation.
|
|
111
139
|
*/
|
|
112
140
|
getCartComplementByProductIds(marker: string, body: IBlockProductsLookup): Promise<IProductsEntity[] | IError>;
|
|
113
141
|
/**
|
|
@@ -115,9 +143,11 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
|
|
|
115
143
|
* @handleName getCartSimilar
|
|
116
144
|
* @param {string} marker - Block marker. Example: "cart_similar_block".
|
|
117
145
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
118
|
-
* @param {string} [signPrice] -
|
|
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.
|
|
119
148
|
* @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
|
|
120
149
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
150
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getCartSimilar getCartSimilar} documentation.
|
|
121
151
|
*/
|
|
122
152
|
getCartSimilar(marker: string, langCode?: string, signPrice?: string): Promise<IProductsEntity[] | IError>;
|
|
123
153
|
/**
|
|
@@ -132,6 +162,7 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
|
|
|
132
162
|
}
|
|
133
163
|
* @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
|
|
134
164
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
165
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getCartSimilarByProductIds getCartSimilarByProductIds} documentation.
|
|
135
166
|
*/
|
|
136
167
|
getCartSimilarByProductIds(marker: string, body: IBlockProductsLookup): Promise<IProductsEntity[] | IError>;
|
|
137
168
|
/**
|
|
@@ -139,9 +170,11 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
|
|
|
139
170
|
* @handleName getPersonalRecommendations
|
|
140
171
|
* @param {string} marker - Block marker. Example: "personal_recommendations_block".
|
|
141
172
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
142
|
-
* @param {string} [signPrice] -
|
|
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.
|
|
143
175
|
* @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
|
|
144
176
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
177
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getPersonalRecommendations getPersonalRecommendations} documentation.
|
|
145
178
|
*/
|
|
146
179
|
getPersonalRecommendations(marker: string, langCode?: string, signPrice?: string): Promise<IProductsEntity[] | IError>;
|
|
147
180
|
/**
|
|
@@ -149,9 +182,11 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
|
|
|
149
182
|
* @handleName getRecentlyViewed
|
|
150
183
|
* @param {string} marker - Block marker. Example: "recently_viewed_block".
|
|
151
184
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
152
|
-
* @param {string} [signPrice] -
|
|
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.
|
|
153
187
|
* @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
|
|
154
188
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
189
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getRecentlyViewed getRecentlyViewed} documentation.
|
|
155
190
|
*/
|
|
156
191
|
getRecentlyViewed(marker: string, langCode?: string, signPrice?: string): Promise<IProductsEntity[] | IError>;
|
|
157
192
|
/**
|
|
@@ -159,9 +194,11 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
|
|
|
159
194
|
* @handleName getRepeatPurchase
|
|
160
195
|
* @param {string} marker - Block marker. Example: "repeat_purchase_block".
|
|
161
196
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
162
|
-
* @param {string} [signPrice] -
|
|
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.
|
|
163
199
|
* @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
|
|
164
200
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
201
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getRepeatPurchase getRepeatPurchase} documentation.
|
|
165
202
|
*/
|
|
166
203
|
getRepeatPurchase(marker: string, langCode?: string, signPrice?: string): Promise<IProductsEntity[] | IError>;
|
|
167
204
|
/**
|
|
@@ -170,6 +207,7 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
|
|
|
170
207
|
* @param {string} marker - Block marker. Example: "slider_block".
|
|
171
208
|
* @returns {Promise<IBlockSlidesResponse | IError>} Returns the slides response.
|
|
172
209
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
210
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getSlides getSlides} documentation.
|
|
173
211
|
*/
|
|
174
212
|
getSlides(marker: string): Promise<IBlockSlidesResponse | IError>;
|
|
175
213
|
/**
|
|
@@ -177,9 +215,11 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
|
|
|
177
215
|
* @handleName getTrending
|
|
178
216
|
* @param {string} marker - Block marker. Example: "trending_block".
|
|
179
217
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
180
|
-
* @param {string} [signPrice] -
|
|
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.
|
|
181
220
|
* @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
|
|
182
221
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
222
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getTrending getTrending} documentation.
|
|
183
223
|
*/
|
|
184
224
|
getTrending(marker: string, langCode?: string, signPrice?: string): Promise<IProductsEntity[] | IError>;
|
|
185
225
|
/**
|
|
@@ -187,9 +227,11 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
|
|
|
187
227
|
* @handleName getWishlistSimilar
|
|
188
228
|
* @param {string} marker - Block marker. Example: "wishlist_similar_block".
|
|
189
229
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
190
|
-
* @param {string} [signPrice] -
|
|
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.
|
|
191
232
|
* @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
|
|
192
233
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
234
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getWishlistSimilar getWishlistSimilar} documentation.
|
|
193
235
|
*/
|
|
194
236
|
getWishlistSimilar(marker: string, langCode?: string, signPrice?: string): Promise<IProductsEntity[] | IError>;
|
|
195
237
|
/**
|
|
@@ -204,6 +246,7 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
|
|
|
204
246
|
}
|
|
205
247
|
* @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
|
|
206
248
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
249
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getWishlistSimilarByProductIds getWishlistSimilarByProductIds} documentation.
|
|
207
250
|
*/
|
|
208
251
|
getWishlistSimilarByProductIds(marker: string, body: IBlockProductsLookup): Promise<IProductsEntity[] | IError>;
|
|
209
252
|
}
|
package/dist/blocks/blocksApi.js
CHANGED
|
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
/* eslint-disable jsdoc/reject-any-type */
|
|
6
7
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
7
8
|
const asyncModules_1 = __importDefault(require("../base/asyncModules"));
|
|
8
9
|
const blocksSchemas_1 = require("./blocksSchemas");
|
|
@@ -31,6 +32,7 @@ class BlocksApi extends asyncModules_1.default {
|
|
|
31
32
|
* @param {number} [limit] - Parameter for pagination. Default: 30.
|
|
32
33
|
* @returns {Promise<IBlocksResponse | IError>} Returns BlocksEntity object.
|
|
33
34
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
35
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getBlocks getBlocks} documentation.
|
|
34
36
|
*/
|
|
35
37
|
async getBlocks(type, langCode = this.state.lang, offset = 0, limit = 30) {
|
|
36
38
|
// type is omitted from the query when not provided — the API rejects an
|
|
@@ -41,41 +43,8 @@ class BlocksApi extends asyncModules_1.default {
|
|
|
41
43
|
const validated = this._validateResponse(response, blocksSchemas_1.BlocksResponseSchema);
|
|
42
44
|
if (!this.state.traficLimit) {
|
|
43
45
|
const normalizeResponse = this._normalizeData(validated);
|
|
44
|
-
await Promise.all(normalizeResponse.items.map(
|
|
45
|
-
|
|
46
|
-
if (customSettings &&
|
|
47
|
-
Object.prototype.hasOwnProperty.call(customSettings, 'productConfig')) {
|
|
48
|
-
if (customSettings.productConfig.countElementsPerRow)
|
|
49
|
-
block.countElementsPerRow =
|
|
50
|
-
+customSettings.productConfig.countElementsPerRow;
|
|
51
|
-
if (customSettings.productConfig.quantity)
|
|
52
|
-
block.quantity = +customSettings.productConfig.quantity;
|
|
53
|
-
}
|
|
54
|
-
delete block.customSettings;
|
|
55
|
-
delete block.attributesSetIdentifier;
|
|
56
|
-
delete block.productPageUrls;
|
|
57
|
-
if (block.type === 'similar_products_block') {
|
|
58
|
-
try {
|
|
59
|
-
await this.getSimilarProducts(block.identifier, langCode, offset, limit).then((result) => {
|
|
60
|
-
block.similarProducts = result;
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
catch {
|
|
64
|
-
block.similarProducts = [];
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
else if (block.type === 'product_block') {
|
|
68
|
-
try {
|
|
69
|
-
await this.getProductsByBlockMarker(block.identifier, langCode, offset, limit).then((result) => {
|
|
70
|
-
block.products = result;
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
catch {
|
|
74
|
-
block.products = [];
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}));
|
|
78
|
-
return this._normalizeData(normalizeResponse);
|
|
46
|
+
await Promise.all(normalizeResponse.items.map((block) => this._enrichBlock(block, langCode, offset, limit, true)));
|
|
47
|
+
return normalizeResponse;
|
|
79
48
|
}
|
|
80
49
|
return this._normalizeData(validated);
|
|
81
50
|
}
|
|
@@ -89,47 +58,70 @@ class BlocksApi extends asyncModules_1.default {
|
|
|
89
58
|
* @returns {Promise<IBlockEntity | IError>} - Returns a BlockEntity object.
|
|
90
59
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
91
60
|
* @description This method retrieves a block by its marker and includes additional information such as similar products or products associated with the block.
|
|
61
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getBlockByMarker getBlockByMarker} documentation.
|
|
92
62
|
*/
|
|
93
63
|
async getBlockByMarker(marker, langCode = this.state.lang, offset = 0, limit = 30) {
|
|
94
64
|
const response = await this._fetchGet(`/marker/${marker}?langCode=${langCode}`);
|
|
95
65
|
// Validate response if validation is enabled
|
|
96
66
|
const validated = this._validateResponse(response, blocksSchemas_1.BlockEntitySchema);
|
|
97
67
|
const normalizeResponse = this._normalizeData(validated);
|
|
98
|
-
|
|
68
|
+
await this._enrichBlock(normalizeResponse, langCode, offset, limit, !this.state.traficLimit);
|
|
69
|
+
return normalizeResponse;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Enrich a single block in place.
|
|
73
|
+
*
|
|
74
|
+
* Lifts product display settings from `customSettings.productConfig` to
|
|
75
|
+
* numeric top-level fields, strips internal-only fields, and — when
|
|
76
|
+
* `loadProducts` is true — fetches the related products for
|
|
77
|
+
* `similar_products_block` / `product_block` blocks. Shared by `getBlocks`
|
|
78
|
+
* (array) and `getBlockByMarker` (single block). Mutates `block` in place.
|
|
79
|
+
* @param {any} block - Normalized block to enrich (mutated in place).
|
|
80
|
+
* @param {string} langCode - Language code passed to product sub-requests.
|
|
81
|
+
* @param {number} offset - Pagination offset for product sub-requests.
|
|
82
|
+
* @param {number} limit - Pagination limit for product sub-requests.
|
|
83
|
+
* @param {boolean} loadProducts - Whether to fetch related products.
|
|
84
|
+
* @returns {Promise<void>} Resolves when enrichment (incl. sub-requests) is done.
|
|
85
|
+
*/
|
|
86
|
+
async _enrichBlock(block, langCode, offset, limit, loadProducts) {
|
|
87
|
+
const customSettings = block.customSettings;
|
|
88
|
+
// Если у блока есть настройки отображения товаров (productConfig) —
|
|
89
|
+
// переносим их на верхний уровень блока в числовом формате (в API значения
|
|
90
|
+
// хранятся строками, поэтому приводим через «+»).
|
|
99
91
|
if (customSettings &&
|
|
100
92
|
Object.prototype.hasOwnProperty.call(customSettings, 'productConfig')) {
|
|
101
93
|
if (customSettings.productConfig.countElementsPerRow)
|
|
102
|
-
|
|
94
|
+
block.countElementsPerRow =
|
|
103
95
|
+customSettings.productConfig.countElementsPerRow;
|
|
104
96
|
if (customSettings.productConfig.quantity)
|
|
105
|
-
|
|
97
|
+
block.quantity = +customSettings.productConfig.quantity;
|
|
106
98
|
}
|
|
107
|
-
|
|
108
|
-
delete
|
|
109
|
-
delete
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
99
|
+
// Убираем служебные/внутренние поля из итогового объекта блока.
|
|
100
|
+
delete block.customSettings;
|
|
101
|
+
delete block.attributesSetIdentifier;
|
|
102
|
+
delete block.productPageUrls;
|
|
103
|
+
// В режиме экономии трафика товары не подгружаем.
|
|
104
|
+
if (!loadProducts)
|
|
105
|
+
return;
|
|
106
|
+
// Подгружаем связанные товары по идентификатору блока. При ошибке запроса
|
|
107
|
+
// подставляем пустой массив, чтобы один упавший подзапрос не ронял весь
|
|
108
|
+
// ответ (в getBlocks — не ломал обработку остальных блоков).
|
|
109
|
+
if (block.type === 'similar_products_block') {
|
|
110
|
+
try {
|
|
111
|
+
block.similarProducts = await this.getSimilarProducts(block.identifier, langCode, offset, limit);
|
|
112
|
+
}
|
|
113
|
+
catch {
|
|
114
|
+
block.similarProducts = [];
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
else if (block.type === 'product_block') {
|
|
118
|
+
try {
|
|
119
|
+
block.products = await this.getProductsByBlockMarker(block.identifier, langCode, offset, limit);
|
|
120
120
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
await this.getProductsByBlockMarker(normalizeResponse.identifier, langCode, offset, limit).then((result) => {
|
|
124
|
-
normalizeResponse.products = result;
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
catch {
|
|
128
|
-
normalizeResponse.products = [];
|
|
129
|
-
}
|
|
121
|
+
catch {
|
|
122
|
+
block.products = [];
|
|
130
123
|
}
|
|
131
124
|
}
|
|
132
|
-
return this._normalizeData(normalizeResponse);
|
|
133
125
|
}
|
|
134
126
|
/**
|
|
135
127
|
* Get similar products by block marker.
|
|
@@ -138,10 +130,12 @@ class BlocksApi extends asyncModules_1.default {
|
|
|
138
130
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
139
131
|
* @param {number} [offset] - Parameter for pagination. Default: 0.
|
|
140
132
|
* @param {number} [limit] - Parameter for pagination. Default: 30.
|
|
141
|
-
* @param {string} [signPrice] -
|
|
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.
|
|
142
135
|
* @param {number} [productId] - Optional product id to find similar products for.
|
|
143
|
-
* @returns {Promise<IProductsResponse | IError>}
|
|
136
|
+
* @returns {Promise<IProductsResponse | IError>} Returns the total count and an array of product items in object by specified block marker.
|
|
144
137
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
138
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getSimilarProducts getSimilarProducts} documentation.
|
|
145
139
|
*/
|
|
146
140
|
async getSimilarProducts(marker, langCode = this.state.lang, offset = 0, limit = 30, signPrice, productId) {
|
|
147
141
|
const query = {
|
|
@@ -161,9 +155,11 @@ class BlocksApi extends asyncModules_1.default {
|
|
|
161
155
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
162
156
|
* @param {number} [offset] - Parameter for pagination. Default: 0.
|
|
163
157
|
* @param {number} [limit] - Parameter for pagination. Default: 30.
|
|
164
|
-
* @param {string} [signPrice] -
|
|
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.
|
|
165
160
|
* @returns {Promise<IProductsEntity[] | IError>} Return array of BlocksEntity object.
|
|
166
161
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
162
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getProductsByBlockMarker getProductsByBlockMarker} documentation.
|
|
167
163
|
*/
|
|
168
164
|
async getProductsByBlockMarker(marker, langCode = this.state.lang, offset = 0, limit = 30, signPrice) {
|
|
169
165
|
const query = {
|
|
@@ -181,9 +177,11 @@ class BlocksApi extends asyncModules_1.default {
|
|
|
181
177
|
* @param {number} productId - Product id. Example: 1.
|
|
182
178
|
* @param {string} marker - Block marker. Example: "frequently_ordered_block".
|
|
183
179
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
184
|
-
* @param {string} [signPrice] -
|
|
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.
|
|
185
182
|
* @returns {Promise<IProductsResponse | IError>} Returns a products response with items and total.
|
|
186
183
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
184
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getFrequentlyOrderedProducts getFrequentlyOrderedProducts} documentation.
|
|
187
185
|
*/
|
|
188
186
|
async getFrequentlyOrderedProducts(productId, marker, langCode = this.state.lang, signPrice) {
|
|
189
187
|
const query = {
|
|
@@ -201,9 +199,10 @@ class BlocksApi extends asyncModules_1.default {
|
|
|
201
199
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
202
200
|
* @returns {Promise<ISearchBlock[] | IError>} Returns an array of ISearchBlock objects.
|
|
203
201
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
202
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/blocks/searchBlock searchBlock} documentation.
|
|
204
203
|
*/
|
|
205
204
|
async searchBlock(name, langCode = this.state.lang) {
|
|
206
|
-
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)}`);
|
|
207
206
|
// Validate response if validation is enabled
|
|
208
207
|
const validated = this._validateResponse(result, blocksSchemas_1.SearchBlocksResponseSchema);
|
|
209
208
|
return validated;
|
|
@@ -213,9 +212,11 @@ class BlocksApi extends asyncModules_1.default {
|
|
|
213
212
|
* @handleName getCartComplement
|
|
214
213
|
* @param {string} marker - Block marker. Example: "cart_complement_block".
|
|
215
214
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
216
|
-
* @param {string} [signPrice] -
|
|
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.
|
|
217
217
|
* @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
|
|
218
218
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
219
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getCartComplement getCartComplement} documentation.
|
|
219
220
|
*/
|
|
220
221
|
async getCartComplement(marker, langCode = this.state.lang, signPrice) {
|
|
221
222
|
const query = { langCode, signPrice };
|
|
@@ -234,6 +235,7 @@ class BlocksApi extends asyncModules_1.default {
|
|
|
234
235
|
}
|
|
235
236
|
* @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
|
|
236
237
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
238
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getCartComplementByProductIds getCartComplementByProductIds} documentation.
|
|
237
239
|
*/
|
|
238
240
|
async getCartComplementByProductIds(marker, body) {
|
|
239
241
|
const data = await this._fetchPost(`/${marker}/cart-complement`, { langCode: this.state.lang, ...body });
|
|
@@ -244,9 +246,11 @@ class BlocksApi extends asyncModules_1.default {
|
|
|
244
246
|
* @handleName getCartSimilar
|
|
245
247
|
* @param {string} marker - Block marker. Example: "cart_similar_block".
|
|
246
248
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
247
|
-
* @param {string} [signPrice] -
|
|
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.
|
|
248
251
|
* @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
|
|
249
252
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
253
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getCartSimilar getCartSimilar} documentation.
|
|
250
254
|
*/
|
|
251
255
|
async getCartSimilar(marker, langCode = this.state.lang, signPrice) {
|
|
252
256
|
const query = { langCode, signPrice };
|
|
@@ -265,6 +269,7 @@ class BlocksApi extends asyncModules_1.default {
|
|
|
265
269
|
}
|
|
266
270
|
* @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
|
|
267
271
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
272
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getCartSimilarByProductIds getCartSimilarByProductIds} documentation.
|
|
268
273
|
*/
|
|
269
274
|
async getCartSimilarByProductIds(marker, body) {
|
|
270
275
|
const data = await this._fetchPost(`/${marker}/cart-similar`, { langCode: this.state.lang, ...body });
|
|
@@ -275,9 +280,11 @@ 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] -
|
|
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
|
|
287
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getPersonalRecommendations getPersonalRecommendations} documentation.
|
|
281
288
|
*/
|
|
282
289
|
async getPersonalRecommendations(marker, langCode = this.state.lang, signPrice) {
|
|
283
290
|
const query = { langCode, signPrice };
|
|
@@ -289,9 +296,11 @@ class BlocksApi extends asyncModules_1.default {
|
|
|
289
296
|
* @handleName getRecentlyViewed
|
|
290
297
|
* @param {string} marker - Block marker. Example: "recently_viewed_block".
|
|
291
298
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
292
|
-
* @param {string} [signPrice] -
|
|
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.
|
|
293
301
|
* @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
|
|
294
302
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
303
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getRecentlyViewed getRecentlyViewed} documentation.
|
|
295
304
|
*/
|
|
296
305
|
async getRecentlyViewed(marker, langCode = this.state.lang, signPrice) {
|
|
297
306
|
const query = { langCode, signPrice };
|
|
@@ -303,9 +312,11 @@ class BlocksApi extends asyncModules_1.default {
|
|
|
303
312
|
* @handleName getRepeatPurchase
|
|
304
313
|
* @param {string} marker - Block marker. Example: "repeat_purchase_block".
|
|
305
314
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
306
|
-
* @param {string} [signPrice] -
|
|
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.
|
|
307
317
|
* @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
|
|
308
318
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
319
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getRepeatPurchase getRepeatPurchase} documentation.
|
|
309
320
|
*/
|
|
310
321
|
async getRepeatPurchase(marker, langCode = this.state.lang, signPrice) {
|
|
311
322
|
const query = { langCode, signPrice };
|
|
@@ -318,6 +329,7 @@ class BlocksApi extends asyncModules_1.default {
|
|
|
318
329
|
* @param {string} marker - Block marker. Example: "slider_block".
|
|
319
330
|
* @returns {Promise<IBlockSlidesResponse | IError>} Returns the slides response.
|
|
320
331
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
332
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getSlides getSlides} documentation.
|
|
321
333
|
*/
|
|
322
334
|
async getSlides(marker) {
|
|
323
335
|
const data = await this._fetchGet(`/${marker}/slides`);
|
|
@@ -328,9 +340,11 @@ class BlocksApi extends asyncModules_1.default {
|
|
|
328
340
|
* @handleName getTrending
|
|
329
341
|
* @param {string} marker - Block marker. Example: "trending_block".
|
|
330
342
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
331
|
-
* @param {string} [signPrice] -
|
|
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.
|
|
332
345
|
* @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
|
|
333
346
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
347
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getTrending getTrending} documentation.
|
|
334
348
|
*/
|
|
335
349
|
async getTrending(marker, langCode = this.state.lang, signPrice) {
|
|
336
350
|
const query = { langCode, signPrice };
|
|
@@ -342,9 +356,11 @@ class BlocksApi extends asyncModules_1.default {
|
|
|
342
356
|
* @handleName getWishlistSimilar
|
|
343
357
|
* @param {string} marker - Block marker. Example: "wishlist_similar_block".
|
|
344
358
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
345
|
-
* @param {string} [signPrice] -
|
|
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.
|
|
346
361
|
* @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
|
|
347
362
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
363
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getWishlistSimilar getWishlistSimilar} documentation.
|
|
348
364
|
*/
|
|
349
365
|
async getWishlistSimilar(marker, langCode = this.state.lang, signPrice) {
|
|
350
366
|
const query = { langCode, signPrice };
|
|
@@ -363,6 +379,7 @@ class BlocksApi extends asyncModules_1.default {
|
|
|
363
379
|
}
|
|
364
380
|
* @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
|
|
365
381
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
382
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getWishlistSimilarByProductIds getWishlistSimilarByProductIds} documentation.
|
|
366
383
|
*/
|
|
367
384
|
async getWishlistSimilarByProductIds(marker, body) {
|
|
368
385
|
const data = await this._fetchPost(`/${marker}/wishlist-similar`, { langCode: this.state.lang, ...body });
|
|
@@ -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] -
|
|
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] -
|
|
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] -
|
|
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] -
|
|
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] -
|
|
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] -
|
|
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] -
|
|
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] -
|
|
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] -
|
|
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 {
|