oneentry 1.0.123 → 1.0.124
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admins/adminsApi.d.ts +16 -8
- package/dist/admins/adminsApi.js +17 -9
- package/dist/admins/adminsInterfaces.d.ts +49 -25
- package/dist/attribute-sets/attributeSetsApi.d.ts +43 -21
- package/dist/attribute-sets/attributeSetsApi.js +49 -25
- package/dist/attribute-sets/attributeSetsInterfaces.d.ts +70 -24
- package/dist/auth-provider/authProviderApi.d.ts +94 -83
- package/dist/auth-provider/authProviderApi.js +96 -83
- package/dist/auth-provider/authProvidersInterfaces.d.ts +188 -10
- package/dist/base/asyncModules.d.ts +32 -28
- package/dist/base/asyncModules.js +61 -36
- package/dist/base/syncModules.d.ts +44 -44
- package/dist/base/syncModules.js +65 -63
- package/dist/blocks/blocksApi.d.ts +56 -25
- package/dist/blocks/blocksApi.js +56 -25
- package/dist/blocks/blocksInterfaces.d.ts +71 -22
- package/dist/events/eventsApi.d.ts +45 -11
- package/dist/events/eventsApi.js +47 -17
- package/dist/events/eventsInterfaces.d.ts +44 -2
- package/dist/file-uploading/fileUploadingApi.d.ts +44 -24
- package/dist/file-uploading/fileUploadingApi.js +46 -27
- package/dist/file-uploading/fileUploadingInterfaces.d.ts +63 -14
- package/dist/forms/formsApi.d.ts +23 -8
- package/dist/forms/formsApi.js +23 -8
- package/dist/forms/formsInterfaces.d.ts +62 -15
- package/dist/formsData/formsDataApi.d.ts +33 -33
- package/dist/formsData/formsDataApi.js +33 -33
- package/dist/formsData/formsDataInterfaces.d.ts +123 -35
- package/dist/general-types/generalTypesApi.d.ts +12 -1
- package/dist/general-types/generalTypesApi.js +12 -1
- package/dist/general-types/generalTypesInterfaces.d.ts +18 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/integration-collections/integrationCollectionsApi.d.ts +96 -70
- package/dist/integration-collections/integrationCollectionsApi.js +114 -81
- package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +152 -30
- package/dist/locales/localesApi.d.ts +6 -1
- package/dist/locales/localesApi.js +6 -1
- package/dist/locales/localesInterfaces.d.ts +20 -11
- package/dist/menus/menusApi.d.ts +8 -3
- package/dist/menus/menusApi.js +8 -3
- package/dist/menus/menusInterfaces.d.ts +30 -17
- package/dist/orders/ordersApi.d.ts +64 -64
- package/dist/orders/ordersApi.js +67 -65
- package/dist/orders/ordersInterfaces.d.ts +174 -60
- package/dist/pages/pagesApi.d.ts +87 -28
- package/dist/pages/pagesApi.js +87 -28
- package/dist/pages/pagesInterfaces.d.ts +117 -23
- package/dist/payments/paymentsApi.d.ts +56 -22
- package/dist/payments/paymentsApi.js +56 -22
- package/dist/payments/paymentsInterfaces.d.ts +119 -36
- package/dist/product-statuses/productStatusesApi.d.ts +21 -15
- package/dist/product-statuses/productStatusesApi.js +21 -18
- package/dist/product-statuses/productStatusesInterfaces.d.ts +37 -9
- package/dist/products/productsApi.d.ts +137 -157
- package/dist/products/productsApi.js +137 -157
- package/dist/products/productsInterfaces.d.ts +240 -57
- package/dist/system/systemApi.d.ts +29 -10
- package/dist/system/systemApi.js +29 -10
- package/dist/system/systemInterfaces.d.ts +8 -0
- package/dist/templates/templatesApi.d.ts +26 -16
- package/dist/templates/templatesApi.js +26 -19
- package/dist/templates/templatesInterfaces.d.ts +40 -14
- package/dist/templates-preview/templatesPreviewApi.d.ts +18 -14
- package/dist/templates-preview/templatesPreviewApi.js +18 -17
- package/dist/templates-preview/templatesPreviewInterfaces.d.ts +54 -26
- package/dist/users/usersApi.d.ts +37 -33
- package/dist/users/usersApi.js +37 -33
- package/dist/users/usersInterfaces.d.ts +80 -9
- package/dist/web-socket/wsApi.d.ts +6 -3
- package/dist/web-socket/wsApi.js +6 -3
- package/dist/web-socket/wsInterfaces.d.ts +3 -1
- package/package.json +11 -11
|
@@ -4,139 +4,150 @@ import type { IError } from '../base/utils';
|
|
|
4
4
|
import type { IAuthEntity, IAuthPostBody, IAuthProvider, IAuthProvidersEntity, ISignUpData, ISignUpEntity } from './authProvidersInterfaces';
|
|
5
5
|
/**
|
|
6
6
|
* Controllers for working with auth services.
|
|
7
|
+
*
|
|
7
8
|
* @handle /api/content/users-auth-providers
|
|
9
|
+
* @class AuthProviderApi
|
|
10
|
+
* @extends AsyncModules
|
|
11
|
+
* @implements {IAuthProvider}
|
|
12
|
+
*
|
|
13
|
+
* @description This class provides methods for user registration, authentication, and management of authentication providers.
|
|
8
14
|
*/
|
|
9
15
|
export default class AuthProviderApi extends AsyncModules implements IAuthProvider {
|
|
10
16
|
protected state: StateModule;
|
|
11
17
|
protected _url: string;
|
|
12
18
|
constructor(state: StateModule);
|
|
13
19
|
/**
|
|
14
|
-
* User registration
|
|
15
|
-
*
|
|
16
|
-
* @param {string}
|
|
17
|
-
* @param {ISignUpData}
|
|
18
|
-
* @param {string} [langCode] -
|
|
19
|
-
*
|
|
20
|
-
* @
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* {
|
|
25
|
-
* "marker": "login",
|
|
26
|
-
* "value": "example@oneentry.cloud"
|
|
27
|
-
* },
|
|
28
|
-
* {
|
|
29
|
-
* "marker": "password",
|
|
30
|
-
* "value": "12345"
|
|
31
|
-
* }
|
|
32
|
-
* ],
|
|
33
|
-
* "formData": [
|
|
34
|
-
* {
|
|
35
|
-
* "marker": "last_name",
|
|
36
|
-
* "type": "string",
|
|
37
|
-
* "value": "Name"
|
|
38
|
-
* }
|
|
39
|
-
* ],
|
|
40
|
-
* "notificationData": {
|
|
41
|
-
* "email": "example@oneentry.cloud",
|
|
42
|
-
* "phonePush": ["+99999999999"],
|
|
43
|
-
* "phoneSMS": "+99999999999"
|
|
44
|
-
* }
|
|
45
|
-
* }
|
|
20
|
+
* User registration.
|
|
21
|
+
*
|
|
22
|
+
* @param {string} marker - The text identifier of the authorization provider. Example: "email".
|
|
23
|
+
* @param {ISignUpData} body - Request body. Example: { "formIdentifier": "reg", "authData": [ { "marker": "login", "value": "example@oneentry.cloud" }, { "marker": "password", "value": "12345" } ], "formData": [ { "marker": "last_name", "type": "string", "value": "Name" } ], "notificationData": {"email": "example@oneentry.cloud", "phonePush": ["+99999999999"], "phoneSMS": "+99999999999" } }
|
|
24
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
25
|
+
*
|
|
26
|
+
* @return {ISignUpEntity} Returns a user object.
|
|
27
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
28
|
+
*
|
|
29
|
+
* @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
|
|
46
30
|
*/
|
|
47
31
|
signUp(marker: string, body: ISignUpData, langCode?: string): Promise<ISignUpEntity | IError>;
|
|
48
32
|
/**
|
|
49
|
-
* Getting a user activation code. The code is returned via the appropriate user notification method
|
|
33
|
+
* Getting a user activation code. The code is returned via the appropriate user notification method.
|
|
50
34
|
*
|
|
51
|
-
* @param {string}
|
|
52
|
-
* @param {string}
|
|
53
|
-
* @param {string}
|
|
35
|
+
* @param {string} marker - The text identifier of the authorization provider. Example: "email".
|
|
36
|
+
* @param {string} userIdentifier - The text identifier of the user's object (user login). Example: "example@oneentry.cloud".
|
|
37
|
+
* @param {string} eventIdentifier - Text identifier of the event object for which the code is generated. Example: "user_registration".
|
|
38
|
+
*
|
|
39
|
+
* @return {void} Returns void if the code is successfully generated, or an error object if there was an issue.
|
|
40
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
41
|
+
*
|
|
42
|
+
* @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
|
|
54
43
|
*/
|
|
55
44
|
generateCode(marker: string, userIdentifier: string, eventIdentifier: string): Promise<void | IError>;
|
|
56
45
|
/**
|
|
57
46
|
* User activation code verification. Returns true (if the code is correct) or false (if it is incorrect).
|
|
58
47
|
*
|
|
59
|
-
* @param {string}
|
|
60
|
-
* @param {string}
|
|
61
|
-
* @param {string}
|
|
62
|
-
* @param {string}
|
|
48
|
+
* @param {string} marker - The text identifier of the authorization provider. Example: "email".
|
|
49
|
+
* @param {string} userIdentifier - The text identifier of the user's object (user login). Example: "example@oneentry.cloud".
|
|
50
|
+
* @param {string} eventIdentifier - Text identifier of the event object for which the code is generated. Example: "user_registration".
|
|
51
|
+
* @param {string} code - Service code. Example: "123456".
|
|
52
|
+
*
|
|
53
|
+
* @return {boolean} Returns true if the code is correct, or an error object if there was an issue.
|
|
54
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
55
|
+
*
|
|
56
|
+
* @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
|
|
63
57
|
*/
|
|
64
58
|
checkCode(marker: string, userIdentifier: string, eventIdentifier: string, code: string): Promise<boolean | IError>;
|
|
65
59
|
/**
|
|
66
60
|
* User activate.
|
|
67
61
|
*
|
|
68
|
-
* @param {string} marker - The text identifier of the authorization provider. Example
|
|
69
|
-
* @param {string} userIdentifier - The text identifier of the user's object (user login)
|
|
70
|
-
* @param {string} code - Service code
|
|
62
|
+
* @param {string} marker - The text identifier of the authorization provider. Example: "email".
|
|
63
|
+
* @param {string} userIdentifier - The text identifier of the user's object (user login). Example: "example@oneentry.cloud".
|
|
64
|
+
* @param {string} code - Service code. Example: "123456".
|
|
65
|
+
*
|
|
66
|
+
* @return {boolean} Returns true if the user was successfully activated, or an error object if there was an issue.
|
|
67
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
68
|
+
*
|
|
69
|
+
* @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
|
|
71
70
|
*/
|
|
72
71
|
activateUser(marker: string, userIdentifier: string, code: string): Promise<boolean | IError>;
|
|
73
72
|
/**
|
|
74
|
-
* User authorization
|
|
75
|
-
*
|
|
76
|
-
* @param {string} marker - The text identifier of the authorization provider. Example
|
|
77
|
-
* @param {IAuthPostBody} data - Array of objects contains auth information
|
|
78
|
-
*
|
|
79
|
-
* @
|
|
80
|
-
*
|
|
81
|
-
|
|
82
|
-
*
|
|
83
|
-
* marker: "login",
|
|
84
|
-
* value: "test"
|
|
85
|
-
* },
|
|
86
|
-
* {
|
|
87
|
-
* marker: "password",
|
|
88
|
-
* value: "12345"
|
|
89
|
-
* }
|
|
90
|
-
* ]
|
|
91
|
-
* }
|
|
73
|
+
* User authorization.
|
|
74
|
+
*
|
|
75
|
+
* @param {string} marker - The text identifier of the authorization provider. Example: "email".
|
|
76
|
+
* @param {IAuthPostBody} data - Array of objects contains auth information. Example: { "authData": [ { "marker": "login", "value": "example@oneentry.cloud" }, { "marker": "password", "value": "12345" } ] } }
|
|
77
|
+
*
|
|
78
|
+
* @return {IAuthEntity} Returns an auth entity object.
|
|
79
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
80
|
+
|
|
81
|
+
* @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
|
|
92
82
|
*
|
|
93
83
|
*/
|
|
94
84
|
auth(marker: string, data: IAuthPostBody): Promise<IAuthEntity | IError>;
|
|
95
85
|
/**
|
|
96
|
-
* Refresh token
|
|
86
|
+
* Refresh token.
|
|
97
87
|
*
|
|
98
|
-
* @param {string}
|
|
99
|
-
* @param {string}
|
|
88
|
+
* @param {string} marker - The text identifier of the authorization provider. Example: "email".
|
|
89
|
+
* @param {string} token - Refresh token. Example: "abcdef123456".
|
|
100
90
|
*
|
|
91
|
+
* @return {IAuthEntity} Returns an auth entity object with the following values: accessToken, refreshToken, user, and other auth-related data.
|
|
92
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
93
|
+
*
|
|
94
|
+
* @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
|
|
101
95
|
*/
|
|
102
96
|
refresh(marker: string, token: string): Promise<IAuthEntity | IError>;
|
|
103
97
|
/**
|
|
104
98
|
* User logout.
|
|
105
99
|
*
|
|
106
|
-
* @param {string} marker - The text identifier of the authorization provider. Example
|
|
107
|
-
* @param {string} token - Refresh token
|
|
100
|
+
* @param {string} marker - The text identifier of the authorization provider. Example: "email".
|
|
101
|
+
* @param {string} token - Refresh token. Example: "abcdef123456".
|
|
102
|
+
*
|
|
103
|
+
* @return {boolean} Returns true if the logout was successful, or an error object if there was an issue.
|
|
104
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
108
105
|
*
|
|
109
106
|
* @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
|
|
110
107
|
*/
|
|
111
108
|
logout(marker: string, token: string): Promise<boolean | IError>;
|
|
112
109
|
/**
|
|
113
|
-
* Change password
|
|
110
|
+
* Change password.
|
|
111
|
+
*
|
|
112
|
+
* @param {string} marker - The text identifier of the authorization provider. Example: "email".
|
|
113
|
+
* @param {string} userIdentifier - The text identifier of the user's object (user login). Example: "example@oneentry.cloud".
|
|
114
|
+
* @param {string} eventIdentifier - The text identifier of the event. Example: "reg".
|
|
115
|
+
* @param {string} type - Operation type (1 - for changing password, 2 - for recovery). Example: 1.
|
|
116
|
+
* @param {string} code - Service code. Example: "123456".
|
|
117
|
+
* @param {string} newPassword - New password. Example: "newPassword123".
|
|
118
|
+
* @param {string} [repeatPassword] - Optional variable contains repeat new password for validation. Example: "newPassword123".
|
|
114
119
|
*
|
|
115
|
-
* @
|
|
116
|
-
* @
|
|
117
|
-
* @param {string} [type] - Operation type (1 - for changing password, 2 - for recovery)
|
|
118
|
-
* @param {string} [code] - Service code
|
|
119
|
-
* @param {string} [newPassword] - New password
|
|
120
|
-
* @param {string} [repeatPassword] - Optional variable contains repeat new password for validation
|
|
120
|
+
* @return {boolean} Returns true if the password was successfully changed, or an error object if there was an issue.
|
|
121
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
121
122
|
*
|
|
122
|
-
* @
|
|
123
|
-
* await AuthProvider.changePassword('email', userIdentifier, type, code, newPassword, repeatPassword);
|
|
123
|
+
* @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
|
|
124
|
+
* @example await AuthProvider.changePassword('email', userIdentifier, type, code, newPassword, repeatPassword);
|
|
124
125
|
*
|
|
125
126
|
*/
|
|
126
|
-
changePassword(marker: string, userIdentifier: string, type: number, code: string, newPassword: string, repeatPassword?: string): Promise<boolean | IError>;
|
|
127
|
+
changePassword(marker: string, userIdentifier: string, eventIdentifier: string, type: number, code: string, newPassword: string, repeatPassword?: string): Promise<boolean | IError>;
|
|
127
128
|
/**
|
|
128
|
-
* Get all auth providers objects
|
|
129
|
+
* Get all auth providers objects.
|
|
129
130
|
*
|
|
130
|
-
* @param {string} [langCode] - Language code. Default "en_US"
|
|
131
|
-
* @param {number} [offset] - Parameter for pagination. Default 0
|
|
132
|
-
* @param {number} [limit] - Parameter for pagination. Default 30
|
|
131
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
132
|
+
* @param {number} [offset] - Parameter for pagination. Default: 0.
|
|
133
|
+
* @param {number} [limit] - Parameter for pagination. Default: 30.
|
|
134
|
+
*
|
|
135
|
+
* @return {IAuthProvidersEntity[]} Returns an array of auth provider objects.
|
|
136
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
137
|
+
*
|
|
138
|
+
* @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
|
|
133
139
|
*/
|
|
134
140
|
getAuthProviders(langCode?: string, offset?: number, limit?: number): Promise<Array<IAuthProvidersEntity> | IError>;
|
|
135
141
|
/**
|
|
136
|
-
* Get one auth provider object by marker
|
|
142
|
+
* Get one auth provider object by marker.
|
|
137
143
|
*
|
|
138
|
-
* @param {string}
|
|
139
|
-
* @param {string} [langCode] -
|
|
144
|
+
* @param {string} marker - The text identifier of the authorization provider. Example: "email".
|
|
145
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
146
|
+
*
|
|
147
|
+
* @return {IAuthProvidersEntity} Returns an auth provider object.
|
|
148
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
149
|
+
*
|
|
150
|
+
* @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
|
|
140
151
|
*/
|
|
141
152
|
getMarker(marker: string, langCode?: string): Promise<IAuthProvidersEntity | IError>;
|
|
142
153
|
}
|
|
@@ -6,7 +6,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const asyncModules_1 = __importDefault(require("../base/asyncModules"));
|
|
7
7
|
/**
|
|
8
8
|
* Controllers for working with auth services.
|
|
9
|
+
*
|
|
9
10
|
* @handle /api/content/users-auth-providers
|
|
11
|
+
* @class AuthProviderApi
|
|
12
|
+
* @extends AsyncModules
|
|
13
|
+
* @implements {IAuthProvider}
|
|
14
|
+
*
|
|
15
|
+
* @description This class provides methods for user registration, authentication, and management of authentication providers.
|
|
10
16
|
*/
|
|
11
17
|
class AuthProviderApi extends asyncModules_1.default {
|
|
12
18
|
constructor(state) {
|
|
@@ -14,38 +20,16 @@ class AuthProviderApi extends asyncModules_1.default {
|
|
|
14
20
|
this._url = state.url + '/api/content/users-auth-providers';
|
|
15
21
|
}
|
|
16
22
|
/**
|
|
17
|
-
* User registration
|
|
18
|
-
*
|
|
19
|
-
* @param {string}
|
|
20
|
-
* @param {ISignUpData}
|
|
21
|
-
* @param {string} [langCode] -
|
|
22
|
-
*
|
|
23
|
-
* @
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* {
|
|
28
|
-
* "marker": "login",
|
|
29
|
-
* "value": "example@oneentry.cloud"
|
|
30
|
-
* },
|
|
31
|
-
* {
|
|
32
|
-
* "marker": "password",
|
|
33
|
-
* "value": "12345"
|
|
34
|
-
* }
|
|
35
|
-
* ],
|
|
36
|
-
* "formData": [
|
|
37
|
-
* {
|
|
38
|
-
* "marker": "last_name",
|
|
39
|
-
* "type": "string",
|
|
40
|
-
* "value": "Name"
|
|
41
|
-
* }
|
|
42
|
-
* ],
|
|
43
|
-
* "notificationData": {
|
|
44
|
-
* "email": "example@oneentry.cloud",
|
|
45
|
-
* "phonePush": ["+99999999999"],
|
|
46
|
-
* "phoneSMS": "+99999999999"
|
|
47
|
-
* }
|
|
48
|
-
* }
|
|
23
|
+
* User registration.
|
|
24
|
+
*
|
|
25
|
+
* @param {string} marker - The text identifier of the authorization provider. Example: "email".
|
|
26
|
+
* @param {ISignUpData} body - Request body. Example: { "formIdentifier": "reg", "authData": [ { "marker": "login", "value": "example@oneentry.cloud" }, { "marker": "password", "value": "12345" } ], "formData": [ { "marker": "last_name", "type": "string", "value": "Name" } ], "notificationData": {"email": "example@oneentry.cloud", "phonePush": ["+99999999999"], "phoneSMS": "+99999999999" } }
|
|
27
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
28
|
+
*
|
|
29
|
+
* @return {ISignUpEntity} Returns a user object.
|
|
30
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
31
|
+
*
|
|
32
|
+
* @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
|
|
49
33
|
*/
|
|
50
34
|
async signUp(marker, body, langCode = this.state.lang) {
|
|
51
35
|
body['langCode'] = langCode;
|
|
@@ -53,11 +37,16 @@ class AuthProviderApi extends asyncModules_1.default {
|
|
|
53
37
|
return this._normalizeData(result);
|
|
54
38
|
}
|
|
55
39
|
/**
|
|
56
|
-
* Getting a user activation code. The code is returned via the appropriate user notification method
|
|
40
|
+
* Getting a user activation code. The code is returned via the appropriate user notification method.
|
|
57
41
|
*
|
|
58
|
-
* @param {string}
|
|
59
|
-
* @param {string}
|
|
60
|
-
* @param {string}
|
|
42
|
+
* @param {string} marker - The text identifier of the authorization provider. Example: "email".
|
|
43
|
+
* @param {string} userIdentifier - The text identifier of the user's object (user login). Example: "example@oneentry.cloud".
|
|
44
|
+
* @param {string} eventIdentifier - Text identifier of the event object for which the code is generated. Example: "user_registration".
|
|
45
|
+
*
|
|
46
|
+
* @return {void} Returns void if the code is successfully generated, or an error object if there was an issue.
|
|
47
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
48
|
+
*
|
|
49
|
+
* @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
|
|
61
50
|
*/
|
|
62
51
|
async generateCode(marker, userIdentifier, eventIdentifier) {
|
|
63
52
|
const data = {
|
|
@@ -71,10 +60,15 @@ class AuthProviderApi extends asyncModules_1.default {
|
|
|
71
60
|
/**
|
|
72
61
|
* User activation code verification. Returns true (if the code is correct) or false (if it is incorrect).
|
|
73
62
|
*
|
|
74
|
-
* @param {string}
|
|
75
|
-
* @param {string}
|
|
76
|
-
* @param {string}
|
|
77
|
-
* @param {string}
|
|
63
|
+
* @param {string} marker - The text identifier of the authorization provider. Example: "email".
|
|
64
|
+
* @param {string} userIdentifier - The text identifier of the user's object (user login). Example: "example@oneentry.cloud".
|
|
65
|
+
* @param {string} eventIdentifier - Text identifier of the event object for which the code is generated. Example: "user_registration".
|
|
66
|
+
* @param {string} code - Service code. Example: "123456".
|
|
67
|
+
*
|
|
68
|
+
* @return {boolean} Returns true if the code is correct, or an error object if there was an issue.
|
|
69
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
70
|
+
*
|
|
71
|
+
* @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
|
|
78
72
|
*/
|
|
79
73
|
async checkCode(marker, userIdentifier, eventIdentifier, code) {
|
|
80
74
|
const data = {
|
|
@@ -88,9 +82,14 @@ class AuthProviderApi extends asyncModules_1.default {
|
|
|
88
82
|
/**
|
|
89
83
|
* User activate.
|
|
90
84
|
*
|
|
91
|
-
* @param {string} marker - The text identifier of the authorization provider. Example
|
|
92
|
-
* @param {string} userIdentifier - The text identifier of the user's object (user login)
|
|
93
|
-
* @param {string} code - Service code
|
|
85
|
+
* @param {string} marker - The text identifier of the authorization provider. Example: "email".
|
|
86
|
+
* @param {string} userIdentifier - The text identifier of the user's object (user login). Example: "example@oneentry.cloud".
|
|
87
|
+
* @param {string} code - Service code. Example: "123456".
|
|
88
|
+
*
|
|
89
|
+
* @return {boolean} Returns true if the user was successfully activated, or an error object if there was an issue.
|
|
90
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
91
|
+
*
|
|
92
|
+
* @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
|
|
94
93
|
*/
|
|
95
94
|
async activateUser(marker, userIdentifier, code) {
|
|
96
95
|
const data = {
|
|
@@ -101,41 +100,37 @@ class AuthProviderApi extends asyncModules_1.default {
|
|
|
101
100
|
return result;
|
|
102
101
|
}
|
|
103
102
|
/**
|
|
104
|
-
* User authorization
|
|
105
|
-
*
|
|
106
|
-
* @param {string} marker - The text identifier of the authorization provider. Example
|
|
107
|
-
* @param {IAuthPostBody} data - Array of objects contains auth information
|
|
108
|
-
*
|
|
109
|
-
* @
|
|
110
|
-
*
|
|
111
|
-
|
|
112
|
-
*
|
|
113
|
-
* marker: "login",
|
|
114
|
-
* value: "test"
|
|
115
|
-
* },
|
|
116
|
-
* {
|
|
117
|
-
* marker: "password",
|
|
118
|
-
* value: "12345"
|
|
119
|
-
* }
|
|
120
|
-
* ]
|
|
121
|
-
* }
|
|
103
|
+
* User authorization.
|
|
104
|
+
*
|
|
105
|
+
* @param {string} marker - The text identifier of the authorization provider. Example: "email".
|
|
106
|
+
* @param {IAuthPostBody} data - Array of objects contains auth information. Example: { "authData": [ { "marker": "login", "value": "example@oneentry.cloud" }, { "marker": "password", "value": "12345" } ] } }
|
|
107
|
+
*
|
|
108
|
+
* @return {IAuthEntity} Returns an auth entity object.
|
|
109
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
110
|
+
|
|
111
|
+
* @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
|
|
122
112
|
*
|
|
123
113
|
*/
|
|
124
114
|
async auth(marker, data) {
|
|
125
115
|
const result = await this._fetchPost(`/marker/${marker}/users/auth`, data);
|
|
126
116
|
this.state.accessToken = result.accessToken;
|
|
127
117
|
this.state.refreshToken = result.refreshToken;
|
|
118
|
+
// console.log(result);
|
|
128
119
|
if (this.state.saveFunction) {
|
|
129
120
|
this.state.saveFunction(result.refreshToken);
|
|
130
121
|
}
|
|
131
122
|
return result;
|
|
132
123
|
}
|
|
133
124
|
/**
|
|
134
|
-
* Refresh token
|
|
125
|
+
* Refresh token.
|
|
135
126
|
*
|
|
136
|
-
* @param {string}
|
|
137
|
-
* @param {string}
|
|
127
|
+
* @param {string} marker - The text identifier of the authorization provider. Example: "email".
|
|
128
|
+
* @param {string} token - Refresh token. Example: "abcdef123456".
|
|
138
129
|
*
|
|
130
|
+
* @return {IAuthEntity} Returns an auth entity object with the following values: accessToken, refreshToken, user, and other auth-related data.
|
|
131
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
132
|
+
*
|
|
133
|
+
* @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
|
|
139
134
|
*/
|
|
140
135
|
async refresh(marker, token) {
|
|
141
136
|
const data = { refreshToken: token };
|
|
@@ -150,8 +145,11 @@ class AuthProviderApi extends asyncModules_1.default {
|
|
|
150
145
|
/**
|
|
151
146
|
* User logout.
|
|
152
147
|
*
|
|
153
|
-
* @param {string} marker - The text identifier of the authorization provider. Example
|
|
154
|
-
* @param {string} token - Refresh token
|
|
148
|
+
* @param {string} marker - The text identifier of the authorization provider. Example: "email".
|
|
149
|
+
* @param {string} token - Refresh token. Example: "abcdef123456".
|
|
150
|
+
*
|
|
151
|
+
* @return {boolean} Returns true if the logout was successful, or an error object if there was an issue.
|
|
152
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
155
153
|
*
|
|
156
154
|
* @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
|
|
157
155
|
*/
|
|
@@ -170,22 +168,27 @@ class AuthProviderApi extends asyncModules_1.default {
|
|
|
170
168
|
return result;
|
|
171
169
|
}
|
|
172
170
|
/**
|
|
173
|
-
* Change password
|
|
171
|
+
* Change password.
|
|
172
|
+
*
|
|
173
|
+
* @param {string} marker - The text identifier of the authorization provider. Example: "email".
|
|
174
|
+
* @param {string} userIdentifier - The text identifier of the user's object (user login). Example: "example@oneentry.cloud".
|
|
175
|
+
* @param {string} eventIdentifier - The text identifier of the event. Example: "reg".
|
|
176
|
+
* @param {string} type - Operation type (1 - for changing password, 2 - for recovery). Example: 1.
|
|
177
|
+
* @param {string} code - Service code. Example: "123456".
|
|
178
|
+
* @param {string} newPassword - New password. Example: "newPassword123".
|
|
179
|
+
* @param {string} [repeatPassword] - Optional variable contains repeat new password for validation. Example: "newPassword123".
|
|
174
180
|
*
|
|
175
|
-
* @
|
|
176
|
-
* @
|
|
177
|
-
* @param {string} [type] - Operation type (1 - for changing password, 2 - for recovery)
|
|
178
|
-
* @param {string} [code] - Service code
|
|
179
|
-
* @param {string} [newPassword] - New password
|
|
180
|
-
* @param {string} [repeatPassword] - Optional variable contains repeat new password for validation
|
|
181
|
+
* @return {boolean} Returns true if the password was successfully changed, or an error object if there was an issue.
|
|
182
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
181
183
|
*
|
|
182
|
-
* @
|
|
183
|
-
* await AuthProvider.changePassword('email', userIdentifier, type, code, newPassword, repeatPassword);
|
|
184
|
+
* @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
|
|
185
|
+
* @example await AuthProvider.changePassword('email', userIdentifier, type, code, newPassword, repeatPassword);
|
|
184
186
|
*
|
|
185
187
|
*/
|
|
186
|
-
async changePassword(marker, userIdentifier, type, code, newPassword, repeatPassword) {
|
|
188
|
+
async changePassword(marker, userIdentifier, eventIdentifier, type, code, newPassword, repeatPassword) {
|
|
187
189
|
const data = {
|
|
188
190
|
userIdentifier: userIdentifier,
|
|
191
|
+
eventIdentifier: eventIdentifier,
|
|
189
192
|
code: code,
|
|
190
193
|
type: type,
|
|
191
194
|
password1: newPassword,
|
|
@@ -195,21 +198,31 @@ class AuthProviderApi extends asyncModules_1.default {
|
|
|
195
198
|
return result;
|
|
196
199
|
}
|
|
197
200
|
/**
|
|
198
|
-
* Get all auth providers objects
|
|
201
|
+
* Get all auth providers objects.
|
|
199
202
|
*
|
|
200
|
-
* @param {string} [langCode] - Language code. Default "en_US"
|
|
201
|
-
* @param {number} [offset] - Parameter for pagination. Default 0
|
|
202
|
-
* @param {number} [limit] - Parameter for pagination. Default 30
|
|
203
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
204
|
+
* @param {number} [offset] - Parameter for pagination. Default: 0.
|
|
205
|
+
* @param {number} [limit] - Parameter for pagination. Default: 30.
|
|
206
|
+
*
|
|
207
|
+
* @return {IAuthProvidersEntity[]} Returns an array of auth provider objects.
|
|
208
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
209
|
+
*
|
|
210
|
+
* @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
|
|
203
211
|
*/
|
|
204
212
|
async getAuthProviders(langCode = this.state.lang, offset = 0, limit = 30) {
|
|
205
213
|
const result = await this._fetchGet(`?langCode=${langCode}&offset=${offset}&limit=${limit}`);
|
|
206
214
|
return this._normalizeData(result);
|
|
207
215
|
}
|
|
208
216
|
/**
|
|
209
|
-
* Get one auth provider object by marker
|
|
217
|
+
* Get one auth provider object by marker.
|
|
210
218
|
*
|
|
211
|
-
* @param {string}
|
|
212
|
-
* @param {string} [langCode] -
|
|
219
|
+
* @param {string} marker - The text identifier of the authorization provider. Example: "email".
|
|
220
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
221
|
+
*
|
|
222
|
+
* @return {IAuthProvidersEntity} Returns an auth provider object.
|
|
223
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
224
|
+
*
|
|
225
|
+
* @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
|
|
213
226
|
*/
|
|
214
227
|
async getMarker(marker, langCode = this.state.lang) {
|
|
215
228
|
const result = await this._fetchGet(`/marker/${marker}?langCode=${langCode}`);
|