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,8 +1,5 @@
1
- "use strict";
2
- exports.__esModule = true;
3
- exports.UserService = void 0;
4
- var Helper_1 = require("./Helper");
5
- var UserService;
1
+ import { Helper, CustomException } from "./Helper";
2
+ export var UserService;
6
3
  (function (UserService) {
7
4
  /**
8
5
  * To get the user profile information by using cidaas internal api, call **getUserProfile()**.
@@ -22,10 +19,10 @@ var UserService;
22
19
  */
23
20
  function getUserProfile(options) {
24
21
  if (!options.access_token) {
25
- throw new Helper_1.CustomException("access_token cannot be empty", 417);
22
+ throw new CustomException("access_token cannot be empty", 417);
26
23
  }
27
- var _serviceURL = window.webAuthSettings.authority + "/users-srv/userinfo";
28
- return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, undefined, "GET", options.access_token);
24
+ const _serviceURL = window.webAuthSettings.authority + "/users-srv/userinfo";
25
+ return Helper.createHttpPromise(undefined, _serviceURL, undefined, "GET", options.access_token);
29
26
  }
30
27
  UserService.getUserProfile = getUserProfile;
31
28
  ;
@@ -58,11 +55,11 @@ var UserService;
58
55
  *```
59
56
  */
60
57
  function register(options, headers) {
61
- var _serviceURL = window.webAuthSettings.authority + "/users-srv/register";
58
+ let _serviceURL = window.webAuthSettings.authority + "/users-srv/register";
62
59
  if (options.invite_id) {
63
60
  _serviceURL = _serviceURL + "?invite_id=" + options.invite_id;
64
61
  }
65
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST", undefined, headers);
62
+ return Helper.createHttpPromise(options, _serviceURL, false, "POST", undefined, headers);
66
63
  }
67
64
  UserService.register = register;
68
65
  ;
@@ -85,14 +82,14 @@ var UserService;
85
82
  * ```
86
83
  */
87
84
  function getInviteUserDetails(options) {
88
- var _serviceURL = "";
85
+ let _serviceURL = "";
89
86
  if (options.callLatestAPI) {
90
87
  _serviceURL = window.webAuthSettings.authority + "/useractions-srv/invitations/" + options.invite_id;
91
88
  }
92
89
  else {
93
90
  _serviceURL = window.webAuthSettings.authority + "/users-srv/invite/info/" + options.invite_id;
94
91
  }
95
- return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, false, "GET");
92
+ return Helper.createHttpPromise(undefined, _serviceURL, false, "GET");
96
93
  }
97
94
  UserService.getInviteUserDetails = getInviteUserDetails;
98
95
  ;
@@ -110,8 +107,8 @@ var UserService;
110
107
  * ```
111
108
  */
112
109
  function getCommunicationStatus(options, headers) {
113
- var _serviceURL = window.webAuthSettings.authority + "/users-srv/user/communication/status/" + options.sub;
114
- return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, false, "GET", undefined, headers);
110
+ let _serviceURL = window.webAuthSettings.authority + "/users-srv/user/communication/status/" + options.sub;
111
+ return Helper.createHttpPromise(undefined, _serviceURL, false, "GET", undefined, headers);
115
112
  }
116
113
  UserService.getCommunicationStatus = getCommunicationStatus;
117
114
  ;
@@ -134,7 +131,7 @@ var UserService;
134
131
  */
135
132
  function initiateResetPassword(options) {
136
133
  var _serviceURL = window.webAuthSettings.authority + "/users-srv/resetpassword/initiate";
137
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST");
134
+ return Helper.createHttpPromise(options, _serviceURL, false, "POST");
138
135
  }
139
136
  UserService.initiateResetPassword = initiateResetPassword;
140
137
  ;
@@ -156,20 +153,20 @@ var UserService;
156
153
  */
157
154
  function handleResetPassword(options, handleResponseAsJson) {
158
155
  try {
159
- var url = window.webAuthSettings.authority + "/users-srv/resetpassword/validatecode";
156
+ const url = window.webAuthSettings.authority + "/users-srv/resetpassword/validatecode";
160
157
  if (!handleResponseAsJson) {
161
158
  // current handling will redirect and give query parameters
162
- var form = Helper_1.Helper.createForm(url, options);
159
+ let form = Helper.createForm(url, options);
163
160
  document.body.appendChild(form);
164
161
  form.submit();
165
162
  }
166
163
  else {
167
164
  // older cidaas service handling return json object
168
- return Helper_1.Helper.createHttpPromise(options, url, false, "POST");
165
+ return Helper.createHttpPromise(options, url, false, "POST");
169
166
  }
170
167
  }
171
168
  catch (ex) {
172
- throw new Helper_1.CustomException(ex, 417);
169
+ throw new CustomException(ex, 417);
173
170
  }
174
171
  }
175
172
  UserService.handleResetPassword = handleResetPassword;
@@ -193,21 +190,21 @@ var UserService;
193
190
  * ```
194
191
  */
195
192
  function resetPassword(options, handleResponseAsJson) {
196
- var url = window.webAuthSettings.authority + "/users-srv/resetpassword/accept";
193
+ const url = window.webAuthSettings.authority + "/users-srv/resetpassword/accept";
197
194
  try {
198
195
  if (!handleResponseAsJson) {
199
196
  // current handling will redirect and give query parameters
200
- var form = Helper_1.Helper.createForm(url, options);
197
+ let form = Helper.createForm(url, options);
201
198
  document.body.appendChild(form);
202
199
  form.submit();
203
200
  }
204
201
  else {
205
202
  // older cidaas service handling return json object
206
- return Helper_1.Helper.createHttpPromise(options, url, false, "POST");
203
+ return Helper.createHttpPromise(options, url, false, "POST");
207
204
  }
208
205
  }
209
206
  catch (ex) {
210
- throw new Helper_1.CustomException(ex, 417);
207
+ throw new CustomException(ex, 417);
211
208
  }
212
209
  }
213
210
  UserService.resetPassword = resetPassword;
@@ -226,8 +223,8 @@ var UserService;
226
223
  * ```
227
224
  */
228
225
  function getDeduplicationDetails(options) {
229
- var _serviceURL = window.webAuthSettings.authority + "/users-srv/deduplication/info/" + options.trackId;
230
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "GET");
226
+ const _serviceURL = window.webAuthSettings.authority + "/users-srv/deduplication/info/" + options.trackId;
227
+ return Helper.createHttpPromise(options, _serviceURL, false, "GET");
231
228
  }
232
229
  UserService.getDeduplicationDetails = getDeduplicationDetails;
233
230
  ;
@@ -244,13 +241,13 @@ var UserService;
244
241
  */
245
242
  function deduplicationLogin(options) {
246
243
  try {
247
- var url = window.webAuthSettings.authority + "/users-srv/deduplication/login/redirection?trackId=" + options.trackId + "&requestId=" + options.requestId + "&sub=" + options.sub;
248
- var form = Helper_1.Helper.createForm(url, {});
244
+ const url = window.webAuthSettings.authority + "/users-srv/deduplication/login/redirection?trackId=" + options.trackId + "&requestId=" + options.requestId + "&sub=" + options.sub;
245
+ const form = Helper.createForm(url, {});
249
246
  document.body.appendChild(form);
250
247
  form.submit();
251
248
  }
252
249
  catch (ex) {
253
- throw new Helper_1.CustomException(ex, 417);
250
+ throw new CustomException(ex, 417);
254
251
  }
255
252
  }
256
253
  UserService.deduplicationLogin = deduplicationLogin;
@@ -269,8 +266,8 @@ var UserService;
269
266
  * ```
270
267
  */
271
268
  function registerDeduplication(options) {
272
- var _serviceURL = window.webAuthSettings.authority + "/users-srv/deduplication/register/" + options.trackId;
273
- return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, undefined, "POST");
269
+ const _serviceURL = window.webAuthSettings.authority + "/users-srv/deduplication/register/" + options.trackId;
270
+ return Helper.createHttpPromise(undefined, _serviceURL, undefined, "POST");
274
271
  }
275
272
  UserService.registerDeduplication = registerDeduplication;
276
273
  ;
@@ -294,7 +291,7 @@ var UserService;
294
291
  */
295
292
  function changePassword(options, access_token) {
296
293
  var _serviceURL = window.webAuthSettings.authority + "/users-srv/changepassword";
297
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST", access_token);
294
+ return Helper.createHttpPromise(options, _serviceURL, false, "POST", access_token);
298
295
  }
299
296
  UserService.changePassword = changePassword;
300
297
  ;
@@ -316,8 +313,8 @@ var UserService;
316
313
  * ```
317
314
  */
318
315
  function updateProfile(options, access_token, sub) {
319
- var _serviceURL = window.webAuthSettings.authority + "/users-srv/user/profile/" + sub;
320
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "PUT", access_token);
316
+ const _serviceURL = window.webAuthSettings.authority + "/users-srv/user/profile/" + sub;
317
+ return Helper.createHttpPromise(options, _serviceURL, false, "PUT", access_token);
321
318
  }
322
319
  UserService.updateProfile = updateProfile;
323
320
  ;
@@ -341,7 +338,7 @@ var UserService;
341
338
  function initiateLinkAccount(options, access_token) {
342
339
  options.user_name_type = 'email';
343
340
  var _serviceURL = window.webAuthSettings.authority + "/users-srv/user/link/initiate";
344
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST", access_token);
341
+ return Helper.createHttpPromise(options, _serviceURL, false, "POST", access_token);
345
342
  }
346
343
  UserService.initiateLinkAccount = initiateLinkAccount;
347
344
  ;
@@ -363,7 +360,7 @@ var UserService;
363
360
  */
364
361
  function completeLinkAccount(options, access_token) {
365
362
  var _serviceURL = window.webAuthSettings.authority + "/users-srv/user/link/complete";
366
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST", access_token);
363
+ return Helper.createHttpPromise(options, _serviceURL, false, "POST", access_token);
367
364
  }
368
365
  UserService.completeLinkAccount = completeLinkAccount;
369
366
  ;
@@ -385,7 +382,7 @@ var UserService;
385
382
  */
386
383
  function getLinkedUsers(access_token, sub) {
387
384
  var _serviceURL = window.webAuthSettings.authority + "/users-srv/userinfo/social/" + sub;
388
- return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, false, "GET", access_token);
385
+ return Helper.createHttpPromise(undefined, _serviceURL, false, "GET", access_token);
389
386
  }
390
387
  UserService.getLinkedUsers = getLinkedUsers;
391
388
  ;
@@ -407,7 +404,7 @@ var UserService;
407
404
  */
408
405
  function unlinkAccount(access_token, identityId) {
409
406
  var _serviceURL = window.webAuthSettings.authority + "/users-srv/user/unlink/" + identityId;
410
- return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, false, "POST", access_token);
407
+ return Helper.createHttpPromise(undefined, _serviceURL, false, "POST", access_token);
411
408
  }
412
409
  UserService.unlinkAccount = unlinkAccount;
413
410
  ;
@@ -430,7 +427,7 @@ var UserService;
430
427
  */
431
428
  function deleteUserAccount(options) {
432
429
  var _serviceURL = window.webAuthSettings.authority + "/users-srv/user/unregister/scheduler/schedule/" + options.sub;
433
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, undefined, "POST", options.access_token);
430
+ return Helper.createHttpPromise(options, _serviceURL, undefined, "POST", options.access_token);
434
431
  }
435
432
  UserService.deleteUserAccount = deleteUserAccount;
436
433
  ;
@@ -450,7 +447,7 @@ var UserService;
450
447
  * ```
451
448
  */
452
449
  function userCheckExists(options) {
453
- var queryParameter = '';
450
+ let queryParameter = '';
454
451
  if (options.webfinger || options.rememberMe) {
455
452
  queryParameter += '?';
456
453
  if (options.webfinger) {
@@ -464,8 +461,8 @@ var UserService;
464
461
  }
465
462
  }
466
463
  var _serviceURL = window.webAuthSettings.authority + "/useractions-srv/userexistence/" + options.requestId + queryParameter;
467
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, undefined, "POST");
464
+ return Helper.createHttpPromise(options, _serviceURL, undefined, "POST");
468
465
  }
469
466
  UserService.userCheckExists = userCheckExists;
470
467
  ;
471
- })(UserService = exports.UserService || (exports.UserService = {}));
468
+ })(UserService || (UserService = {}));
@@ -1,8 +1,5 @@
1
- "use strict";
2
- exports.__esModule = true;
3
- exports.VerificationService = void 0;
4
- var Helper_1 = require("./Helper");
5
- var VerificationService;
1
+ import { Helper, CustomException } from "./Helper";
2
+ export var VerificationService;
6
3
  (function (VerificationService) {
7
4
  /**
8
5
  * To initiate the account verification, call **initiateAccountVerification()**. This will send verification code email or sms or ivr based on the verificationMedium you mentioned.
@@ -23,13 +20,13 @@ var VerificationService;
23
20
  */
24
21
  function initiateAccountVerification(options) {
25
22
  try {
26
- var url = window.webAuthSettings.authority + "/verification-srv/account/initiate";
27
- var form = Helper_1.Helper.createForm(url, options);
23
+ const url = window.webAuthSettings.authority + "/verification-srv/account/initiate";
24
+ let form = Helper.createForm(url, options);
28
25
  document.body.appendChild(form);
29
26
  form.submit();
30
27
  }
31
28
  catch (ex) {
32
- throw new Helper_1.CustomException(ex, 417);
29
+ throw new CustomException(ex, 417);
33
30
  }
34
31
  }
35
32
  VerificationService.initiateAccountVerification = initiateAccountVerification;
@@ -51,7 +48,7 @@ var VerificationService;
51
48
  */
52
49
  function verifyAccount(options) {
53
50
  var _serviceURL = window.webAuthSettings.authority + "/verification-srv/account/verify";
54
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST");
51
+ return Helper.createHttpPromise(options, _serviceURL, false, "POST");
55
52
  }
56
53
  VerificationService.verifyAccount = verifyAccount;
57
54
  ;
@@ -72,7 +69,7 @@ var VerificationService;
72
69
  */
73
70
  function getMFAList(options) {
74
71
  var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/setup/public/configured/list";
75
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST");
72
+ return Helper.createHttpPromise(options, _serviceURL, false, "POST");
76
73
  }
77
74
  VerificationService.getMFAList = getMFAList;
78
75
  ;
@@ -93,7 +90,7 @@ var VerificationService;
93
90
  */
94
91
  function cancelMFA(options) {
95
92
  var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/authenticate/cancel/" + options.type;
96
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, undefined, "POST");
93
+ return Helper.createHttpPromise(options, _serviceURL, undefined, "POST");
97
94
  }
98
95
  VerificationService.cancelMFA = cancelMFA;
99
96
  ;
@@ -113,8 +110,8 @@ var VerificationService;
113
110
  * ```
114
111
  */
115
112
  function getAllVerificationList(access_token) {
116
- var _serviceURL = "".concat(window.webAuthSettings.authority, "/verification-srv/config/list");
117
- return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, undefined, "GET", access_token);
113
+ const _serviceURL = `${window.webAuthSettings.authority}/verification-srv/config/list`;
114
+ return Helper.createHttpPromise(undefined, _serviceURL, undefined, "GET", access_token);
118
115
  }
119
116
  VerificationService.getAllVerificationList = getAllVerificationList;
120
117
  ;
@@ -143,7 +140,7 @@ var VerificationService;
143
140
  */
144
141
  function initiateEnrollment(options, accessToken) {
145
142
  var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/setup/initiate/" + options.verification_type;
146
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, undefined, "POST", accessToken);
143
+ return Helper.createHttpPromise(options, _serviceURL, undefined, "POST", accessToken);
147
144
  }
148
145
  VerificationService.initiateEnrollment = initiateEnrollment;
149
146
  ;
@@ -163,7 +160,7 @@ var VerificationService;
163
160
  */
164
161
  function getEnrollmentStatus(status_id, accessToken) {
165
162
  var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/notification/status/" + status_id;
166
- return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, undefined, "POST", accessToken);
163
+ return Helper.createHttpPromise(undefined, _serviceURL, undefined, "POST", accessToken);
167
164
  }
168
165
  VerificationService.getEnrollmentStatus = getEnrollmentStatus;
169
166
  ;
@@ -192,7 +189,7 @@ var VerificationService;
192
189
  */
193
190
  function enrollVerification(options) {
194
191
  var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/setup/enroll/" + options.verification_type;
195
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, undefined, "POST");
192
+ return Helper.createHttpPromise(options, _serviceURL, undefined, "POST");
196
193
  }
197
194
  VerificationService.enrollVerification = enrollVerification;
198
195
  ;
@@ -214,7 +211,7 @@ var VerificationService;
214
211
  */
215
212
  function checkVerificationTypeConfigured(options) {
216
213
  var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/setup/public/configured/check/" + options.verification_type;
217
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, undefined, "POST");
214
+ return Helper.createHttpPromise(options, _serviceURL, undefined, "POST");
218
215
  }
219
216
  VerificationService.checkVerificationTypeConfigured = checkVerificationTypeConfigured;
220
217
  ;
@@ -245,9 +242,9 @@ var VerificationService;
245
242
  var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/authenticate/initiate/" + options.type;
246
243
  // TODO: remove accessToken parameter in the next major release
247
244
  if (accessToken) {
248
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST", accessToken);
245
+ return Helper.createHttpPromise(options, _serviceURL, false, "POST", accessToken);
249
246
  }
250
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST");
247
+ return Helper.createHttpPromise(options, _serviceURL, false, "POST");
251
248
  }
252
249
  VerificationService.initiateMFA = initiateMFA;
253
250
  ;
@@ -271,8 +268,8 @@ var VerificationService;
271
268
  */
272
269
  function authenticateMFA(options) {
273
270
  var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/authenticate/authenticate/" + options.type;
274
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, undefined, "POST");
271
+ return Helper.createHttpPromise(options, _serviceURL, undefined, "POST");
275
272
  }
276
273
  VerificationService.authenticateMFA = authenticateMFA;
277
274
  ;
278
- })(VerificationService = exports.VerificationService || (exports.VerificationService = {}));
275
+ })(VerificationService || (VerificationService = {}));
@@ -1,39 +1,58 @@
1
- import { SigninState, UserManagerSettings } from "oidc-client-ts";
1
+ import { OidcSettings, LoginRedirectOptions, LogoutRedirectOptions, PopupSignInOptions, PopupSignOutOptions, SilentSignInOptions, LoginRequestOptions, User, LogoutResponse } from '../authentication';
2
2
  import { AccessTokenRequest, TokenIntrospectionEntity, UserEntity, ResetPasswordEntity, IConfiguredListRequestEntity, IInitVerificationAuthenticationRequestEntity, FindUserEntity, IUserEntity, IEnrollVerificationSetupRequestEntity, IUserLinkEntity, ChangePasswordEntity, IConsentAcceptEntity, IAuthVerificationAuthenticationRequestEntity, LoginFormRequestEntity, AccountVerificationRequestEntity, ValidateResetPasswordEntity, AcceptResetPasswordEntity, PhysicalVerificationLoginRequest, IChangePasswordEntity, IUserActivityPayloadEntity } from "./Entities";
3
3
  export declare const createPreloginWebauth: (authority: string) => WebAuth;
4
4
  export declare class WebAuth {
5
- constructor(settings: UserManagerSettings);
5
+ constructor(settings: OidcSettings);
6
6
  /**
7
- * login
7
+ * Generate and redirect to authz url in same window for logging in.
8
+ * @param {LoginRedirectOptions} options options options to over-ride the client config for redirect login
8
9
  */
9
- loginWithBrowser(): any;
10
+ loginWithBrowser(options?: LoginRedirectOptions): Promise<void>;
10
11
  /**
11
- * popupSignIn
12
+ * Generate and open authz url in a popup window.
13
+ * On successful sign in, authenticated user is returned.
14
+ *
15
+ * @param {PopupSignInOptions} options options to over-ride the client config for popup sign in
16
+ * @returns {Promise<User>} Authenticated user
17
+ * @throws error if unable to get the parse and get user
12
18
  */
13
- popupSignIn(): any;
19
+ popupSignIn(options?: PopupSignInOptions): Promise<User>;
14
20
  /**
15
- * silentSignIn
21
+ * Generate and navigate to authz url in an iFrame.
22
+ * On successful sign in, authenticated user is returned
23
+ *
24
+ * @param {SilentSignInOptions} options options to over-ride the client config for silent sign in
25
+ * @returns {Promise<User>} Authenticated user
26
+ * @throws error if unable to get the parse and get user
16
27
  */
17
- silentSignIn(): any;
28
+ silentSignIn(options?: SilentSignInOptions): Promise<User>;
18
29
  /**
19
- * register
30
+ * Generate and redirect to authz url in same window for register view.
31
+ * @param {LoginRedirectOptions} options options options to over-ride the client config for redirect login
20
32
  */
21
- registerWithBrowser(): any;
33
+ registerWithBrowser(options?: LoginRedirectOptions): Promise<void>;
22
34
  /**
23
- * login callback
24
- * @returns
35
+ * Once login successful, it will automatically redirects you to the redirect url whatever you mentioned in the options.
36
+ * To complete the login process, call **loginCallback()**. This will parses the access_token, id_token and whatever in hash in the redirect url.
37
+ *
38
+ * @param {string} url optional url from where to process the login state
39
+ * @returns {Promise<User>} Authenticated user
40
+ * @throws error if unable to get the parse and get user
25
41
  */
26
- loginCallback(): any;
42
+ loginCallback(url?: string): Promise<User>;
27
43
  /**
28
- * popup signin callback
29
- * @returns
44
+ * To complete the popup login process, call **popupSignInCallback()** from the popup login window.
45
+ * Popup window will be closed after doing callback
46
+ *
47
+ * @param {string} url optional url to read sign-in callback state from
48
+ * @param {boolean} keepOpen true to keep the popup open even after sign in, else false
30
49
  */
31
- popupSignInCallback(): any;
50
+ popupSignInCallback(url?: string, keepOpen?: boolean): Promise<void>;
32
51
  /**
33
- * silent signin callback
34
- * @returns
52
+ * Returns a promise to notify the parent window of response from authz service
53
+ * @param {string} url optional url to check authz response, if none window.location is used
35
54
  */
36
- silentSignInCallback(): any;
55
+ silentSignInCallback(url?: string): Promise<void>;
37
56
  /**
38
57
  * 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.
39
58
  * @example
@@ -44,28 +63,30 @@ export declare class WebAuth {
44
63
  * // your failure code here
45
64
  * });
46
65
  * ```
66
+ * @return {Promise<User|null>} returns authenticated user if present, else null
47
67
  */
48
- getUserInfo(): Promise<any>;
68
+ getUserInfo(): Promise<User | null>;
49
69
  /**
50
70
  * logout by using oidc-client-ts library
51
- * @returns
71
+ * @param {LogoutRedirectOptions} options optional options to over-ride logout options on redirect
52
72
  */
53
- logout(): any;
73
+ logout(options?: LogoutRedirectOptions): Promise<void>;
54
74
  /**
55
- * popup signout
56
- * @returns
75
+ * logout by using oidc-client-ts library
76
+ * @param {PopupSignOutOptions} options optional options to over-ride logout options using popup window
57
77
  */
58
- popupSignOut(): any;
78
+ popupSignOut(options?: PopupSignOutOptions): Promise<void>;
59
79
  /**
60
- * logout callback
61
- * @returns
80
+ * get the logout call state from the url provided, if none is provided current window url is used
81
+ * @returns {Promise<LogoutResponse>} logout response from auth service
62
82
  */
63
- logoutCallback(): any;
83
+ logoutCallback(url?: string): Promise<LogoutResponse>;
64
84
  /**
65
- * popup signout callback
66
- * @returns
85
+ * listen to popup sign out event
86
+ * @param {string} url optional url to override to check for sign out state
87
+ * @param {boolean} keepOpen true to keep the popup open even after sign out, else false
67
88
  */
68
- popupSignOutCallback(): any;
89
+ popupSignOutCallback(url?: string, keepOpen?: boolean): Promise<void>;
69
90
  /**
70
91
  * To get the generated login url, call **getLoginURL()**. This will call authz service and generate login url to be used.
71
92
  * @example
@@ -76,8 +97,10 @@ export declare class WebAuth {
76
97
  * // your failure code here
77
98
  * });
78
99
  * ```
100
+ * @param {LoginRequestOptions} options login options to override {@link window.webAuthSettings} provided
101
+ * @return {Promise<string>} authz url for login
79
102
  */
80
- getLoginURL(state?: SigninState): Promise<unknown>;
103
+ getLoginURL(options?: LoginRequestOptions): Promise<string>;
81
104
  /**
82
105
  * Each and every proccesses starts with requestId, it is an entry point to login or register. For getting the requestId, call **getRequestId()**.
83
106
  * @example