oidc-spa 8.2.6 → 8.2.8

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.
@@ -71,7 +71,7 @@ const instancesThatCantUseIframes_1 = require("./instancesThatCantUseIframes");
71
71
  const desiredPostLoginRedirectUrl_1 = require("./desiredPostLoginRedirectUrl");
72
72
  const homeAndRedirectUri_1 = require("./homeAndRedirectUri");
73
73
  // NOTE: Replaced at build time
74
- const VERSION = "8.2.6";
74
+ const VERSION = "8.2.8";
75
75
  const globalContext = {
76
76
  prOidcByConfigId: new Map(),
77
77
  hasLogoutBeenCalled: (0, id_1.id)(false)
@@ -34,7 +34,7 @@ import { evtIsThereMoreThanOneInstanceThatCantUserIframes, notifyNewInstanceThat
34
34
  import { getDesiredPostLoginRedirectUrl } from "./desiredPostLoginRedirectUrl";
35
35
  import { getHomeAndRedirectUri } from "./homeAndRedirectUri";
36
36
  // NOTE: Replaced at build time
37
- const VERSION = "8.2.6";
37
+ const VERSION = "8.2.8";
38
38
  const globalContext = {
39
39
  prOidcByConfigId: new Map(),
40
40
  hasLogoutBeenCalled: id(false)
@@ -66,7 +66,7 @@ export declare class Keycloak {
66
66
  * @param initOptions Initialization options.
67
67
  * @returns A promise to set functions to be invoked on success or error.
68
68
  */
69
- init(initOptions?: KeycloakInitOptions): Promise<boolean>;
69
+ init: (initOptions?: KeycloakInitOptions) => Promise<boolean>;
70
70
  /**
71
71
  * Is true if the user is authenticated, false otherwise.
72
72
  */
@@ -215,29 +215,29 @@ export declare class Keycloak {
215
215
  * Redirects to login form.
216
216
  * @param options Login options.
217
217
  */
218
- login(options?: KeycloakLoginOptions & {
218
+ login: (options?: KeycloakLoginOptions & {
219
219
  doesCurrentHrefRequiresAuth?: boolean;
220
- }): Promise<never>;
220
+ }) => Promise<never>;
221
221
  /**
222
222
  * Redirects to logout.
223
223
  * @param options Logout options.
224
224
  */
225
- logout(options?: KeycloakLogoutOptions): Promise<never>;
225
+ logout: (options?: KeycloakLogoutOptions) => Promise<never>;
226
226
  /**
227
227
  * Redirects to registration form.
228
228
  * @param options The options used for the registration.
229
229
  */
230
- register(options?: KeycloakRegisterOptions): Promise<never>;
230
+ register: (options?: KeycloakRegisterOptions) => Promise<never>;
231
231
  /**
232
232
  * Redirects to the Account Management Console.
233
233
  */
234
- accountManagement(options?: {
234
+ accountManagement: (options?: {
235
235
  /**
236
236
  * Specifies the uri to redirect to when redirecting back to the application.
237
237
  */
238
238
  redirectUri?: string;
239
239
  locale?: string;
240
- }): Promise<never>;
240
+ }) => Promise<never>;
241
241
  /**
242
242
  * Returns the URL to login form.
243
243
  * @param options Supports same options as Keycloak#login.
@@ -260,15 +260,15 @@ export declare class Keycloak {
260
260
  * Returns the URL to the Account Management Console.
261
261
  * @param options The options used for creating the account URL.
262
262
  */
263
- createAccountUrl(options?: KeycloakAccountOptions & {
263
+ createAccountUrl: (options?: KeycloakAccountOptions & {
264
264
  locale?: string;
265
- }): string;
265
+ }) => string;
266
266
  /**
267
267
  * Returns true if the token has less than `minValidity` seconds left before
268
268
  * it expires.
269
269
  * @param minValidity If not specified, `0` is used.
270
270
  */
271
- isTokenExpired(minValidity?: number): boolean;
271
+ isTokenExpired: (minValidity?: number) => boolean;
272
272
  /**
273
273
  * If the token expires within `minValidity` seconds, the token is refreshed.
274
274
  * If the session status iframe is enabled, the session status is also
@@ -288,7 +288,7 @@ export declare class Keycloak {
288
288
  * alert('Failed to refresh the token, or the session has expired');
289
289
  * });
290
290
  */
291
- updateToken(minValidity?: number): Promise<boolean>;
291
+ updateToken: (minValidity?: number) => Promise<boolean>;
292
292
  /**
293
293
  * Clears authentication state, including tokens. This can be useful if
294
294
  * the application has detected the session was expired, for example if
@@ -304,22 +304,22 @@ export declare class Keycloak {
304
304
  * Returns true if the token has the given realm role.
305
305
  * @param role A realm role name.
306
306
  */
307
- hasRealmRole(role: string): boolean;
307
+ hasRealmRole: (role: string) => boolean;
308
308
  /**
309
309
  * Returns true if the token has the given role for the resource.
310
310
  * @param role A role name.
311
311
  * @param resource If not specified, `clientId` is used.
312
312
  */
313
- hasResourceRole(role: string, resource?: string): boolean;
313
+ hasResourceRole: (role: string, resource?: string) => boolean;
314
314
  /**
315
315
  * Loads the user's profile.
316
316
  * @returns A promise to set functions to be invoked on success or error.
317
317
  */
318
- loadUserProfile(): Promise<KeycloakProfile>;
318
+ loadUserProfile: () => Promise<KeycloakProfile>;
319
319
  /**
320
320
  * @private Undocumented.
321
321
  */
322
- loadUserInfo(): Promise<KeycloakUserInfo>;
322
+ loadUserInfo: () => Promise<KeycloakUserInfo>;
323
323
  /** Get the underlying oidc-spa instance */
324
324
  get oidc(): Oidc<Record<string, unknown>>;
325
325
  }