import { MongoClient } from "mongodb"; import session from "express-session"; import { AbstractDatabase, Database } from "./Database.js"; import { Schedule, Library, UserPreferences } from "@rewind-media/rewind-protocol"; import { ServerImageInfo, ServerEpisodeInfo, ServerUser, UserProgress, ServerShowInfo, ServerSeasonInfo, ServerMovieInfo, ServerUserDevicePreferences } from "../models"; export interface MongoClientProps { readonly host: string; readonly port: number; readonly dbName: string; readonly username: string; readonly password: string; } export interface MongoDbProps { readonly client: MongoClient; readonly dbName: string; } export declare class MongoDatabase extends AbstractDatabase { private readonly db; private readonly users; private readonly client; private readonly dbName; private readonly libraries; private readonly shows; private readonly showsEpisodes; private readonly showsSeasons; private readonly images; private readonly userProgress; private readonly serverConfig; private readonly movies; private readonly schedule; private readonly userDevicePreferences; constructor(props: MongoDbProps); getUser(username: string): Promise; putUser(user: ServerUser): Promise; listUsers(): Promise; deleteUser(username: string): Promise; getLibrary(libraryId: string): Promise; listLibraries(): Promise; upsertLibrary(library: Library): Promise; deleteLibrary(libraryId: string): Promise; getImage(imageId: string): Promise; upsertImage(image: ServerImageInfo): Promise; deleteImage(imageId: string): Promise; cleanImages(before: Date, libraryId: string): Promise; getShow(fileId: string): Promise; getSeason(seasonId: string): Promise; getEpisode(episodeId: string): Promise; listShows(libraryId: string): Promise; listSeasons(showId: string): Promise; listEpisodes(seasonId: string): Promise; upsertShow(show: ServerShowInfo): Promise; upsertEpisode(episode: ServerEpisodeInfo): Promise; upsertSeason(season: ServerSeasonInfo): Promise; deleteShow(fileId: string): Promise; deleteEpisode(episodeId: string): Promise; deleteSeason(seasonId: string): Promise; cleanShows(before: Date, libraryId: string): Promise; cleanEpisodes(before: Date, libraryId: string): Promise; cleanSeasons(before: Date, libraryId: string): Promise; get sessionStore(): session.Store; initialize(): Promise; private static toMongoUser; private static toServerUser; listLatestUserProgress(username: string, maxPercent?: number, limit?: number): Promise; getUserProgress(username: string, id: string): Promise; upsertUserProgress(progress: UserProgress): Promise; delServerConfig(key: string): Promise; getServerConfig(key: string): Promise; setServerConfig(key: string, value: string): Promise; setNotExistsServerConfig(key: string, value: string): Promise; cleanMovies(before: Date, libraryId: string): Promise; deleteMovie(movieId: string): Promise; getMovie(movieId: string): Promise; listMovies(libraryId: string): Promise; upsertMovie(movie: ServerMovieInfo): Promise; delSchedule(name: string): Promise; getSchedule(name: string): Promise; listSchedule(): Promise; putSchedule(schedule: Schedule): Promise; getUserDevicePreferences(username: string, deviceId: string): Promise; putUserDevicePreferences(prefs: ServerUserDevicePreferences): Promise; deleteUserDevicePreferences(username: string, deviceId: string): Promise; putUserPreferences(username: string, prefs: UserPreferences): Promise; } export declare function mkMongoDatabase(props: MongoClientProps): Promise; //# sourceMappingURL=MongoDatabase.d.ts.map