oneentry 1.0.151 → 1.0.153

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/changelog.md +20 -0
  2. package/dist/admins/adminsApi.d.ts +2 -1
  3. package/dist/admins/adminsApi.js +2 -1
  4. package/dist/admins/adminsInterfaces.d.ts +1 -1
  5. package/dist/attribute-sets/attributeSetsApi.d.ts +4 -0
  6. package/dist/attribute-sets/attributeSetsApi.js +4 -0
  7. package/dist/auth-provider/authProviderApi.d.ts +14 -1
  8. package/dist/auth-provider/authProviderApi.js +14 -1
  9. package/dist/base/asyncModules.d.ts +19 -2
  10. package/dist/base/asyncModules.js +74 -4
  11. package/dist/base/stateModule.d.ts +1 -0
  12. package/dist/base/stateModule.js +4 -0
  13. package/dist/blocks/blocksApi.d.ts +34 -1
  14. package/dist/blocks/blocksApi.js +69 -62
  15. package/dist/discounts/discountsApi.d.ts +5 -0
  16. package/dist/discounts/discountsApi.js +5 -0
  17. package/dist/events/eventsApi.d.ts +7 -0
  18. package/dist/events/eventsApi.js +11 -28
  19. package/dist/file-uploading/fileUploadingApi.d.ts +4 -1
  20. package/dist/file-uploading/fileUploadingApi.js +4 -1
  21. package/dist/file-uploading/fileUploadingInterfaces.d.ts +1 -1
  22. package/dist/filters/filtersApi.d.ts +1 -0
  23. package/dist/filters/filtersApi.js +1 -0
  24. package/dist/forms/formsApi.d.ts +2 -0
  25. package/dist/forms/formsApi.js +2 -0
  26. package/dist/forms-data/formsDataApi.d.ts +5 -0
  27. package/dist/forms-data/formsDataApi.js +5 -0
  28. package/dist/general-types/generalTypesApi.d.ts +1 -0
  29. package/dist/general-types/generalTypesApi.js +1 -0
  30. package/dist/integration-collections/integrationCollectionsApi.d.ts +10 -1
  31. package/dist/integration-collections/integrationCollectionsApi.js +10 -1
  32. package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +1 -1
  33. package/dist/locales/localesApi.d.ts +1 -0
  34. package/dist/locales/localesApi.js +1 -0
  35. package/dist/menus/menusApi.d.ts +1 -0
  36. package/dist/menus/menusApi.js +1 -0
  37. package/dist/orders/ordersApi.d.ts +25 -1
  38. package/dist/orders/ordersApi.js +36 -12
  39. package/dist/orders/ordersInterfaces.d.ts +4 -2
  40. package/dist/pages/pagesApi.d.ts +9 -0
  41. package/dist/pages/pagesApi.js +33 -38
  42. package/dist/pages/pagesInterfaces.d.ts +5 -0
  43. package/dist/payments/paymentsApi.d.ts +6 -0
  44. package/dist/payments/paymentsApi.js +6 -0
  45. package/dist/product-statuses/productStatusesApi.d.ts +3 -0
  46. package/dist/product-statuses/productStatusesApi.js +3 -0
  47. package/dist/products/productsApi.d.ts +14 -0
  48. package/dist/products/productsApi.js +14 -0
  49. package/dist/products/productsInterfaces.d.ts +2 -2
  50. package/dist/sitemap/sitemapApi.d.ts +2 -0
  51. package/dist/sitemap/sitemapApi.js +2 -0
  52. package/dist/subscriptions/subscriptionsApi.d.ts +5 -0
  53. package/dist/subscriptions/subscriptionsApi.js +7 -14
  54. package/dist/system/systemApi.d.ts +3 -0
  55. package/dist/system/systemApi.js +3 -0
  56. package/dist/templates/templatesApi.d.ts +3 -0
  57. package/dist/templates/templatesApi.js +3 -0
  58. package/dist/templates-preview/templatesPreviewApi.d.ts +2 -0
  59. package/dist/templates-preview/templatesPreviewApi.js +2 -0
  60. package/dist/user-activity/userActivityApi.d.ts +1 -0
  61. package/dist/user-activity/userActivityApi.js +1 -0
  62. package/dist/users/usersApi.d.ts +14 -0
  63. package/dist/users/usersApi.js +14 -0
  64. package/dist/web-socket/wsApi.d.ts +1 -1
  65. package/dist/web-socket/wsApi.js +1 -1
  66. package/package.json +1 -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
@@ -50,8 +68,9 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
50
68
  * @param {number} [limit] - Parameter for pagination. Default: 30.
51
69
  * @param {string} [signPrice] - Sign price.
52
70
  * @param {number} [productId] - Optional product id to find similar products for.
53
- * @returns {Promise<IProductsResponse | IError>} - Returns the total count and an array of product items in object by specified block marker.
71
+ * @returns {Promise<IProductsResponse | IError>} Returns the total count and an array of product items in object by specified block marker.
54
72
  * @throws {IError} When isShell=false and an error occurs during the fetch
73
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getSimilarProducts getSimilarProducts} documentation.
55
74
  */
56
75
  private getSimilarProducts;
57
76
  /**
@@ -64,6 +83,7 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
64
83
  * @param {string} [signPrice] - Sign price.
65
84
  * @returns {Promise<IProductsEntity[] | IError>} Return array of BlocksEntity object.
66
85
  * @throws {IError} When isShell=false and an error occurs during the fetch
86
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getProductsByBlockMarker getProductsByBlockMarker} documentation.
67
87
  */
68
88
  private getProductsByBlockMarker;
69
89
  /**
@@ -75,6 +95,7 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
75
95
  * @param {string} [signPrice] - Sign price.
76
96
  * @returns {Promise<IProductsResponse | IError>} Returns a products response with items and total.
77
97
  * @throws {IError} When isShell=false and an error occurs during the fetch
98
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getFrequentlyOrderedProducts getFrequentlyOrderedProducts} documentation.
78
99
  */
79
100
  getFrequentlyOrderedProducts(productId: number, marker: string, langCode?: string, signPrice?: string): Promise<IProductsResponse | IError>;
80
101
  /**
@@ -84,6 +105,7 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
84
105
  * @param {string} [langCode] - Language code. Default: "en_US".
85
106
  * @returns {Promise<ISearchBlock[] | IError>} Returns an array of ISearchBlock objects.
86
107
  * @throws {IError} When isShell=false and an error occurs during the fetch
108
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/searchBlock searchBlock} documentation.
87
109
  */
88
110
  searchBlock(name: string, langCode?: string): Promise<ISearchBlock[] | IError>;
89
111
  /**
@@ -94,6 +116,7 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
94
116
  * @param {string} [signPrice] - Sign price.
95
117
  * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
96
118
  * @throws {IError} When isShell=false and an error occurs during the fetch
119
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getCartComplement getCartComplement} documentation.
97
120
  */
98
121
  getCartComplement(marker: string, langCode?: string, signPrice?: string): Promise<IProductsEntity[] | IError>;
99
122
  /**
@@ -108,6 +131,7 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
108
131
  }
109
132
  * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
110
133
  * @throws {IError} When isShell=false and an error occurs during the fetch
134
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getCartComplementByProductIds getCartComplementByProductIds} documentation.
111
135
  */
112
136
  getCartComplementByProductIds(marker: string, body: IBlockProductsLookup): Promise<IProductsEntity[] | IError>;
113
137
  /**
@@ -118,6 +142,7 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
118
142
  * @param {string} [signPrice] - Sign price.
119
143
  * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
120
144
  * @throws {IError} When isShell=false and an error occurs during the fetch
145
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getCartSimilar getCartSimilar} documentation.
121
146
  */
122
147
  getCartSimilar(marker: string, langCode?: string, signPrice?: string): Promise<IProductsEntity[] | IError>;
123
148
  /**
@@ -132,6 +157,7 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
132
157
  }
133
158
  * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
134
159
  * @throws {IError} When isShell=false and an error occurs during the fetch
160
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getCartSimilarByProductIds getCartSimilarByProductIds} documentation.
135
161
  */
136
162
  getCartSimilarByProductIds(marker: string, body: IBlockProductsLookup): Promise<IProductsEntity[] | IError>;
137
163
  /**
@@ -142,6 +168,7 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
142
168
  * @param {string} [signPrice] - Sign price.
143
169
  * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
144
170
  * @throws {IError} When isShell=false and an error occurs during the fetch
171
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getPersonalRecommendations getPersonalRecommendations} documentation.
145
172
  */
146
173
  getPersonalRecommendations(marker: string, langCode?: string, signPrice?: string): Promise<IProductsEntity[] | IError>;
147
174
  /**
@@ -152,6 +179,7 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
152
179
  * @param {string} [signPrice] - Sign price.
153
180
  * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
154
181
  * @throws {IError} When isShell=false and an error occurs during the fetch
182
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getRecentlyViewed getRecentlyViewed} documentation.
155
183
  */
156
184
  getRecentlyViewed(marker: string, langCode?: string, signPrice?: string): Promise<IProductsEntity[] | IError>;
157
185
  /**
@@ -162,6 +190,7 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
162
190
  * @param {string} [signPrice] - Sign price.
163
191
  * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
164
192
  * @throws {IError} When isShell=false and an error occurs during the fetch
193
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getRepeatPurchase getRepeatPurchase} documentation.
165
194
  */
166
195
  getRepeatPurchase(marker: string, langCode?: string, signPrice?: string): Promise<IProductsEntity[] | IError>;
167
196
  /**
@@ -170,6 +199,7 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
170
199
  * @param {string} marker - Block marker. Example: "slider_block".
171
200
  * @returns {Promise<IBlockSlidesResponse | IError>} Returns the slides response.
172
201
  * @throws {IError} When isShell=false and an error occurs during the fetch
202
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getSlides getSlides} documentation.
173
203
  */
174
204
  getSlides(marker: string): Promise<IBlockSlidesResponse | IError>;
175
205
  /**
@@ -180,6 +210,7 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
180
210
  * @param {string} [signPrice] - Sign price.
181
211
  * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
182
212
  * @throws {IError} When isShell=false and an error occurs during the fetch
213
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getTrending getTrending} documentation.
183
214
  */
184
215
  getTrending(marker: string, langCode?: string, signPrice?: string): Promise<IProductsEntity[] | IError>;
185
216
  /**
@@ -190,6 +221,7 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
190
221
  * @param {string} [signPrice] - Sign price.
191
222
  * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
192
223
  * @throws {IError} When isShell=false and an error occurs during the fetch
224
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getWishlistSimilar getWishlistSimilar} documentation.
193
225
  */
194
226
  getWishlistSimilar(marker: string, langCode?: string, signPrice?: string): Promise<IProductsEntity[] | IError>;
195
227
  /**
@@ -204,6 +236,7 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
204
236
  }
205
237
  * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
206
238
  * @throws {IError} When isShell=false and an error occurs during the fetch
239
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getWishlistSimilarByProductIds getWishlistSimilarByProductIds} documentation.
207
240
  */
208
241
  getWishlistSimilarByProductIds(marker: string, body: IBlockProductsLookup): Promise<IProductsEntity[] | IError>;
209
242
  }
@@ -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(async (block) => {
45
- const customSettings = block.customSettings;
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
- const customSettings = normalizeResponse.customSettings;
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
- normalizeResponse.countElementsPerRow =
94
+ block.countElementsPerRow =
103
95
  +customSettings.productConfig.countElementsPerRow;
104
96
  if (customSettings.productConfig.quantity)
105
- normalizeResponse.quantity = +customSettings.productConfig.quantity;
97
+ block.quantity = +customSettings.productConfig.quantity;
106
98
  }
107
- delete normalizeResponse.customSettings;
108
- delete normalizeResponse.attributesSetIdentifier;
109
- delete normalizeResponse.productPageUrls;
110
- if (!this.state.traficLimit) {
111
- if (normalizeResponse.type === 'similar_products_block') {
112
- try {
113
- await this.getSimilarProducts(normalizeResponse.identifier, langCode, offset, limit).then((result) => {
114
- normalizeResponse.similarProducts = result;
115
- });
116
- }
117
- catch {
118
- normalizeResponse.similarProducts = [];
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
- else if (normalizeResponse.type === 'product_block') {
122
- try {
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.
@@ -140,8 +132,9 @@ class BlocksApi extends asyncModules_1.default {
140
132
  * @param {number} [limit] - Parameter for pagination. Default: 30.
141
133
  * @param {string} [signPrice] - Sign price.
142
134
  * @param {number} [productId] - Optional product id to find similar products for.
143
- * @returns {Promise<IProductsResponse | IError>} - Returns the total count and an array of product items in object by specified block marker.
135
+ * @returns {Promise<IProductsResponse | IError>} Returns the total count and an array of product items in object by specified block marker.
144
136
  * @throws {IError} When isShell=false and an error occurs during the fetch
137
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getSimilarProducts getSimilarProducts} documentation.
145
138
  */
146
139
  async getSimilarProducts(marker, langCode = this.state.lang, offset = 0, limit = 30, signPrice, productId) {
147
140
  const query = {
@@ -164,6 +157,7 @@ class BlocksApi extends asyncModules_1.default {
164
157
  * @param {string} [signPrice] - Sign price.
165
158
  * @returns {Promise<IProductsEntity[] | IError>} Return array of BlocksEntity object.
166
159
  * @throws {IError} When isShell=false and an error occurs during the fetch
160
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getProductsByBlockMarker getProductsByBlockMarker} documentation.
167
161
  */
168
162
  async getProductsByBlockMarker(marker, langCode = this.state.lang, offset = 0, limit = 30, signPrice) {
169
163
  const query = {
@@ -184,6 +178,7 @@ class BlocksApi extends asyncModules_1.default {
184
178
  * @param {string} [signPrice] - Sign price.
185
179
  * @returns {Promise<IProductsResponse | IError>} Returns a products response with items and total.
186
180
  * @throws {IError} When isShell=false and an error occurs during the fetch
181
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getFrequentlyOrderedProducts getFrequentlyOrderedProducts} documentation.
187
182
  */
188
183
  async getFrequentlyOrderedProducts(productId, marker, langCode = this.state.lang, signPrice) {
189
184
  const query = {
@@ -201,6 +196,7 @@ class BlocksApi extends asyncModules_1.default {
201
196
  * @param {string} [langCode] - Language code. Default: "en_US".
202
197
  * @returns {Promise<ISearchBlock[] | IError>} Returns an array of ISearchBlock objects.
203
198
  * @throws {IError} When isShell=false and an error occurs during the fetch
199
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/searchBlock searchBlock} documentation.
204
200
  */
205
201
  async searchBlock(name, langCode = this.state.lang) {
206
202
  const result = await this._fetchGet(`/quick/search?langCode=${langCode}&name=${name}`);
@@ -216,6 +212,7 @@ class BlocksApi extends asyncModules_1.default {
216
212
  * @param {string} [signPrice] - Sign price.
217
213
  * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
218
214
  * @throws {IError} When isShell=false and an error occurs during the fetch
215
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getCartComplement getCartComplement} documentation.
219
216
  */
220
217
  async getCartComplement(marker, langCode = this.state.lang, signPrice) {
221
218
  const query = { langCode, signPrice };
@@ -234,6 +231,7 @@ class BlocksApi extends asyncModules_1.default {
234
231
  }
235
232
  * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
236
233
  * @throws {IError} When isShell=false and an error occurs during the fetch
234
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getCartComplementByProductIds getCartComplementByProductIds} documentation.
237
235
  */
238
236
  async getCartComplementByProductIds(marker, body) {
239
237
  const data = await this._fetchPost(`/${marker}/cart-complement`, { langCode: this.state.lang, ...body });
@@ -247,6 +245,7 @@ class BlocksApi extends asyncModules_1.default {
247
245
  * @param {string} [signPrice] - Sign price.
248
246
  * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
249
247
  * @throws {IError} When isShell=false and an error occurs during the fetch
248
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getCartSimilar getCartSimilar} documentation.
250
249
  */
251
250
  async getCartSimilar(marker, langCode = this.state.lang, signPrice) {
252
251
  const query = { langCode, signPrice };
@@ -265,6 +264,7 @@ class BlocksApi extends asyncModules_1.default {
265
264
  }
266
265
  * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
267
266
  * @throws {IError} When isShell=false and an error occurs during the fetch
267
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getCartSimilarByProductIds getCartSimilarByProductIds} documentation.
268
268
  */
269
269
  async getCartSimilarByProductIds(marker, body) {
270
270
  const data = await this._fetchPost(`/${marker}/cart-similar`, { langCode: this.state.lang, ...body });
@@ -278,6 +278,7 @@ class BlocksApi extends asyncModules_1.default {
278
278
  * @param {string} [signPrice] - Sign price.
279
279
  * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
280
280
  * @throws {IError} When isShell=false and an error occurs during the fetch
281
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getPersonalRecommendations getPersonalRecommendations} documentation.
281
282
  */
282
283
  async getPersonalRecommendations(marker, langCode = this.state.lang, signPrice) {
283
284
  const query = { langCode, signPrice };
@@ -292,6 +293,7 @@ class BlocksApi extends asyncModules_1.default {
292
293
  * @param {string} [signPrice] - Sign price.
293
294
  * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
294
295
  * @throws {IError} When isShell=false and an error occurs during the fetch
296
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getRecentlyViewed getRecentlyViewed} documentation.
295
297
  */
296
298
  async getRecentlyViewed(marker, langCode = this.state.lang, signPrice) {
297
299
  const query = { langCode, signPrice };
@@ -306,6 +308,7 @@ class BlocksApi extends asyncModules_1.default {
306
308
  * @param {string} [signPrice] - Sign price.
307
309
  * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
308
310
  * @throws {IError} When isShell=false and an error occurs during the fetch
311
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getRepeatPurchase getRepeatPurchase} documentation.
309
312
  */
310
313
  async getRepeatPurchase(marker, langCode = this.state.lang, signPrice) {
311
314
  const query = { langCode, signPrice };
@@ -318,6 +321,7 @@ class BlocksApi extends asyncModules_1.default {
318
321
  * @param {string} marker - Block marker. Example: "slider_block".
319
322
  * @returns {Promise<IBlockSlidesResponse | IError>} Returns the slides response.
320
323
  * @throws {IError} When isShell=false and an error occurs during the fetch
324
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getSlides getSlides} documentation.
321
325
  */
322
326
  async getSlides(marker) {
323
327
  const data = await this._fetchGet(`/${marker}/slides`);
@@ -331,6 +335,7 @@ class BlocksApi extends asyncModules_1.default {
331
335
  * @param {string} [signPrice] - Sign price.
332
336
  * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
333
337
  * @throws {IError} When isShell=false and an error occurs during the fetch
338
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getTrending getTrending} documentation.
334
339
  */
335
340
  async getTrending(marker, langCode = this.state.lang, signPrice) {
336
341
  const query = { langCode, signPrice };
@@ -345,6 +350,7 @@ class BlocksApi extends asyncModules_1.default {
345
350
  * @param {string} [signPrice] - Sign price.
346
351
  * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
347
352
  * @throws {IError} When isShell=false and an error occurs during the fetch
353
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getWishlistSimilar getWishlistSimilar} documentation.
348
354
  */
349
355
  async getWishlistSimilar(marker, langCode = this.state.lang, signPrice) {
350
356
  const query = { langCode, signPrice };
@@ -363,6 +369,7 @@ class BlocksApi extends asyncModules_1.default {
363
369
  }
364
370
  * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
365
371
  * @throws {IError} When isShell=false and an error occurs during the fetch
372
+ * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getWishlistSimilarByProductIds getWishlistSimilarByProductIds} documentation.
366
373
  */
367
374
  async getWishlistSimilarByProductIds(marker, body) {
368
375
  const data = await this._fetchPost(`/${marker}/wishlist-similar`, { langCode: this.state.lang, ...body });
@@ -32,6 +32,7 @@ export default class DiscountsApi extends AsyncModules implements IDiscountsApi
32
32
  * @returns {Promise<IDiscountsResponse | IError>} Returns an object containing all discounts or an error object if there was an issue.
33
33
  * @throws {IError} When isShell=false and an error occurs during the fetch
34
34
  * @description Fetches all discounts from the server.
35
+ * @see {@link https://js-sdk.oneentry.cloud/docs/discounts/getAllDiscounts getAllDiscounts} documentation.
35
36
  */
36
37
  getAllDiscounts(langCode?: string, offset?: number, limit?: number, type?: IDiscountType): Promise<IDiscountsResponse | IError>;
37
38
  /**
@@ -42,6 +43,7 @@ export default class DiscountsApi extends AsyncModules implements IDiscountsApi
42
43
  * @returns {Promise<IDiscountsEntity | IError>} Returns an object containing discount by marker or an error object if there was an issue.
43
44
  * @throws {IError} When isShell=false and an error occurs during the fetch
44
45
  * @description Fetches a discount by its marker.
46
+ * @see {@link https://js-sdk.oneentry.cloud/docs/discounts/getDiscountByMarker getDiscountByMarker} documentation.
45
47
  */
46
48
  getDiscountByMarker(marker: string, langCode?: string): Promise<IDiscountsEntity | IError>;
47
49
  /**
@@ -49,6 +51,7 @@ export default class DiscountsApi extends AsyncModules implements IDiscountsApi
49
51
  * @handleName getBonusBalance
50
52
  * @returns {Promise<IBonusBalanceEntity | IError>} Returns bonus balance or an error object.
51
53
  * @throws {IError} When isShell=false and an error occurs during the fetch
54
+ * @see {@link https://js-sdk.oneentry.cloud/docs/discounts/getBonusBalance getBonusBalance} documentation.
52
55
  */
53
56
  getBonusBalance(): Promise<IBonusBalanceEntity | IError>;
54
57
  /**
@@ -62,6 +65,7 @@ export default class DiscountsApi extends AsyncModules implements IDiscountsApi
62
65
  * @param {boolean} [isAdmin] - Admin filter.
63
66
  * @returns {Promise<IBonusTransactionEntity[] | IError>} Returns array of bonus transactions or an error object.
64
67
  * @throws {IError} When isShell=false and an error occurs during the fetch
68
+ * @see {@link https://js-sdk.oneentry.cloud/docs/discounts/getBonusHistory getBonusHistory} documentation.
65
69
  */
66
70
  getBonusHistory(type?: IBonusTransactionType, dateFrom?: string, dateTo?: string, discountId?: number, moduleId?: number, isAdmin?: boolean): Promise<IBonusTransactionEntity[] | IError>;
67
71
  /**
@@ -71,6 +75,7 @@ export default class DiscountsApi extends AsyncModules implements IDiscountsApi
71
75
  * @returns {Promise<ICouponValidationResult | IError>} Returns an coupon validation result or an error object if there was an issue.
72
76
  * @throws {IError} When isShell=false and an error occurs during the fetch
73
77
  * @description This function validates a coupon code and returns the result.
78
+ * @see {@link https://js-sdk.oneentry.cloud/docs/discounts/validateDiscountsCoupon validateDiscountsCoupon} documentation.
74
79
  */
75
80
  validateDiscountsCoupon(code: string): Promise<ICouponValidationResult | IError>;
76
81
  }
@@ -35,6 +35,7 @@ class DiscountsApi extends asyncModules_1.default {
35
35
  * @returns {Promise<IDiscountsResponse | IError>} Returns an object containing all discounts or an error object if there was an issue.
36
36
  * @throws {IError} When isShell=false and an error occurs during the fetch
37
37
  * @description Fetches all discounts from the server.
38
+ * @see {@link https://js-sdk.oneentry.cloud/docs/discounts/getAllDiscounts getAllDiscounts} documentation.
38
39
  */
39
40
  async getAllDiscounts(langCode = this.state.lang, offset = 0, limit = 30, type) {
40
41
  const query = {
@@ -54,6 +55,7 @@ class DiscountsApi extends asyncModules_1.default {
54
55
  * @returns {Promise<IDiscountsEntity | IError>} Returns an object containing discount by marker or an error object if there was an issue.
55
56
  * @throws {IError} When isShell=false and an error occurs during the fetch
56
57
  * @description Fetches a discount by its marker.
58
+ * @see {@link https://js-sdk.oneentry.cloud/docs/discounts/getDiscountByMarker getDiscountByMarker} documentation.
57
59
  */
58
60
  async getDiscountByMarker(marker, langCode = this.state.lang) {
59
61
  const query = {
@@ -68,6 +70,7 @@ class DiscountsApi extends asyncModules_1.default {
68
70
  * @handleName getBonusBalance
69
71
  * @returns {Promise<IBonusBalanceEntity | IError>} Returns bonus balance or an error object.
70
72
  * @throws {IError} When isShell=false and an error occurs during the fetch
73
+ * @see {@link https://js-sdk.oneentry.cloud/docs/discounts/getBonusBalance getBonusBalance} documentation.
71
74
  */
72
75
  async getBonusBalance() {
73
76
  const data = await this._fetchGet(`/bonus-balance`);
@@ -84,6 +87,7 @@ class DiscountsApi extends asyncModules_1.default {
84
87
  * @param {boolean} [isAdmin] - Admin filter.
85
88
  * @returns {Promise<IBonusTransactionEntity[] | IError>} Returns array of bonus transactions or an error object.
86
89
  * @throws {IError} When isShell=false and an error occurs during the fetch
90
+ * @see {@link https://js-sdk.oneentry.cloud/docs/discounts/getBonusHistory getBonusHistory} documentation.
87
91
  */
88
92
  async getBonusHistory(type, dateFrom, dateTo, discountId, moduleId, isAdmin) {
89
93
  const query = {
@@ -104,6 +108,7 @@ class DiscountsApi extends asyncModules_1.default {
104
108
  * @returns {Promise<ICouponValidationResult | IError>} Returns an coupon validation result or an error object if there was an issue.
105
109
  * @throws {IError} When isShell=false and an error occurs during the fetch
106
110
  * @description This function validates a coupon code and returns the result.
111
+ * @see {@link https://js-sdk.oneentry.cloud/docs/discounts/validateDiscountsCoupon validateDiscountsCoupon} documentation.
107
112
  */
108
113
  async validateDiscountsCoupon(code) {
109
114
  const query = {
@@ -31,6 +31,7 @@ export default class EventsApi extends AsyncModules implements IEvents {
31
31
  * @throws {IError} When isShell=false and an error occurs during the fetch
32
32
  * @description This method requires user authorization.
33
33
  * @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
34
+ * @see {@link https://js-sdk.oneentry.cloud/docs/events/getAllSubscriptions getAllSubscriptions} documentation.
34
35
  */
35
36
  getAllSubscriptions(offset?: number, limit?: number): Promise<ISubscriptions | IError>;
36
37
  /**
@@ -43,6 +44,7 @@ export default class EventsApi extends AsyncModules implements IEvents {
43
44
  * @throws {IError} When isShell=false and an error occurs during the fetch
44
45
  * @description This method requires user authorization.
45
46
  * @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
47
+ * @see {@link https://js-sdk.oneentry.cloud/docs/events/subscribeByMarker subscribeByMarker} documentation.
46
48
  */
47
49
  subscribeByMarker(marker: string, productId: number, langCode?: string): Promise<boolean | IError>;
48
50
  /**
@@ -55,6 +57,7 @@ export default class EventsApi extends AsyncModules implements IEvents {
55
57
  * @throws {IError} When isShell=false and an error occurs during the fetch
56
58
  * @description This method requires user authorization.
57
59
  * @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
60
+ * @see {@link https://js-sdk.oneentry.cloud/docs/events/unsubscribeByMarker unsubscribeByMarker} documentation.
58
61
  */
59
62
  unsubscribeByMarker(marker: string, productId: number, langCode?: string): Promise<boolean | IError>;
60
63
  /**
@@ -63,6 +66,7 @@ export default class EventsApi extends AsyncModules implements IEvents {
63
66
  * @returns {Promise<IContentApiEvent[] | IError>} Returns an array of available events.
64
67
  * @throws {IError} When isShell=false and an error occurs during the fetch
65
68
  * @description This method returns all available events.
69
+ * @see {@link https://js-sdk.oneentry.cloud/docs/events/getAllEvents getAllEvents} documentation.
66
70
  */
67
71
  getAllEvents(): Promise<IContentApiEvent[] | IError>;
68
72
  /**
@@ -74,6 +78,7 @@ export default class EventsApi extends AsyncModules implements IEvents {
74
78
  * @throws {IError} When isShell=false and an error occurs during the fetch
75
79
  * @description This method requires user authorization.
76
80
  * @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
81
+ * @see {@link https://js-sdk.oneentry.cloud/docs/events/subscribeToForm subscribeToForm} documentation.
77
82
  */
78
83
  subscribeToForm(marker: string, body: ISubscribeFormEvent): Promise<boolean | IError>;
79
84
  /**
@@ -85,6 +90,7 @@ export default class EventsApi extends AsyncModules implements IEvents {
85
90
  * @throws {IError} When isShell=false and an error occurs during the fetch
86
91
  * @description This method requires user authorization.
87
92
  * @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
93
+ * @see {@link https://js-sdk.oneentry.cloud/docs/events/getFormSubscriptions getFormSubscriptions} documentation.
88
94
  */
89
95
  getFormSubscriptions(offset?: number, limit?: number): Promise<IListFormSubscription[] | IError>;
90
96
  /**
@@ -96,6 +102,7 @@ export default class EventsApi extends AsyncModules implements IEvents {
96
102
  * @throws {IError} When isShell=false and an error occurs during the fetch
97
103
  * @description This method requires user authorization.
98
104
  * @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
105
+ * @see {@link https://js-sdk.oneentry.cloud/docs/events/unsubscribeFromForm unsubscribeFromForm} documentation.
99
106
  */
100
107
  unsubscribeFromForm(marker: string, body: ISubscribeFormEvent): Promise<boolean | IError>;
101
108
  }