UNPKG

@simulacrum/auth0-simulator

Version:

Run local instance of Auth0 API for local development and integration testing

111 lines 3.27 kB
import { z } from "zod"; import { IdProp } from "@simulacrum/foundation-simulator"; export declare const auth0UserSchema: z.ZodEffects<z.ZodObject<{ id: z.ZodDefault<z.ZodString>; name: z.ZodString; password: z.ZodDefault<z.ZodOptional<z.ZodString>>; email: z.ZodOptional<z.ZodString>; picture: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { id: string; name: string; password: string; email?: string | undefined; picture?: string | undefined; }, { name: string; id?: string | undefined; password?: string | undefined; email?: string | undefined; picture?: string | undefined; }>, { id: string; name: string; password: string; email?: string | undefined; picture?: string | undefined; }, { name: string; id?: string | undefined; password?: string | undefined; email?: string | undefined; picture?: string | undefined; }>; export type Auth0User = z.infer<typeof auth0UserSchema>; export declare const defaultUser: { id: string; name: string; password: string; email?: string | undefined; picture?: string | undefined; }; export declare const auth0InitialStoreSchema: z.ZodObject<{ users: z.ZodArray<z.ZodEffects<z.ZodObject<{ id: z.ZodDefault<z.ZodString>; name: z.ZodString; password: z.ZodDefault<z.ZodOptional<z.ZodString>>; email: z.ZodOptional<z.ZodString>; picture: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { id: string; name: string; password: string; email?: string | undefined; picture?: string | undefined; }, { name: string; id?: string | undefined; password?: string | undefined; email?: string | undefined; picture?: string | undefined; }>, { id: string; name: string; password: string; email?: string | undefined; picture?: string | undefined; }, { name: string; id?: string | undefined; password?: string | undefined; email?: string | undefined; picture?: string | undefined; }>, "many">; }, "strip", z.ZodTypeAny, { users: { id: string; name: string; password: string; email?: string | undefined; picture?: string | undefined; }[]; }, { users: { name: string; id?: string | undefined; password?: string | undefined; email?: string | undefined; picture?: string | undefined; }[]; }>; export type AuthSession = { username: string; nonce: string; }; export type Auth0Store = z.output<typeof auth0InitialStoreSchema> & { sessions: AuthSession[]; }; export type Auth0InitialStore = z.input<typeof auth0InitialStoreSchema>; export declare const convertToObj: <T extends { [k: string]: any; }>(arrayOfObjects: T[], key?: IdProp) => Record<IdProp, T>; export declare const convertInitialStateToStoreState: (initialState: Auth0InitialStore | undefined) => { users: Record<IdProp, { id: string; name: string; password: string; email?: string | undefined; picture?: string | undefined; }>; } | undefined; //# sourceMappingURL=entities.d.ts.map