import { OAuthSession, DeviceFlowState, AuthCodeFlowState, AuthorizationCode } from "../types"; export interface SessionStorageBackend { readonly type: "memory" | "file" | "postgresql" | "redis"; createSession(session: OAuthSession): Promise; getSession(sessionId: string): Promise; getSessionByToken(token: string): Promise; getSessionByRefreshToken(refreshToken: string): Promise; updateSession(sessionId: string, updates: Partial): Promise; deleteSession(sessionId: string): Promise; getAllSessions(): Promise; storeDeviceFlow(state: string, flow: DeviceFlowState): Promise; getDeviceFlow(state: string): Promise; getDeviceFlowByDeviceCode(deviceCode: string): Promise; deleteDeviceFlow(state: string): Promise; storeAuthCodeFlow(internalState: string, flow: AuthCodeFlowState): Promise; getAuthCodeFlow(internalState: string): Promise; deleteAuthCodeFlow(internalState: string): Promise; storeAuthCode(code: AuthorizationCode): Promise; getAuthCode(code: string): Promise; deleteAuthCode(code: string): Promise; associateMcpSession(mcpSessionId: string, oauthSessionId: string): Promise; getSessionByMcpSessionId(mcpSessionId: string): Promise; removeMcpSessionAssociation(mcpSessionId: string): Promise; initialize(): Promise; cleanup(): Promise; close(): Promise; getStats(): Promise; } export interface SessionStorageStats { sessions: number; deviceFlows: number; authCodeFlows: number; authCodes: number; mcpSessionMappings?: number; } export interface StorageConfig { type: "memory" | "file" | "postgresql"; file?: { path: string; saveInterval?: number; }; postgresql?: { connectionString: string; tablePrefix?: string; ssl?: boolean; }; } export interface StorageData { version: number; exportedAt: number; sessions: OAuthSession[]; deviceFlows: Array<{ state: string; flow: DeviceFlowState; }>; authCodeFlows: Array<{ internalState: string; flow: AuthCodeFlowState; }>; authCodes: AuthorizationCode[]; mcpSessionMappings: Array<{ mcpSessionId: string; oauthSessionId: string; }>; } export declare const STORAGE_DATA_VERSION = 1;