cidaas-javascript-sdk 4.2.4 → 4.3.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 (54) hide show
  1. package/CHANGELOG.md +18 -3
  2. package/README.md +3 -0
  3. package/dist/authentication/{index.d.ts → Authentication.d.ts} +2 -2
  4. package/dist/authentication/{index.js → Authentication.js} +2 -9
  5. package/dist/common/Common.model.d.ts +37 -0
  6. package/dist/common/Common.model.js +26 -0
  7. package/dist/{web-auth → common}/Helper.d.ts +6 -6
  8. package/dist/{web-auth → common}/Helper.js +10 -10
  9. package/dist/common/JwtHelper.d.ts +8 -0
  10. package/dist/{web-auth → common}/JwtHelper.js +8 -8
  11. package/dist/common/User.model.d.ts +134 -0
  12. package/dist/common/User.model.js +2 -0
  13. package/dist/consent-service/ConsentService.d.ts +96 -0
  14. package/dist/consent-service/ConsentService.js +127 -0
  15. package/dist/consent-service/ConsentService.model.d.ts +102 -0
  16. package/dist/consent-service/ConsentService.model.js +2 -0
  17. package/dist/index.d.ts +1 -1
  18. package/dist/index.js +1 -1
  19. package/dist/login-service/LoginService.d.ts +143 -0
  20. package/dist/login-service/LoginService.js +247 -0
  21. package/dist/login-service/LoginService.model.d.ts +138 -0
  22. package/dist/login-service/LoginService.model.js +13 -0
  23. package/dist/token-service/TokenService.d.ts +139 -0
  24. package/dist/token-service/TokenService.js +242 -0
  25. package/dist/token-service/TokenService.model.d.ts +149 -0
  26. package/dist/token-service/TokenService.model.js +43 -0
  27. package/dist/user-service/UserService.d.ts +317 -0
  28. package/dist/user-service/UserService.js +451 -0
  29. package/dist/user-service/UserService.model.d.ts +142 -0
  30. package/dist/user-service/UserService.model.js +10 -0
  31. package/dist/verification-service/VerificationService.d.ts +218 -0
  32. package/dist/verification-service/VerificationService.js +288 -0
  33. package/dist/verification-service/VerificationService.model.d.ts +158 -0
  34. package/dist/verification-service/VerificationService.model.js +2 -0
  35. package/dist/web-auth/WebAuth.d.ts +110 -177
  36. package/dist/web-auth/WebAuth.js +120 -150
  37. package/dist/web-auth/webauth.model.d.ts +50 -0
  38. package/dist/web-auth/webauth.model.js +2 -0
  39. package/package.json +1 -1
  40. package/dist/web-auth/ConsentService.d.ts +0 -123
  41. package/dist/web-auth/ConsentService.js +0 -136
  42. package/dist/web-auth/Entities.d.ts +0 -516
  43. package/dist/web-auth/Entities.js +0 -69
  44. package/dist/web-auth/JwtHelper.d.ts +0 -7
  45. package/dist/web-auth/LoginService.d.ts +0 -165
  46. package/dist/web-auth/LoginService.js +0 -246
  47. package/dist/web-auth/TokenService.d.ts +0 -143
  48. package/dist/web-auth/TokenService.js +0 -249
  49. package/dist/web-auth/UserService.d.ts +0 -345
  50. package/dist/web-auth/UserService.js +0 -471
  51. package/dist/web-auth/VerificationService.d.ts +0 -224
  52. package/dist/web-auth/VerificationService.js +0 -278
  53. /package/dist/authentication/{authentication.model.d.ts → Authentication.model.d.ts} +0 -0
  54. /package/dist/authentication/{authentication.model.js → Authentication.model.js} +0 -0
@@ -1,471 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UserService = void 0;
4
- const Helper_1 = require("./Helper");
5
- var UserService;
6
- (function (UserService) {
7
- /**
8
- * To get the user profile information by using cidaas internal api, call **getUserProfile()**.
9
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/2zfvjx3vtq6g6-get-user-info for more details.
10
- * @example
11
- * ```js
12
- * const options = {
13
- * access_token: 'your access token'
14
- * }
15
- * cidaas.getUserProfile(options)
16
- * .then(function () {
17
- * // the response will give you user profile information.
18
- * }).catch(function (ex) {
19
- * // your failure code here
20
- * });
21
- * ```
22
- */
23
- function getUserProfile(options) {
24
- if (!options.access_token) {
25
- throw new Helper_1.CustomException("access_token cannot be empty", 417);
26
- }
27
- const _serviceURL = window.webAuthSettings.authority + "/users-srv/userinfo";
28
- return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, undefined, "GET", options.access_token);
29
- }
30
- UserService.getUserProfile = getUserProfile;
31
- ;
32
- /**
33
- * To register user, call **register()**. This method will create a new user.
34
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/427632e587203-register-a-new-user for more details.
35
- * Note: Only requestId in the headers is required.
36
- * @example
37
- * ```js
38
- * const headers = {
39
- * requestId: 'your_received_requestId',
40
- * captcha: 'captcha',
41
- * acceptlanguage: 'acceptlanguage',
42
- * bot_captcha_response: 'bot_captcha_response'
43
- * };
44
- *
45
- * cidaas.register({
46
- * email: 'xxx123@xxx.com',
47
- * given_name: 'xxxxx',
48
- * family_name: 'yyyyy',
49
- * password: '123456',
50
- * password_echo: '123456',
51
- * provider: 'your provider', // FACEBOOK, GOOGLE, SELF
52
- * acceptlanguage: 'your locale' // optional example: de-de, en-US
53
- * }, headers).then(function (response) {
54
- * // the response will give you client registration details.
55
- * }).catch(function(ex) {
56
- * // your failure code here
57
- * });
58
- *```
59
- */
60
- function register(options, headers) {
61
- let _serviceURL = window.webAuthSettings.authority + "/users-srv/register";
62
- if (options.invite_id) {
63
- _serviceURL = _serviceURL + "?invite_id=" + options.invite_id;
64
- }
65
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST", undefined, headers);
66
- }
67
- UserService.register = register;
68
- ;
69
- /**
70
- * to get information about invitation details, call **getInviteUserDetails()**. This API allows to retrieve invitation details and prefill the registration form.
71
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/0b5efa5a2db5d-prefill-the-user-invitation for more details.
72
- * Minimum cidaas version to use latest api is v3.100
73
- * @example
74
- * ```js
75
- * const options = {
76
- * invite_id: 'id of user invitation'
77
- * callLatestAPI: 'true' // call latest api if parameter is given. By default, the older api will be called
78
- * }
79
- * cidaas.getInviteUserDetails(options)
80
- * .then(function () {
81
- * // the response will give you information about the invitation.
82
- * }).catch(function (ex) {
83
- * // your failure code here
84
- * });
85
- * ```
86
- */
87
- function getInviteUserDetails(options) {
88
- let _serviceURL = "";
89
- if (options.callLatestAPI) {
90
- _serviceURL = window.webAuthSettings.authority + "/useractions-srv/invitations/" + options.invite_id;
91
- }
92
- else {
93
- _serviceURL = window.webAuthSettings.authority + "/users-srv/invite/info/" + options.invite_id;
94
- }
95
- return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, false, "GET");
96
- }
97
- UserService.getInviteUserDetails = getInviteUserDetails;
98
- ;
99
- /**
100
- * Once registration successful, verify the account based on the flow. To get the details, call **getCommunicationStatus()**.
101
- * @example
102
- * ```js
103
- * cidaas.getCommunicationStatus({
104
- * sub: 'your sub', // which you will get on the registration response
105
- * }).then(function (response) {
106
- * // the response will give you account details once its verified.
107
- * }).catch(function(ex) {
108
- * // your failure code here
109
- * });
110
- * ```
111
- */
112
- function getCommunicationStatus(options, headers) {
113
- let _serviceURL = window.webAuthSettings.authority + "/users-srv/user/communication/status/" + options.sub;
114
- return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, false, "GET", undefined, headers);
115
- }
116
- UserService.getCommunicationStatus = getCommunicationStatus;
117
- ;
118
- /**
119
- * To initiate the password resetting, call **initiateResetPassword()**. This will send verification code to your email or mobile based on the resetMedium you mentioned.
120
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/6b29bac6002f4-initiate-password-reset for more details.
121
- * @example
122
- * ```js
123
- * cidaas.initiateResetPassword({
124
- * email: 'xxxxxx@xxx.com',
125
- * processingType: 'CODE',
126
- * requestId: 'your requestId',
127
- * resetMedium: 'email'
128
- * }).then(function (response) {
129
- * // the response will give you password reset details.
130
- * }).catch(function(ex) {
131
- * // your failure code here
132
- * });
133
- * ```
134
- */
135
- function initiateResetPassword(options) {
136
- var _serviceURL = window.webAuthSettings.authority + "/users-srv/resetpassword/initiate";
137
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST");
138
- }
139
- UserService.initiateResetPassword = initiateResetPassword;
140
- ;
141
- /**
142
- * 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.
143
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/3t8ztokeb7cfz-handle-reset-password for more details.
144
- * @example
145
- * ```js
146
- * 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.';
147
- * cidaas.handleResetPassword({
148
- * code: 'your code in email or sms or ivr',
149
- * resetRequestId: 'your resetRequestId' // which you will get on initiate reset password response
150
- * }, handleResponseAsJson).then(function (response) {
151
- * // the response will give you valid verification code.
152
- * }).catch(function(ex) {
153
- * // your failure code here
154
- * });
155
- * ```
156
- */
157
- function handleResetPassword(options, handleResponseAsJson) {
158
- try {
159
- const url = window.webAuthSettings.authority + "/users-srv/resetpassword/validatecode";
160
- if (!handleResponseAsJson) {
161
- // current handling will redirect and give query parameters
162
- let form = Helper_1.Helper.createForm(url, options);
163
- document.body.appendChild(form);
164
- form.submit();
165
- }
166
- else {
167
- // older cidaas service handling return json object
168
- return Helper_1.Helper.createHttpPromise(options, url, false, "POST");
169
- }
170
- }
171
- catch (ex) {
172
- throw new Helper_1.CustomException(ex, 417);
173
- }
174
- }
175
- UserService.handleResetPassword = handleResetPassword;
176
- ;
177
- /**
178
- * To finish reseting the password, call **resetPassword()**. This will allow you to change your password.
179
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/qa9ny0gkzlf6y-accept-reset-password for more details.
180
- * @example
181
- * ```js
182
- * 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.';
183
- * cidaas.resetPassword({
184
- * password: '123456',
185
- * confirmPassword: '123456',
186
- * exchangeId: 'your exchangeId', // which you will get on handle reset password response
187
- * resetRequestId: 'your resetRequestId' // which you will get on handle reset password response
188
- * }).then(function (response) {
189
- * // the response will give you reset password details.
190
- * }).catch(function(ex) {
191
- * // your failure code here
192
- * });
193
- * ```
194
- */
195
- function resetPassword(options, handleResponseAsJson) {
196
- const url = window.webAuthSettings.authority + "/users-srv/resetpassword/accept";
197
- try {
198
- if (!handleResponseAsJson) {
199
- // current handling will redirect and give query parameters
200
- let form = Helper_1.Helper.createForm(url, options);
201
- document.body.appendChild(form);
202
- form.submit();
203
- }
204
- else {
205
- // older cidaas service handling return json object
206
- return Helper_1.Helper.createHttpPromise(options, url, false, "POST");
207
- }
208
- }
209
- catch (ex) {
210
- throw new Helper_1.CustomException(ex, 417);
211
- }
212
- }
213
- UserService.resetPassword = resetPassword;
214
- ;
215
- /**
216
- * To get the list of existing users in deduplication, call **getDeduplicationDetails()**.
217
- * @example
218
- * ```js
219
- * this.cidaas.getDeduplicationDetails({
220
- * track_id: 'your track id'
221
- * }).then((response) => {
222
- * // the response will give you deduplication details of users.
223
- * }).catch((err) => {
224
- * // your failure code here
225
- * });
226
- * ```
227
- */
228
- function getDeduplicationDetails(options) {
229
- const _serviceURL = window.webAuthSettings.authority + "/users-srv/deduplication/info/" + options.trackId;
230
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "GET");
231
- }
232
- UserService.getDeduplicationDetails = getDeduplicationDetails;
233
- ;
234
- /**
235
- * To use the existing users in deduplication, you need to call **deduplicationLogin()**.
236
- * @example
237
- * ```js
238
- * this.cidaas.deduplicationLogin({
239
- * sub: 'your sub',
240
- * requestId: 'request id from deduplication initialisation after register',
241
- * trackId: 'track id from deduplication initialisation after register'
242
- * })
243
- * ```
244
- */
245
- function deduplicationLogin(options) {
246
- try {
247
- const url = window.webAuthSettings.authority + "/users-srv/deduplication/login/redirection?trackId=" + options.trackId + "&requestId=" + options.requestId + "&sub=" + options.sub;
248
- const form = Helper_1.Helper.createForm(url, {});
249
- document.body.appendChild(form);
250
- form.submit();
251
- }
252
- catch (ex) {
253
- throw new Helper_1.CustomException(ex, 417);
254
- }
255
- }
256
- UserService.deduplicationLogin = deduplicationLogin;
257
- ;
258
- /**
259
- * To register new user in deduplication, call **registerDeduplication()**.
260
- * @example
261
- * ```js
262
- * this.cidaas.registerDeduplication({
263
- * track_id: 'track id from deduplication initialisation after register',
264
- * }).then((response) => {
265
- * // the response will give you new registered deduplication user.
266
- * }).catch((err) => {
267
- * // your failure code here
268
- * });
269
- * ```
270
- */
271
- function registerDeduplication(options) {
272
- const _serviceURL = window.webAuthSettings.authority + "/users-srv/deduplication/register/" + options.trackId;
273
- return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, undefined, "POST");
274
- }
275
- UserService.registerDeduplication = registerDeduplication;
276
- ;
277
- /**
278
- * To change the password, call **changePassword()**. This will allow you to change your password.
279
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/8221883241464-change-password for more details.
280
- * @example
281
- * ```js
282
- * cidaas.changePassword({
283
- * old_password: 'your old password',
284
- * new_password: 'your new password',
285
- * confirm_password: 'your new password',
286
- * sub: 'your sub',
287
- * }, 'your access token')
288
- * .then(function () {
289
- * // your success code
290
- * }).catch(function (ex) {
291
- * // your failure code
292
- * });
293
- * ```
294
- */
295
- function changePassword(options, access_token) {
296
- var _serviceURL = window.webAuthSettings.authority + "/users-srv/changepassword";
297
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST", access_token);
298
- }
299
- UserService.changePassword = changePassword;
300
- ;
301
- /**
302
- * To update the user profile information, call **updateProfile()**.
303
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/i3uqnxcpxr19r-update-user-profile for more details.
304
- * @example
305
- * ```js
306
- * cidaas.updateProfile({
307
- * family_name: 'Doe',
308
- * given_name: 'John',
309
- * provider: 'self',
310
- * acceptlanguage: 'your locale' // optional example: de-de, en-US
311
- * }, 'your access token', 'your sub').then(function () {
312
- * // the response will give you updated user profile info.
313
- * }).catch(function (ex) {
314
- * // your failure code here
315
- * });
316
- * ```
317
- */
318
- function updateProfile(options, access_token, sub) {
319
- const _serviceURL = window.webAuthSettings.authority + "/users-srv/user/profile/" + sub;
320
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "PUT", access_token);
321
- }
322
- UserService.updateProfile = updateProfile;
323
- ;
324
- /**
325
- * To initiate account linking, call **initiateLinkAccount()**.
326
- * @example
327
- * ```js
328
- * const options = {
329
- * master_sub: 'sub of the user who initiates the user link',
330
- * user_name_to_link: 'username of the user which should get linked',
331
- * user_name_type: 'type of user name to link. E.g. email'
332
- * }
333
- * const access_token = 'your access token'
334
- * this.cidaas.initiateLinkAccount(options, access_token).then((response) => {
335
- * // your success code
336
- * }).catch((err) => {
337
- * // your failure code here
338
- * });
339
- * ```
340
- */
341
- function initiateLinkAccount(options, access_token) {
342
- options.user_name_type = 'email';
343
- var _serviceURL = window.webAuthSettings.authority + "/users-srv/user/link/initiate";
344
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST", access_token);
345
- }
346
- UserService.initiateLinkAccount = initiateLinkAccount;
347
- ;
348
- /**
349
- * To complete account linking, call **completeLinkAccount()**.
350
- * @example
351
- * ```js
352
- * const options = {
353
- * code: 'code which is sent to account to be linked',
354
- * link_request_id: 'comes from initiateLinkAccount'
355
- * }
356
- * const access_token = 'your access token'
357
- * this.cidaas.completeLinkAccount(options, access_token).then((response) => {
358
- * // your success code
359
- * }).catch((err) => {
360
- * // your failure code here
361
- * });
362
- * ```
363
- */
364
- function completeLinkAccount(options, access_token) {
365
- var _serviceURL = window.webAuthSettings.authority + "/users-srv/user/link/complete";
366
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST", access_token);
367
- }
368
- UserService.completeLinkAccount = completeLinkAccount;
369
- ;
370
- /**
371
- * To get all the linked accounts, call **getLinkedUsers()**.
372
- * @example
373
- * ```js
374
- * const acccess_token= 'your access token';
375
- * const sub = 'your sub';
376
- *
377
- * cidaas.getLinkedUsers(access_token, sub)
378
- * .then(function (response) {
379
- * // type your code here
380
- * })
381
- * .catch(function (ex) {
382
- * // your failure code here
383
- * });
384
- * ```
385
- */
386
- function getLinkedUsers(access_token, sub) {
387
- var _serviceURL = window.webAuthSettings.authority + "/users-srv/userinfo/social/" + sub;
388
- return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, false, "GET", access_token);
389
- }
390
- UserService.getLinkedUsers = getLinkedUsers;
391
- ;
392
- /**
393
- * To unlink an account for a user, call **unlinkAccount()**.
394
- * @example
395
- * ```js
396
- * const acccess_token= "your access token";
397
- * const identityId = "comes from getLinkedUsers";
398
- *
399
- * cidaas.unlinkAccount(access_token, identityId)
400
- * .then(function (response) {
401
- * // type your code here
402
- * })
403
- * .catch(function (ex) {
404
- * // your failure code here
405
- * });
406
- * ```
407
- */
408
- function unlinkAccount(access_token, identityId) {
409
- var _serviceURL = window.webAuthSettings.authority + "/users-srv/user/unlink/" + identityId;
410
- return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, false, "POST", access_token);
411
- }
412
- UserService.unlinkAccount = unlinkAccount;
413
- ;
414
- /**
415
- * To delete the user account directly in the application, call **deleteUserAccount()**.
416
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/x133xdifl1sx9-schedule-user-deletion for more details.
417
- * @example
418
- * ```js
419
- * options = {
420
- * access_token: "your access token",
421
- * sub: "your sub"
422
- * }
423
- *
424
- * cidaas.deleteUserAccount(options).then(function (response) {
425
- * // your success code
426
- * }).catch(function(ex) {
427
- * // your failure code here
428
- * });
429
- * ```
430
- */
431
- function deleteUserAccount(options) {
432
- var _serviceURL = window.webAuthSettings.authority + "/users-srv/user/unregister/scheduler/schedule/" + options.sub;
433
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, undefined, "POST", options.access_token);
434
- }
435
- UserService.deleteUserAccount = deleteUserAccount;
436
- ;
437
- /**
438
- * To check if user exists, call **userCheckExists()**.
439
- * @example
440
- * options = {
441
- * requestId: "your request id",
442
- * email: "your email"
443
- * }
444
- *
445
- * cidaas.userCheckExists(options).then(function (response) {
446
- * // your success code
447
- * }).catch(function(ex) {
448
- * // your failure code here
449
- * });
450
- * ```
451
- */
452
- function userCheckExists(options) {
453
- let queryParameter = '';
454
- if (options.webfinger || options.rememberMe) {
455
- queryParameter += '?';
456
- if (options.webfinger) {
457
- queryParameter += 'webfinger=' + options.webfinger;
458
- if (options.rememberMe) {
459
- queryParameter += '&rememberMe=' + options.rememberMe;
460
- }
461
- }
462
- else if (options.rememberMe) {
463
- queryParameter += 'rememberMe=' + options.rememberMe;
464
- }
465
- }
466
- var _serviceURL = window.webAuthSettings.authority + "/useractions-srv/userexistence/" + options.requestId + queryParameter;
467
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, undefined, "POST");
468
- }
469
- UserService.userCheckExists = userCheckExists;
470
- ;
471
- })(UserService = exports.UserService || (exports.UserService = {}));
@@ -1,224 +0,0 @@
1
- import { IConfiguredListRequestEntity, IInitVerificationAuthenticationRequestEntity, IEnrollVerificationSetupRequestEntity, IAuthVerificationAuthenticationRequestEntity, AccountVerificationRequestEntity } from "./Entities";
2
- export declare namespace VerificationService {
3
- /**
4
- * To initiate the account verification, call **initiateAccountVerification()**. This will send verification code email or sms or ivr based on the verificationMedium you mentioned.
5
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/cgans5erj5alg-init-account-verification for more details.
6
- * @example
7
- * ```js
8
- * cidaas.initiateAccountVerification({
9
- * verificationMedium: 'email',
10
- * requestId: 'your requestId',
11
- * processingType: 'CODE',
12
- * email: 'your email'
13
- * }).then(function (response) {
14
- * // the response will give you account verification details.
15
- * }).catch(function(ex) {
16
- * // your failure code here
17
- * });
18
- * ```
19
- */
20
- function initiateAccountVerification(options: AccountVerificationRequestEntity): void;
21
- /**
22
- * To complete the verification, call **verifyAccount()**.
23
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/r8h9mvavvw2e6-verify-account for more details.
24
- * @example
25
- * ```js
26
- * cidaas.verifyAccount({
27
- * accvid: 'your accvid', // which you will get on initiate account verification response
28
- * code: 'your code in email or sms or ivr'
29
- * }).then(function (response) {
30
- * // the response will give you account verification ID and unique code.
31
- * }).catch(function(ex) {
32
- * // your failure code here
33
- * });
34
- * ```
35
- */
36
- function verifyAccount(options: {
37
- accvid: string;
38
- code: string;
39
- }): Promise<unknown>;
40
- /**
41
- * To get all configured multi factor authentication, call **getMFAList()**.
42
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/ee688a9c52b63-list-of-configured-verification-methods for more details.
43
- * @example
44
- * ```js
45
- * cidaas.getMFAList({
46
- * request_id: 'your request id',
47
- * email: 'your email'
48
- * }).then(function (response) {
49
- * // the response will give you list of configured multi factor authentication
50
- * }).catch(function(ex) {
51
- * // your failure code here
52
- * });
53
- * ```
54
- */
55
- function getMFAList(options: IConfiguredListRequestEntity): Promise<unknown>;
56
- /**
57
- * to cancel mfa process, call **cancelMFA()**.
58
- * @example
59
- * ```js
60
- * cidaas.cancelMFA({
61
- * exchange_id: 'exchange id from initiateMFA() response',
62
- * reason: 'reason of mfa cancelation',
63
- * type: 'authentication type e.g. email'
64
- * }).then(function (response) {
65
- * // your success code here
66
- * }).catch(function(ex) {
67
- * // your failure code here
68
- * });
69
- * ```
70
- */
71
- function cancelMFA(options: {
72
- exchange_id: string;
73
- reason: string;
74
- type: string;
75
- }): Promise<unknown>;
76
- /**
77
- * To get list of all verification type configured, call **getAllVerificationList()**. access_token must be passed as function parameter.
78
- * @example
79
- * ```js
80
- * const access_token = "your access token";
81
- *
82
- * cidaas.getAllVerificationList(access_token)
83
- * .then(function (response) {
84
- * // type your code here
85
- * })
86
- * .catch(function (ex) {
87
- * // your failure code here
88
- * });
89
- * ```
90
- */
91
- function getAllVerificationList(access_token: string): Promise<unknown>;
92
- /**
93
- * To initiate enrollment of new multi factor authentication, call **initiateEnrollment()**.
94
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/branches/master/f85aef6754714-initiate-physical-verification-setup for more details.
95
- * @example
96
- * ```js
97
- * const access_token = "your access token";
98
- * const options = {
99
- * verification_type: 'one of verification_type such as fido2, face, ivr',
100
- * deviceInfo: {
101
- * deviceId: '',
102
- * location: {lat: '', lon: ''}
103
- * }
104
- * }
105
- *
106
- * cidaas.initiateEnrollment(options, access_token)
107
- * .then(function (response) {
108
- * // type your code here
109
- * })
110
- * .catch(function (ex) {
111
- * // your failure code here
112
- * });
113
- * ```
114
- */
115
- function initiateEnrollment(options: {
116
- verification_type: string;
117
- deviceInfo?: {
118
- deviceId: string;
119
- location: {
120
- lat: string;
121
- lon: string;
122
- };
123
- };
124
- }, accessToken: string): Promise<unknown>;
125
- /**
126
- * to get the status of MFA enrollment, call **getEnrollmentStatus()**.
127
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/branches/master/b06447d02d8e0-get-status-of-physical-verification-setup-configuration for more details.
128
- * @example
129
- * ```js
130
- * cidaas.getEnrollmentStatus('statusId from initiateEnrollment()', 'your access token')
131
- * .then(function (response) {
132
- * // type your code here
133
- * })
134
- * .catch(function (ex) {
135
- * // your failure code here
136
- * });
137
- * ```
138
- */
139
- function getEnrollmentStatus(status_id: string, accessToken: string): Promise<unknown>;
140
- /**
141
- * to finish enrollment process of new multi factor authentication, call **enrollVerification()**.
142
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/branches/master/20ec76e937b27-enroll-physical-verification-setup for more details.
143
- * @example
144
- * ```js
145
- * const fidoPayload = {
146
- * sub: 'your sub',
147
- * exchange_id: 'exchange_id from initiateEnrollment()',
148
- * verification_type: 'fido2',
149
- * fido2_client_response: {
150
- * client_response: 'client_response from doing fido process',
151
- * fidoRequestId: 'fidoRequestId from initiateEnrollment',
152
- * }
153
- * }
154
- * cidaas.enrollVerification(fidoPayload)
155
- * .then(function (response) {
156
- * // type your code here
157
- * })
158
- * .catch(function (ex) {
159
- * // your failure code here
160
- * });
161
- * ```
162
- */
163
- function enrollVerification(options: IEnrollVerificationSetupRequestEntity): Promise<unknown>;
164
- /**
165
- * to see details of configured verification type, call **checkVerificationTypeConfigured()**.
166
- * @example
167
- * ```js
168
- * cidaas.checkVerificationTypeConfigured({
169
- * request_id: 'your request id',
170
- * email: 'your email',
171
- * verification_type: 'email'
172
- * }).then(function (response) {
173
- * // type your code here
174
- * })
175
- * .catch(function (ex) {
176
- * // your failure code here
177
- * });
178
- * ```
179
- */
180
- function checkVerificationTypeConfigured(options: IConfiguredListRequestEntity): Promise<unknown>;
181
- /**
182
- * to initiate multi factor auhentication, call **initiateMFA()**.
183
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/2a3ea581bb249-initiate-verification for more details.
184
- * @example
185
- * ```js
186
- * const access_token = "your access token";
187
- * const options = {
188
- * request_id: 'your request id',
189
- * usage_type: 'PASSWORDLESS_AUTHENTICATION',
190
- * type: 'email'
191
- * email: 'your email'
192
- * }
193
- * }
194
- *
195
- * cidaas.initiateMFA(options, access_token)
196
- * .then(function (response) {
197
- * // type your code here
198
- * })
199
- * .catch(function (ex) {
200
- * // your failure code here
201
- * });
202
- * ```
203
- */
204
- function initiateMFA(options: IInitVerificationAuthenticationRequestEntity, accessToken?: string): Promise<unknown>;
205
- /**
206
- * to authenticate with multi factor auhentication, call **authenticateMFA()**.
207
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/1aa38936252d6-perform-the-authentication-method for more details.
208
- * @example
209
- * ```js
210
- * cidaas.authenticateMFA({
211
- * type: 'email',
212
- * client_id: 'your client id',
213
- * exchange_id: exchange id from initiateMFA(),
214
- * pass_code: 'code to authenticate'
215
- * }).then(function (response) {
216
- * // type your code here
217
- * })
218
- * .catch(function (ex) {
219
- * // your failure code here
220
- * });
221
- * ```
222
- */
223
- function authenticateMFA(options: IAuthVerificationAuthenticationRequestEntity): Promise<unknown>;
224
- }