cidaas-javascript-sdk 4.3.3 → 5.0.0
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/CHANGELOG.md +52 -5
- package/README.md +109 -93
- package/dist/authentication-service/AuthenticationService.d.ts +140 -0
- package/dist/authentication-service/AuthenticationService.js +210 -0
- package/dist/{authentication/Authentication.model.d.ts → authentication-service/AuthenticationService.model.d.ts} +18 -12
- package/dist/{authentication/Authentication.model.js → authentication-service/AuthenticationService.model.js} +2 -2
- package/dist/common/Common.model.d.ts +15 -19
- package/dist/common/Common.model.js +17 -17
- package/dist/common/ConfigUserProvider.d.ts +10 -0
- package/dist/common/ConfigUserProvider.js +28 -0
- package/dist/common/Helper.d.ts +7 -0
- package/dist/common/Helper.js +19 -0
- package/dist/common/User.model.d.ts +0 -4
- package/dist/consent-service/ConsentService.d.ts +99 -95
- package/dist/consent-service/ConsentService.js +125 -122
- package/dist/consent-service/ConsentService.model.d.ts +14 -16
- package/dist/device-service/DeviceService.d.ts +49 -0
- package/dist/device-service/DeviceService.js +79 -0
- package/dist/device-service/DeviceService.model.d.ts +6 -0
- package/dist/id-validation-service/IdValidationService.d.ts +28 -0
- package/dist/id-validation-service/IdValidationService.js +59 -0
- package/dist/id-validation-service/IdValidationService.model.d.ts +8 -0
- package/dist/id-validation-service/IdValidationService.model.js +2 -0
- package/dist/index.d.ts +22 -3
- package/dist/index.js +35 -18
- package/dist/login-service/LoginService.d.ts +143 -141
- package/dist/login-service/LoginService.js +225 -234
- package/dist/login-service/LoginService.model.d.ts +7 -51
- package/dist/login-service/LoginService.model.js +1 -1
- package/dist/public-service/PublicService.d.ts +57 -0
- package/dist/public-service/PublicService.js +73 -0
- package/dist/public-service/PublicService.model.d.ts +20 -0
- package/dist/public-service/PublicService.model.js +2 -0
- package/dist/token-service/TokenService.d.ts +104 -138
- package/dist/token-service/TokenService.js +164 -219
- package/dist/token-service/TokenService.model.d.ts +3 -44
- package/dist/token-service/TokenService.model.js +3 -16
- package/dist/user-service/UserService.d.ts +381 -315
- package/dist/user-service/UserService.js +552 -426
- package/dist/user-service/UserService.model.d.ts +48 -14
- package/dist/user-service/UserService.model.js +4 -4
- package/dist/verification-service/VerificationService.d.ts +281 -223
- package/dist/verification-service/VerificationService.js +343 -287
- package/dist/verification-service/VerificationService.model.d.ts +4 -5
- package/package.json +6 -4
- package/dist/authentication/Authentication.d.ts +0 -139
- package/dist/authentication/Authentication.js +0 -186
- package/dist/web-auth/WebAuth.d.ts +0 -665
- package/dist/web-auth/WebAuth.js +0 -955
- package/dist/web-auth/webauth.model.d.ts +0 -66
- /package/dist/{web-auth/webauth.model.js → device-service/DeviceService.model.js} +0 -0
|
@@ -1,317 +1,383 @@
|
|
|
1
|
-
import { ChangePasswordRequest, DeduplicationLoginRequest, DeleteUserAccountRequest, GetDeduplicationDetailsRequest, GetInviteUserDetailsRequest, GetUserProfileRequest, HandleResetPasswordRequest, InitiateLinkAccountRequest, InitiateResetPasswordRequest, RegisterDeduplicationRequest, RegisterRequest, ResetPasswordRequest, UserCheckExistsRequest, CompleteLinkAccountRequest,
|
|
1
|
+
import { ChangePasswordRequest, DeduplicationLoginRequest, DeleteUserAccountRequest, GetDeduplicationDetailsRequest, GetInviteUserDetailsRequest, GetUserProfileRequest, HandleResetPasswordRequest, InitiateLinkAccountRequest, InitiateResetPasswordRequest, RegisterDeduplicationRequest, RegisterRequest, ResetPasswordRequest, UserCheckExistsRequest, CompleteLinkAccountRequest, GetCommunicationStatusRequest, GetRegistrationSetupRequest, GetUserActivitiesRequest, UpdateProfileImageRequest, UserActionOnEnrollmentRequest } from "./UserService.model";
|
|
2
2
|
import { HTTPRequestHeader } from "../common/Common.model";
|
|
3
3
|
import { CidaasUser } from "../common/User.model";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
/**
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
4
|
+
import ConfigUserProvider from "../common/ConfigUserProvider";
|
|
5
|
+
export declare class UserService {
|
|
6
|
+
private config;
|
|
7
|
+
private userManager;
|
|
8
|
+
constructor(configUserProvider: ConfigUserProvider);
|
|
9
|
+
/**
|
|
10
|
+
* To get the user profile information by using cidaas internal api, call **getUserProfile()**.
|
|
11
|
+
* Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/2zfvjx3vtq6g6-get-user-info for more details.
|
|
12
|
+
* @example
|
|
13
|
+
* ```js
|
|
14
|
+
* cidaasUserService.getUserProfile()
|
|
15
|
+
* .then(function () {
|
|
16
|
+
* // the response will give you user profile information.
|
|
17
|
+
* }).catch(function (ex) {
|
|
18
|
+
* // your failure code here
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
getUserProfile(options?: GetUserProfileRequest): Promise<any>;
|
|
23
|
+
/**
|
|
24
|
+
* To handle registration, first you need the registration fields. To get the registration fields, call **getRegistrationSetup()**. This will return the fields that has to be needed while registration.
|
|
25
|
+
* Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/4eae72956f65a-registration-field-setup for more details.
|
|
26
|
+
* @example
|
|
27
|
+
* ```js
|
|
28
|
+
* cidaasUserService.getRegistrationSetup({
|
|
29
|
+
* requestId: 'your requestId',
|
|
30
|
+
* acceptlanguage: 'your locale' // optional example: de-de, en-US
|
|
31
|
+
* }).then(function (resp) {
|
|
32
|
+
* // the response will give you fields that are required.
|
|
33
|
+
* }).catch(function(ex) {
|
|
34
|
+
* // your failure code here
|
|
35
|
+
* });
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
getRegistrationSetup(options: GetRegistrationSetupRequest): Promise<any>;
|
|
39
|
+
/**
|
|
40
|
+
* To register user, call **register()**. This method will create a new user.
|
|
41
|
+
* Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/427632e587203-register-a-new-user for more details.
|
|
42
|
+
* Note: Only requestId in the headers is required.
|
|
43
|
+
* @example
|
|
44
|
+
* ```js
|
|
45
|
+
* const headers = {
|
|
46
|
+
* requestId: 'your_received_requestId',
|
|
47
|
+
* captcha: 'captcha',
|
|
48
|
+
* acceptlanguage: 'acceptlanguage',
|
|
49
|
+
* bot_captcha_response: 'bot_captcha_response'
|
|
50
|
+
* };
|
|
51
|
+
*
|
|
52
|
+
* cidaasUserService.register({
|
|
53
|
+
* email: 'xxx123@xxx.com',
|
|
54
|
+
* given_name: 'xxxxx',
|
|
55
|
+
* family_name: 'yyyyy',
|
|
56
|
+
* password: '123456',
|
|
57
|
+
* password_echo: '123456',
|
|
58
|
+
* provider: 'your provider', // FACEBOOK, GOOGLE, SELF
|
|
59
|
+
* acceptlanguage: 'your locale' // optional example: de-de, en-US
|
|
60
|
+
* }, headers).then(function (response) {
|
|
61
|
+
* // the response will give you client registration details.
|
|
62
|
+
* }).catch(function(ex) {
|
|
63
|
+
* // your failure code here
|
|
64
|
+
* });
|
|
65
|
+
*```
|
|
66
|
+
*/
|
|
67
|
+
register(options: RegisterRequest, headers: HTTPRequestHeader): Promise<any>;
|
|
68
|
+
/**
|
|
69
|
+
* to get information about invitation details, call **getInviteUserDetails()**. This API allows to retrieve invitation details and prefill the registration form.
|
|
70
|
+
* Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/0b5efa5a2db5d-prefill-the-user-invitation for more details.
|
|
71
|
+
* Minimum cidaas version to use latest api is v3.100
|
|
72
|
+
* @example
|
|
73
|
+
* ```js
|
|
74
|
+
* const options = {
|
|
75
|
+
* invite_id: 'id of user invitation'
|
|
76
|
+
* callLatestAPI: 'true' // call latest api if parameter is given. By default, the older api will be called
|
|
77
|
+
* }
|
|
78
|
+
* cidaasUserService.getInviteUserDetails(options)
|
|
79
|
+
* .then(function () {
|
|
80
|
+
* // the response will give you information about the invitation.
|
|
81
|
+
* }).catch(function (ex) {
|
|
82
|
+
* // your failure code here
|
|
83
|
+
* });
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
getInviteUserDetails(options: GetInviteUserDetailsRequest, headers?: HTTPRequestHeader): Promise<any>;
|
|
87
|
+
/**
|
|
88
|
+
* Once registration successful, verify the account based on the flow. To get the details, call **getCommunicationStatus()**.
|
|
89
|
+
* @example
|
|
90
|
+
* ```js
|
|
91
|
+
* cidaasUserService.getCommunicationStatus({
|
|
92
|
+
* sub: 'your sub', // which you will get on the registration response
|
|
93
|
+
* }).then(function (response) {
|
|
94
|
+
* // the response will give you account details once its verified.
|
|
95
|
+
* }).catch(function(ex) {
|
|
96
|
+
* // your failure code here
|
|
97
|
+
* });
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
getCommunicationStatus(options: GetCommunicationStatusRequest, headers?: HTTPRequestHeader): Promise<any>;
|
|
101
|
+
/**
|
|
102
|
+
* To initiate the password resetting, call **initiateResetPassword()**. This will send verification code to your email or mobile based on the resetMedium you mentioned.
|
|
103
|
+
* Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/6b29bac6002f4-initiate-password-reset for more details.
|
|
104
|
+
* @example
|
|
105
|
+
* ```js
|
|
106
|
+
* cidaasUserService.initiateResetPassword({
|
|
107
|
+
* email: 'xxxxxx@xxx.com',
|
|
108
|
+
* processingType: ProcessingType.Code,
|
|
109
|
+
* requestId: 'your requestId',
|
|
110
|
+
* resetMedium: ResetMedium.Email
|
|
111
|
+
* }).then(function (response) {
|
|
112
|
+
* // the response will give you password reset details.
|
|
113
|
+
* }).catch(function(ex) {
|
|
114
|
+
* // your failure code here
|
|
115
|
+
* });
|
|
116
|
+
* ```
|
|
117
|
+
*/
|
|
118
|
+
initiateResetPassword(options: InitiateResetPasswordRequest, headers?: HTTPRequestHeader): Promise<any>;
|
|
119
|
+
/**
|
|
120
|
+
* To handle the reset password by entering the verification code you received, call **handleResetPassword()**. This will check if your verification code was valid or not, and allows you to proceed to the next step.
|
|
121
|
+
* Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/3t8ztokeb7cfz-handle-reset-password for more details.
|
|
122
|
+
* @example
|
|
123
|
+
* ```js
|
|
124
|
+
* const handleResponseAsJson = 'true if the response need to be handled the old way (as json). In the current handling, the response information will be given as query parameter in redirect url.';
|
|
125
|
+
* cidaasUserService.handleResetPassword({
|
|
126
|
+
* code: 'your code in email or sms or ivr',
|
|
127
|
+
* resetRequestId: 'your resetRequestId' // which you will get on initiate reset password response
|
|
128
|
+
* }, handleResponseAsJson).then(function (response) {
|
|
129
|
+
* // the response will give you valid verification code.
|
|
130
|
+
* }).catch(function(ex) {
|
|
131
|
+
* // your failure code here
|
|
132
|
+
* });
|
|
133
|
+
* ```
|
|
134
|
+
*/
|
|
135
|
+
handleResetPassword(options: HandleResetPasswordRequest, handleResponseAsJson?: boolean, headers?: HTTPRequestHeader): Promise<any>;
|
|
136
|
+
/**
|
|
137
|
+
* To finish reseting the password, call **resetPassword()**. This will allow you to change your password.
|
|
138
|
+
* Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/qa9ny0gkzlf6y-accept-reset-password for more details.
|
|
139
|
+
* @example
|
|
140
|
+
* ```js
|
|
141
|
+
* const handleResponseAsJson = 'true if the response need to be handled the old way (as json). In the current handling, user will be redirected to success page after successful reset password.';
|
|
142
|
+
* cidaasUserService.resetPassword({
|
|
143
|
+
* password: '123456',
|
|
144
|
+
* confirmPassword: '123456',
|
|
145
|
+
* exchangeId: 'your exchangeId', // which you will get on handle reset password response
|
|
146
|
+
* resetRequestId: 'your resetRequestId' // which you will get on handle reset password response
|
|
147
|
+
* }).then(function (response) {
|
|
148
|
+
* // the response will give you reset password details.
|
|
149
|
+
* }).catch(function(ex) {
|
|
150
|
+
* // your failure code here
|
|
151
|
+
* });
|
|
152
|
+
* ```
|
|
153
|
+
*/
|
|
154
|
+
resetPassword(options: ResetPasswordRequest, handleResponseAsJson?: boolean, headers?: HTTPRequestHeader): Promise<any>;
|
|
155
|
+
/**
|
|
156
|
+
* To get the list of existing users in deduplication, call **getDeduplicationDetails()**.
|
|
157
|
+
* @example
|
|
158
|
+
* ```js
|
|
159
|
+
* cidaasUserService.getDeduplicationDetails({
|
|
160
|
+
* track_id: 'your track id'
|
|
161
|
+
* }).then((response) => {
|
|
162
|
+
* // the response will give you deduplication details of users.
|
|
163
|
+
* }).catch((err) => {
|
|
164
|
+
* // your failure code here
|
|
165
|
+
* });
|
|
166
|
+
* ```
|
|
167
|
+
*/
|
|
168
|
+
getDeduplicationDetails(options: GetDeduplicationDetailsRequest, headers?: HTTPRequestHeader): Promise<any>;
|
|
169
|
+
/**
|
|
170
|
+
* To use the existing users in deduplication, you need to call **deduplicationLogin()**.
|
|
171
|
+
* @example
|
|
172
|
+
* ```js
|
|
173
|
+
* cidaasUserService.deduplicationLogin({
|
|
174
|
+
* sub: 'your sub',
|
|
175
|
+
* requestId: 'request id from deduplication initialisation after register',
|
|
176
|
+
* trackId: 'track id from deduplication initialisation after register'
|
|
177
|
+
* })
|
|
178
|
+
* ```
|
|
179
|
+
*/
|
|
180
|
+
deduplicationLogin(options: DeduplicationLoginRequest): void;
|
|
181
|
+
/**
|
|
182
|
+
* To register new user in deduplication, call **registerDeduplication()**.
|
|
183
|
+
* @example
|
|
184
|
+
* ```js
|
|
185
|
+
* cidaasUserService.registerDeduplication({
|
|
186
|
+
* track_id: 'track id from deduplication initialisation after register',
|
|
187
|
+
* }).then((response) => {
|
|
188
|
+
* // the response will give you new registered deduplication user.
|
|
189
|
+
* }).catch((err) => {
|
|
190
|
+
* // your failure code here
|
|
191
|
+
* });
|
|
192
|
+
* ```
|
|
193
|
+
*/
|
|
194
|
+
registerDeduplication(options: RegisterDeduplicationRequest, headers?: HTTPRequestHeader): Promise<any>;
|
|
195
|
+
/**
|
|
196
|
+
* To change the password, call **changePassword()**. This will allow you to change your password.
|
|
197
|
+
* Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/8221883241464-change-password for more details.
|
|
198
|
+
* @example
|
|
199
|
+
* ```js
|
|
200
|
+
* cidaasUserService.changePassword({
|
|
201
|
+
* old_password: 'your old password',
|
|
202
|
+
* new_password: 'your new password',
|
|
203
|
+
* confirm_password: 'your new password',
|
|
204
|
+
* sub: 'your sub',
|
|
205
|
+
* })
|
|
206
|
+
* .then(function () {
|
|
207
|
+
* // your success code
|
|
208
|
+
* }).catch(function (ex) {
|
|
209
|
+
* // your failure code
|
|
210
|
+
* });
|
|
211
|
+
* ```
|
|
212
|
+
*/
|
|
213
|
+
changePassword(options: ChangePasswordRequest, access_token?: string): Promise<any>;
|
|
214
|
+
/**
|
|
215
|
+
* To update the user profile information, call **updateProfile()**.
|
|
216
|
+
* After updating the user profile, the information in user storage won't be automatically updated.
|
|
217
|
+
* To get the latest user profile information, you will need to call **getUserProfile()**.
|
|
218
|
+
* To update the user storage, you will need to call **renewToken()** to generate latest tokens (access token, id token, refresh token) & user informations.
|
|
219
|
+
* Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/i3uqnxcpxr19r-update-user-profile for more details.
|
|
220
|
+
* @example
|
|
221
|
+
* ```js
|
|
222
|
+
* cidaasUserService.updateProfile({
|
|
223
|
+
* family_name: 'Doe',
|
|
224
|
+
* given_name: 'John',
|
|
225
|
+
* provider: 'self',
|
|
226
|
+
* acceptlanguage: 'your locale' // optional example: de-de, en-US
|
|
227
|
+
* }, 'your sub' ).then(function () {
|
|
228
|
+
* // the response will give you updated user profile info.
|
|
229
|
+
* }).catch(function (ex) {
|
|
230
|
+
* // your failure code here
|
|
231
|
+
* });
|
|
232
|
+
* ```
|
|
233
|
+
*/
|
|
234
|
+
updateProfile(options: CidaasUser, sub: string, access_token?: string): Promise<any>;
|
|
235
|
+
/**
|
|
236
|
+
* To initiate account linking, call **initiateLinkAccount()**.
|
|
237
|
+
* @example
|
|
238
|
+
* ```js
|
|
239
|
+
* const options = {
|
|
240
|
+
* master_sub: 'sub of the user who initiates the user link',
|
|
241
|
+
* user_name_to_link: 'username of the user which should get linked',
|
|
242
|
+
* user_name_type: 'type of user name to link. E.g. email'
|
|
243
|
+
* }
|
|
244
|
+
* cidaasUserService.initiateLinkAccount(options).then((response) => {
|
|
245
|
+
* // your success code
|
|
246
|
+
* }).catch((err) => {
|
|
247
|
+
* // your failure code here
|
|
248
|
+
* });
|
|
249
|
+
* ```
|
|
250
|
+
*/
|
|
251
|
+
initiateLinkAccount(options: InitiateLinkAccountRequest, access_token?: string): Promise<any>;
|
|
252
|
+
/**
|
|
253
|
+
* To complete account linking, call **completeLinkAccount()**.
|
|
254
|
+
* @example
|
|
255
|
+
* ```js
|
|
256
|
+
* const options = {
|
|
257
|
+
* code: 'code which is sent to account to be linked',
|
|
258
|
+
* link_request_id: 'comes from initiateLinkAccount'
|
|
259
|
+
* }
|
|
260
|
+
* cidaasUserService.completeLinkAccount(options).then((response) => {
|
|
261
|
+
* // your success code
|
|
262
|
+
* }).catch((err) => {
|
|
263
|
+
* // your failure code here
|
|
264
|
+
* });
|
|
265
|
+
* ```
|
|
266
|
+
*/
|
|
267
|
+
completeLinkAccount(options: CompleteLinkAccountRequest, access_token?: string): Promise<any>;
|
|
268
|
+
/**
|
|
269
|
+
* To get all the linked accounts, call **getLinkedUsers()**.
|
|
270
|
+
* @example
|
|
271
|
+
* ```js
|
|
272
|
+
* const sub = 'your sub';
|
|
273
|
+
*
|
|
274
|
+
* cidaasUserService.getLinkedUsers(sub)
|
|
275
|
+
* .then(function (response) {
|
|
276
|
+
* // type your code here
|
|
277
|
+
* })
|
|
278
|
+
* .catch(function (ex) {
|
|
279
|
+
* // your failure code here
|
|
280
|
+
* });
|
|
281
|
+
* ```
|
|
282
|
+
*/
|
|
283
|
+
getLinkedUsers(sub: string, access_token?: string): Promise<any>;
|
|
284
|
+
/**
|
|
285
|
+
* To unlink an account for a user, call **unlinkAccount()**.
|
|
286
|
+
* @example
|
|
287
|
+
* ```js
|
|
288
|
+
* const identityId = "comes from getLinkedUsers";
|
|
289
|
+
*
|
|
290
|
+
* cidaasUserService.unlinkAccount(undefined, identityId)
|
|
291
|
+
* .then(function (response) {
|
|
292
|
+
* // type your code here
|
|
293
|
+
* })
|
|
294
|
+
* .catch(function (ex) {
|
|
295
|
+
* // your failure code here
|
|
296
|
+
* });
|
|
297
|
+
* ```
|
|
298
|
+
*/
|
|
299
|
+
unlinkAccount(access_token: string | undefined, identityId: string): Promise<any>;
|
|
300
|
+
/**
|
|
301
|
+
* To delete the user account directly in the application, call **deleteUserAccount()**.
|
|
302
|
+
* Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/x133xdifl1sx9-schedule-user-deletion for more details.
|
|
303
|
+
* @example
|
|
304
|
+
* ```js
|
|
305
|
+
* options = {
|
|
306
|
+
* sub: "your sub"
|
|
307
|
+
* }
|
|
308
|
+
*
|
|
309
|
+
* cidaasUserService.deleteUserAccount(options).then(function (response) {
|
|
310
|
+
* // your success code
|
|
311
|
+
* }).catch(function(ex) {
|
|
312
|
+
* // your failure code here
|
|
313
|
+
* });
|
|
314
|
+
* ```
|
|
315
|
+
*/
|
|
316
|
+
deleteUserAccount(options: DeleteUserAccountRequest): Promise<any>;
|
|
317
|
+
/**
|
|
318
|
+
* To check if user exists, call **userCheckExists()**.
|
|
319
|
+
* Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/4yh82qism78xf-find-user-by-identifier for more details.
|
|
320
|
+
* @example
|
|
321
|
+
* options = {
|
|
322
|
+
* requestId: "your request id",
|
|
323
|
+
* email: "your email"
|
|
324
|
+
* }
|
|
325
|
+
*
|
|
326
|
+
* cidaasUserService.userCheckExists(options).then(function (response) {
|
|
327
|
+
* // your success code
|
|
328
|
+
* }).catch(function(ex) {
|
|
329
|
+
* // your failure code here
|
|
330
|
+
* });
|
|
331
|
+
* ```
|
|
332
|
+
*/
|
|
333
|
+
userCheckExists(options: UserCheckExistsRequest, headers?: HTTPRequestHeader): Promise<any>;
|
|
334
|
+
/**
|
|
335
|
+
* To get user activities, call **getUserActivities()**.
|
|
336
|
+
* Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/346141453781e-get-user-activities for more details.
|
|
337
|
+
* @example
|
|
338
|
+
* ```js
|
|
339
|
+
* const options = {
|
|
340
|
+
* sub: 'your sub',
|
|
341
|
+
* dateFilter: {
|
|
342
|
+
* from_date: 'date in UTC format',
|
|
343
|
+
* to:date: 'date in UTC format'
|
|
344
|
+
* }
|
|
345
|
+
* };
|
|
346
|
+
* cidaasUserService.getUserActivities(options).then(function (resp) {
|
|
347
|
+
* // your success code
|
|
348
|
+
* }).catch(function(ex) {
|
|
349
|
+
* // your failure code
|
|
350
|
+
* });
|
|
351
|
+
* ```
|
|
352
|
+
*/
|
|
353
|
+
getUserActivities(options: GetUserActivitiesRequest, access_token?: string): Promise<any>;
|
|
354
|
+
/**
|
|
355
|
+
* To change profile image, call **updateProfileImage()**.
|
|
356
|
+
* @example
|
|
357
|
+
* ```js
|
|
358
|
+
* const options = {
|
|
359
|
+
* image_key: 'id for your image e.g. user sub',
|
|
360
|
+
* photo: yourImageFile,
|
|
361
|
+
* filename: 'name of your image file'
|
|
362
|
+
* };
|
|
363
|
+
* cidaasUserService.updateProfileImage(options).then(function (resp) {
|
|
364
|
+
* // your success code
|
|
365
|
+
* }).catch(function(ex) {
|
|
366
|
+
* // your failure code
|
|
367
|
+
* });
|
|
368
|
+
* ```
|
|
369
|
+
*/
|
|
370
|
+
updateProfileImage(options: UpdateProfileImageRequest, access_token?: string): Promise<any>;
|
|
371
|
+
/**
|
|
372
|
+
* To run predefined action after enrollment, call userActionOnEnrollment()
|
|
373
|
+
* @param options
|
|
374
|
+
* @param trackId
|
|
375
|
+
* @example
|
|
376
|
+
* ```js
|
|
377
|
+
* const options = {
|
|
378
|
+
* action: 'predefined action'
|
|
379
|
+
* };
|
|
380
|
+
* cidaasUserService.userActionOnEnrollment(options, 'trackId');
|
|
381
|
+
*/
|
|
382
|
+
userActionOnEnrollment(options: UserActionOnEnrollmentRequest, trackId: string): Promise<any>;
|
|
383
|
+
}
|