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
@@ -10,13 +10,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.WebAuth = exports.createPreloginWebauth = void 0;
13
- const authentication_1 = require("../authentication");
14
- const Helper_1 = require("./Helper");
15
- const LoginService_1 = require("./LoginService");
16
- const UserService_1 = require("./UserService");
17
- const TokenService_1 = require("./TokenService");
18
- const VerificationService_1 = require("./VerificationService");
19
- const ConsentService_1 = require("./ConsentService");
13
+ const Helper_1 = require("../common/Helper");
14
+ const LoginService = require("../login-service/LoginService");
15
+ const UserService = require("../user-service/UserService");
16
+ const TokenService = require("../token-service/TokenService");
17
+ const VerificationService = require("../verification-service/VerificationService");
18
+ const ConsentService = require("../consent-service/ConsentService");
19
+ const Authentication_1 = require("../authentication/Authentication");
20
+ const Authentication_model_1 = require("../authentication/Authentication.model");
20
21
  const createPreloginWebauth = (authority) => {
21
22
  return new WebAuth({ 'authority': authority });
22
23
  };
@@ -33,11 +34,11 @@ class WebAuth {
33
34
  if (settings.authority && settings.authority.charAt(settings.authority.length - 1) === '/') {
34
35
  settings.authority = settings.authority.slice(0, settings.authority.length - 1);
35
36
  }
36
- var usermanager = new authentication_1.OidcManager(settings);
37
+ const usermanager = new Authentication_model_1.OidcManager(settings);
37
38
  window.webAuthSettings = settings;
38
39
  window.usermanager = usermanager;
39
40
  window.localeSettings = null;
40
- window.authentication = new authentication_1.Authentication(window.webAuthSettings, window.usermanager);
41
+ window.authentication = new Authentication_1.Authentication(window.webAuthSettings, window.usermanager);
41
42
  window.usermanager.events.addSilentRenewError(function () {
42
43
  throw new Helper_1.CustomException("Error while renewing silent login", 500);
43
44
  });
@@ -57,7 +58,6 @@ class WebAuth {
57
58
  }
58
59
  return window.authentication.loginOrRegisterWithBrowser('login', options);
59
60
  }
60
- ;
61
61
  /**
62
62
  * Generate and open authz url in a popup window.
63
63
  * On successful sign in, authenticated user is returned.
@@ -72,7 +72,6 @@ class WebAuth {
72
72
  }
73
73
  return window.authentication.popupSignIn(options);
74
74
  }
75
- ;
76
75
  /**
77
76
  * Generate and navigate to authz url in an iFrame.
78
77
  * On successful sign in, authenticated user is returned
@@ -87,7 +86,6 @@ class WebAuth {
87
86
  }
88
87
  return window.authentication.silentSignIn(options);
89
88
  }
90
- ;
91
89
  /**
92
90
  * Generate and redirect to authz url in same window for register view.
93
91
  * @param {LoginRedirectOptions} options options options to over-ride the client config for redirect login
@@ -98,7 +96,6 @@ class WebAuth {
98
96
  }
99
97
  return window.authentication.loginOrRegisterWithBrowser('register', options);
100
98
  }
101
- ;
102
99
  /**
103
100
  * Once login successful, it will automatically redirects you to the redirect url whatever you mentioned in the options.
104
101
  * To complete the login process, call **loginCallback()**. This will parses the access_token, id_token and whatever in hash in the redirect url.
@@ -113,7 +110,6 @@ class WebAuth {
113
110
  }
114
111
  return window.authentication.loginCallback(url);
115
112
  }
116
- ;
117
113
  /**
118
114
  * To complete the popup login process, call **popupSignInCallback()** from the popup login window.
119
115
  * Popup window will be closed after doing callback
@@ -127,7 +123,6 @@ class WebAuth {
127
123
  }
128
124
  return window.authentication.popupSignInCallback(url, keepOpen);
129
125
  }
130
- ;
131
126
  /**
132
127
  * Returns a promise to notify the parent window of response from authz service
133
128
  * @param {string} url optional url to check authz response, if none window.location is used
@@ -138,7 +133,6 @@ class WebAuth {
138
133
  }
139
134
  return window.authentication.silentSignInCallback(url);
140
135
  }
141
- ;
142
136
  /**
143
137
  * To get the user profile information by using oidc-client-ts library, call **getUserInfo()**. This will return the basic user profile details along with groups, roles and whatever scopes you mentioned in the options.
144
138
  * @example
@@ -159,7 +153,6 @@ class WebAuth {
159
153
  return yield window.usermanager.getUser();
160
154
  });
161
155
  }
162
- ;
163
156
  /**
164
157
  * logout by using oidc-client-ts library
165
158
  * @param {LogoutRedirectOptions} options optional options to over-ride logout options on redirect
@@ -170,7 +163,6 @@ class WebAuth {
170
163
  }
171
164
  return window.authentication.logout(options);
172
165
  }
173
- ;
174
166
  /**
175
167
  * logout by using oidc-client-ts library
176
168
  * @param {PopupSignOutOptions} options optional options to over-ride logout options using popup window
@@ -181,7 +173,6 @@ class WebAuth {
181
173
  }
182
174
  return window.authentication.popupSignOut(options);
183
175
  }
184
- ;
185
176
  /**
186
177
  * get the logout call state from the url provided, if none is provided current window url is used
187
178
  * @returns {Promise<LogoutResponse>} logout response from auth service
@@ -192,7 +183,6 @@ class WebAuth {
192
183
  }
193
184
  return window.authentication.logoutCallback(url);
194
185
  }
195
- ;
196
186
  /**
197
187
  * listen to popup sign out event
198
188
  * @param {string} url optional url to override to check for sign out state
@@ -205,7 +195,6 @@ class WebAuth {
205
195
  url = url || window.webAuthSettings.post_logout_redirect_uri;
206
196
  return window.authentication.popupSignOutCallback(url, keepOpen);
207
197
  }
208
- ;
209
198
  /**
210
199
  * To get the generated login url, call **getLoginURL()**. This will call authz service and generate login url to be used.
211
200
  * @example
@@ -224,17 +213,13 @@ class WebAuth {
224
213
  return Promise.reject(new Helper_1.CustomException("Settings or Authentication instance in OIDC cannot be empty", 417));
225
214
  }
226
215
  return new Promise((resolve, reject) => {
227
- try {
228
- window.usermanager.getClient().createSigninRequest(Object.assign(Object.assign({}, window.webAuthSettings), (options && { options } || {}))).then((signinRequest) => {
229
- resolve(signinRequest.url);
230
- });
231
- }
232
- catch (e) {
216
+ window.usermanager.getClient().createSigninRequest(Object.assign(Object.assign({}, window.webAuthSettings), (options && { options } || {}))).then((signinRequest) => {
217
+ resolve(signinRequest.url);
218
+ }).catch(e => {
233
219
  reject(e);
234
- }
220
+ });
235
221
  });
236
222
  }
237
- ;
238
223
  /**
239
224
  * Each and every proccesses starts with requestId, it is an entry point to login or register. For getting the requestId, call **getRequestId()**.
240
225
  * @example
@@ -253,7 +238,6 @@ class WebAuth {
253
238
  const serviceURL = window.webAuthSettings.authority + '/authz-srv/authrequest/authz/generate';
254
239
  return Helper_1.Helper.createHttpPromise(options, serviceURL, false, "POST");
255
240
  }
256
- ;
257
241
  /**
258
242
  * To get the tenant basic information, call **getTenantInfo()**. This will return the basic tenant details such as tenant name and allowed login with types (Email, Mobile, Username).
259
243
  * @example
@@ -269,7 +253,6 @@ class WebAuth {
269
253
  const _serviceURL = window.webAuthSettings.authority + "/public-srv/tenantinfo/basic";
270
254
  return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, false, "GET");
271
255
  }
272
- ;
273
256
  /**
274
257
  * To logout the user by using cidaas internal api, call **logoutUser()**.
275
258
  * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/3b5ce6a54bf29-logout for more details.
@@ -283,7 +266,6 @@ class WebAuth {
283
266
  logoutUser(options) {
284
267
  window.location.href = window.webAuthSettings.authority + "/session/end_session?access_token_hint=" + options.access_token + "&post_logout_redirect_uri=" + window.webAuthSettings.post_logout_redirect_uri;
285
268
  }
286
- ;
287
269
  /**
288
270
  * To get the client basic information, call **getClientInfo()**. This will return the basic client details such as client name and its details.
289
271
  * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/dc8a6cfb28abb-public-page-information for more details.
@@ -302,13 +284,12 @@ class WebAuth {
302
284
  const _serviceURL = window.webAuthSettings.authority + "/public-srv/public/" + options.requestId;
303
285
  return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, false, "GET");
304
286
  }
305
- ;
306
287
  /**
307
288
  * To get all devices information associated to the client, call **getDevicesInfo()**
308
289
  * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/2a2feed70303c-get-device-by-user for more details.
309
290
  * @example
310
291
  * ```js
311
- * const options = {};
292
+ * const options = null; // the payload is deprecated and will be removed in the next major release
312
293
  * const accessToken = 'your access token';
313
294
  * cidaas.getDevicesInfo(options, accessToken).then(function (resp) {
314
295
  * // the response will give you devices informations.
@@ -318,14 +299,10 @@ class WebAuth {
318
299
  * ```
319
300
  */
320
301
  getDevicesInfo(options, accessToken) {
321
- options.userAgent = window.navigator.userAgent;
302
+ options = undefined;
322
303
  const _serviceURL = window.webAuthSettings.authority + "/device-srv/devices";
323
- if (window.navigator.userAgent) {
324
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "GET", accessToken);
325
- }
326
- return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, false, "GET", accessToken);
304
+ return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "GET", accessToken);
327
305
  }
328
- ;
329
306
  /**
330
307
  * To delete device associated to the client, call **deleteDevice()**
331
308
  * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/3d44ad903d6e8-logout-the-user-for-a-device for more details.
@@ -350,7 +327,6 @@ class WebAuth {
350
327
  }
351
328
  return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, false, "DELETE", accessToken);
352
329
  }
353
- ;
354
330
  /**
355
331
  * 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.
356
332
  * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/4eae72956f65a-registration-field-setup for more details.
@@ -370,7 +346,6 @@ class WebAuth {
370
346
  const serviceURL = window.webAuthSettings.authority + '/registration-setup-srv/public/list?acceptlanguage=' + options.acceptlanguage + '&requestId=' + options.requestId;
371
347
  return Helper_1.Helper.createHttpPromise(undefined, serviceURL, false, 'GET');
372
348
  }
373
- ;
374
349
  /**
375
350
  * to generate device info, call **createDeviceInfo()**.
376
351
  * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/9b5a892afaf0b-create-device-info for more details.
@@ -393,69 +368,61 @@ class WebAuth {
393
368
  return Helper_1.Helper.createHttpPromise(options, serviceURL, false, 'POST');
394
369
  }
395
370
  }
396
- ;
397
371
  /**
398
372
  * get the user profile information
399
373
  * @param options
400
374
  * @returns
401
375
  */
402
376
  getUserProfile(options) {
403
- return UserService_1.UserService.getUserProfile(options);
377
+ return UserService.getUserProfile(options);
404
378
  }
405
- ;
406
379
  /**
407
380
  * renew token using refresh token
408
381
  * @param options
409
382
  * @returns
410
383
  */
411
384
  renewToken(options) {
412
- return TokenService_1.TokenService.renewToken(options);
385
+ return TokenService.renewToken(options);
413
386
  }
414
- ;
415
387
  /**
416
388
  * get access token from code
417
389
  * @param options
418
390
  * @returns
419
391
  */
420
392
  getAccessToken(options) {
421
- return TokenService_1.TokenService.getAccessToken(options);
393
+ return TokenService.getAccessToken(options);
422
394
  }
423
- ;
424
395
  /**
425
396
  * validate access token
426
397
  * @param options
427
398
  * @returns
428
399
  */
429
400
  validateAccessToken(options) {
430
- return TokenService_1.TokenService.validateAccessToken(options);
401
+ return TokenService.validateAccessToken(options);
431
402
  }
432
- ;
433
403
  /**
434
404
  * login with username and password
435
405
  * @param options
436
406
  */
437
407
  loginWithCredentials(options) {
438
- LoginService_1.LoginService.loginWithCredentials(options);
408
+ LoginService.loginWithCredentials(options);
439
409
  }
440
- ;
441
410
  /**
442
411
  * login with social
443
412
  * @param options
444
413
  * @param queryParams
445
414
  */
446
415
  loginWithSocial(options, queryParams) {
447
- LoginService_1.LoginService.loginWithSocial(options, queryParams);
416
+ LoginService.loginWithSocial(options, queryParams);
448
417
  }
449
- ;
450
418
  /**
451
419
  * register with social
452
420
  * @param options
453
421
  * @param queryParams
454
422
  */
455
423
  registerWithSocial(options, queryParams) {
456
- LoginService_1.LoginService.registerWithSocial(options, queryParams);
424
+ LoginService.registerWithSocial(options, queryParams);
457
425
  }
458
- ;
459
426
  /**
460
427
  * register user
461
428
  * @param options
@@ -463,210 +430,186 @@ class WebAuth {
463
430
  * @returns
464
431
  */
465
432
  register(options, headers) {
466
- return UserService_1.UserService.register(options, headers);
433
+ return UserService.register(options, headers);
467
434
  }
468
- ;
469
435
  /**
470
436
  * get invite info
471
437
  * @param options
472
438
  * @returns
473
439
  */
474
440
  getInviteUserDetails(options) {
475
- return UserService_1.UserService.getInviteUserDetails(options);
441
+ return UserService.getInviteUserDetails(options);
476
442
  }
477
- ;
478
443
  /**
479
444
  * get Communication status
480
445
  * @param options
481
446
  * @returns
482
447
  */
483
448
  getCommunicationStatus(options, headers) {
484
- return UserService_1.UserService.getCommunicationStatus(options, headers);
449
+ return UserService.getCommunicationStatus(options, headers);
485
450
  }
486
- ;
487
451
  /**
488
452
  * initiate verification
489
453
  * @param options
490
454
  * @returns
491
455
  */
492
456
  initiateAccountVerification(options) {
493
- VerificationService_1.VerificationService.initiateAccountVerification(options);
457
+ VerificationService.initiateAccountVerification(options);
494
458
  }
495
- ;
496
459
  /**
497
460
  * verify account
498
461
  * @param options
499
462
  * @returns
500
463
  */
501
464
  verifyAccount(options) {
502
- return VerificationService_1.VerificationService.verifyAccount(options);
465
+ return VerificationService.verifyAccount(options);
503
466
  }
504
- ;
505
467
  /**
506
468
  * initiate reset password
507
469
  * @param options
508
470
  * @returns
509
471
  */
510
472
  initiateResetPassword(options) {
511
- return UserService_1.UserService.initiateResetPassword(options);
473
+ return UserService.initiateResetPassword(options);
512
474
  }
513
- ;
514
475
  /**
515
476
  * handle reset password
516
477
  * @param options
517
478
  */
518
479
  handleResetPassword(options) {
519
- return UserService_1.UserService.handleResetPassword(options);
480
+ return UserService.handleResetPassword(options);
520
481
  }
521
- ;
522
482
  /**
523
483
  * reset password
524
484
  * @param options
525
485
  */
526
486
  resetPassword(options) {
527
- return UserService_1.UserService.resetPassword(options);
487
+ return UserService.resetPassword(options);
528
488
  }
529
- ;
530
489
  /**
531
490
  * get mfa list
532
491
  * @param options
533
492
  * @returns
534
493
  */
535
494
  getMFAList(options) {
536
- return VerificationService_1.VerificationService.getMFAList(options);
495
+ return VerificationService.getMFAList(options);
537
496
  }
538
- ;
539
497
  /**
540
498
  * cancel mfa
541
499
  * @param options
542
500
  * @returns
543
501
  */
544
502
  cancelMFA(options) {
545
- return VerificationService_1.VerificationService.cancelMFA(options);
503
+ return VerificationService.cancelMFA(options);
546
504
  }
547
- ;
548
505
  /**
549
506
  * passwordless login
550
507
  * @param options
551
508
  */
552
509
  passwordlessLogin(options) {
553
- LoginService_1.LoginService.passwordlessLogin(options);
510
+ LoginService.passwordlessLogin(options);
554
511
  }
555
- ;
556
512
  /**
557
513
  * get user consent details
558
514
  * @param options
559
515
  * @returns
560
516
  */
561
517
  getConsentDetails(options) {
562
- return ConsentService_1.ConsentService.getConsentDetails(options);
518
+ return ConsentService.getConsentDetails(options);
563
519
  }
564
- ;
565
520
  /**
566
521
  * accept consent
567
522
  * @param options
568
523
  * @returns
569
524
  */
570
525
  acceptConsent(options) {
571
- return ConsentService_1.ConsentService.acceptConsent(options);
526
+ return ConsentService.acceptConsent(options);
572
527
  }
573
- ;
574
528
  /**
575
529
  * get scope consent details
576
530
  * @param options
577
531
  * @returns
578
532
  */
579
533
  loginPrecheck(options) {
580
- return TokenService_1.TokenService.loginPrecheck(options);
534
+ return TokenService.loginPrecheck(options);
581
535
  }
582
- ;
583
536
  /**
584
537
  * get scope consent version details
585
538
  * @param options
586
539
  * @returns
587
540
  */
588
541
  getConsentVersionDetails(options) {
589
- return ConsentService_1.ConsentService.getConsentVersionDetails(options);
542
+ return ConsentService.getConsentVersionDetails(options);
590
543
  }
591
- ;
592
544
  /**
593
545
  * accept scope Consent
594
546
  * @param options
595
547
  * @returns
596
548
  */
597
549
  acceptScopeConsent(options) {
598
- return ConsentService_1.ConsentService.acceptScopeConsent(options);
550
+ return ConsentService.acceptScopeConsent(options);
599
551
  }
600
- ;
601
552
  /**
602
553
  * accept claim Consent
603
554
  * @param options
604
555
  * @returns
605
556
  */
606
557
  acceptClaimConsent(options) {
607
- return ConsentService_1.ConsentService.acceptClaimConsent(options);
558
+ return ConsentService.acceptClaimConsent(options);
608
559
  }
609
- ;
610
560
  /**
611
561
  * revoke claim Consent
612
562
  * @param options
613
563
  * @returns
614
564
  */
615
565
  revokeClaimConsent(options) {
616
- return ConsentService_1.ConsentService.revokeClaimConsent(options);
566
+ return ConsentService.revokeClaimConsent(options);
617
567
  }
618
- ;
619
568
  /**
620
569
  * get Deduplication details
621
570
  * @param options
622
571
  * @returns
623
572
  */
624
573
  getDeduplicationDetails(options) {
625
- return UserService_1.UserService.getDeduplicationDetails(options);
574
+ return UserService.getDeduplicationDetails(options);
626
575
  }
627
- ;
628
576
  /**
629
577
  * deduplication login
630
578
  * @param options
631
579
  */
632
580
  deduplicationLogin(options) {
633
- UserService_1.UserService.deduplicationLogin(options);
581
+ UserService.deduplicationLogin(options);
634
582
  }
635
- ;
636
583
  /**
637
584
  * register Deduplication
638
585
  * @param options
639
586
  * @returns
640
587
  */
641
588
  registerDeduplication(options) {
642
- return UserService_1.UserService.registerDeduplication(options);
589
+ return UserService.registerDeduplication(options);
643
590
  }
644
- ;
645
591
  /**
646
- * accepts any as the request
647
592
  * consent continue login
648
593
  * @param options
649
594
  */
650
595
  consentContinue(options) {
651
- LoginService_1.LoginService.consentContinue(options);
596
+ LoginService.consentContinue(options);
652
597
  }
653
- ;
654
598
  /**
655
599
  * mfa continue login
600
+ * options: PhysicalVerificationLoginRequest is not needed anymore. It is now DEPRECATED and will be removed in the next major release
656
601
  * @param options
657
602
  */
658
603
  mfaContinue(options) {
659
- LoginService_1.LoginService.mfaContinue(options);
604
+ LoginService.mfaContinue(options);
660
605
  }
661
- ;
662
606
  /**
663
607
  * change password continue
664
608
  * @param options
665
609
  */
666
610
  firstTimeChangePassword(options) {
667
- LoginService_1.LoginService.firstTimeChangePassword(options);
611
+ LoginService.firstTimeChangePassword(options);
668
612
  }
669
- ;
670
613
  /**
671
614
  * change password
672
615
  * @param options
@@ -674,9 +617,8 @@ class WebAuth {
674
617
  * @returns
675
618
  */
676
619
  changePassword(options, access_token) {
677
- return UserService_1.UserService.changePassword(options, access_token);
620
+ return UserService.changePassword(options, access_token);
678
621
  }
679
- ;
680
622
  /**
681
623
  * update profile
682
624
  * @param options
@@ -685,9 +627,8 @@ class WebAuth {
685
627
  * @returns
686
628
  */
687
629
  updateProfile(options, access_token, sub) {
688
- return UserService_1.UserService.updateProfile(options, access_token, sub);
630
+ return UserService.updateProfile(options, access_token, sub);
689
631
  }
690
- ;
691
632
  /**
692
633
  * To get user activities, call **getUserActivities()**.
693
634
  * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/346141453781e-get-user-activities for more details.
@@ -712,14 +653,28 @@ class WebAuth {
712
653
  const serviceURL = window.webAuthSettings.authority + '/activity-streams-srv/user-activities';
713
654
  return Helper_1.Helper.createHttpPromise(options, serviceURL, false, 'POST', accessToken);
714
655
  }
656
+ /**
657
+ * To run predefined action after enrollment, call userActionOnEnrollment()
658
+ * @param options
659
+ * @param trackId
660
+ * @example
661
+ * ```js
662
+ * const options = {
663
+ * action: 'predefined action'
664
+ * };
665
+ * cidaas.userActionOnEnrollment(options, 'trackId');
666
+ */
667
+ userActionOnEnrollment(options, trackId) {
668
+ const serviceURL = window.webAuthSettings.authority + '/auth-actions-srv/validation/' + trackId;
669
+ return Helper_1.Helper.createHttpPromise(options, serviceURL, false, 'POST');
670
+ }
715
671
  /**
716
672
  * @param access_token
717
673
  * @returns
718
674
  */
719
675
  getAllVerificationList(access_token) {
720
- return VerificationService_1.VerificationService.getAllVerificationList(access_token);
676
+ return VerificationService.getAllVerificationList(access_token);
721
677
  }
722
- ;
723
678
  /**
724
679
  * initiate link accoount
725
680
  * @param options
@@ -727,9 +682,8 @@ class WebAuth {
727
682
  * @returns
728
683
  */
729
684
  initiateLinkAccount(options, access_token) {
730
- return UserService_1.UserService.initiateLinkAccount(options, access_token);
685
+ return UserService.initiateLinkAccount(options, access_token);
731
686
  }
732
- ;
733
687
  /**
734
688
  * complete link accoount
735
689
  * @param options
@@ -737,9 +691,8 @@ class WebAuth {
737
691
  * @returns
738
692
  */
739
693
  completeLinkAccount(options, access_token) {
740
- return UserService_1.UserService.completeLinkAccount(options, access_token);
694
+ return UserService.completeLinkAccount(options, access_token);
741
695
  }
742
- ;
743
696
  /**
744
697
  * get linked users
745
698
  * @param access_token
@@ -747,9 +700,8 @@ class WebAuth {
747
700
  * @returns
748
701
  */
749
702
  getLinkedUsers(access_token, sub) {
750
- return UserService_1.UserService.getLinkedUsers(access_token, sub);
703
+ return UserService.getLinkedUsers(access_token, sub);
751
704
  }
752
- ;
753
705
  /**
754
706
  * unlink accoount
755
707
  * @param access_token
@@ -757,9 +709,8 @@ class WebAuth {
757
709
  * @returns
758
710
  */
759
711
  unlinkAccount(access_token, identityId) {
760
- return UserService_1.UserService.unlinkAccount(access_token, identityId);
712
+ return UserService.unlinkAccount(access_token, identityId);
761
713
  }
762
- ;
763
714
  /**
764
715
  * To change profile image, call **updateProfileImage()**.
765
716
  * @example
@@ -796,55 +747,49 @@ class WebAuth {
796
747
  formdata.set('photo', options.photo, options.filename);
797
748
  return Helper_1.Helper.createHttpPromise(options, serviceURL, undefined, 'POST', access_token, null, formdata);
798
749
  }
799
- ;
800
750
  /**
801
751
  * enrollVerification
802
752
  * @param options
803
753
  * @returns
804
754
  */
805
755
  initiateEnrollment(options, accessToken) {
806
- return VerificationService_1.VerificationService.initiateEnrollment(options, accessToken);
756
+ return VerificationService.initiateEnrollment(options, accessToken);
807
757
  }
808
- ;
809
758
  /**
810
759
  * update the status of notification
811
760
  * @param status_id
812
761
  * @returns
813
762
  */
814
763
  getEnrollmentStatus(status_id, accessToken) {
815
- return VerificationService_1.VerificationService.getEnrollmentStatus(status_id, accessToken);
764
+ return VerificationService.getEnrollmentStatus(status_id, accessToken);
816
765
  }
817
- ;
818
766
  /**
819
767
  * enrollVerification
820
768
  * @param options
821
769
  * @returns
822
770
  */
823
771
  enrollVerification(options) {
824
- return VerificationService_1.VerificationService.enrollVerification(options);
772
+ return VerificationService.enrollVerification(options);
825
773
  }
826
- ;
827
774
  /**
828
775
  * checkVerificationTypeConfigured
829
776
  * @param options
830
777
  * @returns
831
778
  */
832
779
  checkVerificationTypeConfigured(options) {
833
- return VerificationService_1.VerificationService.checkVerificationTypeConfigured(options);
780
+ return VerificationService.checkVerificationTypeConfigured(options);
834
781
  }
835
- ;
836
782
  /**
837
783
  * deleteUserAccount
838
784
  * @param options
839
785
  * @returns
840
786
  */
841
787
  deleteUserAccount(options) {
842
- return UserService_1.UserService.deleteUserAccount(options);
788
+ return UserService.deleteUserAccount(options);
843
789
  }
844
- ;
845
790
  /**
846
791
  * getMissingFields
847
- * @param trackId - required. If only trackId is given, it will get missing fields from cidaas after succesfull registration using default provider
792
+ * @param trackId - required. If only trackId is given, it will get missing fields from cidaas after succesful registration using default provider
848
793
  * @param useSocialProvider - optional. If given, it will get missing fields from social provider after successful registration using social provider
849
794
  *
850
795
  * @example
@@ -867,10 +812,9 @@ class WebAuth {
867
812
  return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, false, "GET");
868
813
  }
869
814
  else {
870
- return TokenService_1.TokenService.getMissingFields(trackId);
815
+ return TokenService.getMissingFields(trackId);
871
816
  }
872
817
  }
873
- ;
874
818
  /**
875
819
  * progressiveRegistration
876
820
  * @param options
@@ -878,29 +822,27 @@ class WebAuth {
878
822
  * @returns
879
823
  */
880
824
  progressiveRegistration(options, headers) {
881
- return LoginService_1.LoginService.progressiveRegistration(options, headers);
825
+ return LoginService.progressiveRegistration(options, headers);
882
826
  }
883
- ;
884
827
  /**
885
828
  * loginAfterRegister
886
829
  * @param options
887
830
  */
888
831
  loginAfterRegister(options) {
889
- LoginService_1.LoginService.loginAfterRegister(options);
832
+ LoginService.loginAfterRegister(options);
890
833
  }
891
- ;
892
834
  /**
893
835
  * device code flow - initiate
894
836
  */
895
837
  initiateDeviceCode(clientId) {
896
- return TokenService_1.TokenService.initiateDeviceCode(clientId);
838
+ return TokenService.initiateDeviceCode(clientId);
897
839
  }
898
840
  /**
899
841
  * device code flow - verify
900
842
  * @param code
901
843
  */
902
844
  deviceCodeVerify(code) {
903
- TokenService_1.TokenService.deviceCodeVerify(code);
845
+ TokenService.deviceCodeVerify(code);
904
846
  }
905
847
  /**
906
848
  * check if an user exists
@@ -908,9 +850,8 @@ class WebAuth {
908
850
  * @returns
909
851
  */
910
852
  userCheckExists(options) {
911
- return UserService_1.UserService.userCheckExists(options);
853
+ return UserService.userCheckExists(options);
912
854
  }
913
- ;
914
855
  /**
915
856
  * To set accept language
916
857
  * @param acceptLanguage
@@ -924,28 +865,57 @@ class WebAuth {
924
865
  * @returns
925
866
  */
926
867
  initiateMFA(options, accessToken) {
927
- // TODO: remove accessToken parameter in the next major release
868
+ // BREAKING TODO: remove accessToken parameter in the next major release
928
869
  if (accessToken) {
929
- return VerificationService_1.VerificationService.initiateMFA(options, accessToken);
870
+ return VerificationService.initiateMFA(options, accessToken);
930
871
  }
931
- return VerificationService_1.VerificationService.initiateMFA(options);
872
+ return VerificationService.initiateMFA(options);
932
873
  }
933
- ;
934
874
  /**
935
875
  * authenticate mfa
936
876
  * @param options
937
877
  * @returns
938
878
  */
939
879
  authenticateMFA(options) {
940
- return VerificationService_1.VerificationService.authenticateMFA(options);
880
+ return VerificationService.authenticateMFA(options);
881
+ }
882
+ /**
883
+ * initiate verification
884
+ * @param options
885
+ * @returns
886
+ */
887
+ initiateVerification(options, trackId, method) {
888
+ return VerificationService.initiateVerification(options, trackId, method);
889
+ }
890
+ /**
891
+ * configure verification
892
+ * @param options
893
+ * @returns
894
+ */
895
+ configureVerification(options, method) {
896
+ return VerificationService.configureVerification(options, method);
897
+ }
898
+ /**
899
+ * configure friendly name
900
+ * @param options
901
+ * @returns
902
+ */
903
+ configureFriendlyName(options, trackId, method) {
904
+ return VerificationService.configureFriendlyName(options, trackId, method);
905
+ }
906
+ /**
907
+ * login as guest
908
+ * @param requestId
909
+ * @returns
910
+ */
911
+ actionGuestLogin(requestId) {
912
+ return LoginService.actionGuestLogin(requestId);
941
913
  }
942
- ;
943
914
  /**
944
915
  * offline token check
945
916
  */
946
917
  offlineTokenCheck(accessToken) {
947
- return TokenService_1.TokenService.offlineTokenCheck(accessToken);
918
+ return TokenService.offlineTokenCheck(accessToken);
948
919
  }
949
- ;
950
920
  }
951
921
  exports.WebAuth = WebAuth;