cidaas-javascript-sdk 4.2.4 → 4.3.1

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 +41 -2
  2. package/README.md +9 -6
  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 +41 -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 +97 -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 +142 -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 +219 -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 +138 -178
  36. package/dist/web-auth/WebAuth.js +183 -177
  37. package/dist/web-auth/webauth.model.d.ts +66 -0
  38. package/dist/web-auth/webauth.model.js +2 -0
  39. package/package.json +2 -2
  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,36 +213,45 @@ 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
241
226
  * ```js
242
- * cidaas.getRequestId().then(function (response) {
227
+ * const option: GetRequestIdRequest = {
228
+ * 'client_id': 'your client id',
229
+ * 'redirect_uri': 'your redirect url',
230
+ * 'scope': 'your scopes',
231
+ * }
232
+ * cidaas.getRequestId(option).then(function (response) {
243
233
  * // the response will give you request id.
244
234
  * }).catch(function(ex) {
245
235
  * // your failure code here
246
236
  * });
247
237
  * ```
248
238
  */
249
- getRequestId() {
250
- var _a, _b;
239
+ getRequestId(option) {
251
240
  const ui_locales = window.webAuthSettings.ui_locales;
252
- const options = Object.assign({ 'client_id': window.webAuthSettings.client_id, 'redirect_uri': window.webAuthSettings.redirect_uri, 'response_type': (_a = window.webAuthSettings.response_type) !== null && _a !== void 0 ? _a : 'token', "response_mode": (_b = window.webAuthSettings.response_mode) !== null && _b !== void 0 ? _b : 'fragment', "scope": window.webAuthSettings.scope, "nonce": new Date().getTime().toString() }, (ui_locales && { ui_locales } || {}));
241
+ const defaultPayload = Object.assign({ 'client_id': window.webAuthSettings.client_id, 'redirect_uri': window.webAuthSettings.redirect_uri, 'response_type': window.webAuthSettings.response_type, 'response_mode': window.webAuthSettings.response_mode, 'scope': window.webAuthSettings.scope }, (ui_locales && { ui_locales } || {}));
242
+ const payload = option ? option : defaultPayload;
243
+ if (!payload.response_type) {
244
+ payload.response_type = 'token';
245
+ }
246
+ if (!payload.response_mode) {
247
+ payload.response_mode = 'fragment';
248
+ }
249
+ if (!payload.nonce) {
250
+ payload.nonce = new Date().getTime().toString();
251
+ }
253
252
  const serviceURL = window.webAuthSettings.authority + '/authz-srv/authrequest/authz/generate';
254
- return Helper_1.Helper.createHttpPromise(options, serviceURL, false, "POST");
253
+ return Helper_1.Helper.createHttpPromise(payload, serviceURL, false, "POST");
255
254
  }
256
- ;
257
255
  /**
258
256
  * 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
257
  * @example
@@ -269,7 +267,6 @@ class WebAuth {
269
267
  const _serviceURL = window.webAuthSettings.authority + "/public-srv/tenantinfo/basic";
270
268
  return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, false, "GET");
271
269
  }
272
- ;
273
270
  /**
274
271
  * To logout the user by using cidaas internal api, call **logoutUser()**.
275
272
  * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/3b5ce6a54bf29-logout for more details.
@@ -283,7 +280,6 @@ class WebAuth {
283
280
  logoutUser(options) {
284
281
  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
282
  }
286
- ;
287
283
  /**
288
284
  * To get the client basic information, call **getClientInfo()**. This will return the basic client details such as client name and its details.
289
285
  * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/dc8a6cfb28abb-public-page-information for more details.
@@ -302,13 +298,12 @@ class WebAuth {
302
298
  const _serviceURL = window.webAuthSettings.authority + "/public-srv/public/" + options.requestId;
303
299
  return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, false, "GET");
304
300
  }
305
- ;
306
301
  /**
307
302
  * To get all devices information associated to the client, call **getDevicesInfo()**
308
303
  * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/2a2feed70303c-get-device-by-user for more details.
309
304
  * @example
310
305
  * ```js
311
- * const options = {};
306
+ * const options = null; // the payload is deprecated and will be removed in the next major release
312
307
  * const accessToken = 'your access token';
313
308
  * cidaas.getDevicesInfo(options, accessToken).then(function (resp) {
314
309
  * // the response will give you devices informations.
@@ -318,14 +313,10 @@ class WebAuth {
318
313
  * ```
319
314
  */
320
315
  getDevicesInfo(options, accessToken) {
321
- options.userAgent = window.navigator.userAgent;
316
+ options = undefined;
322
317
  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);
318
+ return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "GET", accessToken);
327
319
  }
328
- ;
329
320
  /**
330
321
  * To delete device associated to the client, call **deleteDevice()**
331
322
  * 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 +341,6 @@ class WebAuth {
350
341
  }
351
342
  return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, false, "DELETE", accessToken);
352
343
  }
353
- ;
354
344
  /**
355
345
  * 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
346
  * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/4eae72956f65a-registration-field-setup for more details.
@@ -370,7 +360,6 @@ class WebAuth {
370
360
  const serviceURL = window.webAuthSettings.authority + '/registration-setup-srv/public/list?acceptlanguage=' + options.acceptlanguage + '&requestId=' + options.requestId;
371
361
  return Helper_1.Helper.createHttpPromise(undefined, serviceURL, false, 'GET');
372
362
  }
373
- ;
374
363
  /**
375
364
  * to generate device info, call **createDeviceInfo()**.
376
365
  * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/9b5a892afaf0b-create-device-info for more details.
@@ -393,69 +382,61 @@ class WebAuth {
393
382
  return Helper_1.Helper.createHttpPromise(options, serviceURL, false, 'POST');
394
383
  }
395
384
  }
396
- ;
397
385
  /**
398
386
  * get the user profile information
399
387
  * @param options
400
388
  * @returns
401
389
  */
402
390
  getUserProfile(options) {
403
- return UserService_1.UserService.getUserProfile(options);
391
+ return UserService.getUserProfile(options);
404
392
  }
405
- ;
406
393
  /**
407
394
  * renew token using refresh token
408
395
  * @param options
409
396
  * @returns
410
397
  */
411
398
  renewToken(options) {
412
- return TokenService_1.TokenService.renewToken(options);
399
+ return TokenService.renewToken(options);
413
400
  }
414
- ;
415
401
  /**
416
402
  * get access token from code
417
403
  * @param options
418
404
  * @returns
419
405
  */
420
406
  getAccessToken(options) {
421
- return TokenService_1.TokenService.getAccessToken(options);
407
+ return TokenService.getAccessToken(options);
422
408
  }
423
- ;
424
409
  /**
425
410
  * validate access token
426
411
  * @param options
427
412
  * @returns
428
413
  */
429
414
  validateAccessToken(options) {
430
- return TokenService_1.TokenService.validateAccessToken(options);
415
+ return TokenService.validateAccessToken(options);
431
416
  }
432
- ;
433
417
  /**
434
418
  * login with username and password
435
419
  * @param options
436
420
  */
437
421
  loginWithCredentials(options) {
438
- LoginService_1.LoginService.loginWithCredentials(options);
422
+ LoginService.loginWithCredentials(options);
439
423
  }
440
- ;
441
424
  /**
442
425
  * login with social
443
426
  * @param options
444
427
  * @param queryParams
445
428
  */
446
429
  loginWithSocial(options, queryParams) {
447
- LoginService_1.LoginService.loginWithSocial(options, queryParams);
430
+ LoginService.loginWithSocial(options, queryParams);
448
431
  }
449
- ;
450
432
  /**
451
433
  * register with social
452
434
  * @param options
453
435
  * @param queryParams
454
436
  */
455
437
  registerWithSocial(options, queryParams) {
456
- LoginService_1.LoginService.registerWithSocial(options, queryParams);
438
+ LoginService.registerWithSocial(options, queryParams);
457
439
  }
458
- ;
459
440
  /**
460
441
  * register user
461
442
  * @param options
@@ -463,210 +444,203 @@ class WebAuth {
463
444
  * @returns
464
445
  */
465
446
  register(options, headers) {
466
- return UserService_1.UserService.register(options, headers);
447
+ return UserService.register(options, headers);
467
448
  }
468
- ;
469
449
  /**
470
450
  * get invite info
471
451
  * @param options
452
+ * @param headers
472
453
  * @returns
473
454
  */
474
- getInviteUserDetails(options) {
475
- return UserService_1.UserService.getInviteUserDetails(options);
455
+ getInviteUserDetails(options, headers) {
456
+ return UserService.getInviteUserDetails(options, headers);
476
457
  }
477
- ;
478
458
  /**
479
459
  * get Communication status
480
460
  * @param options
461
+ * @param headers
481
462
  * @returns
482
463
  */
483
464
  getCommunicationStatus(options, headers) {
484
- return UserService_1.UserService.getCommunicationStatus(options, headers);
465
+ return UserService.getCommunicationStatus(options, headers);
485
466
  }
486
- ;
487
467
  /**
488
468
  * initiate verification
489
469
  * @param options
490
470
  * @returns
491
471
  */
492
472
  initiateAccountVerification(options) {
493
- VerificationService_1.VerificationService.initiateAccountVerification(options);
473
+ VerificationService.initiateAccountVerification(options);
494
474
  }
495
- ;
496
475
  /**
497
476
  * verify account
498
477
  * @param options
478
+ * @param headers
499
479
  * @returns
500
480
  */
501
- verifyAccount(options) {
502
- return VerificationService_1.VerificationService.verifyAccount(options);
481
+ verifyAccount(options, headers) {
482
+ return VerificationService.verifyAccount(options, headers);
503
483
  }
504
- ;
505
484
  /**
506
485
  * initiate reset password
507
486
  * @param options
487
+ * @param headers
508
488
  * @returns
509
489
  */
510
- initiateResetPassword(options) {
511
- return UserService_1.UserService.initiateResetPassword(options);
490
+ initiateResetPassword(options, headers) {
491
+ return UserService.initiateResetPassword(options, headers);
512
492
  }
513
- ;
514
493
  /**
515
494
  * handle reset password
516
495
  * @param options
496
+ * @param handleResponseAsJson
497
+ * @param headers
517
498
  */
518
- handleResetPassword(options) {
519
- return UserService_1.UserService.handleResetPassword(options);
499
+ handleResetPassword(options, handleResponseAsJson, headers) {
500
+ return UserService.handleResetPassword(options, handleResponseAsJson, headers);
520
501
  }
521
- ;
522
502
  /**
523
503
  * reset password
524
504
  * @param options
505
+ * @param handleResponseAsJson
506
+ * @param headers
525
507
  */
526
- resetPassword(options) {
527
- return UserService_1.UserService.resetPassword(options);
508
+ resetPassword(options, handleResponseAsJson, headers) {
509
+ return UserService.resetPassword(options, handleResponseAsJson, headers);
528
510
  }
529
- ;
530
511
  /**
531
512
  * get mfa list
532
513
  * @param options
514
+ * @param headers
533
515
  * @returns
534
516
  */
535
- getMFAList(options) {
536
- return VerificationService_1.VerificationService.getMFAList(options);
517
+ getMFAList(options, headers) {
518
+ return VerificationService.getMFAList(options, headers);
537
519
  }
538
- ;
539
520
  /**
540
521
  * cancel mfa
541
522
  * @param options
523
+ * @param headers
542
524
  * @returns
543
525
  */
544
- cancelMFA(options) {
545
- return VerificationService_1.VerificationService.cancelMFA(options);
526
+ cancelMFA(options, headers) {
527
+ return VerificationService.cancelMFA(options, headers);
546
528
  }
547
- ;
548
529
  /**
549
530
  * passwordless login
550
531
  * @param options
551
532
  */
552
533
  passwordlessLogin(options) {
553
- LoginService_1.LoginService.passwordlessLogin(options);
534
+ LoginService.passwordlessLogin(options);
554
535
  }
555
- ;
556
536
  /**
557
537
  * get user consent details
558
538
  * @param options
559
539
  * @returns
560
540
  */
561
- getConsentDetails(options) {
562
- return ConsentService_1.ConsentService.getConsentDetails(options);
541
+ getConsentDetails(options, headers) {
542
+ return ConsentService.getConsentDetails(options, headers);
563
543
  }
564
- ;
565
544
  /**
566
545
  * accept consent
567
546
  * @param options
547
+ * @param headers
568
548
  * @returns
569
549
  */
570
- acceptConsent(options) {
571
- return ConsentService_1.ConsentService.acceptConsent(options);
550
+ acceptConsent(options, headers) {
551
+ return ConsentService.acceptConsent(options, headers);
572
552
  }
573
- ;
574
553
  /**
575
554
  * get scope consent details
576
555
  * @param options
556
+ * @param headers
577
557
  * @returns
578
558
  */
579
- loginPrecheck(options) {
580
- return TokenService_1.TokenService.loginPrecheck(options);
559
+ loginPrecheck(options, headers) {
560
+ return TokenService.loginPrecheck(options, headers);
581
561
  }
582
- ;
583
562
  /**
584
563
  * get scope consent version details
585
564
  * @param options
565
+ * @param headers
586
566
  * @returns
587
567
  */
588
- getConsentVersionDetails(options) {
589
- return ConsentService_1.ConsentService.getConsentVersionDetails(options);
568
+ getConsentVersionDetails(options, headers) {
569
+ return ConsentService.getConsentVersionDetails(options, headers);
590
570
  }
591
- ;
592
571
  /**
593
572
  * accept scope Consent
594
573
  * @param options
574
+ * @param headers
595
575
  * @returns
596
576
  */
597
- acceptScopeConsent(options) {
598
- return ConsentService_1.ConsentService.acceptScopeConsent(options);
577
+ acceptScopeConsent(options, headers) {
578
+ return ConsentService.acceptScopeConsent(options, headers);
599
579
  }
600
- ;
601
580
  /**
602
581
  * accept claim Consent
603
582
  * @param options
583
+ * @param headers
604
584
  * @returns
605
585
  */
606
- acceptClaimConsent(options) {
607
- return ConsentService_1.ConsentService.acceptClaimConsent(options);
586
+ acceptClaimConsent(options, headers) {
587
+ return ConsentService.acceptClaimConsent(options, headers);
608
588
  }
609
- ;
610
589
  /**
611
590
  * revoke claim Consent
612
591
  * @param options
613
592
  * @returns
614
593
  */
615
594
  revokeClaimConsent(options) {
616
- return ConsentService_1.ConsentService.revokeClaimConsent(options);
595
+ return ConsentService.revokeClaimConsent(options);
617
596
  }
618
- ;
619
597
  /**
620
598
  * get Deduplication details
621
599
  * @param options
600
+ * @param headers
622
601
  * @returns
623
602
  */
624
- getDeduplicationDetails(options) {
625
- return UserService_1.UserService.getDeduplicationDetails(options);
603
+ getDeduplicationDetails(options, headers) {
604
+ return UserService.getDeduplicationDetails(options, headers);
626
605
  }
627
- ;
628
606
  /**
629
607
  * deduplication login
630
608
  * @param options
631
609
  */
632
610
  deduplicationLogin(options) {
633
- UserService_1.UserService.deduplicationLogin(options);
611
+ UserService.deduplicationLogin(options);
634
612
  }
635
- ;
636
613
  /**
637
614
  * register Deduplication
638
615
  * @param options
616
+ * @param headers
639
617
  * @returns
640
618
  */
641
- registerDeduplication(options) {
642
- return UserService_1.UserService.registerDeduplication(options);
619
+ registerDeduplication(options, headers) {
620
+ return UserService.registerDeduplication(options, headers);
643
621
  }
644
- ;
645
622
  /**
646
- * accepts any as the request
647
623
  * consent continue login
648
624
  * @param options
649
625
  */
650
626
  consentContinue(options) {
651
- LoginService_1.LoginService.consentContinue(options);
627
+ LoginService.consentContinue(options);
652
628
  }
653
- ;
654
629
  /**
655
630
  * mfa continue login
631
+ * options: PhysicalVerificationLoginRequest is not needed anymore. It is now DEPRECATED and will be removed in the next major release
656
632
  * @param options
657
633
  */
658
634
  mfaContinue(options) {
659
- LoginService_1.LoginService.mfaContinue(options);
635
+ LoginService.mfaContinue(options);
660
636
  }
661
- ;
662
637
  /**
663
638
  * change password continue
664
639
  * @param options
665
640
  */
666
641
  firstTimeChangePassword(options) {
667
- LoginService_1.LoginService.firstTimeChangePassword(options);
642
+ LoginService.firstTimeChangePassword(options);
668
643
  }
669
- ;
670
644
  /**
671
645
  * change password
672
646
  * @param options
@@ -674,9 +648,8 @@ class WebAuth {
674
648
  * @returns
675
649
  */
676
650
  changePassword(options, access_token) {
677
- return UserService_1.UserService.changePassword(options, access_token);
651
+ return UserService.changePassword(options, access_token);
678
652
  }
679
- ;
680
653
  /**
681
654
  * update profile
682
655
  * @param options
@@ -685,9 +658,8 @@ class WebAuth {
685
658
  * @returns
686
659
  */
687
660
  updateProfile(options, access_token, sub) {
688
- return UserService_1.UserService.updateProfile(options, access_token, sub);
661
+ return UserService.updateProfile(options, access_token, sub);
689
662
  }
690
- ;
691
663
  /**
692
664
  * To get user activities, call **getUserActivities()**.
693
665
  * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/346141453781e-get-user-activities for more details.
@@ -712,14 +684,29 @@ class WebAuth {
712
684
  const serviceURL = window.webAuthSettings.authority + '/activity-streams-srv/user-activities';
713
685
  return Helper_1.Helper.createHttpPromise(options, serviceURL, false, 'POST', accessToken);
714
686
  }
687
+ /**
688
+ * To run predefined action after enrollment, call userActionOnEnrollment()
689
+ * @param options
690
+ * @param trackId
691
+ * @example
692
+ * ```js
693
+ * const options = {
694
+ * action: 'predefined action'
695
+ * };
696
+ * cidaas.userActionOnEnrollment(options, 'trackId');
697
+ */
698
+ userActionOnEnrollment(options, trackId) {
699
+ const serviceURL = window.webAuthSettings.authority + '/auth-actions-srv/validation/' + trackId;
700
+ return Helper_1.Helper.createHttpPromise(options, serviceURL, false, 'POST');
701
+ }
715
702
  /**
716
703
  * @param access_token
704
+ * @param headers
717
705
  * @returns
718
706
  */
719
- getAllVerificationList(access_token) {
720
- return VerificationService_1.VerificationService.getAllVerificationList(access_token);
707
+ getAllVerificationList(access_token, headers) {
708
+ return VerificationService.getAllVerificationList(access_token, headers);
721
709
  }
722
- ;
723
710
  /**
724
711
  * initiate link accoount
725
712
  * @param options
@@ -727,9 +714,8 @@ class WebAuth {
727
714
  * @returns
728
715
  */
729
716
  initiateLinkAccount(options, access_token) {
730
- return UserService_1.UserService.initiateLinkAccount(options, access_token);
717
+ return UserService.initiateLinkAccount(options, access_token);
731
718
  }
732
- ;
733
719
  /**
734
720
  * complete link accoount
735
721
  * @param options
@@ -737,9 +723,8 @@ class WebAuth {
737
723
  * @returns
738
724
  */
739
725
  completeLinkAccount(options, access_token) {
740
- return UserService_1.UserService.completeLinkAccount(options, access_token);
726
+ return UserService.completeLinkAccount(options, access_token);
741
727
  }
742
- ;
743
728
  /**
744
729
  * get linked users
745
730
  * @param access_token
@@ -747,9 +732,8 @@ class WebAuth {
747
732
  * @returns
748
733
  */
749
734
  getLinkedUsers(access_token, sub) {
750
- return UserService_1.UserService.getLinkedUsers(access_token, sub);
735
+ return UserService.getLinkedUsers(access_token, sub);
751
736
  }
752
- ;
753
737
  /**
754
738
  * unlink accoount
755
739
  * @param access_token
@@ -757,9 +741,8 @@ class WebAuth {
757
741
  * @returns
758
742
  */
759
743
  unlinkAccount(access_token, identityId) {
760
- return UserService_1.UserService.unlinkAccount(access_token, identityId);
744
+ return UserService.unlinkAccount(access_token, identityId);
761
745
  }
762
- ;
763
746
  /**
764
747
  * To change profile image, call **updateProfileImage()**.
765
748
  * @example
@@ -796,55 +779,50 @@ class WebAuth {
796
779
  formdata.set('photo', options.photo, options.filename);
797
780
  return Helper_1.Helper.createHttpPromise(options, serviceURL, undefined, 'POST', access_token, null, formdata);
798
781
  }
799
- ;
800
782
  /**
801
783
  * enrollVerification
802
784
  * @param options
803
785
  * @returns
804
786
  */
805
787
  initiateEnrollment(options, accessToken) {
806
- return VerificationService_1.VerificationService.initiateEnrollment(options, accessToken);
788
+ return VerificationService.initiateEnrollment(options, accessToken);
807
789
  }
808
- ;
809
790
  /**
810
791
  * update the status of notification
811
792
  * @param status_id
793
+ * @param headers
812
794
  * @returns
813
795
  */
814
- getEnrollmentStatus(status_id, accessToken) {
815
- return VerificationService_1.VerificationService.getEnrollmentStatus(status_id, accessToken);
796
+ getEnrollmentStatus(status_id, accessToken, headers) {
797
+ return VerificationService.getEnrollmentStatus(status_id, accessToken, headers);
816
798
  }
817
- ;
818
799
  /**
819
800
  * enrollVerification
820
801
  * @param options
821
802
  * @returns
822
803
  */
823
804
  enrollVerification(options) {
824
- return VerificationService_1.VerificationService.enrollVerification(options);
805
+ return VerificationService.enrollVerification(options);
825
806
  }
826
- ;
827
807
  /**
828
808
  * checkVerificationTypeConfigured
829
809
  * @param options
830
810
  * @returns
831
811
  */
832
812
  checkVerificationTypeConfigured(options) {
833
- return VerificationService_1.VerificationService.checkVerificationTypeConfigured(options);
813
+ return VerificationService.checkVerificationTypeConfigured(options);
834
814
  }
835
- ;
836
815
  /**
837
816
  * deleteUserAccount
838
817
  * @param options
839
818
  * @returns
840
819
  */
841
820
  deleteUserAccount(options) {
842
- return UserService_1.UserService.deleteUserAccount(options);
821
+ return UserService.deleteUserAccount(options);
843
822
  }
844
- ;
845
823
  /**
846
824
  * getMissingFields
847
- * @param trackId - required. If only trackId is given, it will get missing fields from cidaas after succesfull registration using default provider
825
+ * @param trackId - required. If only trackId is given, it will get missing fields from cidaas after succesful registration using default provider
848
826
  * @param useSocialProvider - optional. If given, it will get missing fields from social provider after successful registration using social provider
849
827
  *
850
828
  * @example
@@ -861,16 +839,15 @@ class WebAuth {
861
839
  * ```
862
840
  *
863
841
  */
864
- getMissingFields(trackId, useSocialProvider) {
842
+ getMissingFields(trackId, useSocialProvider, headers) {
865
843
  if (useSocialProvider) {
866
844
  const _serviceURL = window.webAuthSettings.authority + "/public-srv/public/trackinfo/" + useSocialProvider.requestId + "/" + trackId;
867
- return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, false, "GET");
845
+ return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, false, "GET", undefined, headers);
868
846
  }
869
847
  else {
870
- return TokenService_1.TokenService.getMissingFields(trackId);
848
+ return TokenService.getMissingFields(trackId, headers);
871
849
  }
872
850
  }
873
- ;
874
851
  /**
875
852
  * progressiveRegistration
876
853
  * @param options
@@ -878,39 +855,37 @@ class WebAuth {
878
855
  * @returns
879
856
  */
880
857
  progressiveRegistration(options, headers) {
881
- return LoginService_1.LoginService.progressiveRegistration(options, headers);
858
+ return LoginService.progressiveRegistration(options, headers);
882
859
  }
883
- ;
884
860
  /**
885
861
  * loginAfterRegister
886
862
  * @param options
887
863
  */
888
864
  loginAfterRegister(options) {
889
- LoginService_1.LoginService.loginAfterRegister(options);
865
+ LoginService.loginAfterRegister(options);
890
866
  }
891
- ;
892
867
  /**
893
868
  * device code flow - initiate
894
869
  */
895
870
  initiateDeviceCode(clientId) {
896
- return TokenService_1.TokenService.initiateDeviceCode(clientId);
871
+ return TokenService.initiateDeviceCode(clientId);
897
872
  }
898
873
  /**
899
874
  * device code flow - verify
900
875
  * @param code
901
876
  */
902
877
  deviceCodeVerify(code) {
903
- TokenService_1.TokenService.deviceCodeVerify(code);
878
+ TokenService.deviceCodeVerify(code);
904
879
  }
905
880
  /**
906
881
  * check if an user exists
907
882
  * @param options
883
+ * @param headers
908
884
  * @returns
909
885
  */
910
- userCheckExists(options) {
911
- return UserService_1.UserService.userCheckExists(options);
886
+ userCheckExists(options, headers) {
887
+ return UserService.userCheckExists(options, headers);
912
888
  }
913
- ;
914
889
  /**
915
890
  * To set accept language
916
891
  * @param acceptLanguage
@@ -921,31 +896,62 @@ class WebAuth {
921
896
  /**
922
897
  * initiate mfa
923
898
  * @param options
899
+ * @param headers
924
900
  * @returns
925
901
  */
926
- initiateMFA(options, accessToken) {
927
- // TODO: remove accessToken parameter in the next major release
902
+ initiateMFA(options, accessToken, headers) {
903
+ // BREAKING TODO: remove accessToken parameter in the next major release
928
904
  if (accessToken) {
929
- return VerificationService_1.VerificationService.initiateMFA(options, accessToken);
905
+ return VerificationService.initiateMFA(options, accessToken, headers);
930
906
  }
931
- return VerificationService_1.VerificationService.initiateMFA(options);
907
+ return VerificationService.initiateMFA(options, undefined, headers);
932
908
  }
933
- ;
934
909
  /**
935
910
  * authenticate mfa
936
911
  * @param options
912
+ * @param headers
913
+ * @returns
914
+ */
915
+ authenticateMFA(options, headers) {
916
+ return VerificationService.authenticateMFA(options, headers);
917
+ }
918
+ /**
919
+ * initiate verification
920
+ * @param options
921
+ * @returns
922
+ */
923
+ initiateVerification(options, trackId, method) {
924
+ return VerificationService.initiateVerification(options, trackId, method);
925
+ }
926
+ /**
927
+ * configure verification
928
+ * @param options
929
+ * @returns
930
+ */
931
+ configureVerification(options, method) {
932
+ return VerificationService.configureVerification(options, method);
933
+ }
934
+ /**
935
+ * configure friendly name
936
+ * @param options
937
+ * @returns
938
+ */
939
+ configureFriendlyName(options, trackId, method) {
940
+ return VerificationService.configureFriendlyName(options, trackId, method);
941
+ }
942
+ /**
943
+ * login as guest
944
+ * @param requestId
937
945
  * @returns
938
946
  */
939
- authenticateMFA(options) {
940
- return VerificationService_1.VerificationService.authenticateMFA(options);
947
+ actionGuestLogin(requestId) {
948
+ return LoginService.actionGuestLogin(requestId);
941
949
  }
942
- ;
943
950
  /**
944
951
  * offline token check
945
952
  */
946
953
  offlineTokenCheck(accessToken) {
947
- return TokenService_1.TokenService.offlineTokenCheck(accessToken);
954
+ return TokenService.offlineTokenCheck(accessToken);
948
955
  }
949
- ;
950
956
  }
951
957
  exports.WebAuth = WebAuth;