oneentry 1.0.126 → 1.0.128
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.
- package/README.md +0 -2
- package/configure.js +25 -18
- package/dist/admins/adminsApi.d.ts +18 -13
- package/dist/admins/adminsApi.js +18 -13
- package/dist/admins/adminsInterfaces.d.ts +16 -25
- package/dist/attribute-sets/attributeSetsApi.d.ts +14 -15
- package/dist/attribute-sets/attributeSetsApi.js +14 -15
- package/dist/attribute-sets/attributeSetsInterfaces.d.ts +78 -84
- package/dist/auth-provider/authProviderApi.d.ts +53 -79
- package/dist/auth-provider/authProviderApi.js +52 -78
- package/dist/auth-provider/authProvidersInterfaces.d.ts +98 -94
- package/dist/base/asyncModules.d.ts +23 -21
- package/dist/base/asyncModules.js +39 -29
- package/dist/base/result.d.ts +31 -0
- package/dist/base/result.js +32 -5
- package/dist/base/stateModule.d.ts +10 -0
- package/dist/base/stateModule.js +50 -2
- package/dist/base/syncModules.d.ts +42 -50
- package/dist/base/syncModules.js +106 -58
- package/dist/base/utils.d.ts +33 -2
- package/dist/blocks/blocksApi.d.ts +9 -18
- package/dist/blocks/blocksApi.js +9 -18
- package/dist/blocks/blocksInterfaces.d.ts +41 -46
- package/dist/config.d.ts +13 -0
- package/dist/config.js +30 -0
- package/dist/events/eventsApi.d.ts +10 -27
- package/dist/events/eventsApi.js +26 -40
- package/dist/events/eventsInterfaces.d.ts +33 -28
- package/dist/file-uploading/fileUploadingApi.d.ts +12 -17
- package/dist/file-uploading/fileUploadingApi.js +14 -17
- package/dist/file-uploading/fileUploadingInterfaces.d.ts +8 -19
- package/dist/forms/formsApi.d.ts +10 -9
- package/dist/forms/formsApi.js +10 -9
- package/dist/forms/formsInterfaces.d.ts +20 -12
- package/dist/forms-data/formsDataApi.d.ts +24 -28
- package/dist/forms-data/formsDataApi.js +25 -28
- package/dist/forms-data/formsDataInterfaces.d.ts +71 -71
- package/dist/general-types/generalTypesApi.d.ts +5 -5
- package/dist/general-types/generalTypesApi.js +5 -5
- package/dist/general-types/generalTypesInterfaces.d.ts +5 -8
- package/dist/index.d.ts +3 -4
- package/dist/index.js +3 -4
- package/dist/integration-collections/integrationCollectionsApi.d.ts +29 -47
- package/dist/integration-collections/integrationCollectionsApi.js +31 -51
- package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +62 -58
- package/dist/locales/localesApi.d.ts +7 -3
- package/dist/locales/localesApi.js +7 -3
- package/dist/locales/localesInterfaces.d.ts +6 -5
- package/dist/menus/menusApi.d.ts +7 -3
- package/dist/menus/menusApi.js +7 -3
- package/dist/menus/menusInterfaces.d.ts +5 -10
- package/dist/menus/menusInterfaces.js +1 -0
- package/dist/orders/ordersApi.d.ts +17 -25
- package/dist/orders/ordersApi.js +17 -26
- package/dist/orders/ordersInterfaces.d.ts +94 -53
- package/dist/pages/pagesApi.d.ts +47 -60
- package/dist/pages/pagesApi.js +51 -61
- package/dist/pages/pagesInterfaces.d.ts +44 -48
- package/dist/payments/paymentsApi.d.ts +17 -27
- package/dist/payments/paymentsApi.js +17 -31
- package/dist/payments/paymentsInterfaces.d.ts +35 -29
- package/dist/product-statuses/productStatusesApi.d.ts +9 -9
- package/dist/product-statuses/productStatusesApi.js +9 -9
- package/dist/product-statuses/productStatusesInterfaces.d.ts +14 -12
- package/dist/products/productsApi.d.ts +23 -44
- package/dist/products/productsApi.js +24 -44
- package/dist/products/productsInterfaces.d.ts +51 -57
- package/dist/system/systemApi.d.ts +11 -13
- package/dist/system/systemApi.js +12 -13
- package/dist/system/systemInterfaces.d.ts +14 -3
- package/dist/templates/templatesApi.d.ts +8 -11
- package/dist/templates/templatesApi.js +8 -11
- package/dist/templates/templatesInterfaces.d.ts +13 -12
- package/dist/templates-preview/templatesPreviewApi.d.ts +7 -8
- package/dist/templates-preview/templatesPreviewApi.js +7 -8
- package/dist/templates-preview/templatesPreviewInterfaces.d.ts +15 -18
- package/dist/users/usersApi.d.ts +13 -20
- package/dist/users/usersApi.js +13 -20
- package/dist/users/usersInterfaces.d.ts +26 -30
- package/dist/web-socket/wsApi.d.ts +5 -3
- package/dist/web-socket/wsApi.js +6 -3
- package/dist/web-socket/wsInterfaces.d.ts +7 -2
- package/package.json +16 -12
|
@@ -1,27 +1,25 @@
|
|
|
1
1
|
import type { IError, ILocalizeInfo } from '../base/utils';
|
|
2
2
|
/**
|
|
3
3
|
* @interface IAuthProvider
|
|
4
|
-
*
|
|
5
|
-
* @property {
|
|
6
|
-
* @property {
|
|
7
|
-
* @property {
|
|
8
|
-
* @property {
|
|
9
|
-
* @property {
|
|
10
|
-
* @property {
|
|
11
|
-
* @property {
|
|
12
|
-
* @property {
|
|
13
|
-
* @property {
|
|
14
|
-
* @property {
|
|
15
|
-
* @property {
|
|
16
|
-
* @property {
|
|
17
|
-
* @property {function} oauthSignUp - User registration (authorization) via OAUTH.
|
|
18
|
-
*
|
|
4
|
+
* @property {Function} signUp - User registration.
|
|
5
|
+
* @property {Function} generateCode - Getting a user activation code.
|
|
6
|
+
* @property {Function} checkCode - User activation code verification.
|
|
7
|
+
* @property {Function} activateUser - User activate.
|
|
8
|
+
* @property {Function} auth - User authorization.
|
|
9
|
+
* @property {Function} refresh - Refresh token.
|
|
10
|
+
* @property {Function} logout - User logout.
|
|
11
|
+
* @property {Function} logoutAll - User logout.
|
|
12
|
+
* @property {Function} changePassword - Change password.
|
|
13
|
+
* @property {Function} getAuthProviders - Get all auth providers objects.
|
|
14
|
+
* @property {Function} getAuthProviderByMarker - Get one auth provider object by marker.
|
|
15
|
+
* @property {Function} getActiveSessionsByMarker - Get one auth provider object by marker.
|
|
16
|
+
* @property {Function} oauthSignUp - User registration (authorization) via OAUTH.
|
|
19
17
|
* @description This interface defines methods for user authentication and registration through various auth providers.
|
|
20
18
|
*/
|
|
21
19
|
interface IAuthProvider {
|
|
22
20
|
/**
|
|
23
21
|
* Registers a new user.
|
|
24
|
-
*
|
|
22
|
+
* @handleName signUp
|
|
25
23
|
* @param {string} marker - The marker identifying the auth provider. Example: "email".
|
|
26
24
|
* @param {ISignUpData} data - The data required for user registration. Example:
|
|
27
25
|
{
|
|
@@ -50,122 +48,132 @@ interface IAuthProvider {
|
|
|
50
48
|
}
|
|
51
49
|
}
|
|
52
50
|
* @param {string} [langCode] - Optional language code for localization. Default: "en_US".
|
|
53
|
-
* @
|
|
51
|
+
* @returns {ISignUpEntity} A promise that resolves to a sign-up entity or an error.
|
|
54
52
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
53
|
+
* @description This method registers a new user.
|
|
55
54
|
*/
|
|
56
55
|
signUp(marker: string, data: ISignUpData, langCode?: string): Promise<ISignUpEntity | IError>;
|
|
57
56
|
/**
|
|
58
57
|
* Generates an activation code for a user.
|
|
59
|
-
*
|
|
58
|
+
* @handleName generateCode
|
|
60
59
|
* @param {string} marker - The marker identifying the auth provider. Example: "email".
|
|
61
60
|
* @param {string} userIdentifier - The user's identifier. Example: "example@oneentry.cloud".
|
|
62
61
|
* @param {string} eventIdentifier - The event identifier related to the code generation. Example: "user_registration".
|
|
63
|
-
* @
|
|
62
|
+
* @returns {void} A promise that resolves to void or an error.
|
|
64
63
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
64
|
+
* @description This method generates an activation code for a user.
|
|
65
65
|
*/
|
|
66
66
|
generateCode(marker: string, userIdentifier: string, eventIdentifier: string): Promise<void | IError>;
|
|
67
67
|
/**
|
|
68
68
|
* Verifies a user activation code.
|
|
69
|
-
*
|
|
69
|
+
* @handleName checkCode
|
|
70
70
|
* @param {string} marker - The marker identifying the auth provider. Example: "email".
|
|
71
71
|
* @param {string} userIdentifier - The user's identifier. Example: "example@oneentry.cloud".
|
|
72
72
|
* @param {string} eventIdentifier - The event identifier related to the code verification. Example: "user_registration".
|
|
73
73
|
* @param {string} code - The activation code to verify. Example: "123456".
|
|
74
|
-
* @
|
|
74
|
+
* @returns {boolean} A promise that resolves to a boolean indicating success or failure, or an error.
|
|
75
75
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
76
|
+
* @description This method verifies a user activation code.
|
|
76
77
|
*/
|
|
77
78
|
checkCode(marker: string, userIdentifier: string, eventIdentifier: string, code: string): Promise<boolean | IError>;
|
|
78
79
|
/**
|
|
79
80
|
* Activates a user account.
|
|
80
|
-
*
|
|
81
|
+
* @handleName activateUser
|
|
81
82
|
* @param {string} marker - The marker identifying the auth provider. Example: "email".
|
|
82
83
|
* @param {string} userIdentifier - The user's identifier. Example: "example@oneentry.cloud".
|
|
83
84
|
* @param {string} code - The activation code. Example: "123456".
|
|
84
|
-
*
|
|
85
|
-
* @return {boolean} A promise that resolves to a boolean indicating success or failure, or an error.
|
|
85
|
+
* @returns {boolean} A promise that resolves to a boolean indicating success or failure, or an error.
|
|
86
86
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
87
|
+
* @description This method activates a user account.
|
|
87
88
|
*/
|
|
88
89
|
activateUser(marker: string, userIdentifier: string, code: string): Promise<boolean | IError>;
|
|
89
90
|
/**
|
|
90
91
|
* Authorizes a user.
|
|
91
|
-
*
|
|
92
|
+
* @handleName auth
|
|
92
93
|
* @param {string} marker - The marker identifying the auth provider. Example: "email".
|
|
93
94
|
* @param {IAuthPostBody} data - The data required for user authorization. Example: .
|
|
94
|
-
* @
|
|
95
|
+
* @returns {IAuthEntity} A promise that resolves to an auth entity or an error.
|
|
95
96
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
97
|
+
* @description This method authorizes a user.
|
|
96
98
|
*/
|
|
97
99
|
auth(marker: string, data: IAuthPostBody): Promise<IAuthEntity | IError>;
|
|
98
100
|
/**
|
|
99
101
|
* Refreshes a user's access token.
|
|
100
|
-
*
|
|
102
|
+
* @handleName refresh
|
|
101
103
|
* @param {string} marker - The marker identifying the auth provider. Example: "email".
|
|
102
104
|
* @param {string} token - The refresh token. Example: "abcdef123456".
|
|
103
|
-
* @
|
|
105
|
+
* @returns {IAuthEntity} A promise that resolves to an auth entity or an error.
|
|
104
106
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
107
|
+
* @description This method refreshes a user's access token.
|
|
105
108
|
*/
|
|
106
109
|
refresh(marker: string, token: string): Promise<IAuthEntity | IError>;
|
|
107
110
|
/**
|
|
108
111
|
* Logs out a user.
|
|
109
|
-
*
|
|
112
|
+
* @handleName logout
|
|
110
113
|
* @param {string} marker - The marker identifying the auth provider. Example: "email".
|
|
111
114
|
* @param {string} token - The access token. Example: "abcdef123456".
|
|
112
|
-
* @
|
|
115
|
+
* @returns {boolean} A promise that resolves to a boolean indicating success or failure, or an error.
|
|
113
116
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
117
|
+
* @description This method logs out a user.
|
|
114
118
|
*/
|
|
115
119
|
logout(marker: string, token: string): Promise<boolean | IError>;
|
|
116
120
|
/**
|
|
117
121
|
* Logout of user account on all devices.
|
|
118
|
-
*
|
|
122
|
+
* @handleName logoutAll
|
|
119
123
|
* @param {string} marker - The marker identifying the auth provider. Example: "email".
|
|
120
|
-
* @
|
|
124
|
+
* @returns {boolean} A promise that resolves to a boolean indicating success or failure, or an error.
|
|
121
125
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
126
|
+
* @description This method logs out a user account on all devices.
|
|
122
127
|
*/
|
|
123
128
|
logoutAll(marker: string): Promise<boolean | IError>;
|
|
124
129
|
/**
|
|
125
130
|
* Changes a user's password.
|
|
126
|
-
*
|
|
131
|
+
* @handleName changePassword
|
|
127
132
|
* @param {string} marker - The marker identifying the auth provider. Example: "email".
|
|
128
133
|
* @param {string} userIdentifier - The user's identifier. Example: "example@oneentry.cloud".
|
|
134
|
+
* @param {string} eventIdentifier - The event identifier. Example: "reg".
|
|
129
135
|
* @param {number} type - The type of password change. 1 for changing password, 2 for recovery. Example: 1.
|
|
130
136
|
* @param {string} code - The code for password change verification. Example: "123456".
|
|
131
137
|
* @param {string} newPassword - The new password. Example: "newPassword123".
|
|
132
138
|
* @param {string} [repeatPassword] - Optional repeat of the new password for confirmation. Example: "newPassword123".
|
|
133
|
-
* @
|
|
139
|
+
* @returns {boolean} A promise that resolves to a boolean indicating success or failure, or an error.
|
|
134
140
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
141
|
+
* @description This method changes a user's password.
|
|
135
142
|
*/
|
|
136
143
|
changePassword(marker: string, userIdentifier: string, eventIdentifier: string, type: number, code: string, newPassword: string, repeatPassword?: string): Promise<boolean | IError>;
|
|
137
144
|
/**
|
|
138
145
|
* Retrieves all authentication providers.
|
|
139
|
-
*
|
|
146
|
+
* @handleName getAuthProviders
|
|
140
147
|
* @param {string} [langCode] - Optional language code for localization. Default: "en_US".
|
|
141
148
|
* @param {number} [offset] - Optional offset for pagination. Default: 0.
|
|
142
149
|
* @param {number} [limit] - Optional limit for pagination. Default: 30.
|
|
143
|
-
* @
|
|
150
|
+
* @returns {IAuthProvidersEntity[]} A promise that resolves to an array of auth provider entities or an error.
|
|
144
151
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
152
|
+
* @description This method retrieves all authentication providers.
|
|
145
153
|
*/
|
|
146
154
|
getAuthProviders(langCode?: string, offset?: number, limit?: number): Promise<IAuthProvidersEntity[] | IError>;
|
|
147
155
|
/**
|
|
148
156
|
* Retrieves a specific auth provider by its marker.
|
|
149
|
-
*
|
|
157
|
+
* @handleName getAuthProviderByMarker
|
|
150
158
|
* @param {string} marker - The marker identifying the auth provider. Example: "email".
|
|
151
159
|
* @param {string} [langCode] - Optional language code for localization. Default: "en_US".
|
|
152
|
-
* @
|
|
160
|
+
* @returns {IAuthProvidersEntity} A promise that resolves to an auth provider entity or an error.
|
|
153
161
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
162
|
+
* @description This method retrieves a specific auth provider by its marker.
|
|
154
163
|
*/
|
|
155
164
|
getAuthProviderByMarker(marker: string, langCode?: string): Promise<IAuthProvidersEntity | IError>;
|
|
156
165
|
/**
|
|
157
166
|
* Retrieves active user sessions data object.
|
|
158
|
-
*
|
|
167
|
+
* @handleName getActiveSessionsByMarker
|
|
159
168
|
* @param {string} marker - The marker identifying the auth provider. Example: "email".
|
|
160
|
-
* @
|
|
169
|
+
* @returns {any} A promise that resolves to active user sessions data object.
|
|
161
170
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
171
|
+
* @description This method retrieves active user sessions data object.
|
|
162
172
|
*/
|
|
163
173
|
getActiveSessionsByMarker(marker: string): Promise<any | IError>;
|
|
164
174
|
/**
|
|
165
175
|
* User registration (authorization) via OAUTH.
|
|
166
|
-
*
|
|
167
176
|
* @handleName oauthSignUp
|
|
168
|
-
*
|
|
169
177
|
* @param {string} marker - The text identifier of the authorization provider. Example: "email".
|
|
170
178
|
* @param {IOAuthSignUpData} body - Object contains OAuth information for registration. Example:
|
|
171
179
|
{
|
|
@@ -176,7 +184,7 @@ interface IAuthProvider {
|
|
|
176
184
|
"redirect_uri": "http://localhost:3000"
|
|
177
185
|
}
|
|
178
186
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
179
|
-
* @
|
|
187
|
+
* @returns {ISignUpEntity} Returns a user object.
|
|
180
188
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
181
189
|
* @description User registration (authorization) via OAUTH.
|
|
182
190
|
*/
|
|
@@ -184,9 +192,7 @@ interface IAuthProvider {
|
|
|
184
192
|
}
|
|
185
193
|
/**
|
|
186
194
|
* Interface representing the structure of authentication form data.
|
|
187
|
-
*
|
|
188
195
|
* @interface IAuthFormData
|
|
189
|
-
*
|
|
190
196
|
* @property {string} marker - A unique identifier for the form field. Example: "email".
|
|
191
197
|
* @property {string} type - The type of the form field, such as 'string', 'email', etc. Example: "string".
|
|
192
198
|
* @property {string} value - The value entered in the form field. Example: "example@oneentry.cloud".
|
|
@@ -199,9 +205,7 @@ interface IAuthFormData {
|
|
|
199
205
|
}
|
|
200
206
|
/**
|
|
201
207
|
* Interface representing the data required for user registration.
|
|
202
|
-
*
|
|
203
208
|
* @interface ISignUpData
|
|
204
|
-
*
|
|
205
209
|
* @property {string} marker - The text identifier of the authorization provider. Example: "email".
|
|
206
210
|
* @property {ISignUpData} body - Request body. Example:
|
|
207
211
|
{
|
|
@@ -218,9 +222,9 @@ interface IAuthFormData {
|
|
|
218
222
|
],
|
|
219
223
|
"formData": [
|
|
220
224
|
{
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
225
|
+
"marker": "last_name",
|
|
226
|
+
"type": "string",
|
|
227
|
+
"value": "Name"
|
|
224
228
|
}
|
|
225
229
|
],
|
|
226
230
|
"notificationData": {
|
|
@@ -229,30 +233,30 @@ interface IAuthFormData {
|
|
|
229
233
|
"phoneSMS": "+99999999999"
|
|
230
234
|
}
|
|
231
235
|
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
{
|
|
236
|
-
"marker": "login",
|
|
237
|
-
"value": "example@oneentry.cloud"
|
|
238
|
-
},
|
|
239
|
-
{
|
|
240
|
-
"marker": "password",
|
|
241
|
-
"value": "12345"
|
|
242
|
-
}
|
|
243
|
-
]
|
|
244
|
-
* @property {IAuthFormData | IAuthFormData[]} body.formData - The form data for the registration, which can be a single object or an array of objects. Example:
|
|
236
|
+
* @property {string} body.formIdentifier - The identifier for the registration form. Example: "reg".
|
|
237
|
+
* @property {{ marker: string; value: string }[]} body.authData - An array of authentication data objects, each containing a marker and its corresponding value. Example:
|
|
238
|
+
[
|
|
245
239
|
{
|
|
246
|
-
"marker": "
|
|
247
|
-
"
|
|
248
|
-
|
|
249
|
-
}
|
|
250
|
-
* @property {Object} body.notificationData - An object containing notification data, including email, phonePush, and phoneSMS. Example:
|
|
240
|
+
"marker": "login",
|
|
241
|
+
"value": "example@oneentry.cloud"
|
|
242
|
+
},
|
|
251
243
|
{
|
|
252
|
-
"
|
|
253
|
-
"
|
|
254
|
-
"phoneSMS": "+99999999999"
|
|
244
|
+
"marker": "password",
|
|
245
|
+
"value": "12345"
|
|
255
246
|
}
|
|
247
|
+
]
|
|
248
|
+
* @property {IAuthFormData | IAuthFormData[]} body.formData - The form data for the registration, which can be a single object or an array of objects. Example:
|
|
249
|
+
{
|
|
250
|
+
"marker": "last_name",
|
|
251
|
+
"type": "string",
|
|
252
|
+
"value": "Name"
|
|
253
|
+
}
|
|
254
|
+
* @property {object} body.notificationData - An object containing notification data, including email, phonePush, and phoneSMS. Example:
|
|
255
|
+
{
|
|
256
|
+
"email": "example@oneentry.cloud",
|
|
257
|
+
"phonePush": ["+99999999999"],
|
|
258
|
+
"phoneSMS": "+99999999999"
|
|
259
|
+
}
|
|
256
260
|
* @property {string} [langCode] - Language code. Default: "en_US".
|
|
257
261
|
* @description User registration (❗️For a provider with user activation, the activation code is sent through the corresponding user notification method).
|
|
258
262
|
*/
|
|
@@ -272,15 +276,12 @@ interface ISignUpData {
|
|
|
272
276
|
}
|
|
273
277
|
/**
|
|
274
278
|
* Interface representing the data required for user registration via OAUTH.
|
|
275
|
-
*
|
|
276
279
|
* @interface IOAuthSignUpData
|
|
277
|
-
*
|
|
278
280
|
* @property {string} client_id - The client ID for the OAuth application. Example: "34346983-luuct343473qdkqidjopdfp3eb3k4thp.apps.googleusercontent.com".
|
|
279
281
|
* @property {string} client_secret - The client secret for the OAuth application. Example: "43434343434".
|
|
280
282
|
* @property {string} code - The authorization code received from the OAuth provider. Example: "4/0AVMBsJgwewewewewewei4D7T6E_fbswxnL3g".
|
|
281
283
|
* @property {string} grant_type - The grant type for the OAuth request. Example: "authorization_code".
|
|
282
284
|
* @property {string} redirect_uri - The redirect URI for the OAuth application. Example: "http://localhost:3000".
|
|
283
|
-
*
|
|
284
285
|
* @description User registration (❗️For a provider with user activation, the activation code is sent through the corresponding user notification method).
|
|
285
286
|
*/
|
|
286
287
|
interface IOAuthSignUpData {
|
|
@@ -292,9 +293,7 @@ interface IOAuthSignUpData {
|
|
|
292
293
|
}
|
|
293
294
|
/**
|
|
294
295
|
* Interface representing a sign-up entity.
|
|
295
|
-
*
|
|
296
296
|
* @interface ISignUpEntity
|
|
297
|
-
*
|
|
298
297
|
* @property {number} id - The unique identifier of the sign-up entity. Example: 12345.
|
|
299
298
|
* @property {string} updatedDate - The date when the sign-up entity was last updated. Example: "2023-10-01T12:00:00Z".
|
|
300
299
|
* @property {number} version - The version number of the sign-up entity. Example: 1.
|
|
@@ -311,7 +310,7 @@ interface IOAuthSignUpData {
|
|
|
311
310
|
"value": "Doe"
|
|
312
311
|
}
|
|
313
312
|
]
|
|
314
|
-
* @property {
|
|
313
|
+
* @property {object} notificationData - An object containing notification data, including email, phonePush, and phoneSMS. Example:
|
|
315
314
|
{
|
|
316
315
|
"email": "example@oneentry.cloud",
|
|
317
316
|
"phonePush": ["+99999999999"],
|
|
@@ -339,9 +338,7 @@ interface ISignUpEntity {
|
|
|
339
338
|
}
|
|
340
339
|
/**
|
|
341
340
|
* Interface representing a code entity used for user registration or verification processes.
|
|
342
|
-
*
|
|
343
341
|
* @interface ICodeEntity
|
|
344
|
-
*
|
|
345
342
|
* @property {string} code - The activation code for user registration or verification. Example: "123456".
|
|
346
343
|
* @property {string} expiredDate - The date when the activation code expires. Example: "2023-10-01T12:00:00Z".
|
|
347
344
|
* @description This interface defines the structure of a code entity used for user registration or verification processes.
|
|
@@ -352,9 +349,7 @@ interface ICodeEntity {
|
|
|
352
349
|
}
|
|
353
350
|
/**
|
|
354
351
|
* Interface representing an authentication entity.
|
|
355
|
-
*
|
|
356
352
|
* @interface IAuthEntity
|
|
357
|
-
*
|
|
358
353
|
* @property {string} userIdentifier - The unique identifier for the user. Example: "user12345".
|
|
359
354
|
* @property {string} authProviderIdentifier - The identifier for the authentication provider. Example: "email".
|
|
360
355
|
* @property {string} accessToken - The access token for the user session. Example: "abcdef123456".
|
|
@@ -369,9 +364,7 @@ interface IAuthEntity {
|
|
|
369
364
|
}
|
|
370
365
|
/**
|
|
371
366
|
* Interface representing an authentication provider entity.
|
|
372
|
-
*
|
|
373
367
|
* @interface IAuthProvidersEntity
|
|
374
|
-
*
|
|
375
368
|
* @property {number} id - The unique identifier of the auth provider entity. Example: 194.
|
|
376
369
|
* @property {ILocalizeInfo} localizeInfos - Localized information for the auth provider. Example: {"key": "value"}.
|
|
377
370
|
* @property {IAuthProvidersEntityConfig} config - Configuration settings for the auth provider, stored as a key-value pair object. Example: { "key": "value" }
|
|
@@ -398,15 +391,13 @@ interface IAuthProvidersEntity {
|
|
|
398
391
|
}
|
|
399
392
|
/**
|
|
400
393
|
* Interface representing an authentication provider config.
|
|
401
|
-
*
|
|
402
394
|
* @interface IAuthProvidersEntityConfig
|
|
403
|
-
*
|
|
404
|
-
* @property {string}
|
|
405
|
-
* @property {string}
|
|
406
|
-
* @property {string}
|
|
407
|
-
* @property {string}
|
|
408
|
-
* @property {string}
|
|
409
|
-
* @property {string} systemCodeLength
|
|
395
|
+
* @property {string} accessTokenTtlSec - Access token time to live in seconds.
|
|
396
|
+
* @property {string} refreshTokenTtlMc - Refresh token time to live in milliseconds.
|
|
397
|
+
* @property {string} tokenSecretKey - Token secret key.
|
|
398
|
+
* @property {string} deleteNoneActiveUsersAfterDays - Delete none active users after days.
|
|
399
|
+
* @property {string} systemCodeTlsSec - System code time to live in seconds.
|
|
400
|
+
* @property {string} systemCodeLength - System code length.
|
|
410
401
|
*/
|
|
411
402
|
interface IAuthProvidersEntityConfig {
|
|
412
403
|
accessTokenTtlSec: string;
|
|
@@ -418,9 +409,7 @@ interface IAuthProvidersEntityConfig {
|
|
|
418
409
|
}
|
|
419
410
|
/**
|
|
420
411
|
* Interface representing the body used in authentication requests.
|
|
421
|
-
*
|
|
422
412
|
* @interface IAuthPostBody
|
|
423
|
-
*
|
|
424
413
|
* @property {{ marker: string; value: string | number }[]} authData - An array of authentication data objects, each containing a marker and its corresponding value. Example:
|
|
425
414
|
[
|
|
426
415
|
{
|
|
@@ -436,4 +425,19 @@ interface IAuthPostBody {
|
|
|
436
425
|
value: string | number;
|
|
437
426
|
}>;
|
|
438
427
|
}
|
|
439
|
-
|
|
428
|
+
/**
|
|
429
|
+
* Interface representing the active session data.
|
|
430
|
+
* @interface IActiveSession
|
|
431
|
+
* @property {string} os - The operating system of the active session. Example: "Win32".
|
|
432
|
+
* @property {string} browser - The browser used in the active session. Example: "Node.js/22".
|
|
433
|
+
* @property {string} location - The location of the active session. Example: "ru-RU".
|
|
434
|
+
* @description This interface defines the structure of the body used in authentication requests, containing an array of authentication data.
|
|
435
|
+
*/
|
|
436
|
+
interface IActiveSession {
|
|
437
|
+
deviceInfo: {
|
|
438
|
+
os: string;
|
|
439
|
+
browser: string;
|
|
440
|
+
location: string;
|
|
441
|
+
};
|
|
442
|
+
}
|
|
443
|
+
export type { IActiveSession, IAuthEntity, IAuthFormData, IAuthPostBody, IAuthProvider, IAuthProvidersEntity, ICodeEntity, IOAuthSignUpData, ISignUpData, ISignUpEntity, };
|
|
@@ -2,6 +2,7 @@ import type StateModule from './stateModule';
|
|
|
2
2
|
import SyncModules from './syncModules';
|
|
3
3
|
/**
|
|
4
4
|
* Abstract class AsyncModules extends SyncModules to provide asynchronous HTTP request functionalities.
|
|
5
|
+
* @description Abstract class AsyncModules extends SyncModules to provide asynchronous HTTP request functionalities.
|
|
5
6
|
*/
|
|
6
7
|
export default abstract class AsyncModules extends SyncModules {
|
|
7
8
|
protected state: StateModule;
|
|
@@ -10,58 +11,59 @@ export default abstract class AsyncModules extends SyncModules {
|
|
|
10
11
|
protected _url: string;
|
|
11
12
|
/**
|
|
12
13
|
* Constructor initializes the AsyncModules with a given state.
|
|
13
|
-
* @param state - Instance of StateModule containing configuration and state data.
|
|
14
|
+
* @param {StateModule} state - Instance of StateModule containing configuration and state data.
|
|
15
|
+
* @description Constructor initializes the AsyncModules with a given state.
|
|
14
16
|
*/
|
|
15
17
|
protected constructor(state: StateModule);
|
|
16
18
|
/**
|
|
17
19
|
* Performs an HTTP GET request.
|
|
18
|
-
* @param path - The path to append to the base URL.
|
|
19
|
-
* @
|
|
20
|
+
* @param {string} path - The path to append to the base URL.
|
|
21
|
+
* @returns {Promise<any>} A promise resolving to the response data.
|
|
20
22
|
* @description Define a protected asynchronous method '_fetchGet' that performs a GET request
|
|
21
23
|
*/
|
|
22
24
|
protected _fetchGet(path: string): Promise<any>;
|
|
23
25
|
/**
|
|
24
26
|
* Performs an HTTP POST request.
|
|
25
|
-
* @param path
|
|
26
|
-
* @param data - The data to send in the request body.
|
|
27
|
-
* @
|
|
27
|
+
* @param {string} path - The path to append to the base URL.
|
|
28
|
+
* @param {any} [data] - The data to send in the request body.
|
|
29
|
+
* @returns {Promise<any>} A promise resolving to the response data.
|
|
28
30
|
* @description Define a protected asynchronous method '_fetchPost' that performs a POST request
|
|
29
31
|
*/
|
|
30
32
|
protected _fetchPost(path: string, data?: any): Promise<any>;
|
|
31
33
|
/**
|
|
32
34
|
* Performs an HTTP PUT request.
|
|
33
|
-
* @param path - The path to append to the base URL.
|
|
34
|
-
* @param
|
|
35
|
-
* @
|
|
35
|
+
* @param {string} path - The path to append to the base URL.
|
|
36
|
+
* @param {any} body - The data to send in the request body.
|
|
37
|
+
* @returns {Promise<any>} A promise resolving to the response data.
|
|
36
38
|
* @description Define a protected asynchronous method '_fetchPut' that performs a PUT request
|
|
37
39
|
*/
|
|
38
|
-
protected _fetchPut(path: string,
|
|
40
|
+
protected _fetchPut(path: string, body: any): Promise<any>;
|
|
39
41
|
/**
|
|
40
42
|
* Performs an HTTP DELETE request.
|
|
41
|
-
* @param path - The path to append to the base URL.
|
|
42
|
-
* @param
|
|
43
|
-
* @
|
|
43
|
+
* @param {string} path - The path to append to the base URL.
|
|
44
|
+
* @param {any} body - The body of the request.
|
|
45
|
+
* @returns {Promise<any>} A promise resolving to the response data.
|
|
44
46
|
* @description Define a protected asynchronous method '_fetchDelete' that performs a DELETE request
|
|
45
47
|
*/
|
|
46
|
-
protected _fetchDelete(path: string,
|
|
48
|
+
protected _fetchDelete(path: string, body?: any): Promise<any>;
|
|
47
49
|
/**
|
|
48
50
|
* Refreshes the authentication token.
|
|
49
|
-
* @
|
|
51
|
+
* @returns {Promise<boolean>} A promise resolving to a boolean indicating success or failure.
|
|
50
52
|
* @description Define an asynchronous method 'refreshToken' that attempts to refresh the authentication token
|
|
51
53
|
*/
|
|
52
54
|
protected refreshToken(): Promise<boolean>;
|
|
53
55
|
/**
|
|
54
56
|
* Creates options for HTTP requests.
|
|
55
|
-
* @param method - The HTTP method (GET, POST, PUT, DELETE, etc.).
|
|
56
|
-
* @param data - Optional data to include in the request body.
|
|
57
|
-
* @
|
|
57
|
+
* @param {string} method - The HTTP method (GET, POST, PUT, DELETE, etc.).
|
|
58
|
+
* @param {any} data - Optional data to include in the request body.
|
|
59
|
+
* @returns {any} An object representing the request options.
|
|
58
60
|
*/
|
|
59
61
|
private makeOptions;
|
|
60
62
|
/**
|
|
61
63
|
* Handles responses from the browser's fetch API.
|
|
62
|
-
* @param path - The path to append to the base URL.
|
|
63
|
-
* @param options - The options for the fetch request.
|
|
64
|
-
* @
|
|
64
|
+
* @param {string} path - The path to append to the base URL.
|
|
65
|
+
* @param {any} options - The options for the fetch request.
|
|
66
|
+
* @returns {any} A promise resolving to the response data.
|
|
65
67
|
* @description Define an asynchronous method 'browserResponse' that takes a path and options as parameters
|
|
66
68
|
*/
|
|
67
69
|
private browserResponse;
|