cidaas-javascript-sdk 3.0.5 → 3.1.1

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