@tdanks2000/tmdb-wrapper
Version:
A powerful and easy-to-use TypeScript wrapper for The Movie Database (TMDb) API
1 lines • 99.2 kB
Source Map (JSON)
{"version":3,"file":"index.mjs","names":["auth: TokenType","path: string","options?: O","options?: Record<string, unknown>","entries: [string, string][]","baseUrl: string","fileSize: string","imagePath: string","format?: string","imageFormat","auth: TokenType","access_token: TokenType","access_token: TokenType","access_token: TokenType","options?: ChangeOption","access_token: TokenType","id: number","options?: LanguageOption","options?: CollectionImageOptions","access_token: TokenType","id: number","access_token: TokenType","access_token: TokenType","id: string","access_token: TokenType","options?: MovieQueryOptions","options?: TvShowQueryOptions","access_token: TokenType","externalId: string","options: ExternalIdOptions","access_token: TokenType","options?: LanguageOption","access_token: TokenType","keywordId: number","options?: KeywordsOptions","access_token: TokenType","id: number","appendToResponse?: T","language?: string","options?: ChangeOption","options?: LanguageOption","options?: MoviesImageSearchOptions","options?: LanguageOption & PageOption","options?: PageOption & LanguageOption & RegionOption","access_token: TokenType","id: number","access_token: TokenType","id: number","appendToResponse?: T","language?: string","options?: ChangeOption","options?: LanguageOption","options?: PageOption","options?: LanguageOption & PageOption","access_token: TokenType","id: string","access_token: TokenType","options: SearchOptions","options: MovieSearchOptions","options: PeopleSearchOptions","options: TvSearchOptions","options: MultiSearchOptions","access_token: TokenType","mediaType: T","timeWindow: TimeWindow","options?: LanguageOption & PageOption","episodeSelection: EpisodeSelection","access_token: TokenType","appendToResponse?: T","options?: LanguageOption","episodeID: number","options?: ChangeOption","options?: TvEpisodeImageSearchOptions","options?: TvEpisodeVideoSearchOptions","seasonSelection: SeasonSelection","access_token: TokenType","appendToResponse?: T","options?: LanguageOption","seasonId: number","options?: ChangeOption","options?: TvSeasonImageSearchOptions","options?: TvSeasonVideoSearchOptions","access_token: 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 \"..\";\n\nexport interface BelongsToCollection {\n\tid: number;\n\tname: string;\n\tposter_path: string;\n\tbackdrop_path: string;\n}\n\nexport interface MovieDetails {\n\tadult: boolean;\n\tbackdrop_path: string;\n\tbelongs_to_collection?: BelongsToCollection;\n\tbudget: number;\n\tgenres: Genre[];\n\thomepage: string;\n\tid: number;\n\timdb_id: string;\n\toriginal_language: string;\n\toriginal_title: string;\n\toverview: string;\n\tpopularity: number;\n\tposter_path?: string;\n\tproduction_companies: ProductionCompany[];\n\tproduction_countries: ProductionCountry[];\n\trelease_date: string;\n\trevenue: number;\n\truntime: number;\n\tspoken_languages: SpokenLanguage[];\n\tstatus: string;\n\ttagline: 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: Date;\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: 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?: string;\n\tbelongs_to_collection?: BelongsToCollection;\n\tbudget: number;\n\tgenres: Genre[];\n\thomepage: string;\n\tid: number;\n\timdb_id: string;\n\toriginal_language: string;\n\toriginal_title: string;\n\toverview: string;\n\tpopularity: number;\n\tposter_path: string;\n\tproduction_companies: ProductionCompany[];\n\tproduction_countries: ProductionCountry[];\n\trelease_date: string;\n\trevenue: number;\n\truntime: number;\n\tspoken_languages: SpokenLanguage[];\n\tstatus: string;\n\ttagline: 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 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\t/**\n\t * Generic GET:\n\t * @template T — response type\n\t * @template O — options (query params) type\n\t */\n\tasync get<T, O extends Record<string, unknown> = Record<string, unknown>>(\n\t\tpath: string,\n\t\toptions?: O,\n\t): Promise<T> {\n\t\tconst rawOptions = {\n\t\t\t...(options ?? {}),\n\t\t\t...(this.apiKey ? { api_key: this.apiKey } : {}),\n\t\t};\n\n\t\tconst params = parseOptions(rawOptions);\n\n\t\tconst response = await fetch(`${BASE_URL_V3}${path}?${params}`, {\n\t\t\tmethod: \"GET\",\n\t\t\theaders: {\n\t\t\t\t...(this.accessToken\n\t\t\t\t\t? { Authorization: `Bearer ${this.accessToken}` }\n\t\t\t\t\t: {}),\n\t\t\t\t\"Content-Type\": \"application/json;charset=utf-8\",\n\t\t\t},\n\t\t});\n\n\t\tif (!response.ok) {\n\t\t\tconst error = (await response.json()) as ErrorResponse;\n\t\t\treturn Promise.reject(error);\n\t\t}\n\n\t\treturn (await response.json()) as T;\n\t}\n}\n\nexport const parseOptions = (options?: Record<string, unknown>): 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\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","/**\n * Utility method to construct full url for image\n * based on configuration\n *\n * https://developers.themoviedb.org/3/getting-started/images\n * @param {string} baseUrl base image url (e.g., 'https://image.tmdb.org/t/p/')\n * @param {string} fileSize file size (e.g., 'original', 'w500')\n * @param {string} imagePath raw image path\n * @param {string} format override image format (e.g., 'svg', 'png', 'jpg')\n * @returns {string} The complete image URL\n */\nexport const getFullImagePath = (\n\tbaseUrl: string,\n\tfileSize: string,\n\timagePath: string,\n\tformat?: string,\n): string => {\n\tif (!imagePath) return \"\";\n\n\t// Handle case where imagePath doesn't have an extension\n\tconst hasExtension = imagePath.includes(\".\");\n\n\tif (hasExtension) {\n\t\tconst imagePathArr = imagePath.split(\".\");\n\t\tconst imageFormat = format || imagePathArr[1];\n\t\treturn `${baseUrl}${fileSize}${imagePathArr[0]}.${imageFormat}`;\n\t}\n\t// If no extension in path, use provided format or default to jpg\n\tconst imageFormat = format || \"jpg\";\n\treturn `${baseUrl}${fileSize}${imagePath}.${imageFormat}`;\n};\n\n/**\n * Common image sizes available in TMDB\n */\nexport const ImageSizes = {\n\tORIGINAL: \"original\",\n\tW500: \"w500\",\n\tW300: \"w300\",\n\tW185: \"w185\",\n\tW92: \"w92\",\n\tH632: \"h632\",\n};\n\n/**\n * Image formats supported by TMDB\n */\nexport const ImageFormats = {\n\tJPG: \"jpg\",\n\tPNG: \"png\",\n\tSVG: \"svg\",\n};\n","import { API } from \"../../utils\";\nimport type { TokenType } from \"../types\";\n\nexport class BaseEndpoint {\n\tprotected api: API;\n\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 */\nexport class AccountEndpoint extends BaseEndpoint {\n\t/**\n\t * Constructs a new AccountEndpoint instance.\n\t * @param {string} 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 * @returns {Promise<AccountDetails>} A Promise that resolves with the account details.\n\t */\n\tasync details(): Promise<AccountDetails> {\n\t\treturn await this.api.get(\"/account\");\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 */\nexport class CertificationEndpoint extends BaseEndpoint {\n\t/**\n\t * Constructs a new CertificationEndpoint instance.\n\t * @param {string} 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 * @returns {Promise<Certifications>} A Promise that resolves with the certifications for movies.\n\t */\n\tasync movies(): Promise<Certifications> {\n\t\treturn await this.api.get<Certifications>(\"/certification/movie/list\");\n\t}\n\n\t/**\n\t * Retrieves certifications for TV shows asynchronously.\n\t * @returns {Promise<Certifications>} A Promise that resolves with the certifications for TV shows.\n\t */\n\tasync tv(): Promise<Certifications> {\n\t\treturn await 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 */\nexport class ChangeEndpoint extends BaseEndpoint {\n\t/**\n\t * Constructs a new ChangeEndpoint instance.\n\t * @param {string} 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 * @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\tasync movies(options?: ChangeOption): Promise<MediaChanges> {\n\t\treturn await this.api.get<MediaChanges>(\n\t\t\t\"/movie/changes\",\n\t\t\toptions as Record<string, unknown>,\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves changes in TV shows asynchronously.\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\tasync tv(options?: ChangeOption): Promise<MediaChanges> {\n\t\treturn await this.api.get<MediaChanges>(\n\t\t\t\"/tv/changes\",\n\t\t\toptions as Record<string, unknown>,\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves changes related to persons asynchronously.\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\tasync person(options?: ChangeOption): Promise<MediaChanges> {\n\t\treturn await this.api.get<MediaChanges>(\n\t\t\t\"/person/change\",\n\t\t\toptions as Record<string, unknown>,\n\t\t);\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\";\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 * @param {string} 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 details of a specific collection asynchronously.\n\t * @param {number} id - The ID of the collection.\n\t * @param {LanguageOption} [options] - Optional parameters for specifying the language.\n\t * @returns {Promise<DetailedCollection>} A Promise that resolves with the detailed information of the collection.\n\t */\n\tasync details(\n\t\tid: number,\n\t\toptions?: LanguageOption,\n\t): Promise<DetailedCollection> {\n\t\treturn await this.api.get<DetailedCollection>(\n\t\t\t`${BASE_COLLECTION}/${id}`,\n\n\t\t\toptions as Record<string, unknown>,\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves images associated with a specific collection asynchronously.\n\t * @param {number} id - The ID of the collection.\n\t * @param {CollectionImageOptions} [options] - Optional parameters for specifying image options.\n\t * @returns {Promise<ImageCollection>} A Promise that resolves with the collection images.\n\t */\n\tasync images(\n\t\tid: number,\n\t\toptions?: CollectionImageOptions,\n\t): Promise<ImageCollection> {\n\t\tconst computedOptions = {\n\t\t\tinclude_image_language: options?.include_image_language?.join(\",\"),\n\t\t\tlanguage: options?.language,\n\t\t};\n\t\treturn await this.api.get<ImageCollection>(\n\t\t\t`${BASE_COLLECTION}/${id}/images`,\n\t\t\tcomputedOptions,\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves translations for a specific collection asynchronously.\n\t * @param {number} id - The ID of the collection.\n\t * @param {LanguageOption} [options] - Optional parameters for specifying the language.\n\t * @returns {Promise<Translations>} A Promise that resolves with the translations of the collection.\n\t */\n\tasync translations(\n\t\tid: number,\n\t\toptions?: LanguageOption,\n\t): Promise<Translations> {\n\t\treturn await this.api.get<Translations>(\n\t\t\t`${BASE_COLLECTION}/${id}/translations`,\n\n\t\t\toptions as Record<string, unknown>,\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 * @param {string} 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 details of a specific company asynchronously.\n\t * @param {number} id - The ID of the company.\n\t * @returns {Promise<CompanyDetails>} A Promise that resolves with the detailed information of the company.\n\t */\n\tasync details(id: number): Promise<CompanyDetails> {\n\t\treturn await this.api.get<CompanyDetails>(`/company/${id}`);\n\t}\n\n\t/**\n\t * Retrieves alternative names of a specific company asynchronously.\n\t * @param {number} id - The ID of the company.\n\t * @returns {Promise<AlternativeNames>} A Promise that resolves with the alternative names of the company.\n\t */\n\tasync alternativeNames(id: number): Promise<AlternativeNames> {\n\t\treturn await this.api.get<AlternativeNames>(\n\t\t\t`/company/${id}/alternative_names`,\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves images associated with a specific company asynchronously.\n\t * @param {number} id - The ID of the company.\n\t * @returns {Promise<CompanyImages>} A Promise that resolves with the images of the company.\n\t */\n\tasync images(id: number): Promise<CompanyImages> {\n\t\treturn await 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 * @param {string} 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 the current system configuration asynchronously.\n\t * @returns {Promise<Configuration>} A Promise that resolves with the current system configuration.\n\t */\n\tasync getCurrent(): Promise<Configuration> {\n\t\treturn await 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 * @param {string} 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 credit details by ID asynchronously.\n\t * @param {string} id - The ID of the credit.\n\t * @returns {Promise<CreditResponse>} A Promise that resolves with the credit details.\n\t */\n\tasync getById(id: string): Promise<CreditResponse> {\n\t\treturn await 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\";\n\nconst BASE_DISCOVER = \"/discover\";\n\n/**\n * Represents an endpoint for discovering movies and TV shows based on various criteria.\n */\nexport class DiscoverEndpoint extends BaseEndpoint {\n\t/**\n\t * Constructs a new DiscoverEndpoint instance.\n\t * @param {string} 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 asynchronously.\n\t * @param {MovieQueryOptions} [options] - Optional parameters for refining the movie discovery.\n\t * @returns {Promise<MovieDiscoverResult>} A Promise that resolves with the movie discovery results.\n\t */\n\tasync movie(options?: MovieQueryOptions): Promise<MovieDiscoverResult> {\n\t\treturn await this.api.get<MovieDiscoverResult>(\n\t\t\t`${BASE_DISCOVER}/movie`,\n\t\t\toptions as Record<string, unknown>,\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves a list of TV shows based on the provided query options asynchronously.\n\t * @param {TvShowQueryOptions} [options] - Optional parameters for refining the TV show discovery.\n\t * @returns {Promise<TvShowDiscoverResult>} A Promise that resolves with the TV show discovery results.\n\t */\n\tasync tvShow(options?: TvShowQueryOptions): Promise<TvShowDiscoverResult> {\n\t\treturn await this.api.get<TvShowDiscoverResult>(\n\t\t\t`${BASE_DISCOVER}/tv`,\n\t\t\toptions as Record<string, unknown>,\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 * @param {string} 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 media by external ID asynchronously.\n\t * @param {string} externalId - The external ID of the media.\n\t * @param {ExternalIdOptions} options - Options for finding media by external ID.\n\t * @returns {Promise<FindResult>} A Promise that resolves with the result of the find operation.\n\t */\n\tasync byId(\n\t\texternalId: string,\n\t\toptions: ExternalIdOptions,\n\t): Promise<FindResult> {\n\t\treturn await this.api.get<FindResult>(\n\t\t\t`/find/${externalId}`,\n\t\t\toptions as unknown as Record<string, unknown>,\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 shows.\n */\nexport class GenreEndpoint extends BaseEndpoint {\n\t/**\n\t * Constructs a new GenreEndpoint instance.\n\t * @param {string} 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 genre information for movies asynchronously.\n\t * @param {LanguageOption} [options] - Optional parameters for specifying the language.\n\t * @returns {Promise<Genres>} A Promise that resolves with the genre information for movies.\n\t */\n\tasync movies(options?: LanguageOption): Promise<Genres> {\n\t\treturn await this.api.get<Genres>(\n\t\t\t\"/genre/movie/list\",\n\t\t\toptions as Record<string, unknown>,\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves genre information for TV shows asynchronously.\n\t * @param {LanguageOption} [options] - Optional parameters for specifying the language.\n\t * @returns {Promise<Genres>} A Promise that resolves with the genre information for TV shows.\n\t */\n\tasync tv(options?: LanguageOption): Promise<Genres> {\n\t\treturn await this.api.get<Genres>(\n\t\t\t\"/genre/tv/list\",\n\t\t\toptions as Record<string, unknown>,\n\t\t);\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 * @param {string} 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 details of a specific keyword asynchronously.\n\t * @param {number} keywordId - The ID of the keyword.\n\t * @returns {Promise<Keyword>} A Promise that resolves with the details of the keyword.\n\t */\n\tasync details(keywordId: number): Promise<Keyword> {\n\t\treturn await this.api.get<Keyword>(`${BASE_KEYWORD}/${keywordId}`);\n\t}\n\n\t/**\n\t * Retrieves movies belonging to a specific keyword asynchronously.\n\t * @param {number} keywordId - The ID of the keyword.\n\t * @param {KeywordsOptions} [options] - Optional parameters for refining the search.\n\t * @returns {Promise<BelongingMovies>} A Promise that resolves with the movies belonging to the keyword.\n\t */\n\tasync belongingMovies(\n\t\tkeywordId: number,\n\t\toptions?: KeywordsOptions,\n\t): Promise<BelongingMovies> {\n\t\treturn await this.api.get<BelongingMovies>(\n\t\t\t`${BASE_KEYWORD}/${keywordId}/movies`,\n\n\t\t\toptions as Record<string, unknown>,\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\";\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 * @param {string} 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 details of a specific movie asynchronously.\n\t * @param {number} id - The ID of the movie.\n\t * @param {AppendToResponseMovieKey[]} [appendToResponse] - Optional keys to append to the response.\n\t * @param {string} [language] - Optional parameter for specifying the language.\n\t * @returns {Promise<AppendToResponse<MovieDetails, AppendToResponseMovieKey[], 'movie'>>} A Promise that resolves with the details of the movie.\n\t */\n\tasync details<T extends AppendToResponseMovieKey[] | undefined>(\n\t\tid: number,\n\t\tappendToResponse?: T,\n\t\tlanguage?: string,\n\t) {\n\t\tconst options = {\n\t\t\tappend_to_response: appendToResponse\n\t\t\t\t? appendToResponse.join(\",\")\n\t\t\t\t: undefined,\n\t\t\tlanguage: language,\n\t\t};\n\n\t\treturn await this.api.get<AppendToResponse<MovieDetails, T, \"movie\">>(\n\t\t\t`${BASE_MOVIE}/${id}`,\n\t\t\toptions,\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves alternative titles of a specific movie asynchronously.\n\t * @param {number} id - The ID of the movie.\n\t * @returns {Promise<AlternativeTitles>} A Promise that resolves with the alternative titles of the movie.\n\t */\n\tasync alternativeTitles(id: number): Promise<AlternativeTitles> {\n\t\treturn await this.api.get<AlternativeTitles>(\n\t\t\t`${BASE_MOVIE}/${id}/alternative_titles`,\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves changes made to a specific movie asynchronously.\n\t * @param {number} id - The ID of the movie.\n\t * @param {ChangeOption} [options] - Optional parameters for filtering changes.\n\t * @returns {Promise<Changes<MovieChangeValue>>} A Promise that resolves with the changes made to the movie.\n\t */\n\tasync changes(\n\t\tid: number,\n\t\toptions?: ChangeOption,\n\t): Promise<Changes<MovieChangeValue>> {\n\t\treturn await this.api.get<Changes<MovieChangeValue>>(\n\t\t\t`${BASE_MOVIE}/${id}/changes`,\n\n\t\t\toptions as Record<string, unknown>,\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves credits of a specific movie asynchronously.\n\t * @param {number} id - The ID of the movie.\n\t * @param {LanguageOption} [options] - Optional parameters for specifying the language.\n\t * @returns {Promise<Credits>} A Promise that resolves with the credits of the movie.\n\t */\n\tasync credits(id: number, options?: LanguageOption): Promise<Credits> {\n\t\treturn await this.api.get<Credits>(\n\t\t\t`${BASE_MOVIE}/${id}/credits`,\n\t\t\toptions as Record<string, unknown>,\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves external IDs of a specific movie asynchronously.\n\t * @param {number} id - The ID of the movie.\n\t * @returns {Promise<ExternalIds>} A Promise that resolves with the external IDs of the movie.\n\t */\n\tasync externalIds(id: number): Promise<ExternalIds> {\n\t\treturn await this.api.get<ExternalIds>(`${BASE_MOVIE}/${id}/external_ids`);\n\t}\n\n\t/**\n\t * Retrieves images of a specific movie asynchronously.\n\t * @param {number} id - The ID of the movie.\n\t * @param {MoviesImageSearchOptions} [options] - Optional parameters for specifying image search options.\n\t * @returns {Promise<Images>} A Promise that resolves with the images of the movie.\n\t */\n\tasync images(\n\t\tid: number,\n\t\toptions?: MoviesImageSearchOptions,\n\t): Promise<Images> {\n\t\tconst computedOptions = {\n\t\t\tinclude_image_language: options?.include_image_language?.join(\",\"),\n\t\t\tlanguage: options?.language,\n\t\t};\n\t\treturn await this.api.get<Images>(\n\t\t\t`${BASE_MOVIE}/${id}/images`,\n\t\t\tcomputedOptions,\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves keywords of a specific movie asynchronously.\n\t * @param {number} id - The ID of the movie.\n\t * @returns {Promise<Keywords>} A Promise that resolves with the keywords of the movie.\n\t */\n\tasync keywords(id: number): Promise<Keywords> {\n\t\treturn await this.api.get<Keywords>(`${BASE_MOVIE}/${id}/keywords`);\n\t}\n\n\t/**\n\t * Retrieves lists containing a specific movie asynchronously.\n\t * @param {number} id - The ID of the movie.\n\t * @param {LanguageOption & PageOption} [options] - Optional parameters for specifying language and pagination options.\n\t * @returns {Promise<MovieLists>} A Promise that resolves with the lists containing the movie.\n\t */\n\tasync lists(\n\t\tid: number,\n\t\toptions?: LanguageOption & PageOption,\n\t): Promise<MovieLists> {\n\t\treturn await this.api.get<MovieLists>(\n\t\t\t`${BASE_MOVIE}/${id}/lists`,\n\t\t\toptions as Record<string, unknown>,\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves recommendations for a specific movie asynchronously.\n\t * @param {number} id - The ID of the movie.\n\t * @param {LanguageOption & PageOption} [options] - Optional parameters for specifying language and pagination options.\n\t * @returns {Promise<Recommendations>} A Promise that resolves with the recommendations for the movie.\n\t */\n\tasync recommendations(\n\t\tid: number,\n\t\toptions?: LanguageOption & PageOption,\n\t): Promise<Recommendations> {\n\t\treturn await this.api.get<Recommendations>(\n\t\t\t`${BASE_MOVIE}/${id}/recommendations`,\n\n\t\t\toptions as Record<string, unknown>,\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves release dates of a specific movie asynchronously.\n\t * @param {number} id - The ID of the movie.\n\t * @returns {Promise<ReleaseDates>} A Promise that resolves with the release dates of the movie.\n\t */\n\tasync releaseDates(id: number): Promise<ReleaseDates> {\n\t\treturn await this.api.get<ReleaseDates>(\n\t\t\t`${BASE_MOVIE}/${id}/release_dates`,\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves reviews for a specific movie asynchronously.\n\t * @param {number} id - The ID of the movie.\n\t * @param {LanguageOption & PageOption} [options] - Optional parameters for specifying language and pagination options.\n\t * @returns {Promise<Reviews>} A Promise that resolves with the reviews for the movie.\n\t */\n\tasync reviews(\n\t\tid: number,\n\t\toptions?: LanguageOption & PageOption,\n\t): Promise<Reviews> {\n\t\treturn await this.api.get<Reviews>(\n\t\t\t`${BASE_MOVIE}/${id}/reviews`,\n\t\t\toptions as Record<string, unknown>,\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves similar movies for a specific movie asynchronously.\n\t * @param {number} id - The ID of the movie.\n\t * @param {LanguageOption & PageOption} [options] - Optional parameters for specifying language and pagination options.\n\t * @returns {Promise<SimilarMovies>} A Promise that resolves with the similar movies for the movie.\n\t */\n\tasync similar(\n\t\tid: number,\n\t\toptions?: LanguageOption & PageOption,\n\t): Promise<SimilarMovies> {\n\t\treturn await this.api.get<SimilarMovies>(\n\t\t\t`${BASE_MOVIE}/${id}/similar`,\n\n\t\t\toptions as Record<string, unknown>,\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves translations of a specific movie asynchronously.\n\t * @param {number} id - The ID of the movie.\n\t * @returns {Promise<Translations>} A Promise that resolves with the translations of the movie.\n\t */\n\tasync translations(id: number): Promise<Translations> {\n\t\treturn await this.api.get<Translations>(`${BASE_MOVIE}/${id}/translations`);\n\t}\n\n\t/**\n\t * Retrieves videos of a specific movie asynchronously.\n\t * @param {number} id - The ID of the movie.\n\t * @param {LanguageOption} [options] - Optional parameters for specifying the language.\n\t * @returns {Promise<Videos>} A Promise that resolves with the videos of the movie.\n\t */\n\tasync videos(id: number, options?: LanguageOption): Promise<Videos> {\n\t\treturn await this.api.get<Videos>(\n\t\t\t`${BASE_MOVIE}/${id}/videos`,\n\t\t\toptions as Record<string, unknown>,\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves watch providers of a specific movie asynchronously.\n\t * @param {number} id - The ID of the movie.\n\t * @returns {Promise<WatchProviders>} A Promise that resolves with the watch providers of the movie.\n\t */\n\tasync watchProviders(id: number): Promise<WatchProviders> {\n\t\treturn await this.api.get<WatchProviders>(\n\t\t\t`${BASE_MOVIE}/${id}/watch/providers`,\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves details of the latest movie asynchronously.\n\t * @returns {Promise<LatestMovie>} A Promise that resolves with the details of the latest movie.\n\t */\n\tasync latest(): Promise<LatestMovie> {\n\t\treturn await this.api.get<LatestMovie>(`${BASE_MOVIE}/latest`);\n\t}\n\n\t/**\n\t * Retrieves movies playing now asynchronously.\n\t * @param {PageOption & LanguageOption & RegionOption} [options] - Optional parameters for specifying language, region, and pagination options.\n\t * @returns {Promise<MoviesPlayingNow>} A Promise that resolves with the movies playing now.\n\t */\n\tasync nowPlaying(\n\t\toptions?: PageOption & LanguageOption & RegionOption,\n\t): Promise<MoviesPlayingNow> {\n\t\treturn await this.api.get<MoviesPlayingNow>(\n\t\t\t`${BASE_MOVIE}/now_playing`,\n\n\t\t\toptions as Record<string, unknown>,\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves popular movies asynchronously.\n\t * @param {LanguageOption & PageOption} [options] - Optional parameters for specifying language and pagination options.\n\t * @returns {Promise<PopularMovies>} A Promise that resolves with the popular movies.\n\t */\n\tasync popular(options?: LanguageOption & PageOption): Promise<PopularMovies> {\n\t\treturn await this.api.get<PopularMovies>(\n\t\t\t`${BASE_MOVIE}/popular`,\n\t\t\toptions as Record<string, unknown>,\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves top rated movies asynchronously.\n\t * @param {PageOption & LanguageOption & RegionOption} [options] - Optional parameters for specifying language, region, and pagination options.\n\t * @returns {Promise<TopRatedMovies>} A Promise that resolves with the top rated movies.\n\t */\n\tasync topRated(\n\t\toptions?: PageOption & LanguageOption & RegionOption,\n\t): Promise<TopRatedMovies> {\n\t\treturn await this.api.get<TopRatedMovies>(\n\t\t\t`${BASE_MOVIE}/top_rated`,\n\n\t\t\toptions as Record<string, unknown>,\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves upcoming movies asynchronously.\n\t * @param {PageOption & LanguageOption & RegionOption} [options] - Optional parameters for specifying language, region, and pagination options.\n\t * @returns {Promise<UpcomingMovies>} A Promise that resolves with the upcoming movies.\n\t */\n\tasync upcoming(\n\t\toptions?: PageOption & LanguageOption & RegionOption,\n\t): Promise<UpcomingMovies> {\n\t\treturn await this.api.get<UpcomingMovies>(\n\t\t\t`${BASE_MOVIE}/upcoming`,\n\n\t\t\toptions as Record<string, unknown>,\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 * @param {string} 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 details of a specific network asynchronously.\n\t * @param {number} id - The ID of the network.\n\t * @returns {Promise<NetworkDetails>} A Promise that resolves with the details of the network.\n\t */\n\tasync details(id: number): Promise<NetworkDetails> {\n\t\treturn await this.api.get<NetworkDetails>(`/network/${id}`);\n\t}\n\n\t/**\n\t * Retrieves alternative names of a specific network asynchronously.\n\t * @param {number} id - The ID of the network.\n\t * @returns {Promise<AlternativeNames>} A Promise that resolves with the alternative names of the network.\n\t */\n\tasync alternativeNames(id: number): Promise<AlternativeNames> {\n\t\treturn await this.api.get<AlternativeNames>(\n\t\t\t`/network/${id}/alternative_names`,\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves images of a specific network asynchronously.\n\t * @param {number} id - The ID of the network.\n\t * @returns {Promise<NetworkImages>} A Promise that resolves with the images of the network.\n\t */\n\tasync images(id: number): Promise<NetworkImages> {\n\t\treturn await this.api.get<NetworkImages>(`/network/${id}/images`);\n\t}\n}\n","import {\n\ttype AppendToResponse,\n\ttype AppendToResponsePersonKey,\n\tBaseEndpoint,\n\ttype ChangeOption,\n\ttype Changes,\n\ttype ExternalIds,\n\ttype LanguageOption,\n\ttype PageOption,\n\ttype PeopleImages,\n\ttype PersonChangeValue,\n\ttype PersonCombinedCredits,\n\ttype PersonDetails,\n\ttype PersonMovieCredit,\n\ttype PersonTranslations,\n\ttype PersonTvShowCredit,\n\ttype PopularPersons,\n\ttype TaggedImages,\n\ttype TokenType,\n} from \"../@types\";\n\nconst BASE_PERSON = \"/person\";\n\n/**\n * Represents an endpoint for accessing information about people.\n */\nexport class PeopleEndpoint extends BaseEndpoint {\n\t/**\n\t * Constructs a new PeopleEndpoint instance.\n\t * @param {string} 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 details of a specific person asynchronously.\n\t * @param {number} id - The ID of the person.\n\t * @param {AppendToResponsePersonKey[]} [appendToResponse] - Optional keys to append to the response.\n\t * @param {string} [language] - Optional parameter for specifying the language.\n\t * @returns {Promise<AppendToResponse<PersonDetails, AppendToResponsePersonKey[], 'person'>>} A Promise that resolves with the details of the person.\n\t */\n\tasync details<T extends AppendToResponsePersonKey[] | undefined>(\n\t\tid: number,\n\t\tappendToResponse?: T,\n\t\tlanguage?: string,\n\t) {\n\t\tconst options = {\n\t\t\tappend_to_response: appendToResponse\n\t\t\t\t? appendToResponse.join(\",\")\n\t\t\t\t: undefined,\n\t\t\tlanguage: language,\n\t\t};\n\t\treturn await this.api.get<AppendToResponse<PersonDetails, T, \"person\">>(\n\t\t\t`${BASE_PERSON}/${id}`,\n\t\t\toptions,\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves changes made to a specific person asynchronously.\n\t * @param {number} id - The ID of the person.\n\t * @param {ChangeOption} [options] - Optional parameters for filtering changes.\n\t * @returns {Promise<Changes<PersonChangeValue>>} A Promise that resolves with the changes made to the person.\n\t */\n\tasync changes(\n\t\tid: number,\n\t\toptions?: ChangeOption,\n\t): Promise<Changes<PersonChangeValue>> {\n\t\treturn await this.api.get<Changes<PersonChangeValue>>(\n\t\t\t`${BASE_PERSON}/${id}/changes`,\n\n\t\t\toptions as Record<string, unknown>,\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves movie credits of a specific person asynchronously.\n\t * @param {number} id - The ID of the person.\n\t * @param {LanguageOption} [options] - Optional parameters for specifying the language.\n\t * @returns {Promise<PersonMovieCredit>} A Promise that resolves with the movie credits of the person.\n\t */\n\tasync movieCredits(\n\t\tid: number,\n\t\toptions?: LanguageOption,\n\t): Promise<PersonMovieCredit> {\n\t\treturn await this.api.get<PersonMovieCredit>(\n\t\t\t`${BASE_PERSON}/${id}/movie_credits`,\n\t\t\toptions as Record<string, unknown>,\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves TV show credits of a specific person asynchronously.\n\t * @param {number} id - The ID of the person.\n\t * @param {LanguageOption} [options] - Optional parameters for specifying the language.\n\t * @returns {Promise<PersonTvShowCredit>} A Promise that resolves with the TV show credits of the person.\n\t */\n\tasync tvShowCredits(\n\t\tid: number,\n\t\toptions?: LanguageOption,\n\t): Promise<PersonTvShowCredit> {\n\t\treturn await this.api.get<PersonTvShowCredit>(\n\t\t\t`${BASE_PERSON}/${id}/tv_credits`,\n\t\t\toptions as Record<string, unknown>,\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves combined credits of a specific person asynchronously.\n\t * @param {number} id - The ID of the person.\n\t * @param {LanguageOption} [options] - Optional parameters for specifying the language.\n\t * @returns {Promise<PersonCombinedCredits>} A Promise that resolves with the combined credits of the person.\n\t */\n\tasync combinedCredits(\n\t\tid: number,\n\t\toptions?: LanguageOption,\n\t): Promise<PersonCombinedCredits> {\n\t\treturn await this.api.get<PersonCombinedCredits>(\n\t\t\t`${BASE_PERSON}/${id}/combined_credits`,\n\t\t\toptions as Record<string, unknown>,\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves external IDs of a specific person asynchronously.\n\t * @param {number} id - The ID of the person.\n\t * @returns {Promise<ExternalIds>} A Promise that resolves with the external IDs of the person.\n\t */\n\tasync externalId(id: number): Promise<ExternalIds> {\n\t\treturn await this.api.get<ExternalIds>(`${BASE_PERSON}/${id}/external_ids`);\n\t}\n\n\t/**\n\t * Retrieves images of a specific person asynchronously.\n\t * @param {number} id - The ID of the person.\n\t * @returns {Promise<PeopleImages>} A Promise that resolves with the images of the person.\n\t */\n\tasync images(id: number): Promise<PeopleImages> {\n\t\treturn await this.api.get<PeopleImages>(`${BASE_PERSON}/${id}/images`);\n\t}\n\n\t/**\n\t * Retrieves tagged images of a specific person asynchronously.\n\t * @param {number} id - The ID of the person.\n\t * @param {PageOption} [options] - Optional parameters for specifying pagination options.\n\t * @returns {Promise<TaggedImages>} A Promise that resolves with the tagged images of the person.\n\t */\n\tasync taggedImages(id: number, options?: PageOption): Promise<TaggedImages> {\n\t\treturn await this.api.get<TaggedImages>(\n\t\t\t`${BASE_PERSON}/${id}/tagged_images`,\n\t\t\toptions as Record<string, unknown>,\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves translations of a specific person asynchronously.\n\t * @param {number} id - The ID of the person.\n\t * @returns {Promise<PersonTranslations>} A Promise that resolves with the translations of the person.\n\t */\n\tasync translation(id: number): Promise<PersonTranslations> {\n\t\treturn await this.api.get<PersonTranslations>(\n\t\t\t`${BASE_PERSON}/${id}/translations`,\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves details of the latest person asynchronously.\n\t * @returns {Promise<PersonDetails>} A Promise that resolves with the details of the latest person.\n\t */\n\tasync latest(): Promise<PersonDetails> {\n\t\treturn await this.api.get<PersonDetails>(`${BASE_PERSON}/latest`);\n\t}\n\n\t/**\n\t * Retrieves popular persons asynchronously.\n\t * @param {LanguageOption & PageOption} [options] - Optional parameters for specifying language and pagination options.\n\t * @returns {Promise<PopularPersons>} A Promise that resolves with the popular persons.\n\t */\n\tasync popular(\n\t\toptions?: LanguageOption & PageOption,\n\t): Promise<PopularPersons> {\n\t\treturn await this.api.get<PopularPersons>(\n\t\t\t`${BASE_PERSON}/popular`,\n\t\t\toptions as Record<string, unknown>,\n\t\t);\n\t}\n}\n","import { BaseEndpoint, type ReviewDetails, type TokenType } from \"../@types\";\n\n/**\n * Represents an endpoint for accessing review details.\n */\nexport class ReviewEndpoint extends BaseEndpoint {\n\t/**\n\t * Constructs a new ReviewEndpoint instance.\n\t * @param {string} 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 details of a specific review asynchronously.\n\t * @param {string} id - The ID of the review.\n\t * @returns {Promise<ReviewDetails>} A Promise that resolves with the details of the review.\n\t */\n\tasync details(id: string): Promise<ReviewDetails> {\n\t\treturn await this.api.get<ReviewDetails>(`/review/${id}`);\n\t}\n}\n","import {\n\tBaseEndpoint,\n\ttype Collection,\n\ttype Company,\n\ttype Movie,\n\ttype MovieSearchOptions,\n\ttype MultiSearchOptions,\n\ttype MultiSearchResult,\n\ttype PeopleSearchOptions,\n\ttype Person,\n\ttype Search,\n\ttype SearchOptions,\n\ttype TokenType,\n\ttype TV,\n\ttype TvSearchOptions,\n} from \"../@types\";\n\nconst BASE_SEARCH = \"/search\";\n\n/**\n * Represents an endpoint for performing various search operations.\n */\nexport class SearchEndpoint extends BaseEndpoint {\n\t/**\n\t * Constructs a new SearchEndpoint instance.\n\t * @param {string} 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 * Searches for companies asynchronously.\n\t * @param {SearchOptions} options - The search options.\n\t * @returns {Promise<Search<Company>>} A Promise that resolves with the search results for companies.\n\t */\n\tasync companies(options: SearchOptions): Promise<Search<Company>> {\n\t\treturn await this.api.get<Search<Company>>(\n\t\t\t`${BASE_SEARCH}