oneentry 1.0.137 → 1.0.138

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 (70) hide show
  1. package/dist/admins/adminsApi.d.ts +2 -2
  2. package/dist/admins/adminsApi.js +2 -2
  3. package/dist/admins/adminsInterfaces.d.ts +1 -1
  4. package/dist/attribute-sets/attributeSetsApi.d.ts +8 -8
  5. package/dist/attribute-sets/attributeSetsApi.js +8 -8
  6. package/dist/attribute-sets/attributeSetsInterfaces.d.ts +3 -3
  7. package/dist/auth-provider/authProviderApi.d.ts +33 -33
  8. package/dist/auth-provider/authProviderApi.js +33 -33
  9. package/dist/auth-provider/authProvidersInterfaces.d.ts +12 -62
  10. package/dist/base/asyncModules.js +4 -50
  11. package/dist/base/stateModule.d.ts +1 -0
  12. package/dist/base/stateModule.js +16 -15
  13. package/dist/base/syncModules.d.ts +6 -0
  14. package/dist/base/syncModules.js +48 -5
  15. package/dist/base/utils.d.ts +15 -8
  16. package/dist/blocks/blocksApi.d.ts +10 -10
  17. package/dist/blocks/blocksApi.js +10 -10
  18. package/dist/blocks/blocksInterfaces.d.ts +1 -0
  19. package/dist/events/eventsApi.d.ts +5 -5
  20. package/dist/events/eventsApi.js +5 -5
  21. package/dist/events/eventsInterfaces.d.ts +25 -15
  22. package/dist/file-uploading/fileUploadingApi.d.ts +6 -6
  23. package/dist/file-uploading/fileUploadingApi.js +6 -6
  24. package/dist/forms/formsApi.d.ts +4 -4
  25. package/dist/forms/formsApi.js +4 -4
  26. package/dist/forms/formsInterfaces.d.ts +1 -0
  27. package/dist/forms-data/formsDataApi.d.ts +10 -10
  28. package/dist/forms-data/formsDataApi.js +10 -10
  29. package/dist/forms-data/formsDataInterfaces.d.ts +24 -24
  30. package/dist/forms-data/formsDataSchemas.d.ts +36 -28
  31. package/dist/forms-data/formsDataSchemas.js +16 -13
  32. package/dist/general-types/generalTypesApi.d.ts +2 -2
  33. package/dist/general-types/generalTypesApi.js +2 -2
  34. package/dist/index.d.ts +23 -1
  35. package/dist/integration-collections/integrationCollectionsApi.d.ts +17 -17
  36. package/dist/integration-collections/integrationCollectionsApi.js +17 -17
  37. package/dist/locales/localesApi.d.ts +2 -2
  38. package/dist/locales/localesApi.js +2 -2
  39. package/dist/menus/menusApi.d.ts +2 -2
  40. package/dist/menus/menusApi.js +2 -2
  41. package/dist/menus/menusInterfaces.d.ts +2 -2
  42. package/dist/orders/ordersApi.d.ts +12 -12
  43. package/dist/orders/ordersApi.js +12 -12
  44. package/dist/orders/ordersInterfaces.d.ts +2 -1
  45. package/dist/pages/pagesApi.d.ts +20 -20
  46. package/dist/pages/pagesApi.js +20 -20
  47. package/dist/pages/pagesInterfaces.d.ts +10 -7
  48. package/dist/payments/paymentsApi.d.ts +13 -13
  49. package/dist/payments/paymentsApi.js +12 -12
  50. package/dist/payments/paymentsInterfaces.d.ts +8 -2
  51. package/dist/payments/paymentsSchemas.d.ts +22 -6
  52. package/dist/payments/paymentsSchemas.js +6 -3
  53. package/dist/product-statuses/productStatusesApi.d.ts +6 -6
  54. package/dist/product-statuses/productStatusesApi.js +6 -6
  55. package/dist/products/productsApi.d.ts +29 -28
  56. package/dist/products/productsApi.js +31 -30
  57. package/dist/products/productsInterfaces.d.ts +26 -21
  58. package/dist/system/systemApi.d.ts +10 -10
  59. package/dist/system/systemApi.js +10 -10
  60. package/dist/templates/templatesApi.d.ts +6 -6
  61. package/dist/templates/templatesApi.js +6 -6
  62. package/dist/templates-preview/templatesPreviewApi.d.ts +3 -3
  63. package/dist/templates-preview/templatesPreviewApi.js +3 -3
  64. package/dist/templates-preview/templatesPreviewInterfaces.d.ts +1 -0
  65. package/dist/users/usersApi.d.ts +18 -18
  66. package/dist/users/usersApi.js +18 -18
  67. package/dist/users/usersInterfaces.d.ts +8 -10
  68. package/package.json +34 -11
  69. package/dist/config.d.ts +0 -21
  70. package/dist/config.js +0 -48
@@ -22,8 +22,8 @@ class ProductApi extends asyncModules_1.default {
22
22
  this._defaultQuery = {
23
23
  offset: 0,
24
24
  limit: 30,
25
- sortOrder: null,
26
- sortKey: null,
25
+ sortOrder: 'DESC',
26
+ sortKey: 'id',
27
27
  };
28
28
  this._url = state.url + '/api/content/products';
29
29
  }
@@ -59,18 +59,19 @@ class ProductApi extends asyncModules_1.default {
59
59
  * @param {IProductsQuery} [userQuery] - Optional set query parameters.
60
60
  * @example
61
61
  {
62
- "limit": 30,
63
- "offset": 0,
62
+ "signPrice": "orders",
64
63
  "sortOrder": "DESC",
65
64
  "sortKey": "id",
65
+ "limit": 30,
66
+ "offset": 0,
66
67
  "statusId": 123,
67
68
  "statusMarker": "in_stock",
68
69
  "conditionValue": "new",
69
70
  "conditionMarker": "equals",
70
71
  "attributeMarker": "color"
71
72
  }
72
- * @returns {IProductsResponse} Array with ProductEntity objects
73
- * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
73
+ * @returns {Promise<IProductsResponse | IError>} Products response, or IError when isShell=true
74
+ * @throws {IError} When isShell=false and an error occurs during the fetch
74
75
  * @description Fetch products with optional filters and pagination.
75
76
  */
76
77
  async getProducts(body = [], langCode = this.state.lang, userQuery) {
@@ -101,8 +102,8 @@ class ProductApi extends asyncModules_1.default {
101
102
  "conditionMarker": "equals",
102
103
  "attributeMarker": "color"
103
104
  }
104
- * @returns {IProductsResponse} Array with ProductEntity objects.
105
- * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
105
+ * @returns {Promise<IProductsResponse | IError>} Array with ProductEntity objects.
106
+ * @throws {IError} When isShell=false and an error occurs during the fetch
106
107
  * @description Search for all product page objects with pagination that do not have a category.
107
108
  */
108
109
  async getProductsEmptyPage(langCode = this.state.lang, userQuery) {
@@ -155,8 +156,8 @@ class ProductApi extends asyncModules_1.default {
155
156
  "conditionMarker": "equals",
156
157
  "attributeMarker": "color"
157
158
  }
158
- * @returns {IProductsResponse} Array with ProductEntity objects
159
- * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
159
+ * @returns {Promise<IProductsResponse | IError>} Array with ProductEntity objects
160
+ * @throws {IError} When isShell=false and an error occurs during the fetch
160
161
  * @description Fetch products by page ID with optional filters and pagination.
161
162
  */
162
163
  async getProductsByPageId(id, body = [], langCode = this.state.lang, userQuery) {
@@ -184,8 +185,8 @@ class ProductApi extends asyncModules_1.default {
184
185
  "conditionMarker": "equals",
185
186
  "attributeMarker": "color"
186
187
  }
187
- * @returns {IProductsInfo} Array with ProductInformation objects.
188
- * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
188
+ * @returns {Promise<IProductsInfo | IError>} Array with ProductInformation objects.
189
+ * @throws {IError} When isShell=false and an error occurs during the fetch
189
190
  * @description Search for information about products and prices for the selected category.
190
191
  */
191
192
  async getProductsPriceByPageUrl(url, langCode = this.state.lang, userQuery) {
@@ -240,8 +241,8 @@ class ProductApi extends asyncModules_1.default {
240
241
  "conditionMarker": "equals",
241
242
  "attributeMarker": "color"
242
243
  }
243
- * @returns {IProductsResponse} Array with ProductEntity objects.
244
- * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
244
+ * @returns {Promise<IProductsResponse | IError>} Array with ProductEntity objects.
245
+ * @throws {IError} When isShell=false and an error occurs during the fetch
245
246
  * @description Search for all products with pagination for the selected category.
246
247
  */
247
248
  async getProductsByPageUrl(url, body = [], langCode = this.state.lang, userQuery) {
@@ -274,8 +275,8 @@ class ProductApi extends asyncModules_1.default {
274
275
  * @param {number} [userQuery.offset] - Optional parameter for pagination. Default: 0.
275
276
  * @param {string} [userQuery.sortOrder] - Optional sorting order "DESC" | "ASC". Example: "DESC".
276
277
  * @param {string} [userQuery.sortKey] - Optional field to sort by ("id", "title", "date", "price", "position", "status"). Example: "id".
277
- * @returns {IProductsResponse} Array with ProductEntity objects
278
- * @throws {IError} If there is an error during the fetch operation, it will return an error object.
278
+ * @returns {Promise<IProductsResponse | IError>} Array with ProductEntity objects
279
+ * @throws {IError} When isShell=false and an error occurs during the fetch
279
280
  * @description Find all related product page objects.
280
281
  */
281
282
  async getRelatedProductsById(id, langCode = this.state.lang, userQuery) {
@@ -312,8 +313,8 @@ class ProductApi extends asyncModules_1.default {
312
313
  * @param {string} [userQuery.conditionValue] - Optional value that is being searched. Example: "new".
313
314
  * @param {string} [userQuery.conditionMarker] - Optional identifier of the filter condition by which values are filtered. Example: "equals".
314
315
  * @param {string} [userQuery.attributeMarker] - Optional text identifier of the indexed attribute by which values are filtered. Example: "color".
315
- * @returns {IProductsEntity[]} Array with ProductEntity objects
316
- * @throws {IError} If there is an error during the fetch operation, it will return an error object.
316
+ * @returns {Promise<IProductsEntity[] | IError>} Array with ProductEntity objects
317
+ * @throws {IError} When isShell=false and an error occurs during the fetch
317
318
  * @description Find products by its ids.
318
319
  */
319
320
  async getProductsByIds(ids, langCode = this.state.lang, userQuery) {
@@ -331,8 +332,8 @@ class ProductApi extends asyncModules_1.default {
331
332
  * @handleName getProductById
332
333
  * @param {number} id - Product id. Example: 12345.
333
334
  * @param {string} [langCode] - Language code. Default: "en_US".
334
- * @returns {IProductsEntity} ProductEntity object.
335
- * @throws {IError} If there is an error during the fetch operation, it will return an error object.
335
+ * @returns {Promise<IProductsEntity | IError>} ProductEntity object.
336
+ * @throws {IError} When isShell=false and an error occurs during the fetch
336
337
  * @description Retrieve one product object.
337
338
  */
338
339
  async getProductById(id, langCode = this.state.lang) {
@@ -345,8 +346,8 @@ class ProductApi extends asyncModules_1.default {
345
346
  * Getting a product block object by product id.
346
347
  * @handleName getProductBlockById
347
348
  * @param {number} id - Product id. Example: 12345.
348
- * @returns {IProductBlock} - Product block object.
349
- * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
349
+ * @returns {Promise<IProductBlock | IError>} - Product block object.
350
+ * @throws {IError} When isShell=false and an error occurs during the fetch
350
351
  * @description Getting a product block object by product id.
351
352
  */
352
353
  async getProductBlockById(id) {
@@ -358,8 +359,8 @@ class ProductApi extends asyncModules_1.default {
358
359
  * @handleName searchProduct
359
360
  * @param {string} name - Text to search product page objects (search is based on the title field of the localizeInfos object with language consideration). Example: "laminat".
360
361
  * @param {string} [langCode] - Language code. Default: "en_US".
361
- * @returns {IProductsEntity[]} Array with ProductEntity objects
362
- * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
362
+ * @returns {Promise<IProductsEntity[] | IError>} Array with ProductEntity objects
363
+ * @throws {IError} When isShell=false and an error occurs during the fetch
363
364
  * @description Quick search for product page objects with limited output.
364
365
  */
365
366
  async searchProduct(name, langCode = this.state.lang) {
@@ -393,8 +394,8 @@ class ProductApi extends asyncModules_1.default {
393
394
  "title": "Iphone 17 Pro"
394
395
  }
395
396
  ]
396
- * @returns {IProductsCount} Object with product items count.
397
- * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
397
+ * @returns {Promise<IProductsCount | IError>} Object with product items count.
398
+ * @throws {IError} When isShell=false and an error occurs during the fetch
398
399
  * @description This method calculates and returns the total number of products present across the entire catalog, optionally applying specified filters.
399
400
  */
400
401
  async getProductsCount(
@@ -421,8 +422,8 @@ class ProductApi extends asyncModules_1.default {
421
422
  "title": "Iphone 17 Pro"
422
423
  }
423
424
  ]
424
- * @returns {IProductsCount} Object with product items count.
425
- * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
425
+ * @returns {Promise<IProductsCount | IError>} Object with product items count.
426
+ * @throws {IError} When isShell=false and an error occurs during the fetch
426
427
  * @description This method calculates and returns the number of products available on a given catalog page, identified by its page ID, with optional filtering.
427
428
  */
428
429
  async getProductsCountByPageId(id,
@@ -449,8 +450,8 @@ class ProductApi extends asyncModules_1.default {
449
450
  "title": "Iphone 17 Pro"
450
451
  }
451
452
  ]
452
- * @returns {IProductsCount} Object with product items count.
453
- * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
453
+ * @returns {Promise<IProductsCount | IError>} Object with product items count.
454
+ * @throws {IError} When isShell=false and an error occurs during the fetch
454
455
  * @description This method calculates and returns the number of products available on a given catalog page, identified by its URL, with optional filtering.
455
456
  */
456
457
  async getProductsCountByPageUrl(url,
@@ -1,5 +1,5 @@
1
- import type { IFormConfig } from 'forms/formsInterfaces';
2
1
  import type { AttributeType, IError, ILocalizeInfo, LangType, Types } from '../base/utils';
2
+ import type { IFormConfig } from '../forms/formsInterfaces';
3
3
  /**
4
4
  * @interface IProductApi
5
5
  * @property {Function} getProducts - Search for all product page objects with pagination and filtering.
@@ -235,7 +235,7 @@ interface IProductApi {
235
235
  /**
236
236
  * Getting the number of products for the entire catalog.
237
237
  * @handleName getProductsCount
238
- * @param {string} [body] - Body parameters for filter. Deault: [].
238
+ * @param {object[]} [body] - Body parameters for filter. Deault: [].
239
239
  * @example
240
240
  [
241
241
  {
@@ -263,12 +263,12 @@ interface IProductApi {
263
263
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
264
264
  * @description This method calculates and returns the total number of products present across the entire catalog, optionally applying specified filters.
265
265
  */
266
- getProductsCount(body?: any): Promise<IProductsCount | IError>;
266
+ getProductsCount(body?: object[]): Promise<IProductsCount | IError>;
267
267
  /**
268
268
  * Getting the number of products on a catalog page by page ID.
269
269
  * @handleName getProductsCountByPageId
270
270
  * @param {string} id - Page id. Example: 12345.
271
- * @param {string} body - Body parameters for filter. Deault: [].
271
+ * @param {object[]} body - Body parameters for filter. Deault: [].
272
272
  * @example
273
273
  [
274
274
  {
@@ -296,7 +296,7 @@ interface IProductApi {
296
296
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
297
297
  * @description This method calculates and returns the number of products available on a given catalog page, identified by its page ID, with optional filtering.
298
298
  */
299
- getProductsCountByPageId(id: string, body?: any): Promise<IProductsCount | IError>;
299
+ getProductsCountByPageId(id: string, body?: object[]): Promise<IProductsCount | IError>;
300
300
  /**
301
301
  * Getting the number of products on a catalog page by page URL.
302
302
  * @handleName getProductsCountByPageUrl
@@ -329,7 +329,7 @@ interface IProductApi {
329
329
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
330
330
  * @description This method calculates and returns the number of products available on a given catalog page, identified by its URL, with optional filtering.
331
331
  */
332
- getProductsCountByPageUrl(url: string, body?: any): Promise<IProductsCount | IError>;
332
+ getProductsCountByPageUrl(url: string, body?: object[]): Promise<IProductsCount | IError>;
333
333
  }
334
334
  /**
335
335
  * @interface IProductsQuery
@@ -337,6 +337,7 @@ interface IProductApi {
337
337
  * @property {number} limit - Parameter for pagination. Default: 30.
338
338
  * @property {string} sortOrder - Sort order "DESC" | "ASC". Default: "DESC".
339
339
  * @property {string} sortKey - Field for sorting (default - null). Possible values: "id", "position", "title", "date", "price". Default: null.
340
+ * @property {string} [signPrice] - Price sign. Default: null.
340
341
  * @property {string | null} [templateMarker] - Product page template marker, default null. Example: "template_12345".
341
342
  * @property {string | null} [statusMarker] - Product page status marker, default null. Example: "in_stock".
342
343
  * @property {string | null} [conditionValue] - The value that is being searched for, default null. Example: "new".
@@ -349,6 +350,7 @@ interface IProductsQuery {
349
350
  limit: number;
350
351
  sortOrder: 'DESC' | 'ASC' | null;
351
352
  sortKey: 'id' | 'position' | 'title' | 'date' | 'price' | null;
353
+ signPrice?: string;
352
354
  templateMarker?: string | null;
353
355
  statusMarker?: string | null;
354
356
  conditionValue?: string | null;
@@ -381,12 +383,10 @@ interface IFilterParams {
381
383
  * @property {number} id - The unique identifier. Example: 12345.
382
384
  * @property {ILocalizeInfo} localizeInfos - The name of the products, taking into account localization. Example: {}.
383
385
  * @property {string | null} statusIdentifier - Product page status identifiers (may be null). Example: "in_stock".
384
- * @property {any} statusLocalizeInfos - JSON description of the item status object, taking into account the language. Example: {}.
386
+ * @property {Record<string, any>} statusLocalizeInfos - JSON description of the item status object, taking into account the language. Example: {}.
385
387
  * @property {string | null} attributeSetIdentifier - Set of attributes id. Example: "set_12345".
386
388
  * @property {number} position - Item number (for sorting). Example: 1.
387
- * @property {string | null} [templateIdentifier] - User id of the linked template. Example: "template_12345".
388
- * @property {string | null} [shortDescTemplateIdentifier] - User id of the linked template for a short description. Example: "short_desc_template_12345".
389
- * @property {number} price - The value of the product page price taken from the index. Example: 150.00.
389
+ * @property {number | null} price - The value of the product page price taken from the index. Example: 150.00.
390
390
  * @property {object} additional - Additional value from the index.
391
391
  * @example
392
392
  {
@@ -394,7 +394,7 @@ interface IFilterParams {
394
394
  "de": "Auf Lager"
395
395
  }
396
396
  * @property {string | null} sku - Product SKU (Stock Keeping Unit), may be null. Example: "SKU_12345".
397
- * @property {boolean} isSync - Indication of page indexing. Example: true.
397
+ * @property {number | boolean} isSync - Indication of page indexing. Example: true.
398
398
  * @property {AttributeType} attributeValues - Array of attribute values from the index, represented.
399
399
  * @example
400
400
  [
@@ -411,13 +411,7 @@ interface IFilterParams {
411
411
  3
412
412
  ]
413
413
  * @property {boolean} isVisible - A sign of page visibility. Example: true.
414
- * @property {any} [productPages] - Array of product pages or a single product page object. Example: [].
415
- * @property {string[]} [blocks] - Array of block identifiers.
416
- * @example
417
- [
418
- "block_12345",
419
- "block_67890"
420
- ]
414
+ * @property {Array<IFormConfig>} [moduleFormConfigs] - Module form configurations (optional).
421
415
  * @property {boolean} isPositionLocked - Sorting position lock indicator (optional). Example: false.
422
416
  * @property {number[]} relatedIds - Ids of related product pages.
423
417
  * @example
@@ -425,6 +419,16 @@ interface IFilterParams {
425
419
  12345,
426
420
  67890
427
421
  ]
422
+ * @property {string | null} [templateIdentifier] - User id of the linked template. Example: "template_12345".
423
+ * @property {string | null} [shortDescTemplateIdentifier] - User id of the linked template for a short description. Example: "short_desc_template_12345".
424
+ * @property {string} [signedPrice] - Price sign.
425
+ * @property {Array<Record<string, any>> | Record<string, any>} [productPages] - Array of product pages or a single product page object. Example: [].
426
+ * @property {string[]} [blocks] - Array of block identifiers.
427
+ * @example
428
+ [
429
+ "block_12345",
430
+ "block_67890"
431
+ ]
428
432
  * @description This interface defines the structure of a product entity, including its identifiers, attributes, and related information.
429
433
  */
430
434
  interface IProductsEntity {
@@ -433,10 +437,7 @@ interface IProductsEntity {
433
437
  statusIdentifier: string | null;
434
438
  statusLocalizeInfos: Record<string, any>;
435
439
  attributeSetIdentifier: string | null;
436
- moduleFormConfigs?: Array<IFormConfig>;
437
440
  position: number;
438
- templateIdentifier?: string | null;
439
- shortDescTemplateIdentifier?: string | null;
440
441
  price: number | null;
441
442
  additional: {
442
443
  prices: {
@@ -449,6 +450,10 @@ interface IProductsEntity {
449
450
  attributeValues: AttributeType;
450
451
  categories: string[];
451
452
  isVisible: boolean;
453
+ moduleFormConfigs?: Array<IFormConfig>;
454
+ templateIdentifier?: string | null;
455
+ shortDescTemplateIdentifier?: string | null;
456
+ signedPrice?: string;
452
457
  productPages?: Array<Record<string, any>> | Record<string, any>;
453
458
  blocks?: string[];
454
459
  isPositionLocked?: boolean;
@@ -19,22 +19,22 @@ export default class SystemApi extends AsyncModules implements ISystem {
19
19
  /**
20
20
  * Sends a GET request to the '/test404' endpoint and returns the result.
21
21
  * @handleName test404
22
- * @returns {any} The response from the server after fetching data from the '/test404' endpoint.
23
- * @throws {IError} If there is an error during the fetch operation, it will return an error object.
22
+ * @returns {Promise<any | IError>} The response from the server after fetching data from the '/test404' endpoint.
23
+ * @throws {IError} When isShell=false and an error occurs during the fetch
24
24
  * @description This method is used to test the 404 error handling by sending a GET request to a specific endpoint.
25
25
  */
26
26
  test404(): Promise<any | IError>;
27
27
  /**
28
28
  * Sends a GET request to the '/test500' endpoint and returns the result.
29
29
  * @handleName test500
30
- * @returns {any} The response from the server after fetching data from the '/test500' endpoint.
31
- * @throws {IError} If there is an error during the fetch operation, it will return an error object.
30
+ * @returns {Promise<any | IError>} The response from the server after fetching data from the '/test500' endpoint.
31
+ * @throws {IError} When isShell=false and an error occurs during the fetch
32
32
  * @description This method is used to test the 500 error handling by sending a GET request to a specific endpoint.
33
33
  */
34
34
  test500(): Promise<any | IError>;
35
35
  /**
36
36
  * Validates a CAPTCHA token by sending it to the server for verification.
37
- * @handleName validateCapcha
37
+ * @handleName validateCaptcha
38
38
  * @param {object} event - The event object containing CAPTCHA data.
39
39
  * @example
40
40
  {
@@ -45,11 +45,11 @@ export default class SystemApi extends AsyncModules implements ISystem {
45
45
  * @param {string} event.token - The CAPTCHA token to be validated. Example: "03AGdBq24...".
46
46
  * @param {string} event.expectedAction - The expected action associated with the CAPTCHA. Example: "login".
47
47
  * @param {string} event.siteKey - The site key used for the CAPTCHA. Example: "6Lc_aCMTAAAAAB...".
48
- * @returns {any} The response from the server after validating the CAPTCHA, or an error object if validation fails.
49
- * @throws {IError} If there is an error during the fetch operation, it will return an error object.
48
+ * @returns {Promise<any | IError>} The response from the server after validating the CAPTCHA, or an error object if validation fails.
49
+ * @throws {IError} When isShell=false and an error occurs during the fetch
50
50
  * @description This method sends the CAPTCHA token and related information to the server endpoint '/captcha/validate' to verify its validity.
51
51
  */
52
- validateCapcha(event: {
52
+ validateCaptcha(event: {
53
53
  token: string;
54
54
  expectedAction: string;
55
55
  siteKey: string;
@@ -57,8 +57,8 @@ export default class SystemApi extends AsyncModules implements ISystem {
57
57
  /**
58
58
  * Getting the number of requests to API.
59
59
  * @handleName getApiStat
60
- * @returns {any} Return object with date and count.
61
- * @throws {IError} If there is an error during the fetch operation, it will return an error object.
60
+ * @returns {Promise<any | IError>} Return object with date and count.
61
+ * @throws {IError} When isShell=false and an error occurs during the fetch
62
62
  * @description Getting the number of requests to API.
63
63
  */
64
64
  getApiStat(): Promise<any | IError>;
@@ -24,8 +24,8 @@ class SystemApi extends asyncModules_1.default {
24
24
  /**
25
25
  * Sends a GET request to the '/test404' endpoint and returns the result.
26
26
  * @handleName test404
27
- * @returns {any} The response from the server after fetching data from the '/test404' endpoint.
28
- * @throws {IError} If there is an error during the fetch operation, it will return an error object.
27
+ * @returns {Promise<any | IError>} The response from the server after fetching data from the '/test404' endpoint.
28
+ * @throws {IError} When isShell=false and an error occurs during the fetch
29
29
  * @description This method is used to test the 404 error handling by sending a GET request to a specific endpoint.
30
30
  */
31
31
  async test404() {
@@ -35,8 +35,8 @@ class SystemApi extends asyncModules_1.default {
35
35
  /**
36
36
  * Sends a GET request to the '/test500' endpoint and returns the result.
37
37
  * @handleName test500
38
- * @returns {any} The response from the server after fetching data from the '/test500' endpoint.
39
- * @throws {IError} If there is an error during the fetch operation, it will return an error object.
38
+ * @returns {Promise<any | IError>} The response from the server after fetching data from the '/test500' endpoint.
39
+ * @throws {IError} When isShell=false and an error occurs during the fetch
40
40
  * @description This method is used to test the 500 error handling by sending a GET request to a specific endpoint.
41
41
  */
42
42
  async test500() {
@@ -45,7 +45,7 @@ class SystemApi extends asyncModules_1.default {
45
45
  }
46
46
  /**
47
47
  * Validates a CAPTCHA token by sending it to the server for verification.
48
- * @handleName validateCapcha
48
+ * @handleName validateCaptcha
49
49
  * @param {object} event - The event object containing CAPTCHA data.
50
50
  * @example
51
51
  {
@@ -56,11 +56,11 @@ class SystemApi extends asyncModules_1.default {
56
56
  * @param {string} event.token - The CAPTCHA token to be validated. Example: "03AGdBq24...".
57
57
  * @param {string} event.expectedAction - The expected action associated with the CAPTCHA. Example: "login".
58
58
  * @param {string} event.siteKey - The site key used for the CAPTCHA. Example: "6Lc_aCMTAAAAAB...".
59
- * @returns {any} The response from the server after validating the CAPTCHA, or an error object if validation fails.
60
- * @throws {IError} If there is an error during the fetch operation, it will return an error object.
59
+ * @returns {Promise<any | IError>} The response from the server after validating the CAPTCHA, or an error object if validation fails.
60
+ * @throws {IError} When isShell=false and an error occurs during the fetch
61
61
  * @description This method sends the CAPTCHA token and related information to the server endpoint '/captcha/validate' to verify its validity.
62
62
  */
63
- async validateCapcha(event) {
63
+ async validateCaptcha(event) {
64
64
  const data = {
65
65
  event,
66
66
  };
@@ -70,8 +70,8 @@ class SystemApi extends asyncModules_1.default {
70
70
  /**
71
71
  * Getting the number of requests to API.
72
72
  * @handleName getApiStat
73
- * @returns {any} Return object with date and count.
74
- * @throws {IError} If there is an error during the fetch operation, it will return an error object.
73
+ * @returns {Promise<any | IError>} Return object with date and count.
74
+ * @throws {IError} When isShell=false and an error occurs during the fetch
75
75
  * @description Getting the number of requests to API.
76
76
  */
77
77
  async getApiStat() {
@@ -21,8 +21,8 @@ export default class TemplatesPreviewApi extends AsyncModules implements ITempla
21
21
  * Get all template objects grouped by types.
22
22
  * @handleName getAllTemplates
23
23
  * @param {string} [langCode] - Language code. Default: "en_US".
24
- * @returns {Record<Types, ITemplateEntity[]>} Returns an object GroupedTemplatesObject, which contains an array of template objects TemplateEntity
25
- * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
24
+ * @returns {Promise<Record<Types, ITemplateEntity[]> | IError>} Returns an object GroupedTemplatesObject, which contains an array of template objects TemplateEntity
25
+ * @throws {IError} When isShell=false and an error occurs during the fetch
26
26
  * @description This function is designed to fetch organized template objects in groups based on their types.
27
27
  */
28
28
  getAllTemplates(langCode?: string): Promise<Record<Types, ITemplateEntity[]> | IError>;
@@ -31,8 +31,8 @@ export default class TemplatesPreviewApi extends AsyncModules implements ITempla
31
31
  * @handleName getTemplateByType
32
32
  * @param {Types} type - The type of templates to retrieve. This parameter specifies the category or classification of templates being requested. Example: "product".
33
33
  * @param {string} [langCode] - Language code. Default: "en_US".
34
- * @returns {ITemplateEntity[]} Returns a TemplateEntity object.
35
- * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
34
+ * @returns {Promise<ITemplateEntity[] | IError>} Returns a TemplateEntity object.
35
+ * @throws {IError} When isShell=false and an error occurs during the fetch
36
36
  * @description Fetch template objects that belong to a specific type, with an optional filter by language.
37
37
  */
38
38
  getTemplateByType(type: Types, langCode?: string): Promise<ITemplateEntity[] | IError>;
@@ -41,8 +41,8 @@ export default class TemplatesPreviewApi extends AsyncModules implements ITempla
41
41
  * @handleName getTemplateByMarker
42
42
  * @param {string} marker - The unique marker of the template to retrieve. Example: "template_12345".
43
43
  * @param {string} [langCode] - Language code. Default: "en_US".
44
- * @returns {ITemplateEntity} Returns a TemplateEntity object
45
- * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
44
+ * @returns {Promise<ITemplateEntity | IError>} Returns a TemplateEntity object
45
+ * @throws {IError} When isShell=false and an error occurs during the fetch
46
46
  * @description Fetch a specific template object based on its unique marker.
47
47
  */
48
48
  getTemplateByMarker(marker: string, langCode?: string): Promise<ITemplateEntity | IError>;
@@ -26,8 +26,8 @@ class TemplatesPreviewApi extends asyncModules_1.default {
26
26
  * Get all template objects grouped by types.
27
27
  * @handleName getAllTemplates
28
28
  * @param {string} [langCode] - Language code. Default: "en_US".
29
- * @returns {Record<Types, ITemplateEntity[]>} Returns an object GroupedTemplatesObject, which contains an array of template objects TemplateEntity
30
- * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
29
+ * @returns {Promise<Record<Types, ITemplateEntity[]> | IError>} Returns an object GroupedTemplatesObject, which contains an array of template objects TemplateEntity
30
+ * @throws {IError} When isShell=false and an error occurs during the fetch
31
31
  * @description This function is designed to fetch organized template objects in groups based on their types.
32
32
  */
33
33
  async getAllTemplates(langCode = this.state.lang) {
@@ -46,8 +46,8 @@ class TemplatesPreviewApi extends asyncModules_1.default {
46
46
  * @handleName getTemplateByType
47
47
  * @param {Types} type - The type of templates to retrieve. This parameter specifies the category or classification of templates being requested. Example: "product".
48
48
  * @param {string} [langCode] - Language code. Default: "en_US".
49
- * @returns {ITemplateEntity[]} Returns a TemplateEntity object.
50
- * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
49
+ * @returns {Promise<ITemplateEntity[] | IError>} Returns a TemplateEntity object.
50
+ * @throws {IError} When isShell=false and an error occurs during the fetch
51
51
  * @description Fetch template objects that belong to a specific type, with an optional filter by language.
52
52
  */
53
53
  async getTemplateByType(type, langCode = this.state.lang) {
@@ -61,8 +61,8 @@ class TemplatesPreviewApi extends asyncModules_1.default {
61
61
  * @handleName getTemplateByMarker
62
62
  * @param {string} marker - The unique marker of the template to retrieve. Example: "template_12345".
63
63
  * @param {string} [langCode] - Language code. Default: "en_US".
64
- * @returns {ITemplateEntity} Returns a TemplateEntity object
65
- * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
64
+ * @returns {Promise<ITemplateEntity | IError>} Returns a TemplateEntity object
65
+ * @throws {IError} When isShell=false and an error occurs during the fetch
66
66
  * @description Fetch a specific template object based on its unique marker.
67
67
  */
68
68
  async getTemplateByMarker(marker, langCode = this.state.lang) {
@@ -20,8 +20,8 @@ export default class TemplatePreviewsApi extends AsyncModules implements ITempla
20
20
  * Get all template objects.
21
21
  * @handleName getTemplatePreviews
22
22
  * @param {string} [langCode] - Language code. Default: "en_US".
23
- * @returns {ITemplatesPreviewEntity[]} - Returns all TemplatePreviewsEntity template objects.
24
- * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
23
+ * @returns {Promise<ITemplatesPreviewEntity[] | IError>} - Returns all TemplatePreviewsEntity template objects.
24
+ * @throws {IError} When isShell=false and an error occurs during the fetch
25
25
  * @description This method is used to fetch all available template objects.
26
26
  */
27
27
  getTemplatePreviews(langCode?: string): Promise<ITemplatesPreviewEntity[] | IError>;
@@ -31,7 +31,7 @@ export default class TemplatePreviewsApi extends AsyncModules implements ITempla
31
31
  * @param {string} marker - The unique product marker used to identify the template. If not provided, a default behavior or error may occur. Example: "template_12345".
32
32
  * @param {string} [langCode] - Language code. Default: "en_US".
33
33
  * @returns {Promise<ITemplatesPreviewEntity | IError>} - A promise that resolves to a TemplatePreviewsEntity object representing the template.
34
- * @throws {IError} - Throws an error object if there is an issue during the fetch operation.
34
+ * @throws {IError} When isShell=false and an error occurs during the fetch
35
35
  * @description This method is used to fetch a specific template object based on the provided marker.
36
36
  */
37
37
  getTemplatePreviewByMarker(marker: string, langCode?: string): Promise<ITemplatesPreviewEntity | IError>;
@@ -24,8 +24,8 @@ class TemplatePreviewsApi extends asyncModules_1.default {
24
24
  * Get all template objects.
25
25
  * @handleName getTemplatePreviews
26
26
  * @param {string} [langCode] - Language code. Default: "en_US".
27
- * @returns {ITemplatesPreviewEntity[]} - Returns all TemplatePreviewsEntity template objects.
28
- * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
27
+ * @returns {Promise<ITemplatesPreviewEntity[] | IError>} - Returns all TemplatePreviewsEntity template objects.
28
+ * @throws {IError} When isShell=false and an error occurs during the fetch
29
29
  * @description This method is used to fetch all available template objects.
30
30
  */
31
31
  async getTemplatePreviews(langCode = this.state.lang) {
@@ -40,7 +40,7 @@ class TemplatePreviewsApi extends asyncModules_1.default {
40
40
  * @param {string} marker - The unique product marker used to identify the template. If not provided, a default behavior or error may occur. Example: "template_12345".
41
41
  * @param {string} [langCode] - Language code. Default: "en_US".
42
42
  * @returns {Promise<ITemplatesPreviewEntity | IError>} - A promise that resolves to a TemplatePreviewsEntity object representing the template.
43
- * @throws {IError} - Throws an error object if there is an issue during the fetch operation.
43
+ * @throws {IError} When isShell=false and an error occurs during the fetch
44
44
  * @description This method is used to fetch a specific template object based on the provided marker.
45
45
  */
46
46
  async getTemplatePreviewByMarker(marker, langCode = this.state.lang) {
@@ -73,6 +73,7 @@ interface ITemplatesPreview {
73
73
  * @property {number} version - The version number of the object. Example: 1.
74
74
  * @property {AttributeType} attributeValues - Attribute values from index. Example: {}
75
75
  * @property {number} position - The position of the object. Example: 1.
76
+ * @property {boolean} isUsed - Indicates whether the template preview is used. Example: true.
76
77
  * @property {string | null} [attributeSetIdentifier] - Text identifier used for a set of attributes. Example: "attribute_set_1".
77
78
  * @description This interface defines the structure of a template preview entity, including its identifiers, attributes, proportions, and title.
78
79
  */