import { Db } from "mongodb"; import OidcConnection from "../schemas/OidcConnection"; /** * Repository for OIDC connections * * Manages persistent connections between users and OIDC providers. * Stores the mapping of app users to IdP subjects, and optionally * stores encrypted tokens for API access. */ export default class OidcConnectionRepo { private collection; constructor(collectionName: string, db: Db); /** * Create a new OIDC connection * * @param connection - Connection data * @returns Created connection with _id */ create(connection: Omit): Promise; /** * Find connection by user ID and provider * * @param userId - Application user ID * @param provider - Provider name * @returns Connection or null if not found */ findByUserAndProvider(userId: string, provider: string): Promise; /** * Find connection by subject and issuer * * Used to look up users by their IdP identity. * * @param subject - OIDC subject (sub claim) * @param issuer - OIDC issuer (iss claim) * @returns Connection or null if not found */ findBySubjectAndIssuer(subject: string, issuer: string): Promise; /** * Find all connections for a user * * @param userId - Application user ID * @returns Array of connections */ findByUserId(userId: string): Promise; /** * Update connection * * Typically used to update tokens when they're refreshed. * * @param connectionId - Connection _id * @param updates - Fields to update */ updateOne(connectionId: string, updates: Partial): Promise; /** * Delete connection by user and provider * * @param userId - Application user ID * @param provider - Provider name */ deleteByUserAndProvider(userId: string, provider: string): Promise; /** * Delete all connections for a user * * @param userId - Application user ID */ deleteByUserId(userId: string): Promise; /** * Find one connection by query * * @param query - MongoDB query * @returns Connection or null if not found */ getOne(query: Partial): Promise; } //# sourceMappingURL=OidcConnectionRepo.d.ts.map