import type { MongoClient, Db, Collection } from 'mongodb'; import { SessionStorage } from './session-storage'; import { ISessionData } from './interfaces'; import { Logger } from '../logging'; /** * MongoDB implementation of SessionStorage * Provides MongoDB-based storage for sessions, tokens, and related data */ export declare class MongoDBSessionStorage extends SessionStorage { private client; private db; private dbUrl; private dbName; private collectionName; private clientId; private isConnected; private ensuredCollections; constructor(dbUrl: string, dbName: string, collectionName?: string, logger?: Logger); /** * Set the client ID (called automatically by HighLevel class) * @param clientId - The client ID from HighLevel configuration */ setClientId(clientId: string): void; /** * Extract applicationId from clientId (first part before "-") * @returns Application ID extracted from clientId */ private getApplicationId; /** * Initialize the MongoDB connection */ init(): Promise; /** * Close the MongoDB connection */ disconnect(): Promise; /** * Create a collection if it doesn't exist * @param collectionName - Name of the collection to create */ createCollection(collectionName: string): Promise; /** * Get a reference to a collection * @param collectionName - Name of the collection to get */ getCollection(collectionName: string): Promise; /** * Store a session in MongoDB * @param resourceId - Unique identifier: it can be a companyId or a locationId * @param sessionData - Session data to store */ setSession(resourceId: string, sessionData: ISessionData): Promise; /** * Retrieve a session from MongoDB * @param resourceId - Unique identifier: it can be a companyId or a locationId * @returns Session data or null if not found */ getSession(resourceId: string): Promise; /** * Delete a session from MongoDB * @param resourceId - Unique identifier: it can be a companyId or a locationId */ deleteSession(resourceId: string): Promise; /** * Get only the access token for a resource * @param resourceId - Unique identifier for the resource (companyId or locationId) * @returns Access token or null if not found */ getAccessToken(resourceId: string): Promise; /** * Get only the refresh token for a resource * @param resourceId - Unique identifier for the resource (companyId or locationId) * @returns Refresh token or null if not found */ getRefreshToken(resourceId: string): Promise; /** * Get all sessions for this application * @returns Array of session data for the application */ getSessionsByApplication(): Promise; /** * Get the underlying MongoDB database instance * @returns MongoDB Db instance */ getDb(): Db | null; /** * Get the underlying MongoDB client instance * @returns MongoDB client instance */ getClient(): MongoClient | null; /** * Check if the storage is connected * @returns Connection status */ isConnectionActive(): boolean; } //# sourceMappingURL=mongodb-session-storage.d.ts.map