import type { ProjectMember } from '@owox/idp-protocol'; import type { DatabaseAccount, DatabaseOperationResult, DatabaseUser, OnboardingAnswer } from '../types/index.js'; import { type AuthFlowParams } from '../utils/request-utils.js'; import type { DatabaseStore } from './database-store.js'; import { StoreResult } from './store-result.js'; export interface MysqlConnectionConfig { host: string; user: string; password: string; database: string; port?: number; ssl?: unknown; } /** * MySQL-backed DatabaseStore implementation. */ export declare class MysqlDatabaseStore implements DatabaseStore { private readonly config; private pool?; private readonly logger; private authTableReady; private projectTablesReady; private onboardingTableReady; private userProjectOnboardingTableReady; constructor(config: MysqlConnectionConfig); private getPool; private toIso; private toBoolean; private mapUser; private mapAccount; initialize(): Promise; isHealthy(): Promise; cleanupExpiredSessions(): Promise; getUserById(userId: string): Promise; getUserByBiUserId(biUserId: string): Promise; getUserByEmail(email: string): Promise; getAccountByUserId(userId: string): Promise; getAccountsByUserId(userId: string): Promise; getAccountByUserIdAndProvider(userId: string, providerId: string): Promise; updateUserLastLoginMethod(userId: string, loginMethod: string): Promise; updateUserFirstLoginMethod(userId: string, loginMethod: string): Promise; updateUserBiUserId(userId: string, biUserId: string): Promise; saveAuthState(state: string, codeVerifier: string, expiresAt?: Date | null, authFlowParams?: AuthFlowParams): Promise; getAuthState(state: string): Promise; deleteAuthState(state: string): Promise; purgeExpiredAuthStates(): Promise; /** * Escapes special LIKE pattern characters (%, _, \) to prevent SQL injection. */ private escapeLikePattern; shutdown(): Promise; getAdapter(): Promise; private ensureAuthStatesTable; findActiveMagicLink(email: string): Promise<{ id: string; createdAt?: Date | null; expiresAt?: Date | null; } | null>; private ensureProjectTables; saveProjectMembers(projectId: string, members: ProjectMember[], ttlSeconds: number): Promise; getProjectMembers(projectId: string): Promise; getProjectSyncInfo(projectId: string): Promise<{ expiresAt: Date | null; updatedAt: Date | null; } | null>; private ensureOnboardingTable; saveOnboardingAnswers(answers: OnboardingAnswer[]): Promise; hasOnboardingAnswers(userId: string, projectId: string): Promise; getOnboardingAnswers(userId: string, projectId: string): Promise; private ensureUserProjectOnboardingTable; getUserProjectOnboardingStatus(biUserId: string, projectId: string): Promise; setUserProjectOnboardingStatus(biUserId: string, projectId: string, status: string): Promise; } //# sourceMappingURL=mysql-database-store.d.ts.map