@auth0/auth0-spa-js 2.17.1 → 2.18.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.
- package/README.md +1 -1
- package/dist/auth0-spa-js.development.js +430 -314
- package/dist/auth0-spa-js.development.js.map +1 -1
- package/dist/auth0-spa-js.production.esm.js +1 -1
- package/dist/auth0-spa-js.production.esm.js.map +1 -1
- package/dist/auth0-spa-js.production.js +1 -1
- package/dist/auth0-spa-js.production.js.map +1 -1
- package/dist/auth0-spa-js.worker.development.js +71 -21
- package/dist/auth0-spa-js.worker.development.js.map +1 -1
- package/dist/auth0-spa-js.worker.production.js +1 -1
- package/dist/auth0-spa-js.worker.production.js.map +1 -1
- package/dist/lib/auth0-spa-js.cjs.js +453 -334
- package/dist/lib/auth0-spa-js.cjs.js.map +1 -1
- package/package.json +4 -3
- package/src/Auth0Client.ts +67 -9
- package/src/global.ts +44 -0
- package/src/index.ts +6 -3
- package/src/utils.ts +11 -5
- package/src/version.ts +1 -1
- package/dist/typings/Auth0Client.d.ts +0 -415
- package/dist/typings/Auth0Client.utils.d.ts +0 -90
- package/dist/typings/MyAccountApiClient.d.ts +0 -92
- package/dist/typings/TokenExchange.d.ts +0 -77
- package/dist/typings/api.d.ts +0 -2
- package/dist/typings/cache/cache-localstorage.d.ts +0 -7
- package/dist/typings/cache/cache-manager.d.ts +0 -56
- package/dist/typings/cache/cache-memory.d.ts +0 -4
- package/dist/typings/cache/index.d.ts +0 -4
- package/dist/typings/cache/key-manifest.d.ts +0 -12
- package/dist/typings/cache/shared.d.ts +0 -68
- package/dist/typings/constants.d.ts +0 -58
- package/dist/typings/dpop/dpop.d.ts +0 -17
- package/dist/typings/dpop/storage.d.ts +0 -27
- package/dist/typings/dpop/utils.d.ts +0 -15
- package/dist/typings/errors.d.ts +0 -96
- package/dist/typings/fetcher.d.ts +0 -54
- package/dist/typings/global.d.ts +0 -777
- package/dist/typings/http.d.ts +0 -5
- package/dist/typings/index.d.ts +0 -23
- package/dist/typings/jwt.d.ts +0 -21
- package/dist/typings/lock.d.ts +0 -32
- package/dist/typings/mfa/MfaApiClient.d.ts +0 -225
- package/dist/typings/mfa/MfaContextManager.d.ts +0 -79
- package/dist/typings/mfa/constants.d.ts +0 -23
- package/dist/typings/mfa/errors.d.ts +0 -117
- package/dist/typings/mfa/index.d.ts +0 -4
- package/dist/typings/mfa/types.d.ts +0 -181
- package/dist/typings/mfa/utils.d.ts +0 -23
- package/dist/typings/promise-utils.d.ts +0 -2
- package/dist/typings/scope.d.ts +0 -35
- package/dist/typings/storage.d.ts +0 -26
- package/dist/typings/transaction-manager.d.ts +0 -33
- package/dist/typings/utils.d.ts +0 -36
- package/dist/typings/version.d.ts +0 -2
- package/dist/typings/worker/token.worker.d.ts +0 -1
- package/dist/typings/worker/worker.types.d.ts +0 -15
- package/dist/typings/worker/worker.utils.d.ts +0 -7
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { GetTokenSilentlyVerboseResponse } from './global';
|
|
2
|
-
export type ResponseHeaders = Record<string, string | null | undefined> | [string, string][] | {
|
|
3
|
-
get(name: string): string | null | undefined;
|
|
4
|
-
};
|
|
5
|
-
export type CustomFetchMinimalOutput = {
|
|
6
|
-
status: number;
|
|
7
|
-
headers: ResponseHeaders;
|
|
8
|
-
};
|
|
9
|
-
export type CustomFetchImpl<TOutput extends CustomFetchMinimalOutput> = (req: Request) => Promise<TOutput>;
|
|
10
|
-
export type AuthParams = {
|
|
11
|
-
scope?: string[];
|
|
12
|
-
audience?: string;
|
|
13
|
-
};
|
|
14
|
-
type AccessTokenFactory = (authParams?: AuthParams) => Promise<string | GetTokenSilentlyVerboseResponse>;
|
|
15
|
-
export type FetcherConfig<TOutput extends CustomFetchMinimalOutput> = {
|
|
16
|
-
getAccessToken?: AccessTokenFactory;
|
|
17
|
-
baseUrl?: string;
|
|
18
|
-
fetch?: CustomFetchImpl<TOutput>;
|
|
19
|
-
dpopNonceId?: string;
|
|
20
|
-
};
|
|
21
|
-
export type FetcherHooks = {
|
|
22
|
-
isDpopEnabled: () => boolean;
|
|
23
|
-
getAccessToken: AccessTokenFactory;
|
|
24
|
-
getDpopNonce: () => Promise<string | undefined>;
|
|
25
|
-
setDpopNonce: (nonce: string) => Promise<void>;
|
|
26
|
-
generateDpopProof: (params: {
|
|
27
|
-
url: string;
|
|
28
|
-
method: string;
|
|
29
|
-
nonce?: string;
|
|
30
|
-
accessToken: string;
|
|
31
|
-
}) => Promise<string>;
|
|
32
|
-
};
|
|
33
|
-
export type FetchWithAuthCallbacks<TOutput> = {
|
|
34
|
-
onUseDpopNonceError?(): Promise<TOutput>;
|
|
35
|
-
};
|
|
36
|
-
export declare class Fetcher<TOutput extends CustomFetchMinimalOutput> {
|
|
37
|
-
protected readonly config: Omit<FetcherConfig<TOutput>, 'fetch'> & Required<Pick<FetcherConfig<TOutput>, 'fetch'>>;
|
|
38
|
-
protected readonly hooks: FetcherHooks;
|
|
39
|
-
constructor(config: FetcherConfig<TOutput>, hooks: FetcherHooks);
|
|
40
|
-
protected isAbsoluteUrl(url: string): boolean;
|
|
41
|
-
protected buildUrl(baseUrl: string | undefined, url: string | undefined): string;
|
|
42
|
-
protected getAccessToken(authParams?: AuthParams): Promise<string | GetTokenSilentlyVerboseResponse>;
|
|
43
|
-
protected extractUrl(info: RequestInfo | URL): string;
|
|
44
|
-
protected buildBaseRequest(info: RequestInfo | URL, init: RequestInit | undefined): Request;
|
|
45
|
-
protected setAuthorizationHeader(request: Request, accessToken: string, tokenType?: string): void;
|
|
46
|
-
protected setDpopProofHeader(request: Request, accessToken: string): Promise<void>;
|
|
47
|
-
protected prepareRequest(request: Request, authParams?: AuthParams): Promise<void>;
|
|
48
|
-
protected getHeader(headers: ResponseHeaders, name: string): string;
|
|
49
|
-
protected hasUseDpopNonceError(response: TOutput): boolean;
|
|
50
|
-
protected handleResponse(response: TOutput, callbacks: FetchWithAuthCallbacks<TOutput>): Promise<TOutput>;
|
|
51
|
-
protected internalFetchWithAuth(info: RequestInfo | URL, init: RequestInit | undefined, callbacks: FetchWithAuthCallbacks<TOutput>, authParams?: AuthParams): Promise<TOutput>;
|
|
52
|
-
fetchWithAuth(info: RequestInfo | URL, init?: RequestInit, authParams?: AuthParams): Promise<TOutput>;
|
|
53
|
-
}
|
|
54
|
-
export {};
|