cidaas-javascript-sdk 3.1.3 → 3.1.4

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,1570 @@
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
+ if (window.localeSettings) {
435
+ http.setRequestHeader("accept-language", window.localeSettings);
436
+ }
437
+ http.send();
438
+ }
439
+ catch (ex) {
440
+ reject(ex);
441
+ }
442
+ });
443
+ };
444
+ ;
445
+ /**
446
+ * get unreviewed devices
447
+ * @param access_token
448
+ * @param sub
449
+ * @returns
450
+ */
451
+ WebAuth.prototype.getUnreviewedDevices = function (access_token, sub) {
452
+ var _serviceURL = window.webAuthSettings.authority + "/reports-srv/device/unreviewlist/" + sub;
453
+ return Helper_1.Helper.createPostPromise(undefined, _serviceURL, false, "GET", access_token);
454
+ };
455
+ ;
456
+ /**
457
+ * get reviewed devices
458
+ * @param access_token
459
+ * @param sub
460
+ * @returns
461
+ */
462
+ WebAuth.prototype.getReviewedDevices = function (access_token, sub) {
463
+ var _serviceURL = window.webAuthSettings.authority + "/reports-srv/device/reviewlist/" + sub;
464
+ return Helper_1.Helper.createPostPromise(undefined, _serviceURL, false, "GET", access_token);
465
+ };
466
+ ;
467
+ /**
468
+ * review device
469
+ * @param options
470
+ * @param access_token
471
+ * @returns
472
+ */
473
+ WebAuth.prototype.reviewDevice = function (options, access_token) {
474
+ var _serviceURL = window.webAuthSettings.authority + "/reports-srv/device/updatereview";
475
+ return Helper_1.Helper.createPostPromise(options, _serviceURL, false, "PUT", access_token);
476
+ };
477
+ ;
478
+ /**
479
+ * get device info
480
+ * @returns
481
+ */
482
+ WebAuth.prototype.getDeviceInfo = function () {
483
+ var _this = this;
484
+ return new Promise(function (resolve, reject) {
485
+ try {
486
+ var value = ('; ' + document.cookie).split("; cidaas_dr=").pop().split(';')[0];
487
+ var options = { userAgent: "" };
488
+ if (!value) {
489
+ (function () { return __awaiter(_this, void 0, void 0, function () {
490
+ var http, _serviceURL;
491
+ return __generator(this, function (_a) {
492
+ options.userAgent = window.navigator.userAgent;
493
+ http = new XMLHttpRequest();
494
+ _serviceURL = window.webAuthSettings.authority + "/device-srv/deviceinfo";
495
+ http.onreadystatechange = function () {
496
+ if (http.readyState == 4) {
497
+ resolve(JSON.parse(http.responseText));
498
+ }
499
+ };
500
+ http.open("POST", _serviceURL, true);
501
+ http.setRequestHeader("Content-type", "application/json");
502
+ if (window.localeSettings) {
503
+ http.setRequestHeader("accept-language", window.localeSettings);
504
+ }
505
+ http.send(JSON.stringify(options));
506
+ return [2 /*return*/];
507
+ });
508
+ }); })();
509
+ }
510
+ }
511
+ catch (ex) {
512
+ reject(ex);
513
+ }
514
+ });
515
+ };
516
+ ;
517
+ /**
518
+ * get user info
519
+ * @param options
520
+ * @returns
521
+ */
522
+ WebAuth.prototype.getUserProfile = function (options) {
523
+ return UserService_1.UserService.getUserProfile(options);
524
+ };
525
+ ;
526
+ /**
527
+ * renew token using refresh token
528
+ * @param options
529
+ * @returns
530
+ */
531
+ WebAuth.prototype.renewToken = function (options) {
532
+ return TokenService_1.TokenService.renewToken(options);
533
+ };
534
+ ;
535
+ /**
536
+ * get access token from code
537
+ * @param options
538
+ * @returns
539
+ */
540
+ WebAuth.prototype.getAccessToken = function (options) {
541
+ return TokenService_1.TokenService.getAccessToken(options);
542
+ };
543
+ ;
544
+ /**
545
+ * validate access token
546
+ * @param options
547
+ * @returns
548
+ */
549
+ WebAuth.prototype.validateAccessToken = function (options) {
550
+ return TokenService_1.TokenService.validateAccessToken(options);
551
+ };
552
+ ;
553
+ /**
554
+ * login with username and password
555
+ * @param options
556
+ */
557
+ WebAuth.prototype.loginWithCredentials = function (options) {
558
+ LoginService_1.LoginService.loginWithCredentials(options);
559
+ };
560
+ ;
561
+ /**
562
+ * login with username and password and return response
563
+ * @param options
564
+ * @returns
565
+ */
566
+ WebAuth.prototype.loginWithCredentialsAsynFn = function (options) {
567
+ return __awaiter(this, void 0, void 0, function () {
568
+ return __generator(this, function (_a) {
569
+ switch (_a.label) {
570
+ case 0: return [4 /*yield*/, LoginService_1.LoginService.loginWithCredentialsAsynFn(options)];
571
+ case 1:
572
+ _a.sent();
573
+ return [2 /*return*/];
574
+ }
575
+ });
576
+ });
577
+ };
578
+ ;
579
+ /**
580
+ * login with social
581
+ * @param options
582
+ * @param queryParams
583
+ */
584
+ WebAuth.prototype.loginWithSocial = function (options, queryParams) {
585
+ LoginService_1.LoginService.loginWithSocial(options, queryParams);
586
+ };
587
+ ;
588
+ /**
589
+ * register with social
590
+ * @param options
591
+ * @param queryParams
592
+ */
593
+ WebAuth.prototype.registerWithSocial = function (options, queryParams) {
594
+ LoginService_1.LoginService.registerWithSocial(options, queryParams);
595
+ };
596
+ ;
597
+ /**
598
+ * register user
599
+ * @param options
600
+ * @param headers
601
+ * @returns
602
+ */
603
+ WebAuth.prototype.register = function (options, headers) {
604
+ return UserService_1.UserService.register(options, headers);
605
+ };
606
+ ;
607
+ /**
608
+ * get invite info
609
+ * @param options
610
+ * @returns
611
+ */
612
+ WebAuth.prototype.getInviteUserDetails = function (options) {
613
+ return UserService_1.UserService.getInviteUserDetails(options);
614
+ };
615
+ ;
616
+ /**
617
+ * get Communication status
618
+ * @param options
619
+ * @returns
620
+ */
621
+ WebAuth.prototype.getCommunicationStatus = function (options) {
622
+ return UserService_1.UserService.getCommunicationStatus(options);
623
+ };
624
+ ;
625
+ /**
626
+ * initiate verification
627
+ * @param options
628
+ * @returns
629
+ */
630
+ WebAuth.prototype.initiateAccountVerification = function (options) {
631
+ VerificationService_1.VerificationService.initiateAccountVerification(options);
632
+ };
633
+ ;
634
+ /**
635
+ * initiate verification and return response
636
+ * @param options
637
+ * @returns
638
+ */
639
+ WebAuth.prototype.initiateAccountVerificationAsynFn = function (options) {
640
+ return __awaiter(this, void 0, void 0, function () {
641
+ return __generator(this, function (_a) {
642
+ switch (_a.label) {
643
+ case 0: return [4 /*yield*/, VerificationService_1.VerificationService.initiateAccountVerificationAsynFn(options)];
644
+ case 1: return [2 /*return*/, _a.sent()];
645
+ }
646
+ });
647
+ });
648
+ };
649
+ ;
650
+ /**
651
+ * verify account
652
+ * @param options
653
+ * @returns
654
+ */
655
+ WebAuth.prototype.verifyAccount = function (options) {
656
+ return VerificationService_1.VerificationService.verifyAccount(options);
657
+ };
658
+ ;
659
+ /**
660
+ * initiate reset password
661
+ * @param options
662
+ * @returns
663
+ */
664
+ WebAuth.prototype.initiateResetPassword = function (options) {
665
+ return UserService_1.UserService.initiateResetPassword(options);
666
+ };
667
+ ;
668
+ /**
669
+ * handle reset password
670
+ * @param options
671
+ */
672
+ WebAuth.prototype.handleResetPassword = function (options) {
673
+ return UserService_1.UserService.handleResetPassword(options);
674
+ };
675
+ ;
676
+ /**
677
+ * reset password
678
+ * @param options
679
+ */
680
+ WebAuth.prototype.resetPassword = function (options) {
681
+ return UserService_1.UserService.resetPassword(options);
682
+ };
683
+ ;
684
+ /**
685
+ * get mfa list v2
686
+ * @param options
687
+ * @returns
688
+ */
689
+ WebAuth.prototype.getMFAListV2 = function (options) {
690
+ return VerificationService_1.VerificationService.getMFAListV2(options);
691
+ };
692
+ ;
693
+ /**
694
+ * cancel mfa v2
695
+ * @param options
696
+ * @returns
697
+ */
698
+ WebAuth.prototype.cancelMFAV2 = function (options) {
699
+ return VerificationService_1.VerificationService.cancelMFAV2(options);
700
+ };
701
+ ;
702
+ /**
703
+ * passwordless login
704
+ * @param options
705
+ */
706
+ WebAuth.prototype.passwordlessLogin = function (options) {
707
+ LoginService_1.LoginService.passwordlessLogin(options);
708
+ };
709
+ ;
710
+ /**
711
+ * get user consent details
712
+ * @param options
713
+ * @returns
714
+ */
715
+ WebAuth.prototype.getConsentDetailsV2 = function (options) {
716
+ return ConsentService_1.ConsentService.getConsentDetailsV2(options);
717
+ };
718
+ ;
719
+ /**
720
+ * accept consent v2
721
+ * @param options
722
+ * @returns
723
+ */
724
+ WebAuth.prototype.acceptConsentV2 = function (options) {
725
+ return ConsentService_1.ConsentService.acceptConsentV2(options);
726
+ };
727
+ ;
728
+ /**
729
+ * get scope consent details
730
+ * @param options
731
+ * @returns
732
+ */
733
+ WebAuth.prototype.getScopeConsentDetails = function (options) {
734
+ return TokenService_1.TokenService.getScopeConsentDetails(options);
735
+ };
736
+ ;
737
+ /**
738
+ * get scope consent version details
739
+ * @param options
740
+ * @returns
741
+ */
742
+ WebAuth.prototype.getScopeConsentVersionDetailsV2 = function (options) {
743
+ return ConsentService_1.ConsentService.getScopeConsentVersionDetailsV2(options);
744
+ };
745
+ ;
746
+ /**
747
+ * accept scope Consent
748
+ * @param options
749
+ * @returns
750
+ */
751
+ WebAuth.prototype.acceptScopeConsent = function (options) {
752
+ return ConsentService_1.ConsentService.acceptScopeConsent(options);
753
+ };
754
+ ;
755
+ /**
756
+ * scope consent continue login
757
+ * @param options
758
+ */
759
+ WebAuth.prototype.scopeConsentContinue = function (options) {
760
+ LoginService_1.LoginService.scopeConsentContinue(options);
761
+ };
762
+ ;
763
+ /**
764
+ * accept claim Consent
765
+ * @param options
766
+ * @returns
767
+ */
768
+ WebAuth.prototype.acceptClaimConsent = function (options) {
769
+ return ConsentService_1.ConsentService.acceptClaimConsent(options);
770
+ };
771
+ ;
772
+ /**
773
+ * claim consent continue login
774
+ * @param options
775
+ */
776
+ WebAuth.prototype.claimConsentContinue = function (options) {
777
+ LoginService_1.LoginService.claimConsentContinue(options);
778
+ };
779
+ ;
780
+ /**
781
+ * revoke claim Consent
782
+ * @param options
783
+ * @returns
784
+ */
785
+ WebAuth.prototype.revokeClaimConsent = function (options) {
786
+ return ConsentService_1.ConsentService.revokeClaimConsent(options);
787
+ };
788
+ ;
789
+ /**
790
+ * get Deduplication details
791
+ * @param options
792
+ * @returns
793
+ */
794
+ WebAuth.prototype.getDeduplicationDetails = function (options) {
795
+ return UserService_1.UserService.getDeduplicationDetails(options);
796
+ };
797
+ ;
798
+ /**
799
+ * deduplication login
800
+ * @param options
801
+ */
802
+ WebAuth.prototype.deduplicationLogin = function (options) {
803
+ UserService_1.UserService.deduplicationLogin(options);
804
+ };
805
+ ;
806
+ /**
807
+ * register Deduplication
808
+ * @param options
809
+ * @returns
810
+ */
811
+ WebAuth.prototype.registerDeduplication = function (options) {
812
+ return UserService_1.UserService.registerDeduplication(options);
813
+ };
814
+ ;
815
+ /**
816
+ * accepts any as the request
817
+ * consent continue login
818
+ * @param options
819
+ */
820
+ WebAuth.prototype.consentContinue = function (options) {
821
+ LoginService_1.LoginService.consentContinue(options);
822
+ };
823
+ ;
824
+ /**
825
+ * mfa continue login
826
+ * @param options
827
+ */
828
+ WebAuth.prototype.mfaContinue = function (options) {
829
+ LoginService_1.LoginService.mfaContinue(options);
830
+ };
831
+ ;
832
+ /**
833
+ * change password continue
834
+ * @param options
835
+ */
836
+ WebAuth.prototype.firstTimeChangePassword = function (options) {
837
+ LoginService_1.LoginService.firstTimeChangePassword(options);
838
+ };
839
+ ;
840
+ /**
841
+ * change password
842
+ * @param options
843
+ * @param access_token
844
+ * @returns
845
+ */
846
+ WebAuth.prototype.changePassword = function (options, access_token) {
847
+ return UserService_1.UserService.changePassword(options, access_token);
848
+ };
849
+ ;
850
+ /**
851
+ * update profile
852
+ * @param options
853
+ * @param access_token
854
+ * @param sub
855
+ * @returns
856
+ */
857
+ WebAuth.prototype.updateProfile = function (options, access_token, sub) {
858
+ return UserService_1.UserService.updateProfile(options, access_token, sub);
859
+ };
860
+ ;
861
+ /**
862
+ * get user activities
863
+ * @param options
864
+ * @param access_token
865
+ * @returns
866
+ */
867
+ WebAuth.prototype.getUserActivities = function (options, access_token) {
868
+ var _serviceURL = window.webAuthSettings.authority + "/useractivity-srv/latestactivity";
869
+ return Helper_1.Helper.createPostPromise(options, _serviceURL, false, "POST", access_token);
870
+ };
871
+ ;
872
+ /**
873
+ * @param access_token
874
+ * @returns
875
+ */
876
+ WebAuth.prototype.getAllVerificationList = function (access_token) {
877
+ return VerificationService_1.VerificationService.getAllVerificationList(access_token);
878
+ };
879
+ ;
880
+ /**
881
+ * initiate link accoount
882
+ * @param options
883
+ * @param access_token
884
+ * @returns
885
+ */
886
+ WebAuth.prototype.initiateLinkAccount = function (options, access_token) {
887
+ return UserService_1.UserService.initiateLinkAccount(options, access_token);
888
+ };
889
+ ;
890
+ /**
891
+ * complete link accoount
892
+ * @param options
893
+ * @param access_token
894
+ * @returns
895
+ */
896
+ WebAuth.prototype.completeLinkAccount = function (options, access_token) {
897
+ return UserService_1.UserService.completeLinkAccount(options, access_token);
898
+ };
899
+ ;
900
+ /**
901
+ * get linked users
902
+ * @param access_token
903
+ * @param sub
904
+ * @returns
905
+ */
906
+ WebAuth.prototype.getLinkedUsers = function (access_token, sub) {
907
+ return UserService_1.UserService.getLinkedUsers(access_token, sub);
908
+ };
909
+ ;
910
+ /**
911
+ * unlink accoount
912
+ * @param access_token
913
+ * @param identityId
914
+ * @returns
915
+ */
916
+ WebAuth.prototype.unlinkAccount = function (access_token, identityId) {
917
+ return UserService_1.UserService.unlinkAccount(access_token, identityId);
918
+ };
919
+ ;
920
+ /**
921
+ * image upload
922
+ * @param options
923
+ * @param access_token
924
+ * @returns
925
+ */
926
+ WebAuth.prototype.updateProfileImage = function (options, access_token) {
927
+ var _serviceURL = window.webAuthSettings.authority + "/image-srv/profile/upload";
928
+ return Helper_1.Helper.createPostPromise(options, _serviceURL, false, "POST", access_token);
929
+ };
930
+ ;
931
+ /**
932
+ * updateSuggestMFA
933
+ * @param track_id
934
+ * @param options
935
+ * @returns
936
+ */
937
+ WebAuth.prototype.updateSuggestMFA = function (track_id, options) {
938
+ return TokenService_1.TokenService.updateSuggestMFA(track_id, options);
939
+ };
940
+ ;
941
+ /**
942
+ * enrollVerification
943
+ * @param options
944
+ * @returns
945
+ */
946
+ WebAuth.prototype.enrollVerification = function (options) {
947
+ return VerificationService_1.VerificationService.enrollVerification(options);
948
+ };
949
+ ;
950
+ /**
951
+ * @deprecated This function is no longer supported, instead use {this.updateStatus()}
952
+ * @param status_id
953
+ * @returns
954
+ */
955
+ WebAuth.prototype.updateSocket = function (status_id) {
956
+ return VerificationService_1.VerificationService.updateStatus(status_id);
957
+ };
958
+ ;
959
+ /**
960
+ * update the status of notification
961
+ * @param status_id
962
+ * @returns
963
+ */
964
+ WebAuth.prototype.updateStatus = function (status_id) {
965
+ return VerificationService_1.VerificationService.updateStatus(status_id);
966
+ };
967
+ ;
968
+ /**
969
+ * setupFidoVerification
970
+ * @param options
971
+ * @returns
972
+ */
973
+ WebAuth.prototype.setupFidoVerification = function (options) {
974
+ return VerificationService_1.VerificationService.setupFidoVerification(options);
975
+ };
976
+ ;
977
+ /**
978
+ * checkVerificationTypeConfigured
979
+ * @param options
980
+ * @returns
981
+ */
982
+ WebAuth.prototype.checkVerificationTypeConfigured = function (options) {
983
+ return VerificationService_1.VerificationService.checkVerificationTypeConfigured(options);
984
+ };
985
+ ;
986
+ /**
987
+ * deleteUserAccount
988
+ * @param options
989
+ * @returns
990
+ */
991
+ WebAuth.prototype.deleteUserAccount = function (options) {
992
+ return UserService_1.UserService.deleteUserAccount(options);
993
+ };
994
+ ;
995
+ /**
996
+ * getMissingFieldsLogin
997
+ * @param trackId
998
+ * @returns
999
+ */
1000
+ WebAuth.prototype.getMissingFieldsLogin = function (trackId) {
1001
+ return TokenService_1.TokenService.getMissingFieldsLogin(trackId);
1002
+ };
1003
+ ;
1004
+ /**
1005
+ * progressiveRegistration
1006
+ * @param options
1007
+ * @param headers
1008
+ * @returns
1009
+ */
1010
+ WebAuth.prototype.progressiveRegistration = function (options, headers) {
1011
+ return LoginService_1.LoginService.progressiveRegistration(options, headers);
1012
+ };
1013
+ ;
1014
+ /**
1015
+ * loginAfterRegister
1016
+ * @param options
1017
+ */
1018
+ WebAuth.prototype.loginAfterRegister = function (options) {
1019
+ LoginService_1.LoginService.loginAfterRegister(options);
1020
+ };
1021
+ ;
1022
+ /**
1023
+ * device code flow - verify
1024
+ * @param code
1025
+ */
1026
+ WebAuth.prototype.deviceCodeVerify = function (code) {
1027
+ TokenService_1.TokenService.deviceCodeVerify(code);
1028
+ };
1029
+ /**
1030
+ * check if an user exists
1031
+ * @param options
1032
+ * @returns
1033
+ */
1034
+ WebAuth.prototype.userCheckExists = function (options) {
1035
+ return UserService_1.UserService.userCheckExists(options);
1036
+ };
1037
+ ;
1038
+ /**
1039
+ * To set accept language
1040
+ * @param acceptLanguage
1041
+ */
1042
+ WebAuth.prototype.setAcceptLanguageHeader = function (acceptLanguage) {
1043
+ window.localeSettings = acceptLanguage;
1044
+ };
1045
+ /**
1046
+ * initiate mfa v2
1047
+ * @param options
1048
+ * @returns
1049
+ */
1050
+ WebAuth.prototype.initiateMFAV2 = function (options) {
1051
+ return VerificationService_1.VerificationService.initiateMFAV2(options);
1052
+ };
1053
+ ;
1054
+ /**
1055
+ * initiateVerification
1056
+ * @param options
1057
+ */
1058
+ WebAuth.prototype.initiateVerification = function (options) {
1059
+ options.type = options.verification_type;
1060
+ this.initiateMFAV2(options);
1061
+ };
1062
+ ;
1063
+ /**
1064
+ * initiate email v2
1065
+ * @param options
1066
+ */
1067
+ WebAuth.prototype.initiateEmailV2 = function (options) {
1068
+ options.type = "email";
1069
+ this.initiateMFAV2(options);
1070
+ };
1071
+ ;
1072
+ /**
1073
+ * initiate sms v2
1074
+ * @param options
1075
+ */
1076
+ WebAuth.prototype.initiateSMSV2 = function (options) {
1077
+ options.type = "sms";
1078
+ this.initiateMFAV2(options);
1079
+ };
1080
+ ;
1081
+ /**
1082
+ * initiate ivr v2
1083
+ * @param options
1084
+ */
1085
+ WebAuth.prototype.initiateIVRV2 = function (options) {
1086
+ options.type = "ivr";
1087
+ this.initiateMFAV2(options);
1088
+ };
1089
+ ;
1090
+ /**
1091
+ * initiate backupcode v2
1092
+ * @param options
1093
+ */
1094
+ WebAuth.prototype.initiateBackupcodeV2 = function (options) {
1095
+ options.type = "backupcode";
1096
+ this.initiateMFAV2(options);
1097
+ };
1098
+ ;
1099
+ /**
1100
+ * initiate totp v2
1101
+ * @param options
1102
+ */
1103
+ WebAuth.prototype.initiateTOTPV2 = function (options) {
1104
+ options.type = "totp";
1105
+ this.initiateMFAV2(options);
1106
+ };
1107
+ ;
1108
+ /**
1109
+ * initiate pattern v2
1110
+ * @param options
1111
+ */
1112
+ WebAuth.prototype.initiatePatternV2 = function (options) {
1113
+ options.type = "pattern";
1114
+ this.initiateMFAV2(options);
1115
+ };
1116
+ ;
1117
+ /**
1118
+ * initiate touchid v2
1119
+ * @param options
1120
+ */
1121
+ WebAuth.prototype.initiateTouchIdV2 = function (options) {
1122
+ options.type = "touchid";
1123
+ this.initiateMFAV2(options);
1124
+ };
1125
+ ;
1126
+ /**
1127
+ * initiate smart push v2
1128
+ * @param options
1129
+ */
1130
+ WebAuth.prototype.initiateSmartPushV2 = function (options) {
1131
+ options.type = "push";
1132
+ this.initiateMFAV2(options);
1133
+ };
1134
+ ;
1135
+ /**
1136
+ * initiate face v2
1137
+ * @param options
1138
+ */
1139
+ WebAuth.prototype.initiateFaceV2 = function (options) {
1140
+ options.type = "face";
1141
+ this.initiateMFAV2(options);
1142
+ };
1143
+ ;
1144
+ /**
1145
+ * initiate voice v2
1146
+ * @param options
1147
+ */
1148
+ WebAuth.prototype.initiateVoiceV2 = function (options) {
1149
+ options.type = "voice";
1150
+ this.initiateMFAV2(options);
1151
+ };
1152
+ ;
1153
+ /**
1154
+ * @deprecated
1155
+ * @param options
1156
+ * @param verificationType
1157
+ * @returns
1158
+ */
1159
+ WebAuth.prototype.initiateMfaV1 = function (options, verificationType) {
1160
+ return VerificationService_1.VerificationService.initiateMfaV1(options, verificationType);
1161
+ };
1162
+ /**
1163
+ * @deprecated
1164
+ * initiate email - v1
1165
+ * @param options
1166
+ */
1167
+ WebAuth.prototype.initiateEmail = function (options) {
1168
+ var verificationType = "EMAIL";
1169
+ this.initiateMfaV1(options, verificationType);
1170
+ };
1171
+ ;
1172
+ /**
1173
+ * @deprecated
1174
+ * initiate SMS - v1
1175
+ * @param options
1176
+ */
1177
+ WebAuth.prototype.initiateSMS = function (options) {
1178
+ var verificationType = "SMS";
1179
+ this.initiateMfaV1(options, verificationType);
1180
+ };
1181
+ ;
1182
+ /**
1183
+ * @deprecated
1184
+ * initiate IVR - v1
1185
+ * @param options
1186
+ */
1187
+ WebAuth.prototype.initiateIVR = function (options) {
1188
+ var verificationType = "IVR";
1189
+ this.initiateMfaV1(options, verificationType);
1190
+ };
1191
+ ;
1192
+ /**
1193
+ * @deprecated
1194
+ * initiate backup code - v1
1195
+ * @param options
1196
+ */
1197
+ WebAuth.prototype.initiateBackupcode = function (options) {
1198
+ var verificationType = "BACKUPCODE";
1199
+ this.initiateMfaV1(options, verificationType);
1200
+ };
1201
+ ;
1202
+ /**
1203
+ * @deprecated
1204
+ * initiate TOTP - v1
1205
+ * @param options
1206
+ */
1207
+ WebAuth.prototype.initiateTOTP = function (options) {
1208
+ var verificationType = "TOTP";
1209
+ this.initiateMfaV1(options, verificationType);
1210
+ };
1211
+ ;
1212
+ /**
1213
+ * @deprecated
1214
+ * initiate pattern - v1
1215
+ * @param options
1216
+ */
1217
+ WebAuth.prototype.initiatePattern = function (options) {
1218
+ var verificationType = "PATTERN";
1219
+ this.initiateMfaV1(options, verificationType);
1220
+ };
1221
+ ;
1222
+ /**
1223
+ * @deprecated
1224
+ * initiate touchid - v1
1225
+ * @param options
1226
+ */
1227
+ WebAuth.prototype.initiateTouchId = function (options) {
1228
+ var verificationType = "TOUCHID";
1229
+ this.initiateMfaV1(options, verificationType);
1230
+ };
1231
+ ;
1232
+ /**
1233
+ * @deprecated
1234
+ * initiate push - v1
1235
+ * @param options
1236
+ */ WebAuth.prototype.initiateSmartPush = function (options) {
1237
+ var verificationType = "PUSH";
1238
+ this.initiateMfaV1(options, verificationType);
1239
+ };
1240
+ ;
1241
+ /**
1242
+ * @deprecated
1243
+ * initiate face - v1
1244
+ * @param options
1245
+ */
1246
+ WebAuth.prototype.initiateFace = function (options) {
1247
+ var verificationType = "FACE";
1248
+ this.initiateMfaV1(options, verificationType);
1249
+ };
1250
+ ;
1251
+ /**
1252
+ * @deprecated
1253
+ * initiate Voice - v1
1254
+ * @param options
1255
+ */
1256
+ WebAuth.prototype.initiateVoice = function (options) {
1257
+ var verificationType = "VOICE";
1258
+ this.initiateMfaV1(options, verificationType);
1259
+ };
1260
+ ;
1261
+ /**
1262
+ * authenticate mfa v2
1263
+ * @param options
1264
+ * @returns
1265
+ */
1266
+ WebAuth.prototype.authenticateMFAV2 = function (options) {
1267
+ return VerificationService_1.VerificationService.authenticateMFAV2(options);
1268
+ };
1269
+ ;
1270
+ /**
1271
+ * authenticateVerification
1272
+ * @param options
1273
+ */
1274
+ WebAuth.prototype.authenticateVerification = function (options) {
1275
+ options.type = options.verification_type;
1276
+ this.authenticateMFAV2(options);
1277
+ };
1278
+ ;
1279
+ /**
1280
+ * authenticate email v2
1281
+ * @param options
1282
+ */
1283
+ WebAuth.prototype.authenticateEmailV2 = function (options) {
1284
+ options.type = "email";
1285
+ this.authenticateMFAV2(options);
1286
+ };
1287
+ ;
1288
+ /**
1289
+ * authenticate sms v2
1290
+ * @param options
1291
+ */
1292
+ WebAuth.prototype.authenticateSMSV2 = function (options) {
1293
+ options.type = "sms";
1294
+ this.authenticateMFAV2(options);
1295
+ };
1296
+ ;
1297
+ /**
1298
+ * authenticate ivr v2
1299
+ * @param options
1300
+ */
1301
+ WebAuth.prototype.authenticateIVRV2 = function (options) {
1302
+ options.type = "ivr";
1303
+ this.authenticateMFAV2(options);
1304
+ };
1305
+ ;
1306
+ /**
1307
+ * authenticate backupcode v2
1308
+ * @param options
1309
+ */
1310
+ WebAuth.prototype.authenticateBackupcodeV2 = function (options) {
1311
+ options.type = "backupcode";
1312
+ this.authenticateMFAV2(options);
1313
+ };
1314
+ ;
1315
+ /**
1316
+ * authenticate totp v2
1317
+ * @param options
1318
+ */
1319
+ WebAuth.prototype.authenticateTOTPV2 = function (options) {
1320
+ options.type = "totp";
1321
+ this.authenticateMFAV2(options);
1322
+ };
1323
+ ;
1324
+ /**
1325
+ * authenticateVerification form type (for face)
1326
+ * @param options
1327
+ * @returns
1328
+ */
1329
+ WebAuth.prototype.authenticateFaceVerification = function (options) {
1330
+ return VerificationService_1.VerificationService.authenticateFaceVerification(options);
1331
+ };
1332
+ ;
1333
+ /**
1334
+ * @deprecated
1335
+ * setup verification - v1
1336
+ * @param options
1337
+ * @param access_token
1338
+ * @param verificationType
1339
+ * @returns
1340
+ */
1341
+ WebAuth.prototype.setupVerificationV1 = function (options, access_token, verificationType) {
1342
+ return VerificationService_1.VerificationService.setupVerificationV1(options, access_token, verificationType);
1343
+ };
1344
+ /**
1345
+ * @deprecated
1346
+ * setup email - v1
1347
+ * @param options
1348
+ * @param access_token
1349
+ */
1350
+ WebAuth.prototype.setupEmail = function (options, access_token) {
1351
+ var verificationType = "EMAIL";
1352
+ this.setupVerificationV1(options, access_token, verificationType);
1353
+ };
1354
+ ;
1355
+ /**
1356
+ * @deprecated
1357
+ * setup sms - v1
1358
+ * @param options
1359
+ * @param access_token
1360
+ */
1361
+ WebAuth.prototype.setupSMS = function (options, access_token) {
1362
+ var verificationType = "SMS";
1363
+ this.setupVerificationV1(options, access_token, verificationType);
1364
+ };
1365
+ ;
1366
+ /**
1367
+ * @deprecated
1368
+ * setup ivr - v1
1369
+ * @param options
1370
+ * @param access_token
1371
+ */
1372
+ WebAuth.prototype.setupIVR = function (options, access_token) {
1373
+ var verificationType = "IVR";
1374
+ this.setupVerificationV1(options, access_token, verificationType);
1375
+ };
1376
+ ;
1377
+ /**
1378
+ * @deprecated
1379
+ * setup backupcode - v1
1380
+ * @param options
1381
+ * @param access_token
1382
+ */
1383
+ WebAuth.prototype.setupBackupcode = function (options, access_token) {
1384
+ var verificationType = "BACKUPCODE";
1385
+ this.setupVerificationV1(options, access_token, verificationType);
1386
+ };
1387
+ ;
1388
+ /**
1389
+ * @deprecated
1390
+ * setup totp - v1
1391
+ * @param options
1392
+ * @param access_token
1393
+ */
1394
+ WebAuth.prototype.setupTOTP = function (options, access_token) {
1395
+ var verificationType = "TOTP";
1396
+ this.setupVerificationV1(options, access_token, verificationType);
1397
+ };
1398
+ ;
1399
+ /**
1400
+ * @deprecated
1401
+ * setup pattern - v1
1402
+ * @param options
1403
+ * @param access_token
1404
+ */
1405
+ WebAuth.prototype.setupPattern = function (options, access_token) {
1406
+ var verificationType = "PATTERN";
1407
+ this.setupVerificationV1(options, access_token, verificationType);
1408
+ };
1409
+ ;
1410
+ /**
1411
+ * @deprecated
1412
+ * setup touch - v1
1413
+ * @param options
1414
+ * @param access_token
1415
+ */
1416
+ WebAuth.prototype.setupTouchId = function (options, access_token) {
1417
+ var verificationType = "TOUCHID";
1418
+ this.setupVerificationV1(options, access_token, verificationType);
1419
+ };
1420
+ ;
1421
+ /**
1422
+ * @deprecated
1423
+ * setup smart push - v1
1424
+ * @param options
1425
+ * @param access_token
1426
+ */
1427
+ WebAuth.prototype.setupSmartPush = function (options, access_token) {
1428
+ var verificationType = "PUSH";
1429
+ this.setupVerificationV1(options, access_token, verificationType);
1430
+ };
1431
+ ;
1432
+ /**
1433
+ * @deprecated
1434
+ * setup face - v1
1435
+ * @param options
1436
+ * @param access_token
1437
+ */
1438
+ WebAuth.prototype.setupFace = function (options, access_token) {
1439
+ var verificationType = "FACE";
1440
+ this.setupVerificationV1(options, access_token, verificationType);
1441
+ };
1442
+ ;
1443
+ /**
1444
+ * @deprecated
1445
+ * setup voice - v1
1446
+ * @param options
1447
+ * @param access_token
1448
+ */
1449
+ WebAuth.prototype.setupVoice = function (options, access_token) {
1450
+ var verificationType = "VOICE";
1451
+ this.setupVerificationV1(options, access_token, verificationType);
1452
+ };
1453
+ ;
1454
+ /**
1455
+ * @deprecated
1456
+ * enroll verification - v1
1457
+ * @param options
1458
+ * @param access_token
1459
+ * @param verificationType
1460
+ * @returns
1461
+ */
1462
+ WebAuth.prototype.enrollVerificationV1 = function (options, access_token, verificationType) {
1463
+ return VerificationService_1.VerificationService.enrollVerificationV1(options, access_token, verificationType);
1464
+ };
1465
+ /**
1466
+ * @deprecated
1467
+ * enroll email - v1
1468
+ * @param options
1469
+ * @param access_token
1470
+ */
1471
+ WebAuth.prototype.enrollEmail = function (options, access_token) {
1472
+ var verificationType = "EMAIL";
1473
+ this.enrollVerificationV1(options, access_token, verificationType);
1474
+ };
1475
+ ;
1476
+ /**
1477
+ * @deprecated
1478
+ * enroll SMS - v1
1479
+ * @param options
1480
+ * @param access_token
1481
+ */
1482
+ WebAuth.prototype.enrollSMS = function (options, access_token) {
1483
+ var verificationType = "SMS";
1484
+ this.enrollVerificationV1(options, access_token, verificationType);
1485
+ };
1486
+ ;
1487
+ /**
1488
+ * @deprecated
1489
+ * enroll IVR - v1
1490
+ * @param options
1491
+ * @param access_token
1492
+ */
1493
+ WebAuth.prototype.enrollIVR = function (options, access_token) {
1494
+ var verificationType = "IVR";
1495
+ this.enrollVerificationV1(options, access_token, verificationType);
1496
+ };
1497
+ ;
1498
+ /**
1499
+ * @deprecated
1500
+ * enroll TOTP - v1
1501
+ * @param options
1502
+ * @param access_token
1503
+ */
1504
+ WebAuth.prototype.enrollTOTP = function (options, access_token) {
1505
+ var verificationType = "TOTP";
1506
+ this.enrollVerificationV1(options, access_token, verificationType);
1507
+ };
1508
+ ;
1509
+ /**
1510
+ * @deprecated
1511
+ * authenticate mfa - v1
1512
+ * @param verificationType
1513
+ * @returns
1514
+ */
1515
+ WebAuth.prototype.authenticateMfaV1 = function (options, verificationType) {
1516
+ return VerificationService_1.VerificationService.authenticateMfaV1(options, verificationType);
1517
+ };
1518
+ /**
1519
+ * @deprecated
1520
+ * authenticate email - v1
1521
+ * @param options
1522
+ */
1523
+ WebAuth.prototype.authenticateEmail = function (options) {
1524
+ var verificationType = "EMAIL";
1525
+ this.authenticateMfaV1(options, verificationType);
1526
+ };
1527
+ ;
1528
+ /**
1529
+ * @deprecated
1530
+ * authenticate sms - v1
1531
+ * @param options
1532
+ */
1533
+ WebAuth.prototype.authenticateSMS = function (options) {
1534
+ var verificationType = "SMS";
1535
+ this.authenticateMfaV1(options, verificationType);
1536
+ };
1537
+ ;
1538
+ /**
1539
+ * @deprecated
1540
+ * authenticate ivr - v1
1541
+ * @param options
1542
+ */
1543
+ WebAuth.prototype.authenticateIVR = function (options) {
1544
+ var verificationType = "IVR";
1545
+ this.authenticateMfaV1(options, verificationType);
1546
+ };
1547
+ ;
1548
+ /**
1549
+ * @deprecated
1550
+ * authenticate totp - v1
1551
+ * @param options
1552
+ */
1553
+ WebAuth.prototype.authenticateTOTP = function (options) {
1554
+ var verificationType = "TOTP";
1555
+ this.authenticateMfaV1(options, verificationType);
1556
+ };
1557
+ ;
1558
+ /**
1559
+ * @deprecated
1560
+ * authenticate backupcode - v1
1561
+ * @param options
1562
+ */
1563
+ WebAuth.prototype.authenticateBackupcode = function (options) {
1564
+ var verificationType = "BACKUPCODE";
1565
+ this.authenticateMfaV1(options, verificationType);
1566
+ };
1567
+ ;
1568
+ return WebAuth;
1569
+ }());
1570
+ exports.WebAuth = WebAuth;