import type { AuthIdentity, AuthSecurityEvent, AuthSession, AuthUser, LoginAttempt, OAuthAccount, OneTimeToken, OtpChallenge, PasskeyCredential, PasswordCredential, RecoveryCodeRecord, TotpCredential, TrustedDevice, } from "./types.ts"; export interface AuthStore { createUser(user: AuthUser): Promise; updateUser(user: AuthUser): Promise; findUserById(id: string): Promise; listUsers(): Promise; createIdentity(identity: AuthIdentity): Promise; updateIdentity(identity: AuthIdentity): Promise; findIdentity( type: AuthIdentity["type"], normalizedValue: string, ): Promise; listIdentities(userId: string): Promise; setPassword(credential: PasswordCredential): Promise; getPassword(userId: string): Promise; createSession(session: AuthSession): Promise; updateSession(session: AuthSession): Promise; findSession(id: string): Promise; listSessions(userId: string): Promise; deleteSession(id: string): Promise; createTrustedDevice(device: TrustedDevice): Promise; updateTrustedDevice(device: TrustedDevice): Promise; findTrustedDeviceByFingerprint( userId: string, fingerprintHash: string, ): Promise; listTrustedDevices(userId: string): Promise; createToken(token: OneTimeToken): Promise; updateToken(token: OneTimeToken): Promise; findTokenByHash(hash: string): Promise; createOtp(challenge: OtpChallenge): Promise; updateOtp(challenge: OtpChallenge): Promise; findOtp(id: string): Promise; createTotp(credential: TotpCredential): Promise; updateTotp(credential: TotpCredential): Promise; listTotp(userId: string): Promise; deleteTotp(id: string): Promise; createRecoveryCodes(codes: RecoveryCodeRecord[]): Promise; updateRecoveryCode(code: RecoveryCodeRecord): Promise; listRecoveryCodes(userId: string): Promise; deleteRecoveryCodes(userId: string): Promise; createPasskey(credential: PasskeyCredential): Promise; updatePasskey(credential: PasskeyCredential): Promise; findPasskeyByCredentialId(credentialId: string): Promise; listPasskeys(userId: string): Promise; deletePasskey(id: string): Promise; createOAuthAccount(account: OAuthAccount): Promise; updateOAuthAccount(account: OAuthAccount): Promise; findOAuthAccount(provider: string, providerAccountId: string): Promise; listOAuthAccounts(userId: string): Promise; deleteOAuthAccount(id: string): Promise; createLoginAttempt(attempt: LoginAttempt): Promise; listRecentLoginAttempts(identifier: string, since: number): Promise; createSecurityEvent(event: AuthSecurityEvent): Promise; listSecurityEvents(userId: string, limit?: number): Promise; }