@tdanks2000/tmdb-wrapper
Version:
A powerful and easy-to-use TypeScript wrapper for The Movie Database (TMDb) API
1 lines • 115 kB
Source Map (JSON)
{"version":3,"file":"index.mjs","names":["message: string","status: number","url: string","payload?: unknown","options?: Query","entries: [string, string][]","values?: ReadonlyArray<Primitive | null | undefined>","query?: Q","config?: RequestConfig","ms: number","res: Response","auth: TokenType","path: string","opts: RequestOptions<Q>","query: Query","payload: unknown","value: string","baseUrl: string","size: string","path: string","format: string","fileSize: string","imagePath: string","format?: string","image: Image","fileSize: ImageSize","format?: ImageFormat","auth: TokenType","access_token: TokenType","accountId: number","access_token: TokenType","access_token: TokenType","options?: ChangeOption","auth: TokenType","id: number","options?: LanguageOption","request?: RequestConfig","options?: CollectionImageOptions","auth: TokenType","id: number","auth: TokenType","auth: TokenType","id: string","access_token: TokenType","options?: MovieQueryOptions","request?: RequestConfig","options?: TvShowQueryOptions","auth: TokenType","externalId: string","options: ExternalIdOptions","auth: TokenType","options?: LanguageOption","auth: TokenType","keywordId: number","options?: KeywordsOptions","auth: TokenType","id: number","appendToResponse?: T","language?: string","request?: RequestConfig","options?: ChangeOption","options?: LanguageOption","options?: MoviesImageSearchOptions","options?: LanguageOption & PageOption","options?: PageOption & LanguageOption & RegionOption","auth: TokenType","id: number","auth: TokenType","id: number","appendToResponse?: T","language?: string","request?: RequestConfig","options?: ChangeOption","options?: LanguageOption","options?: PageOption","options?: LanguageOption & PageOption","auth: TokenType","id: string","access_token: TokenType","options: SearchOptions","request?: RequestConfig","options: CollectionSearchOptions","options: MovieSearchOptions","options: PeopleSearchOptions","options: TvSearchOptions","options: MultiSearchOptions","auth: TokenType","mediaType: T","timeWindow: TimeWindow","options?: LanguageOption & PageOption","request?: RequestConfig","episodeSelection: EpisodeSelection","auth: TokenType","appendToResponse?: T","options?: LanguageOption","request?: RequestConfig","episodeID: number","options?: ChangeOption","options?: TvEpisodeImageSearchOptions","options?: TvEpisodeVideoSearchOptions","seasonSelection: SeasonSelection","auth: TokenType","appendToResponse?: T","options?: LanguageOption","request?: RequestConfig","seasonId: number","options?: ChangeOption","options?: TvSeasonImageSearchOptions","options?: TvSeasonVideoSearchOptions","auth: TokenType","id: number","appendToResponse?: T","language?: string","options?: ChangeOption","options?: LanguageOption","tvId: number","seasonNumber: number","options?: TvShowImageOptions","options?: LanguageOption & PageOption","options?: TvShowVideoOptions","options?: PageOption & LanguageOption & TimezoneOption","options?: PageOption & LanguageOption","access_token: TokenType","auth: TokenType"],"sources":["../src/@types/endpoints/configuration.ts","../src/@types/endpoints/movies.ts","../src/utils/api.ts","../src/utils/getimagePath.ts","../src/@types/models/baseEndpoint.ts","../src/endpoints/account.ts","../src/endpoints/certification.ts","../src/endpoints/changes.ts","../src/endpoints/collections.ts","../src/endpoints/companies.ts","../src/endpoints/configuration.ts","../src/endpoints/credits.ts","../src/endpoints/discover.ts","../src/endpoints/find.ts","../src/endpoints/genre.ts","../src/endpoints/keywords.ts","../src/endpoints/movies.ts","../src/endpoints/networks.ts","../src/endpoints/people.ts","../src/endpoints/review.ts","../src/endpoints/search.ts","../src/endpoints/trending.ts","../src/endpoints/tvEpisodes.ts","../src/endpoints/tvSeasons.ts","../src/endpoints/tvShows.ts","../src/endpoints/watchProviders.ts","../src/index.ts"],"sourcesContent":["export interface ImageConfiguration {\n\tbase_url: string;\n\tsecure_base_url: string;\n\tbackdrop_sizes: BackdropSizes[];\n\tlogo_sizes: LogoSizes[];\n\tposter_sizes: PosterSizes[];\n\tprofile_sizes: ProfileSizes[];\n\tstill_sizes: StillSizes[];\n}\n\nexport interface Configuration {\n\timages: ImageConfiguration;\n\tchange_keys: ChangeKeys[];\n}\n\nexport enum BackdropSizes {\n\tW300 = \"w300\",\n\tW500 = \"w500\",\n\tW780 = \"w780\",\n\tW1280 = \"w1280\",\n\tORIGINAL = \"original\",\n}\n\nexport enum LogoSizes {\n\tW45 = \"w45\",\n\tW92 = \"w92\",\n\tW154 = \"w154\",\n\tW185 = \"w185\",\n\tW300 = \"w300\",\n\tW500 = \"w500\",\n\tORIGINAL = \"original\",\n}\n\nexport enum PosterSizes {\n\tW92 = \"w92\",\n\tW154 = \"w154\",\n\tW185 = \"w185\",\n\tW300 = \"w300\",\n\tW500 = \"w500\",\n\tW780 = \"w780\",\n\tORIGINAL = \"original\",\n}\n\nexport enum ProfileSizes {\n\tW45 = \"w45\",\n\tW185 = \"w185\",\n\tW632 = \"w632\",\n\tORIGINAL = \"original\",\n}\n\nexport enum StillSizes {\n\tW92 = \"w92\",\n\tW185 = \"w185\",\n\tW300 = \"w300\",\n\tORIGINAL = \"original\",\n}\n\nexport enum ChangeKeys {\n\tADULT = \"adult\",\n\tAIR_DATE = \"air_date\",\n\tALSO_KNOWN_AS = \"also_known_as\",\n\tALTERNATIVE_TITLES = \"alternative_titles\",\n\tBIOGRAPHY = \"biography\",\n\tBIRTHDAY = \"birthday\",\n\tBUDGET = \"budget\",\n\tCAST = \"cast\",\n\tCERTIFICATIONS = \"certifications\",\n\tCHARACTER_NAMES = \"character_names\",\n\tCREATED_BY = \"created_by\",\n\tCREW = \"crew\",\n\tDEATHDAY = \"deathday\",\n\tEPISODE = \"episode\",\n\tEPISODE_NUMBER = \"episode_number\",\n\tEPISODE_RUN_TIME = \"episode_run_time\",\n\tFREEBASE_ID = \"freebase_id\",\n\tFREEBASE_MID = \"freebase_mid\",\n\tGENERAL = \"general\",\n\tGENRES = \"genres\",\n\tGUEST_STARS = \"guest_stars\",\n\tHOMEPAGE = \"homepage\",\n\tIMAGES = \"images\",\n\tIMDB_ID = \"imdb_id\",\n\tLANGUAGES = \"languages\",\n\tNAME = \"name\",\n\tNETWORK = \"network\",\n\tORIGIN_COUNTRY = \"origin_country\",\n\tORIGINAL_NAME = \"original_name\",\n\tORIGINAL_TITLE = \"original_title\",\n\tOVERVIEW = \"overview\",\n\tPARTS = \"parts\",\n\tPLACE_OF_BIRTH = \"place_of_birth\",\n\tPLOT_KEYWORDS = \"plot_keywords\",\n\tPRODUCTION_CODE = \"production_code\",\n\tPRODUCTION_COMPANIES = \"production_companies\",\n\tPRODUCTION_COUNTRIES = \"production_countries\",\n\tRELEASES = \"releases\",\n\tREVENUE = \"revenue\",\n\tRUNTIME = \"runtime\",\n\tSEASON = \"season\",\n\tSEASON_NUMBER = \"season_number\",\n\tSEASON_REGULAR = \"season_regular\",\n\tSPOKEN_LANGUAGES = \"spoken_languages\",\n\tSTATUS = \"status\",\n\tTAGLINE = \"tagline\",\n\tTITLE = \"title\",\n\tTRANSLATIONS = \"translations\",\n\tTVDB_ID = \"tvdb_id\",\n\tTVRAGE_ID = \"tvrage_id\",\n\tTYPE = \"type\",\n\tVIDEO = \"video\",\n\tVIDEOS = \"videos\",\n}\n","import type {\n\tGenre,\n\tLanguageOption,\n\tMovie,\n\tProductionCompany,\n\tProductionCountry,\n\tSpokenLanguage,\n} from \"..\";\nimport type { Nullable, TMDBDateTime } from \"../wire\";\n\nexport interface BelongsToCollection {\n\tid: number;\n\tname: string;\n\tposter_path: Nullable<string>;\n\tbackdrop_path: Nullable<string>;\n}\n\nexport interface MovieDetails {\n\tadult: boolean;\n\tbackdrop_path: Nullable<string>;\n\tbelongs_to_collection?: Nullable<BelongsToCollection>;\n\tbudget: number;\n\tgenres: Genre[];\n\thomepage: Nullable<string>;\n\tid: number;\n\timdb_id: Nullable<string>;\n\toriginal_language: string;\n\toriginal_title: string;\n\toverview: string;\n\tpopularity: number;\n\tposter_path: Nullable<string>;\n\tproduction_companies: ProductionCompany[];\n\tproduction_countries: ProductionCountry[];\n\trelease_date: string;\n\trevenue: number;\n\truntime: Nullable<number>;\n\tspoken_languages: SpokenLanguage[];\n\tstatus: string;\n\ttagline: Nullable<string>;\n\ttitle: string;\n\tvideo: boolean;\n\tvote_average: number;\n\tvote_count: number;\n}\n\nexport enum ReleaseDateType {\n\tPremiere = 1,\n\t\"Theatrical (limited)\" = 2,\n\tTheatrical = 3,\n\tDigital = 4,\n\tPhysical = 5,\n\tTV = 6,\n}\n\nexport interface ReleaseDate {\n\tcertification: string;\n\tiso_639_1: string;\n\trelease_date: TMDBDateTime;\n\ttype: ReleaseDateType;\n\tnote: string;\n}\n\nexport interface ReleaseDateResult {\n\tiso_3166_1: string;\n\trelease_dates: ReleaseDate[];\n}\n\nexport interface ReleaseDates {\n\tid: number;\n\tresults: ReleaseDateResult[];\n}\n\nexport interface SimilarMovies {\n\tpage: number;\n\tresults: Movie[];\n\ttotal_pages: number;\n\ttotal_results: number;\n}\n\nexport interface MovieList {\n\tdescription: string;\n\tfavorite_count: number;\n\tid: number;\n\titem_count: number;\n\tiso_639_1: string;\n\tlist_type: string;\n\tname: string;\n\tposter_path: Nullable<string>;\n}\n\nexport interface MovieLists {\n\tid: number;\n\tpage: number;\n\tresults: MovieList[];\n\ttotal_pages: number;\n\ttotal_results: number;\n}\n\nexport interface LatestMovie {\n\tadult: boolean;\n\tbackdrop_path: Nullable<string>;\n\tbelongs_to_collection?: Nullable<BelongsToCollection>;\n\tbudget: number;\n\tgenres: Genre[];\n\thomepage: Nullable<string>;\n\tid: number;\n\timdb_id: Nullable<string>;\n\toriginal_language: string;\n\toriginal_title: string;\n\toverview: string;\n\tpopularity: number;\n\tposter_path: Nullable<string>;\n\tproduction_companies: ProductionCompany[];\n\tproduction_countries: ProductionCountry[];\n\trelease_date: string;\n\trevenue: number;\n\truntime: Nullable<number>;\n\tspoken_languages: SpokenLanguage[];\n\tstatus: string;\n\ttagline: Nullable<string>;\n\ttitle: string;\n\tvideo: boolean;\n\tvote_average: number;\n\tvote_count: number;\n}\n\nexport interface Dates {\n\tmaximum: string;\n\tminimum: string;\n}\n\nexport interface MoviesPlayingNow {\n\tpage: number;\n\tresults: Movie[];\n\tdates: Dates;\n\ttotal_pages: number;\n\ttotal_results: number;\n}\n\nexport interface PopularMovies {\n\tpage: number;\n\tresults: Movie[];\n\ttotal_results: number;\n\ttotal_pages: number;\n}\n\nexport interface TopRatedMovies {\n\tpage: number;\n\tresults: Movie[];\n\ttotal_results: number;\n\ttotal_pages: number;\n}\n\nexport interface UpcomingMovies {\n\tpage: number;\n\tresults: Movie[];\n\ttotal_results: number;\n\ttotal_pages: number;\n}\n\nexport type MovieChangeValue =\n\t| string\n\t| {\n\t\t\tperson_id: number;\n\t\t\tcharacter: string;\n\t\t\torder: number;\n\t\t\tcast_id: number;\n\t\t\tcredit_id: string;\n\t }\n\t| unknown;\n\nexport interface MoviesImageSearchOptions extends LanguageOption {\n\t/**\n\t * a list of ISO-639-1 values to query\n\t */\n\tinclude_image_language?: string[];\n}\n","import type { ErrorResponse, TokenType } from \"../@types\";\n\nconst BASE_URL_V3 = \"https://api.themoviedb.org/3\";\n\nexport type Primitive = string | number | boolean;\n\nexport type QueryValue =\n\t| Primitive\n\t| null\n\t| undefined\n\t| Array<Primitive | null | undefined>;\n\nexport type Query = Record<string, QueryValue>;\n\nexport interface RequestOptions<Q extends object = object> {\n\tquery?: Q;\n\tsignal?: AbortSignal;\n\ttimeoutMs?: number;\n\tretries?: number;\n\tretryDelayMs?: number;\n}\n\nexport interface RequestConfig {\n\tsignal?: AbortSignal;\n\ttimeoutMs?: number;\n\tretries?: number;\n\tretryDelayMs?: number;\n}\n\nexport class TMDBError extends Error {\n\tconstructor(\n\t\tmessage: string,\n\t\tpublic readonly status: number,\n\t\tpublic readonly url: string,\n\t\tpublic readonly payload?: unknown,\n\t) {\n\t\tsuper(message);\n\t\tthis.name = \"TMDBError\";\n\t}\n}\n\nexport const parseOptions = (options?: Query): string => {\n\tif (!options) return \"\";\n\n\tconst entries: [string, string][] = [];\n\n\tfor (const [key, value] of Object.entries(options)) {\n\t\tif (value === undefined || value === null) continue;\n\n\t\tif (Array.isArray(value)) {\n\t\t\tfor (const item of value) {\n\t\t\t\tif (item === undefined || item === null) continue;\n\t\t\t\tentries.push([key, String(item)]);\n\t\t\t}\n\t\t} else {\n\t\t\tentries.push([key, String(value)]);\n\t\t}\n\t}\n\n\treturn new URLSearchParams(entries).toString();\n};\n\nexport const csv = (\n\tvalues?: ReadonlyArray<Primitive | null | undefined>,\n): string | undefined => {\n\tif (!values) return undefined;\n\n\tconst normalized = values\n\t\t.filter(\n\t\t\t(value): value is Primitive => value !== undefined && value !== null,\n\t\t)\n\t\t.map(String);\n\n\treturn normalized.length > 0 ? normalized.join(\",\") : undefined;\n};\n\nexport const withQuery = <Q extends object>(\n\tquery?: Q,\n\tconfig?: RequestConfig,\n): RequestOptions<Q> => ({\n\t...config,\n\tquery,\n});\n\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n\nconst shouldRetry = (status: number) =>\n\tstatus === 429 || status === 502 || status === 503 || status === 504;\n\nconst readRetryAfterMs = (res: Response): number | undefined => {\n\tconst raw = res.headers.get(\"retry-after\");\n\tif (!raw) return undefined;\n\n\tconst asSeconds = Number(raw);\n\tif (Number.isFinite(asSeconds)) return Math.max(0, asSeconds * 1000);\n\n\tconst asDate = Date.parse(raw);\n\tif (!Number.isNaN(asDate)) return Math.max(0, asDate - Date.now());\n\n\treturn undefined;\n};\n\nexport class API {\n\tprivate apiKey?: string;\n\tprivate accessToken?: string;\n\n\tconstructor(auth: TokenType) {\n\t\tif (typeof auth === \"string\") {\n\t\t\tthis.accessToken = auth;\n\t\t} else {\n\t\t\tthis.apiKey = auth.apiKey;\n\t\t\tthis.accessToken = auth.accessToken;\n\t\t}\n\t}\n\n\tasync get<T, Q extends object = object>(\n\t\tpath: string,\n\t\topts: RequestOptions<Q> = {},\n\t): Promise<T> {\n\t\tif (!this.apiKey && !this.accessToken) {\n\t\t\tthrow new TMDBError(\n\t\t\t\t\"No TMDB authentication provided\",\n\t\t\t\t0,\n\t\t\t\t`${BASE_URL_V3}${path}`,\n\t\t\t);\n\t\t}\n\n\t\tconst query: Query = {\n\t\t\t...(opts.query\n\t\t\t\t? (opts.query as unknown as Record<string, QueryValue>)\n\t\t\t\t: {}),\n\t\t\t...(this.apiKey ? { api_key: this.apiKey } : {}),\n\t\t};\n\n\t\tconst qs = parseOptions(query);\n\t\tconst url = `${BASE_URL_V3}${path}${qs ? `?${qs}` : \"\"}`;\n\n\t\tconst retries = opts.retries ?? 2;\n\t\tconst retryDelayMs = opts.retryDelayMs ?? 300;\n\t\tconst timeoutMs = opts.timeoutMs ?? 30_000;\n\n\t\tconst controller = new AbortController();\n\t\tconst timeout = setTimeout(() => controller.abort(), timeoutMs);\n\n\t\tconst abortFromSignal = () => controller.abort();\n\n\t\tif (opts.signal) {\n\t\t\tif (opts.signal.aborted) {\n\t\t\t\tcontroller.abort();\n\t\t\t} else {\n\t\t\t\topts.signal.addEventListener(\"abort\", abortFromSignal, {\n\t\t\t\t\tonce: true,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\ttry {\n\t\t\tfor (let attempt = 0; attempt <= retries; attempt++) {\n\t\t\t\tconst res = await fetch(url, {\n\t\t\t\t\tmethod: \"GET\",\n\t\t\t\t\tsignal: controller.signal,\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t...(this.accessToken\n\t\t\t\t\t\t\t? { Authorization: `Bearer ${this.accessToken}` }\n\t\t\t\t\t\t\t: {}),\n\t\t\t\t\t\tAccept: \"application/json\",\n\t\t\t\t\t},\n\t\t\t\t});\n\n\t\t\t\tif (res.ok) {\n\t\t\t\t\treturn (await res.json()) as T;\n\t\t\t\t}\n\n\t\t\t\tlet payload: unknown;\n\t\t\t\tlet message = `${res.status} ${res.statusText}`;\n\n\t\t\t\ttry {\n\t\t\t\t\tpayload = (await res.json()) as ErrorResponse;\n\t\t\t\t\tif (\n\t\t\t\t\t\tpayload &&\n\t\t\t\t\t\ttypeof payload === \"object\" &&\n\t\t\t\t\t\t\"status_message\" in payload\n\t\t\t\t\t) {\n\t\t\t\t\t\tmessage = String((payload as ErrorResponse).status_message);\n\t\t\t\t\t}\n\t\t\t\t} catch {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tpayload = await res.text();\n\t\t\t\t\t} catch {\n\t\t\t\t\t\t// ignore\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (attempt < retries && shouldRetry(res.status)) {\n\t\t\t\t\tconst retryAfter = readRetryAfterMs(res);\n\t\t\t\t\tconst delay = retryAfter ?? retryDelayMs * 2 ** attempt;\n\t\t\t\t\tawait sleep(delay);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tthrow new TMDBError(message, res.status, url, payload);\n\t\t\t}\n\n\t\t\tthrow new TMDBError(\"Request failed\", 0, url);\n\t\t} finally {\n\t\t\tclearTimeout(timeout);\n\n\t\t\tif (opts.signal) {\n\t\t\t\topts.signal.removeEventListener(\"abort\", abortFromSignal);\n\t\t\t}\n\t\t}\n\t}\n}\n","import type { Image } from \"../@types\";\n\nexport const TMDB_IMAGE_BASE_URL = \"https://image.tmdb.org/t/p/\";\n\nexport const ImageSizes = {\n\tORIGINAL: \"original\",\n\tW500: \"w500\",\n\tW300: \"w300\",\n\tW185: \"w185\",\n\tW92: \"w92\",\n\tH632: \"h632\",\n} as const;\n\nexport type ImageSize = (typeof ImageSizes)[keyof typeof ImageSizes];\n\nexport const ImageFormats = {\n\tJPG: \"jpg\",\n\tPNG: \"png\",\n\tSVG: \"svg\",\n} as const;\n\nexport type ImageFormat = (typeof ImageFormats)[keyof typeof ImageFormats];\n\nconst isAbsoluteUrl = (value: string) => /^https?:\\/\\//i.test(value);\n\nconst normalizeBaseUrl = (baseUrl: string) =>\n\tbaseUrl.endsWith(\"/\") ? baseUrl : `${baseUrl}/`;\n\nconst normalizeSize = (size: string) => size.replace(/^\\/+|\\/+$/g, \"\");\n\nconst normalizePath = (path: string) =>\n\tpath.startsWith(\"/\") ? path : `/${path}`;\n\nconst setExtension = (path: string, format: string) => {\n\tconst lastSlash = path.lastIndexOf(\"/\");\n\tconst lastDot = path.lastIndexOf(\".\");\n\n\tconst hasExt = lastDot > lastSlash;\n\tif (!hasExt) return `${path}.${format}`;\n\n\treturn `${path.slice(0, lastDot + 1)}${format}`;\n};\n\n/**\n * Constructs a TMDB image URL.\n *\n * - Keeps paths as-is unless `format` is provided (then it replaces/appends\n * the extension safely using the last dot after the last slash).\n * - Handles leading/trailing slashes robustly.\n * - If `imagePath` is already an absolute URL, it is returned unchanged.\n */\nexport const getFullImagePath = (\n\tbaseUrl: string,\n\tfileSize: string,\n\timagePath: string,\n\tformat?: string,\n): string => {\n\tif (!imagePath) return \"\";\n\tif (isAbsoluteUrl(imagePath)) return imagePath;\n\n\tconst base = normalizeBaseUrl(baseUrl);\n\tconst size = normalizeSize(fileSize);\n\n\tlet path = normalizePath(imagePath);\n\tif (format) path = setExtension(path, format);\n\n\treturn `${base}${size}${path}`;\n};\n\n/**\n * Convenience helper for TMDB `Image` objects.\n */\nexport const formImage = (\n\timage: Image,\n\tfileSize: ImageSize,\n\tformat?: ImageFormat,\n): string | undefined => {\n\tconst path = image?.file_path;\n\tif (!path) return undefined;\n\n\treturn getFullImagePath(TMDB_IMAGE_BASE_URL, fileSize, path, format);\n};\n","import { API } from \"../../utils\";\nimport type { TokenType } from \"../types\";\n\n/**\n * Base class for all TMDB API endpoints.\n *\n * Provides a configured {@link API} client instance to subclasses.\n */\nexport class BaseEndpoint {\n\t/**\n\t * Low-level HTTP client wrapper used by all endpoints.\n\t */\n\tprotected readonly api: API;\n\n\t/**\n\t * Create a new endpoint instance.\n\t *\n\t * @param {TokenType} auth - Authentication information.\n\t * - If a string: treated as a v4 API Read Access Token (Bearer token).\n\t * - If an object: can include an API key and/or access token.\n\t */\n\tconstructor(protected readonly auth: TokenType) {\n\t\tthis.api = new API(auth);\n\t}\n}\n","import { type AccountDetails, BaseEndpoint, type TokenType } from \"../@types\";\n\n/**\n * Represents an endpoint for retrieving account details.\n *\n * TMDB v3 reference:\n * - GET /account/{account_id}\n *\n * Note:\n * TMDB does not expose a generic \"GET /account\" for account details. You must\n * provide an `account_id`. Most apps obtain it from an auth flow and then cache\n * it for subsequent requests.\n */\nexport class AccountEndpoint extends BaseEndpoint {\n\t/**\n\t * Constructs a new AccountEndpoint instance.\n\t *\n\t * @param {TokenType} access_token - The access token used for authentication.\n\t */\n\tconstructor(protected readonly access_token: TokenType) {\n\t\tsuper(access_token);\n\t}\n\n\t/**\n\t * Retrieves account details asynchronously.\n\t *\n\t * TMDB: GET /account/{account_id}\n\t *\n\t * @param {number} accountId - The TMDB account ID.\n\t * @returns {Promise<AccountDetails>} A Promise that resolves with the account details.\n\t */\n\tdetails(accountId: number): Promise<AccountDetails> {\n\t\treturn this.api.get<AccountDetails>(`/account/${accountId}`);\n\t}\n}\n","import { BaseEndpoint, type Certifications, type TokenType } from \"../@types\";\n\n/**\n * Represents an endpoint for retrieving certifications for movies and TV shows.\n *\n * TMDB v3 reference:\n * - GET /certification/movie/list\n * - GET /certification/tv/list\n */\nexport class CertificationEndpoint extends BaseEndpoint {\n\t/**\n\t * Constructs a new CertificationEndpoint instance.\n\t *\n\t * @param {TokenType} access_token - The access token used for authentication.\n\t */\n\tconstructor(protected readonly access_token: TokenType) {\n\t\tsuper(access_token);\n\t}\n\n\t/**\n\t * Retrieves certifications for movies asynchronously.\n\t *\n\t * TMDB: GET /certification/movie/list\n\t *\n\t * @returns {Promise<Certifications>} A Promise that resolves with the certifications for movies.\n\t */\n\tmovies(): Promise<Certifications> {\n\t\treturn this.api.get<Certifications>(\"/certification/movie/list\");\n\t}\n\n\t/**\n\t * Retrieves certifications for TV shows asynchronously.\n\t *\n\t * TMDB: GET /certification/tv/list\n\t *\n\t * @returns {Promise<Certifications>} A Promise that resolves with the certifications for TV shows.\n\t */\n\ttv(): Promise<Certifications> {\n\t\treturn this.api.get<Certifications>(\"/certification/tv/list\");\n\t}\n}\n","import {\n\tBaseEndpoint,\n\ttype ChangeOption,\n\ttype MediaChanges,\n\ttype TokenType,\n} from \"../@types\";\n\n/**\n * Represents an endpoint for retrieving changes in movies, TV shows, and persons.\n *\n * TMDB v3 reference:\n * - GET /movie/changes\n * - GET /tv/changes\n * - GET /person/changes\n */\nexport class ChangeEndpoint extends BaseEndpoint {\n\t/**\n\t * Constructs a new ChangeEndpoint instance.\n\t *\n\t * @param {TokenType} access_token - The access token used for authentication.\n\t */\n\tconstructor(protected readonly access_token: TokenType) {\n\t\tsuper(access_token);\n\t}\n\n\t/**\n\t * Retrieves changes in movies asynchronously.\n\t *\n\t * TMDB: GET /movie/changes\n\t *\n\t * @param {ChangeOption} [options] - Optional parameters for filtering the changes.\n\t * @returns {Promise<MediaChanges>} A Promise that resolves with the changes in movies.\n\t */\n\tmovies(options?: ChangeOption): Promise<MediaChanges> {\n\t\treturn this.api.get<MediaChanges>(\"/movie/changes\", { query: options });\n\t}\n\n\t/**\n\t * Retrieves changes in TV shows asynchronously.\n\t *\n\t * TMDB: GET /tv/changes\n\t *\n\t * @param {ChangeOption} [options] - Optional parameters for filtering the changes.\n\t * @returns {Promise<MediaChanges>} A Promise that resolves with the changes in TV shows.\n\t */\n\ttv(options?: ChangeOption): Promise<MediaChanges> {\n\t\treturn this.api.get<MediaChanges>(\"/tv/changes\", { query: options });\n\t}\n\n\t/**\n\t * Retrieves changes related to persons asynchronously.\n\t *\n\t * TMDB: GET /person/changes\n\t *\n\t * @param {ChangeOption} [options] - Optional parameters for filtering the changes.\n\t * @returns {Promise<MediaChanges>} A Promise that resolves with the changes related to persons.\n\t */\n\tperson(options?: ChangeOption): Promise<MediaChanges> {\n\t\treturn this.api.get<MediaChanges>(\"/person/changes\", { query: options });\n\t}\n}\n","import {\n\tBaseEndpoint,\n\ttype CollectionImageOptions,\n\ttype DetailedCollection,\n\ttype ImageCollection,\n\ttype LanguageOption,\n\ttype TokenType,\n\ttype Translations,\n} from \"../@types\";\nimport { csv, type RequestConfig, withQuery } from \"../utils\";\n\nconst BASE_COLLECTION = \"/collection\";\n\n/**\n * Represents an endpoint for accessing collections and their details.\n */\nexport class CollectionsEndpoint extends BaseEndpoint {\n\t/**\n\t * Constructs a new CollectionsEndpoint instance.\n\t *\n\t * @param {TokenType} auth - The authentication configuration.\n\t */\n\tconstructor(protected readonly auth: TokenType) {\n\t\tsuper(auth);\n\t}\n\n\t/**\n\t * Retrieves details of a specific collection asynchronously.\n\t *\n\t * @param {number} id - The ID of the collection.\n\t * @param {LanguageOption} [options] - Optional parameters for specifying the\n\t * language.\n\t * @param {RequestConfig} [request] - Optional request behavior overrides.\n\t * @returns {Promise<DetailedCollection>} A Promise that resolves with the\n\t * detailed information of the collection.\n\t */\n\tdetails(\n\t\tid: number,\n\t\toptions?: LanguageOption,\n\t\trequest?: RequestConfig,\n\t): Promise<DetailedCollection> {\n\t\treturn this.api.get<DetailedCollection>(\n\t\t\t`${BASE_COLLECTION}/${id}`,\n\t\t\twithQuery(options, request),\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves images associated with a specific collection asynchronously.\n\t *\n\t * @param {number} id - The ID of the collection.\n\t * @param {CollectionImageOptions} [options] - Optional parameters for\n\t * specifying image options.\n\t * @param {RequestConfig} [request] - Optional request behavior overrides.\n\t * @returns {Promise<ImageCollection>} A Promise that resolves with the\n\t * collection images.\n\t */\n\timages(\n\t\tid: number,\n\t\toptions?: CollectionImageOptions,\n\t\trequest?: RequestConfig,\n\t): Promise<ImageCollection> {\n\t\tconst query = {\n\t\t\tinclude_image_language: csv(options?.include_image_language),\n\t\t\tlanguage: options?.language,\n\t\t};\n\n\t\treturn this.api.get<ImageCollection>(\n\t\t\t`${BASE_COLLECTION}/${id}/images`,\n\t\t\twithQuery(query, request),\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves translations for a specific collection asynchronously.\n\t *\n\t * @param {number} id - The ID of the collection.\n\t * @param {LanguageOption} [options] - Optional parameters for specifying the\n\t * language.\n\t * @param {RequestConfig} [request] - Optional request behavior overrides.\n\t * @returns {Promise<Translations>} A Promise that resolves with the\n\t * translations of the collection.\n\t */\n\ttranslations(\n\t\tid: number,\n\t\toptions?: LanguageOption,\n\t\trequest?: RequestConfig,\n\t): Promise<Translations> {\n\t\treturn this.api.get<Translations>(\n\t\t\t`${BASE_COLLECTION}/${id}/translations`,\n\t\t\twithQuery(options, request),\n\t\t);\n\t}\n}\n","import {\n\ttype AlternativeNames,\n\tBaseEndpoint,\n\ttype CompanyDetails,\n\ttype CompanyImages,\n\ttype TokenType,\n} from \"../@types\";\n\n/**\n * Represents an endpoint for accessing company details and related information.\n */\nexport class CompaniesEndpoint extends BaseEndpoint {\n\t/**\n\t * Constructs a new CompaniesEndpoint instance.\n\t *\n\t * @param {TokenType} auth - The authentication configuration.\n\t */\n\tconstructor(protected readonly auth: TokenType) {\n\t\tsuper(auth);\n\t}\n\n\t/**\n\t * Retrieves details of a specific company asynchronously.\n\t *\n\t * @param {number} id - The ID of the company.\n\t * @returns {Promise<CompanyDetails>} A Promise that resolves with the\n\t * detailed information of the company.\n\t */\n\tdetails(id: number): Promise<CompanyDetails> {\n\t\treturn this.api.get<CompanyDetails>(`/company/${id}`);\n\t}\n\n\t/**\n\t * Retrieves alternative names of a specific company asynchronously.\n\t *\n\t * @param {number} id - The ID of the company.\n\t * @returns {Promise<AlternativeNames>} A Promise that resolves with the\n\t * alternative names of the company.\n\t */\n\talternativeNames(id: number): Promise<AlternativeNames> {\n\t\treturn this.api.get<AlternativeNames>(`/company/${id}/alternative_names`);\n\t}\n\n\t/**\n\t * Retrieves images associated with a specific company asynchronously.\n\t *\n\t * @param {number} id - The ID of the company.\n\t * @returns {Promise<CompanyImages>} A Promise that resolves with the images\n\t * of the company.\n\t */\n\timages(id: number): Promise<CompanyImages> {\n\t\treturn this.api.get<CompanyImages>(`/company/${id}/images`);\n\t}\n}\n","import { BaseEndpoint, type Configuration, type TokenType } from \"../@types\";\n\n/**\n * Represents an endpoint for retrieving current system configuration.\n */\nexport class ConfigurationEndpoint extends BaseEndpoint {\n\t/**\n\t * Constructs a new ConfigurationEndpoint instance.\n\t *\n\t * @param {TokenType} auth - The authentication configuration.\n\t */\n\tconstructor(protected readonly auth: TokenType) {\n\t\tsuper(auth);\n\t}\n\n\t/**\n\t * Retrieves the current system configuration asynchronously.\n\t *\n\t * @returns {Promise<Configuration>} A Promise that resolves with the current\n\t * system configuration.\n\t */\n\tgetCurrent(): Promise<Configuration> {\n\t\treturn this.api.get<Configuration>(\"/configuration\");\n\t}\n}\n","import { BaseEndpoint, type CreditResponse, type TokenType } from \"../@types\";\n\n/**\n * Represents an endpoint for retrieving credit details.\n */\nexport class CreditsEndpoint extends BaseEndpoint {\n\t/**\n\t * Constructs a new CreditsEndpoint instance.\n\t *\n\t * @param {TokenType} auth - The authentication configuration.\n\t */\n\tconstructor(protected readonly auth: TokenType) {\n\t\tsuper(auth);\n\t}\n\n\t/**\n\t * Retrieves credit details by ID asynchronously.\n\t *\n\t * @param {string} id - The ID of the credit.\n\t * @returns {Promise<CreditResponse>} A Promise that resolves with the credit\n\t * details.\n\t */\n\tgetById(id: string): Promise<CreditResponse> {\n\t\treturn this.api.get<CreditResponse>(`/credit/${id}`);\n\t}\n}\n","import {\n\tBaseEndpoint,\n\ttype MovieDiscoverResult,\n\ttype MovieQueryOptions,\n\ttype TokenType,\n\ttype TvShowDiscoverResult,\n\ttype TvShowQueryOptions,\n} from \"../@types\";\nimport { type RequestConfig, withQuery } from \"../utils\";\n\nconst BASE_DISCOVER = \"/discover\";\n\n/**\n * Represents an endpoint for discovering movies and TV shows based on various\n * criteria.\n *\n * TMDB v3 reference:\n * - GET /discover/movie\n * - GET /discover/tv\n */\nexport class DiscoverEndpoint extends BaseEndpoint {\n\t/**\n\t * Constructs a new DiscoverEndpoint instance.\n\t *\n\t * @param {TokenType} access_token - The access token used for authentication.\n\t */\n\tconstructor(protected readonly access_token: TokenType) {\n\t\tsuper(access_token);\n\t}\n\n\t/**\n\t * Retrieves a list of movies based on the provided query options\n\t * asynchronously.\n\t *\n\t * @param {MovieQueryOptions} [options] - Optional parameters for refining the\n\t * movie discovery.\n\t * @param {RequestConfig} [request] - Optional request behavior overrides.\n\t * @returns {Promise<MovieDiscoverResult>} A Promise that resolves with the\n\t * movie discovery results.\n\t */\n\tmovie(\n\t\toptions?: MovieQueryOptions,\n\t\trequest?: RequestConfig,\n\t): Promise<MovieDiscoverResult> {\n\t\treturn this.api.get<MovieDiscoverResult>(\n\t\t\t`${BASE_DISCOVER}/movie`,\n\t\t\twithQuery(options, request),\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves a list of TV shows based on the provided query options\n\t * asynchronously.\n\t *\n\t * @param {TvShowQueryOptions} [options] - Optional parameters for refining\n\t * the TV show discovery.\n\t * @param {RequestConfig} [request] - Optional request behavior overrides.\n\t * @returns {Promise<TvShowDiscoverResult>} A Promise that resolves with the\n\t * TV show discovery results.\n\t */\n\ttvShow(\n\t\toptions?: TvShowQueryOptions,\n\t\trequest?: RequestConfig,\n\t): Promise<TvShowDiscoverResult> {\n\t\treturn this.api.get<TvShowDiscoverResult>(\n\t\t\t`${BASE_DISCOVER}/tv`,\n\t\t\twithQuery(options, request),\n\t\t);\n\t}\n}\n","import {\n\tBaseEndpoint,\n\ttype ExternalIdOptions,\n\ttype FindResult,\n\ttype TokenType,\n} from \"../@types\";\n\n/**\n * Represents an endpoint for finding media by external ID.\n */\nexport class FindEndpoint extends BaseEndpoint {\n\t/**\n\t * Constructs a new FindEndpoint instance.\n\t *\n\t * @param {TokenType} auth - The authentication configuration.\n\t */\n\tconstructor(protected readonly auth: TokenType) {\n\t\tsuper(auth);\n\t}\n\n\t/**\n\t * Retrieves media by external ID asynchronously.\n\t *\n\t * @param {string} externalId - The external ID of the media.\n\t * @param {ExternalIdOptions} options - Options for finding media by external\n\t * ID.\n\t * @returns {Promise<FindResult>} A Promise that resolves with the result of\n\t * the find operation.\n\t */\n\tbyId(externalId: string, options: ExternalIdOptions): Promise<FindResult> {\n\t\treturn this.api.get<FindResult>(`/find/${externalId}`, {\n\t\t\tquery: options,\n\t\t});\n\t}\n}\n","import {\n\tBaseEndpoint,\n\ttype Genres,\n\ttype LanguageOption,\n\ttype TokenType,\n} from \"../@types\";\n\n/**\n * Represents an endpoint for retrieving genre information for movies and TV\n * shows.\n */\nexport class GenreEndpoint extends BaseEndpoint {\n\t/**\n\t * Constructs a new GenreEndpoint instance.\n\t *\n\t * @param {TokenType} auth - The authentication configuration.\n\t */\n\tconstructor(protected readonly auth: TokenType) {\n\t\tsuper(auth);\n\t}\n\n\t/**\n\t * Retrieves genre information for movies asynchronously.\n\t *\n\t * @param {LanguageOption} [options] - Optional parameters for specifying the\n\t * language.\n\t * @returns {Promise<Genres>} A Promise that resolves with the genre\n\t * information for movies.\n\t */\n\tmovies(options?: LanguageOption): Promise<Genres> {\n\t\treturn this.api.get<Genres>(\"/genre/movie/list\", { query: options });\n\t}\n\n\t/**\n\t * Retrieves genre information for TV shows asynchronously.\n\t *\n\t * @param {LanguageOption} [options] - Optional parameters for specifying the\n\t * language.\n\t * @returns {Promise<Genres>} A Promise that resolves with the genre\n\t * information for TV shows.\n\t */\n\ttv(options?: LanguageOption): Promise<Genres> {\n\t\treturn this.api.get<Genres>(\"/genre/tv/list\", { query: options });\n\t}\n}\n","import {\n\tBaseEndpoint,\n\ttype BelongingMovies,\n\ttype Keyword,\n\ttype KeywordsOptions,\n\ttype TokenType,\n} from \"../@types\";\n\nconst BASE_KEYWORD = \"/keyword\";\n\n/**\n * Represents an endpoint for accessing keyword details and related movies.\n */\nexport class KeywordsEndpoint extends BaseEndpoint {\n\t/**\n\t * Constructs a new KeywordsEndpoint instance.\n\t *\n\t * @param {TokenType} auth - The authentication configuration.\n\t */\n\tconstructor(protected readonly auth: TokenType) {\n\t\tsuper(auth);\n\t}\n\n\t/**\n\t * Retrieves details of a specific keyword asynchronously.\n\t *\n\t * @param {number} keywordId - The ID of the keyword.\n\t * @returns {Promise<Keyword>} A Promise that resolves with the details of\n\t * the keyword.\n\t */\n\tdetails(keywordId: number): Promise<Keyword> {\n\t\treturn this.api.get<Keyword>(`${BASE_KEYWORD}/${keywordId}`);\n\t}\n\n\t/**\n\t * Retrieves movies belonging to a specific keyword asynchronously.\n\t *\n\t * @param {number} keywordId - The ID of the keyword.\n\t * @param {KeywordsOptions} [options] - Optional parameters for refining the\n\t * search.\n\t * @returns {Promise<BelongingMovies>} A Promise that resolves with the\n\t * movies belonging to the keyword.\n\t */\n\tbelongingMovies(\n\t\tkeywordId: number,\n\t\toptions?: KeywordsOptions,\n\t): Promise<BelongingMovies> {\n\t\treturn this.api.get<BelongingMovies>(\n\t\t\t`${BASE_KEYWORD}/${keywordId}/movies`,\n\t\t\t{\n\t\t\t\tquery: options,\n\t\t\t},\n\t\t);\n\t}\n}\n","import {\n\ttype AlternativeTitles,\n\ttype AppendToResponse,\n\ttype AppendToResponseMovieKey,\n\tBaseEndpoint,\n\ttype ChangeOption,\n\ttype Changes,\n\ttype Credits,\n\ttype ExternalIds,\n\ttype Images,\n\ttype Keywords,\n\ttype LanguageOption,\n\ttype LatestMovie,\n\ttype MovieChangeValue,\n\ttype MovieDetails,\n\ttype MovieLists,\n\ttype MoviesImageSearchOptions,\n\ttype MoviesPlayingNow,\n\ttype PageOption,\n\ttype PopularMovies,\n\ttype Recommendations,\n\ttype RegionOption,\n\ttype ReleaseDates,\n\ttype Reviews,\n\ttype SimilarMovies,\n\ttype TokenType,\n\ttype TopRatedMovies,\n\ttype Translations,\n\ttype UpcomingMovies,\n\ttype Videos,\n\ttype WatchProviders,\n} from \"../@types\";\nimport { csv, type RequestConfig, withQuery } from \"../utils\";\n\nconst BASE_MOVIE = \"/movie\";\n\n/**\n * Represents an endpoint for accessing movie-related information.\n */\nexport class MoviesEndpoint extends BaseEndpoint {\n\t/**\n\t * Constructs a new MoviesEndpoint instance.\n\t *\n\t * @param {TokenType} auth - The authentication configuration.\n\t */\n\tconstructor(protected readonly auth: TokenType) {\n\t\tsuper(auth);\n\t}\n\n\t/**\n\t * Retrieves details of a specific movie asynchronously.\n\t *\n\t * @param {number} id - The ID of the movie.\n\t * @param {AppendToResponseMovieKey[]} [appendToResponse] - Optional keys to\n\t * append to the response.\n\t * @param {string} [language] - Optional parameter for specifying the\n\t * language.\n\t * @param {RequestConfig} [request] - Optional request behavior overrides.\n\t * @returns {Promise<AppendToResponse<MovieDetails, T, \"movie\">>} A Promise\n\t * that resolves with the details of the movie.\n\t */\n\tdetails<T extends AppendToResponseMovieKey[] | undefined>(\n\t\tid: number,\n\t\tappendToResponse?: T,\n\t\tlanguage?: string,\n\t\trequest?: RequestConfig,\n\t): Promise<AppendToResponse<MovieDetails, T, \"movie\">> {\n\t\tconst query = {\n\t\t\tappend_to_response: csv(appendToResponse),\n\t\t\tlanguage,\n\t\t};\n\n\t\treturn this.api.get<AppendToResponse<MovieDetails, T, \"movie\">>(\n\t\t\t`${BASE_MOVIE}/${id}`,\n\t\t\twithQuery(query, request),\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves alternative titles of a specific movie asynchronously.\n\t *\n\t * @param {number} id - The ID of the movie.\n\t * @param {RequestConfig} [request] - Optional request behavior overrides.\n\t * @returns {Promise<AlternativeTitles>} A Promise that resolves with the\n\t * alternative titles of the movie.\n\t */\n\talternativeTitles(\n\t\tid: number,\n\t\trequest?: RequestConfig,\n\t): Promise<AlternativeTitles> {\n\t\treturn this.api.get<AlternativeTitles>(\n\t\t\t`${BASE_MOVIE}/${id}/alternative_titles`,\n\t\t\trequest,\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves changes made to a specific movie asynchronously.\n\t *\n\t * @param {number} id - The ID of the movie.\n\t * @param {ChangeOption} [options] - Optional parameters for filtering\n\t * changes.\n\t * @param {RequestConfig} [request] - Optional request behavior overrides.\n\t * @returns {Promise<Changes<MovieChangeValue>>} A Promise that resolves with\n\t * the changes made to the movie.\n\t */\n\tchanges(\n\t\tid: number,\n\t\toptions?: ChangeOption,\n\t\trequest?: RequestConfig,\n\t): Promise<Changes<MovieChangeValue>> {\n\t\treturn this.api.get<Changes<MovieChangeValue>>(\n\t\t\t`${BASE_MOVIE}/${id}/changes`,\n\t\t\twithQuery(options, request),\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves credits of a specific movie asynchronously.\n\t *\n\t * @param {number} id - The ID of the movie.\n\t * @param {LanguageOption} [options] - Optional parameters for specifying the\n\t * language.\n\t * @param {RequestConfig} [request] - Optional request behavior overrides.\n\t * @returns {Promise<Credits>} A Promise that resolves with the credits of\n\t * the movie.\n\t */\n\tcredits(\n\t\tid: number,\n\t\toptions?: LanguageOption,\n\t\trequest?: RequestConfig,\n\t): Promise<Credits> {\n\t\treturn this.api.get<Credits>(\n\t\t\t`${BASE_MOVIE}/${id}/credits`,\n\t\t\twithQuery(options, request),\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves external IDs of a specific movie asynchronously.\n\t *\n\t * @param {number} id - The ID of the movie.\n\t * @param {RequestConfig} [request] - Optional request behavior overrides.\n\t * @returns {Promise<ExternalIds>} A Promise that resolves with the external\n\t * IDs of the movie.\n\t */\n\texternalIds(id: number, request?: RequestConfig): Promise<ExternalIds> {\n\t\treturn this.api.get<ExternalIds>(\n\t\t\t`${BASE_MOVIE}/${id}/external_ids`,\n\t\t\trequest,\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves images of a specific movie asynchronously.\n\t *\n\t * @param {number} id - The ID of the movie.\n\t * @param {MoviesImageSearchOptions} [options] - Optional parameters for\n\t * specifying image search options.\n\t * @param {RequestConfig} [request] - Optional request behavior overrides.\n\t * @returns {Promise<Images>} A Promise that resolves with the images of the\n\t * movie.\n\t */\n\timages(\n\t\tid: number,\n\t\toptions?: MoviesImageSearchOptions,\n\t\trequest?: RequestConfig,\n\t): Promise<Images> {\n\t\tconst query = {\n\t\t\tinclude_image_language: csv(options?.include_image_language),\n\t\t\tlanguage: options?.language,\n\t\t};\n\n\t\treturn this.api.get<Images>(\n\t\t\t`${BASE_MOVIE}/${id}/images`,\n\t\t\twithQuery(query, request),\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves keywords of a specific movie asynchronously.\n\t *\n\t * @param {number} id - The ID of the movie.\n\t * @param {RequestConfig} [request] - Optional request behavior overrides.\n\t * @returns {Promise<Keywords>} A Promise that resolves with the keywords of\n\t * the movie.\n\t */\n\tkeywords(id: number, request?: RequestConfig): Promise<Keywords> {\n\t\treturn this.api.get<Keywords>(`${BASE_MOVIE}/${id}/keywords`, request);\n\t}\n\n\t/**\n\t * Retrieves lists containing a specific movie asynchronously.\n\t *\n\t * @param {number} id - The ID of the movie.\n\t * @param {LanguageOption & PageOption} [options] - Optional parameters for\n\t * specifying language and pagination options.\n\t * @param {RequestConfig} [request] - Optional request behavior overrides.\n\t * @returns {Promise<MovieLists>} A Promise that resolves with the lists\n\t * containing the movie.\n\t */\n\tlists(\n\t\tid: number,\n\t\toptions?: LanguageOption & PageOption,\n\t\trequest?: RequestConfig,\n\t): Promise<MovieLists> {\n\t\treturn this.api.get<MovieLists>(\n\t\t\t`${BASE_MOVIE}/${id}/lists`,\n\t\t\twithQuery(options, request),\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves recommendations for a specific movie asynchronously.\n\t *\n\t * @param {number} id - The ID of the movie.\n\t * @param {LanguageOption & PageOption} [options] - Optional parameters for\n\t * specifying language and pagination options.\n\t * @param {RequestConfig} [request] - Optional request behavior overrides.\n\t * @returns {Promise<Recommendations>} A Promise that resolves with the\n\t * recommendations for the movie.\n\t */\n\trecommendations(\n\t\tid: number,\n\t\toptions?: LanguageOption & PageOption,\n\t\trequest?: RequestConfig,\n\t): Promise<Recommendations> {\n\t\treturn this.api.get<Recommendations>(\n\t\t\t`${BASE_MOVIE}/${id}/recommendations`,\n\t\t\twithQuery(options, request),\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves release dates of a specific movie asynchronously.\n\t *\n\t * @param {number} id - The ID of the movie.\n\t * @param {RequestConfig} [request] - Optional request behavior overrides.\n\t * @returns {Promise<ReleaseDates>} A Promise that resolves with the release\n\t * dates of the movie.\n\t */\n\treleaseDates(id: number, request?: RequestConfig): Promise<ReleaseDates> {\n\t\treturn this.api.get<ReleaseDates>(\n\t\t\t`${BASE_MOVIE}/${id}/release_dates`,\n\t\t\trequest,\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves reviews for a specific movie asynchronously.\n\t *\n\t * @param {number} id - The ID of the movie.\n\t * @param {LanguageOption & PageOption} [options] - Optional parameters for\n\t * specifying language and pagination options.\n\t * @param {RequestConfig} [request] - Optional request behavior overrides.\n\t * @returns {Promise<Reviews>} A Promise that resolves with the reviews for\n\t * the movie.\n\t */\n\treviews(\n\t\tid: number,\n\t\toptions?: LanguageOption & PageOption,\n\t\trequest?: RequestConfig,\n\t): Promise<Reviews> {\n\t\treturn this.api.get<Reviews>(\n\t\t\t`${BASE_MOVIE}/${id}/reviews`,\n\t\t\twithQuery(options, request),\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves similar movies for a specific movie asynchronously.\n\t *\n\t * @param {number} id - The ID of the movie.\n\t * @param {LanguageOption & PageOption} [options] - Optional parameters for\n\t * specifying language and pagination options.\n\t * @param {RequestConfig} [request] - Optional request behavior overrides.\n\t * @returns {Promise<SimilarMovies>} A Promise that resolves with the similar\n\t * movies for the movie.\n\t */\n\tsimilar(\n\t\tid: number,\n\t\toptions?: LanguageOption & PageOption,\n\t\trequest?: RequestConfig,\n\t): Promise<SimilarMovies> {\n\t\treturn this.api.get<SimilarMovies>(\n\t\t\t`${BASE_MOVIE}/${id}/similar`,\n\t\t\twithQuery(options, request),\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves translations of a specific movie asynchronously.\n\t *\n\t * @param {number} id - The ID of the movie.\n\t * @param {RequestConfig} [request] - Optional request behavior overrides.\n\t * @returns {Promise<Translations>} A Promise that resolves with the\n\t * translations of the movie.\n\t */\n\ttranslations(id: number, request?: RequestConfig): Promise<Translations> {\n\t\treturn this.api.get<Translations>(\n\t\t\t`${BASE_MOVIE}/${id}/translations`,\n\t\t\trequest,\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves videos of a specific movie asynchronously.\n\t *\n\t * @param {number} id - The ID of the movie.\n\t * @param {LanguageOption} [options] - Optional parameters for specifying the\n\t * language.\n\t * @param {RequestConfig} [request] - Optional request behavior overrides.\n\t * @returns {Promise<Videos>} A Promise that resolves with the videos of the\n\t * movie.\n\t */\n\tvideos(\n\t\tid: number,\n\t\toptions?: LanguageOption,\n\t\trequest?: RequestConfig,\n\t): Promise<Videos> {\n\t\treturn this.api.get<Videos>(\n\t\t\t`${BASE_MOVIE}/${id}/videos`,\n\t\t\twithQuery(options, request),\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves watch providers of a specific movie asynchronously.\n\t *\n\t * @param {number} id - The ID of the movie.\n\t * @param {RequestConfig} [request] - Optional request behavior overrides.\n\t * @returns {Promise<WatchProviders>} A Promise that resolves with the watch\n\t * providers of the movie.\n\t */\n\twatchProviders(id: number, request?: RequestConfig): Promise<WatchProviders> {\n\t\treturn this.api.get<WatchProviders>(\n\t\t\t`${BASE_MOVIE}/${id}/watch/providers`,\n\t\t\trequest,\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves details of the latest movie asynchronously.\n\t *\n\t * @param {RequestConfig} [request] - Optional request behavior overrides.\n\t * @returns {Promise<LatestMovie>} A Promise that resolves with the details\n\t * of the latest movie.\n\t */\n\tlatest(request?: RequestConfig): Promise<LatestMovie> {\n\t\treturn this.api.get<LatestMovie>(`${BASE_MOVIE}/latest`, request);\n\t}\n\n\t/**\n\t * Retrieves movies playing now asynchronously.\n\t *\n\t * @param {PageOption & LanguageOption & RegionOption} [options] - Optional\n\t * parameters for specifying language, region, and pagination options.\n\t * @param {RequestConfig} [request] - Optional request behavior overrides.\n\t * @returns {Promise<MoviesPlayingNow>} A Promise that resolves with the\n\t * movies playing now.\n\t */\n\tnowPlaying(\n\t\toptions?: PageOption & LanguageOption & RegionOption,\n\t\trequest?: RequestConfig,\n\t): Promise<MoviesPlayingNow> {\n\t\treturn this.api.get<MoviesPlayingNow>(\n\t\t\t`${BASE_MOVIE}/now_playing`,\n\t\t\twithQuery(options, request),\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves popular movies asynchronously.\n\t *\n\t * @param {LanguageOption & PageOption} [options] - Optional parameters for\n\t * specifying language and pagination options.\n\t * @param {RequestConfig} [request] - Optional request behavior overrides.\n\t * @returns {Promise<PopularMovies>} A Promise that resolves with the popular\n\t * movies.\n\t */\n\tpopular(\n\t\toptions?: LanguageOption & PageOption,\n\t\trequest?: RequestConfig,\n\t): Promise<PopularMovies> {\n\t\treturn this.api.get<PopularMovies>(\n\t\t\t`${BASE_MOVIE}/popular`,\n\t\t\twithQuery(options, request),\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves top rated movies asynchronously.\n\t *\n\t * @param {PageOption & LanguageOption & RegionOption} [options] - Optional\n\t * parameters for specifying language, region, and pagination options.\n\t * @param {RequestConfig} [request] - Optional request behavior overrides.\n\t * @returns {Promise<TopRatedMovies>} A Promise that resolves with the top\n\t * rated movies.\n\t */\n\ttopRated(\n\t\toptions?: PageOption & LanguageOption & RegionOption,\n\t\trequest?: RequestConfig,\n\t): Promise<TopRatedMovies> {\n\t\treturn this.api.get<TopRatedMovies>(\n\t\t\t`${BASE_MOVIE}/top_rated`,\n\t\t\twithQuery(options, request),\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves upcoming movies asynchronously.\n\t *\n\t * @param {PageOption & LanguageOption & RegionOption} [options] - Optional\n\t * parameters for specifying language, region, and pagination options.\n\t * @param {RequestConfig} [request] - Optional request behavior overrides.\n\t * @returns {Promise<UpcomingMovies>} A Promise that resolves with the\n\t * upcoming movies.\n\t */\n\tupcoming(\n\t\toptions?: PageOption & LanguageOption & RegionOption,\n\t\trequest?: RequestConfig,\n\t): Promise<UpcomingMovies> {\n\t\treturn this.api.get<UpcomingMovies>(\n\t\t\t`${BASE_MOVIE}/upcoming`,\n\t\t\twithQuery(options, request),\n\t\t);\n\t}\n}\n","import {\n\ttype AlternativeNames,\n\tBaseEndpoint,\n\ttype NetworkDetails,\n\ttype NetworkImages,\n\ttype TokenType,\n} from \"../@types\";\n\n/**\n * Represents an endpoint for accessing network details.\n */\nexport class NetworksEndpoint extends BaseEndpoint {\n\t/**\n\t * Constructs a new NetworksEndpoint instance.\n\t *\n\t * @param {TokenType} auth - The authentication configuration.\n\t */\n\tconstructor(protected readonly auth: TokenType) {\n\t\tsuper(auth);\n\t}\n\n\t/**\n\t * Retrieves details of a specific network asynchronously.\n\t *\n\t * @param {number} id - The ID of the network.\n\t * @returns {Promise<NetworkDetails>} A Promise that resolves with the\n\t * details of the network.\n\t */\n\tdetails(id: number): Promise<NetworkDetails> {\n\t\treturn this.api.get<NetworkDetails>(`/network/${id}`);\n\t}\n\n\t/**\n\t * Retrieves alternative names of a specific network asynchronously.\n\t *\n\t * @param {number} id - The ID of the network.\n\t * @retu