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