import session from "express-session"; import { Library, Schedule, UserPreferences } from "@rewind-media/rewind-protocol"; import { ServerImageInfo, ServerEpisodeInfo, ServerUser, UserProgress, ServerShowInfo, ServerSeasonInfo, ServerMovieInfo, ServerUserDevicePreferences } from "../models"; export interface Database { initialize(): Promise; get sessionStore(): session.Store; getServerConfig(key: string): Promise; setServerConfig(key: string, val: string): Promise; setNotExistsServerConfig(key: string, val: string): Promise; delServerConfig(key: string): Promise; getSchedule(name: string): Promise; listSchedule(): Promise; putSchedule(schedule: Schedule): Promise; delSchedule(name: string): Promise; getUser(username: string): Promise; putUser(user: ServerUser): Promise; deleteUser(username: string): Promise; listUsers(): Promise; putUserPreferences(username: string, prefs: UserPreferences): Promise; getUserDevicePreferences(username: string, deviceId: string): Promise; putUserDevicePreferences(preferences: ServerUserDevicePreferences): Promise; deleteUserDevicePreferences(username: string, deviceId: string): Promise; getUserProgress(username: string, mediaId: string): Promise; listLatestUserProgress(username: string, maxPercent: number, limit: number): Promise; upsertUserProgress(progress: UserProgress): Promise; listLibraries(): Promise; getLibrary(libraryId: string): 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; listMovies(libraryId: string): Promise; listShows(libraryId: string): Promise; listSeasons(showId: string): Promise; listEpisodes(seasonId: string): Promise; getMovie(movieId: string): Promise; getShow(showId: string): Promise; getSeason(seasonId: string): Promise; getEpisode(episodeId: string): Promise; upsertMovie(movie: ServerMovieInfo): Promise; upsertShow(show: ServerShowInfo): Promise; upsertSeason(season: ServerSeasonInfo): Promise; upsertEpisode(episode: ServerEpisodeInfo): Promise; deleteMovie(movieId: string): Promise; deleteShow(showId: string): Promise; deleteSeason(seasonId: string): Promise; deleteEpisode(episodeId: string): Promise; cleanShows(before: Date, libraryId: string): Promise; cleanSeasons(before: Date, libraryId: string): Promise; cleanEpisodes(before: Date, libraryId: string): Promise; cleanMovies(before: Date, libraryId: string): Promise; } export declare abstract class AbstractDatabase implements Database { abstract getServerConfig(key: string): Promise; abstract setServerConfig(key: string, val: string): Promise; abstract setNotExistsServerConfig(key: string, val: string): Promise; abstract delServerConfig(key: string): Promise; initialize(): Promise; abstract cleanImages(before: Date, libraryId: string): Promise; abstract cleanEpisodes(before: Date, libraryId: string): Promise; abstract cleanSeasons(before: Date, libraryId: string): Promise; abstract cleanShows(before: Date, libraryId: string): Promise; abstract deleteImage(imageId: string): Promise; abstract deleteShow(showId: string): Promise; abstract deleteEpisode(episodeId: string): Promise; abstract deleteSeason(seasonId: string): Promise; abstract deleteUser(username: string): Promise; abstract getImage(imageId: string): Promise; abstract getLibrary(libraryId: string): Promise; abstract getShow(showId: string): Promise; abstract getEpisode(episodeId: string): Promise; abstract getSeason(seasonId: string): Promise; abstract getUser(username: string): Promise; abstract listLibraries(): Promise; abstract listEpisodes(seasonId: string): Promise; abstract listSeasons(showId: string): Promise; abstract listShows(libraryId: string): Promise; abstract listUsers(): Promise; abstract deleteLibrary(libraryId: string): Promise; abstract putUser(user: ServerUser): Promise; abstract get sessionStore(): session.Store; abstract upsertImage(image: ServerImageInfo): Promise; abstract upsertLibrary(library: Library): Promise; abstract upsertShow(show: ServerShowInfo): Promise; abstract upsertEpisode(episode: ServerEpisodeInfo): Promise; abstract upsertSeason(season: ServerSeasonInfo): Promise; abstract listLatestUserProgress(username: string, limit: number): Promise; abstract getUserProgress(username: string, mediaId: string): Promise; abstract upsertUserProgress(progress: UserProgress): Promise; abstract cleanMovies(before: Date, libraryId: string): Promise; abstract deleteMovie(movieId: string): Promise; abstract getMovie(movieId: string): Promise; abstract listMovies(libraryId: string): Promise; abstract upsertMovie(movie: ServerMovieInfo): Promise; abstract delSchedule(name: string): Promise; abstract getSchedule(name: string): Promise; abstract listSchedule(): Promise; abstract putSchedule(schedule: Schedule): Promise; abstract getUserDevicePreferences(username: string, deviceId: string): Promise; abstract putUserDevicePreferences(preferences: ServerUserDevicePreferences): Promise; abstract deleteUserDevicePreferences(username: string, deviceId: string): Promise; abstract putUserPreferences(username: string, prefs: UserPreferences): Promise; } export declare const DatabaseLogger: import("typescript-logging-category-style").Category; //# sourceMappingURL=Database.d.ts.map