@simulacrum/auth0-simulator
Version:
Run local instance of Auth0 API for local development and integration testing
130 lines • 3.8 kB
TypeScript
import { z } from "zod";
export declare const configurationSchema: z.ZodObject<{
port: z.ZodOptional<z.ZodNumber>;
domain: z.ZodOptional<z.ZodString>;
audience: z.ZodOptional<z.ZodString>;
clientID: z.ZodOptional<z.ZodString>;
scope: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodObject<{
clientID: z.ZodString;
audience: z.ZodOptional<z.ZodString>;
scope: z.ZodString;
}, "strip", z.ZodTypeAny, {
clientID: string;
scope: string;
audience?: string | undefined;
}, {
clientID: string;
scope: string;
audience?: string | undefined;
}>, "many">]>;
clientSecret: z.ZodOptional<z.ZodString>;
rulesDirectory: z.ZodOptional<z.ZodString>;
auth0SessionCookieName: z.ZodOptional<z.ZodString>;
auth0CookieSecret: z.ZodOptional<z.ZodString>;
connection: z.ZodOptional<z.ZodString>;
cookieSecret: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
scope: string | {
clientID: string;
scope: string;
audience?: string | undefined;
}[];
port?: number | undefined;
domain?: string | undefined;
audience?: string | undefined;
clientID?: string | undefined;
clientSecret?: string | undefined;
rulesDirectory?: string | undefined;
auth0SessionCookieName?: string | undefined;
auth0CookieSecret?: string | undefined;
connection?: string | undefined;
cookieSecret?: string | undefined;
}, {
scope: string | {
clientID: string;
scope: string;
audience?: string | undefined;
}[];
port?: number | undefined;
domain?: string | undefined;
audience?: string | undefined;
clientID?: string | undefined;
clientSecret?: string | undefined;
rulesDirectory?: string | undefined;
auth0SessionCookieName?: string | undefined;
auth0CookieSecret?: string | undefined;
connection?: string | undefined;
cookieSecret?: string | undefined;
}>;
export type ConfigSchema = z.infer<typeof configurationSchema>;
type ReadonlyFields = "audience" | "clientID" | "scope" | "port";
export type GrantType = "password" | "client_credentials" | "authorization_code" | "refresh_token";
export type ScopeConfig = string | {
audience?: string;
clientID: string;
scope: string;
}[];
export type Auth0Configuration = Required<Pick<ConfigSchema, ReadonlyFields>> & Omit<ConfigSchema, ReadonlyFields>;
export type ResponseModes = "query" | "web_message";
export type QueryParams = {
state: string;
code: string;
redirect_uri: string;
code_challenge: string;
scope: string;
client_id: string;
nonce: string;
code_challenge_method: string;
response_type: string;
response_mode: ResponseModes;
auth0Client: string;
audience: string;
};
export interface TokenSet {
access_token?: string;
token_type?: string;
id_token?: string;
refresh_token?: string;
scope?: string;
expires_at?: number;
session_state?: string;
[key: string]: unknown;
}
export interface IdTokenData {
alg: string;
typ: string;
iss: string;
exp: number;
iat: number;
email: string;
aud: string;
sub: string;
nonce?: string;
}
export interface AccessTokenPayload {
iss: string;
sub: string;
aud: string;
iat: number;
exp: number;
scope: string;
[key: string]: string | number | string[];
}
export interface RefreshToken {
iat: number;
exp: number;
rotations?: number;
scope: string;
sessionUid?: string;
user: {
id: string;
};
nonce?: string;
}
type Token<P> = {
payload: P;
};
export type IdToken = Token<IdTokenData>;
export type AccessToken = Token<AccessTokenPayload>;
export {};
//# sourceMappingURL=types.d.ts.map