cidaas-javascript-sdk 4.2.0 → 4.2.2

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,15 +1,3 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
1
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
2
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
3
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -19,49 +7,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
19
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
20
8
  });
21
9
  };
22
- var __generator = (this && this.__generator) || function (thisArg, body) {
23
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
- function verb(n) { return function (v) { return step([n, v]); }; }
26
- function step(op) {
27
- if (f) throw new TypeError("Generator is already executing.");
28
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
- 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;
30
- if (y = 0, t) op = [op[0] & 2, t.value];
31
- switch (op[0]) {
32
- case 0: case 1: t = op; break;
33
- case 4: _.label++; return { value: op[1], done: false };
34
- case 5: _.label++; y = op[1]; op = [0]; continue;
35
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
- default:
37
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
- if (t[2]) _.ops.pop();
42
- _.trys.pop(); continue;
43
- }
44
- op = body.call(thisArg, _);
45
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
- }
48
- };
49
- exports.__esModule = true;
50
- exports.WebAuth = exports.createPreloginWebauth = void 0;
51
- var oidc_client_ts_1 = require("oidc-client-ts");
52
- var authentication_1 = require("../authentication");
53
- var Helper_1 = require("./Helper");
54
- var LoginService_1 = require("./LoginService");
55
- var UserService_1 = require("./UserService");
56
- var TokenService_1 = require("./TokenService");
57
- var VerificationService_1 = require("./VerificationService");
58
- var ConsentService_1 = require("./ConsentService");
59
- var createPreloginWebauth = function (authority) {
10
+ import { Authentication, OidcManager } from '../authentication';
11
+ import { Helper, CustomException } from "./Helper";
12
+ import { LoginService } from "./LoginService";
13
+ import { UserService } from "./UserService";
14
+ import { TokenService } from "./TokenService";
15
+ import { VerificationService } from "./VerificationService";
16
+ import { ConsentService } from "./ConsentService";
17
+ export const createPreloginWebauth = (authority) => {
60
18
  return new WebAuth({ 'authority': authority });
61
19
  };
62
- exports.createPreloginWebauth = createPreloginWebauth;
63
- var WebAuth = /** @class */ (function () {
64
- function WebAuth(settings) {
20
+ export class WebAuth {
21
+ constructor(settings) {
65
22
  try {
66
23
  if (!settings.response_type) {
67
24
  settings.response_type = "code";
@@ -72,13 +29,13 @@ var WebAuth = /** @class */ (function () {
72
29
  if (settings.authority && settings.authority.charAt(settings.authority.length - 1) === '/') {
73
30
  settings.authority = settings.authority.slice(0, settings.authority.length - 1);
74
31
  }
75
- var usermanager = new oidc_client_ts_1.UserManager(settings);
32
+ var usermanager = new OidcManager(settings);
76
33
  window.webAuthSettings = settings;
77
34
  window.usermanager = usermanager;
78
35
  window.localeSettings = null;
79
- window.authentication = new authentication_1.Authentication(window.webAuthSettings, window.usermanager);
36
+ window.authentication = new Authentication(window.webAuthSettings, window.usermanager);
80
37
  window.usermanager.events.addSilentRenewError(function () {
81
- throw new Helper_1.CustomException("Error while renewing silent login", 500);
38
+ throw new CustomException("Error while renewing silent login", 500);
82
39
  });
83
40
  }
84
41
  catch (ex) {
@@ -87,77 +44,96 @@ var WebAuth = /** @class */ (function () {
87
44
  }
88
45
  // prototype methods
89
46
  /**
90
- * login
47
+ * Generate and redirect to authz url in same window for logging in.
48
+ * @param {LoginRedirectOptions} options options options to over-ride the client config for redirect login
91
49
  */
92
- WebAuth.prototype.loginWithBrowser = function () {
50
+ loginWithBrowser(options) {
93
51
  if (!window.webAuthSettings || !window.authentication) {
94
- return Promise.reject(new Helper_1.CustomException("Settings or Authentication instance in OIDC cannot be empty", 417));
52
+ return Promise.reject(new CustomException("Settings or Authentication instance in OIDC cannot be empty", 417));
95
53
  }
96
- return window.authentication.loginOrRegisterWithBrowser('login');
97
- };
54
+ return window.authentication.loginOrRegisterWithBrowser('login', options);
55
+ }
98
56
  ;
99
57
  /**
100
- * popupSignIn
58
+ * Generate and open authz url in a popup window.
59
+ * On successful sign in, authenticated user is returned.
60
+ *
61
+ * @param {PopupSignInOptions} options options to over-ride the client config for popup sign in
62
+ * @returns {Promise<User>} Authenticated user
63
+ * @throws error if unable to get the parse and get user
101
64
  */
102
- WebAuth.prototype.popupSignIn = function () {
65
+ popupSignIn(options) {
103
66
  if (!window.webAuthSettings || !window.authentication) {
104
- return Promise.reject(new Helper_1.CustomException("Settings or Authentication instance in OIDC cannot be empty", 417));
67
+ return Promise.reject(new CustomException("Settings or Authentication instance in OIDC cannot be empty", 417));
105
68
  }
106
- return window.authentication.popupSignIn();
107
- };
69
+ return window.authentication.popupSignIn(options);
70
+ }
108
71
  ;
109
72
  /**
110
- * silentSignIn
73
+ * Generate and navigate to authz url in an iFrame.
74
+ * On successful sign in, authenticated user is returned
75
+ *
76
+ * @param {SilentSignInOptions} options options to over-ride the client config for silent sign in
77
+ * @returns {Promise<User>} Authenticated user
78
+ * @throws error if unable to get the parse and get user
111
79
  */
112
- WebAuth.prototype.silentSignIn = function () {
80
+ silentSignIn(options) {
113
81
  if (!window.webAuthSettings || !window.authentication) {
114
- return Promise.reject(new Helper_1.CustomException("Settings or Authentication instance in OIDC cannot be empty", 417));
82
+ return Promise.reject(new CustomException("Settings or Authentication instance in OIDC cannot be empty", 417));
115
83
  }
116
- return window.authentication.silentSignIn();
117
- };
84
+ return window.authentication.silentSignIn(options);
85
+ }
118
86
  ;
119
87
  /**
120
- * register
88
+ * Generate and redirect to authz url in same window for register view.
89
+ * @param {LoginRedirectOptions} options options options to over-ride the client config for redirect login
121
90
  */
122
- WebAuth.prototype.registerWithBrowser = function () {
91
+ registerWithBrowser(options) {
123
92
  if (!window.webAuthSettings || !window.authentication) {
124
- return Promise.reject(new Helper_1.CustomException("Settings or Authentication instance in OIDC cannot be empty", 417));
93
+ return Promise.reject(new CustomException("Settings or Authentication instance in OIDC cannot be empty", 417));
125
94
  }
126
- return window.authentication.loginOrRegisterWithBrowser('register');
127
- };
95
+ return window.authentication.loginOrRegisterWithBrowser('register', options);
96
+ }
128
97
  ;
129
98
  /**
130
- * login callback
131
- * @returns
99
+ * Once login successful, it will automatically redirects you to the redirect url whatever you mentioned in the options.
100
+ * To complete the login process, call **loginCallback()**. This will parses the access_token, id_token and whatever in hash in the redirect url.
101
+ *
102
+ * @param {string} url optional url from where to process the login state
103
+ * @returns {Promise<User>} Authenticated user
104
+ * @throws error if unable to get the parse and get user
132
105
  */
133
- WebAuth.prototype.loginCallback = function () {
106
+ loginCallback(url) {
134
107
  if (!window.webAuthSettings || !window.authentication) {
135
- return Promise.reject(new Helper_1.CustomException("Settings or Authentication instance in OIDC cannot be empty", 417));
108
+ return Promise.reject(new CustomException("Settings or Authentication instance in OIDC cannot be empty", 417));
136
109
  }
137
- return window.authentication.loginCallback();
138
- };
110
+ return window.authentication.loginCallback(url);
111
+ }
139
112
  ;
140
113
  /**
141
- * popup signin callback
142
- * @returns
114
+ * To complete the popup login process, call **popupSignInCallback()** from the popup login window.
115
+ * Popup window will be closed after doing callback
116
+ *
117
+ * @param {string} url optional url to read sign-in callback state from
118
+ * @param {boolean} keepOpen true to keep the popup open even after sign in, else false
143
119
  */
144
- WebAuth.prototype.popupSignInCallback = function () {
120
+ popupSignInCallback(url, keepOpen) {
145
121
  if (!window.webAuthSettings || !window.authentication) {
146
- return Promise.reject(new Helper_1.CustomException("Settings or Authentication instance in OIDC cannot be empty", 417));
122
+ return Promise.reject(new CustomException("Settings or Authentication instance in OIDC cannot be empty", 417));
147
123
  }
148
- return window.authentication.popupSignInCallback();
149
- };
124
+ return window.authentication.popupSignInCallback(url, keepOpen);
125
+ }
150
126
  ;
151
127
  /**
152
- * silent signin callback
153
- * @returns
128
+ * Returns a promise to notify the parent window of response from authz service
129
+ * @param {string} url optional url to check authz response, if none window.location is used
154
130
  */
155
- WebAuth.prototype.silentSignInCallback = function () {
131
+ silentSignInCallback(url) {
156
132
  if (!window.webAuthSettings || !window.authentication) {
157
- return Promise.reject(new Helper_1.CustomException("Settings or Authentication instance in OIDC cannot be empty", 417));
133
+ return Promise.reject(new CustomException("Settings or Authentication instance in OIDC cannot be empty", 417));
158
134
  }
159
- return window.authentication.silentSignInCallback();
160
- };
135
+ return window.authentication.silentSignInCallback(url);
136
+ }
161
137
  ;
162
138
  /**
163
139
  * To get the user profile information by using oidc-client-ts library, call **getUserInfo()**. This will return the basic user profile details along with groups, roles and whatever scopes you mentioned in the options.
@@ -169,65 +145,62 @@ var WebAuth = /** @class */ (function () {
169
145
  * // your failure code here
170
146
  * });
171
147
  * ```
148
+ * @return {Promise<User|null>} returns authenticated user if present, else null
172
149
  */
173
- WebAuth.prototype.getUserInfo = function () {
174
- return __awaiter(this, void 0, void 0, function () {
175
- return __generator(this, function (_a) {
176
- switch (_a.label) {
177
- case 0:
178
- if (!window.usermanager) {
179
- return [2 /*return*/, Promise.reject(new Helper_1.CustomException("UserManager cannot be empty", 417))];
180
- }
181
- return [4 /*yield*/, window.usermanager.getUser()];
182
- case 1: return [2 /*return*/, _a.sent()];
183
- }
184
- });
150
+ getUserInfo() {
151
+ return __awaiter(this, void 0, void 0, function* () {
152
+ if (!window.usermanager) {
153
+ return Promise.reject(new CustomException("UserManager cannot be empty", 417));
154
+ }
155
+ return yield window.usermanager.getUser();
185
156
  });
186
- };
157
+ }
187
158
  ;
188
159
  /**
189
160
  * logout by using oidc-client-ts library
190
- * @returns
161
+ * @param {LogoutRedirectOptions} options optional options to over-ride logout options on redirect
191
162
  */
192
- WebAuth.prototype.logout = function () {
163
+ logout(options) {
193
164
  if (!window.webAuthSettings || !window.authentication) {
194
- return Promise.reject(new Helper_1.CustomException("Settings or Authentication instance in OIDC cannot be empty", 417));
165
+ return Promise.reject(new CustomException("Settings or Authentication instance in OIDC cannot be empty", 417));
195
166
  }
196
- return window.authentication.logout();
197
- };
167
+ return window.authentication.logout(options);
168
+ }
198
169
  ;
199
170
  /**
200
- * popup signout
201
- * @returns
171
+ * logout by using oidc-client-ts library
172
+ * @param {PopupSignOutOptions} options optional options to over-ride logout options using popup window
202
173
  */
203
- WebAuth.prototype.popupSignOut = function () {
174
+ popupSignOut(options) {
204
175
  if (!window.webAuthSettings || !window.authentication) {
205
- return Promise.reject(new Helper_1.CustomException("Settings or Authentication instance in OIDC cannot be empty", 417));
176
+ return Promise.reject(new CustomException("Settings or Authentication instance in OIDC cannot be empty", 417));
206
177
  }
207
- return window.authentication.popupSignOut();
208
- };
178
+ return window.authentication.popupSignOut(options);
179
+ }
209
180
  ;
210
181
  /**
211
- * logout callback
212
- * @returns
182
+ * get the logout call state from the url provided, if none is provided current window url is used
183
+ * @returns {Promise<LogoutResponse>} logout response from auth service
213
184
  */
214
- WebAuth.prototype.logoutCallback = function () {
185
+ logoutCallback(url) {
215
186
  if (!window.webAuthSettings || !window.authentication) {
216
- return Promise.reject(new Helper_1.CustomException("Settings or Authentication instance in OIDC cannot be empty", 417));
187
+ return Promise.reject(new CustomException("Settings or Authentication instance in OIDC cannot be empty", 417));
217
188
  }
218
- return window.authentication.logoutCallback();
219
- };
189
+ return window.authentication.logoutCallback(url);
190
+ }
220
191
  ;
221
192
  /**
222
- * popup signout callback
223
- * @returns
193
+ * listen to popup sign out event
194
+ * @param {string} url optional url to override to check for sign out state
195
+ * @param {boolean} keepOpen true to keep the popup open even after sign out, else false
224
196
  */
225
- WebAuth.prototype.popupSignOutCallback = function () {
197
+ popupSignOutCallback(url, keepOpen) {
226
198
  if (!window.webAuthSettings || !window.authentication) {
227
- return Promise.reject(new Helper_1.CustomException("Settings or Authentication instance in OIDC cannot be empty", 417));
199
+ return Promise.reject(new CustomException("Settings or Authentication instance in OIDC cannot be empty", 417));
228
200
  }
229
- return window.authentication.popupSignOutCallback();
230
- };
201
+ url = url || window.webAuthSettings.post_logout_redirect_uri;
202
+ return window.authentication.popupSignOutCallback(url, keepOpen);
203
+ }
231
204
  ;
232
205
  /**
233
206
  * To get the generated login url, call **getLoginURL()**. This will call authz service and generate login url to be used.
@@ -239,11 +212,16 @@ var WebAuth = /** @class */ (function () {
239
212
  * // your failure code here
240
213
  * });
241
214
  * ```
215
+ * @param {LoginRequestOptions} options login options to override {@link window.webAuthSettings} provided
216
+ * @return {Promise<string>} authz url for login
242
217
  */
243
- WebAuth.prototype.getLoginURL = function (state) {
244
- return new Promise(function (resolve, reject) {
218
+ getLoginURL(options) {
219
+ if (!window.webAuthSettings || !window.authentication) {
220
+ return Promise.reject(new CustomException("Settings or Authentication instance in OIDC cannot be empty", 417));
221
+ }
222
+ return new Promise((resolve, reject) => {
245
223
  try {
246
- window.usermanager._client.createSigninRequest({ state: state }).then(function (signinRequest) {
224
+ window.usermanager.getClient().createSigninRequest(Object.assign(Object.assign({}, window.webAuthSettings), (options && { options } || {}))).then((signinRequest) => {
247
225
  resolve(signinRequest.url);
248
226
  });
249
227
  }
@@ -251,7 +229,7 @@ var WebAuth = /** @class */ (function () {
251
229
  reject(e);
252
230
  }
253
231
  });
254
- };
232
+ }
255
233
  ;
256
234
  /**
257
235
  * Each and every proccesses starts with requestId, it is an entry point to login or register. For getting the requestId, call **getRequestId()**.
@@ -264,13 +242,13 @@ var WebAuth = /** @class */ (function () {
264
242
  * });
265
243
  * ```
266
244
  */
267
- WebAuth.prototype.getRequestId = function () {
245
+ getRequestId() {
268
246
  var _a, _b;
269
- var ui_locales = window.webAuthSettings.ui_locales;
270
- var options = __assign({ 'client_id': window.webAuthSettings.client_id, 'redirect_uri': window.webAuthSettings.redirect_uri, 'response_type': (_a = window.webAuthSettings.response_type) !== null && _a !== void 0 ? _a : 'token', "response_mode": (_b = window.webAuthSettings.response_mode) !== null && _b !== void 0 ? _b : 'fragment', "scope": window.webAuthSettings.scope, "nonce": new Date().getTime().toString() }, (ui_locales && { ui_locales: ui_locales } || {}));
271
- var serviceURL = window.webAuthSettings.authority + '/authz-srv/authrequest/authz/generate';
272
- return Helper_1.Helper.createHttpPromise(options, serviceURL, false, "POST");
273
- };
247
+ const ui_locales = window.webAuthSettings.ui_locales;
248
+ const options = Object.assign({ 'client_id': window.webAuthSettings.client_id, 'redirect_uri': window.webAuthSettings.redirect_uri, 'response_type': (_a = window.webAuthSettings.response_type) !== null && _a !== void 0 ? _a : 'token', "response_mode": (_b = window.webAuthSettings.response_mode) !== null && _b !== void 0 ? _b : 'fragment', "scope": window.webAuthSettings.scope, "nonce": new Date().getTime().toString() }, (ui_locales && { ui_locales } || {}));
249
+ const serviceURL = window.webAuthSettings.authority + '/authz-srv/authrequest/authz/generate';
250
+ return Helper.createHttpPromise(options, serviceURL, false, "POST");
251
+ }
274
252
  ;
275
253
  /**
276
254
  * To get the tenant basic information, call **getTenantInfo()**. This will return the basic tenant details such as tenant name and allowed login with types (Email, Mobile, Username).
@@ -283,10 +261,10 @@ var WebAuth = /** @class */ (function () {
283
261
  * });
284
262
  * ```
285
263
  */
286
- WebAuth.prototype.getTenantInfo = function () {
287
- var _serviceURL = window.webAuthSettings.authority + "/public-srv/tenantinfo/basic";
288
- return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, false, "GET");
289
- };
264
+ getTenantInfo() {
265
+ const _serviceURL = window.webAuthSettings.authority + "/public-srv/tenantinfo/basic";
266
+ return Helper.createHttpPromise(undefined, _serviceURL, false, "GET");
267
+ }
290
268
  ;
291
269
  /**
292
270
  * To logout the user by using cidaas internal api, call **logoutUser()**.
@@ -298,9 +276,9 @@ var WebAuth = /** @class */ (function () {
298
276
  * });
299
277
  * ```
300
278
  */
301
- WebAuth.prototype.logoutUser = function (options) {
279
+ logoutUser(options) {
302
280
  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;
303
- };
281
+ }
304
282
  ;
305
283
  /**
306
284
  * To get the client basic information, call **getClientInfo()**. This will return the basic client details such as client name and its details.
@@ -316,10 +294,10 @@ var WebAuth = /** @class */ (function () {
316
294
  * });
317
295
  * ```
318
296
  */
319
- WebAuth.prototype.getClientInfo = function (options) {
320
- var _serviceURL = window.webAuthSettings.authority + "/public-srv/public/" + options.requestId;
321
- return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, false, "GET");
322
- };
297
+ getClientInfo(options) {
298
+ const _serviceURL = window.webAuthSettings.authority + "/public-srv/public/" + options.requestId;
299
+ return Helper.createHttpPromise(undefined, _serviceURL, false, "GET");
300
+ }
323
301
  ;
324
302
  /**
325
303
  * To get all devices information associated to the client, call **getDevicesInfo()**
@@ -335,14 +313,14 @@ var WebAuth = /** @class */ (function () {
335
313
  * });
336
314
  * ```
337
315
  */
338
- WebAuth.prototype.getDevicesInfo = function (options, accessToken) {
316
+ getDevicesInfo(options, accessToken) {
339
317
  options.userAgent = window.navigator.userAgent;
340
- var _serviceURL = window.webAuthSettings.authority + "/device-srv/devices";
318
+ const _serviceURL = window.webAuthSettings.authority + "/device-srv/devices";
341
319
  if (window.navigator.userAgent) {
342
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "GET", accessToken);
320
+ return Helper.createHttpPromise(options, _serviceURL, false, "GET", accessToken);
343
321
  }
344
- return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, false, "GET", accessToken);
345
- };
322
+ return Helper.createHttpPromise(undefined, _serviceURL, false, "GET", accessToken);
323
+ }
346
324
  ;
347
325
  /**
348
326
  * To delete device associated to the client, call **deleteDevice()**
@@ -360,14 +338,14 @@ var WebAuth = /** @class */ (function () {
360
338
  * });
361
339
  * ```
362
340
  */
363
- WebAuth.prototype.deleteDevice = function (options, accessToken) {
364
- var _serviceURL = window.webAuthSettings.authority + "/device-srv/device/" + options.device_id;
341
+ deleteDevice(options, accessToken) {
342
+ const _serviceURL = window.webAuthSettings.authority + "/device-srv/device/" + options.device_id;
365
343
  options.userAgent = window.navigator.userAgent;
366
344
  if (window.navigator.userAgent) {
367
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "DELETE", accessToken);
345
+ return Helper.createHttpPromise(options, _serviceURL, false, "DELETE", accessToken);
368
346
  }
369
- return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, false, "DELETE", accessToken);
370
- };
347
+ return Helper.createHttpPromise(undefined, _serviceURL, false, "DELETE", accessToken);
348
+ }
371
349
  ;
372
350
  /**
373
351
  * To handle registration, first you need the registration fields. To get the registration fields, call **getRegistrationSetup()**. This will return the fields that has to be needed while registration.
@@ -384,10 +362,10 @@ var WebAuth = /** @class */ (function () {
384
362
  * });
385
363
  * ```
386
364
  */
387
- WebAuth.prototype.getRegistrationSetup = function (options) {
388
- var serviceURL = window.webAuthSettings.authority + '/registration-setup-srv/public/list?acceptlanguage=' + options.acceptlanguage + '&requestId=' + options.requestId;
389
- return Helper_1.Helper.createHttpPromise(undefined, serviceURL, false, 'GET');
390
- };
365
+ getRegistrationSetup(options) {
366
+ const serviceURL = window.webAuthSettings.authority + '/registration-setup-srv/public/list?acceptlanguage=' + options.acceptlanguage + '&requestId=' + options.requestId;
367
+ return Helper.createHttpPromise(undefined, serviceURL, false, 'GET');
368
+ }
391
369
  ;
392
370
  /**
393
371
  * to generate device info, call **createDeviceInfo()**.
@@ -401,78 +379,78 @@ var WebAuth = /** @class */ (function () {
401
379
  * });
402
380
  * ```
403
381
  */
404
- WebAuth.prototype.createDeviceInfo = function () {
405
- var value = ('; ' + document.cookie).split("; cidaas_dr=").pop().split(';')[0];
382
+ createDeviceInfo() {
383
+ const value = ('; ' + document.cookie).split(`; cidaas_dr=`).pop().split(';')[0];
406
384
  if (!value) {
407
- var options = {
385
+ const options = {
408
386
  userAgent: window.navigator.userAgent
409
387
  };
410
- var serviceURL = window.webAuthSettings.authority + '/device-srv/deviceinfo';
411
- return Helper_1.Helper.createHttpPromise(options, serviceURL, false, 'POST');
388
+ const serviceURL = window.webAuthSettings.authority + '/device-srv/deviceinfo';
389
+ return Helper.createHttpPromise(options, serviceURL, false, 'POST');
412
390
  }
413
- };
391
+ }
414
392
  ;
415
393
  /**
416
394
  * get the user profile information
417
395
  * @param options
418
396
  * @returns
419
397
  */
420
- WebAuth.prototype.getUserProfile = function (options) {
421
- return UserService_1.UserService.getUserProfile(options);
422
- };
398
+ getUserProfile(options) {
399
+ return UserService.getUserProfile(options);
400
+ }
423
401
  ;
424
402
  /**
425
403
  * renew token using refresh token
426
404
  * @param options
427
405
  * @returns
428
406
  */
429
- WebAuth.prototype.renewToken = function (options) {
430
- return TokenService_1.TokenService.renewToken(options);
431
- };
407
+ renewToken(options) {
408
+ return TokenService.renewToken(options);
409
+ }
432
410
  ;
433
411
  /**
434
412
  * get access token from code
435
413
  * @param options
436
414
  * @returns
437
415
  */
438
- WebAuth.prototype.getAccessToken = function (options) {
439
- return TokenService_1.TokenService.getAccessToken(options);
440
- };
416
+ getAccessToken(options) {
417
+ return TokenService.getAccessToken(options);
418
+ }
441
419
  ;
442
420
  /**
443
421
  * validate access token
444
422
  * @param options
445
423
  * @returns
446
424
  */
447
- WebAuth.prototype.validateAccessToken = function (options) {
448
- return TokenService_1.TokenService.validateAccessToken(options);
449
- };
425
+ validateAccessToken(options) {
426
+ return TokenService.validateAccessToken(options);
427
+ }
450
428
  ;
451
429
  /**
452
430
  * login with username and password
453
431
  * @param options
454
432
  */
455
- WebAuth.prototype.loginWithCredentials = function (options) {
456
- LoginService_1.LoginService.loginWithCredentials(options);
457
- };
433
+ loginWithCredentials(options) {
434
+ LoginService.loginWithCredentials(options);
435
+ }
458
436
  ;
459
437
  /**
460
438
  * login with social
461
439
  * @param options
462
440
  * @param queryParams
463
441
  */
464
- WebAuth.prototype.loginWithSocial = function (options, queryParams) {
465
- LoginService_1.LoginService.loginWithSocial(options, queryParams);
466
- };
442
+ loginWithSocial(options, queryParams) {
443
+ LoginService.loginWithSocial(options, queryParams);
444
+ }
467
445
  ;
468
446
  /**
469
447
  * register with social
470
448
  * @param options
471
449
  * @param queryParams
472
450
  */
473
- WebAuth.prototype.registerWithSocial = function (options, queryParams) {
474
- LoginService_1.LoginService.registerWithSocial(options, queryParams);
475
- };
451
+ registerWithSocial(options, queryParams) {
452
+ LoginService.registerWithSocial(options, queryParams);
453
+ }
476
454
  ;
477
455
  /**
478
456
  * register user
@@ -480,210 +458,210 @@ var WebAuth = /** @class */ (function () {
480
458
  * @param headers
481
459
  * @returns
482
460
  */
483
- WebAuth.prototype.register = function (options, headers) {
484
- return UserService_1.UserService.register(options, headers);
485
- };
461
+ register(options, headers) {
462
+ return UserService.register(options, headers);
463
+ }
486
464
  ;
487
465
  /**
488
466
  * get invite info
489
467
  * @param options
490
468
  * @returns
491
469
  */
492
- WebAuth.prototype.getInviteUserDetails = function (options) {
493
- return UserService_1.UserService.getInviteUserDetails(options);
494
- };
470
+ getInviteUserDetails(options) {
471
+ return UserService.getInviteUserDetails(options);
472
+ }
495
473
  ;
496
474
  /**
497
475
  * get Communication status
498
476
  * @param options
499
477
  * @returns
500
478
  */
501
- WebAuth.prototype.getCommunicationStatus = function (options, headers) {
502
- return UserService_1.UserService.getCommunicationStatus(options, headers);
503
- };
479
+ getCommunicationStatus(options, headers) {
480
+ return UserService.getCommunicationStatus(options, headers);
481
+ }
504
482
  ;
505
483
  /**
506
484
  * initiate verification
507
485
  * @param options
508
486
  * @returns
509
487
  */
510
- WebAuth.prototype.initiateAccountVerification = function (options) {
511
- VerificationService_1.VerificationService.initiateAccountVerification(options);
512
- };
488
+ initiateAccountVerification(options) {
489
+ VerificationService.initiateAccountVerification(options);
490
+ }
513
491
  ;
514
492
  /**
515
493
  * verify account
516
494
  * @param options
517
495
  * @returns
518
496
  */
519
- WebAuth.prototype.verifyAccount = function (options) {
520
- return VerificationService_1.VerificationService.verifyAccount(options);
521
- };
497
+ verifyAccount(options) {
498
+ return VerificationService.verifyAccount(options);
499
+ }
522
500
  ;
523
501
  /**
524
502
  * initiate reset password
525
503
  * @param options
526
504
  * @returns
527
505
  */
528
- WebAuth.prototype.initiateResetPassword = function (options) {
529
- return UserService_1.UserService.initiateResetPassword(options);
530
- };
506
+ initiateResetPassword(options) {
507
+ return UserService.initiateResetPassword(options);
508
+ }
531
509
  ;
532
510
  /**
533
511
  * handle reset password
534
512
  * @param options
535
513
  */
536
- WebAuth.prototype.handleResetPassword = function (options) {
537
- return UserService_1.UserService.handleResetPassword(options);
538
- };
514
+ handleResetPassword(options) {
515
+ return UserService.handleResetPassword(options);
516
+ }
539
517
  ;
540
518
  /**
541
519
  * reset password
542
520
  * @param options
543
521
  */
544
- WebAuth.prototype.resetPassword = function (options) {
545
- return UserService_1.UserService.resetPassword(options);
546
- };
522
+ resetPassword(options) {
523
+ return UserService.resetPassword(options);
524
+ }
547
525
  ;
548
526
  /**
549
527
  * get mfa list
550
528
  * @param options
551
529
  * @returns
552
530
  */
553
- WebAuth.prototype.getMFAList = function (options) {
554
- return VerificationService_1.VerificationService.getMFAList(options);
555
- };
531
+ getMFAList(options) {
532
+ return VerificationService.getMFAList(options);
533
+ }
556
534
  ;
557
535
  /**
558
536
  * cancel mfa
559
537
  * @param options
560
538
  * @returns
561
539
  */
562
- WebAuth.prototype.cancelMFA = function (options) {
563
- return VerificationService_1.VerificationService.cancelMFA(options);
564
- };
540
+ cancelMFA(options) {
541
+ return VerificationService.cancelMFA(options);
542
+ }
565
543
  ;
566
544
  /**
567
545
  * passwordless login
568
546
  * @param options
569
547
  */
570
- WebAuth.prototype.passwordlessLogin = function (options) {
571
- LoginService_1.LoginService.passwordlessLogin(options);
572
- };
548
+ passwordlessLogin(options) {
549
+ LoginService.passwordlessLogin(options);
550
+ }
573
551
  ;
574
552
  /**
575
553
  * get user consent details
576
554
  * @param options
577
555
  * @returns
578
556
  */
579
- WebAuth.prototype.getConsentDetails = function (options) {
580
- return ConsentService_1.ConsentService.getConsentDetails(options);
581
- };
557
+ getConsentDetails(options) {
558
+ return ConsentService.getConsentDetails(options);
559
+ }
582
560
  ;
583
561
  /**
584
562
  * accept consent
585
563
  * @param options
586
564
  * @returns
587
565
  */
588
- WebAuth.prototype.acceptConsent = function (options) {
589
- return ConsentService_1.ConsentService.acceptConsent(options);
590
- };
566
+ acceptConsent(options) {
567
+ return ConsentService.acceptConsent(options);
568
+ }
591
569
  ;
592
570
  /**
593
571
  * get scope consent details
594
572
  * @param options
595
573
  * @returns
596
574
  */
597
- WebAuth.prototype.loginPrecheck = function (options) {
598
- return TokenService_1.TokenService.loginPrecheck(options);
599
- };
575
+ loginPrecheck(options) {
576
+ return TokenService.loginPrecheck(options);
577
+ }
600
578
  ;
601
579
  /**
602
580
  * get scope consent version details
603
581
  * @param options
604
582
  * @returns
605
583
  */
606
- WebAuth.prototype.getConsentVersionDetails = function (options) {
607
- return ConsentService_1.ConsentService.getConsentVersionDetails(options);
608
- };
584
+ getConsentVersionDetails(options) {
585
+ return ConsentService.getConsentVersionDetails(options);
586
+ }
609
587
  ;
610
588
  /**
611
589
  * accept scope Consent
612
590
  * @param options
613
591
  * @returns
614
592
  */
615
- WebAuth.prototype.acceptScopeConsent = function (options) {
616
- return ConsentService_1.ConsentService.acceptScopeConsent(options);
617
- };
593
+ acceptScopeConsent(options) {
594
+ return ConsentService.acceptScopeConsent(options);
595
+ }
618
596
  ;
619
597
  /**
620
598
  * accept claim Consent
621
599
  * @param options
622
600
  * @returns
623
601
  */
624
- WebAuth.prototype.acceptClaimConsent = function (options) {
625
- return ConsentService_1.ConsentService.acceptClaimConsent(options);
626
- };
602
+ acceptClaimConsent(options) {
603
+ return ConsentService.acceptClaimConsent(options);
604
+ }
627
605
  ;
628
606
  /**
629
607
  * revoke claim Consent
630
608
  * @param options
631
609
  * @returns
632
610
  */
633
- WebAuth.prototype.revokeClaimConsent = function (options) {
634
- return ConsentService_1.ConsentService.revokeClaimConsent(options);
635
- };
611
+ revokeClaimConsent(options) {
612
+ return ConsentService.revokeClaimConsent(options);
613
+ }
636
614
  ;
637
615
  /**
638
616
  * get Deduplication details
639
617
  * @param options
640
618
  * @returns
641
619
  */
642
- WebAuth.prototype.getDeduplicationDetails = function (options) {
643
- return UserService_1.UserService.getDeduplicationDetails(options);
644
- };
620
+ getDeduplicationDetails(options) {
621
+ return UserService.getDeduplicationDetails(options);
622
+ }
645
623
  ;
646
624
  /**
647
625
  * deduplication login
648
626
  * @param options
649
627
  */
650
- WebAuth.prototype.deduplicationLogin = function (options) {
651
- UserService_1.UserService.deduplicationLogin(options);
652
- };
628
+ deduplicationLogin(options) {
629
+ UserService.deduplicationLogin(options);
630
+ }
653
631
  ;
654
632
  /**
655
633
  * register Deduplication
656
634
  * @param options
657
635
  * @returns
658
636
  */
659
- WebAuth.prototype.registerDeduplication = function (options) {
660
- return UserService_1.UserService.registerDeduplication(options);
661
- };
637
+ registerDeduplication(options) {
638
+ return UserService.registerDeduplication(options);
639
+ }
662
640
  ;
663
641
  /**
664
642
  * accepts any as the request
665
643
  * consent continue login
666
644
  * @param options
667
645
  */
668
- WebAuth.prototype.consentContinue = function (options) {
669
- LoginService_1.LoginService.consentContinue(options);
670
- };
646
+ consentContinue(options) {
647
+ LoginService.consentContinue(options);
648
+ }
671
649
  ;
672
650
  /**
673
651
  * mfa continue login
674
652
  * @param options
675
653
  */
676
- WebAuth.prototype.mfaContinue = function (options) {
677
- LoginService_1.LoginService.mfaContinue(options);
678
- };
654
+ mfaContinue(options) {
655
+ LoginService.mfaContinue(options);
656
+ }
679
657
  ;
680
658
  /**
681
659
  * change password continue
682
660
  * @param options
683
661
  */
684
- WebAuth.prototype.firstTimeChangePassword = function (options) {
685
- LoginService_1.LoginService.firstTimeChangePassword(options);
686
- };
662
+ firstTimeChangePassword(options) {
663
+ LoginService.firstTimeChangePassword(options);
664
+ }
687
665
  ;
688
666
  /**
689
667
  * change password
@@ -691,9 +669,9 @@ var WebAuth = /** @class */ (function () {
691
669
  * @param access_token
692
670
  * @returns
693
671
  */
694
- WebAuth.prototype.changePassword = function (options, access_token) {
695
- return UserService_1.UserService.changePassword(options, access_token);
696
- };
672
+ changePassword(options, access_token) {
673
+ return UserService.changePassword(options, access_token);
674
+ }
697
675
  ;
698
676
  /**
699
677
  * update profile
@@ -702,9 +680,9 @@ var WebAuth = /** @class */ (function () {
702
680
  * @param sub
703
681
  * @returns
704
682
  */
705
- WebAuth.prototype.updateProfile = function (options, access_token, sub) {
706
- return UserService_1.UserService.updateProfile(options, access_token, sub);
707
- };
683
+ updateProfile(options, access_token, sub) {
684
+ return UserService.updateProfile(options, access_token, sub);
685
+ }
708
686
  ;
709
687
  /**
710
688
  * To get user activities, call **getUserActivities()**.
@@ -726,17 +704,17 @@ var WebAuth = /** @class */ (function () {
726
704
  * });
727
705
  * ```
728
706
  */
729
- WebAuth.prototype.getUserActivities = function (options, accessToken) {
730
- var serviceURL = window.webAuthSettings.authority + '/activity-streams-srv/user-activities';
731
- return Helper_1.Helper.createHttpPromise(options, serviceURL, false, 'POST', accessToken);
732
- };
707
+ getUserActivities(options, accessToken) {
708
+ const serviceURL = window.webAuthSettings.authority + '/activity-streams-srv/user-activities';
709
+ return Helper.createHttpPromise(options, serviceURL, false, 'POST', accessToken);
710
+ }
733
711
  /**
734
712
  * @param access_token
735
713
  * @returns
736
714
  */
737
- WebAuth.prototype.getAllVerificationList = function (access_token) {
738
- return VerificationService_1.VerificationService.getAllVerificationList(access_token);
739
- };
715
+ getAllVerificationList(access_token) {
716
+ return VerificationService.getAllVerificationList(access_token);
717
+ }
740
718
  ;
741
719
  /**
742
720
  * initiate link accoount
@@ -744,9 +722,9 @@ var WebAuth = /** @class */ (function () {
744
722
  * @param access_token
745
723
  * @returns
746
724
  */
747
- WebAuth.prototype.initiateLinkAccount = function (options, access_token) {
748
- return UserService_1.UserService.initiateLinkAccount(options, access_token);
749
- };
725
+ initiateLinkAccount(options, access_token) {
726
+ return UserService.initiateLinkAccount(options, access_token);
727
+ }
750
728
  ;
751
729
  /**
752
730
  * complete link accoount
@@ -754,9 +732,9 @@ var WebAuth = /** @class */ (function () {
754
732
  * @param access_token
755
733
  * @returns
756
734
  */
757
- WebAuth.prototype.completeLinkAccount = function (options, access_token) {
758
- return UserService_1.UserService.completeLinkAccount(options, access_token);
759
- };
735
+ completeLinkAccount(options, access_token) {
736
+ return UserService.completeLinkAccount(options, access_token);
737
+ }
760
738
  ;
761
739
  /**
762
740
  * get linked users
@@ -764,9 +742,9 @@ var WebAuth = /** @class */ (function () {
764
742
  * @param sub
765
743
  * @returns
766
744
  */
767
- WebAuth.prototype.getLinkedUsers = function (access_token, sub) {
768
- return UserService_1.UserService.getLinkedUsers(access_token, sub);
769
- };
745
+ getLinkedUsers(access_token, sub) {
746
+ return UserService.getLinkedUsers(access_token, sub);
747
+ }
770
748
  ;
771
749
  /**
772
750
  * unlink accoount
@@ -774,9 +752,9 @@ var WebAuth = /** @class */ (function () {
774
752
  * @param identityId
775
753
  * @returns
776
754
  */
777
- WebAuth.prototype.unlinkAccount = function (access_token, identityId) {
778
- return UserService_1.UserService.unlinkAccount(access_token, identityId);
779
- };
755
+ unlinkAccount(access_token, identityId) {
756
+ return UserService.unlinkAccount(access_token, identityId);
757
+ }
780
758
  ;
781
759
  /**
782
760
  * To change profile image, call **updateProfileImage()**.
@@ -795,70 +773,70 @@ var WebAuth = /** @class */ (function () {
795
773
  * });
796
774
  * ```
797
775
  */
798
- WebAuth.prototype.updateProfileImage = function (options, access_token) {
799
- var serviceURL = window.webAuthSettings.authority + "/image-srv/profile/upload";
800
- var form = document.createElement('form');
776
+ updateProfileImage(options, access_token) {
777
+ const serviceURL = window.webAuthSettings.authority + "/image-srv/profile/upload";
778
+ const form = document.createElement('form');
801
779
  form.action = serviceURL;
802
780
  form.method = 'POST';
803
- var image_key = document.createElement('input');
781
+ const image_key = document.createElement('input');
804
782
  image_key.setAttribute('type', 'hidden');
805
783
  image_key.setAttribute('name', 'image_key');
806
784
  form.appendChild(image_key);
807
- var photo = document.createElement('input');
785
+ const photo = document.createElement('input');
808
786
  photo.setAttribute('type', 'file');
809
787
  photo.setAttribute('hidden', 'true');
810
788
  photo.setAttribute("name", "photo");
811
789
  form.appendChild(photo);
812
- var formdata = new FormData(form);
790
+ const formdata = new FormData(form);
813
791
  formdata.set('image_key', options.image_key);
814
792
  formdata.set('photo', options.photo, options.filename);
815
- return Helper_1.Helper.createHttpPromise(options, serviceURL, undefined, 'POST', access_token, null, formdata);
816
- };
793
+ return Helper.createHttpPromise(options, serviceURL, undefined, 'POST', access_token, null, formdata);
794
+ }
817
795
  ;
818
796
  /**
819
797
  * enrollVerification
820
798
  * @param options
821
799
  * @returns
822
800
  */
823
- WebAuth.prototype.initiateEnrollment = function (options, accessToken) {
824
- return VerificationService_1.VerificationService.initiateEnrollment(options, accessToken);
825
- };
801
+ initiateEnrollment(options, accessToken) {
802
+ return VerificationService.initiateEnrollment(options, accessToken);
803
+ }
826
804
  ;
827
805
  /**
828
806
  * update the status of notification
829
807
  * @param status_id
830
808
  * @returns
831
809
  */
832
- WebAuth.prototype.getEnrollmentStatus = function (status_id, accessToken) {
833
- return VerificationService_1.VerificationService.getEnrollmentStatus(status_id, accessToken);
834
- };
810
+ getEnrollmentStatus(status_id, accessToken) {
811
+ return VerificationService.getEnrollmentStatus(status_id, accessToken);
812
+ }
835
813
  ;
836
814
  /**
837
815
  * enrollVerification
838
816
  * @param options
839
817
  * @returns
840
818
  */
841
- WebAuth.prototype.enrollVerification = function (options) {
842
- return VerificationService_1.VerificationService.enrollVerification(options);
843
- };
819
+ enrollVerification(options) {
820
+ return VerificationService.enrollVerification(options);
821
+ }
844
822
  ;
845
823
  /**
846
824
  * checkVerificationTypeConfigured
847
825
  * @param options
848
826
  * @returns
849
827
  */
850
- WebAuth.prototype.checkVerificationTypeConfigured = function (options) {
851
- return VerificationService_1.VerificationService.checkVerificationTypeConfigured(options);
852
- };
828
+ checkVerificationTypeConfigured(options) {
829
+ return VerificationService.checkVerificationTypeConfigured(options);
830
+ }
853
831
  ;
854
832
  /**
855
833
  * deleteUserAccount
856
834
  * @param options
857
835
  * @returns
858
836
  */
859
- WebAuth.prototype.deleteUserAccount = function (options) {
860
- return UserService_1.UserService.deleteUserAccount(options);
861
- };
837
+ deleteUserAccount(options) {
838
+ return UserService.deleteUserAccount(options);
839
+ }
862
840
  ;
863
841
  /**
864
842
  * getMissingFields
@@ -879,15 +857,15 @@ var WebAuth = /** @class */ (function () {
879
857
  * ```
880
858
  *
881
859
  */
882
- WebAuth.prototype.getMissingFields = function (trackId, useSocialProvider) {
860
+ getMissingFields(trackId, useSocialProvider) {
883
861
  if (useSocialProvider) {
884
- var _serviceURL = window.webAuthSettings.authority + "/public-srv/public/trackinfo/" + useSocialProvider.requestId + "/" + trackId;
885
- return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, false, "GET");
862
+ const _serviceURL = window.webAuthSettings.authority + "/public-srv/public/trackinfo/" + useSocialProvider.requestId + "/" + trackId;
863
+ return Helper.createHttpPromise(undefined, _serviceURL, false, "GET");
886
864
  }
887
865
  else {
888
- return TokenService_1.TokenService.getMissingFields(trackId);
866
+ return TokenService.getMissingFields(trackId);
889
867
  }
890
- };
868
+ }
891
869
  ;
892
870
  /**
893
871
  * progressiveRegistration
@@ -895,68 +873,66 @@ var WebAuth = /** @class */ (function () {
895
873
  * @param headers
896
874
  * @returns
897
875
  */
898
- WebAuth.prototype.progressiveRegistration = function (options, headers) {
899
- return LoginService_1.LoginService.progressiveRegistration(options, headers);
900
- };
876
+ progressiveRegistration(options, headers) {
877
+ return LoginService.progressiveRegistration(options, headers);
878
+ }
901
879
  ;
902
880
  /**
903
881
  * device code flow - initiate
904
882
  */
905
- WebAuth.prototype.initiateDeviceCode = function (clientId) {
906
- return TokenService_1.TokenService.initiateDeviceCode(clientId);
907
- };
883
+ initiateDeviceCode(clientId) {
884
+ return TokenService.initiateDeviceCode(clientId);
885
+ }
908
886
  /**
909
887
  * device code flow - verify
910
888
  * @param code
911
889
  */
912
- WebAuth.prototype.deviceCodeVerify = function (code) {
913
- TokenService_1.TokenService.deviceCodeVerify(code);
914
- };
890
+ deviceCodeVerify(code) {
891
+ TokenService.deviceCodeVerify(code);
892
+ }
915
893
  /**
916
894
  * check if an user exists
917
895
  * @param options
918
896
  * @returns
919
897
  */
920
- WebAuth.prototype.userCheckExists = function (options) {
921
- return UserService_1.UserService.userCheckExists(options);
922
- };
898
+ userCheckExists(options) {
899
+ return UserService.userCheckExists(options);
900
+ }
923
901
  ;
924
902
  /**
925
903
  * To set accept language
926
904
  * @param acceptLanguage
927
905
  */
928
- WebAuth.prototype.setAcceptLanguageHeader = function (acceptLanguage) {
906
+ setAcceptLanguageHeader(acceptLanguage) {
929
907
  window.localeSettings = acceptLanguage;
930
- };
908
+ }
931
909
  /**
932
910
  * initiate mfa
933
911
  * @param options
934
912
  * @returns
935
913
  */
936
- WebAuth.prototype.initiateMFA = function (options, accessToken) {
914
+ initiateMFA(options, accessToken) {
937
915
  // TODO: remove accessToken parameter in the next major release
938
916
  if (accessToken) {
939
- return VerificationService_1.VerificationService.initiateMFA(options, accessToken);
917
+ return VerificationService.initiateMFA(options, accessToken);
940
918
  }
941
- return VerificationService_1.VerificationService.initiateMFA(options);
942
- };
919
+ return VerificationService.initiateMFA(options);
920
+ }
943
921
  ;
944
922
  /**
945
923
  * authenticate mfa
946
924
  * @param options
947
925
  * @returns
948
926
  */
949
- WebAuth.prototype.authenticateMFA = function (options) {
950
- return VerificationService_1.VerificationService.authenticateMFA(options);
951
- };
927
+ authenticateMFA(options) {
928
+ return VerificationService.authenticateMFA(options);
929
+ }
952
930
  ;
953
931
  /**
954
932
  * offline token check
955
933
  */
956
- WebAuth.prototype.offlineTokenCheck = function (accessToken) {
957
- return TokenService_1.TokenService.offlineTokenCheck(accessToken);
958
- };
934
+ offlineTokenCheck(accessToken) {
935
+ return TokenService.offlineTokenCheck(accessToken);
936
+ }
959
937
  ;
960
- return WebAuth;
961
- }());
962
- exports.WebAuth = WebAuth;
938
+ }