oneentry 1.0.123 → 1.0.125

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 (76) hide show
  1. package/README.md +24 -22
  2. package/dist/admins/adminsApi.d.ts +30 -9
  3. package/dist/admins/adminsApi.js +30 -9
  4. package/dist/admins/adminsInterfaces.d.ts +77 -32
  5. package/dist/attribute-sets/attributeSetsApi.d.ts +36 -22
  6. package/dist/attribute-sets/attributeSetsApi.js +41 -25
  7. package/dist/attribute-sets/attributeSetsInterfaces.d.ts +133 -39
  8. package/dist/auth-provider/authProviderApi.d.ts +209 -88
  9. package/dist/auth-provider/authProviderApi.js +226 -87
  10. package/dist/auth-provider/authProvidersInterfaces.d.ts +345 -18
  11. package/dist/base/asyncModules.d.ts +38 -28
  12. package/dist/base/asyncModules.js +178 -47
  13. package/dist/base/result.js +23 -0
  14. package/dist/base/syncModules.d.ts +48 -44
  15. package/dist/base/syncModules.js +84 -64
  16. package/dist/base/utils.d.ts +1 -1
  17. package/dist/blocks/blocksApi.d.ts +48 -27
  18. package/dist/blocks/blocksApi.js +48 -27
  19. package/dist/blocks/blocksInterfaces.d.ts +126 -32
  20. package/dist/events/eventsApi.d.ts +45 -12
  21. package/dist/events/eventsApi.js +47 -12
  22. package/dist/events/eventsInterfaces.d.ts +50 -3
  23. package/dist/file-uploading/fileUploadingApi.d.ts +57 -29
  24. package/dist/file-uploading/fileUploadingApi.js +57 -30
  25. package/dist/file-uploading/fileUploadingInterfaces.d.ts +90 -17
  26. package/dist/forms/formsApi.d.ts +20 -9
  27. package/dist/forms/formsApi.js +19 -8
  28. package/dist/forms/formsInterfaces.d.ts +86 -23
  29. package/dist/formsData/formsDataApi.d.ts +33 -21
  30. package/dist/formsData/formsDataApi.js +33 -21
  31. package/dist/formsData/formsDataInterfaces.d.ts +212 -41
  32. package/dist/general-types/generalTypesApi.d.ts +11 -2
  33. package/dist/general-types/generalTypesApi.js +10 -1
  34. package/dist/general-types/generalTypesInterfaces.d.ts +17 -6
  35. package/dist/index.d.ts +2 -2
  36. package/dist/index.js +2 -2
  37. package/dist/integration-collections/integrationCollectionsApi.d.ts +134 -81
  38. package/dist/integration-collections/integrationCollectionsApi.js +135 -83
  39. package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +246 -43
  40. package/dist/locales/localesApi.d.ts +5 -1
  41. package/dist/locales/localesApi.js +5 -1
  42. package/dist/locales/localesInterfaces.d.ts +19 -12
  43. package/dist/menus/menusApi.d.ts +6 -3
  44. package/dist/menus/menusApi.js +6 -3
  45. package/dist/menus/menusInterfaces.d.ts +60 -21
  46. package/dist/orders/ordersApi.d.ts +84 -66
  47. package/dist/orders/ordersApi.js +91 -71
  48. package/dist/orders/ordersInterfaces.d.ts +282 -86
  49. package/dist/pages/pagesApi.d.ts +101 -42
  50. package/dist/pages/pagesApi.js +93 -39
  51. package/dist/pages/pagesInterfaces.d.ts +218 -75
  52. package/dist/payments/paymentsApi.d.ts +53 -39
  53. package/dist/payments/paymentsApi.js +55 -40
  54. package/dist/payments/paymentsInterfaces.d.ts +121 -56
  55. package/dist/product-statuses/productStatusesApi.d.ts +17 -17
  56. package/dist/product-statuses/productStatusesApi.js +16 -19
  57. package/dist/product-statuses/productStatusesInterfaces.d.ts +43 -14
  58. package/dist/products/productsApi.d.ts +309 -177
  59. package/dist/products/productsApi.js +313 -167
  60. package/dist/products/productsInterfaces.d.ts +447 -81
  61. package/dist/system/systemApi.d.ts +42 -12
  62. package/dist/system/systemApi.js +43 -10
  63. package/dist/system/systemInterfaces.d.ts +7 -0
  64. package/dist/templates/templatesApi.d.ts +24 -20
  65. package/dist/templates/templatesApi.js +22 -21
  66. package/dist/templates/templatesInterfaces.d.ts +48 -22
  67. package/dist/templates-preview/templatesPreviewApi.d.ts +17 -17
  68. package/dist/templates-preview/templatesPreviewApi.js +16 -19
  69. package/dist/templates-preview/templatesPreviewInterfaces.d.ts +85 -32
  70. package/dist/users/usersApi.d.ts +59 -35
  71. package/dist/users/usersApi.js +62 -35
  72. package/dist/users/usersInterfaces.d.ts +136 -14
  73. package/dist/web-socket/wsApi.d.ts +4 -5
  74. package/dist/web-socket/wsApi.js +4 -5
  75. package/dist/web-socket/wsInterfaces.d.ts +2 -1
  76. package/package.json +20 -18
@@ -1,21 +1,42 @@
1
- import type { IError } from '../base/utils';
1
+ import type { IError, ILocalizeInfo } from '../base/utils';
2
2
  /**
3
- * Represents an interface object of AttributesSets Api.
3
+ * @interface IAttributesSets
4
4
  *
5
5
  * @property {function} getAttributesByMarker - Get all attributes with data from the attribute sets.
6
6
  * @property {function} getSingleAttributeByMarkerSet - Get a single attribute with data from the attribute sets.
7
+ *
8
+ * @description This interface defines methods for retrieving attributes based on markers and language codes.
7
9
  */
8
10
  interface IAttributesSets {
9
- getAttributesByMarker(marker: string, langCode: string): Promise<Array<IAttributesSetsEntity> | IError>;
11
+ /**
12
+ * Fetches attributes by a specific marker.
13
+ *
14
+ * @param {string} marker - The marker used to identify the attribute set. Example: "productAttributes".
15
+ * @param {string} [langCode] - The language code for localization purposes. Default: 'en_US'.
16
+ * @returns {IAttributeSetsEntity[]} A promise that resolves to an array of attribute set entities or an error.
17
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
18
+ */
19
+ getAttributesByMarker(marker: string, langCode: string): Promise<IAttributeSetsEntity[] | IError>;
20
+ /**
21
+ * Fetches a single attribute by its marker and the set marker.
22
+ *
23
+ * @param {string} attributeMarker - The marker identifying the attribute. Example: "color".
24
+ * @param {string} setMarker - The marker identifying the attribute set. Example: "productAttributes".
25
+ * @param {string} [langCode] - The language code for localization purposes. Default: "en_US".
26
+ * @returns {IAttributesSetsEntity} A promise that resolves to an attribute set entity or an error.
27
+ */
10
28
  getSingleAttributeByMarkerSet(attributeMarker: string, setMarker: string, langCode: string): Promise<IAttributesSetsEntity | IError>;
11
29
  }
12
30
  /**
13
- * Represents an interface object of IListTitle.
31
+ * Interface representing the structure of a list item.
32
+ *
33
+ * @interface IListTitle
14
34
  *
15
- * @property {string} title - The title or name associated with the list item.
16
- * @property {number | string} value - The value of the list item, which can be either a number or a string depending on the context.
17
- * @property {string | number | null} position - The position of the list item, which can be represented as a string, number, or null if not applicable.
35
+ * @property {string} title - The title or name associated with the list item. Example: "Item Name".
36
+ * @property {number | string} value - The value of the list item, which can be either a number or a string depending on the context. Example: 42
37
+ * @property {string | number | null} position - The position of the list item, which can be represented as a string, number, or null if not applicable. Example: 1
18
38
  * @property {object} extended - An object containing additional properties or metadata related to the list item. This could include any extra details that extend the basic information.
39
+ * @description This interface defines the structure of a list item, which includes properties for the title, value, position, and extended information.
19
40
  */
20
41
  interface IListTitle {
21
42
  title: string;
@@ -26,63 +47,136 @@ interface IListTitle {
26
47
  type: string | null;
27
48
  };
28
49
  }
50
+ /**
51
+ * AttributeType
52
+ *
53
+ * @type IAdminQuery
54
+ * @type {AttributeType}
55
+ * @description This type defines the possible values for attribute types used in the system.
56
+ */
29
57
  type AttributeType = 'string' | 'text' | 'textWithHeader' | 'integer' | 'real' | 'float' | 'dateTime' | 'date' | 'time' | 'file' | 'image' | 'groupOfImages' | 'radioButton' | 'list' | 'button';
30
58
  /**
31
- * Represents a template entity object.
59
+ * Interface representing an attribute set entity.
32
60
  *
33
- * @interface
34
- * @property {AttributeType} type - Attribute type.
35
- * @property {string} marker - Textual identifier of the attribute (marker).
36
- * @property {number} position - Position number for sorting.
37
- * @property {Record<string, any>} validators - Set of validators for validation.
38
- * @property {Record<string, any>} localizeInfos - The name of the template, taking into account localization.
39
- * @property {Array<Record<string, any>>} listTitles - Array of values (with extended data) for list and radioButton attributes.
40
- * @property {Array<Record<string, any>>} settings - Additional attribute settings (optional).
61
+ * @interface IAttributesSetsEntity
41
62
  *
63
+ * @property {AttributeType} type - Attribute type. Example: "string", "text", "integer", "etc".
64
+ * @property {any} [value] - Value of the attribute, which can be of any type.
65
+ * @property {string} marker - Textual identifier of the attribute (marker). Example: "color", "size", "etc".
66
+ * @property {number} position - Position number for sorting. Example: 1
67
+ * @property {IListTitle[] | Record<string, any>} [listTitles] - Array of values (with extended data) for list and radioButton attributes. Example:
68
+ [
69
+ {
70
+ "title": "red",
71
+ "value": 1,
72
+ "position": 1,
73
+ "extendedValue": null,
74
+ "extendedValueType": null
75
+ },
76
+ {
77
+ "title": "yellow",
78
+ "value": 2,
79
+ "position": 2,
80
+ "extendedValue": null,
81
+ "extendedValueType": null
82
+ }
83
+ ]
84
+ * @property {Record<string, any>} [validators] - Set of validators for validation. Example:
85
+ {
86
+ "requiredValidator": {
87
+ "strict": true
88
+ },
89
+ "defaultValueValidator": {
90
+ "fieldDefaultValue": 11
91
+ }
92
+ }
93
+ * @property {ILocalizeInfo} localizeInfos - The name of the template, taking into account localization. Example:
94
+ {
95
+ "title": "My attribute"
96
+ }
97
+ * @property {Record<string, any>} [additionalFields] - Additional fields for the attribute (optional).
98
+ * @property {Record<string, any>} [settings] - Additional attribute settings (optional).
99
+ * @description This interface defines the structure of an attribute set entity, including its type, marker, position, validators, localization information, list titles, additional fields, and settings.
42
100
  */
43
101
  interface IAttributesSetsEntity {
44
102
  type: AttributeType;
103
+ value?: any;
45
104
  marker: string;
46
105
  position: number;
47
- validators: object;
48
- localizeInfos: Record<string, any>;
49
- listTitles: Array<IListTitle> | Record<string, any>;
106
+ listTitles?: IListTitle[] | Record<string, any>;
107
+ validators?: Record<string, any>;
108
+ localizeInfos: ILocalizeInfo;
50
109
  additionalFields?: Record<string, any>;
51
110
  settings?: Record<string, any>;
52
111
  }
53
112
  /**
54
- * Represents an interface object of IAttributeSetsEntity.
113
+ * Interface representing an attribute set entity.
114
+ *
115
+ * @interface IAttributeSetsEntity
55
116
  *
56
- * @property {number} id - The unique identifier of the attribute set entity.
57
- * @property {string} identifier - A string that uniquely identifies the attribute set.
58
- * @property {boolean} isVisible - Indicates whether the attribute set is visible or not.
59
- * @property {any} schema - The schema definition associated with the attribute set. This could represent the structure or rules for the data.
60
- * @property {string} title - The title or name of the attribute set.
61
- * @property {any} type - The type of the attribute set, which could be a specific classification or category.
62
- * @property {number} typeId - The numerical identifier representing the type of the attribute set.
63
- * @property {string} updatedDate - The date when the attribute set was last updated, represented as a string. Consider using Date for better date handling.
64
- * @property {number} version - The version number of the attribute set, used for tracking changes or updates.
117
+ * @property {number} id - The unique identifier of the attribute set entity. Example: 123.
118
+ * @property {string} updatedDate - The date when the attribute set was last updated, represented as a string. Example: "2023-10-01T12:00:00Z".
119
+ * @property {number} version - The version number of the attribute set, used for tracking changes or updates. Example: 1.
120
+ * @property {string} identifier - A string that uniquely identifies the attribute set. Example: "attributeSet1".
121
+ * @property {number} typeId - The numerical identifier representing the type of the attribute set. Example: 1.
122
+ * @property {string} title - The title or name of the attribute set. Example: "Product Attributes".
123
+ * @property {any} schema - The schema definition associated with the attribute set. This could represent the structure or rules for the data. Example:
124
+ {
125
+ "attribute1": {
126
+ "id": 1,
127
+ "type": "string",
128
+ "isPrice": false,
129
+ "original": true,
130
+ "identifier": "string",
131
+ "localizeInfos": {
132
+ "en_US": { "title": "String" }
133
+ }
134
+ }
135
+ }
136
+ * @property {boolean} isVisible - Indicates whether the attribute set is visible or not. Example: true.
137
+ * @property {any} properties - Additional properties associated with the attribute set, which can be of any type. Example:
138
+ {
139
+ "color": "red",
140
+ "size": "M"
141
+ }
142
+ * @property {any} type - The type of the attribute set, which could be a specific classification or category. Example: "product", "user", "etc".
143
+ * @property {number} position - The position number for sorting the attribute set. Example: 1.
144
+ * @description This interface defines the structure of an attribute set entity.
65
145
  */
66
146
  interface IAttributeSetsEntity {
67
147
  id: number;
148
+ updatedDate: string;
149
+ version: number;
68
150
  identifier: string;
69
- isVisible: boolean;
70
- position: number;
71
- schema: any;
151
+ typeId: number;
72
152
  title: string;
153
+ schema: any;
154
+ isVisible: boolean;
155
+ properties: any;
73
156
  type: any;
74
- typeId: number;
75
- updatedDate: string;
76
- version: number;
157
+ position: number;
77
158
  }
78
159
  /**
79
- * Represents an interface object of IAttributesSetsResponce.
160
+ * Interface defining the structure of a response object for attribute sets.
161
+ *
162
+ * @interface IAttributesSetsResponse
80
163
  *
81
- * @property {IAttributeSetsEntity[]} items - IAttributeSetsEntity
82
- * @property {number} total - total items
164
+ * @property {number} total - Total items. Example: 100.
165
+ * @property {IAttributeSetsEntity[]} items - IAttributeSetsEntity array containing attribute set entities. Example:
166
+ [
167
+ {
168
+ "id": 1,
169
+ "identifier": "set1"
170
+ },
171
+ {
172
+ "id": 2,
173
+ "identifier": "set2"
174
+ }
175
+ ]
176
+ * @description This interface defines the structure of a response object for attribute sets.
83
177
  */
84
178
  interface IAttributesSetsResponse {
85
- items: IAttributeSetsEntity[];
86
179
  total: number;
180
+ items: IAttributeSetsEntity[];
87
181
  }
88
182
  export type { AttributeType, IAttributeSetsEntity, IAttributesSets, IAttributesSetsEntity, IAttributesSetsResponse, IListTitle, };
@@ -1,142 +1,263 @@
1
1
  import AsyncModules from '../base/asyncModules';
2
2
  import type StateModule from '../base/stateModule';
3
3
  import type { IError } from '../base/utils';
4
- import type { IAuthEntity, IAuthPostBody, IAuthProvider, IAuthProvidersEntity, ISignUpData, ISignUpEntity } from './authProvidersInterfaces';
4
+ import type { IAuthEntity, IAuthPostBody, IAuthProvider, IAuthProvidersEntity, IOAuthSignUpData, ISignUpData, ISignUpEntity } from './authProvidersInterfaces';
5
5
  /**
6
6
  * Controllers for working with auth services.
7
+ *
7
8
  * @handle /api/content/users-auth-providers
9
+ * @class AuthProviderApi
10
+ * @extends AsyncModules
11
+ * @implements {IAuthProvider}
12
+ *
13
+ * @description This class provides methods for user registration, authentication, and management of authentication providers.
8
14
  */
9
15
  export default class AuthProviderApi extends AsyncModules implements IAuthProvider {
10
16
  protected state: StateModule;
11
17
  protected _url: string;
12
18
  constructor(state: StateModule);
13
19
  /**
14
- * User registration
15
- *
16
- * @param {string} [marker] - The text identifier of the authorization provider. Example - email
17
- * @param {ISignUpData} [body] - Request body
18
- * @param {string} [langCode] - Optional language field
19
- *
20
- * @example
21
- * const body = {
22
- * "formIdentifier": "reg",
23
- * "authData": [
24
- * {
25
- * "marker": "login",
26
- * "value": "example@oneentry.cloud"
27
- * },
28
- * {
29
- * "marker": "password",
30
- * "value": "12345"
31
- * }
32
- * ],
33
- * "formData": [
34
- * {
35
- * "marker": "last_name",
36
- * "type": "string",
37
- * "value": "Name"
38
- * }
39
- * ],
40
- * "notificationData": {
41
- * "email": "example@oneentry.cloud",
42
- * "phonePush": ["+99999999999"],
43
- * "phoneSMS": "+99999999999"
44
- * }
45
- * }
20
+ * User registration.
21
+ *
22
+ * @handleName signUp
23
+ *
24
+ * @param {string} marker - The text identifier of the authorization provider. Example: "email".
25
+ * @param {ISignUpData} body - Request body. Example:
26
+ {
27
+ "formIdentifier": "reg",
28
+ "authData": [
29
+ {
30
+ "marker": "login",
31
+ "value": "example@oneentry.cloud"
32
+ },
33
+ {
34
+ "marker": "password",
35
+ "value": "12345"
36
+ }
37
+ ],
38
+ "formData": [
39
+ {
40
+ "marker": "last_name",
41
+ "type": "string",
42
+ "value": "Name"
43
+ }
44
+ ],
45
+ "notificationData": {
46
+ "email": "example@oneentry.cloud",
47
+ "phonePush": ["+99999999999"],
48
+ "phoneSMS": "+99999999999"
49
+ }
50
+ }
51
+ * @param {string} body.formIdentifier - The identifier for the registration form. Example: "reg".
52
+ * @param {{ marker: string; value: string }[]} body.authData - An array of authentication data objects, each containing a marker and its corresponding value. Example:
53
+ [
54
+ {
55
+ "marker": "login",
56
+ "value": "example@oneentry.cloud"
57
+ },
58
+ {
59
+ "marker": "password",
60
+ "value": "12345"
61
+ }
62
+ ]
63
+ * @param {IAuthFormData | IAuthFormData[]} body.formData - The form data for the registration, which can be a single object or an array of objects. Example:
64
+ {
65
+ "marker": "last_name",
66
+ "type": "string",
67
+ "value": "Name"
68
+ }
69
+ * @param {Object} body.notificationData - An object containing notification data, including email, phonePush, and phoneSMS. Example:
70
+ {
71
+ "email": "example@oneentry.cloud",
72
+ "phonePush": ["+99999999999"],
73
+ "phoneSMS": "+99999999999"
74
+ }
75
+ * @param {string} [langCode] - Language code. Default: "en_US".
76
+ * @return {ISignUpEntity} Returns a user object.
77
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
78
+ * @description User registration (❗️For a provider with user activation, the activation code is sent through the corresponding user notification method).
46
79
  */
47
80
  signUp(marker: string, body: ISignUpData, langCode?: string): Promise<ISignUpEntity | IError>;
48
81
  /**
49
- * Getting a user activation code. The code is returned via the appropriate user notification method
82
+ * Getting a user activation code. The code is returned via the appropriate user notification method.
83
+ *
84
+ * @handleName generateCode
50
85
  *
51
- * @param {string} [marker] - The text identifier of the authorization provider. Example - email
52
- * @param {string} [userIdentifier] - The text identifier of the user's object (user login)
53
- * @param {string} [eventIdentifier] - Text identifier of the event object for which the code is generated
86
+ * @param {string} marker - The text identifier of the authorization provider. Example: "email".
87
+ * @param {string} userIdentifier - The text identifier of the user's object (user login). Example: "example@oneentry.cloud".
88
+ * @param {string} eventIdentifier - Text identifier of the event object for which the code is generated. Example: "user_registration".
89
+ * @return {void} Returns void if the code is successfully generated, or an error object if there was an issue.
90
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
91
+ * @description Obtaining a code to activate the user.
54
92
  */
55
93
  generateCode(marker: string, userIdentifier: string, eventIdentifier: string): Promise<void | IError>;
56
94
  /**
57
95
  * User activation code verification. Returns true (if the code is correct) or false (if it is incorrect).
58
96
  *
59
- * @param {string} [marker] - The text identifier of the authorization provider. Example - email
60
- * @param {string} [userIdentifier] - The text identifier of the user's object (user login)
61
- * @param {string} [eventIdentifier] - Text identifier of the event object for which the code is generated
62
- * @param {string} [code] - Service code
97
+ * @handleName checkCode
98
+ *
99
+ * @param {string} marker - The text identifier of the authorization provider. Example: "email".
100
+ * @param {string} userIdentifier - The text identifier of the user's object (user login). Example: "example@oneentry.cloud".
101
+ * @param {string} eventIdentifier - Text identifier of the event object for which the code is generated. Example: "user_registration".
102
+ * @param {string} code - Service code. Example: "123456".
103
+ * @return {boolean} Returns true if the code is correct, or an error object if there was an issue.
104
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
105
+ * @description Checking the user activation code
63
106
  */
64
107
  checkCode(marker: string, userIdentifier: string, eventIdentifier: string, code: string): Promise<boolean | IError>;
65
108
  /**
66
109
  * User activate.
67
110
  *
68
- * @param {string} marker - The text identifier of the authorization provider. Example - email
69
- * @param {string} userIdentifier - The text identifier of the user's object (user login)
70
- * @param {string} code - Service code
111
+ * @handleName activateUser
112
+ *
113
+ * @param {string} marker - The text identifier of the authorization provider. Example: "email".
114
+ * @param {string} userIdentifier - The text identifier of the user's object (user login). Example: "example@oneentry.cloud".
115
+ * @param {string} code - Service code. Example: "123456".
116
+ * @return {boolean} Returns true if the user was successfully activated, or an error object if there was an issue.
117
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
118
+ * @description User activation.
71
119
  */
72
120
  activateUser(marker: string, userIdentifier: string, code: string): Promise<boolean | IError>;
73
121
  /**
74
- * User authorization
75
- *
76
- * @param {string} marker - The text identifier of the authorization provider. Example - email
77
- * @param {IAuthPostBody} data - Array of objects contains auth information
78
- *
79
- * @example
80
- * const data = {
81
- * authData: [
82
- * {
83
- * marker: "login",
84
- * value: "test"
85
- * },
86
- * {
87
- * marker: "password",
88
- * value: "12345"
89
- * }
90
- * ]
91
- * }
122
+ * User authorization.
123
+ *
124
+ * @handleName auth
92
125
  *
126
+ * @param {string} marker - The text identifier of the authorization provider. Example: "email".
127
+ * @param {IAuthPostBody} body - Objects contains auth information. Example:
128
+ {
129
+ "authData": [
130
+ {
131
+ "marker": "login",
132
+ "value": "example@oneentry.cloud"
133
+ },
134
+ {
135
+ "marker": "password",
136
+ "value": "12345"
137
+ }
138
+ ]
139
+ }
140
+ * @param {{ marker: string; value: string | number }[]} body.authData - An array of authentication data objects, each containing a marker and its corresponding value. Example:
141
+ [
142
+ {
143
+ "marker": "login",
144
+ "value": "user@example.com"
145
+ }
146
+ ]
147
+ * @param {string} body.authData[index].marker - The marker for the authentication data. Example: "login".
148
+ * @param {string} body.authData[index].value - The value for the authentication data. Example: "user@example.com".
149
+ *
150
+ * @return {IAuthEntity} Returns an auth entity object.
151
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
152
+ * @description User authorization.
93
153
  */
94
- auth(marker: string, data: IAuthPostBody): Promise<IAuthEntity | IError>;
154
+ auth(marker: string, body: IAuthPostBody): Promise<IAuthEntity | IError>;
95
155
  /**
96
- * Refresh token
156
+ * Refresh token.
97
157
  *
98
- * @param {string} [marker] - The text identifier of the authorization provider. Example - email
99
- * @param {string} [token] - Refresh token
158
+ * @handleName refresh
100
159
  *
160
+ * @param {string} marker - The text identifier of the authorization provider. Example: "email".
161
+ * @param {string} token - Refresh token. Example: "abcdef123456".
162
+ * @return {IAuthEntity} Returns an auth entity object with the following values: accessToken, refreshToken, user, and other auth-related data.
163
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
164
+ * @description User token refresh.
101
165
  */
102
166
  refresh(marker: string, token: string): Promise<IAuthEntity | IError>;
103
167
  /**
104
- * User logout.
168
+ * User account logout.
105
169
  *
106
- * @param {string} marker - The text identifier of the authorization provider. Example - email
107
- * @param {string} token - Refresh token
170
+ * @handleName logout
108
171
  *
172
+ * @param {string} marker - The text identifier of the authorization provider. Example: "email".
173
+ * @param {string} token - Refresh token. Example: "abcdef123456".
174
+ * @return {boolean} Returns true if the logout was successful, or an error object if there was an issue.
175
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
109
176
  * @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.
110
177
  */
111
178
  logout(marker: string, token: string): Promise<boolean | IError>;
112
179
  /**
113
- * Change password
180
+ * Logout of user account on all devices.
181
+ *
182
+ * @handleName logoutAll
114
183
  *
115
- * @param {string} [marker] - The text identifier of the authorization provider. Example - email
116
- * @param {string} [userIdentifier] - The text identifier of the user's object (user login)
117
- * @param {string} [type] - Operation type (1 - for changing password, 2 - for recovery)
118
- * @param {string} [code] - Service code
119
- * @param {string} [newPassword] - New password
120
- * @param {string} [repeatPassword] - Optional variable contains repeat new password for validation
184
+ * @param {string} marker - The text identifier of the authorization provider. Example: "email".
185
+ * @return {boolean} Returns true if the logout was successful, or an error object if there was an issue.
186
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
187
+ * @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.
188
+ */
189
+ logoutAll(marker: string): Promise<boolean | IError>;
190
+ /**
191
+ * Change password.
121
192
  *
122
- * @example
123
- * await AuthProvider.changePassword('email', userIdentifier, type, code, newPassword, repeatPassword);
193
+ * @handleName changePassword
124
194
  *
195
+ * @param {string} marker - The text identifier of the authorization provider. Example: "email".
196
+ * @param {string} userIdentifier - The text identifier of the user's object (user login). Example: "example@oneentry.cloud".
197
+ * @param {string} eventIdentifier - The text identifier of the event. Example: "reg".
198
+ * @param {string} type - Operation type (1 - for changing password, 2 - for recovery). Example: 1.
199
+ * @param {string} code - Service code. Example: "123456".
200
+ * @param {string} newPassword - New password. Example: "newPassword123".
201
+ * @param {string} [repeatPassword] - Optional variable contains repeat new password for validation. Example: "newPassword123".
202
+ * @return {boolean} Returns true if the password was successfully changed, or an error object if there was an issue.
203
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
204
+ * @description User password change (only for tariffs with account activation and the Activation feature enabled).
125
205
  */
126
- changePassword(marker: string, userIdentifier: string, type: number, code: string, newPassword: string, repeatPassword?: string): Promise<boolean | IError>;
206
+ changePassword(marker: string, userIdentifier: string, eventIdentifier: string, type: number, code: string, newPassword: string, repeatPassword?: string): Promise<boolean | IError>;
127
207
  /**
128
- * Get all auth providers objects
208
+ * Get all auth providers objects.
129
209
  *
130
- * @param {string} [langCode] - Language code. Default "en_US"
131
- * @param {number} [offset] - Parameter for pagination. Default 0
132
- * @param {number} [limit] - Parameter for pagination. Default 30
210
+ * @handleName getAuthProviders
211
+ *
212
+ * @param {string} [langCode] - Language code. Default: "en_US".
213
+ * @param {number} [offset] - Parameter for pagination. Default: 0.
214
+ * @param {number} [limit] - Parameter for pagination. Default: 30.
215
+ * @return {IAuthProvidersEntity[]} Returns an array of auth provider objects.
216
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
217
+ * @description Getting all objects of authorization providers.
218
+ */
219
+ getAuthProviders(langCode?: string, offset?: number, limit?: number): Promise<IAuthProvidersEntity[] | IError>;
220
+ /**
221
+ * Get one auth provider object by marker.
222
+ *
223
+ * @handleName getAuthProviderByMarker
224
+ *
225
+ * @param {string} marker - The text identifier of the authorization provider. Example: "email".
226
+ * @param {string} [langCode] - Language code. Default: "en_US".
227
+ * @return {IAuthProvidersEntity} Returns an auth provider object.
228
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
229
+ * @description Getting a single authorization provider object by marker.
133
230
  */
134
- getAuthProviders(langCode?: string, offset?: number, limit?: number): Promise<Array<IAuthProvidersEntity> | IError>;
231
+ getAuthProviderByMarker(marker: string, langCode?: string): Promise<IAuthProvidersEntity | IError>;
135
232
  /**
136
- * Get one auth provider object by marker
233
+ * Getting active user sessions data.
234
+ *
235
+ * @handleName getActiveSessions
236
+ *
237
+ * @param {string} marker - The text identifier of the authorization provider. Example: "email".
238
+ * @return {IAuthProvidersEntity} Returns an auth provider object.
239
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
240
+ * @description Getting a single authorization provider object by marker.
241
+ */
242
+ getActiveSessionsByMarker(marker: string): Promise<any | IError>;
243
+ /**
244
+ * User registration (authorization) via OAUTH.
245
+ *
246
+ * @handleName oauthSignUp
137
247
  *
138
- * @param {string} [marker] - The text identifier of the authorization provider. Example - email
139
- * @param {string} [langCode] - Optional parameter language code. Default "en_US"
248
+ * @param {string} marker - The text identifier of the authorization provider. Example: "email".
249
+ * @param {IOAuthSignUpData} body - Object contains OAuth information for registration. Example:
250
+ {
251
+ "client_id": "34346983-luuct343473qdkqidjopdfp3eb3k4thp.apps.googleusercontent.com",
252
+ "client_secret": "43434343434",
253
+ "code": "4/0AVMBsJgwewewewewewei4D7T6E_fbswxnL3g",
254
+ "grant_type": "authorization_code",
255
+ "redirect_uri": "http://localhost:3000"
256
+ }
257
+ * @param {string} [langCode] - Language code. Default: "en_US".
258
+ * @return {ISignUpEntity} Returns a user object.
259
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
260
+ * @description User registration (authorization) via OAUTH.
140
261
  */
141
- getMarker(marker: string, langCode?: string): Promise<IAuthProvidersEntity | IError>;
262
+ oauthSignUp(marker: string, body: IOAuthSignUpData, langCode?: string): Promise<IAuthEntity | IError>;
142
263
  }