oneentry 1.0.124 → 1.0.126
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 +17 -4
- package/dist/admins/adminsApi.js +16 -3
- package/dist/admins/adminsInterfaces.d.ts +47 -26
- package/dist/attribute-sets/attributeSetsApi.d.ts +10 -18
- package/dist/attribute-sets/attributeSetsApi.js +9 -17
- package/dist/attribute-sets/attributeSetsInterfaces.d.ts +92 -44
- package/dist/auth-provider/authProviderApi.d.ts +146 -36
- package/dist/auth-provider/authProviderApi.js +163 -37
- package/dist/auth-provider/authProvidersInterfaces.d.ts +189 -40
- package/dist/base/asyncModules.d.ts +7 -1
- package/dist/base/asyncModules.js +127 -21
- package/dist/base/result.js +23 -0
- package/dist/base/syncModules.d.ts +4 -0
- package/dist/base/syncModules.js +19 -1
- package/dist/base/utils.d.ts +1 -1
- package/dist/blocks/blocksApi.d.ts +7 -17
- package/dist/blocks/blocksApi.js +7 -17
- package/dist/blocks/blocksInterfaces.d.ts +77 -32
- package/dist/events/eventsApi.d.ts +7 -8
- package/dist/events/eventsApi.js +12 -7
- package/dist/events/eventsInterfaces.d.ts +16 -11
- package/dist/file-uploading/fileUploadingApi.d.ts +22 -14
- package/dist/file-uploading/fileUploadingApi.js +20 -12
- package/dist/file-uploading/fileUploadingInterfaces.d.ts +42 -18
- package/dist/forms/formsApi.d.ts +3 -7
- package/dist/forms/formsApi.js +2 -6
- package/dist/forms/formsInterfaces.d.ts +44 -28
- package/dist/{formsData → forms-data}/formsDataApi.d.ts +31 -15
- package/dist/{formsData → forms-data}/formsDataApi.js +30 -14
- package/dist/forms-data/formsDataInterfaces.d.ts +462 -0
- package/dist/general-types/generalTypesApi.d.ts +1 -3
- package/dist/general-types/generalTypesApi.js +0 -2
- package/dist/general-types/generalTypesInterfaces.d.ts +2 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/integration-collections/integrationCollectionsApi.d.ts +74 -47
- package/dist/integration-collections/integrationCollectionsApi.js +64 -45
- package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +144 -63
- package/dist/locales/localesApi.d.ts +1 -2
- package/dist/locales/localesApi.js +1 -2
- package/dist/locales/localesInterfaces.d.ts +2 -4
- package/dist/menus/menusApi.d.ts +1 -3
- package/dist/menus/menusApi.js +1 -3
- package/dist/menus/menusInterfaces.d.ts +39 -13
- package/dist/orders/ordersApi.d.ts +36 -18
- package/dist/orders/ordersApi.js +40 -22
- package/dist/orders/ordersInterfaces.d.ts +163 -81
- package/dist/pages/pagesApi.d.ts +48 -48
- package/dist/pages/pagesApi.js +40 -45
- package/dist/pages/pagesInterfaces.d.ts +147 -98
- package/dist/payments/paymentsApi.d.ts +25 -45
- package/dist/payments/paymentsApi.js +27 -46
- package/dist/payments/paymentsInterfaces.d.ts +42 -60
- package/dist/product-statuses/productStatusesApi.d.ts +6 -12
- package/dist/product-statuses/productStatusesApi.js +5 -11
- package/dist/product-statuses/productStatusesInterfaces.d.ts +16 -15
- package/dist/products/productsApi.d.ts +256 -104
- package/dist/products/productsApi.js +263 -97
- package/dist/products/productsInterfaces.d.ts +343 -160
- package/dist/system/systemApi.d.ts +21 -10
- package/dist/system/systemApi.js +22 -8
- package/dist/system/systemInterfaces.d.ts +0 -1
- package/dist/templates/templatesApi.d.ts +6 -12
- package/dist/templates/templatesApi.js +4 -10
- package/dist/templates/templatesInterfaces.d.ts +20 -20
- package/dist/templates-preview/templatesPreviewApi.d.ts +2 -6
- package/dist/templates-preview/templatesPreviewApi.js +1 -5
- package/dist/templates-preview/templatesPreviewInterfaces.d.ts +50 -25
- package/dist/users/usersApi.d.ts +33 -13
- package/dist/users/usersApi.js +38 -15
- package/dist/users/usersInterfaces.d.ts +78 -27
- package/dist/web-socket/wsApi.d.ts +1 -5
- package/dist/web-socket/wsApi.js +1 -5
- package/dist/web-socket/wsInterfaces.d.ts +0 -1
- package/package.json +18 -16
- package/dist/formsData/formsDataInterfaces.d.ts +0 -267
- /package/dist/{formsData → forms-data}/formsDataInterfaces.js +0 -0
|
@@ -9,9 +9,12 @@ 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.
|
|
15
18
|
*
|
|
16
19
|
* @description This interface defines methods for user authentication and registration through various auth providers.
|
|
17
20
|
*/
|
|
@@ -20,9 +23,33 @@ interface IAuthProvider {
|
|
|
20
23
|
* Registers a new user.
|
|
21
24
|
*
|
|
22
25
|
* @param {string} marker - The marker identifying the auth provider. Example: "email".
|
|
23
|
-
* @param {ISignUpData} data - The data required for user registration. Example:
|
|
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
|
+
}
|
|
24
52
|
* @param {string} [langCode] - Optional language code for localization. Default: "en_US".
|
|
25
|
-
*
|
|
26
53
|
* @return {ISignUpEntity} A promise that resolves to a sign-up entity or an error.
|
|
27
54
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
28
55
|
*/
|
|
@@ -33,7 +60,6 @@ interface IAuthProvider {
|
|
|
33
60
|
* @param {string} marker - The marker identifying the auth provider. Example: "email".
|
|
34
61
|
* @param {string} userIdentifier - The user's identifier. Example: "example@oneentry.cloud".
|
|
35
62
|
* @param {string} eventIdentifier - The event identifier related to the code generation. Example: "user_registration".
|
|
36
|
-
*
|
|
37
63
|
* @return {void} A promise that resolves to void or an error.
|
|
38
64
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
39
65
|
*/
|
|
@@ -45,7 +71,6 @@ interface IAuthProvider {
|
|
|
45
71
|
* @param {string} userIdentifier - The user's identifier. Example: "example@oneentry.cloud".
|
|
46
72
|
* @param {string} eventIdentifier - The event identifier related to the code verification. Example: "user_registration".
|
|
47
73
|
* @param {string} code - The activation code to verify. Example: "123456".
|
|
48
|
-
*
|
|
49
74
|
* @return {boolean} A promise that resolves to a boolean indicating success or failure, or an error.
|
|
50
75
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
51
76
|
*/
|
|
@@ -66,7 +91,6 @@ interface IAuthProvider {
|
|
|
66
91
|
*
|
|
67
92
|
* @param {string} marker - The marker identifying the auth provider. Example: "email".
|
|
68
93
|
* @param {IAuthPostBody} data - The data required for user authorization. Example: .
|
|
69
|
-
*
|
|
70
94
|
* @return {IAuthEntity} A promise that resolves to an auth entity or an error.
|
|
71
95
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
72
96
|
*/
|
|
@@ -76,7 +100,6 @@ interface IAuthProvider {
|
|
|
76
100
|
*
|
|
77
101
|
* @param {string} marker - The marker identifying the auth provider. Example: "email".
|
|
78
102
|
* @param {string} token - The refresh token. Example: "abcdef123456".
|
|
79
|
-
*
|
|
80
103
|
* @return {IAuthEntity} A promise that resolves to an auth entity or an error.
|
|
81
104
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
82
105
|
*/
|
|
@@ -86,11 +109,18 @@ interface IAuthProvider {
|
|
|
86
109
|
*
|
|
87
110
|
* @param {string} marker - The marker identifying the auth provider. Example: "email".
|
|
88
111
|
* @param {string} token - The access token. Example: "abcdef123456".
|
|
89
|
-
*
|
|
90
112
|
* @return {boolean} A promise that resolves to a boolean indicating success or failure, or an error.
|
|
91
113
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
92
114
|
*/
|
|
93
115
|
logout(marker: string, token: string): Promise<boolean | IError>;
|
|
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>;
|
|
94
124
|
/**
|
|
95
125
|
* Changes a user's password.
|
|
96
126
|
*
|
|
@@ -100,7 +130,6 @@ interface IAuthProvider {
|
|
|
100
130
|
* @param {string} code - The code for password change verification. Example: "123456".
|
|
101
131
|
* @param {string} newPassword - The new password. Example: "newPassword123".
|
|
102
132
|
* @param {string} [repeatPassword] - Optional repeat of the new password for confirmation. Example: "newPassword123".
|
|
103
|
-
*
|
|
104
133
|
* @return {boolean} A promise that resolves to a boolean indicating success or failure, or an error.
|
|
105
134
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
106
135
|
*/
|
|
@@ -111,21 +140,47 @@ interface IAuthProvider {
|
|
|
111
140
|
* @param {string} [langCode] - Optional language code for localization. Default: "en_US".
|
|
112
141
|
* @param {number} [offset] - Optional offset for pagination. Default: 0.
|
|
113
142
|
* @param {number} [limit] - Optional limit for pagination. Default: 30.
|
|
114
|
-
*
|
|
115
143
|
* @return {IAuthProvidersEntity[]} A promise that resolves to an array of auth provider entities or an error.
|
|
116
144
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
117
145
|
*/
|
|
118
|
-
getAuthProviders(langCode?: string, offset?: number, limit?: number): Promise<
|
|
146
|
+
getAuthProviders(langCode?: string, offset?: number, limit?: number): Promise<IAuthProvidersEntity[] | IError>;
|
|
119
147
|
/**
|
|
120
148
|
* Retrieves a specific auth provider by its marker.
|
|
121
149
|
*
|
|
122
150
|
* @param {string} marker - The marker identifying the auth provider. Example: "email".
|
|
123
151
|
* @param {string} [langCode] - Optional language code for localization. Default: "en_US".
|
|
124
|
-
*
|
|
125
152
|
* @return {IAuthProvidersEntity} A promise that resolves to an auth provider entity or an error.
|
|
126
153
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
127
154
|
*/
|
|
128
|
-
|
|
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>;
|
|
129
184
|
}
|
|
130
185
|
/**
|
|
131
186
|
* Interface representing the structure of authentication form data.
|
|
@@ -135,7 +190,6 @@ interface IAuthProvider {
|
|
|
135
190
|
* @property {string} marker - A unique identifier for the form field. Example: "email".
|
|
136
191
|
* @property {string} type - The type of the form field, such as 'string', 'email', etc. Example: "string".
|
|
137
192
|
* @property {string} value - The value entered in the form field. Example: "example@oneentry.cloud".
|
|
138
|
-
*
|
|
139
193
|
* @description This interface defines the structure of authentication form data used in user registration and authentication processes.
|
|
140
194
|
*/
|
|
141
195
|
interface IAuthFormData {
|
|
@@ -148,13 +202,59 @@ interface IAuthFormData {
|
|
|
148
202
|
*
|
|
149
203
|
* @interface ISignUpData
|
|
150
204
|
*
|
|
151
|
-
* @property {string}
|
|
152
|
-
* @property {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
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).
|
|
158
258
|
*/
|
|
159
259
|
interface ISignUpData {
|
|
160
260
|
formIdentifier: string;
|
|
@@ -163,13 +263,33 @@ interface ISignUpData {
|
|
|
163
263
|
marker: string;
|
|
164
264
|
value: string;
|
|
165
265
|
}>;
|
|
166
|
-
formData: IAuthFormData |
|
|
266
|
+
formData: IAuthFormData | IAuthFormData[];
|
|
167
267
|
notificationData: {
|
|
168
268
|
email: string;
|
|
169
269
|
phonePush: Array<string>;
|
|
170
270
|
phoneSMS: string;
|
|
171
271
|
};
|
|
172
272
|
}
|
|
273
|
+
/**
|
|
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
|
+
}
|
|
173
293
|
/**
|
|
174
294
|
* Interface representing a sign-up entity.
|
|
175
295
|
*
|
|
@@ -180,10 +300,24 @@ interface ISignUpData {
|
|
|
180
300
|
* @property {number} version - The version number of the sign-up entity. Example: 1.
|
|
181
301
|
* @property {string} identifier - A unique string that identifies the sign-up entity. Example: "signup_12345".
|
|
182
302
|
* @property {boolean} isActive - Indicates whether the sign-up entity is active. Example: true.
|
|
183
|
-
* @property {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
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".
|
|
187
321
|
* @description This interface defines the structure of a sign-up entity.
|
|
188
322
|
*/
|
|
189
323
|
interface ISignUpEntity {
|
|
@@ -201,7 +335,7 @@ interface ISignUpEntity {
|
|
|
201
335
|
phonePush: Array<string>;
|
|
202
336
|
phoneSMS: string;
|
|
203
337
|
};
|
|
204
|
-
locale
|
|
338
|
+
locale?: string;
|
|
205
339
|
}
|
|
206
340
|
/**
|
|
207
341
|
* Interface representing a code entity used for user registration or verification processes.
|
|
@@ -210,7 +344,6 @@ interface ISignUpEntity {
|
|
|
210
344
|
*
|
|
211
345
|
* @property {string} code - The activation code for user registration or verification. Example: "123456".
|
|
212
346
|
* @property {string} expiredDate - The date when the activation code expires. Example: "2023-10-01T12:00:00Z".
|
|
213
|
-
*
|
|
214
347
|
* @description This interface defines the structure of a code entity used for user registration or verification processes.
|
|
215
348
|
*/
|
|
216
349
|
interface ICodeEntity {
|
|
@@ -226,7 +359,6 @@ interface ICodeEntity {
|
|
|
226
359
|
* @property {string} authProviderIdentifier - The identifier for the authentication provider. Example: "email".
|
|
227
360
|
* @property {string} accessToken - The access token for the user session. Example: "abcdef123456".
|
|
228
361
|
* @property {string} refreshToken - The refresh token for renewing the access token. Example: "ghijkl789012".
|
|
229
|
-
*
|
|
230
362
|
* @description This interface defines the structure of an authentication entity.
|
|
231
363
|
*/
|
|
232
364
|
interface IAuthEntity {
|
|
@@ -241,29 +373,41 @@ interface IAuthEntity {
|
|
|
241
373
|
* @interface IAuthProvidersEntity
|
|
242
374
|
*
|
|
243
375
|
* @property {number} id - The unique identifier of the auth provider entity. Example: 194.
|
|
244
|
-
* @property {ILocalizeInfo} localizeInfos - Localized information for the auth provider. Example: .
|
|
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" }
|
|
245
378
|
* @property {number} version - The version number of the auth provider entity. Example: 1.
|
|
246
379
|
* @property {string} identifier - A unique string that identifies the auth provider. Example: "email".
|
|
247
|
-
* @property {boolean} isActive - Indicates whether the auth provider is active. Example: true.
|
|
248
|
-
* @property {boolean} isCheckCode - Indicates whether the auth provider requires code verification. Example: false.
|
|
249
380
|
* @property {string} type - The type of the auth provider (e.g., 'email', 'google', etc.). Example: "email".
|
|
250
381
|
* @property {string | null} formIdentifier - The identifier for the form associated with the auth provider, or null if not applicable. Example: "reg_form".
|
|
251
|
-
* @property {
|
|
252
|
-
*
|
|
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.
|
|
253
385
|
* @description This interface defines the structure of an authentication provider entity.
|
|
254
386
|
*/
|
|
255
387
|
interface IAuthProvidersEntity {
|
|
256
388
|
id: number;
|
|
257
389
|
localizeInfos: ILocalizeInfo;
|
|
390
|
+
config: IAuthProvidersEntityConfig;
|
|
258
391
|
version: number;
|
|
259
392
|
identifier: string;
|
|
260
|
-
isActive: boolean;
|
|
261
|
-
isCheckCode: boolean;
|
|
262
393
|
type: string;
|
|
263
394
|
formIdentifier: string | null;
|
|
264
|
-
config: IAuthProvidersEntityConfig;
|
|
265
395
|
userGroupIdentifier: string;
|
|
396
|
+
isActive: boolean;
|
|
397
|
+
isCheckCode: boolean;
|
|
266
398
|
}
|
|
399
|
+
/**
|
|
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
|
+
*/
|
|
267
411
|
interface IAuthProvidersEntityConfig {
|
|
268
412
|
accessTokenTtlSec: string;
|
|
269
413
|
refreshTokenTtlMc: string;
|
|
@@ -277,8 +421,13 @@ interface IAuthProvidersEntityConfig {
|
|
|
277
421
|
*
|
|
278
422
|
* @interface IAuthPostBody
|
|
279
423
|
*
|
|
280
|
-
* @property {
|
|
281
|
-
|
|
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
|
+
]
|
|
282
431
|
* @description This interface defines the structure of the body used in authentication requests, containing an array of authentication data.
|
|
283
432
|
*/
|
|
284
433
|
interface IAuthPostBody {
|
|
@@ -287,4 +436,4 @@ interface IAuthPostBody {
|
|
|
287
436
|
value: string | number;
|
|
288
437
|
}>;
|
|
289
438
|
}
|
|
290
|
-
export type { IAuthEntity, IAuthFormData, IAuthPostBody, IAuthProvider, IAuthProvidersEntity, ICodeEntity, ISignUpData, ISignUpEntity, };
|
|
439
|
+
export type { IAuthEntity, IAuthFormData, IAuthPostBody, IAuthProvider, IAuthProvidersEntity, ICodeEntity, IOAuthSignUpData, ISignUpData, ISignUpEntity, };
|
|
@@ -17,6 +17,7 @@ export default abstract class AsyncModules extends SyncModules {
|
|
|
17
17
|
* Performs an HTTP GET request.
|
|
18
18
|
* @param path - The path to append to the base URL.
|
|
19
19
|
* @return A promise resolving to the response data.
|
|
20
|
+
* @description Define a protected asynchronous method '_fetchGet' that performs a GET request
|
|
20
21
|
*/
|
|
21
22
|
protected _fetchGet(path: string): Promise<any>;
|
|
22
23
|
/**
|
|
@@ -24,6 +25,7 @@ export default abstract class AsyncModules extends SyncModules {
|
|
|
24
25
|
* @param path - The path to append to the base URL.
|
|
25
26
|
* @param data - The data to send in the request body.
|
|
26
27
|
* @return A promise resolving to the response data.
|
|
28
|
+
* @description Define a protected asynchronous method '_fetchPost' that performs a POST request
|
|
27
29
|
*/
|
|
28
30
|
protected _fetchPost(path: string, data?: any): Promise<any>;
|
|
29
31
|
/**
|
|
@@ -31,6 +33,7 @@ export default abstract class AsyncModules extends SyncModules {
|
|
|
31
33
|
* @param path - The path to append to the base URL.
|
|
32
34
|
* @param data - The data to send in the request body.
|
|
33
35
|
* @return A promise resolving to the response data.
|
|
36
|
+
* @description Define a protected asynchronous method '_fetchPut' that performs a PUT request
|
|
34
37
|
*/
|
|
35
38
|
protected _fetchPut(path: string, data: any): Promise<any>;
|
|
36
39
|
/**
|
|
@@ -38,16 +41,18 @@ export default abstract class AsyncModules extends SyncModules {
|
|
|
38
41
|
* @param path - The path to append to the base URL.
|
|
39
42
|
* @param data - Optional data to send in the request body.
|
|
40
43
|
* @return A promise resolving to the response data.
|
|
44
|
+
* @description Define a protected asynchronous method '_fetchDelete' that performs a DELETE request
|
|
41
45
|
*/
|
|
42
46
|
protected _fetchDelete(path: string, data?: any): Promise<any>;
|
|
43
47
|
/**
|
|
44
48
|
* Refreshes the authentication token.
|
|
45
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
|
|
46
51
|
*/
|
|
47
52
|
protected refreshToken(): Promise<boolean>;
|
|
48
53
|
/**
|
|
49
54
|
* Creates options for HTTP requests.
|
|
50
|
-
* @param method - The HTTP method (GET, POST, etc.).
|
|
55
|
+
* @param method - The HTTP method (GET, POST, PUT, DELETE, etc.).
|
|
51
56
|
* @param data - Optional data to include in the request body.
|
|
52
57
|
* @return An object representing the request options.
|
|
53
58
|
*/
|
|
@@ -57,6 +62,7 @@ export default abstract class AsyncModules extends SyncModules {
|
|
|
57
62
|
* @param path - The path to append to the base URL.
|
|
58
63
|
* @param options - The options for the fetch request.
|
|
59
64
|
* @return A promise resolving to the response data.
|
|
65
|
+
* @description Define an asynchronous method 'browserResponse' that takes a path and options as parameters
|
|
60
66
|
*/
|
|
61
67
|
private browserResponse;
|
|
62
68
|
}
|