oneentry 1.0.126 → 1.0.127

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 (83) hide show
  1. package/README.md +0 -2
  2. package/configure.js +25 -18
  3. package/dist/admins/adminsApi.d.ts +30 -25
  4. package/dist/admins/adminsApi.js +30 -25
  5. package/dist/admins/adminsInterfaces.d.ts +45 -54
  6. package/dist/attribute-sets/attributeSetsApi.d.ts +26 -27
  7. package/dist/attribute-sets/attributeSetsApi.js +26 -27
  8. package/dist/attribute-sets/attributeSetsInterfaces.d.ts +101 -109
  9. package/dist/auth-provider/authProviderApi.d.ts +132 -158
  10. package/dist/auth-provider/authProviderApi.js +131 -157
  11. package/dist/auth-provider/authProvidersInterfaces.d.ts +241 -237
  12. package/dist/base/asyncModules.d.ts +23 -21
  13. package/dist/base/asyncModules.js +30 -25
  14. package/dist/base/result.d.ts +31 -0
  15. package/dist/base/result.js +32 -1
  16. package/dist/base/stateModule.d.ts +10 -0
  17. package/dist/base/stateModule.js +50 -2
  18. package/dist/base/syncModules.d.ts +41 -49
  19. package/dist/base/syncModules.js +49 -48
  20. package/dist/base/utils.d.ts +38 -7
  21. package/dist/blocks/blocksApi.d.ts +27 -36
  22. package/dist/blocks/blocksApi.js +27 -36
  23. package/dist/blocks/blocksInterfaces.d.ts +92 -97
  24. package/dist/config.d.ts +13 -0
  25. package/dist/config.js +30 -0
  26. package/dist/events/eventsApi.d.ts +16 -33
  27. package/dist/events/eventsApi.js +32 -46
  28. package/dist/events/eventsInterfaces.d.ts +42 -37
  29. package/dist/file-uploading/fileUploadingApi.d.ts +42 -47
  30. package/dist/file-uploading/fileUploadingApi.js +44 -47
  31. package/dist/file-uploading/fileUploadingInterfaces.d.ts +49 -60
  32. package/dist/forms/formsApi.d.ts +15 -14
  33. package/dist/forms/formsApi.js +15 -14
  34. package/dist/forms/formsInterfaces.d.ts +36 -40
  35. package/dist/forms-data/formsDataApi.d.ts +40 -44
  36. package/dist/forms-data/formsDataApi.js +42 -44
  37. package/dist/forms-data/formsDataInterfaces.d.ts +231 -231
  38. package/dist/general-types/generalTypesApi.d.ts +5 -5
  39. package/dist/general-types/generalTypesApi.js +5 -5
  40. package/dist/general-types/generalTypesInterfaces.d.ts +6 -9
  41. package/dist/index.d.ts +12 -13
  42. package/dist/index.js +12 -13
  43. package/dist/integration-collections/integrationCollectionsApi.d.ts +84 -98
  44. package/dist/integration-collections/integrationCollectionsApi.js +86 -102
  45. package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +177 -169
  46. package/dist/locales/localesApi.d.ts +7 -3
  47. package/dist/locales/localesApi.js +7 -3
  48. package/dist/locales/localesInterfaces.d.ts +14 -13
  49. package/dist/menus/menusApi.d.ts +9 -5
  50. package/dist/menus/menusApi.js +9 -5
  51. package/dist/menus/menusInterfaces.d.ts +43 -48
  52. package/dist/menus/menusInterfaces.js +1 -0
  53. package/dist/orders/ordersApi.d.ts +62 -70
  54. package/dist/orders/ordersApi.js +62 -71
  55. package/dist/orders/ordersInterfaces.d.ts +238 -203
  56. package/dist/pages/pagesApi.d.ts +67 -80
  57. package/dist/pages/pagesApi.js +71 -81
  58. package/dist/pages/pagesInterfaces.d.ts +164 -160
  59. package/dist/payments/paymentsApi.d.ts +24 -34
  60. package/dist/payments/paymentsApi.js +24 -38
  61. package/dist/payments/paymentsInterfaces.d.ts +82 -76
  62. package/dist/product-statuses/productStatusesApi.d.ts +13 -13
  63. package/dist/product-statuses/productStatusesApi.js +13 -13
  64. package/dist/product-statuses/productStatusesInterfaces.d.ts +29 -27
  65. package/dist/products/productsApi.d.ts +246 -267
  66. package/dist/products/productsApi.js +247 -267
  67. package/dist/products/productsInterfaces.d.ts +333 -339
  68. package/dist/system/systemApi.d.ts +19 -21
  69. package/dist/system/systemApi.js +20 -21
  70. package/dist/system/systemInterfaces.d.ts +14 -3
  71. package/dist/templates/templatesApi.d.ts +13 -16
  72. package/dist/templates/templatesApi.js +13 -16
  73. package/dist/templates/templatesInterfaces.d.ts +30 -29
  74. package/dist/templates-preview/templatesPreviewApi.d.ts +10 -11
  75. package/dist/templates-preview/templatesPreviewApi.js +10 -11
  76. package/dist/templates-preview/templatesPreviewInterfaces.d.ts +61 -64
  77. package/dist/users/usersApi.d.ts +36 -43
  78. package/dist/users/usersApi.js +36 -43
  79. package/dist/users/usersInterfaces.d.ts +92 -96
  80. package/dist/web-socket/wsApi.d.ts +5 -3
  81. package/dist/web-socket/wsApi.js +6 -3
  82. package/dist/web-socket/wsInterfaces.d.ts +7 -2
  83. package/package.json +16 -12
@@ -5,46 +5,46 @@ import type { ISystem } from './systemInterfaces';
5
5
  /**
6
6
  * Controllers for working with system - system
7
7
  * @handle /api/content/system
8
+ * @description Controllers for working with system - system
8
9
  */
9
10
  export default class SystemApi extends AsyncModules implements ISystem {
10
11
  protected state: StateModule;
11
12
  protected _url: string;
13
+ /**
14
+ * Constructor
15
+ * @param {StateModule} state - The state module.
16
+ * @description Constructor initializes the SystemApi with a given state.
17
+ */
12
18
  constructor(state: StateModule);
13
19
  /**
14
20
  * Sends a GET request to the '/test404' endpoint and returns the result.
15
- *
16
21
  * @handleName test404
17
- *
18
- * @return {any} The response from the server after fetching data from the '/test404' endpoint.
22
+ * @returns {any} The response from the server after fetching data from the '/test404' endpoint.
19
23
  * @throws {IError} If there is an error during the fetch operation, it will return an error object.
20
24
  * @description This method is used to test the 404 error handling by sending a GET request to a specific endpoint.
21
25
  */
22
26
  test404(): Promise<any | IError>;
23
27
  /**
24
28
  * Sends a GET request to the '/test500' endpoint and returns the result.
25
- *
26
29
  * @handleName test500
27
- *
28
- * @return {any} The response from the server after fetching data from the '/test500' endpoint.
30
+ * @returns {any} The response from the server after fetching data from the '/test500' endpoint.
29
31
  * @throws {IError} If there is an error during the fetch operation, it will return an error object.
30
32
  * @description This method is used to test the 500 error handling by sending a GET request to a specific endpoint.
31
33
  */
32
34
  test500(): Promise<any | IError>;
33
35
  /**
34
36
  * Validates a CAPTCHA token by sending it to the server for verification.
35
- *
36
37
  * @handleName validateCapcha
37
- *
38
- * @param {Object} event - The event object containing CAPTCHA data. Example:
39
- {
40
- "token": "03AGdBq24...",
41
- "expectedAction": "login",
42
- "siteKey": "6Lc_aCMTAAAAAB..."
43
- }
44
- * @param {string} event.token - The CAPTCHA token to be validated. Example: "03AGdBq24...".
45
- * @param {string} event.expectedAction - The expected action associated with the CAPTCHA. Example: "login".
46
- * @param {string} event.siteKey - The site key used for the CAPTCHA. Example: "6Lc_aCMTAAAAAB...".
47
- * @return {any} The response from the server after validating the CAPTCHA, or an error object if validation fails.
38
+ * @param {object} event - The event object containing CAPTCHA data. Example:
39
+ {
40
+ "token": "03AGdBq24...",
41
+ "expectedAction": "login",
42
+ "siteKey": "6Lc_aCMTAAAAAB..."
43
+ }
44
+ * @param {string} event.token - The CAPTCHA token to be validated. Example: "03AGdBq24...".
45
+ * @param {string} event.expectedAction - The expected action associated with the CAPTCHA. Example: "login".
46
+ * @param {string} event.siteKey - The site key used for the CAPTCHA. Example: "6Lc_aCMTAAAAAB...".
47
+ * @returns {any} The response from the server after validating the CAPTCHA, or an error object if validation fails.
48
48
  * @throws {IError} If there is an error during the fetch operation, it will return an error object.
49
49
  * @description This method sends the CAPTCHA token and related information to the server endpoint '/captcha/validate' to verify its validity.
50
50
  */
@@ -55,10 +55,8 @@ export default class SystemApi extends AsyncModules implements ISystem {
55
55
  }): Promise<any | IError>;
56
56
  /**
57
57
  * Getting the number of requests to API.
58
- *
59
58
  * @handleName getApiStat
60
- *
61
- * @return {any} Return object with date and count.
59
+ * @returns {any} Return object with date and count.
62
60
  * @throws {IError} If there is an error during the fetch operation, it will return an error object.
63
61
  * @description Getting the number of requests to API.
64
62
  */
@@ -3,23 +3,28 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ /* eslint-disable jsdoc/reject-any-type */
6
7
  /* eslint-disable @typescript-eslint/no-explicit-any */
7
8
  const asyncModules_1 = __importDefault(require("../base/asyncModules"));
8
9
  /**
9
10
  * Controllers for working with system - system
10
11
  * @handle /api/content/system
12
+ * @description Controllers for working with system - system
11
13
  */
12
14
  class SystemApi extends asyncModules_1.default {
15
+ /**
16
+ * Constructor
17
+ * @param {StateModule} state - The state module.
18
+ * @description Constructor initializes the SystemApi with a given state.
19
+ */
13
20
  constructor(state) {
14
21
  super(state);
15
22
  this._url = state.url + '/api/content/system';
16
23
  }
17
24
  /**
18
25
  * Sends a GET request to the '/test404' endpoint and returns the result.
19
- *
20
26
  * @handleName test404
21
- *
22
- * @return {any} The response from the server after fetching data from the '/test404' endpoint.
27
+ * @returns {any} The response from the server after fetching data from the '/test404' endpoint.
23
28
  * @throws {IError} If there is an error during the fetch operation, it will return an error object.
24
29
  * @description This method is used to test the 404 error handling by sending a GET request to a specific endpoint.
25
30
  */
@@ -29,10 +34,8 @@ class SystemApi extends asyncModules_1.default {
29
34
  }
30
35
  /**
31
36
  * Sends a GET request to the '/test500' endpoint and returns the result.
32
- *
33
37
  * @handleName test500
34
- *
35
- * @return {any} The response from the server after fetching data from the '/test500' endpoint.
38
+ * @returns {any} The response from the server after fetching data from the '/test500' endpoint.
36
39
  * @throws {IError} If there is an error during the fetch operation, it will return an error object.
37
40
  * @description This method is used to test the 500 error handling by sending a GET request to a specific endpoint.
38
41
  */
@@ -42,19 +45,17 @@ class SystemApi extends asyncModules_1.default {
42
45
  }
43
46
  /**
44
47
  * Validates a CAPTCHA token by sending it to the server for verification.
45
- *
46
48
  * @handleName validateCapcha
47
- *
48
- * @param {Object} event - The event object containing CAPTCHA data. Example:
49
- {
50
- "token": "03AGdBq24...",
51
- "expectedAction": "login",
52
- "siteKey": "6Lc_aCMTAAAAAB..."
53
- }
54
- * @param {string} event.token - The CAPTCHA token to be validated. Example: "03AGdBq24...".
55
- * @param {string} event.expectedAction - The expected action associated with the CAPTCHA. Example: "login".
56
- * @param {string} event.siteKey - The site key used for the CAPTCHA. Example: "6Lc_aCMTAAAAAB...".
57
- * @return {any} The response from the server after validating the CAPTCHA, or an error object if validation fails.
49
+ * @param {object} event - The event object containing CAPTCHA data. Example:
50
+ {
51
+ "token": "03AGdBq24...",
52
+ "expectedAction": "login",
53
+ "siteKey": "6Lc_aCMTAAAAAB..."
54
+ }
55
+ * @param {string} event.token - The CAPTCHA token to be validated. Example: "03AGdBq24...".
56
+ * @param {string} event.expectedAction - The expected action associated with the CAPTCHA. Example: "login".
57
+ * @param {string} event.siteKey - The site key used for the CAPTCHA. Example: "6Lc_aCMTAAAAAB...".
58
+ * @returns {any} The response from the server after validating the CAPTCHA, or an error object if validation fails.
58
59
  * @throws {IError} If there is an error during the fetch operation, it will return an error object.
59
60
  * @description This method sends the CAPTCHA token and related information to the server endpoint '/captcha/validate' to verify its validity.
60
61
  */
@@ -67,10 +68,8 @@ class SystemApi extends asyncModules_1.default {
67
68
  }
68
69
  /**
69
70
  * Getting the number of requests to API.
70
- *
71
71
  * @handleName getApiStat
72
- *
73
- * @return {any} Return object with date and count.
72
+ * @returns {any} Return object with date and count.
74
73
  * @throws {IError} If there is an error during the fetch operation, it will return an error object.
75
74
  * @description Getting the number of requests to API.
76
75
  */
@@ -1,12 +1,23 @@
1
1
  /**
2
2
  * @interface ISystem
3
- *
4
- * @property {function} test404 - Test 404 error.
5
- * @property {function} test500 - Test 500 error.
3
+ * @property {Function} test404 - Test 404 error.
4
+ * @property {Function} test500 - Test 500 error.
6
5
  * @description Represents a interface object of System Api.
7
6
  */
8
7
  interface ISystem {
8
+ /**
9
+ * Test 404 error.
10
+ * @handleName test404
11
+ * @returns {any} Returns a Promise that resolves with any data.
12
+ * @description This method tests 404 error.
13
+ */
9
14
  test404(): Promise<any>;
15
+ /**
16
+ * Test 500 error.
17
+ * @handleName test500
18
+ * @returns {any} Returns a Promise that resolves with any data.
19
+ * @description This method tests 500 error.
20
+ */
10
21
  test500(): Promise<any>;
11
22
  }
12
23
  export type { ISystem };
@@ -4,47 +4,44 @@ import type { IError, Types } from '../base/utils';
4
4
  import type { ITemplateEntity, ITemplatesApi } from './templatesInterfaces';
5
5
  /**
6
6
  * Controllers for working with template objects
7
- *
8
7
  * @module TemplateController
9
8
  * @handle /api/content/templates
10
- *
11
9
  * @description This module provides a set of controllers for handling operations related to template objects.
12
10
  */
13
11
  export default class TemplatesPreviewApi extends AsyncModules implements ITemplatesApi {
14
12
  protected state: StateModule;
15
13
  protected _url: string;
14
+ /**
15
+ * Constructor for TemplatesApi class.
16
+ * @param {StateModule} state - The state module instance.
17
+ * @description Initializes the TemplatesApi class with the provided state module instance.
18
+ */
16
19
  constructor(state: StateModule);
17
20
  /**
18
21
  * Get all template objects grouped by types.
19
- *
20
22
  * @handleName getAllTemplates
21
- *
22
- * @param {string} [langCode] - Language code. Default: "en_US".
23
- * @return {Record<Types, ITemplateEntity[]>} Returns an object GroupedTemplatesObject, which contains an array of template objects TemplateEntity
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
24
25
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
25
26
  * @description This function is designed to fetch organized template objects in groups based on their types.
26
27
  */
27
28
  getAllTemplates(langCode?: string): Promise<Record<Types, ITemplateEntity[]> | IError>;
28
29
  /**
29
30
  * Get template objects by type.
30
- *
31
31
  * @handleName getTemplateByType
32
- *
33
- * @param {Types} type - The type of templates to retrieve. This parameter specifies the category or classification of templates being requested. Example: "product".
34
- * @param {string} [langCode] - Language code. Default: "en_US".
35
- * @return {ITemplateEntity[]} Returns a TemplateEntity object.
32
+ * @param {Types} type - The type of templates to retrieve. This parameter specifies the category or classification of templates being requested. Example: "product".
33
+ * @param {string} [langCode] - Language code. Default: "en_US".
34
+ * @returns {ITemplateEntity[]} Returns a TemplateEntity object.
36
35
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
37
36
  * @description Fetch template objects that belong to a specific type, with an optional filter by language.
38
37
  */
39
38
  getTemplateByType(type: Types, langCode?: string): Promise<ITemplateEntity[] | IError>;
40
39
  /**
41
40
  * Get one template object by marker.
42
- *
43
41
  * @handleName getTemplateByMarker
44
- *
45
- * @param {string} marker - The unique marker of the template to retrieve. Example: "template_12345".
46
- * @param {string} [langCode] - Language code. Default: "en_US".
47
- * @return {ITemplateEntity} Returns a TemplateEntity object
42
+ * @param {string} marker - The unique marker of the template to retrieve. Example: "template_12345".
43
+ * @param {string} [langCode] - Language code. Default: "en_US".
44
+ * @returns {ITemplateEntity} Returns a TemplateEntity object
48
45
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
49
46
  * @description Fetch a specific template object based on its unique marker.
50
47
  */
@@ -7,24 +7,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  const asyncModules_1 = __importDefault(require("../base/asyncModules"));
8
8
  /**
9
9
  * Controllers for working with template objects
10
- *
11
10
  * @module TemplateController
12
11
  * @handle /api/content/templates
13
- *
14
12
  * @description This module provides a set of controllers for handling operations related to template objects.
15
13
  */
16
14
  class TemplatesPreviewApi extends asyncModules_1.default {
15
+ /**
16
+ * Constructor for TemplatesApi class.
17
+ * @param {StateModule} state - The state module instance.
18
+ * @description Initializes the TemplatesApi class with the provided state module instance.
19
+ */
17
20
  constructor(state) {
18
21
  super(state);
19
22
  this._url = state.url + '/api/content/templates';
20
23
  }
21
24
  /**
22
25
  * Get all template objects grouped by types.
23
- *
24
26
  * @handleName getAllTemplates
25
- *
26
- * @param {string} [langCode] - Language code. Default: "en_US".
27
- * @return {Record<Types, ITemplateEntity[]>} Returns an object GroupedTemplatesObject, which contains an array of template objects TemplateEntity
27
+ * @param {string} [langCode] - Language code. Default: "en_US".
28
+ * @returns {Record<Types, ITemplateEntity[]>} Returns an object GroupedTemplatesObject, which contains an array of template objects TemplateEntity
28
29
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
29
30
  * @description This function is designed to fetch organized template objects in groups based on their types.
30
31
  */
@@ -39,12 +40,10 @@ class TemplatesPreviewApi extends asyncModules_1.default {
39
40
  }
40
41
  /**
41
42
  * Get template objects by type.
42
- *
43
43
  * @handleName getTemplateByType
44
- *
45
- * @param {Types} type - The type of templates to retrieve. This parameter specifies the category or classification of templates being requested. Example: "product".
46
- * @param {string} [langCode] - Language code. Default: "en_US".
47
- * @return {ITemplateEntity[]} Returns a TemplateEntity object.
44
+ * @param {Types} type - The type of templates to retrieve. This parameter specifies the category or classification of templates being requested. Example: "product".
45
+ * @param {string} [langCode] - Language code. Default: "en_US".
46
+ * @returns {ITemplateEntity[]} Returns a TemplateEntity object.
48
47
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
49
48
  * @description Fetch template objects that belong to a specific type, with an optional filter by language.
50
49
  */
@@ -54,12 +53,10 @@ class TemplatesPreviewApi extends asyncModules_1.default {
54
53
  }
55
54
  /**
56
55
  * Get one template object by marker.
57
- *
58
56
  * @handleName getTemplateByMarker
59
- *
60
- * @param {string} marker - The unique marker of the template to retrieve. Example: "template_12345".
61
- * @param {string} [langCode] - Language code. Default: "en_US".
62
- * @return {ITemplateEntity} Returns a TemplateEntity object
57
+ * @param {string} marker - The unique marker of the template to retrieve. Example: "template_12345".
58
+ * @param {string} [langCode] - Language code. Default: "en_US".
59
+ * @returns {ITemplateEntity} Returns a TemplateEntity object
63
60
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
64
61
  * @description Fetch a specific template object based on its unique marker.
65
62
  */
@@ -1,57 +1,58 @@
1
1
  import type { AttributeType, IError, Types } from '../base/utils';
2
2
  /**
3
3
  * @interface ITemplatesApi
4
- *
5
- * @property {function} getAllTemplates - Get all template objects grouped by types.
6
- * @property {function} getTemplateByType - Get template objects by type.
7
- * @property {function} getTemplateByMarker - Getting a single template object.
8
- *
4
+ * @property {Function} getAllTemplates - Get all template objects grouped by types.
5
+ * @property {Function} getTemplateByType - Get template objects by type.
6
+ * @property {Function} getTemplateByMarker - Getting a single template object.
9
7
  * @description This interface defines methods for retrieving templates in the system, including fetching all templates, specific templates by type or ID, and by marker.
10
8
  */
11
9
  interface ITemplatesApi {
12
10
  /**
13
11
  * Get all template objects grouped by types.
14
- *
15
- * @param {string} [langCode] - Language code. Default: "en_US".
16
- * @return {Record<Types, ITemplateEntity[]>} Returns an object GroupedTemplatesObject, which contains an array of template objects TemplateEntity
12
+ * @handleName getAllTemplates
13
+ * @param {string} [langCode] - Language code. Default: "en_US".
14
+ * @returns {Record<Types, ITemplateEntity[]>} Returns an object GroupedTemplatesObject, which contains an array of template objects TemplateEntity
17
15
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
16
+ * @description This method gets all template objects grouped by types.
18
17
  */
19
18
  getAllTemplates(langCode?: string): Promise<Record<Types, ITemplateEntity[]> | IError>;
20
19
  /**
21
20
  * Get template objects by type.
22
- *
23
- * @param {Types} type - The type of templates to retrieve. This parameter specifies the category or classification of templates being requested. Example: "product".
24
- * @param {string} [langCode] - Language code. Default: "en_US".
25
- * @return {TemplateEntity[]} Returns a TemplateEntity object.
21
+ * @handleName getTemplateByType
22
+ * @param {Types} type - The type of templates to retrieve. This parameter specifies the category or classification of templates being requested. Example: "product".
23
+ * @param {string} [langCode] - Language code. Default: "en_US".
24
+ * @returns {ITemplateEntity[]} Returns a TemplateEntity object.
26
25
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
26
+ * @description This method gets template objects by type.
27
27
  */
28
28
  getTemplateByType(type: Types, langCode: string): Promise<ITemplateEntity[] | IError>;
29
29
  /**
30
30
  * Get one template object by id.
31
- *
32
- * @param {string} marker - The unique marker of the template to retrieve. Example: "template_12345".
33
- * @param {string} [langCode] - Language code. Default: "en_US".
34
- * @return {ITemplateEntity} Returns a TemplateEntity object
31
+ * @handleName getTemplateByMarker
32
+ * @param {string} marker - The unique marker of the template to retrieve. Example: "template_12345".
33
+ * @param {string} [langCode] - Language code. Default: "en_US".
34
+ * @returns {ITemplateEntity} Returns a TemplateEntity object
35
35
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
36
+ * @description This method gets one template object by id.
36
37
  */
37
38
  getTemplateByMarker(marker: string, langCode?: string): Promise<ITemplateEntity | IError>;
38
39
  }
39
40
  /**
41
+ * The template entity interface
40
42
  * @interface ITemplateEntity
41
- *
42
- * @property {number} id - The unique identifier of the position. Example: 12345.
43
+ * @property {number} id - The unique identifier of the position. Example: 12345.
43
44
  * @property {string | null} attributeSetIdentifier - Set of attributes id. Example: "attribute_set_1".
44
- * @property {string} title - The name of the template. Example: "Product Template".
45
- * @property {number} generalTypeId - General type Entity id. Example: 67890.
46
- * @property {string} identifier - The textual identifier for the record field. Example: "template_12345".
47
- * @property {number} version - The version number of the object. Example: 1.
48
- * @property {Types} generalTypeName - General type name. Example: "product".
49
- * @property {AttributeType} attributeValues - Attribute values from the index (represented as a pair of user attribute id: attribute value). Example:
50
- * @property {number} position - The position of the object. Example: 1.
51
- {
52
- "id": 1,
53
- "value": "some"
54
- }
45
+ * @property {string} title - The name of the template. Example: "Product Template".
46
+ * @property {number} generalTypeId - General type Entity id. Example: 67890.
47
+ * @property {string} identifier - The textual identifier for the record field. Example: "template_12345".
48
+ * @property {number} version - The version number of the object. Example: 1.
49
+ * @property {Types} generalTypeName - General type name. Example: "product".
50
+ * @property {AttributeType} attributeValues - Attribute values from the index (represented as a pair of user attribute id: attribute value). Example:
51
+ * @property {number} position - The position of the object. Example: 1.
52
+ {
53
+ "id": 1,
54
+ "value": "some"
55
+ }
55
56
  * @description This interface defines the structure of a template entity, including its identifiers, attributes, and general type information.
56
57
  */
57
58
  interface ITemplateEntity {
@@ -4,34 +4,33 @@ import type { IError } from '../base/utils';
4
4
  import type { ITemplatesPreview, ITemplatesPreviewEntity } from './templatesPreviewInterfaces';
5
5
  /**
6
6
  * Controllers for working with template objects for preview.
7
- *
8
7
  * @handle /api/content/template-previews
9
- *
10
8
  * @description This module provides a set of controllers for managing and retrieving template objects designed for preview purposes.
11
9
  */
12
10
  export default class TemplatePreviewsApi extends AsyncModules implements ITemplatesPreview {
13
11
  protected state: StateModule;
14
12
  protected _url: string;
13
+ /**
14
+ * Constructor for the TemplatePreviewsApi class.
15
+ * @param {StateModule} state - The state module instance.
16
+ * @description Initializes the TemplatePreviewsApi class with the provided state module instance.
17
+ */
15
18
  constructor(state: StateModule);
16
19
  /**
17
20
  * Get all template objects.
18
- *
19
21
  * @handleName getTemplatePreviews
20
- *
21
- * @param {string} [langCode] - Language code. Default: "en_US".
22
- * @return {ITemplatesPreviewEntity[]} - Returns all TemplatePreviewsEntity template objects.
22
+ * @param {string} [langCode] - Language code. Default: "en_US".
23
+ * @returns {ITemplatesPreviewEntity[]} - Returns all TemplatePreviewsEntity template objects.
23
24
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
24
25
  * @description This method is used to fetch all available template objects.
25
26
  */
26
27
  getTemplatePreviews(langCode?: string): Promise<ITemplatesPreviewEntity[] | IError>;
27
28
  /**
28
29
  * Retrieves a template object by its marker.
29
- *
30
30
  * @handleName getTemplatePreviewByMarker
31
- *
32
- * @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".
33
- * @param {string} [langCode] - Language code. Default: "en_US".
34
- * @return {TemplatePreviewsEntity} - A promise that resolves to a TemplatePreviewsEntity object representing the template.
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
+ * @param {string} [langCode] - Language code. Default: "en_US".
33
+ * @returns {Promise<ITemplatesPreviewEntity | IError>} - A promise that resolves to a TemplatePreviewsEntity object representing the template.
35
34
  * @throws {IError} - Throws an error object if there is an issue during the fetch operation.
36
35
  * @description This method is used to fetch a specific template object based on the provided marker.
37
36
  */
@@ -6,23 +6,24 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const asyncModules_1 = __importDefault(require("../base/asyncModules"));
7
7
  /**
8
8
  * Controllers for working with template objects for preview.
9
- *
10
9
  * @handle /api/content/template-previews
11
- *
12
10
  * @description This module provides a set of controllers for managing and retrieving template objects designed for preview purposes.
13
11
  */
14
12
  class TemplatePreviewsApi extends asyncModules_1.default {
13
+ /**
14
+ * Constructor for the TemplatePreviewsApi class.
15
+ * @param {StateModule} state - The state module instance.
16
+ * @description Initializes the TemplatePreviewsApi class with the provided state module instance.
17
+ */
15
18
  constructor(state) {
16
19
  super(state);
17
20
  this._url = state.url + '/api/content/template-previews';
18
21
  }
19
22
  /**
20
23
  * Get all template objects.
21
- *
22
24
  * @handleName getTemplatePreviews
23
- *
24
- * @param {string} [langCode] - Language code. Default: "en_US".
25
- * @return {ITemplatesPreviewEntity[]} - Returns all TemplatePreviewsEntity template objects.
25
+ * @param {string} [langCode] - Language code. Default: "en_US".
26
+ * @returns {ITemplatesPreviewEntity[]} - Returns all TemplatePreviewsEntity template objects.
26
27
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
27
28
  * @description This method is used to fetch all available template objects.
28
29
  */
@@ -32,12 +33,10 @@ class TemplatePreviewsApi extends asyncModules_1.default {
32
33
  }
33
34
  /**
34
35
  * Retrieves a template object by its marker.
35
- *
36
36
  * @handleName getTemplatePreviewByMarker
37
- *
38
- * @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".
39
- * @param {string} [langCode] - Language code. Default: "en_US".
40
- * @return {TemplatePreviewsEntity} - A promise that resolves to a TemplatePreviewsEntity object representing the template.
37
+ * @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".
38
+ * @param {string} [langCode] - Language code. Default: "en_US".
39
+ * @returns {Promise<ITemplatesPreviewEntity | IError>} - A promise that resolves to a TemplatePreviewsEntity object representing the template.
41
40
  * @throws {IError} - Throws an error object if there is an issue during the fetch operation.
42
41
  * @description This method is used to fetch a specific template object based on the provided marker.
43
42
  */