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