import { NodeSavedSession, NodeSavedSessionStore, } from '@atproto/oauth-client-node'; /** * In-memory implementation of NodeSavedSessionStore for testing */ export class InMemorySessionStore implements NodeSavedSessionStore { private static instance: InMemorySessionStore; private sessions: Map = new Map(); private constructor() {} public static getInstance(): InMemorySessionStore { if (!InMemorySessionStore.instance) { InMemorySessionStore.instance = new InMemorySessionStore(); } return InMemorySessionStore.instance; } async get(key: string): Promise { return this.sessions.get(key); } async set(key: string, val: NodeSavedSession): Promise { this.sessions.set(key, val); } async del(key: string): Promise { this.sessions.delete(key); } // Helper method for testing clear(): void { this.sessions.clear(); } }