UNPKG

ci-validation

Version:

🇺🇾 Complete TypeScript/JavaScript library for validating Uruguayan CI (Cédula de Identidad) with official algorithm and government service integration

60 lines • 1.75 kB
import { ISessionStorage, SessionData, SessionStorageOptions } from "../interfaces/ISessionStorage"; /** * Redis-based session storage implementation * Compatible with Vercel serverless environment */ export declare class RedisSessionStorage implements ISessionStorage { private redis; private readonly keyPrefix; private readonly expirationTime; private readonly autoCleanup; constructor(options?: SessionStorageOptions & { redisUrl?: string; keyPrefix?: string; }); /** * Initialize Redis connection */ private initializeRedis; /** * Get the Redis key for a session */ private getSessionKey; /** * Save session data to Redis */ saveSession(sessionId: string, sessionData: SessionData): Promise<void>; /** * Load session data from Redis */ loadSession(sessionId: string): Promise<SessionData | null>; /** * Delete session from Redis */ deleteSession(sessionId: string): Promise<void>; /** * Check if session exists in Redis */ sessionExists(sessionId: string): Promise<boolean>; /** * Update session's last used timestamp */ touchSession(sessionId: string): Promise<void>; /** * Clean up expired sessions (Redis handles this automatically with TTL) * This method is provided for interface compliance but isn't necessary for Redis */ cleanupExpiredSessions(): Promise<void>; /** * Get session statistics (useful for debugging) */ getSessionStats(): Promise<{ totalSessions: number; memoryUsage?: string; }>; /** * Cleanup resources */ destroy(): void; } //# sourceMappingURL=RedisSessionStorage.d.ts.map