Skip to content

Commit

Permalink
chore: release v1.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
ayZagen committed May 4, 2023
1 parent 660901c commit 3970fbd
Show file tree
Hide file tree
Showing 37 changed files with 2,705 additions and 2,414 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@


## [1.2.3](https://github.com/PlusAuth/oidc-client-js/compare/v1.2.2...v1.2.3) (2023-05-04)


### Bug Fixes

* merge options properly, ignore undefined ([cfd0cd8](https://github.com/PlusAuth/oidc-client-js/commit/cfd0cd8d4c4e267f6c714109461ed0ff2f4bc0fc)), closes [#13](https://github.com/PlusAuth/oidc-client-js/issues/13)

## [1.2.2](https://github.com/PlusAuth/oidc-client-js/compare/v1.2.1...v1.2.2) (2023-04-09)

## [1.2.1](https://github.com/PlusAuth/oidc-client-js/compare/v1.2.0...v1.2.1) (2023-03-27)
Expand Down
67 changes: 46 additions & 21 deletions dist/oidc-client.esm.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/oidc-client.esm.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/oidc-client.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/oidc-client.min.js.map

Large diffs are not rendered by default.

57 changes: 37 additions & 20 deletions dist/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,27 @@ declare const Events: {
};
type EventTypes = 'user_logout' | 'user_login' | 'silent_renew_success' | 'silent_renew_error' | 'session_change' | 'session_error';

interface StateStore {
init?(): Promise<StateStore>;
interface StateStore<T = Record<string, any>> {
init?(): Promise<StateStore<T>>;
}
declare abstract class StateStore {
declare abstract class StateStore<T = Record<string, any>> {
prefix: string;
constructor(prefix?: string);
abstract get(key: string): Promise<Record<string, any> | null>;
abstract set(key: string, value: Record<string, any>): Promise<void>;
abstract get(key: string): Promise<T | null>;
abstract set(key: string, value: T): Promise<void>;
abstract del(key: string): Promise<void>;
abstract clear(maxAge?: number): Promise<void>;
}

declare class LocalStorageStateStore extends StateStore {
declare class LocalStorageStateStore<T = any> extends StateStore<T> {
constructor(prefix?: string);
get(key: string): Promise<Record<string, any> | null>;
set(key: string, value: Record<string, any>): Promise<void>;
get(key: string): Promise<T | null>;
set(key: string, value: T): Promise<void>;
del(key: string): Promise<void>;
clear(before?: number): Promise<void>;
}

declare class InMemoryStateStore extends StateStore {
declare class InMemoryStateStore<T = any> extends StateStore<T> {
map: Map<any, any>;
clear(before?: number): Promise<void>;
del(key: string): Promise<void>;
Expand Down Expand Up @@ -168,7 +168,7 @@ interface IPlusAuthClientOptions extends Omit<AuthRequestOptions, 'request_type'
/**
* Custom state store. See {@link StateStore}
*/
stateStore?: StateStore;
stateStore?: StateStore<StateRecord>;
/**
* If `true`, refresh tokens will be used for renewing access token. If `false`, authorization request will be
* performed silently in an iframe.
Expand Down Expand Up @@ -239,6 +239,23 @@ type SessionChecker = {
start: (session_state: string) => void;
stop: () => void;
};
type StateRecord = {
authParams: AuthRequestOptions;
created_at: number;
localState: Record<string, any>;
request_type: 'p' | 's' | any;
};
type AuthRecord = {
access_token?: string;
authParams?: IPlusAuthClientOptions;
expires_at?: number;
id_token?: Record<string, any>;
id_token_raw?: string;
refresh_token?: string;
scope?: string;
session_state?: string;
user?: Record<string, any>;
};

/**
* `OIDCClient` provides methods for interacting with OIDC/OAuth2 authorization server. Those methods are signing a
Expand Down Expand Up @@ -292,15 +309,15 @@ declare class OIDCClient extends EventEmitter<EventTypes> {
* @param options
* @param popupOptions
*/
loginWithPopup(options?: Partial<AuthRequestOptions>, popupOptions?: PopupOptions): Promise<any>;
loginWithPopup(options?: Partial<AuthRequestOptions>, popupOptions?: PopupOptions): Promise<Record<string, any>>;
/**
* After a user successfully authorizes an application, the authorization server will redirect the user back to
* the application with either an authorization code or access token in the URL. In the callback page you should
* call this method.
*
* @param url Full url which contains authorization request result parameters. Defaults to `window.location.href`
*/
loginCallback(url?: string): Promise<any>;
loginCallback(url?: string): Promise<Record<string, any> | undefined>;
/**
* Redirect to provider's `end_session_endpoint` with provided parameters. After logout provider will redirect to
* provided `post_logout_redirect_uri` if it provided.
Expand Down Expand Up @@ -328,31 +345,31 @@ declare class OIDCClient extends EventEmitter<EventTypes> {
/**
* Retrieve logged in user's access token if it exists.
*/
getAccessToken(): Promise<any>;
getAccessToken(): Promise<string | undefined>;
/**
* Retrieve logged in user's refresh token if it exists.
*/
getRefreshToken(): Promise<any>;
getRefreshToken(): Promise<string | undefined>;
/**
* Retrieve logged in user's parsed id token if it exists.
*/
getIdToken(): Promise<any>;
getIdToken(): Promise<Record<string, any> | undefined>;
/**
* Retrieve access token's expiration.
*/
getExpiresAt(): Promise<any>;
getExpiresAt(): Promise<number | undefined>;
/**
* Retrieve logged in user's id token in raw format if it exists.
*/
getIdTokenRaw(): Promise<any>;
getIdTokenRaw(): Promise<string | undefined>;
/**
* Retrieve logged in user's scopes if it exists.
*/
getScopes(): Promise<any>;
getScopes(): Promise<string[] | undefined>;
/**
* Retrieve logged in user's profile.
*/
getUser(): Promise<any>;
getUser(): Promise<Record<string, any> | undefined>;
/**
* If there is a user stored locally return true. Otherwise it will make a silentLogin to check if End-User is
* logged in provider.
Expand Down Expand Up @@ -458,4 +475,4 @@ declare class InteractionCancelled extends OIDCClientError {
*/
declare function createOIDCClient(options: IPlusAuthClientOptions): Promise<OIDCClient>;

export { AuthRequestOptions, AuthenticationError, EventEmitter, EventTypes, Events, IEndpointConfiguration, IFrameOptions, IPlusAuthClientOptions, InMemoryStateStore, InteractionCancelled, InvalidIdTokenError, InvalidJWTError, JWTHeaderField, JWTValidationOptions, Listener, LocalStorageStateStore, LogoutRequestOptions, OIDCClient, OIDCClientError, ParsedJWT, PopupOptions, RevokeOptions, SessionChecker, SessionCheckerOptions, SessionMonitorOptions, StateStore, TokenRequestOption, TokenResponse, TokenType, createOIDCClient as default };
export { AuthRecord, AuthRequestOptions, AuthenticationError, EventEmitter, EventTypes, Events, IEndpointConfiguration, IFrameOptions, IPlusAuthClientOptions, InMemoryStateStore, InteractionCancelled, InvalidIdTokenError, InvalidJWTError, JWTHeaderField, JWTValidationOptions, Listener, LocalStorageStateStore, LogoutRequestOptions, OIDCClient, OIDCClientError, ParsedJWT, PopupOptions, RevokeOptions, SessionChecker, SessionCheckerOptions, SessionMonitorOptions, StateRecord, StateStore, TokenRequestOption, TokenResponse, TokenType, createOIDCClient as default };
4 changes: 2 additions & 2 deletions docs/assets/main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/assets/search.js

Large diffs are not rendered by default.

Loading

0 comments on commit 3970fbd

Please sign in to comment.