AuthStoresContract.ts overview
The contracts of the stores beyond sign-in, as one suite each dialect runs on a real engine: the core’s conformance suites where they exist, and cases from the documented contracts otherwise, ending in real flows through EmailPasswordService and UserService. Never published.
Exports Grouped by Category
utils
AuthStores (type alias)
Every store the suite exercises.
Signature
type AuthStores =
| PurgeRateLimits
| Auth.ApiKey.ApiKeyStore
| Auth.Email.EmailPasswordStore
| Auth.Password.PasswordResetUserStore
| Auth.RateLimit.RateLimitStore
| Auth.Email.EmailVerificationStore
| Auth.Password.PasswordResetStore
| Auth.SessionStore.SessionStore
| Auth.UserStore.UserStore
| Auth.User.UserServiceStore
| Auth.Identifier.IdentifierStore
| Auth.Organization.OrganizationStore
| Auth.Organization.OrganizationDomainStore
MappedTables (interface)
Application tables standing in for the dialect’s API key, token and rate-limit tables.
Signature
export interface MappedTables {
readonly apiKeys?: ApiKeySchema
readonly tokens?: TokenSchema
readonly rateLimits?: RateLimitSchema
}
Run (type alias)
Runs a case against the file’s database, with authStoresLayer provided.
Signature
type Run = <A, E>(effect: Effect.Effect<A, E, AuthStores>) => Promise<A>
authStoresContract
Register every case, label naming the engine and driver.
Signature
declare const authStoresContract: (label: string, run: Run) => void
authStoresLayer
The stores over one dialect’s tables, still needing the database; mapped swaps in an application’s own tables for the stores that take one.
Signature
declare const authStoresLayer: (
tables: Tables,
mapped?: MappedTables
) => Layer.Layer<AuthStores, never, DrizzleDatabase>