cidaas-javascript-sdk 3.1.3 → 3.1.5

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.
@@ -0,0 +1,1569 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ exports.__esModule = true;
39
+ exports.WebAuth = void 0;
40
+ var oidc_client_ts_1 = require("oidc-client-ts");
41
+ var CryptoJS = require("crypto-js");
42
+ var authentication_1 = require("../authentication");
43
+ var Helper_1 = require("./Helper");
44
+ var LoginService_1 = require("./LoginService");
45
+ var UserService_1 = require("./UserService");
46
+ var TokenService_1 = require("./TokenService");
47
+ var VerificationService_1 = require("./VerificationService");
48
+ var ConsentService_1 = require("./ConsentService");
49
+ var WebAuth = /** @class */ (function () {
50
+ function WebAuth(settings) {
51
+ try {
52
+ if (!settings.response_type) {
53
+ settings.response_type = "code";
54
+ }
55
+ if (!settings.scope) {
56
+ settings.scope = "email openid profile mobile";
57
+ }
58
+ if (!settings.mode) {
59
+ settings.mode = 'redirect';
60
+ }
61
+ if (!settings.cidaas_version) {
62
+ settings.cidaas_version = 2;
63
+ }
64
+ var usermanager = new oidc_client_ts_1.UserManager(settings);
65
+ window.webAuthSettings = settings;
66
+ window.usermanager = usermanager;
67
+ window.localeSettings = null;
68
+ window.authentication = new authentication_1.Authentication(window.webAuthSettings, window.usermanager);
69
+ window.usermanager.events.addSilentRenewError(function (error) {
70
+ throw new Helper_1.CustomException("Error while renewing silent login", 500);
71
+ });
72
+ }
73
+ catch (ex) {
74
+ console.log(ex);
75
+ }
76
+ }
77
+ /**
78
+ * @param string
79
+ * @returns
80
+ */
81
+ WebAuth.prototype.base64URL = function (string) {
82
+ return string.toString(CryptoJS.enc.Base64).replace(/=/g, '').replace(/\+/g, '-').replace(/\//g, '_');
83
+ };
84
+ ;
85
+ // prototype methods
86
+ /**
87
+ * login
88
+ */
89
+ WebAuth.prototype.loginWithBrowser = function () {
90
+ try {
91
+ if (!window.webAuthSettings && !window.authentication) {
92
+ throw new Helper_1.CustomException("Settings or Authentication instance in OIDC cannot be empty", 417);
93
+ }
94
+ switch (window.webAuthSettings.mode) {
95
+ case 'redirect':
96
+ window.authentication.redirectSignIn('login');
97
+ break;
98
+ case 'window':
99
+ window.authentication.popupSignIn();
100
+ break;
101
+ case 'silent':
102
+ window.authentication.silentSignIn();
103
+ break;
104
+ }
105
+ }
106
+ catch (ex) {
107
+ console.log(ex);
108
+ }
109
+ };
110
+ ;
111
+ /**
112
+ * register
113
+ */
114
+ WebAuth.prototype.registerWithBrowser = function () {
115
+ try {
116
+ if (!window.webAuthSettings && !window.authentication) {
117
+ throw new Helper_1.CustomException("Settings or Authentication instance in OIDC cannot be empty", 417);
118
+ }
119
+ switch (window.webAuthSettings.mode) {
120
+ case 'redirect':
121
+ window.authentication.redirectSignIn('register');
122
+ break;
123
+ case 'window':
124
+ window.authentication.popupSignIn();
125
+ break;
126
+ case 'silent':
127
+ window.authentication.silentSignIn();
128
+ break;
129
+ }
130
+ }
131
+ catch (ex) {
132
+ console.log(ex);
133
+ }
134
+ };
135
+ ;
136
+ /**
137
+ * login callback
138
+ * @returns
139
+ */
140
+ WebAuth.prototype.loginCallback = function () {
141
+ return new Promise(function (resolve, reject) {
142
+ try {
143
+ if (!window.webAuthSettings && !window.authentication) {
144
+ throw new Helper_1.CustomException("Settings or Authentication instance in OIDC cannot be empty", 417);
145
+ }
146
+ switch (window.webAuthSettings.mode) {
147
+ case 'redirect':
148
+ window.authentication.redirectSignInCallback().then(function (user) {
149
+ resolve(user);
150
+ })["catch"](function (ex) {
151
+ reject(ex);
152
+ });
153
+ break;
154
+ case 'window':
155
+ window.authentication.popupSignInCallback();
156
+ break;
157
+ case 'silent':
158
+ window.authentication.silentSignInCallbackV2().then(function (data) {
159
+ resolve(data);
160
+ })["catch"](function (error) {
161
+ reject(error);
162
+ });
163
+ break;
164
+ }
165
+ }
166
+ catch (ex) {
167
+ console.log(ex);
168
+ }
169
+ });
170
+ };
171
+ ;
172
+ /**
173
+ * get user info
174
+ * @returns
175
+ */
176
+ WebAuth.prototype.getUserInfo = function () {
177
+ return __awaiter(this, void 0, void 0, function () {
178
+ var e_1;
179
+ return __generator(this, function (_a) {
180
+ switch (_a.label) {
181
+ case 0:
182
+ _a.trys.push([0, 4, , 5]);
183
+ if (!window.usermanager) return [3 /*break*/, 2];
184
+ return [4 /*yield*/, window.usermanager.getUser()];
185
+ case 1: return [2 /*return*/, _a.sent()];
186
+ case 2: throw new Helper_1.CustomException("UserManager cannot be empty", 417);
187
+ case 3: return [3 /*break*/, 5];
188
+ case 4:
189
+ e_1 = _a.sent();
190
+ throw e_1;
191
+ case 5: return [2 /*return*/];
192
+ }
193
+ });
194
+ });
195
+ };
196
+ ;
197
+ /**
198
+ * logout
199
+ * @returns
200
+ */
201
+ WebAuth.prototype.logout = function () {
202
+ return new Promise(function (resolve, reject) {
203
+ try {
204
+ if (!window.webAuthSettings && !window.authentication) {
205
+ throw new Helper_1.CustomException("Settings or Authentication instance in OIDC cannot be empty", 417);
206
+ }
207
+ if (window.webAuthSettings.mode == 'redirect') {
208
+ window.authentication.redirectSignOut().then(function (result) {
209
+ resolve(result);
210
+ return;
211
+ });
212
+ }
213
+ else if (window.webAuthSettings.mode == 'window') {
214
+ window.authentication.popupSignOut();
215
+ }
216
+ else if (window.webAuthSettings.mode == 'silent') {
217
+ window.authentication.redirectSignOut();
218
+ }
219
+ else {
220
+ resolve(undefined);
221
+ }
222
+ }
223
+ catch (ex) {
224
+ reject(ex);
225
+ }
226
+ });
227
+ };
228
+ ;
229
+ /**
230
+ * logout callback
231
+ * @returns
232
+ */
233
+ WebAuth.prototype.logoutCallback = function () {
234
+ return new Promise(function (resolve, reject) {
235
+ try {
236
+ if (!window.webAuthSettings && !window.authentication) {
237
+ throw new Helper_1.CustomException("Settings or Authentication instance in OIDC cannot be empty", 417);
238
+ }
239
+ if (window.webAuthSettings.mode == 'redirect') {
240
+ window.authentication.redirectSignOutCallback().then(function (resp) {
241
+ resolve(resp);
242
+ });
243
+ }
244
+ else if (window.webAuthSettings.mode == 'window') {
245
+ window.authentication.popupSignOutCallback();
246
+ }
247
+ else if (window.webAuthSettings.mode == 'silent') {
248
+ window.authentication.redirectSignOutCallback();
249
+ }
250
+ }
251
+ catch (ex) {
252
+ reject(ex);
253
+ }
254
+ });
255
+ };
256
+ ;
257
+ /**
258
+ * get login url
259
+ * @returns
260
+ */
261
+ WebAuth.prototype.getLoginURL = function () {
262
+ var _this = this;
263
+ var loginUrl;
264
+ var finish = false;
265
+ (function () { return __awaiter(_this, void 0, void 0, function () {
266
+ var e_2;
267
+ return __generator(this, function (_a) {
268
+ switch (_a.label) {
269
+ case 0:
270
+ _a.trys.push([0, 2, , 3]);
271
+ return [4 /*yield*/, window.usermanager._client.getSignInRedirectUrl()];
272
+ case 1:
273
+ loginUrl = _a.sent();
274
+ return [3 /*break*/, 3];
275
+ case 2:
276
+ e_2 = _a.sent();
277
+ //TODO: define Error handling
278
+ console.log(e_2);
279
+ return [3 /*break*/, 3];
280
+ case 3:
281
+ finish = true;
282
+ return [2 /*return*/];
283
+ }
284
+ });
285
+ }); })();
286
+ while (!finish) { } // A simple synchronous loop to wait async call is finish
287
+ return loginUrl;
288
+ };
289
+ ;
290
+ /**
291
+ * get request id
292
+ * @returns
293
+ */
294
+ WebAuth.prototype.getRequestId = function () {
295
+ return new Promise(function (resolve, reject) {
296
+ try {
297
+ var respone_type = window.webAuthSettings.response_type;
298
+ if (!respone_type) {
299
+ respone_type = "token";
300
+ }
301
+ var response_mode = window.webAuthSettings.response_mode;
302
+ if (!response_mode) {
303
+ response_mode = "fragment";
304
+ }
305
+ var bodyParams = {
306
+ "client_id": window.webAuthSettings.client_id,
307
+ "redirect_uri": window.webAuthSettings.redirect_uri,
308
+ "response_type": respone_type,
309
+ "response_mode": response_mode,
310
+ "scope": window.webAuthSettings.scope,
311
+ "nonce": new Date().getTime().toString()
312
+ };
313
+ var http = new XMLHttpRequest();
314
+ var _serviceURL = window.webAuthSettings.authority + "/authz-srv/authrequest/authz/generate";
315
+ http.onreadystatechange = function () {
316
+ if (http.readyState == 4) {
317
+ if (http.responseText) {
318
+ resolve(JSON.parse(http.responseText));
319
+ }
320
+ else {
321
+ resolve(false);
322
+ }
323
+ }
324
+ };
325
+ http.open("POST", _serviceURL, true);
326
+ http.setRequestHeader("Content-type", "application/json");
327
+ if (window.localeSettings) {
328
+ http.setRequestHeader("accept-language", window.localeSettings);
329
+ }
330
+ http.send(JSON.stringify(bodyParams));
331
+ }
332
+ catch (ex) {
333
+ reject(ex);
334
+ }
335
+ });
336
+ };
337
+ ;
338
+ /**
339
+ * get missing fields
340
+ * @param options
341
+ * @returns
342
+ */
343
+ WebAuth.prototype.getMissingFields = function (options) {
344
+ var _serviceURL = window.webAuthSettings.authority + "/public-srv/public/trackinfo/" + options.requestId + "/" + options.trackId;
345
+ return Helper_1.Helper.createPostPromise(undefined, _serviceURL, false, "GET");
346
+ };
347
+ ;
348
+ /**
349
+ * get Tenant info
350
+ * @returns
351
+ */
352
+ WebAuth.prototype.getTenantInfo = function () {
353
+ var _serviceURL = window.webAuthSettings.authority + "/public-srv/tenantinfo/basic";
354
+ return Helper_1.Helper.createPostPromise(undefined, _serviceURL, false, "GET");
355
+ };
356
+ ;
357
+ /**
358
+ * logout api call
359
+ * @param options
360
+ */
361
+ WebAuth.prototype.logoutUser = function (options) {
362
+ try {
363
+ 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;
364
+ }
365
+ catch (ex) {
366
+ throw new Helper_1.CustomException(ex, 417);
367
+ }
368
+ };
369
+ ;
370
+ /**
371
+ * get Client Info
372
+ * @param options
373
+ * @returns
374
+ */
375
+ WebAuth.prototype.getClientInfo = function (options) {
376
+ var _serviceURL = window.webAuthSettings.authority + "/public-srv/public/" + options.requestId;
377
+ return Helper_1.Helper.createPostPromise(undefined, _serviceURL, false, "GET");
378
+ };
379
+ ;
380
+ /**
381
+ * get all devices associated to the client
382
+ * @param options
383
+ * @returns
384
+ */
385
+ WebAuth.prototype.getDevicesInfo = function (options) {
386
+ options.userAgent = window.navigator.userAgent;
387
+ var _serviceURL = window.webAuthSettings.authority + "/device-srv/devices";
388
+ if (window.navigator.userAgent) {
389
+ return Helper_1.Helper.createPostPromise(options, _serviceURL, false, "GET");
390
+ }
391
+ return Helper_1.Helper.createPostPromise(undefined, _serviceURL, false, "GET");
392
+ };
393
+ ;
394
+ /**
395
+ * delete a device
396
+ * @param options
397
+ * @returns
398
+ */
399
+ WebAuth.prototype.deleteDevice = function (options) {
400
+ var _serviceURL = window.webAuthSettings.authority + "/device-srv/device/" + options.device_id;
401
+ options.userAgent = window.navigator.userAgent;
402
+ if (window.navigator.userAgent) {
403
+ return Helper_1.Helper.createPostPromise(options, _serviceURL, false, "DELETE");
404
+ }
405
+ return Helper_1.Helper.createPostPromise(undefined, _serviceURL, false, "DELETE");
406
+ };
407
+ ;
408
+ /**
409
+ * get Registration setup
410
+ * @param options
411
+ * @returns
412
+ */
413
+ WebAuth.prototype.getRegistrationSetup = function (options) {
414
+ return new Promise(function (resolve, reject) {
415
+ try {
416
+ var http = new XMLHttpRequest();
417
+ var _serviceURL = window.webAuthSettings.authority + "/registration-setup-srv/public/list?acceptlanguage=" + options.acceptlanguage + "&requestId=" + options.requestId;
418
+ http.onreadystatechange = function () {
419
+ if (http.readyState == 4) {
420
+ if (http.responseText) {
421
+ var parsedResponse = JSON.parse(http.responseText);
422
+ if (parsedResponse && parsedResponse.data && parsedResponse.data.length > 0) {
423
+ var registrationFields = parsedResponse.data;
424
+ }
425
+ resolve(parsedResponse);
426
+ }
427
+ else {
428
+ resolve(false);
429
+ }
430
+ }
431
+ };
432
+ http.open("GET", _serviceURL, true);
433
+ http.setRequestHeader("Content-type", "application/json");
434
+ var acceptLanguage = options.acceptlanguage ? options.acceptlanguage : window === null || window === void 0 ? void 0 : window.localeSettings;
435
+ http.setRequestHeader("accept-language", acceptLanguage);
436
+ http.send();
437
+ }
438
+ catch (ex) {
439
+ reject(ex);
440
+ }
441
+ });
442
+ };
443
+ ;
444
+ /**
445
+ * get unreviewed devices
446
+ * @param access_token
447
+ * @param sub
448
+ * @returns
449
+ */
450
+ WebAuth.prototype.getUnreviewedDevices = function (access_token, sub) {
451
+ var _serviceURL = window.webAuthSettings.authority + "/reports-srv/device/unreviewlist/" + sub;
452
+ return Helper_1.Helper.createPostPromise(undefined, _serviceURL, false, "GET", access_token);
453
+ };
454
+ ;
455
+ /**
456
+ * get reviewed devices
457
+ * @param access_token
458
+ * @param sub
459
+ * @returns
460
+ */
461
+ WebAuth.prototype.getReviewedDevices = function (access_token, sub) {
462
+ var _serviceURL = window.webAuthSettings.authority + "/reports-srv/device/reviewlist/" + sub;
463
+ return Helper_1.Helper.createPostPromise(undefined, _serviceURL, false, "GET", access_token);
464
+ };
465
+ ;
466
+ /**
467
+ * review device
468
+ * @param options
469
+ * @param access_token
470
+ * @returns
471
+ */
472
+ WebAuth.prototype.reviewDevice = function (options, access_token) {
473
+ var _serviceURL = window.webAuthSettings.authority + "/reports-srv/device/updatereview";
474
+ return Helper_1.Helper.createPostPromise(options, _serviceURL, false, "PUT", access_token);
475
+ };
476
+ ;
477
+ /**
478
+ * get device info
479
+ * @returns
480
+ */
481
+ WebAuth.prototype.getDeviceInfo = function () {
482
+ var _this = this;
483
+ return new Promise(function (resolve, reject) {
484
+ try {
485
+ var value = ('; ' + document.cookie).split("; cidaas_dr=").pop().split(';')[0];
486
+ var options = { userAgent: "" };
487
+ if (!value) {
488
+ (function () { return __awaiter(_this, void 0, void 0, function () {
489
+ var http, _serviceURL;
490
+ return __generator(this, function (_a) {
491
+ options.userAgent = window.navigator.userAgent;
492
+ http = new XMLHttpRequest();
493
+ _serviceURL = window.webAuthSettings.authority + "/device-srv/deviceinfo";
494
+ http.onreadystatechange = function () {
495
+ if (http.readyState == 4) {
496
+ resolve(JSON.parse(http.responseText));
497
+ }
498
+ };
499
+ http.open("POST", _serviceURL, true);
500
+ http.setRequestHeader("Content-type", "application/json");
501
+ if (window.localeSettings) {
502
+ http.setRequestHeader("accept-language", window.localeSettings);
503
+ }
504
+ http.send(JSON.stringify(options));
505
+ return [2 /*return*/];
506
+ });
507
+ }); })();
508
+ }
509
+ }
510
+ catch (ex) {
511
+ reject(ex);
512
+ }
513
+ });
514
+ };
515
+ ;
516
+ /**
517
+ * get user info
518
+ * @param options
519
+ * @returns
520
+ */
521
+ WebAuth.prototype.getUserProfile = function (options) {
522
+ return UserService_1.UserService.getUserProfile(options);
523
+ };
524
+ ;
525
+ /**
526
+ * renew token using refresh token
527
+ * @param options
528
+ * @returns
529
+ */
530
+ WebAuth.prototype.renewToken = function (options) {
531
+ return TokenService_1.TokenService.renewToken(options);
532
+ };
533
+ ;
534
+ /**
535
+ * get access token from code
536
+ * @param options
537
+ * @returns
538
+ */
539
+ WebAuth.prototype.getAccessToken = function (options) {
540
+ return TokenService_1.TokenService.getAccessToken(options);
541
+ };
542
+ ;
543
+ /**
544
+ * validate access token
545
+ * @param options
546
+ * @returns
547
+ */
548
+ WebAuth.prototype.validateAccessToken = function (options) {
549
+ return TokenService_1.TokenService.validateAccessToken(options);
550
+ };
551
+ ;
552
+ /**
553
+ * login with username and password
554
+ * @param options
555
+ */
556
+ WebAuth.prototype.loginWithCredentials = function (options) {
557
+ LoginService_1.LoginService.loginWithCredentials(options);
558
+ };
559
+ ;
560
+ /**
561
+ * login with username and password and return response
562
+ * @param options
563
+ * @returns
564
+ */
565
+ WebAuth.prototype.loginWithCredentialsAsynFn = function (options) {
566
+ return __awaiter(this, void 0, void 0, function () {
567
+ return __generator(this, function (_a) {
568
+ switch (_a.label) {
569
+ case 0: return [4 /*yield*/, LoginService_1.LoginService.loginWithCredentialsAsynFn(options)];
570
+ case 1:
571
+ _a.sent();
572
+ return [2 /*return*/];
573
+ }
574
+ });
575
+ });
576
+ };
577
+ ;
578
+ /**
579
+ * login with social
580
+ * @param options
581
+ * @param queryParams
582
+ */
583
+ WebAuth.prototype.loginWithSocial = function (options, queryParams) {
584
+ LoginService_1.LoginService.loginWithSocial(options, queryParams);
585
+ };
586
+ ;
587
+ /**
588
+ * register with social
589
+ * @param options
590
+ * @param queryParams
591
+ */
592
+ WebAuth.prototype.registerWithSocial = function (options, queryParams) {
593
+ LoginService_1.LoginService.registerWithSocial(options, queryParams);
594
+ };
595
+ ;
596
+ /**
597
+ * register user
598
+ * @param options
599
+ * @param headers
600
+ * @returns
601
+ */
602
+ WebAuth.prototype.register = function (options, headers) {
603
+ return UserService_1.UserService.register(options, headers);
604
+ };
605
+ ;
606
+ /**
607
+ * get invite info
608
+ * @param options
609
+ * @returns
610
+ */
611
+ WebAuth.prototype.getInviteUserDetails = function (options) {
612
+ return UserService_1.UserService.getInviteUserDetails(options);
613
+ };
614
+ ;
615
+ /**
616
+ * get Communication status
617
+ * @param options
618
+ * @returns
619
+ */
620
+ WebAuth.prototype.getCommunicationStatus = function (options) {
621
+ return UserService_1.UserService.getCommunicationStatus(options);
622
+ };
623
+ ;
624
+ /**
625
+ * initiate verification
626
+ * @param options
627
+ * @returns
628
+ */
629
+ WebAuth.prototype.initiateAccountVerification = function (options) {
630
+ VerificationService_1.VerificationService.initiateAccountVerification(options);
631
+ };
632
+ ;
633
+ /**
634
+ * initiate verification and return response
635
+ * @param options
636
+ * @returns
637
+ */
638
+ WebAuth.prototype.initiateAccountVerificationAsynFn = function (options) {
639
+ return __awaiter(this, void 0, void 0, function () {
640
+ return __generator(this, function (_a) {
641
+ switch (_a.label) {
642
+ case 0: return [4 /*yield*/, VerificationService_1.VerificationService.initiateAccountVerificationAsynFn(options)];
643
+ case 1: return [2 /*return*/, _a.sent()];
644
+ }
645
+ });
646
+ });
647
+ };
648
+ ;
649
+ /**
650
+ * verify account
651
+ * @param options
652
+ * @returns
653
+ */
654
+ WebAuth.prototype.verifyAccount = function (options) {
655
+ return VerificationService_1.VerificationService.verifyAccount(options);
656
+ };
657
+ ;
658
+ /**
659
+ * initiate reset password
660
+ * @param options
661
+ * @returns
662
+ */
663
+ WebAuth.prototype.initiateResetPassword = function (options) {
664
+ return UserService_1.UserService.initiateResetPassword(options);
665
+ };
666
+ ;
667
+ /**
668
+ * handle reset password
669
+ * @param options
670
+ */
671
+ WebAuth.prototype.handleResetPassword = function (options) {
672
+ return UserService_1.UserService.handleResetPassword(options);
673
+ };
674
+ ;
675
+ /**
676
+ * reset password
677
+ * @param options
678
+ */
679
+ WebAuth.prototype.resetPassword = function (options) {
680
+ return UserService_1.UserService.resetPassword(options);
681
+ };
682
+ ;
683
+ /**
684
+ * get mfa list v2
685
+ * @param options
686
+ * @returns
687
+ */
688
+ WebAuth.prototype.getMFAListV2 = function (options) {
689
+ return VerificationService_1.VerificationService.getMFAListV2(options);
690
+ };
691
+ ;
692
+ /**
693
+ * cancel mfa v2
694
+ * @param options
695
+ * @returns
696
+ */
697
+ WebAuth.prototype.cancelMFAV2 = function (options) {
698
+ return VerificationService_1.VerificationService.cancelMFAV2(options);
699
+ };
700
+ ;
701
+ /**
702
+ * passwordless login
703
+ * @param options
704
+ */
705
+ WebAuth.prototype.passwordlessLogin = function (options) {
706
+ LoginService_1.LoginService.passwordlessLogin(options);
707
+ };
708
+ ;
709
+ /**
710
+ * get user consent details
711
+ * @param options
712
+ * @returns
713
+ */
714
+ WebAuth.prototype.getConsentDetailsV2 = function (options) {
715
+ return ConsentService_1.ConsentService.getConsentDetailsV2(options);
716
+ };
717
+ ;
718
+ /**
719
+ * accept consent v2
720
+ * @param options
721
+ * @returns
722
+ */
723
+ WebAuth.prototype.acceptConsentV2 = function (options) {
724
+ return ConsentService_1.ConsentService.acceptConsentV2(options);
725
+ };
726
+ ;
727
+ /**
728
+ * get scope consent details
729
+ * @param options
730
+ * @returns
731
+ */
732
+ WebAuth.prototype.getScopeConsentDetails = function (options) {
733
+ return TokenService_1.TokenService.getScopeConsentDetails(options);
734
+ };
735
+ ;
736
+ /**
737
+ * get scope consent version details
738
+ * @param options
739
+ * @returns
740
+ */
741
+ WebAuth.prototype.getScopeConsentVersionDetailsV2 = function (options) {
742
+ return ConsentService_1.ConsentService.getScopeConsentVersionDetailsV2(options);
743
+ };
744
+ ;
745
+ /**
746
+ * accept scope Consent
747
+ * @param options
748
+ * @returns
749
+ */
750
+ WebAuth.prototype.acceptScopeConsent = function (options) {
751
+ return ConsentService_1.ConsentService.acceptScopeConsent(options);
752
+ };
753
+ ;
754
+ /**
755
+ * scope consent continue login
756
+ * @param options
757
+ */
758
+ WebAuth.prototype.scopeConsentContinue = function (options) {
759
+ LoginService_1.LoginService.scopeConsentContinue(options);
760
+ };
761
+ ;
762
+ /**
763
+ * accept claim Consent
764
+ * @param options
765
+ * @returns
766
+ */
767
+ WebAuth.prototype.acceptClaimConsent = function (options) {
768
+ return ConsentService_1.ConsentService.acceptClaimConsent(options);
769
+ };
770
+ ;
771
+ /**
772
+ * claim consent continue login
773
+ * @param options
774
+ */
775
+ WebAuth.prototype.claimConsentContinue = function (options) {
776
+ LoginService_1.LoginService.claimConsentContinue(options);
777
+ };
778
+ ;
779
+ /**
780
+ * revoke claim Consent
781
+ * @param options
782
+ * @returns
783
+ */
784
+ WebAuth.prototype.revokeClaimConsent = function (options) {
785
+ return ConsentService_1.ConsentService.revokeClaimConsent(options);
786
+ };
787
+ ;
788
+ /**
789
+ * get Deduplication details
790
+ * @param options
791
+ * @returns
792
+ */
793
+ WebAuth.prototype.getDeduplicationDetails = function (options) {
794
+ return UserService_1.UserService.getDeduplicationDetails(options);
795
+ };
796
+ ;
797
+ /**
798
+ * deduplication login
799
+ * @param options
800
+ */
801
+ WebAuth.prototype.deduplicationLogin = function (options) {
802
+ UserService_1.UserService.deduplicationLogin(options);
803
+ };
804
+ ;
805
+ /**
806
+ * register Deduplication
807
+ * @param options
808
+ * @returns
809
+ */
810
+ WebAuth.prototype.registerDeduplication = function (options) {
811
+ return UserService_1.UserService.registerDeduplication(options);
812
+ };
813
+ ;
814
+ /**
815
+ * accepts any as the request
816
+ * consent continue login
817
+ * @param options
818
+ */
819
+ WebAuth.prototype.consentContinue = function (options) {
820
+ LoginService_1.LoginService.consentContinue(options);
821
+ };
822
+ ;
823
+ /**
824
+ * mfa continue login
825
+ * @param options
826
+ */
827
+ WebAuth.prototype.mfaContinue = function (options) {
828
+ LoginService_1.LoginService.mfaContinue(options);
829
+ };
830
+ ;
831
+ /**
832
+ * change password continue
833
+ * @param options
834
+ */
835
+ WebAuth.prototype.firstTimeChangePassword = function (options) {
836
+ LoginService_1.LoginService.firstTimeChangePassword(options);
837
+ };
838
+ ;
839
+ /**
840
+ * change password
841
+ * @param options
842
+ * @param access_token
843
+ * @returns
844
+ */
845
+ WebAuth.prototype.changePassword = function (options, access_token) {
846
+ return UserService_1.UserService.changePassword(options, access_token);
847
+ };
848
+ ;
849
+ /**
850
+ * update profile
851
+ * @param options
852
+ * @param access_token
853
+ * @param sub
854
+ * @returns
855
+ */
856
+ WebAuth.prototype.updateProfile = function (options, access_token, sub) {
857
+ return UserService_1.UserService.updateProfile(options, access_token, sub);
858
+ };
859
+ ;
860
+ /**
861
+ * get user activities
862
+ * @param options
863
+ * @param access_token
864
+ * @returns
865
+ */
866
+ WebAuth.prototype.getUserActivities = function (options, access_token) {
867
+ var _serviceURL = window.webAuthSettings.authority + "/useractivity-srv/latestactivity";
868
+ return Helper_1.Helper.createPostPromise(options, _serviceURL, false, "POST", access_token);
869
+ };
870
+ ;
871
+ /**
872
+ * @param access_token
873
+ * @returns
874
+ */
875
+ WebAuth.prototype.getAllVerificationList = function (access_token) {
876
+ return VerificationService_1.VerificationService.getAllVerificationList(access_token);
877
+ };
878
+ ;
879
+ /**
880
+ * initiate link accoount
881
+ * @param options
882
+ * @param access_token
883
+ * @returns
884
+ */
885
+ WebAuth.prototype.initiateLinkAccount = function (options, access_token) {
886
+ return UserService_1.UserService.initiateLinkAccount(options, access_token);
887
+ };
888
+ ;
889
+ /**
890
+ * complete link accoount
891
+ * @param options
892
+ * @param access_token
893
+ * @returns
894
+ */
895
+ WebAuth.prototype.completeLinkAccount = function (options, access_token) {
896
+ return UserService_1.UserService.completeLinkAccount(options, access_token);
897
+ };
898
+ ;
899
+ /**
900
+ * get linked users
901
+ * @param access_token
902
+ * @param sub
903
+ * @returns
904
+ */
905
+ WebAuth.prototype.getLinkedUsers = function (access_token, sub) {
906
+ return UserService_1.UserService.getLinkedUsers(access_token, sub);
907
+ };
908
+ ;
909
+ /**
910
+ * unlink accoount
911
+ * @param access_token
912
+ * @param identityId
913
+ * @returns
914
+ */
915
+ WebAuth.prototype.unlinkAccount = function (access_token, identityId) {
916
+ return UserService_1.UserService.unlinkAccount(access_token, identityId);
917
+ };
918
+ ;
919
+ /**
920
+ * image upload
921
+ * @param options
922
+ * @param access_token
923
+ * @returns
924
+ */
925
+ WebAuth.prototype.updateProfileImage = function (options, access_token) {
926
+ var _serviceURL = window.webAuthSettings.authority + "/image-srv/profile/upload";
927
+ return Helper_1.Helper.createPostPromise(options, _serviceURL, false, "POST", access_token);
928
+ };
929
+ ;
930
+ /**
931
+ * updateSuggestMFA
932
+ * @param track_id
933
+ * @param options
934
+ * @returns
935
+ */
936
+ WebAuth.prototype.updateSuggestMFA = function (track_id, options) {
937
+ return TokenService_1.TokenService.updateSuggestMFA(track_id, options);
938
+ };
939
+ ;
940
+ /**
941
+ * enrollVerification
942
+ * @param options
943
+ * @returns
944
+ */
945
+ WebAuth.prototype.enrollVerification = function (options) {
946
+ return VerificationService_1.VerificationService.enrollVerification(options);
947
+ };
948
+ ;
949
+ /**
950
+ * @deprecated This function is no longer supported, instead use {this.updateStatus()}
951
+ * @param status_id
952
+ * @returns
953
+ */
954
+ WebAuth.prototype.updateSocket = function (status_id) {
955
+ return VerificationService_1.VerificationService.updateStatus(status_id);
956
+ };
957
+ ;
958
+ /**
959
+ * update the status of notification
960
+ * @param status_id
961
+ * @returns
962
+ */
963
+ WebAuth.prototype.updateStatus = function (status_id) {
964
+ return VerificationService_1.VerificationService.updateStatus(status_id);
965
+ };
966
+ ;
967
+ /**
968
+ * setupFidoVerification
969
+ * @param options
970
+ * @returns
971
+ */
972
+ WebAuth.prototype.setupFidoVerification = function (options) {
973
+ return VerificationService_1.VerificationService.setupFidoVerification(options);
974
+ };
975
+ ;
976
+ /**
977
+ * checkVerificationTypeConfigured
978
+ * @param options
979
+ * @returns
980
+ */
981
+ WebAuth.prototype.checkVerificationTypeConfigured = function (options) {
982
+ return VerificationService_1.VerificationService.checkVerificationTypeConfigured(options);
983
+ };
984
+ ;
985
+ /**
986
+ * deleteUserAccount
987
+ * @param options
988
+ * @returns
989
+ */
990
+ WebAuth.prototype.deleteUserAccount = function (options) {
991
+ return UserService_1.UserService.deleteUserAccount(options);
992
+ };
993
+ ;
994
+ /**
995
+ * getMissingFieldsLogin
996
+ * @param trackId
997
+ * @returns
998
+ */
999
+ WebAuth.prototype.getMissingFieldsLogin = function (trackId) {
1000
+ return TokenService_1.TokenService.getMissingFieldsLogin(trackId);
1001
+ };
1002
+ ;
1003
+ /**
1004
+ * progressiveRegistration
1005
+ * @param options
1006
+ * @param headers
1007
+ * @returns
1008
+ */
1009
+ WebAuth.prototype.progressiveRegistration = function (options, headers) {
1010
+ return LoginService_1.LoginService.progressiveRegistration(options, headers);
1011
+ };
1012
+ ;
1013
+ /**
1014
+ * loginAfterRegister
1015
+ * @param options
1016
+ */
1017
+ WebAuth.prototype.loginAfterRegister = function (options) {
1018
+ LoginService_1.LoginService.loginAfterRegister(options);
1019
+ };
1020
+ ;
1021
+ /**
1022
+ * device code flow - verify
1023
+ * @param code
1024
+ */
1025
+ WebAuth.prototype.deviceCodeVerify = function (code) {
1026
+ TokenService_1.TokenService.deviceCodeVerify(code);
1027
+ };
1028
+ /**
1029
+ * check if an user exists
1030
+ * @param options
1031
+ * @returns
1032
+ */
1033
+ WebAuth.prototype.userCheckExists = function (options) {
1034
+ return UserService_1.UserService.userCheckExists(options);
1035
+ };
1036
+ ;
1037
+ /**
1038
+ * To set accept language
1039
+ * @param acceptLanguage
1040
+ */
1041
+ WebAuth.prototype.setAcceptLanguageHeader = function (acceptLanguage) {
1042
+ window.localeSettings = acceptLanguage;
1043
+ };
1044
+ /**
1045
+ * initiate mfa v2
1046
+ * @param options
1047
+ * @returns
1048
+ */
1049
+ WebAuth.prototype.initiateMFAV2 = function (options) {
1050
+ return VerificationService_1.VerificationService.initiateMFAV2(options);
1051
+ };
1052
+ ;
1053
+ /**
1054
+ * initiateVerification
1055
+ * @param options
1056
+ */
1057
+ WebAuth.prototype.initiateVerification = function (options) {
1058
+ options.type = options.verification_type;
1059
+ this.initiateMFAV2(options);
1060
+ };
1061
+ ;
1062
+ /**
1063
+ * initiate email v2
1064
+ * @param options
1065
+ */
1066
+ WebAuth.prototype.initiateEmailV2 = function (options) {
1067
+ options.type = "email";
1068
+ this.initiateMFAV2(options);
1069
+ };
1070
+ ;
1071
+ /**
1072
+ * initiate sms v2
1073
+ * @param options
1074
+ */
1075
+ WebAuth.prototype.initiateSMSV2 = function (options) {
1076
+ options.type = "sms";
1077
+ this.initiateMFAV2(options);
1078
+ };
1079
+ ;
1080
+ /**
1081
+ * initiate ivr v2
1082
+ * @param options
1083
+ */
1084
+ WebAuth.prototype.initiateIVRV2 = function (options) {
1085
+ options.type = "ivr";
1086
+ this.initiateMFAV2(options);
1087
+ };
1088
+ ;
1089
+ /**
1090
+ * initiate backupcode v2
1091
+ * @param options
1092
+ */
1093
+ WebAuth.prototype.initiateBackupcodeV2 = function (options) {
1094
+ options.type = "backupcode";
1095
+ this.initiateMFAV2(options);
1096
+ };
1097
+ ;
1098
+ /**
1099
+ * initiate totp v2
1100
+ * @param options
1101
+ */
1102
+ WebAuth.prototype.initiateTOTPV2 = function (options) {
1103
+ options.type = "totp";
1104
+ this.initiateMFAV2(options);
1105
+ };
1106
+ ;
1107
+ /**
1108
+ * initiate pattern v2
1109
+ * @param options
1110
+ */
1111
+ WebAuth.prototype.initiatePatternV2 = function (options) {
1112
+ options.type = "pattern";
1113
+ this.initiateMFAV2(options);
1114
+ };
1115
+ ;
1116
+ /**
1117
+ * initiate touchid v2
1118
+ * @param options
1119
+ */
1120
+ WebAuth.prototype.initiateTouchIdV2 = function (options) {
1121
+ options.type = "touchid";
1122
+ this.initiateMFAV2(options);
1123
+ };
1124
+ ;
1125
+ /**
1126
+ * initiate smart push v2
1127
+ * @param options
1128
+ */
1129
+ WebAuth.prototype.initiateSmartPushV2 = function (options) {
1130
+ options.type = "push";
1131
+ this.initiateMFAV2(options);
1132
+ };
1133
+ ;
1134
+ /**
1135
+ * initiate face v2
1136
+ * @param options
1137
+ */
1138
+ WebAuth.prototype.initiateFaceV2 = function (options) {
1139
+ options.type = "face";
1140
+ this.initiateMFAV2(options);
1141
+ };
1142
+ ;
1143
+ /**
1144
+ * initiate voice v2
1145
+ * @param options
1146
+ */
1147
+ WebAuth.prototype.initiateVoiceV2 = function (options) {
1148
+ options.type = "voice";
1149
+ this.initiateMFAV2(options);
1150
+ };
1151
+ ;
1152
+ /**
1153
+ * @deprecated
1154
+ * @param options
1155
+ * @param verificationType
1156
+ * @returns
1157
+ */
1158
+ WebAuth.prototype.initiateMfaV1 = function (options, verificationType) {
1159
+ return VerificationService_1.VerificationService.initiateMfaV1(options, verificationType);
1160
+ };
1161
+ /**
1162
+ * @deprecated
1163
+ * initiate email - v1
1164
+ * @param options
1165
+ */
1166
+ WebAuth.prototype.initiateEmail = function (options) {
1167
+ var verificationType = "EMAIL";
1168
+ this.initiateMfaV1(options, verificationType);
1169
+ };
1170
+ ;
1171
+ /**
1172
+ * @deprecated
1173
+ * initiate SMS - v1
1174
+ * @param options
1175
+ */
1176
+ WebAuth.prototype.initiateSMS = function (options) {
1177
+ var verificationType = "SMS";
1178
+ this.initiateMfaV1(options, verificationType);
1179
+ };
1180
+ ;
1181
+ /**
1182
+ * @deprecated
1183
+ * initiate IVR - v1
1184
+ * @param options
1185
+ */
1186
+ WebAuth.prototype.initiateIVR = function (options) {
1187
+ var verificationType = "IVR";
1188
+ this.initiateMfaV1(options, verificationType);
1189
+ };
1190
+ ;
1191
+ /**
1192
+ * @deprecated
1193
+ * initiate backup code - v1
1194
+ * @param options
1195
+ */
1196
+ WebAuth.prototype.initiateBackupcode = function (options) {
1197
+ var verificationType = "BACKUPCODE";
1198
+ this.initiateMfaV1(options, verificationType);
1199
+ };
1200
+ ;
1201
+ /**
1202
+ * @deprecated
1203
+ * initiate TOTP - v1
1204
+ * @param options
1205
+ */
1206
+ WebAuth.prototype.initiateTOTP = function (options) {
1207
+ var verificationType = "TOTP";
1208
+ this.initiateMfaV1(options, verificationType);
1209
+ };
1210
+ ;
1211
+ /**
1212
+ * @deprecated
1213
+ * initiate pattern - v1
1214
+ * @param options
1215
+ */
1216
+ WebAuth.prototype.initiatePattern = function (options) {
1217
+ var verificationType = "PATTERN";
1218
+ this.initiateMfaV1(options, verificationType);
1219
+ };
1220
+ ;
1221
+ /**
1222
+ * @deprecated
1223
+ * initiate touchid - v1
1224
+ * @param options
1225
+ */
1226
+ WebAuth.prototype.initiateTouchId = function (options) {
1227
+ var verificationType = "TOUCHID";
1228
+ this.initiateMfaV1(options, verificationType);
1229
+ };
1230
+ ;
1231
+ /**
1232
+ * @deprecated
1233
+ * initiate push - v1
1234
+ * @param options
1235
+ */ WebAuth.prototype.initiateSmartPush = function (options) {
1236
+ var verificationType = "PUSH";
1237
+ this.initiateMfaV1(options, verificationType);
1238
+ };
1239
+ ;
1240
+ /**
1241
+ * @deprecated
1242
+ * initiate face - v1
1243
+ * @param options
1244
+ */
1245
+ WebAuth.prototype.initiateFace = function (options) {
1246
+ var verificationType = "FACE";
1247
+ this.initiateMfaV1(options, verificationType);
1248
+ };
1249
+ ;
1250
+ /**
1251
+ * @deprecated
1252
+ * initiate Voice - v1
1253
+ * @param options
1254
+ */
1255
+ WebAuth.prototype.initiateVoice = function (options) {
1256
+ var verificationType = "VOICE";
1257
+ this.initiateMfaV1(options, verificationType);
1258
+ };
1259
+ ;
1260
+ /**
1261
+ * authenticate mfa v2
1262
+ * @param options
1263
+ * @returns
1264
+ */
1265
+ WebAuth.prototype.authenticateMFAV2 = function (options) {
1266
+ return VerificationService_1.VerificationService.authenticateMFAV2(options);
1267
+ };
1268
+ ;
1269
+ /**
1270
+ * authenticateVerification
1271
+ * @param options
1272
+ */
1273
+ WebAuth.prototype.authenticateVerification = function (options) {
1274
+ options.type = options.verification_type;
1275
+ this.authenticateMFAV2(options);
1276
+ };
1277
+ ;
1278
+ /**
1279
+ * authenticate email v2
1280
+ * @param options
1281
+ */
1282
+ WebAuth.prototype.authenticateEmailV2 = function (options) {
1283
+ options.type = "email";
1284
+ this.authenticateMFAV2(options);
1285
+ };
1286
+ ;
1287
+ /**
1288
+ * authenticate sms v2
1289
+ * @param options
1290
+ */
1291
+ WebAuth.prototype.authenticateSMSV2 = function (options) {
1292
+ options.type = "sms";
1293
+ this.authenticateMFAV2(options);
1294
+ };
1295
+ ;
1296
+ /**
1297
+ * authenticate ivr v2
1298
+ * @param options
1299
+ */
1300
+ WebAuth.prototype.authenticateIVRV2 = function (options) {
1301
+ options.type = "ivr";
1302
+ this.authenticateMFAV2(options);
1303
+ };
1304
+ ;
1305
+ /**
1306
+ * authenticate backupcode v2
1307
+ * @param options
1308
+ */
1309
+ WebAuth.prototype.authenticateBackupcodeV2 = function (options) {
1310
+ options.type = "backupcode";
1311
+ this.authenticateMFAV2(options);
1312
+ };
1313
+ ;
1314
+ /**
1315
+ * authenticate totp v2
1316
+ * @param options
1317
+ */
1318
+ WebAuth.prototype.authenticateTOTPV2 = function (options) {
1319
+ options.type = "totp";
1320
+ this.authenticateMFAV2(options);
1321
+ };
1322
+ ;
1323
+ /**
1324
+ * authenticateVerification form type (for face)
1325
+ * @param options
1326
+ * @returns
1327
+ */
1328
+ WebAuth.prototype.authenticateFaceVerification = function (options) {
1329
+ return VerificationService_1.VerificationService.authenticateFaceVerification(options);
1330
+ };
1331
+ ;
1332
+ /**
1333
+ * @deprecated
1334
+ * setup verification - v1
1335
+ * @param options
1336
+ * @param access_token
1337
+ * @param verificationType
1338
+ * @returns
1339
+ */
1340
+ WebAuth.prototype.setupVerificationV1 = function (options, access_token, verificationType) {
1341
+ return VerificationService_1.VerificationService.setupVerificationV1(options, access_token, verificationType);
1342
+ };
1343
+ /**
1344
+ * @deprecated
1345
+ * setup email - v1
1346
+ * @param options
1347
+ * @param access_token
1348
+ */
1349
+ WebAuth.prototype.setupEmail = function (options, access_token) {
1350
+ var verificationType = "EMAIL";
1351
+ this.setupVerificationV1(options, access_token, verificationType);
1352
+ };
1353
+ ;
1354
+ /**
1355
+ * @deprecated
1356
+ * setup sms - v1
1357
+ * @param options
1358
+ * @param access_token
1359
+ */
1360
+ WebAuth.prototype.setupSMS = function (options, access_token) {
1361
+ var verificationType = "SMS";
1362
+ this.setupVerificationV1(options, access_token, verificationType);
1363
+ };
1364
+ ;
1365
+ /**
1366
+ * @deprecated
1367
+ * setup ivr - v1
1368
+ * @param options
1369
+ * @param access_token
1370
+ */
1371
+ WebAuth.prototype.setupIVR = function (options, access_token) {
1372
+ var verificationType = "IVR";
1373
+ this.setupVerificationV1(options, access_token, verificationType);
1374
+ };
1375
+ ;
1376
+ /**
1377
+ * @deprecated
1378
+ * setup backupcode - v1
1379
+ * @param options
1380
+ * @param access_token
1381
+ */
1382
+ WebAuth.prototype.setupBackupcode = function (options, access_token) {
1383
+ var verificationType = "BACKUPCODE";
1384
+ this.setupVerificationV1(options, access_token, verificationType);
1385
+ };
1386
+ ;
1387
+ /**
1388
+ * @deprecated
1389
+ * setup totp - v1
1390
+ * @param options
1391
+ * @param access_token
1392
+ */
1393
+ WebAuth.prototype.setupTOTP = function (options, access_token) {
1394
+ var verificationType = "TOTP";
1395
+ this.setupVerificationV1(options, access_token, verificationType);
1396
+ };
1397
+ ;
1398
+ /**
1399
+ * @deprecated
1400
+ * setup pattern - v1
1401
+ * @param options
1402
+ * @param access_token
1403
+ */
1404
+ WebAuth.prototype.setupPattern = function (options, access_token) {
1405
+ var verificationType = "PATTERN";
1406
+ this.setupVerificationV1(options, access_token, verificationType);
1407
+ };
1408
+ ;
1409
+ /**
1410
+ * @deprecated
1411
+ * setup touch - v1
1412
+ * @param options
1413
+ * @param access_token
1414
+ */
1415
+ WebAuth.prototype.setupTouchId = function (options, access_token) {
1416
+ var verificationType = "TOUCHID";
1417
+ this.setupVerificationV1(options, access_token, verificationType);
1418
+ };
1419
+ ;
1420
+ /**
1421
+ * @deprecated
1422
+ * setup smart push - v1
1423
+ * @param options
1424
+ * @param access_token
1425
+ */
1426
+ WebAuth.prototype.setupSmartPush = function (options, access_token) {
1427
+ var verificationType = "PUSH";
1428
+ this.setupVerificationV1(options, access_token, verificationType);
1429
+ };
1430
+ ;
1431
+ /**
1432
+ * @deprecated
1433
+ * setup face - v1
1434
+ * @param options
1435
+ * @param access_token
1436
+ */
1437
+ WebAuth.prototype.setupFace = function (options, access_token) {
1438
+ var verificationType = "FACE";
1439
+ this.setupVerificationV1(options, access_token, verificationType);
1440
+ };
1441
+ ;
1442
+ /**
1443
+ * @deprecated
1444
+ * setup voice - v1
1445
+ * @param options
1446
+ * @param access_token
1447
+ */
1448
+ WebAuth.prototype.setupVoice = function (options, access_token) {
1449
+ var verificationType = "VOICE";
1450
+ this.setupVerificationV1(options, access_token, verificationType);
1451
+ };
1452
+ ;
1453
+ /**
1454
+ * @deprecated
1455
+ * enroll verification - v1
1456
+ * @param options
1457
+ * @param access_token
1458
+ * @param verificationType
1459
+ * @returns
1460
+ */
1461
+ WebAuth.prototype.enrollVerificationV1 = function (options, access_token, verificationType) {
1462
+ return VerificationService_1.VerificationService.enrollVerificationV1(options, access_token, verificationType);
1463
+ };
1464
+ /**
1465
+ * @deprecated
1466
+ * enroll email - v1
1467
+ * @param options
1468
+ * @param access_token
1469
+ */
1470
+ WebAuth.prototype.enrollEmail = function (options, access_token) {
1471
+ var verificationType = "EMAIL";
1472
+ this.enrollVerificationV1(options, access_token, verificationType);
1473
+ };
1474
+ ;
1475
+ /**
1476
+ * @deprecated
1477
+ * enroll SMS - v1
1478
+ * @param options
1479
+ * @param access_token
1480
+ */
1481
+ WebAuth.prototype.enrollSMS = function (options, access_token) {
1482
+ var verificationType = "SMS";
1483
+ this.enrollVerificationV1(options, access_token, verificationType);
1484
+ };
1485
+ ;
1486
+ /**
1487
+ * @deprecated
1488
+ * enroll IVR - v1
1489
+ * @param options
1490
+ * @param access_token
1491
+ */
1492
+ WebAuth.prototype.enrollIVR = function (options, access_token) {
1493
+ var verificationType = "IVR";
1494
+ this.enrollVerificationV1(options, access_token, verificationType);
1495
+ };
1496
+ ;
1497
+ /**
1498
+ * @deprecated
1499
+ * enroll TOTP - v1
1500
+ * @param options
1501
+ * @param access_token
1502
+ */
1503
+ WebAuth.prototype.enrollTOTP = function (options, access_token) {
1504
+ var verificationType = "TOTP";
1505
+ this.enrollVerificationV1(options, access_token, verificationType);
1506
+ };
1507
+ ;
1508
+ /**
1509
+ * @deprecated
1510
+ * authenticate mfa - v1
1511
+ * @param verificationType
1512
+ * @returns
1513
+ */
1514
+ WebAuth.prototype.authenticateMfaV1 = function (options, verificationType) {
1515
+ return VerificationService_1.VerificationService.authenticateMfaV1(options, verificationType);
1516
+ };
1517
+ /**
1518
+ * @deprecated
1519
+ * authenticate email - v1
1520
+ * @param options
1521
+ */
1522
+ WebAuth.prototype.authenticateEmail = function (options) {
1523
+ var verificationType = "EMAIL";
1524
+ this.authenticateMfaV1(options, verificationType);
1525
+ };
1526
+ ;
1527
+ /**
1528
+ * @deprecated
1529
+ * authenticate sms - v1
1530
+ * @param options
1531
+ */
1532
+ WebAuth.prototype.authenticateSMS = function (options) {
1533
+ var verificationType = "SMS";
1534
+ this.authenticateMfaV1(options, verificationType);
1535
+ };
1536
+ ;
1537
+ /**
1538
+ * @deprecated
1539
+ * authenticate ivr - v1
1540
+ * @param options
1541
+ */
1542
+ WebAuth.prototype.authenticateIVR = function (options) {
1543
+ var verificationType = "IVR";
1544
+ this.authenticateMfaV1(options, verificationType);
1545
+ };
1546
+ ;
1547
+ /**
1548
+ * @deprecated
1549
+ * authenticate totp - v1
1550
+ * @param options
1551
+ */
1552
+ WebAuth.prototype.authenticateTOTP = function (options) {
1553
+ var verificationType = "TOTP";
1554
+ this.authenticateMfaV1(options, verificationType);
1555
+ };
1556
+ ;
1557
+ /**
1558
+ * @deprecated
1559
+ * authenticate backupcode - v1
1560
+ * @param options
1561
+ */
1562
+ WebAuth.prototype.authenticateBackupcode = function (options) {
1563
+ var verificationType = "BACKUPCODE";
1564
+ this.authenticateMfaV1(options, verificationType);
1565
+ };
1566
+ ;
1567
+ return WebAuth;
1568
+ }());
1569
+ exports.WebAuth = WebAuth;