oneentry 1.0.161 → 1.0.163

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 (87) hide show
  1. package/README.md +18 -0
  2. package/changelog.md +80 -3
  3. package/dist/admins/adminsInterfaces.d.ts +2 -0
  4. package/dist/admins/adminsSchemas.d.ts +8 -22
  5. package/dist/admins/adminsSchemas.js +3 -9
  6. package/dist/attribute-sets/attributeSetsInterfaces.d.ts +8 -6
  7. package/dist/auth-provider/authProviderSchemas.d.ts +1 -0
  8. package/dist/auth-provider/authProvidersInterfaces.d.ts +4 -4
  9. package/dist/base/attributes.d.ts +105 -0
  10. package/dist/base/attributes.js +172 -0
  11. package/dist/base/utils.d.ts +95 -2
  12. package/dist/base/validation.d.ts +30 -0
  13. package/dist/base/validation.js +94 -1
  14. package/dist/blocks/blocksApi.d.ts +16 -8
  15. package/dist/blocks/blocksApi.js +24 -15
  16. package/dist/blocks/blocksInterfaces.d.ts +17 -9
  17. package/dist/blocks/blocksSchemas.d.ts +6 -6
  18. package/dist/blocks/blocksSchemas.js +2 -1
  19. package/dist/discounts/discountsInterfaces.d.ts +3 -1
  20. package/dist/forms-data/formsDataApi.d.ts +16 -6
  21. package/dist/forms-data/formsDataApi.js +14 -4
  22. package/dist/forms-data/formsDataInterfaces.d.ts +57 -20
  23. package/dist/index.d.ts +1 -0
  24. package/dist/index.js +9 -1
  25. package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +6 -6
  26. package/dist/menus/menusInterfaces.d.ts +5 -1
  27. package/dist/menus/menusSchemas.js +4 -1
  28. package/dist/orders/ordersInterfaces.d.ts +3 -1
  29. package/dist/orders/ordersSchemas.d.ts +2 -0
  30. package/dist/orders/ordersSchemas.js +1 -0
  31. package/dist/pages/pagesApi.d.ts +1 -11
  32. package/dist/pages/pagesApi.js +0 -17
  33. package/dist/pages/pagesInterfaces.d.ts +3 -20
  34. package/dist/pages/pagesSchemas.d.ts +6 -10
  35. package/dist/pages/pagesSchemas.js +4 -9
  36. package/dist/product-statuses/productStatusesInterfaces.d.ts +2 -2
  37. package/dist/products/productsSchemas.d.ts +5 -5
  38. package/dist/products/productsSchemas.js +3 -2
  39. package/dist/templates/templatesInterfaces.d.ts +1 -1
  40. package/dist/templates/templatesSchemas.d.ts +3 -3
  41. package/dist/templates/templatesSchemas.js +2 -1
  42. package/dist/templates-preview/templatesPreviewInterfaces.d.ts +2 -2
  43. package/dist/users/usersInterfaces.d.ts +2 -0
  44. package/dist/users/usersSchemas.d.ts +1 -0
  45. package/esm/admins/adminsInterfaces.d.ts +2 -0
  46. package/esm/admins/adminsSchemas.d.ts +8 -22
  47. package/esm/admins/adminsSchemas.js +3 -9
  48. package/esm/attribute-sets/attributeSetsInterfaces.d.ts +8 -6
  49. package/esm/auth-provider/authProviderSchemas.d.ts +1 -0
  50. package/esm/auth-provider/authProvidersInterfaces.d.ts +4 -4
  51. package/esm/base/attributes.d.ts +105 -0
  52. package/esm/base/attributes.js +163 -0
  53. package/esm/base/utils.d.ts +95 -2
  54. package/esm/base/validation.d.ts +30 -0
  55. package/esm/base/validation.js +93 -0
  56. package/esm/blocks/blocksApi.d.ts +16 -8
  57. package/esm/blocks/blocksApi.js +24 -15
  58. package/esm/blocks/blocksInterfaces.d.ts +17 -9
  59. package/esm/blocks/blocksSchemas.d.ts +6 -6
  60. package/esm/blocks/blocksSchemas.js +2 -1
  61. package/esm/discounts/discountsInterfaces.d.ts +3 -1
  62. package/esm/forms-data/formsDataApi.d.ts +16 -6
  63. package/esm/forms-data/formsDataApi.js +14 -4
  64. package/esm/forms-data/formsDataInterfaces.d.ts +57 -20
  65. package/esm/index.d.ts +1 -0
  66. package/esm/index.js +1 -0
  67. package/esm/integration-collections/integrationCollectionsInterfaces.d.ts +6 -6
  68. package/esm/menus/menusInterfaces.d.ts +5 -1
  69. package/esm/menus/menusSchemas.js +4 -1
  70. package/esm/orders/ordersInterfaces.d.ts +3 -1
  71. package/esm/orders/ordersSchemas.d.ts +2 -0
  72. package/esm/orders/ordersSchemas.js +1 -0
  73. package/esm/pages/pagesApi.d.ts +1 -11
  74. package/esm/pages/pagesApi.js +0 -17
  75. package/esm/pages/pagesInterfaces.d.ts +3 -20
  76. package/esm/pages/pagesSchemas.d.ts +6 -10
  77. package/esm/pages/pagesSchemas.js +3 -8
  78. package/esm/product-statuses/productStatusesInterfaces.d.ts +2 -2
  79. package/esm/products/productsSchemas.d.ts +5 -5
  80. package/esm/products/productsSchemas.js +3 -2
  81. package/esm/templates/templatesInterfaces.d.ts +1 -1
  82. package/esm/templates/templatesSchemas.d.ts +3 -3
  83. package/esm/templates/templatesSchemas.js +2 -1
  84. package/esm/templates-preview/templatesPreviewInterfaces.d.ts +2 -2
  85. package/esm/users/usersInterfaces.d.ts +2 -0
  86. package/esm/users/usersSchemas.d.ts +1 -0
  87. package/package.json +2 -2
@@ -185,14 +185,16 @@ export default class BlocksApi extends AsyncModules {
185
185
  * @param {string} [langCode] - Language code. Default: "en_US".
186
186
  * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
187
187
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
188
+ * @param {number} [limit] - Maximum number of products to return. When omitted, the block's own quantity setting applies. Example: 10.
188
189
  * @returns {Promise<IProductsResponse | IError>} Returns a products response with items and total.
189
190
  * @throws {IError} When isShell=false and an error occurs during the fetch
190
191
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getFrequentlyOrderedProducts getFrequentlyOrderedProducts} documentation.
191
192
  */
192
- async getFrequentlyOrderedProducts(productId, marker, langCode = this.state.lang, signPrice) {
193
+ async getFrequentlyOrderedProducts(productId, marker, langCode = this.state.lang, signPrice, limit) {
193
194
  const query = {
194
195
  langCode,
195
196
  signPrice,
197
+ limit,
196
198
  };
197
199
  const data = await this._fetchGet(`/${marker}/products/${productId}/frequently-ordered?` +
198
200
  this._queryParamsToString(query));
@@ -220,12 +222,13 @@ export default class BlocksApi extends AsyncModules {
220
222
  * @param {string} [langCode] - Language code. Default: "en_US".
221
223
  * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
222
224
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
225
+ * @param {number} [limit] - Maximum number of products to return. When omitted, the block's own quantity setting applies. Example: 10.
223
226
  * @returns {Promise<IProductsResponse | IError>} Returns an object with an array of products, total count and totalFound.
224
227
  * @throws {IError} When isShell=false and an error occurs during the fetch
225
228
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getCartComplement getCartComplement} documentation.
226
229
  */
227
- async getCartComplement(marker, langCode = this.state.lang, signPrice) {
228
- const query = { langCode, signPrice };
230
+ async getCartComplement(marker, langCode = this.state.lang, signPrice, limit) {
231
+ const query = { langCode, signPrice, limit };
229
232
  const data = await this._fetchGet(`/${marker}/cart-complement?` + this._queryParamsToString(query));
230
233
  return this._normalizeData(data);
231
234
  }
@@ -254,12 +257,13 @@ export default class BlocksApi extends AsyncModules {
254
257
  * @param {string} [langCode] - Language code. Default: "en_US".
255
258
  * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
256
259
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
260
+ * @param {number} [limit] - Maximum number of products to return. When omitted, the block's own quantity setting applies. Example: 10.
257
261
  * @returns {Promise<IProductsResponse | IError>} Returns an object with an array of products, total count and totalFound.
258
262
  * @throws {IError} When isShell=false and an error occurs during the fetch
259
263
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getCartSimilar getCartSimilar} documentation.
260
264
  */
261
- async getCartSimilar(marker, langCode = this.state.lang, signPrice) {
262
- const query = { langCode, signPrice };
265
+ async getCartSimilar(marker, langCode = this.state.lang, signPrice, limit) {
266
+ const query = { langCode, signPrice, limit };
263
267
  const data = await this._fetchGet(`/${marker}/cart-similar?` + this._queryParamsToString(query));
264
268
  return this._normalizeData(data);
265
269
  }
@@ -288,12 +292,13 @@ export default class BlocksApi extends AsyncModules {
288
292
  * @param {string} [langCode] - Language code. Default: "en_US".
289
293
  * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
290
294
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
295
+ * @param {number} [limit] - Maximum number of products to return. When omitted, the block's own quantity setting applies. Example: 10.
291
296
  * @returns {Promise<IProductsResponse | IError>} Returns an object with an array of products, total count and totalFound.
292
297
  * @throws {IError} When isShell=false and an error occurs during the fetch
293
298
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getPersonalRecommendations getPersonalRecommendations} documentation.
294
299
  */
295
- async getPersonalRecommendations(marker, langCode = this.state.lang, signPrice) {
296
- const query = { langCode, signPrice };
300
+ async getPersonalRecommendations(marker, langCode = this.state.lang, signPrice, limit) {
301
+ const query = { langCode, signPrice, limit };
297
302
  const data = await this._fetchGet(`/${marker}/personal-recommendations?` + this._queryParamsToString(query));
298
303
  return this._normalizeData(data);
299
304
  }
@@ -304,12 +309,13 @@ export default class BlocksApi extends AsyncModules {
304
309
  * @param {string} [langCode] - Language code. Default: "en_US".
305
310
  * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
306
311
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
312
+ * @param {number} [limit] - Maximum number of products to return. When omitted, the block's own quantity setting applies. Example: 10.
307
313
  * @returns {Promise<IProductsResponse | IError>} Returns an object with an array of products, total count and totalFound.
308
314
  * @throws {IError} When isShell=false and an error occurs during the fetch
309
315
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getRecentlyViewed getRecentlyViewed} documentation.
310
316
  */
311
- async getRecentlyViewed(marker, langCode = this.state.lang, signPrice) {
312
- const query = { langCode, signPrice };
317
+ async getRecentlyViewed(marker, langCode = this.state.lang, signPrice, limit) {
318
+ const query = { langCode, signPrice, limit };
313
319
  const data = await this._fetchGet(`/${marker}/recently-viewed?` + this._queryParamsToString(query));
314
320
  return this._normalizeData(data);
315
321
  }
@@ -320,12 +326,13 @@ export default class BlocksApi extends AsyncModules {
320
326
  * @param {string} [langCode] - Language code. Default: "en_US".
321
327
  * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
322
328
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
329
+ * @param {number} [limit] - Maximum number of products to return. When omitted, the block's own quantity setting applies. Example: 10.
323
330
  * @returns {Promise<IProductsResponse | IError>} Returns an object with an array of products, total count and totalFound.
324
331
  * @throws {IError} When isShell=false and an error occurs during the fetch
325
332
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getRepeatPurchase getRepeatPurchase} documentation.
326
333
  */
327
- async getRepeatPurchase(marker, langCode = this.state.lang, signPrice) {
328
- const query = { langCode, signPrice };
334
+ async getRepeatPurchase(marker, langCode = this.state.lang, signPrice, limit) {
335
+ const query = { langCode, signPrice, limit };
329
336
  const data = await this._fetchGet(`/${marker}/repeat-purchase?` + this._queryParamsToString(query));
330
337
  return this._normalizeData(data);
331
338
  }
@@ -348,12 +355,13 @@ export default class BlocksApi extends AsyncModules {
348
355
  * @param {string} [langCode] - Language code. Default: "en_US".
349
356
  * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
350
357
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
358
+ * @param {number} [limit] - Maximum number of products to return. When omitted, the block's own quantity setting applies. Example: 10.
351
359
  * @returns {Promise<IProductsResponse | IError>} Returns an object with an array of products, total count and totalFound.
352
360
  * @throws {IError} When isShell=false and an error occurs during the fetch
353
361
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getTrending getTrending} documentation.
354
362
  */
355
- async getTrending(marker, langCode = this.state.lang, signPrice) {
356
- const query = { langCode, signPrice };
363
+ async getTrending(marker, langCode = this.state.lang, signPrice, limit) {
364
+ const query = { langCode, signPrice, limit };
357
365
  const data = await this._fetchGet(`/${marker}/trending?` + this._queryParamsToString(query));
358
366
  return this._normalizeData(data);
359
367
  }
@@ -364,12 +372,13 @@ export default class BlocksApi extends AsyncModules {
364
372
  * @param {string} [langCode] - Language code. Default: "en_US".
365
373
  * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
366
374
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
375
+ * @param {number} [limit] - Maximum number of products to return. When omitted, the block's own quantity setting applies. Example: 10.
367
376
  * @returns {Promise<IProductsResponse | IError>} Returns an object with an array of products, total count and totalFound.
368
377
  * @throws {IError} When isShell=false and an error occurs during the fetch
369
378
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/getWishlistSimilar getWishlistSimilar} documentation.
370
379
  */
371
- async getWishlistSimilar(marker, langCode = this.state.lang, signPrice) {
372
- const query = { langCode, signPrice };
380
+ async getWishlistSimilar(marker, langCode = this.state.lang, signPrice, limit) {
381
+ const query = { langCode, signPrice, limit };
373
382
  const data = await this._fetchGet(`/${marker}/wishlist-similar?` + this._queryParamsToString(query));
374
383
  return this._normalizeData(data);
375
384
  }
@@ -29,7 +29,7 @@ interface IBlocks {
29
29
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
30
30
  * @description This method retrieves a block object by its marker.
31
31
  */
32
- getBlockByMarker(marker: string, langCode: string, offset?: number, limit?: number): Promise<IBlockEntity | IError>;
32
+ getBlockByMarker(marker: string, langCode?: string, offset?: number, limit?: number): Promise<IBlockEntity | IError>;
33
33
  /**
34
34
  * Performs a quick search for block objects with limited output.
35
35
  * @handleName searchBlock
@@ -48,10 +48,11 @@ interface IBlocks {
48
48
  * @param {string} [langCode] - Language code. Default: "en_US".
49
49
  * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
50
50
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
51
+ * @param {number} [limit] - Maximum number of products to return. When omitted, the block's own quantity setting applies. Example: 10.
51
52
  * @returns {IProductsResponse} A promise that resolves to a products response (items + total) or an error.
52
53
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
53
54
  */
54
- getFrequentlyOrderedProducts(productId: number, marker: string, langCode?: string, signPrice?: string): Promise<IProductsResponse | IError>;
55
+ getFrequentlyOrderedProducts(productId: number, marker: string, langCode?: string, signPrice?: string, limit?: number): Promise<IProductsResponse | IError>;
55
56
  /**
56
57
  * Get "complete your cart" products by the cart from context (auth user or guest).
57
58
  * @handleName getCartComplement
@@ -59,10 +60,11 @@ interface IBlocks {
59
60
  * @param {string} [langCode] - Language code. Default: "en_US".
60
61
  * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
61
62
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
63
+ * @param {number} [limit] - Maximum number of products to return. When omitted, the block's own quantity setting applies. Example: 10.
62
64
  * @returns {IProductsResponse} A promise that resolves to a products response (items + total + totalFound) or an error.
63
65
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
64
66
  */
65
- getCartComplement(marker: string, langCode?: string, signPrice?: string): Promise<IProductsResponse | IError>;
67
+ getCartComplement(marker: string, langCode?: string, signPrice?: string, limit?: number): Promise<IProductsResponse | IError>;
66
68
  /**
67
69
  * Get "complete your cart" products by an explicit list of productIds (POST body).
68
70
  * @handleName getCartComplementByProductIds
@@ -84,10 +86,11 @@ interface IBlocks {
84
86
  * @param {string} [langCode] - Language code. Default: "en_US".
85
87
  * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
86
88
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
89
+ * @param {number} [limit] - Maximum number of products to return. When omitted, the block's own quantity setting applies. Example: 10.
87
90
  * @returns {IProductsResponse} A promise that resolves to a products response (items + total + totalFound) or an error.
88
91
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
89
92
  */
90
- getCartSimilar(marker: string, langCode?: string, signPrice?: string): Promise<IProductsResponse | IError>;
93
+ getCartSimilar(marker: string, langCode?: string, signPrice?: string, limit?: number): Promise<IProductsResponse | IError>;
91
94
  /**
92
95
  * Get "similar to cart" products by an explicit list of productIds (POST body).
93
96
  * @handleName getCartSimilarByProductIds
@@ -109,10 +112,11 @@ interface IBlocks {
109
112
  * @param {string} [langCode] - Language code. Default: "en_US".
110
113
  * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
111
114
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
115
+ * @param {number} [limit] - Maximum number of products to return. When omitted, the block's own quantity setting applies. Example: 10.
112
116
  * @returns {IProductsResponse} A promise that resolves to a products response (items + total + totalFound) or an error.
113
117
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
114
118
  */
115
- getPersonalRecommendations(marker: string, langCode?: string, signPrice?: string): Promise<IProductsResponse | IError>;
119
+ getPersonalRecommendations(marker: string, langCode?: string, signPrice?: string, limit?: number): Promise<IProductsResponse | IError>;
116
120
  /**
117
121
  * Get recently viewed products.
118
122
  * @handleName getRecentlyViewed
@@ -120,10 +124,11 @@ interface IBlocks {
120
124
  * @param {string} [langCode] - Language code. Default: "en_US".
121
125
  * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
122
126
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
127
+ * @param {number} [limit] - Maximum number of products to return. When omitted, the block's own quantity setting applies. Example: 10.
123
128
  * @returns {IProductsResponse} A promise that resolves to a products response (items + total + totalFound) or an error.
124
129
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
125
130
  */
126
- getRecentlyViewed(marker: string, langCode?: string, signPrice?: string): Promise<IProductsResponse | IError>;
131
+ getRecentlyViewed(marker: string, langCode?: string, signPrice?: string, limit?: number): Promise<IProductsResponse | IError>;
127
132
  /**
128
133
  * Get products for repeat purchase.
129
134
  * @handleName getRepeatPurchase
@@ -131,10 +136,11 @@ interface IBlocks {
131
136
  * @param {string} [langCode] - Language code. Default: "en_US".
132
137
  * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
133
138
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
139
+ * @param {number} [limit] - Maximum number of products to return. When omitted, the block's own quantity setting applies. Example: 10.
134
140
  * @returns {IProductsResponse} A promise that resolves to a products response (items + total + totalFound) or an error.
135
141
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
136
142
  */
137
- getRepeatPurchase(marker: string, langCode?: string, signPrice?: string): Promise<IProductsResponse | IError>;
143
+ getRepeatPurchase(marker: string, langCode?: string, signPrice?: string, limit?: number): Promise<IProductsResponse | IError>;
138
144
  /**
139
145
  * Get the block's slides tree as a flat pre-order array (slider_block only).
140
146
  * @handleName getSlides
@@ -150,10 +156,11 @@ interface IBlocks {
150
156
  * @param {string} [langCode] - Language code. Default: "en_US".
151
157
  * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
152
158
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
159
+ * @param {number} [limit] - Maximum number of products to return. When omitted, the block's own quantity setting applies. Example: 10.
153
160
  * @returns {IProductsResponse} A promise that resolves to a products response (items + total + totalFound) or an error.
154
161
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
155
162
  */
156
- getTrending(marker: string, langCode?: string, signPrice?: string): Promise<IProductsResponse | IError>;
163
+ getTrending(marker: string, langCode?: string, signPrice?: string, limit?: number): Promise<IProductsResponse | IError>;
157
164
  /**
158
165
  * Get "similar to wishlist" products by the wishlist from context (auth user or guest).
159
166
  * @handleName getWishlistSimilar
@@ -161,10 +168,11 @@ interface IBlocks {
161
168
  * @param {string} [langCode] - Language code. Default: "en_US".
162
169
  * @param {string} [signPrice] - Order storage marker for price fixing. If the parameter is set, the price is fixed for a certain time.
163
170
  * @see {@link https://js-sdk.oneentry.cloud/docs/blocks/#Fixing-the-price-signPrice Fixing the price} documentation.
171
+ * @param {number} [limit] - Maximum number of products to return. When omitted, the block's own quantity setting applies. Example: 10.
164
172
  * @returns {IProductsResponse} A promise that resolves to a products response (items + total + totalFound) or an error.
165
173
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
166
174
  */
167
- getWishlistSimilar(marker: string, langCode?: string, signPrice?: string): Promise<IProductsResponse | IError>;
175
+ getWishlistSimilar(marker: string, langCode?: string, signPrice?: string, limit?: number): Promise<IProductsResponse | IError>;
168
176
  /**
169
177
  * Get "similar to wishlist" products by an explicit list of productIds (POST body).
170
178
  * @handleName getWishlistSimilarByProductIds
@@ -12,7 +12,7 @@ export declare const BlockEntitySchema: z.ZodObject<{
12
12
  type: z.ZodString;
13
13
  templateIdentifier: z.ZodNullable<z.ZodString>;
14
14
  isVisible: z.ZodBoolean;
15
- attributeValues: z.ZodRecord<z.ZodString, z.ZodAny>;
15
+ attributeValues: z.ZodRecord<z.ZodString, z.ZodUnknown>;
16
16
  similarProducts: z.ZodOptional<z.ZodObject<{
17
17
  items: z.ZodArray<z.ZodObject<{
18
18
  id: z.ZodNumber;
@@ -30,7 +30,7 @@ export declare const BlockEntitySchema: z.ZodObject<{
30
30
  }, z.core.$strip>;
31
31
  sku: z.ZodNullable<z.ZodString>;
32
32
  isSync: z.ZodBoolean;
33
- attributeValues: z.ZodRecord<z.ZodString, z.ZodAny>;
33
+ attributeValues: z.ZodRecord<z.ZodString, z.ZodUnknown>;
34
34
  categories: z.ZodArray<z.ZodString>;
35
35
  isVisible: z.ZodBoolean;
36
36
  moduleFormConfigs: z.ZodOptional<z.ZodArray<z.ZodAny>>;
@@ -73,7 +73,7 @@ export declare const BlockEntitySchema: z.ZodObject<{
73
73
  }, z.core.$strip>;
74
74
  sku: z.ZodNullable<z.ZodString>;
75
75
  isSync: z.ZodBoolean;
76
- attributeValues: z.ZodRecord<z.ZodString, z.ZodAny>;
76
+ attributeValues: z.ZodRecord<z.ZodString, z.ZodUnknown>;
77
77
  categories: z.ZodArray<z.ZodString>;
78
78
  isVisible: z.ZodBoolean;
79
79
  moduleFormConfigs: z.ZodOptional<z.ZodArray<z.ZodAny>>;
@@ -109,7 +109,7 @@ export declare const BlocksResponseSchema: z.ZodObject<{
109
109
  type: z.ZodString;
110
110
  templateIdentifier: z.ZodNullable<z.ZodString>;
111
111
  isVisible: z.ZodBoolean;
112
- attributeValues: z.ZodRecord<z.ZodString, z.ZodAny>;
112
+ attributeValues: z.ZodRecord<z.ZodString, z.ZodUnknown>;
113
113
  similarProducts: z.ZodOptional<z.ZodObject<{
114
114
  items: z.ZodArray<z.ZodObject<{
115
115
  id: z.ZodNumber;
@@ -127,7 +127,7 @@ export declare const BlocksResponseSchema: z.ZodObject<{
127
127
  }, z.core.$strip>;
128
128
  sku: z.ZodNullable<z.ZodString>;
129
129
  isSync: z.ZodBoolean;
130
- attributeValues: z.ZodRecord<z.ZodString, z.ZodAny>;
130
+ attributeValues: z.ZodRecord<z.ZodString, z.ZodUnknown>;
131
131
  categories: z.ZodArray<z.ZodString>;
132
132
  isVisible: z.ZodBoolean;
133
133
  moduleFormConfigs: z.ZodOptional<z.ZodArray<z.ZodAny>>;
@@ -170,7 +170,7 @@ export declare const BlocksResponseSchema: z.ZodObject<{
170
170
  }, z.core.$strip>;
171
171
  sku: z.ZodNullable<z.ZodString>;
172
172
  isSync: z.ZodBoolean;
173
- attributeValues: z.ZodRecord<z.ZodString, z.ZodAny>;
173
+ attributeValues: z.ZodRecord<z.ZodString, z.ZodUnknown>;
174
174
  categories: z.ZodArray<z.ZodString>;
175
175
  isVisible: z.ZodBoolean;
176
176
  moduleFormConfigs: z.ZodOptional<z.ZodArray<z.ZodAny>>;
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ import { AttributeValuesSchema } from '../base/validation.js';
2
3
  import { ProductEntitySchema, ProductsResponseSchema, } from '../products/productsSchemas.js';
3
4
  /**
4
5
  * Block entity schema
@@ -13,7 +14,7 @@ export const BlockEntitySchema = z.object({
13
14
  type: z.string(),
14
15
  templateIdentifier: z.string().nullable(),
15
16
  isVisible: z.boolean(),
16
- attributeValues: z.record(z.string(), z.any()),
17
+ attributeValues: AttributeValuesSchema,
17
18
  similarProducts: ProductsResponseSchema.optional(),
18
19
  countElementsPerRow: z.number().optional(),
19
20
  quantity: z.number().optional(),
@@ -29,7 +29,7 @@ interface IDiscountsApi {
29
29
  * @throws {IError} When isShell=false and an error occurs during the fetch
30
30
  * @description Fetches a discount by its marker.
31
31
  */
32
- getDiscountByMarker(marker: string, langCode: string): Promise<IDiscountsEntity | IError>;
32
+ getDiscountByMarker(marker: string, langCode?: string): Promise<IDiscountsEntity | IError>;
33
33
  /**
34
34
  * Validate discounts coupon
35
35
  * @handleName validateDiscountsCoupon
@@ -134,6 +134,7 @@ interface IDiscountCondition {
134
134
  * @property {Record<string, unknown>} [bonusEvent] - Bonus event configuration.
135
135
  * @property {number} [position] - Position number for sorting. Example: 1.
136
136
  * @property {number | string} [total] - Total count of related entries. Example: "1".
137
+ * @property {number} [distance] - Cosine distance to the query. Returned only by the semantic (vector) search endpoint when `debug: true` is passed in the search body. Example: 0.12.
137
138
  */
138
139
  interface IDiscountsEntity {
139
140
  id: number;
@@ -157,6 +158,7 @@ interface IDiscountsEntity {
157
158
  bonusEvent?: Record<string, unknown> | null;
158
159
  position?: number;
159
160
  total?: number | string;
161
+ distance?: number;
160
162
  }
161
163
  /**
162
164
  * @interface IDiscountValue
@@ -1,7 +1,7 @@
1
1
  import AsyncModules from '../base/asyncModules.js';
2
2
  import type StateModule from '../base/stateModule.js';
3
3
  import type { IError } from '../base/utils.js';
4
- import type { IBodyPostFormData, IFormsByMarkerDataEntity, IFormsData, IFormsDataSearchResponse, IFormsDataVectorSearch, IPostFormResponse, IUpdateFormsData } from './formsDataInterfaces.js';
4
+ import type { IBodyPostFormData, IFormsByMarkerDataEntity, IFormsData, IFormsDataFilter, IFormsDataSearchResponse, IFormsDataVectorSearch, IPostFormResponse, IUpdateFormsData } from './formsDataInterfaces.js';
5
5
  /**
6
6
  * Controllers for working with form data
7
7
  * @handle /api/content/form-data
@@ -56,6 +56,7 @@ export default class FormsDataApi extends AsyncModules implements IFormsData {
56
56
  * @param {string} [langCode] - Language code. Default: "en_US".
57
57
  * @returns {Promise<IPostFormResponse | IError>} Returns an object containing the created form data entry and message.
58
58
  * @throws {IError} When isShell=false and an error occurs during the fetch
59
+ * @description Field values are typed per field type by {@link FormDataType}. For attached files see {@link IImageValue} (`image`, `groupOfImages`) and {@link IFileValue} (`file`) — the shape the endpoint expects, which is **not** what `FileUploading.upload` returns: that object carries `contentType`, which form data rejects. Passing a `File`/`FileList` as the value is also supported — the SDK uploads it first, then strips `contentType` from the resulting value.
59
60
  * @see {@link https://js-sdk.oneentry.cloud/docs/forms-data/postFormsData postFormsData} documentation.
60
61
  */
61
62
  postFormsData(body: IBodyPostFormData, langCode?: string): Promise<IPostFormResponse | IError>;
@@ -64,25 +65,34 @@ export default class FormsDataApi extends AsyncModules implements IFormsData {
64
65
  * @handleName getFormsDataByMarker
65
66
  * @param {string} marker - Marker of the form. Example: "contact_form".
66
67
  * @param {number} formModuleConfigId - Form module configuration ID. Example: 4.
67
- * @param {object} [body] - Request body.
68
+ * @param {IFormsDataFilter} [body] - Filter for the records to return. Every field is optional; an omitted or empty one is not applied.
68
69
  * @example
69
70
  {
70
- "entityIdentifier": 14,
71
- "entityparentIdentifier": 167,
71
+ "entityIdentifier": "blog",
72
+ "parentId": 10,
72
73
  "userIdentifier": "",
73
- "status": ["new", "approved"],
74
+ "status": ["moderation", "approved"],
74
75
  "dateFrom": "2025-01-01",
75
76
  "dateTo": ""
76
77
  }
78
+ * @param {string} [body.entityIdentifier] - Text identifier (marker) of the entity the records belong to. Example: "blog".
79
+ * @param {number} [body.parentId] - Identifier of the parent record, to fetch replies to one submission. Example: 10.
80
+ * @param {string} [body.userIdentifier] - Text identifier of the sender. Example: "admin".
81
+ * @param {FormDataStatus[]} [body.status] - Moderation statuses to keep: "sent", "moderation", "approved", "banned", "deleted". Must be an array; anything outside the set is rejected with `400 each value in status must be a valid enum value`. Example: ["approved"].
82
+ * @param {string} [body.dateFrom] - Lower bound of the submission date, `YYYY-MM-DD`. An unparsable value fails the request with a `500`. Example: "2025-01-01".
83
+ * @param {string} [body.dateTo] - Upper bound of the submission date, `YYYY-MM-DD`. Example: "2025-12-31".
77
84
  * @param {number} [isExtended] - Flag for getting additional fields. Example: 1.
78
85
  * @param {string} [langCode] - Language code. Default: "en_US".
79
86
  * @param {number} [offset] - Parameter for pagination. Default: 0.
80
87
  * @param {number} [limit] - Parameter for pagination. Default: 30.
81
88
  * @returns {Promise<IFormsByMarkerDataEntity | IError>} Returns an object containing the form data or an error object if there was an issue.
82
89
  * @throws {IError} When isShell=false and an error occurs during the fetch
90
+ * @description Each record's `formData` comes back **already unwrapped from its locale**. The API sends `formData: { "en_US": [ … ] }`; the SDK normalizes the response and hands over the array for `langCode`, so read `record.formData` — `record.formData[langCode]` is `undefined` and yields an empty list with no error. This holds for both values of `isExtended`.
91
+ *
92
+ * The filter body is typed for a reason: the API silently ignores a field it does not know, so a misspelled `statuses` returns every record — unmoderated ones included — and the code looks like it works.
83
93
  * @see {@link https://js-sdk.oneentry.cloud/docs/forms-data/getFormsDataByMarker getFormsDataByMarker} documentation.
84
94
  */
85
- getFormsDataByMarker(marker: string, formModuleConfigId: number, body?: object, isExtended?: number, langCode?: string, offset?: number, limit?: number): Promise<IFormsByMarkerDataEntity | IError>;
95
+ getFormsDataByMarker(marker: string, formModuleConfigId: number, body?: IFormsDataFilter, isExtended?: number, langCode?: string, offset?: number, limit?: number): Promise<IFormsByMarkerDataEntity | IError>;
86
96
  /**
87
97
  * Update one object of form data by id. Requires user authentication.
88
98
  * @handleName updateFormsDataByid
@@ -58,6 +58,7 @@ export default class FormsDataApi extends AsyncModules {
58
58
  * @param {string} [langCode] - Language code. Default: "en_US".
59
59
  * @returns {Promise<IPostFormResponse | IError>} Returns an object containing the created form data entry and message.
60
60
  * @throws {IError} When isShell=false and an error occurs during the fetch
61
+ * @description Field values are typed per field type by {@link FormDataType}. For attached files see {@link IImageValue} (`image`, `groupOfImages`) and {@link IFileValue} (`file`) — the shape the endpoint expects, which is **not** what `FileUploading.upload` returns: that object carries `contentType`, which form data rejects. Passing a `File`/`FileList` as the value is also supported — the SDK uploads it first, then strips `contentType` from the resulting value.
61
62
  * @see {@link https://js-sdk.oneentry.cloud/docs/forms-data/postFormsData postFormsData} documentation.
62
63
  */
63
64
  async postFormsData(body, langCode = this.state.lang) {
@@ -126,22 +127,31 @@ export default class FormsDataApi extends AsyncModules {
126
127
  * @handleName getFormsDataByMarker
127
128
  * @param {string} marker - Marker of the form. Example: "contact_form".
128
129
  * @param {number} formModuleConfigId - Form module configuration ID. Example: 4.
129
- * @param {object} [body] - Request body.
130
+ * @param {IFormsDataFilter} [body] - Filter for the records to return. Every field is optional; an omitted or empty one is not applied.
130
131
  * @example
131
132
  {
132
- "entityIdentifier": 14,
133
- "entityparentIdentifier": 167,
133
+ "entityIdentifier": "blog",
134
+ "parentId": 10,
134
135
  "userIdentifier": "",
135
- "status": ["new", "approved"],
136
+ "status": ["moderation", "approved"],
136
137
  "dateFrom": "2025-01-01",
137
138
  "dateTo": ""
138
139
  }
140
+ * @param {string} [body.entityIdentifier] - Text identifier (marker) of the entity the records belong to. Example: "blog".
141
+ * @param {number} [body.parentId] - Identifier of the parent record, to fetch replies to one submission. Example: 10.
142
+ * @param {string} [body.userIdentifier] - Text identifier of the sender. Example: "admin".
143
+ * @param {FormDataStatus[]} [body.status] - Moderation statuses to keep: "sent", "moderation", "approved", "banned", "deleted". Must be an array; anything outside the set is rejected with `400 each value in status must be a valid enum value`. Example: ["approved"].
144
+ * @param {string} [body.dateFrom] - Lower bound of the submission date, `YYYY-MM-DD`. An unparsable value fails the request with a `500`. Example: "2025-01-01".
145
+ * @param {string} [body.dateTo] - Upper bound of the submission date, `YYYY-MM-DD`. Example: "2025-12-31".
139
146
  * @param {number} [isExtended] - Flag for getting additional fields. Example: 1.
140
147
  * @param {string} [langCode] - Language code. Default: "en_US".
141
148
  * @param {number} [offset] - Parameter for pagination. Default: 0.
142
149
  * @param {number} [limit] - Parameter for pagination. Default: 30.
143
150
  * @returns {Promise<IFormsByMarkerDataEntity | IError>} Returns an object containing the form data or an error object if there was an issue.
144
151
  * @throws {IError} When isShell=false and an error occurs during the fetch
152
+ * @description Each record's `formData` comes back **already unwrapped from its locale**. The API sends `formData: { "en_US": [ … ] }`; the SDK normalizes the response and hands over the array for `langCode`, so read `record.formData` — `record.formData[langCode]` is `undefined` and yields an empty list with no error. This holds for both values of `isExtended`.
153
+ *
154
+ * The filter body is typed for a reason: the API silently ignores a field it does not know, so a misspelled `statuses` returns every record — unmoderated ones included — and the code looks like it works.
145
155
  * @see {@link https://js-sdk.oneentry.cloud/docs/forms-data/getFormsDataByMarker getFormsDataByMarker} documentation.
146
156
  */
147
157
  async getFormsDataByMarker(marker, formModuleConfigId, body = {}, isExtended = 0, langCode = this.state.lang, offset = 0, limit = 30) {
@@ -52,24 +52,24 @@ interface IFormsData {
52
52
  * @handleName getFormsDataByMarker
53
53
  * @param {string} marker - The marker identifying the form data. Example: "contact_form_data".
54
54
  * @param {number} formModuleConfigId - The form module configuration ID. Example: 4.
55
- * @param {object} [body] - Request body. Default: {}.
55
+ * @param {IFormsDataFilter} [body] - Filter for the records to return. Default: {}. Every field is optional; an omitted or empty one is not applied. Valid `status` values: "sent", "moderation", "approved", "banned", "deleted".
56
56
  * @example
57
57
  {
58
- "entityIdentifier": "test",
58
+ "entityIdentifier": "blog",
59
59
  "userIdentifier": "",
60
- "status": "",
60
+ "status": ["approved"],
61
61
  "dateFrom": "2025-08-11",
62
62
  "dateTo": ""
63
63
  }
64
- * @param {number} [isNested] - Flag for getting hierarchical data. Example: 1.
64
+ * @param {number} [isExtended] - Flag for getting additional fields. Example: 1.
65
65
  * @param {string} [langCode] - The language code for localization. Default: "en_US".
66
66
  * @param {number} [offset] - Optional offset for pagination. Default: 0.
67
67
  * @param {number} [limit] - Optional limit for pagination. Default: 30.
68
68
  * @returns {IFormsByMarkerDataEntity} A promise that resolves to a form data entity or an error.
69
69
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
70
- * @description This method retrieves form data by its marker.
70
+ * @description This method retrieves form data by its marker. Each record's `formData` is returned **already unwrapped from its locale**: the API sends `{ "en_US": [ … ] }`, the SDK hands over the array for `langCode` — read `record.formData`, not `record.formData[langCode]`.
71
71
  */
72
- getFormsDataByMarker(marker: string, formModuleConfigId: number, body?: object, isNested?: number, langCode?: string, offset?: number, limit?: number): Promise<IFormsByMarkerDataEntity | IError>;
72
+ getFormsDataByMarker(marker: string, formModuleConfigId: number, body?: IFormsDataFilter, isExtended?: number, langCode?: string, offset?: number, limit?: number): Promise<IFormsByMarkerDataEntity | IError>;
73
73
  /**
74
74
  * Semantic (vector) search for form data.
75
75
  * @handleName getFormsDataByVectorSearch
@@ -97,6 +97,39 @@ interface IFormsDataVectorSearch {
97
97
  maxHits?: number;
98
98
  debug?: boolean;
99
99
  }
100
+ /**
101
+ * FormDataStatus — moderation status of a form data record.
102
+ *
103
+ * The set the API accepts and returns: a submission arrives as `sent`, may be
104
+ * routed to `moderation`, and ends up `approved`, `banned` or `deleted`. Any
105
+ * other value is rejected with `400 each value in status must be a valid enum
106
+ * value` — an error that does not list the valid ones.
107
+ */
108
+ type FormDataStatus = 'sent' | 'moderation' | 'approved' | 'banned' | 'deleted';
109
+ /**
110
+ * Represents the filter body of `getFormsDataByMarker`.
111
+ * @interface IFormsDataFilter
112
+ * @property {string} [entityIdentifier] - Text identifier (marker) of the entity the records belong to; an empty string means "no filter". Example: "blog".
113
+ * @property {number} [parentId] - Identifier of the parent record — the way to fetch replies to one comment. Example: 10.
114
+ * @property {string} [userIdentifier] - Text identifier of the sender; an empty string means "no filter". Example: "admin".
115
+ * @property {FormDataStatus[]} [status] - Moderation statuses to keep. Must be an array — a bare string is rejected with `400`. An empty array means "no filter". Example: ["approved"].
116
+ * @property {string} [dateFrom] - Lower bound of the submission date, `YYYY-MM-DD`; an empty string means "no bound". A value the API cannot parse fails the request with a `500`. Example: "2025-01-01".
117
+ * @property {string} [dateTo] - Upper bound of the submission date, `YYYY-MM-DD`; an empty string means "no bound". Example: "2025-12-31".
118
+ * @description Filter for reading form submissions. Every field is optional and an omitted one is simply not applied.
119
+ *
120
+ * Typed rather than left as `object` on purpose: the API **ignores** a field it
121
+ * does not know, so `statuses: ['approved']` (note the "s") is not an error —
122
+ * it returns every record, unmoderated ones included. That is premoderation
123
+ * leaking onto a public page, from one typo the compiler used to accept.
124
+ */
125
+ interface IFormsDataFilter {
126
+ entityIdentifier?: string;
127
+ parentId?: number;
128
+ userIdentifier?: string;
129
+ status?: FormDataStatus[];
130
+ dateFrom?: string;
131
+ dateTo?: string;
132
+ }
100
133
  /**
101
134
  * Represents a form data record returned by the vector search endpoint.
102
135
  * @interface IFormDataSearchEntity
@@ -112,13 +145,15 @@ interface IFormsDataVectorSearch {
112
145
  "value": "Test"
113
146
  }
114
147
  ]
115
- * @property {string} [userIdentifier] - Text identifier of the user who submitted the form. Example: "user_12345".
116
- * @property {string} [entityIdentifier] - Text identifier of the entity the record belongs to. Example: "product_1".
117
- * @property {number} [parentId] - Identifier of the parent form data record. Example: 1.
148
+ * @property {string | null} [userIdentifier] - Text identifier of the user who submitted the form, or `null` for an anonymous submission. Example: null.
149
+ * @property {string} [entityIdentifier] - Text identifier of the entity the record belongs to. Example: "blog".
150
+ * @property {number | null} [parentId] - Identifier of the parent form data record, or `null` for a top-level record. Example: null.
118
151
  * @property {string} [ip] - IP address the form was submitted from. Example: "127.0.0.1".
119
152
  * @property {string} [fingerprint] - Device fingerprint of the sender. Example: "UQ_123456_abcdef".
120
153
  * @property {boolean} [isUserAdmin] - Whether the record was submitted by an admin. Example: false.
121
- * @property {'sent' | 'banned' | 'deleted' | 'moderation' | 'approved'} [status] - Moderation status of the record. Example: "sent".
154
+ * @property {FormDataStatus} [status] - Moderation status of the record. Example: "sent".
155
+ * @property {number} [formModuleId] - Identifier of the form module the record belongs to. Example: 2.
156
+ * @property {number} [distance] - Cosine distance to the query. Returned only when `debug: true` is passed in the search body. Example: 0.12.
122
157
  * @description This interface defines a form data record as returned by the semantic (vector) search endpoint. Unlike IFormDataEntity it carries the moderation and sender fields of the raw record.
123
158
  */
124
159
  interface IFormDataSearchEntity {
@@ -126,13 +161,15 @@ interface IFormDataSearchEntity {
126
161
  formIdentifier?: string;
127
162
  time?: Date | string;
128
163
  formData?: FormDataType[];
129
- userIdentifier?: string;
164
+ userIdentifier?: string | null;
130
165
  entityIdentifier?: string;
131
- parentId?: number;
166
+ parentId?: number | null;
132
167
  ip?: string;
133
168
  fingerprint?: string;
134
169
  isUserAdmin?: boolean;
135
- status?: 'sent' | 'banned' | 'deleted' | 'moderation' | 'approved';
170
+ status?: FormDataStatus;
171
+ formModuleId?: number;
172
+ distance?: number;
136
173
  }
137
174
  /**
138
175
  * @interface IFormsDataSearchResponse
@@ -150,7 +187,7 @@ interface IFormsDataSearchResponse {
150
187
  * @property {number} id - The unique identifier of the form page. Example: 12345.
151
188
  * @property {string} formIdentifier - The identifier of the page. Example: "contact_form".
152
189
  * @property {Date | string} time - The identifier of the form. Example: "2023-10-01T12:00:00Z".
153
- * @property {FormDataType[]} formData - Form data.
190
+ * @property {FormDataType[]} formData - Submitted fields, **already unwrapped from the locale**: the API returns `{ "en_US": [ … ] }` and the SDK hands over the array for the requested `langCode`.
154
191
  * @example
155
192
  [
156
193
  {
@@ -202,9 +239,9 @@ interface IFormsDataEntity {
202
239
  * @property {number} depth - Example: 1.
203
240
  * @property {string | null} ip - Ip. Example: '127.0.0.1'.
204
241
  * @property {string | null} fingerprint - Fingerprint. Example: 'fingerprint'.
205
- * @property {string | null} status - Status. Example: 'approved'.
242
+ * @property {string | null} status - Moderation status of the record: "sent", "moderation", "approved", "banned" or "deleted"; `null` when the form does not moderate. Example: 'approved'.
206
243
  * @property {string | null} userIdentifier - Text identifier (marker) of the user. Example: "admin".
207
- * @property {FormDataType[]} formData - Form data.
244
+ * @property {FormDataType[]} formData - Submitted fields, **already unwrapped from the locale**: the API returns `{ "en_US": [ … ] }` and the SDK hands over the array for the requested `langCode`. Read `formData` directly — `formData[langCode]` is `undefined`.
208
245
  * @example
209
246
  [
210
247
  {
@@ -543,7 +580,7 @@ interface ITextWithHeaderValue {
543
580
  * Represents an image or group of images form data entity.
544
581
  * @interface IBodyTypeImageGroupOfImages
545
582
  * @property {string} marker - marker name. Example: "avatar".
546
- * @property {'image' | 'groupOfImage'} type - Type value. Example: "image".
583
+ * @property {'image' | 'groupOfImages'} type - Type value — must match the attribute type in the set, note the plural in "groupOfImages". Example: "image".
547
584
  * @property {object} value - Image Object. Contains image information.
548
585
  * @example
549
586
  [
@@ -561,7 +598,7 @@ interface ITextWithHeaderValue {
561
598
  */
562
599
  interface IBodyTypeImageGroupOfImages {
563
600
  marker: string;
564
- type: 'image' | 'groupOfImage';
601
+ type: 'image' | 'groupOfImages';
565
602
  value: IImageValue | IImageValue[];
566
603
  }
567
604
  /**
@@ -579,7 +616,7 @@ interface IImageValueParams {
579
616
  * @property {number} size - File size in bytes. Example: 392585.
580
617
  * @property {string} previewLink - URL to a preview-sized version (may be empty).
581
618
  * @property {IImageValueParams} params - Image-specific parameters.
582
- * @description Value payload for `image`/`groupOfImage` form fields.
619
+ * @description Value payload for `image`/`groupOfImages` form fields. Note it is **not** the object `FileUploading.upload` returns: that one carries `contentType`, which the form-data endpoint rejects. Build the value from `filename`, `downloadLink`, `size` and `previewLink` (the SDK also strips `contentType` from an image value passed to `postFormsData`).
583
620
  */
584
621
  interface IImageValue {
585
622
  filename: string;
@@ -667,4 +704,4 @@ interface IListOptionValue {
667
704
  value: string;
668
705
  extended: IListOptionExtended;
669
706
  }
670
- export type { FormDataType, IBodyPostFormData, IBodyTypeFile, IBodyTypeImageGroupOfImages, IBodyTypeRadioButtonList, IBodyTypeStringNumberFloat, IBodyTypeText, IBodyTypeTextWithHeader, IBodyTypeTimeDate, IFileValue, IFormByMarkerDataEntity, IFormDataEntity, IFormDataSearchEntity, IFormsByMarkerDataEntity, IFormsData, IFormsDataEntity, IFormsDataSearchResponse, IFormsDataVectorSearch, IImageValue, IImageValueParams, IListOptionExtended, IListOptionValue, IPostFormResponse, IPostFormResponseData, ITextEditorParams, ITextValue, ITextWithHeaderValue, ITimeDateValue, IUpdateFormsData, };
707
+ export type { FormDataStatus, FormDataType, IBodyPostFormData, IBodyTypeFile, IBodyTypeImageGroupOfImages, IBodyTypeRadioButtonList, IBodyTypeStringNumberFloat, IBodyTypeText, IBodyTypeTextWithHeader, IBodyTypeTimeDate, IFileValue, IFormByMarkerDataEntity, IFormDataEntity, IFormDataSearchEntity, IFormsByMarkerDataEntity, IFormsData, IFormsDataEntity, IFormsDataFilter, IFormsDataSearchResponse, IFormsDataVectorSearch, IImageValue, IImageValueParams, IListOptionExtended, IListOptionValue, IPostFormResponse, IPostFormResponseData, ITextEditorParams, ITextValue, ITextWithHeaderValue, ITimeDateValue, IUpdateFormsData, };
package/esm/index.d.ts CHANGED
@@ -30,6 +30,7 @@ import TemplatePreviewsApi from './templates-preview/templatesPreviewApi.js';
30
30
  import UserActivityApi from './user-activity/userActivityApi.js';
31
31
  import UsersApi from './users/usersApi.js';
32
32
  import WsApi from './web-socket/wsApi.js';
33
+ export { getAdditionalFields, getAttributeFile, getAttributeFiles, isFileAttribute, isListAttribute, isNumberAttribute, isStringAttribute, } from './base/attributes.js';
33
34
  export { expandAttributeTimeIntervals, expandTimeIntervals, isTimeIntervalAttribute, } from './base/timeIntervals.js';
34
35
  export type * from './types.js';
35
36
  /**
package/esm/index.js CHANGED
@@ -30,6 +30,7 @@ import TemplatePreviewsApi from './templates-preview/templatesPreviewApi.js';
30
30
  import UserActivityApi from './user-activity/userActivityApi.js';
31
31
  import UsersApi from './users/usersApi.js';
32
32
  import WsApi from './web-socket/wsApi.js';
33
+ export { getAdditionalFields, getAttributeFile, getAttributeFiles, isFileAttribute, isListAttribute, isNumberAttribute, isStringAttribute, } from './base/attributes.js';
33
34
  export { expandAttributeTimeIntervals, expandTimeIntervals, isTimeIntervalAttribute, } from './base/timeIntervals.js';
34
35
  /**
35
36
  * Define API.