oneentry 1.0.157 → 1.0.159

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 (48) hide show
  1. package/README.md +20 -0
  2. package/changelog.md +89 -0
  3. package/dist/admins/adminsApi.js +36 -2
  4. package/dist/attribute-sets/attributeSetsApi.d.ts +2 -2
  5. package/dist/attribute-sets/attributeSetsApi.js +40 -6
  6. package/dist/attribute-sets/attributeSetsInterfaces.d.ts +19 -7
  7. package/dist/auth-provider/authProviderApi.js +38 -4
  8. package/dist/base/asyncModules.d.ts +6 -4
  9. package/dist/base/asyncModules.js +44 -8
  10. package/dist/base/syncModules.d.ts +2 -1
  11. package/dist/base/syncModules.js +10 -1
  12. package/dist/base/timeIntervals.js +6 -5
  13. package/dist/base/utils.d.ts +12 -8
  14. package/dist/blocks/blocksApi.d.ts +21 -21
  15. package/dist/blocks/blocksApi.js +48 -14
  16. package/dist/blocks/blocksInterfaces.d.ts +20 -20
  17. package/dist/blocks/blocksSchemas.d.ts +2 -0
  18. package/dist/discounts/discountsInterfaces.d.ts +4 -4
  19. package/dist/events/eventsApi.d.ts +3 -3
  20. package/dist/events/eventsApi.js +1 -1
  21. package/dist/events/eventsInterfaces.d.ts +16 -5
  22. package/dist/file-uploading/fileUploadingApi.js +36 -2
  23. package/dist/filters/filtersApi.js +36 -2
  24. package/dist/forms/formsApi.js +37 -3
  25. package/dist/forms/formsInterfaces.d.ts +22 -20
  26. package/dist/forms-data/formsDataApi.js +38 -4
  27. package/dist/general-types/generalTypesApi.js +36 -2
  28. package/dist/index.d.ts +2 -2
  29. package/dist/integration-collections/integrationCollectionsApi.js +43 -9
  30. package/dist/locales/localesApi.js +36 -2
  31. package/dist/menus/menusApi.js +36 -2
  32. package/dist/orders/ordersApi.js +39 -5
  33. package/dist/orders/ordersInterfaces.d.ts +11 -3
  34. package/dist/pages/pagesApi.js +42 -8
  35. package/dist/payments/paymentsApi.js +39 -5
  36. package/dist/product-statuses/productStatusesApi.js +38 -4
  37. package/dist/products/productsApi.d.ts +2 -2
  38. package/dist/products/productsApi.js +42 -8
  39. package/dist/products/productsInterfaces.d.ts +23 -15
  40. package/dist/products/productsSchemas.d.ts +1 -0
  41. package/dist/products/productsSchemas.js +1 -0
  42. package/dist/subscriptions/subscriptionsApi.js +38 -4
  43. package/dist/templates/templatesApi.js +38 -4
  44. package/dist/templates-preview/templatesPreviewApi.js +37 -3
  45. package/dist/users/usersApi.js +45 -11
  46. package/dist/web-socket/wsApi.d.ts +2 -0
  47. package/dist/web-socket/wsApi.js +47 -10
  48. package/package.json +6 -1
@@ -136,6 +136,7 @@ interface IAttributes {
136
136
  * @property {string | null} [plainValue] - Localized plain-text content (without HTML markup). Example: "Plain description".
137
137
  * @property {string | null} [htmlValue] - Localized HTML-rendered content. Example: "<p>Description</p>".
138
138
  * @property {string | null} [htmlContent] - Localized HTML body content for richer pages. Example: "<div>...</div>".
139
+ * @property {string | null} [plainContent] - Localized plain-text version of `htmlContent`; returned by pages and menus. Example: "Description".
139
140
  * @property {string | null} [menuTitle] - Localized title used in menus and navigation. Example: "Home".
140
141
  * @description Normalized localization payload for a single locale, returned by the SDK after unwrapping the API's per-language map.
141
142
  */
@@ -144,23 +145,26 @@ interface ILocalizeInfo {
144
145
  plainValue?: string | null;
145
146
  htmlValue?: string | null;
146
147
  htmlContent?: string | null;
148
+ plainContent?: string | null;
147
149
  menuTitle?: string | null;
148
150
  }
149
151
  /**
150
152
  * @interface IAttributeLocalizeInfo
153
+ * @property {string} [title] - Localized title of the attribute. Optional — the payload is an empty object when the attribute has no localization for the requested language (e.g. form attributes in list responses). Example: "Color".
151
154
  * @property {ITimeIntervalSchedule[]} [intervals] - For attributes of type `timeInterval`, the schedule data attached to the localization payload. Each entry is a compact recurrence rule — pass it to `expandTimeIntervals` to resolve concrete slots.
152
- * @description Extension of {@link ILocalizeInfo} used by attribute entities — adds attribute-type-specific fields the API exposes via `localizeInfos`.
155
+ * @description Extension of {@link ILocalizeInfo} used by attribute entities — adds attribute-type-specific fields the API exposes via `localizeInfos`. Unlike the base type, `title` is optional here.
153
156
  */
154
- interface IAttributeLocalizeInfo extends ILocalizeInfo {
157
+ interface IAttributeLocalizeInfo extends Omit<ILocalizeInfo, 'title'> {
158
+ title?: string;
155
159
  intervals?: ITimeIntervalSchedule[];
156
160
  [key: string]: unknown;
157
161
  }
158
162
  /**
159
163
  * @interface ITimeIntervalSchedule
160
164
  * @property {string} id - Schedule entry identifier (UUID). Example: "c6466cd8-c55d-4583-97c5-42b684210f12".
161
- * @property {number} fullMonth - Month index this schedule covers (0-11). Example: 2.
165
+ * @property {number} [fullMonth] - Month index this schedule covers (0-11). Optional — present when the schedule is pinned to a month/year rather than an explicit date `range`. Example: 2.
162
166
  * @property {boolean} inEveryMonth - Whether the schedule repeats every month. Example: true.
163
- * @property {number} selectedYear - Year the schedule applies to. Example: 2025.
167
+ * @property {number} [selectedYear] - Year the schedule applies to. Optional — present when the schedule is pinned to a month/year rather than an explicit date `range`. Example: 2025.
164
168
  * @property {ITimeIntervalRange[]} intervals - Daily time ranges configured for the schedule.
165
169
  * @property {unknown[]} external - External overrides; empty array when none.
166
170
  * @property {string[]} range - Validity range as a pair of ISO dates `[from, to]`; empty array when none. When both entries are equal the schedule is anchored to that single day and its recurrence is open-ended. Example: ["2025-05-07T21:00:00.000Z", "2025-05-07T21:00:00.000Z"].
@@ -169,9 +173,9 @@ interface IAttributeLocalizeInfo extends ILocalizeInfo {
169
173
  */
170
174
  interface ITimeIntervalSchedule {
171
175
  id: string;
172
- fullMonth: number;
176
+ fullMonth?: number;
173
177
  inEveryMonth: boolean;
174
- selectedYear: number;
178
+ selectedYear?: number;
175
179
  intervals: ITimeIntervalRange[];
176
180
  external: unknown[];
177
181
  range: string[];
@@ -248,14 +252,14 @@ interface ITimeIntervalPoint {
248
252
  * @property {string} id - Range identifier (UUID).
249
253
  * @property {ITimeIntervalPoint} start - Start time of the range.
250
254
  * @property {ITimeIntervalPoint} end - End time of the range.
251
- * @property {number} period - Slot duration in minutes. Example: 60.
255
+ * @property {number | null} period - Slot duration in minutes; `null` when the range is not sliced into slots. Example: 60.
252
256
  * @description A single daily time range inside a {@link ITimeIntervalSchedule}.
253
257
  */
254
258
  interface ITimeIntervalRange {
255
259
  id: string;
256
260
  start: ITimeIntervalPoint;
257
261
  end: ITimeIntervalPoint;
258
- period: number;
262
+ period: number | null;
259
263
  }
260
264
  /**
261
265
  * @interface IAttributeValue
@@ -1,7 +1,7 @@
1
1
  import AsyncModules from '../base/asyncModules';
2
2
  import type StateModule from '../base/stateModule';
3
3
  import type { IError } from '../base/utils';
4
- import type { IProductsEntity, IProductsResponse } from '../products/productsInterfaces';
4
+ import type { IProductsResponse } from '../products/productsInterfaces';
5
5
  import type { BlockType, IBlockEntity, IBlockProductsLookup, IBlocks, IBlockSlidesResponse, IBlocksResponse, ISearchBlock } from './blocksInterfaces';
6
6
  /**
7
7
  * Controllers for working with blocks.
@@ -118,11 +118,11 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
118
118
  * @param {string} [langCode] - Language code. Default: "en_US".
119
119
  * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
120
120
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
121
- * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
121
+ * @returns {Promise<IProductsResponse | IError>} Returns an object with an array of products, total count and totalFound.
122
122
  * @throws {IError} When isShell=false and an error occurs during the fetch
123
123
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getCartComplement getCartComplement} documentation.
124
124
  */
125
- getCartComplement(marker: string, langCode?: string, signPrice?: string): Promise<IProductsEntity[] | IError>;
125
+ getCartComplement(marker: string, langCode?: string, signPrice?: string): Promise<IProductsResponse | IError>;
126
126
  /**
127
127
  * Get "complete your cart" products by an explicit list of productIds (POST body).
128
128
  * @handleName getCartComplementByProductIds
@@ -133,11 +133,11 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
133
133
  "productIds": [1, 2],
134
134
  "langCode": "en_US"
135
135
  }
136
- * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
136
+ * @returns {Promise<IProductsResponse | IError>} Returns an object with an array of products, total count and totalFound.
137
137
  * @throws {IError} When isShell=false and an error occurs during the fetch
138
138
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getCartComplementByProductIds getCartComplementByProductIds} documentation.
139
139
  */
140
- getCartComplementByProductIds(marker: string, body: IBlockProductsLookup): Promise<IProductsEntity[] | IError>;
140
+ getCartComplementByProductIds(marker: string, body: IBlockProductsLookup): Promise<IProductsResponse | IError>;
141
141
  /**
142
142
  * Get "similar to cart" products by the cart from context (auth user or guest).
143
143
  * @handleName getCartSimilar
@@ -145,11 +145,11 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
145
145
  * @param {string} [langCode] - Language code. Default: "en_US".
146
146
  * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
147
147
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
148
- * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
148
+ * @returns {Promise<IProductsResponse | IError>} Returns an object with an array of products, total count and totalFound.
149
149
  * @throws {IError} When isShell=false and an error occurs during the fetch
150
150
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getCartSimilar getCartSimilar} documentation.
151
151
  */
152
- getCartSimilar(marker: string, langCode?: string, signPrice?: string): Promise<IProductsEntity[] | IError>;
152
+ getCartSimilar(marker: string, langCode?: string, signPrice?: string): Promise<IProductsResponse | IError>;
153
153
  /**
154
154
  * Get "similar to cart" products by an explicit list of productIds (POST body).
155
155
  * @handleName getCartSimilarByProductIds
@@ -160,11 +160,11 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
160
160
  "productIds": [1, 2],
161
161
  "langCode": "en_US"
162
162
  }
163
- * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
163
+ * @returns {Promise<IProductsResponse | IError>} Returns an object with an array of products, total count and totalFound.
164
164
  * @throws {IError} When isShell=false and an error occurs during the fetch
165
165
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getCartSimilarByProductIds getCartSimilarByProductIds} documentation.
166
166
  */
167
- getCartSimilarByProductIds(marker: string, body: IBlockProductsLookup): Promise<IProductsEntity[] | IError>;
167
+ getCartSimilarByProductIds(marker: string, body: IBlockProductsLookup): Promise<IProductsResponse | IError>;
168
168
  /**
169
169
  * Get personal recommendations for the user.
170
170
  * @handleName getPersonalRecommendations
@@ -172,11 +172,11 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
172
172
  * @param {string} [langCode] - Language code. Default: "en_US".
173
173
  * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
174
174
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
175
- * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
175
+ * @returns {Promise<IProductsResponse | IError>} Returns an object with an array of products, total count and totalFound.
176
176
  * @throws {IError} When isShell=false and an error occurs during the fetch
177
177
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getPersonalRecommendations getPersonalRecommendations} documentation.
178
178
  */
179
- getPersonalRecommendations(marker: string, langCode?: string, signPrice?: string): Promise<IProductsEntity[] | IError>;
179
+ getPersonalRecommendations(marker: string, langCode?: string, signPrice?: string): Promise<IProductsResponse | IError>;
180
180
  /**
181
181
  * Get recently viewed products.
182
182
  * @handleName getRecentlyViewed
@@ -184,11 +184,11 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
184
184
  * @param {string} [langCode] - Language code. Default: "en_US".
185
185
  * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
186
186
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
187
- * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
187
+ * @returns {Promise<IProductsResponse | IError>} Returns an object with an array of products, total count and totalFound.
188
188
  * @throws {IError} When isShell=false and an error occurs during the fetch
189
189
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getRecentlyViewed getRecentlyViewed} documentation.
190
190
  */
191
- getRecentlyViewed(marker: string, langCode?: string, signPrice?: string): Promise<IProductsEntity[] | IError>;
191
+ getRecentlyViewed(marker: string, langCode?: string, signPrice?: string): Promise<IProductsResponse | IError>;
192
192
  /**
193
193
  * Get products for repeat purchase.
194
194
  * @handleName getRepeatPurchase
@@ -196,11 +196,11 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
196
196
  * @param {string} [langCode] - Language code. Default: "en_US".
197
197
  * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
198
198
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
199
- * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
199
+ * @returns {Promise<IProductsResponse | IError>} Returns an object with an array of products, total count and totalFound.
200
200
  * @throws {IError} When isShell=false and an error occurs during the fetch
201
201
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getRepeatPurchase getRepeatPurchase} documentation.
202
202
  */
203
- getRepeatPurchase(marker: string, langCode?: string, signPrice?: string): Promise<IProductsEntity[] | IError>;
203
+ getRepeatPurchase(marker: string, langCode?: string, signPrice?: string): Promise<IProductsResponse | IError>;
204
204
  /**
205
205
  * Get the block's slides tree as a flat pre-order array (slider_block only).
206
206
  * @handleName getSlides
@@ -217,11 +217,11 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
217
217
  * @param {string} [langCode] - Language code. Default: "en_US".
218
218
  * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
219
219
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
220
- * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
220
+ * @returns {Promise<IProductsResponse | IError>} Returns an object with an array of products, total count and totalFound.
221
221
  * @throws {IError} When isShell=false and an error occurs during the fetch
222
222
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getTrending getTrending} documentation.
223
223
  */
224
- getTrending(marker: string, langCode?: string, signPrice?: string): Promise<IProductsEntity[] | IError>;
224
+ getTrending(marker: string, langCode?: string, signPrice?: string): Promise<IProductsResponse | IError>;
225
225
  /**
226
226
  * Get "similar to wishlist" products by the wishlist from context (auth user or guest).
227
227
  * @handleName getWishlistSimilar
@@ -229,11 +229,11 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
229
229
  * @param {string} [langCode] - Language code. Default: "en_US".
230
230
  * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
231
231
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
232
- * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
232
+ * @returns {Promise<IProductsResponse | IError>} Returns an object with an array of products, total count and totalFound.
233
233
  * @throws {IError} When isShell=false and an error occurs during the fetch
234
234
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getWishlistSimilar getWishlistSimilar} documentation.
235
235
  */
236
- getWishlistSimilar(marker: string, langCode?: string, signPrice?: string): Promise<IProductsEntity[] | IError>;
236
+ getWishlistSimilar(marker: string, langCode?: string, signPrice?: string): Promise<IProductsResponse | IError>;
237
237
  /**
238
238
  * Get "similar to wishlist" products by an explicit list of productIds (POST body).
239
239
  * @handleName getWishlistSimilarByProductIds
@@ -244,9 +244,9 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
244
244
  "productIds": [1, 2],
245
245
  "langCode": "en_US"
246
246
  }
247
- * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
247
+ * @returns {Promise<IProductsResponse | IError>} Returns an object with an array of products, total count and totalFound.
248
248
  * @throws {IError} When isShell=false and an error occurs during the fetch
249
249
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getWishlistSimilarByProductIds getWishlistSimilarByProductIds} documentation.
250
250
  */
251
- getWishlistSimilarByProductIds(marker: string, body: IBlockProductsLookup): Promise<IProductsEntity[] | IError>;
251
+ getWishlistSimilarByProductIds(marker: string, body: IBlockProductsLookup): Promise<IProductsResponse | IError>;
252
252
  }
@@ -1,4 +1,37 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
2
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
37
  };
@@ -6,7 +39,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
39
  /* eslint-disable jsdoc/reject-any-type */
7
40
  /* eslint-disable @typescript-eslint/no-explicit-any */
8
41
  const asyncModules_1 = __importDefault(require("../base/asyncModules"));
9
- const blocksSchemas_1 = require("./blocksSchemas");
42
+ const lazySchema_1 = __importDefault(require("../base/lazySchema"));
43
+ const schema = (0, lazySchema_1.default)(() => Promise.resolve().then(() => __importStar(require('./blocksSchemas'))));
10
44
  /**
11
45
  * Controllers for working with blocks.
12
46
  * @handle /api/content/blocks
@@ -40,7 +74,7 @@ class BlocksApi extends asyncModules_1.default {
40
74
  const query = this._queryParamsToString({ langCode, type, offset, limit });
41
75
  const response = await this._fetchPost(`?${query}`);
42
76
  // Validate response if validation is enabled
43
- const validated = this._validateResponse(response, blocksSchemas_1.BlocksResponseSchema);
77
+ const validated = await this._validateResponse(response, schema('BlocksResponseSchema'));
44
78
  if (!this.state.traficLimit) {
45
79
  const normalizeResponse = this._normalizeData(validated);
46
80
  // On API error responses (e.g. 403 without list permission, 422) the
@@ -68,7 +102,7 @@ class BlocksApi extends asyncModules_1.default {
68
102
  async getBlockByMarker(marker, langCode = this.state.lang, offset = 0, limit = 30) {
69
103
  const response = await this._fetchGet(`/marker/${marker}?langCode=${langCode}`);
70
104
  // Validate response if validation is enabled
71
- const validated = this._validateResponse(response, blocksSchemas_1.BlockEntitySchema);
105
+ const validated = await this._validateResponse(response, schema('BlockEntitySchema'));
72
106
  const normalizeResponse = this._normalizeData(validated);
73
107
  await this._enrichBlock(normalizeResponse, langCode, offset, limit, !this.state.traficLimit);
74
108
  return normalizeResponse;
@@ -214,7 +248,7 @@ class BlocksApi extends asyncModules_1.default {
214
248
  async searchBlock(name, langCode = this.state.lang) {
215
249
  const result = await this._fetchGet(`/quick/search?langCode=${encodeURIComponent(langCode)}&name=${encodeURIComponent(name)}`);
216
250
  // Validate response if validation is enabled
217
- const validated = this._validateResponse(result, blocksSchemas_1.SearchBlocksResponseSchema);
251
+ const validated = await this._validateResponse(result, schema('SearchBlocksResponseSchema'));
218
252
  return validated;
219
253
  }
220
254
  /**
@@ -224,7 +258,7 @@ class BlocksApi extends asyncModules_1.default {
224
258
  * @param {string} [langCode] - Language code. Default: "en_US".
225
259
  * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
226
260
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
227
- * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
261
+ * @returns {Promise<IProductsResponse | IError>} Returns an object with an array of products, total count and totalFound.
228
262
  * @throws {IError} When isShell=false and an error occurs during the fetch
229
263
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getCartComplement getCartComplement} documentation.
230
264
  */
@@ -243,7 +277,7 @@ class BlocksApi extends asyncModules_1.default {
243
277
  "productIds": [1, 2],
244
278
  "langCode": "en_US"
245
279
  }
246
- * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
280
+ * @returns {Promise<IProductsResponse | IError>} Returns an object with an array of products, total count and totalFound.
247
281
  * @throws {IError} When isShell=false and an error occurs during the fetch
248
282
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getCartComplementByProductIds getCartComplementByProductIds} documentation.
249
283
  */
@@ -258,7 +292,7 @@ class BlocksApi extends asyncModules_1.default {
258
292
  * @param {string} [langCode] - Language code. Default: "en_US".
259
293
  * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
260
294
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
261
- * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
295
+ * @returns {Promise<IProductsResponse | IError>} Returns an object with an array of products, total count and totalFound.
262
296
  * @throws {IError} When isShell=false and an error occurs during the fetch
263
297
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getCartSimilar getCartSimilar} documentation.
264
298
  */
@@ -277,7 +311,7 @@ class BlocksApi extends asyncModules_1.default {
277
311
  "productIds": [1, 2],
278
312
  "langCode": "en_US"
279
313
  }
280
- * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
314
+ * @returns {Promise<IProductsResponse | IError>} Returns an object with an array of products, total count and totalFound.
281
315
  * @throws {IError} When isShell=false and an error occurs during the fetch
282
316
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getCartSimilarByProductIds getCartSimilarByProductIds} documentation.
283
317
  */
@@ -292,7 +326,7 @@ class BlocksApi extends asyncModules_1.default {
292
326
  * @param {string} [langCode] - Language code. Default: "en_US".
293
327
  * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
294
328
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
295
- * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
329
+ * @returns {Promise<IProductsResponse | IError>} Returns an object with an array of products, total count and totalFound.
296
330
  * @throws {IError} When isShell=false and an error occurs during the fetch
297
331
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getPersonalRecommendations getPersonalRecommendations} documentation.
298
332
  */
@@ -308,7 +342,7 @@ class BlocksApi extends asyncModules_1.default {
308
342
  * @param {string} [langCode] - Language code. Default: "en_US".
309
343
  * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
310
344
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
311
- * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
345
+ * @returns {Promise<IProductsResponse | IError>} Returns an object with an array of products, total count and totalFound.
312
346
  * @throws {IError} When isShell=false and an error occurs during the fetch
313
347
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getRecentlyViewed getRecentlyViewed} documentation.
314
348
  */
@@ -324,7 +358,7 @@ class BlocksApi extends asyncModules_1.default {
324
358
  * @param {string} [langCode] - Language code. Default: "en_US".
325
359
  * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
326
360
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
327
- * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
361
+ * @returns {Promise<IProductsResponse | IError>} Returns an object with an array of products, total count and totalFound.
328
362
  * @throws {IError} When isShell=false and an error occurs during the fetch
329
363
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getRepeatPurchase getRepeatPurchase} documentation.
330
364
  */
@@ -352,7 +386,7 @@ class BlocksApi extends asyncModules_1.default {
352
386
  * @param {string} [langCode] - Language code. Default: "en_US".
353
387
  * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
354
388
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
355
- * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
389
+ * @returns {Promise<IProductsResponse | IError>} Returns an object with an array of products, total count and totalFound.
356
390
  * @throws {IError} When isShell=false and an error occurs during the fetch
357
391
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getTrending getTrending} documentation.
358
392
  */
@@ -368,7 +402,7 @@ class BlocksApi extends asyncModules_1.default {
368
402
  * @param {string} [langCode] - Language code. Default: "en_US".
369
403
  * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
370
404
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
371
- * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
405
+ * @returns {Promise<IProductsResponse | IError>} Returns an object with an array of products, total count and totalFound.
372
406
  * @throws {IError} When isShell=false and an error occurs during the fetch
373
407
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getWishlistSimilar getWishlistSimilar} documentation.
374
408
  */
@@ -387,7 +421,7 @@ class BlocksApi extends asyncModules_1.default {
387
421
  "productIds": [1, 2],
388
422
  "langCode": "en_US"
389
423
  }
390
- * @returns {Promise<IProductsEntity[] | IError>} Returns an array of products.
424
+ * @returns {Promise<IProductsResponse | IError>} Returns an object with an array of products, total count and totalFound.
391
425
  * @throws {IError} When isShell=false and an error occurs during the fetch
392
426
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getWishlistSimilarByProductIds getWishlistSimilarByProductIds} documentation.
393
427
  */
@@ -59,10 +59,10 @@ interface IBlocks {
59
59
  * @param {string} [langCode] - Language code. Default: "en_US".
60
60
  * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
61
61
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
62
- * @returns {IProductsEntity[]} A promise that resolves to an array of products or an error.
62
+ * @returns {IProductsResponse} A promise that resolves to a products response (items + total + totalFound) or an error.
63
63
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
64
64
  */
65
- getCartComplement(marker: string, langCode?: string, signPrice?: string): Promise<IProductsEntity[] | IError>;
65
+ getCartComplement(marker: string, langCode?: string, signPrice?: string): Promise<IProductsResponse | IError>;
66
66
  /**
67
67
  * Get "complete your cart" products by an explicit list of productIds (POST body).
68
68
  * @handleName getCartComplementByProductIds
@@ -73,10 +73,10 @@ interface IBlocks {
73
73
  "productIds": [1, 2],
74
74
  "langCode": "en_US"
75
75
  }
76
- * @returns {IProductsEntity[]} A promise that resolves to an array of products or an error.
76
+ * @returns {IProductsResponse} A promise that resolves to a products response (items + total + totalFound) or an error.
77
77
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
78
78
  */
79
- getCartComplementByProductIds(marker: string, body: IBlockProductsLookup): Promise<IProductsEntity[] | IError>;
79
+ getCartComplementByProductIds(marker: string, body: IBlockProductsLookup): Promise<IProductsResponse | IError>;
80
80
  /**
81
81
  * Get "similar to cart" products by the cart from context (auth user or guest).
82
82
  * @handleName getCartSimilar
@@ -84,10 +84,10 @@ interface IBlocks {
84
84
  * @param {string} [langCode] - Language code. Default: "en_US".
85
85
  * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
86
86
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
87
- * @returns {IProductsEntity[]} A promise that resolves to an array of products or an error.
87
+ * @returns {IProductsResponse} A promise that resolves to a products response (items + total + totalFound) or an error.
88
88
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
89
89
  */
90
- getCartSimilar(marker: string, langCode?: string, signPrice?: string): Promise<IProductsEntity[] | IError>;
90
+ getCartSimilar(marker: string, langCode?: string, signPrice?: string): Promise<IProductsResponse | IError>;
91
91
  /**
92
92
  * Get "similar to cart" products by an explicit list of productIds (POST body).
93
93
  * @handleName getCartSimilarByProductIds
@@ -98,10 +98,10 @@ interface IBlocks {
98
98
  "productIds": [1, 2],
99
99
  "langCode": "en_US"
100
100
  }
101
- * @returns {IProductsEntity[]} A promise that resolves to an array of products or an error.
101
+ * @returns {IProductsResponse} A promise that resolves to a products response (items + total + totalFound) or an error.
102
102
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
103
103
  */
104
- getCartSimilarByProductIds(marker: string, body: IBlockProductsLookup): Promise<IProductsEntity[] | IError>;
104
+ getCartSimilarByProductIds(marker: string, body: IBlockProductsLookup): Promise<IProductsResponse | IError>;
105
105
  /**
106
106
  * Get personal recommendations for the user.
107
107
  * @handleName getPersonalRecommendations
@@ -109,10 +109,10 @@ interface IBlocks {
109
109
  * @param {string} [langCode] - Language code. Default: "en_US".
110
110
  * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
111
111
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
112
- * @returns {IProductsEntity[]} A promise that resolves to an array of products or an error.
112
+ * @returns {IProductsResponse} A promise that resolves to a products response (items + total + totalFound) or an error.
113
113
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
114
114
  */
115
- getPersonalRecommendations(marker: string, langCode?: string, signPrice?: string): Promise<IProductsEntity[] | IError>;
115
+ getPersonalRecommendations(marker: string, langCode?: string, signPrice?: string): Promise<IProductsResponse | IError>;
116
116
  /**
117
117
  * Get recently viewed products.
118
118
  * @handleName getRecentlyViewed
@@ -120,10 +120,10 @@ interface IBlocks {
120
120
  * @param {string} [langCode] - Language code. Default: "en_US".
121
121
  * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
122
122
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
123
- * @returns {IProductsEntity[]} A promise that resolves to an array of products or an error.
123
+ * @returns {IProductsResponse} A promise that resolves to a products response (items + total + totalFound) or an error.
124
124
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
125
125
  */
126
- getRecentlyViewed(marker: string, langCode?: string, signPrice?: string): Promise<IProductsEntity[] | IError>;
126
+ getRecentlyViewed(marker: string, langCode?: string, signPrice?: string): Promise<IProductsResponse | IError>;
127
127
  /**
128
128
  * Get products for repeat purchase.
129
129
  * @handleName getRepeatPurchase
@@ -131,10 +131,10 @@ interface IBlocks {
131
131
  * @param {string} [langCode] - Language code. Default: "en_US".
132
132
  * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
133
133
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
134
- * @returns {IProductsEntity[]} A promise that resolves to an array of products or an error.
134
+ * @returns {IProductsResponse} A promise that resolves to a products response (items + total + totalFound) or an error.
135
135
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
136
136
  */
137
- getRepeatPurchase(marker: string, langCode?: string, signPrice?: string): Promise<IProductsEntity[] | IError>;
137
+ getRepeatPurchase(marker: string, langCode?: string, signPrice?: string): Promise<IProductsResponse | IError>;
138
138
  /**
139
139
  * Get the block's slides tree as a flat pre-order array (slider_block only).
140
140
  * @handleName getSlides
@@ -150,10 +150,10 @@ interface IBlocks {
150
150
  * @param {string} [langCode] - Language code. Default: "en_US".
151
151
  * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
152
152
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
153
- * @returns {IProductsEntity[]} A promise that resolves to an array of products or an error.
153
+ * @returns {IProductsResponse} A promise that resolves to a products response (items + total + totalFound) or an error.
154
154
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
155
155
  */
156
- getTrending(marker: string, langCode?: string, signPrice?: string): Promise<IProductsEntity[] | IError>;
156
+ getTrending(marker: string, langCode?: string, signPrice?: string): Promise<IProductsResponse | IError>;
157
157
  /**
158
158
  * Get "similar to wishlist" products by the wishlist from context (auth user or guest).
159
159
  * @handleName getWishlistSimilar
@@ -161,10 +161,10 @@ interface IBlocks {
161
161
  * @param {string} [langCode] - Language code. Default: "en_US".
162
162
  * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
163
163
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
164
- * @returns {IProductsEntity[]} A promise that resolves to an array of products or an error.
164
+ * @returns {IProductsResponse} A promise that resolves to a products response (items + total + totalFound) or an error.
165
165
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
166
166
  */
167
- getWishlistSimilar(marker: string, langCode?: string, signPrice?: string): Promise<IProductsEntity[] | IError>;
167
+ getWishlistSimilar(marker: string, langCode?: string, signPrice?: string): Promise<IProductsResponse | IError>;
168
168
  /**
169
169
  * Get "similar to wishlist" products by an explicit list of productIds (POST body).
170
170
  * @handleName getWishlistSimilarByProductIds
@@ -175,10 +175,10 @@ interface IBlocks {
175
175
  "productIds": [1, 2],
176
176
  "langCode": "en_US"
177
177
  }
178
- * @returns {IProductsEntity[]} A promise that resolves to an array of products or an error.
178
+ * @returns {IProductsResponse} A promise that resolves to a products response (items + total + totalFound) or an error.
179
179
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
180
180
  */
181
- getWishlistSimilarByProductIds(marker: string, body: IBlockProductsLookup): Promise<IProductsEntity[] | IError>;
181
+ getWishlistSimilarByProductIds(marker: string, body: IBlockProductsLookup): Promise<IProductsResponse | IError>;
182
182
  }
183
183
  /**
184
184
  * Represents a response from the blocks API.
@@ -53,6 +53,7 @@ export declare const BlockEntitySchema: z.ZodObject<{
53
53
  discountConfig: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
54
54
  }, z.core.$strip>>;
55
55
  total: z.ZodNumber;
56
+ totalFound: z.ZodOptional<z.ZodNumber>;
56
57
  }, z.core.$strip>>;
57
58
  countElementsPerRow: z.ZodOptional<z.ZodNumber>;
58
59
  quantity: z.ZodOptional<z.ZodNumber>;
@@ -149,6 +150,7 @@ export declare const BlocksResponseSchema: z.ZodObject<{
149
150
  discountConfig: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
150
151
  }, z.core.$strip>>;
151
152
  total: z.ZodNumber;
153
+ totalFound: z.ZodOptional<z.ZodNumber>;
152
154
  }, z.core.$strip>>;
153
155
  countElementsPerRow: z.ZodOptional<z.ZodNumber>;
154
156
  quantity: z.ZodOptional<z.ZodNumber>;
@@ -88,7 +88,7 @@ interface IDiscountCondition {
88
88
  * Represents a discount entity.
89
89
  * @interface IDiscountsEntity
90
90
  * @property {number} id - The unique identifier of the discount.
91
- * @property {number} [attributeSetId] - The identifier of the discount.
91
+ * @property {number | null} [attributeSetId] - The identifier of the attribute set linked to the discount, or `null` when no set is linked.
92
92
  * @property {ILocalizeInfo} [localizeInfos] - The name of the discount.
93
93
  * @property {number} [version] - The version of the discount.
94
94
  * @property {string} [identifier] - The identifier of the discount.
@@ -111,7 +111,7 @@ interface IDiscountCondition {
111
111
  */
112
112
  interface IDiscountsEntity {
113
113
  id: number;
114
- attributeSetId?: number;
114
+ attributeSetId?: number | null;
115
115
  localizeInfos?: ILocalizeInfo;
116
116
  version?: number;
117
117
  identifier?: string;
@@ -137,14 +137,14 @@ interface IDiscountsEntity {
137
137
  * @property {'TO_PRODUCT' | 'TO_ORDER'} applicability - What the discount applies to. Example: "TO_PRODUCT".
138
138
  * @property {'FIXED_AMOUNT' | 'PERCENT'} discountType - How the discount value is interpreted. Example: "FIXED_AMOUNT".
139
139
  * @property {number} value - Discount amount (currency units for FIXED_AMOUNT, percentage points for PERCENT). Example: 10.
140
- * @property {number} [maxAmount] - Optional cap on the absolute discount applied. Example: 5.
140
+ * @property {number | null} [maxAmount] - Cap on the absolute discount applied, or `null` when uncapped. Example: 5.
141
141
  * @description Configuration of the discount calculation.
142
142
  */
143
143
  interface IDiscountValue {
144
144
  applicability: 'TO_PRODUCT' | 'TO_ORDER';
145
145
  discountType: 'FIXED_AMOUNT' | 'PERCENT';
146
146
  value: number;
147
- maxAmount?: number;
147
+ maxAmount?: number | null;
148
148
  }
149
149
  /**
150
150
  * @interface ICouponEntity
@@ -1,7 +1,7 @@
1
1
  import AsyncModules from '../base/asyncModules';
2
2
  import type StateModule from '../base/stateModule';
3
3
  import type { IError } from '../base/utils';
4
- import type { IContentApiEvent, IEvents, IListFormSubscription, ISubscribeFormEvent, ISubscriptions } from './eventsInterfaces';
4
+ import type { IContentApiEvent, IEvents, IFormSubscriptionsResponse, ISubscribeFormEvent, ISubscriptions } from './eventsInterfaces';
5
5
  /**
6
6
  * Controllers for working with events
7
7
  * @handle /api/content/events
@@ -86,13 +86,13 @@ export default class EventsApi extends AsyncModules implements IEvents {
86
86
  * @handleName getFormSubscriptions
87
87
  * @param {number} [offset] - Optional offset for pagination. Default: 0.
88
88
  * @param {number} [limit] - Optional limit for pagination. Default: 30.
89
- * @returns {Promise<IListFormSubscription[] | IError>} Returns an array of form subscriptions.
89
+ * @returns {Promise<IFormSubscriptionsResponse | IError>} Returns an object with an array of form subscriptions and total count.
90
90
  * @throws {IError} When isShell=false and an error occurs during the fetch
91
91
  * @description This method requires user authorization.
92
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
93
  * @see {@link https://js-sdk.oneentry.cloud/docs/events/getFormSubscriptions getFormSubscriptions} documentation.
94
94
  */
95
- getFormSubscriptions(offset?: number, limit?: number): Promise<IListFormSubscription[] | IError>;
95
+ getFormSubscriptions(offset?: number, limit?: number): Promise<IFormSubscriptionsResponse | IError>;
96
96
  /**
97
97
  * Unsubscribe from form notifications by marker.
98
98
  * @handleName unsubscribeFromForm
@@ -115,7 +115,7 @@ class EventsApi extends asyncModules_1.default {
115
115
  * @handleName getFormSubscriptions
116
116
  * @param {number} [offset] - Optional offset for pagination. Default: 0.
117
117
  * @param {number} [limit] - Optional limit for pagination. Default: 30.
118
- * @returns {Promise<IListFormSubscription[] | IError>} Returns an array of form subscriptions.
118
+ * @returns {Promise<IFormSubscriptionsResponse | IError>} Returns an object with an array of form subscriptions and total count.
119
119
  * @throws {IError} When isShell=false and an error occurs during the fetch
120
120
  * @description This method requires user authorization.
121
121
  * @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}.