import { type LTIClient, type LTIDeployment, type LTIDynamicRegistrationSession, type LTILaunchConfig, type LTISession, type LTIStorage } from '@lti-tool/core'; import type { PostgresStorageConfig } from './interfaces/postgresStorageConfig.js'; /** * PostgreSQL implementation of LTI storage interface. * * Stores clients, deployments, sessions, and nonces in PostgreSQL with LRU caching. * Uses Drizzle ORM for type-safe database operations. */ export declare class PostgresStorage implements LTIStorage { private logger; private db; private sql; constructor(config: PostgresStorageConfig); listClients(): Promise[]>; getClientById(clientId: string): Promise; addClient(client: Omit): Promise; updateClient(clientId: string, client: Partial>): Promise; deleteClient(clientId: string): Promise; private updateClientLaunchConfigs; listDeployments(clientId: string): Promise; getDeployment(clientId: string, deploymentId: string): Promise; addDeployment(clientId: string, deployment: Omit): Promise; updateDeployment(clientId: string, deploymentId: string, deployment: Partial): Promise; deleteDeployment(clientId: string, deploymentId: string): Promise; storeNonce(nonce: string, expiresAt: Date): Promise; validateNonce(nonce: string): Promise; getSession(sessionId: string): Promise; addSession(session: LTISession): Promise; getLaunchConfig(iss: string, clientId: string, deploymentId: string): Promise; saveLaunchConfig(launchConfig: LTILaunchConfig): Promise; setRegistrationSession(sessionId: string, session: LTIDynamicRegistrationSession): Promise; getRegistrationSession(sessionId: string): Promise; deleteRegistrationSession(sessionId: string): Promise; /** * Clean up expired nonces, sessions, and registration sessions. * Should be called periodically (e.g., every 30 minutes via EventBridge). * * @returns Object with counts of deleted items */ cleanup(): Promise<{ noncesDeleted: number; sessionsDeleted: number; registrationSessionsDeleted: number; }>; /** * Close the PostgreSQL connection pool. * Should be called on graceful server shutdown or after tests. * Not required for serverless environments (Lambda manages lifecycle). */ close(): Promise; } //# sourceMappingURL=postgresStorage.d.ts.map