oneentry 1.0.122 → 1.0.124

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 (73) hide show
  1. package/dist/admins/adminsApi.d.ts +16 -8
  2. package/dist/admins/adminsApi.js +18 -10
  3. package/dist/admins/adminsInterfaces.d.ts +49 -25
  4. package/dist/attribute-sets/attributeSetsApi.d.ts +43 -21
  5. package/dist/attribute-sets/attributeSetsApi.js +49 -25
  6. package/dist/attribute-sets/attributeSetsInterfaces.d.ts +70 -24
  7. package/dist/auth-provider/authProviderApi.d.ts +94 -83
  8. package/dist/auth-provider/authProviderApi.js +96 -83
  9. package/dist/auth-provider/authProvidersInterfaces.d.ts +188 -10
  10. package/dist/base/asyncModules.d.ts +32 -28
  11. package/dist/base/asyncModules.js +62 -38
  12. package/dist/base/syncModules.d.ts +44 -44
  13. package/dist/base/syncModules.js +65 -63
  14. package/dist/blocks/blocksApi.d.ts +56 -25
  15. package/dist/blocks/blocksApi.js +56 -25
  16. package/dist/blocks/blocksInterfaces.d.ts +71 -22
  17. package/dist/events/eventsApi.d.ts +45 -11
  18. package/dist/events/eventsApi.js +47 -17
  19. package/dist/events/eventsInterfaces.d.ts +44 -2
  20. package/dist/file-uploading/fileUploadingApi.d.ts +44 -24
  21. package/dist/file-uploading/fileUploadingApi.js +46 -27
  22. package/dist/file-uploading/fileUploadingInterfaces.d.ts +63 -14
  23. package/dist/forms/formsApi.d.ts +23 -8
  24. package/dist/forms/formsApi.js +23 -8
  25. package/dist/forms/formsInterfaces.d.ts +62 -15
  26. package/dist/formsData/formsDataApi.d.ts +33 -33
  27. package/dist/formsData/formsDataApi.js +33 -33
  28. package/dist/formsData/formsDataInterfaces.d.ts +123 -35
  29. package/dist/general-types/generalTypesApi.d.ts +12 -1
  30. package/dist/general-types/generalTypesApi.js +12 -1
  31. package/dist/general-types/generalTypesInterfaces.d.ts +18 -5
  32. package/dist/index.d.ts +1 -1
  33. package/dist/index.js +1 -1
  34. package/dist/integration-collections/integrationCollectionsApi.d.ts +96 -70
  35. package/dist/integration-collections/integrationCollectionsApi.js +114 -81
  36. package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +152 -30
  37. package/dist/locales/localesApi.d.ts +6 -1
  38. package/dist/locales/localesApi.js +6 -1
  39. package/dist/locales/localesInterfaces.d.ts +20 -11
  40. package/dist/menus/menusApi.d.ts +8 -3
  41. package/dist/menus/menusApi.js +8 -3
  42. package/dist/menus/menusInterfaces.d.ts +30 -17
  43. package/dist/orders/ordersApi.d.ts +64 -64
  44. package/dist/orders/ordersApi.js +67 -65
  45. package/dist/orders/ordersInterfaces.d.ts +174 -60
  46. package/dist/pages/pagesApi.d.ts +89 -30
  47. package/dist/pages/pagesApi.js +181 -57
  48. package/dist/pages/pagesInterfaces.d.ts +117 -23
  49. package/dist/payments/paymentsApi.d.ts +56 -22
  50. package/dist/payments/paymentsApi.js +56 -22
  51. package/dist/payments/paymentsInterfaces.d.ts +119 -36
  52. package/dist/product-statuses/productStatusesApi.d.ts +21 -15
  53. package/dist/product-statuses/productStatusesApi.js +21 -18
  54. package/dist/product-statuses/productStatusesInterfaces.d.ts +37 -9
  55. package/dist/products/productsApi.d.ts +137 -157
  56. package/dist/products/productsApi.js +137 -157
  57. package/dist/products/productsInterfaces.d.ts +240 -57
  58. package/dist/system/systemApi.d.ts +29 -10
  59. package/dist/system/systemApi.js +29 -10
  60. package/dist/system/systemInterfaces.d.ts +8 -0
  61. package/dist/templates/templatesApi.d.ts +26 -16
  62. package/dist/templates/templatesApi.js +26 -19
  63. package/dist/templates/templatesInterfaces.d.ts +40 -14
  64. package/dist/templates-preview/templatesPreviewApi.d.ts +18 -14
  65. package/dist/templates-preview/templatesPreviewApi.js +18 -17
  66. package/dist/templates-preview/templatesPreviewInterfaces.d.ts +57 -29
  67. package/dist/users/usersApi.d.ts +37 -33
  68. package/dist/users/usersApi.js +37 -33
  69. package/dist/users/usersInterfaces.d.ts +80 -9
  70. package/dist/web-socket/wsApi.d.ts +6 -3
  71. package/dist/web-socket/wsApi.js +6 -3
  72. package/dist/web-socket/wsInterfaces.d.ts +3 -1
  73. package/package.json +11 -11
@@ -7,7 +7,11 @@ 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
+ * @module TemplateController
10
12
  * @handle /api/content/templates
13
+ *
14
+ * @description This module provides a set of controllers for handling operations related to template objects.
11
15
  */
12
16
  class TemplatesPreviewApi extends asyncModules_1.default {
13
17
  constructor(state) {
@@ -17,9 +21,14 @@ class TemplatesPreviewApi extends asyncModules_1.default {
17
21
  /**
18
22
  * Get all template objects grouped by types.
19
23
  *
20
- * @param {string} [langCode] - Optional parameter language code
24
+ * @handleName getAllTemplates
21
25
  *
22
- * @returns Returns an object GroupedTemplatesObject, which contains an array of template objects TemplateEntity
26
+ * @param {string} [langCode] - Language code. Default: "en_US".
27
+ *
28
+ * @return {Record<Types, ITemplateEntity>} Returns an object GroupedTemplatesObject, which contains an array of template objects TemplateEntity
29
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
30
+ *
31
+ * @description This function is designed to fetch organized template objects in groups based on their types.
23
32
  */
24
33
  async getAllTemplates(langCode = this.state.lang) {
25
34
  const response = await this._fetchGet(`/all?langCode=${langCode}`);
@@ -33,34 +42,32 @@ class TemplatesPreviewApi extends asyncModules_1.default {
33
42
  /**
34
43
  * Get template objects by type.
35
44
  *
36
- * @param {Types} [type] - type
37
- * @param {string} [langCode] - Optional parameter language code
45
+ * @handleName getTemplateByType
46
+ *
47
+ * @param {Types} type - The type of templates to retrieve. This parameter specifies the category or classification of templates being requested. Example: 'product'.
48
+ * @param {string} [langCode] - Language code. Default: "en_US".
49
+ *
50
+ * @return {TemplateEntity[]} Returns a TemplateEntity object.
51
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
38
52
  *
39
- * @returns Returns a TemplateEntity object
53
+ * @description Fetch template objects that belong to a specific type, with an optional filter by language.
40
54
  */
41
55
  async getTemplateByType(type, langCode = this.state.lang) {
42
56
  const result = await this._fetchGet(`?type=${type}&langCode=${langCode}`);
43
57
  return this._normalizeData(result);
44
58
  }
45
59
  /**
46
- * Get one template object by id.
60
+ * Get one template object by marker.
47
61
  *
48
- * @param {number} [id] - Template id
49
- * @param {string} [langCode] - Optional parameter language code
62
+ * @handleName getTemplateByMarker
50
63
  *
51
- * @returns Returns a TemplateEntity object
52
- */
53
- async getTemplateById(id, langCode = this.state.lang) {
54
- const result = await this._fetchGet(`/${id}?langCode=${langCode}`);
55
- return this._normalizeData(result);
56
- }
57
- /**
58
- * Get one template object by id.
64
+ * @param {number} marker - The unique marker of the template to retrieve. Example: 'template_12345'.
65
+ * @param {string} [langCode] - Language code. Default: "en_US".
59
66
  *
60
- * @param {number} [marker] - Template marker
61
- * @param {string} [langCode] - Optional parameter language code
67
+ * @return {ITemplateEntity} Returns a TemplateEntity object
68
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
62
69
  *
63
- * @returns Returns a TemplateEntity object
70
+ * @description Fetch a specific template object based on its unique marker.
64
71
  */
65
72
  async getTemplateByMarker(marker, langCode = this.state.lang) {
66
73
  const result = await this._fetchGet(`/marker/${marker}?langCode=${langCode}`);
@@ -1,32 +1,58 @@
1
1
  import type { AttributeType, IError, Types } from '../base/utils';
2
2
  /**
3
- * Represents an interface object of Templates Api.
3
+ * @interface ITemplatesApi
4
4
  *
5
5
  * @property {function} getAllTemplates - Get all template objects grouped by types.
6
6
  * @property {function} getTemplateByType - Get template objects by type.
7
- * @property {function} getTemplateById - Get one template object by id.
8
7
  * @property {function} getTemplateByMarker - Getting a single template object.
8
+ *
9
+ * @description This interface defines methods for retrieving templates in the system, including fetching all templates, specific templates by type or ID, and by marker.
9
10
  */
10
11
  interface ITemplatesApi {
12
+ /**
13
+ * Get all template objects grouped by types.
14
+ *
15
+ * @param {string} [langCode] - Language code. Default: "en_US".
16
+ *
17
+ * @return {Record<Types, ITemplateEntity>} Returns an object GroupedTemplatesObject, which contains an array of template objects TemplateEntity
18
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
19
+ */
11
20
  getAllTemplates(langCode?: string): Promise<Record<Types, ITemplateEntity> | IError>;
21
+ /**
22
+ * Get template objects by type.
23
+ *
24
+ * @param {Types} type - The type of templates to retrieve. This parameter specifies the category or classification of templates being requested. Example: 'product'.
25
+ * @param {string} [langCode] - Language code. Default: "en_US".
26
+ *
27
+ * @return {TemplateEntity[]} Returns a TemplateEntity object.
28
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
29
+ */
12
30
  getTemplateByType(type: Types, langCode: string): Promise<Array<ITemplateEntity> | IError>;
13
- getTemplateById(id: number): Promise<ITemplateEntity | IError>;
31
+ /**
32
+ * Get one template object by id.
33
+ *
34
+ * @param {number} marker - The unique marker of the template to retrieve. Example: 'template_12345'.
35
+ * @param {string} [langCode] - Language code. Default: "en_US".
36
+ *
37
+ * @return {ITemplateEntity} Returns a TemplateEntity object
38
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
39
+ */
14
40
  getTemplateByMarker(marker: string, langCode?: string): Promise<ITemplateEntity | IError>;
15
41
  }
16
42
  /**
17
- * Represents a template entity object.
43
+ * @interface ITemplateEntity
18
44
  *
19
- * @interface
20
- * @property {number} id - The unique identifier of the position.
21
- * @property {number} version - The version number of the object.
22
- * @property {string} identifier - The textual identifier for the record field.
23
- * @property {number} generalTypeId - General type Entity id.
24
- * @property {string} title - The name of the template.
25
- * @property {number} position - The position of the object.
26
- * @property {Types} generalTypeName - General type name.
27
- * @property {string} attributeSetIdentifier - Set of attributes id.
28
- * @property {AttributeType} attributeValues - Attribute values from the index (represented as a pair of user attribute id: attribute value).
45
+ * @property {number} id - The unique identifier of the position. Example: 12345.
46
+ * @property {number} version - The version number of the object. Example: 1.
47
+ * @property {string} identifier - The textual identifier for the record field. Example: 'template_12345'.
48
+ * @property {number} generalTypeId - General type Entity id. Example: 67890.
49
+ * @property {string} title - The name of the template. Example: 'Product Template'.
50
+ * @property {number} position - The position of the object. Example: 1.
51
+ * @property {Types} generalTypeName - General type name. Example: 'product'.
52
+ * @property {string} attributeSetIdentifier - Set of attributes id. Example: 'attribute_set_1'.
53
+ * @property {AttributeType} attributeValues - Attribute values from the index (represented as a pair of user attribute id: attribute value). Example: .
29
54
  *
55
+ * @description This interface defines the structure of a template entity, including its identifiers, attributes, and general type information.
30
56
  */
31
57
  interface ITemplateEntity {
32
58
  id: number;
@@ -3,8 +3,11 @@ import type StateModule from '../base/stateModule';
3
3
  import type { IError } from '../base/utils';
4
4
  import type { ITemplatesPreview, ITemplatesPreviewEntity } from './templatesPreviewInterfaces';
5
5
  /**
6
- * Controllers for working with template objects for preview
6
+ * Controllers for working with template objects for preview.
7
+ *
7
8
  * @handle /api/content/template-previews
9
+ *
10
+ * @description This module provides a set of controllers for managing and retrieving template objects designed for preview purposes.
8
11
  */
9
12
  export default class TemplatePreviewsApi extends AsyncModules implements ITemplatesPreview {
10
13
  protected state: StateModule;
@@ -13,27 +16,28 @@ export default class TemplatePreviewsApi extends AsyncModules implements ITempla
13
16
  /**
14
17
  * Get all template objects.
15
18
  *
16
- * @param {string} [langCode] - Optional parameter language code
19
+ * @handleName getTemplatePreviews
17
20
  *
18
- * @returns Returns all TemplatePreviewsEntity template objects
21
+ * @param {string} [langCode] - Language code. Default: "en_US".
22
+ *
23
+ * @return {ITemplatesPreviewEntity[]} - Returns all TemplatePreviewsEntity template objects.
24
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
25
+ *
26
+ * @description This method is used to fetch all available template objects.
19
27
  */
20
28
  getTemplatePreviews(langCode?: string): Promise<Array<ITemplatesPreviewEntity> | IError>;
21
29
  /**
22
- * Get one template object by id.
30
+ * Retrieves a template object by its marker.
23
31
  *
24
- * @param {number} [id] - Product marker
25
- * @param {string} [langCode] - Optional parameter language code
32
+ * @handleName getTemplatePreviewByMarker
26
33
  *
27
- * @returns Returns a TemplatePreviewsEntity object
28
- */
29
- getTemplatePreviewById(id: number, langCode?: string): Promise<ITemplatesPreviewEntity | IError>;
30
- /**
31
- * Get one template object by marker.
34
+ * @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'.
35
+ * @param {string} [langCode] - Language code. Default: "en_US".
32
36
  *
33
- * @param {string} [marker] - Product marker
34
- * @param {string} [langCode] - Optional parameter language code
37
+ * @return {TemplatePreviewsEntity} - A promise that resolves to a TemplatePreviewsEntity object representing the template.
38
+ * @throws {IError} - Throws an error object if there is an issue during the fetch operation.
35
39
  *
36
- * @returns Returns a TemplatePreviewsEntity object
40
+ * @description This method is used to fetch a specific template object based on the provided marker.
37
41
  */
38
42
  getTemplatePreviewByMarker(marker: string, langCode?: string): Promise<ITemplatesPreviewEntity | IError>;
39
43
  }
@@ -5,8 +5,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const asyncModules_1 = __importDefault(require("../base/asyncModules"));
7
7
  /**
8
- * Controllers for working with template objects for preview
8
+ * Controllers for working with template objects for preview.
9
+ *
9
10
  * @handle /api/content/template-previews
11
+ *
12
+ * @description This module provides a set of controllers for managing and retrieving template objects designed for preview purposes.
10
13
  */
11
14
  class TemplatePreviewsApi extends asyncModules_1.default {
12
15
  constructor(state) {
@@ -16,33 +19,31 @@ class TemplatePreviewsApi extends asyncModules_1.default {
16
19
  /**
17
20
  * Get all template objects.
18
21
  *
19
- * @param {string} [langCode] - Optional parameter language code
22
+ * @handleName getTemplatePreviews
20
23
  *
21
- * @returns Returns all TemplatePreviewsEntity template objects
24
+ * @param {string} [langCode] - Language code. Default: "en_US".
25
+ *
26
+ * @return {ITemplatesPreviewEntity[]} - Returns all TemplatePreviewsEntity template objects.
27
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
28
+ *
29
+ * @description This method is used to fetch all available template objects.
22
30
  */
23
31
  async getTemplatePreviews(langCode = this.state.lang) {
24
32
  const result = await this._fetchGet(`?langCode=${langCode}`);
25
33
  return this._normalizeData(result, langCode);
26
34
  }
27
35
  /**
28
- * Get one template object by id.
36
+ * Retrieves a template object by its marker.
29
37
  *
30
- * @param {number} [id] - Product marker
31
- * @param {string} [langCode] - Optional parameter language code
38
+ * @handleName getTemplatePreviewByMarker
32
39
  *
33
- * @returns Returns a TemplatePreviewsEntity object
34
- */
35
- async getTemplatePreviewById(id, langCode = this.state.lang) {
36
- const result = await this._fetchGet(`/${id}?langCode=${langCode}`);
37
- return this._normalizeData(result, langCode);
38
- }
39
- /**
40
- * Get one template object by marker.
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
+ * @param {string} [langCode] - Language code. Default: "en_US".
41
42
  *
42
- * @param {string} [marker] - Product marker
43
- * @param {string} [langCode] - Optional parameter language code
43
+ * @return {TemplatePreviewsEntity} - A promise that resolves to a TemplatePreviewsEntity object representing the template.
44
+ * @throws {IError} - Throws an error object if there is an issue during the fetch operation.
44
45
  *
45
- * @returns Returns a TemplatePreviewsEntity object
46
+ * @description This method is used to fetch a specific template object based on the provided marker.
46
47
  */
47
48
  async getTemplatePreviewByMarker(marker, langCode = this.state.lang) {
48
49
  const result = await this._fetchGet(`/marker/${marker}?langCode=${langCode}`);
@@ -1,28 +1,50 @@
1
1
  import type { AttributeType, IError } from '../base/utils';
2
2
  /**
3
- * Represents an interface object of Templates Preview Api.
3
+ * @interface ITemplatesPreview
4
4
  *
5
- * @interface
6
5
  * @property {function} getTemplatesPreview - Get all template objects.
7
6
  * @property {function} getTemplatesPreviewById - Get one template object by id.
8
7
  * @property {function} getTemplatesPreviewByMarker - Get one template object by marker.
8
+ *
9
+ * @description This interface defines methods for retrieving template previews in the system, including fetching all previews, specific previews by ID, and by marker.
9
10
  */
10
11
  interface ITemplatesPreview {
12
+ /**
13
+ * Retrieves all template preview objects.
14
+ *
15
+ * @param {string} langCode - Language code for localization. Default: "en_US".
16
+ *
17
+ * @returns {ITemplatesPreviewEntity[]} A promise resolving to an array of template preview entities or an error.
18
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
19
+ */
11
20
  getTemplatePreviews(langCode: string): Promise<Array<ITemplatesPreviewEntity> | IError>;
12
- getTemplatePreviewById(id: number, langCode: string): Promise<ITemplatesPreviewEntity | IError>;
21
+ /**
22
+ * Retrieves a specific template preview object by its marker.
23
+ *
24
+ * @param {string} marker - The marker of the template preview. Example: 'template_12345'.
25
+ * @param {string} [langCode] - Language code for localization. Default: "en_US".
26
+ *
27
+ * @returns {ITemplatesPreviewEntity} A promise resolving to the template preview entity or an error.
28
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
29
+ */
13
30
  getTemplatePreviewByMarker(marker: string, langCode: string): Promise<ITemplatesPreviewEntity | IError>;
14
31
  }
15
32
  /**
16
- * Represents a template preview entity object.
33
+ * @interface ITemplatesPreviewEntity
34
+ *
35
+ * @property {number} id - The unique identifier of the position. Example: 12345.
36
+ * @property {number} version - The version number of the object. Example: 1.
37
+ * @property {string} identifier - The textual identifier for the record field. Example: 'template_12345'.
38
+ * @property {AttributeType} attributeValues - Attribute values from index. Example: .
39
+ * @property {string} attributeSetIdentifier - Text identifier used for a set of attributes. Example: 'attribute_set_1'.
40
+ * @property {string} title - The name of the template preview. Example: 'Product Template'.
41
+ * @property {number} position - The position of the object. Example: 1.
42
+ * @property {object} proportions - Object contains info by proportions template preview. Example: .
43
+ * @property {IProportion | null} proportions.horizontal - Horizontal proportion of the template preview. Example: .
44
+ * @property {IProportion | null} proportions.vertical - Vertical proportion of the template preview. Example: .
45
+ * @property {ISquare} proportions.square - Square proportion of the template preview. Example: .
17
46
  *
18
- * @interface
19
- * @property {number} id - The unique identifier of the position.
20
- * @property {string} identifier - The textual identifier for the record field.
21
- * @property {object} proportion - Object contains info by proportion template preview.
22
- * @property {Record<string, any>} localizeInfos - The name of the template, taking into account localization.
23
- * @property {number} position - The position of the object.
24
- * @property {AttributeType} attributeValues - Attribute values from index.
25
- * @property {string} attributeSetIdentifier - Text identifier used for a set of attributes
47
+ * @description This interface defines the structure of a template preview entity, including its identifiers, attributes, proportions, and title.
26
48
  */
27
49
  interface ITemplatesPreviewEntity {
28
50
  id: number;
@@ -30,36 +52,42 @@ interface ITemplatesPreviewEntity {
30
52
  identifier: string;
31
53
  attributeValues: AttributeType;
32
54
  attributeSetIdentifier?: string | null;
33
- proportion: {
34
- horizontal: IProportion | null;
35
- vertical: IProportion | null;
36
- square: ISquare;
55
+ proportions: {
56
+ default: {
57
+ horizontal: IProportion | null;
58
+ vertical: IProportion | null;
59
+ square: ISquare;
60
+ };
37
61
  };
38
62
  title: string;
39
63
  position: number;
64
+ isUsed: boolean;
40
65
  }
41
66
  /**
42
- * IProportion
67
+ * @interface IProportion
68
+ *
69
+ * @property {string | number | null} width - width of the template preview. Example: 100.
70
+ * @property {string | number | null} height - height of the template preview. Example: 200.
71
+ * @property {string} marker - marker of the template preview. Example: 'template_12345'.
72
+ * @property {string} alignmentType - alignment type of the template preview. Example: 'center'.
43
73
  *
44
- * @property {string | number | null} width -
45
- * @property {string | number | null} height -
46
- * @property {string} marker -
47
- * @property {string} alignmentType -
74
+ * @description Represents a proportion object used in template previews.
48
75
  */
49
76
  interface IProportion {
50
- width: string | number | null;
51
- height: string | number | null;
52
- marker: string;
77
+ width: number | null;
78
+ height: number | null;
53
79
  alignmentType: string;
54
80
  }
55
81
  /**
56
- * ISquare
57
- * @property {string} marker -
58
- * @property {number | string} side -
59
- * @property {string} alignmentType -
82
+ * @interface ISquare
83
+ *
84
+ * @property {string} marker - Marker of the square template preview. Example: 'square_template_12345'.
85
+ * @property {number | string} side - Side length of the square template preview, can be a number or string. Example: 100.
86
+ * @property {string} alignmentType - Alignment type of the square template preview. Example: 'center'.
87
+ *
88
+ * @description Represents a square proportion object used in template previews.
60
89
  */
61
90
  interface ISquare {
62
- marker: string;
63
91
  side: number | string;
64
92
  alignmentType: string;
65
93
  }
@@ -5,6 +5,7 @@ import type { IUserBody, IUserEntity, IUsers } from './usersInterfaces';
5
5
  /**
6
6
  * Controllers for working with users
7
7
  * @handle /api/content/users
8
+ * @description This module provides various methods to manage users, including creating, retrieving, updating, and deleting user data. It requires proper authorization to access these endpoints.
8
9
  */
9
10
  export default class UsersApi extends AsyncModules implements IUsers {
10
11
  protected state: StateModule;
@@ -13,63 +14,66 @@ export default class UsersApi extends AsyncModules implements IUsers {
13
14
  /**
14
15
  * Getting the data of an authorized user.
15
16
  *
16
- * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
17
+ * @handleName getUser
18
+ *
19
+ * @param {string} [langCode] - Language code. Default: "en_US".
20
+ *
21
+ * @return {IUserEntity} Returns a promise that resolves to the user entity object if successful; otherwise, returns an error object.
22
+ * @throws {IError} If there is an error during the fetch operation, it will return an error object.
17
23
  *
18
- * @param {string} [langCode] - lang code.
24
+ * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
19
25
  */
20
26
  getUser(langCode?: string): Promise<IUserEntity | IError>;
21
27
  /**
22
28
  * Updating a single user object.
23
29
  *
30
+ * @handleName updateUser
31
+ *
32
+ * @param {object} body - Request body. Example: {"formIdentifier": "reg", "authData": [{"marker": "password", "value": "12345"}], "formData": {"marker": "last_name", "type": "string", "value": "Username"}, "notificationData": {"email": "example@oneentry.cloud", "phonePush": ["+99999999999"], "phoneSMS": "+99999999999"}, "state": {}}
33
+ * @param {string} [langCode] - Language code. Default: "en_US".
34
+ *
35
+ * @return {boolean} Returns `true` if the user object was successfully updated; otherwise, returns an error object.
36
+ * @throws {IError} If there is an error during the fetch operation, it will return an error object.
37
+ *
24
38
  * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
25
39
  *
26
- * @param {object} [body] - Request body.
27
- * @param {string} [langCode] - Optional language field
28
- *
29
- * @example
30
- * {
31
- * "formIdentifier": "reg",
32
- * "authData": [
33
- * {
34
- * "marker": "password",
35
- * "value": "12345"
36
- * }
37
- * ],
38
- * "formData": {
39
- * "marker": "last_name",
40
- * "type": "string",
41
- * "value": "Username"
42
- * },
43
- * "notificationData": {
44
- * "email": "example@oneentry.cloud",
45
- * "phonePush": ["+99999999999"],
46
- * "phoneSMS": "+99999999999"
47
- * },
48
- * "state": {}
49
- * }
50
40
  */
51
41
  updateUser(body: IUserBody, langCode?: string): Promise<boolean | IError>;
52
42
  /**
53
43
  * Delete a single user object.
54
44
  *
55
- * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
45
+ * @handleName deleteUser
46
+ *
47
+ * @return {boolean} Returns `true` if the user was successfully deleted; otherwise, returns an error object.
48
+ * @throws {IError} If there is an error during the fetch operation, it will return an error object.
56
49
  *
50
+ * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
57
51
  */
58
52
  deleteUser(): Promise<boolean | IError>;
59
53
  /**
60
- * Adds FCM token for sending Push notification.
54
+ * Adds an FCM (Firebase Cloud Messaging) token for sending push notifications.
61
55
  *
62
- * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
56
+ * @handleName addFCMToken
57
+ *
58
+ * @param {string} token - The cloud messaging token to be added. This token is used to identify the user's device for push notifications. Example: "fcm_token_1234567890abcdefg".
63
59
  *
64
- * @param {string} [token] - Cloud messaging token.
60
+ * @return {boolean} Returns `true` if the token was successfully added; otherwise, returns an error object.
61
+ * @throws {IError} If there is an error during the fetch operation, it will return an error object.
62
+ *
63
+ * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
65
64
  */
66
65
  addFCMToken(token: string): Promise<boolean | IError>;
67
66
  /**
68
- * Delete FCM token.
67
+ * Deletes an FCM (Firebase Cloud Messaging) token.
69
68
  *
70
- * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
69
+ * @handleName deleteFCMToken
70
+ *
71
+ * @param {string} token - The cloud messaging token to be deleted. This token is used to identify the user's device for push notifications and will be removed. Example: "fcm_token_1234567890abcdefg".
71
72
  *
72
- * @param {string} [token] - Cloud messaging token.
73
+ * @return {boolean} Returns `true` if the token was successfully deleted; otherwise, returns an error object.
74
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
75
+ *
76
+ * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
73
77
  */
74
78
  deleteFCMToken(token: string): Promise<boolean | IError>;
75
79
  }
@@ -7,6 +7,7 @@ const asyncModules_1 = __importDefault(require("../base/asyncModules"));
7
7
  /**
8
8
  * Controllers for working with users
9
9
  * @handle /api/content/users
10
+ * @description This module provides various methods to manage users, including creating, retrieving, updating, and deleting user data. It requires proper authorization to access these endpoints.
10
11
  */
11
12
  class UsersApi extends asyncModules_1.default {
12
13
  constructor(state) {
@@ -16,9 +17,14 @@ class UsersApi extends asyncModules_1.default {
16
17
  /**
17
18
  * Getting the data of an authorized user.
18
19
  *
19
- * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
20
+ * @handleName getUser
21
+ *
22
+ * @param {string} [langCode] - Language code. Default: "en_US".
23
+ *
24
+ * @return {IUserEntity} Returns a promise that resolves to the user entity object if successful; otherwise, returns an error object.
25
+ * @throws {IError} If there is an error during the fetch operation, it will return an error object.
20
26
  *
21
- * @param {string} [langCode] - lang code.
27
+ * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
22
28
  */
23
29
  async getUser(langCode = this.state.lang) {
24
30
  const result = await this._fetchGet(`/me?langCode=${langCode}`);
@@ -27,32 +33,16 @@ class UsersApi extends asyncModules_1.default {
27
33
  /**
28
34
  * Updating a single user object.
29
35
  *
36
+ * @handleName updateUser
37
+ *
38
+ * @param {object} body - Request body. Example: {"formIdentifier": "reg", "authData": [{"marker": "password", "value": "12345"}], "formData": {"marker": "last_name", "type": "string", "value": "Username"}, "notificationData": {"email": "example@oneentry.cloud", "phonePush": ["+99999999999"], "phoneSMS": "+99999999999"}, "state": {}}
39
+ * @param {string} [langCode] - Language code. Default: "en_US".
40
+ *
41
+ * @return {boolean} Returns `true` if the user object was successfully updated; otherwise, returns an error object.
42
+ * @throws {IError} If there is an error during the fetch operation, it will return an error object.
43
+ *
30
44
  * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
31
45
  *
32
- * @param {object} [body] - Request body.
33
- * @param {string} [langCode] - Optional language field
34
- *
35
- * @example
36
- * {
37
- * "formIdentifier": "reg",
38
- * "authData": [
39
- * {
40
- * "marker": "password",
41
- * "value": "12345"
42
- * }
43
- * ],
44
- * "formData": {
45
- * "marker": "last_name",
46
- * "type": "string",
47
- * "value": "Username"
48
- * },
49
- * "notificationData": {
50
- * "email": "example@oneentry.cloud",
51
- * "phonePush": ["+99999999999"],
52
- * "phoneSMS": "+99999999999"
53
- * },
54
- * "state": {}
55
- * }
56
46
  */
57
47
  async updateUser(body, langCode = this.state.lang) {
58
48
  if (!('langCode' in body))
@@ -67,30 +57,44 @@ class UsersApi extends asyncModules_1.default {
67
57
  /**
68
58
  * Delete a single user object.
69
59
  *
70
- * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
60
+ * @handleName deleteUser
61
+ *
62
+ * @return {boolean} Returns `true` if the user was successfully deleted; otherwise, returns an error object.
63
+ * @throws {IError} If there is an error during the fetch operation, it will return an error object.
71
64
  *
65
+ * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
72
66
  */
73
67
  async deleteUser() {
74
68
  const result = await this._fetchDelete('/me');
75
69
  return result;
76
70
  }
77
71
  /**
78
- * Adds FCM token for sending Push notification.
72
+ * Adds an FCM (Firebase Cloud Messaging) token for sending push notifications.
79
73
  *
80
- * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
74
+ * @handleName addFCMToken
75
+ *
76
+ * @param {string} token - The cloud messaging token to be added. This token is used to identify the user's device for push notifications. Example: "fcm_token_1234567890abcdefg".
81
77
  *
82
- * @param {string} [token] - Cloud messaging token.
78
+ * @return {boolean} Returns `true` if the token was successfully added; otherwise, returns an error object.
79
+ * @throws {IError} If there is an error during the fetch operation, it will return an error object.
80
+ *
81
+ * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
83
82
  */
84
83
  async addFCMToken(token) {
85
84
  const result = await this._fetchPost(`/me/fcm-token/${token}`);
86
85
  return result;
87
86
  }
88
87
  /**
89
- * Delete FCM token.
88
+ * Deletes an FCM (Firebase Cloud Messaging) token.
90
89
  *
91
- * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
90
+ * @handleName deleteFCMToken
91
+ *
92
+ * @param {string} token - The cloud messaging token to be deleted. This token is used to identify the user's device for push notifications and will be removed. Example: "fcm_token_1234567890abcdefg".
92
93
  *
93
- * @param {string} [token] - Cloud messaging token.
94
+ * @return {boolean} Returns `true` if the token was successfully deleted; otherwise, returns an error object.
95
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
96
+ *
97
+ * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
94
98
  */
95
99
  async deleteFCMToken(token) {
96
100
  const result = await this._fetchDelete(`/me/fcm-token/${token}`);