@lorenzopant/tmdb 1.22.1 → 1.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +204 -142
- package/dist/index.mjs +1 -1
- package/package.json +5 -3
package/dist/index.d.mts
CHANGED
|
@@ -29,7 +29,8 @@ type ChangeItem = {
|
|
|
29
29
|
*/
|
|
30
30
|
type ChangeResultItem = {
|
|
31
31
|
/** Id of the movie, tv show or person */id: number; /** Whether the movie, tv show or person is marked as adult content */
|
|
32
|
-
adult: boolean;
|
|
32
|
+
adult: boolean; /** Whether the movie or tv show is flagged as softcore content */
|
|
33
|
+
softcore: boolean;
|
|
33
34
|
};
|
|
34
35
|
//#endregion
|
|
35
36
|
//#region src/types/config/languages.d.ts
|
|
@@ -150,7 +151,7 @@ type Credit = {
|
|
|
150
151
|
* Represents a cast member in a movie or TV show.
|
|
151
152
|
*/
|
|
152
153
|
type Cast = Credit & {
|
|
153
|
-
cast_id
|
|
154
|
+
cast_id?: number;
|
|
154
155
|
character: string;
|
|
155
156
|
order: number;
|
|
156
157
|
};
|
|
@@ -198,7 +199,7 @@ type AlternativeTitle = {
|
|
|
198
199
|
type: string;
|
|
199
200
|
};
|
|
200
201
|
type VideoResults = {
|
|
201
|
-
/** Media identifier */id
|
|
202
|
+
/** Media identifier. Absent when this resource is fetched via `append_to_response` rather than standalone. */id?: number | string; /** Array of video items */
|
|
202
203
|
results: VideoItem[];
|
|
203
204
|
};
|
|
204
205
|
/**
|
|
@@ -231,7 +232,8 @@ type BaseKnownForItem = {
|
|
|
231
232
|
overview: string;
|
|
232
233
|
poster_path?: string;
|
|
233
234
|
genre_ids: number[];
|
|
234
|
-
popularity: number;
|
|
235
|
+
popularity: number; /** Whether the item is flagged as softcore content */
|
|
236
|
+
softcore: boolean;
|
|
235
237
|
vote_average: number;
|
|
236
238
|
vote_count: number;
|
|
237
239
|
};
|
|
@@ -292,7 +294,7 @@ type ReviewAuthorDetails = {
|
|
|
292
294
|
};
|
|
293
295
|
/** Collection of translations for a media item (object with `id` and `translations`). */
|
|
294
296
|
type TranslationResults<T> = {
|
|
295
|
-
id
|
|
297
|
+
/** Absent when this resource is fetched via `append_to_response` rather than standalone. */id?: number | string;
|
|
296
298
|
translations: Translation<T>[];
|
|
297
299
|
};
|
|
298
300
|
/**
|
|
@@ -309,15 +311,17 @@ type Translation<T = unknown> = {
|
|
|
309
311
|
* Watch provider availability by country
|
|
310
312
|
*/
|
|
311
313
|
type MediaWatchProviders = {
|
|
312
|
-
/** Movie/TV show identifier */id
|
|
314
|
+
/** Movie/TV show identifier. Absent when fetched via `append_to_response` rather than standalone. */id?: number; /** Watch providers grouped by country code */
|
|
313
315
|
results: Record<CountryISO3166_1, WatchProvider>;
|
|
314
316
|
};
|
|
315
317
|
/**
|
|
316
318
|
* Watch provider options for a specific country
|
|
317
319
|
*/
|
|
318
320
|
type WatchProvider = {
|
|
319
|
-
/** URL to watch/purchase the movie */link: string; /**
|
|
320
|
-
|
|
321
|
+
/** URL to watch/purchase the movie */link: string; /** Ad-supported (free with ads) providers */
|
|
322
|
+
ads?: WatchProviderItem[]; /** Streaming providers (subscription required) */
|
|
323
|
+
flatrate?: WatchProviderItem[]; /** Free (no ads, no subscription) providers */
|
|
324
|
+
free?: WatchProviderItem[]; /** Rental providers */
|
|
321
325
|
rent?: WatchProviderItem[]; /** Purchase providers */
|
|
322
326
|
buy?: WatchProviderItem[];
|
|
323
327
|
};
|
|
@@ -339,6 +343,8 @@ type WatchProviderItem = {
|
|
|
339
343
|
type Prettify<T> = T extends object ? (T extends infer O ? { [K in keyof O]: Prettify<O[K]> } : never) : T;
|
|
340
344
|
/** Keep literal suggestions but allow any string */
|
|
341
345
|
type LiteralUnion<T extends string> = T | (string & {});
|
|
346
|
+
/** Keep literal suggestions but allow any number */
|
|
347
|
+
type LiteralUnionNumber<T extends number> = T | (number & {});
|
|
342
348
|
/**
|
|
343
349
|
* Type guard checks for KnowForItems (tv or movie)
|
|
344
350
|
* @returns
|
|
@@ -357,7 +363,8 @@ type ImageCollectionKey = "backdrops" | "logos" | "posters" | "profiles" | "stil
|
|
|
357
363
|
type ImageItem = {
|
|
358
364
|
/** Aspect ratio of the image (width/height) */aspect_ratio: number; /** Image height in pixels */
|
|
359
365
|
height: number; /** ISO 639-1 language code if image contains text, null otherwise */
|
|
360
|
-
iso_639_1?: string; /**
|
|
366
|
+
iso_639_1?: string; /** ISO 3166-1 country code the image is tagged for, if any */
|
|
367
|
+
iso_3166_1?: string; /** Relative path to the image file (append to base URL) */
|
|
361
368
|
file_path: string; /** Average user rating for this image */
|
|
362
369
|
vote_average: number; /** Total number of votes for this image */
|
|
363
370
|
vote_count: number; /** Image width in pixels */
|
|
@@ -396,7 +403,7 @@ type OrganizationImage = Omit<ImageItem, "iso_639_1"> & {
|
|
|
396
403
|
* type PersonImagesResult = ImagesResult<"profiles">;
|
|
397
404
|
*/
|
|
398
405
|
type ImagesResult<T, K extends ImageCollectionKey> = {
|
|
399
|
-
/** The unique TMDB identifier of the entity. */id
|
|
406
|
+
/** The unique TMDB identifier of the entity. Absent when fetched via `append_to_response` rather than standalone. */id?: number;
|
|
400
407
|
} & { [P in K]: T[] };
|
|
401
408
|
/** Available file type on svg (for images) */
|
|
402
409
|
type FileType = LiteralUnion<".png" | ".svg">;
|
|
@@ -667,7 +674,7 @@ declare class TMDBLogger {
|
|
|
667
674
|
constructor(logger?: TMDBLoggerFn);
|
|
668
675
|
static from(logger?: boolean | TMDBLoggerFn): TMDBLogger | undefined;
|
|
669
676
|
log(entry: TMDBLoggerEntry): void;
|
|
670
|
-
private static defaultLogger;
|
|
677
|
+
private static readonly defaultLogger;
|
|
671
678
|
}
|
|
672
679
|
//#endregion
|
|
673
680
|
//#region src/utils/rate-limiter.d.ts
|
|
@@ -1551,7 +1558,7 @@ type RequestInterceptor = (context: RequestInterceptorContext) => RequestInterce
|
|
|
1551
1558
|
* });
|
|
1552
1559
|
* ```
|
|
1553
1560
|
*/
|
|
1554
|
-
type ResponseSuccessInterceptor = (data: unknown) => unknown |
|
|
1561
|
+
type ResponseSuccessInterceptor = (data: unknown) => unknown | Promise<unknown>;
|
|
1555
1562
|
/**
|
|
1556
1563
|
* Called after a TMDB API error has been normalised into a {@link TMDBError}.
|
|
1557
1564
|
*
|
|
@@ -1740,6 +1747,61 @@ type Certifications = {
|
|
|
1740
1747
|
/** A record mapping each country (ISO 3166-1 alpha-2 code) to its list of applicable certifications */certifications: Record<CountryISO3166_1, CertificationItem[]>;
|
|
1741
1748
|
};
|
|
1742
1749
|
//#endregion
|
|
1750
|
+
//#region src/types/enums.d.ts
|
|
1751
|
+
declare const MovieReleaseType: {
|
|
1752
|
+
readonly Premiere: 1;
|
|
1753
|
+
readonly TheatricalLimited: 2;
|
|
1754
|
+
readonly Theatrical: 3;
|
|
1755
|
+
readonly Digital: 4;
|
|
1756
|
+
readonly Physical: 5;
|
|
1757
|
+
readonly TV: 6;
|
|
1758
|
+
};
|
|
1759
|
+
type MovieReleaseType = (typeof MovieReleaseType)[keyof typeof MovieReleaseType];
|
|
1760
|
+
declare const MovieReleaseTypeLabel: Record<MovieReleaseType, string>;
|
|
1761
|
+
/**
|
|
1762
|
+
* TV status values accepted by TMDB discover filters.
|
|
1763
|
+
* @reference https://developer.themoviedb.org/reference/discover-tv
|
|
1764
|
+
*/
|
|
1765
|
+
declare const DiscoverTVStatus: {
|
|
1766
|
+
readonly ReturningSeries: 0;
|
|
1767
|
+
readonly Planned: 1;
|
|
1768
|
+
readonly InProduction: 2;
|
|
1769
|
+
readonly Ended: 3;
|
|
1770
|
+
readonly Canceled: 4;
|
|
1771
|
+
readonly Pilot: 5;
|
|
1772
|
+
};
|
|
1773
|
+
type DiscoverTVStatus = (typeof DiscoverTVStatus)[keyof typeof DiscoverTVStatus];
|
|
1774
|
+
declare const DiscoverTVStatusLabel: Record<DiscoverTVStatus, string>;
|
|
1775
|
+
/**
|
|
1776
|
+
* TV type values accepted by TMDB discover filters.
|
|
1777
|
+
* @reference https://developer.themoviedb.org/reference/discover-tv
|
|
1778
|
+
*/
|
|
1779
|
+
declare const DiscoverTVType: {
|
|
1780
|
+
readonly Documentary: 0;
|
|
1781
|
+
readonly News: 1;
|
|
1782
|
+
readonly Miniseries: 2;
|
|
1783
|
+
readonly Reality: 3;
|
|
1784
|
+
readonly Scripted: 4;
|
|
1785
|
+
readonly TalkShow: 5;
|
|
1786
|
+
readonly Video: 6;
|
|
1787
|
+
};
|
|
1788
|
+
type DiscoverTVType = (typeof DiscoverTVType)[keyof typeof DiscoverTVType];
|
|
1789
|
+
declare const DiscoverTVTypeLabel: Record<DiscoverTVType, string>;
|
|
1790
|
+
/**
|
|
1791
|
+
* Supported episode group type identifiers.
|
|
1792
|
+
*/
|
|
1793
|
+
declare const TVEpisodeGroupType: {
|
|
1794
|
+
readonly OriginalAirDate: 1;
|
|
1795
|
+
readonly Absolute: 2;
|
|
1796
|
+
readonly Dvd: 3;
|
|
1797
|
+
readonly Digital: 4;
|
|
1798
|
+
readonly StoryArc: 5;
|
|
1799
|
+
readonly Production: 6;
|
|
1800
|
+
readonly TV: 7;
|
|
1801
|
+
};
|
|
1802
|
+
type TVEpisodeGroupType = (typeof TVEpisodeGroupType)[keyof typeof TVEpisodeGroupType];
|
|
1803
|
+
declare const TVEpisodeGroupTypeLabel: Record<TVEpisodeGroupType, string>;
|
|
1804
|
+
//#endregion
|
|
1743
1805
|
//#region src/types/search.d.ts
|
|
1744
1806
|
/**
|
|
1745
1807
|
* Collection information in search results
|
|
@@ -1778,8 +1840,8 @@ type PersonResultItem = {
|
|
|
1778
1840
|
name: string; /** Original name, typically in the person's native language */
|
|
1779
1841
|
original_name: string; /** TMDB popularity score based on views, votes, and activity */
|
|
1780
1842
|
popularity: number; /** Path to person's profile image */
|
|
1781
|
-
profile_path?: string; /** List of notable movies or TV shows the person is known for */
|
|
1782
|
-
known_for
|
|
1843
|
+
profile_path?: string; /** List of notable movies or TV shows the person is known for. Not returned by every endpoint (e.g. trending) */
|
|
1844
|
+
known_for?: KnownForItem[];
|
|
1783
1845
|
};
|
|
1784
1846
|
/**
|
|
1785
1847
|
* A single TV series result as returned by TMDB APIs.
|
|
@@ -1789,7 +1851,8 @@ type PersonResultItem = {
|
|
|
1789
1851
|
* It is a partial representation of the TVDetails type.
|
|
1790
1852
|
*/
|
|
1791
1853
|
type TVSeriesResultItem = {
|
|
1792
|
-
/** Relative path to the backdrop image for the series (nullable on some responses). */
|
|
1854
|
+
/** Whether the series is marked as adult content. */adult: boolean; /** Relative path to the backdrop image for the series (nullable on some responses). */
|
|
1855
|
+
backdrop_path?: string; /** First air date of the series (YYYY-MM-DD). */
|
|
1793
1856
|
first_air_date: string; /** Array of genre ids associated with the series. */
|
|
1794
1857
|
genre_ids: number[]; /** Unique TMDB id for the series. */
|
|
1795
1858
|
id: number; /** Series name (localized). */
|
|
@@ -1798,7 +1861,8 @@ type TVSeriesResultItem = {
|
|
|
1798
1861
|
original_language: string; /** Brief synopsis/overview of the series. */
|
|
1799
1862
|
overview: string; /** Popularity score as returned by TMDB. */
|
|
1800
1863
|
popularity: number; /** Relative path to the poster image for the series (nullable on some responses). */
|
|
1801
|
-
poster_path?: string; /**
|
|
1864
|
+
poster_path?: string; /** Whether the series is flagged as softcore content. */
|
|
1865
|
+
softcore: boolean; /** Average vote score for the series. */
|
|
1802
1866
|
vote_average: number; /** Total number of votes the series has received. */
|
|
1803
1867
|
vote_count: number; /** Original (non-localized) title of the series. */
|
|
1804
1868
|
original_name: string;
|
|
@@ -1816,7 +1880,8 @@ type MovieResultItem = {
|
|
|
1816
1880
|
adult: boolean; /** Original language of the movie (ISO 639-1 code) */
|
|
1817
1881
|
original_language: string; /** Array of genre IDs (use /genre/movie/list to map to names) */
|
|
1818
1882
|
genre_ids: number[]; /** Popularity score calculated by TMDB */
|
|
1819
|
-
popularity: number; /**
|
|
1883
|
+
popularity: number; /** Whether the movie is flagged as softcore content */
|
|
1884
|
+
softcore: boolean; /** Release date in ISO 8601 format (YYYY-MM-DD) */
|
|
1820
1885
|
release_date: string; /** Whether a video is available on TMDB */
|
|
1821
1886
|
video: boolean; /** Average user rating (0-10 scale) */
|
|
1822
1887
|
vote_average: number; /** Total number of votes received */
|
|
@@ -2049,16 +2114,6 @@ type AuthDeleteSessionResponse = {
|
|
|
2049
2114
|
/** `true` if the session was successfully deleted. */success: boolean;
|
|
2050
2115
|
};
|
|
2051
2116
|
//#endregion
|
|
2052
|
-
//#region src/types/enums.d.ts
|
|
2053
|
-
declare enum ReleaseType {
|
|
2054
|
-
Premiere = 1,
|
|
2055
|
-
TheatricalLimited = 2,
|
|
2056
|
-
Theatrical = 3,
|
|
2057
|
-
Digital = 4,
|
|
2058
|
-
Physical = 5,
|
|
2059
|
-
TV = 6
|
|
2060
|
-
}
|
|
2061
|
-
//#endregion
|
|
2062
2117
|
//#region src/types/discover.d.ts
|
|
2063
2118
|
/**
|
|
2064
2119
|
* Supported sort options for the movie discover endpoint.
|
|
@@ -2070,35 +2125,11 @@ type DiscoverMovieSortBy = "original_title.asc" | "original_title.desc" | "popul
|
|
|
2070
2125
|
* @reference https://developer.themoviedb.org/reference/discover-tv
|
|
2071
2126
|
*/
|
|
2072
2127
|
type DiscoverTVSortBy = "first_air_date.asc" | "first_air_date.desc" | "name.asc" | "name.desc" | "original_name.asc" | "original_name.desc" | "popularity.asc" | "popularity.desc" | "vote_average.asc" | "vote_average.desc" | "vote_count.asc" | "vote_count.desc";
|
|
2073
|
-
/**
|
|
2074
|
-
* TV status values accepted by TMDB discover filters.
|
|
2075
|
-
* @reference https://developer.themoviedb.org/reference/discover-tv
|
|
2076
|
-
*/
|
|
2077
|
-
declare enum DiscoverTVStatus {
|
|
2078
|
-
ReturningSeries = 0,
|
|
2079
|
-
Planned = 1,
|
|
2080
|
-
InProduction = 2,
|
|
2081
|
-
Ended = 3,
|
|
2082
|
-
Canceled = 4,
|
|
2083
|
-
Pilot = 5
|
|
2084
|
-
}
|
|
2085
|
-
/**
|
|
2086
|
-
* TV type values accepted by TMDB discover filters.
|
|
2087
|
-
* @reference https://developer.themoviedb.org/reference/discover-tv
|
|
2088
|
-
*/
|
|
2089
|
-
declare enum DiscoverTVType {
|
|
2090
|
-
Documentary = 0,
|
|
2091
|
-
News = 1,
|
|
2092
|
-
Miniseries = 2,
|
|
2093
|
-
Reality = 3,
|
|
2094
|
-
Scripted = 4,
|
|
2095
|
-
TalkShow = 5,
|
|
2096
|
-
Video = 6
|
|
2097
|
-
}
|
|
2098
2128
|
/**
|
|
2099
2129
|
* A TV result item as returned by discover endpoints.
|
|
2100
2130
|
*/
|
|
2101
2131
|
type DiscoverTVResultItem = {
|
|
2132
|
+
adult: boolean;
|
|
2102
2133
|
backdrop_path?: string;
|
|
2103
2134
|
first_air_date: string;
|
|
2104
2135
|
genre_ids: number[];
|
|
@@ -2110,6 +2141,7 @@ type DiscoverTVResultItem = {
|
|
|
2110
2141
|
overview: string;
|
|
2111
2142
|
popularity: number;
|
|
2112
2143
|
poster_path?: string;
|
|
2144
|
+
softcore: boolean;
|
|
2113
2145
|
vote_average: number;
|
|
2114
2146
|
vote_count: number;
|
|
2115
2147
|
};
|
|
@@ -2119,7 +2151,7 @@ type DiscoverTVResultItem = {
|
|
|
2119
2151
|
*
|
|
2120
2152
|
* The API expects these values serialized as query strings, not arrays.
|
|
2121
2153
|
*/
|
|
2122
|
-
type DiscoverFilterExpression<T extends string | number = string | number> = T |
|
|
2154
|
+
type DiscoverFilterExpression<T extends string | number = string | number> = T | string;
|
|
2123
2155
|
type DiscoverBaseParams = {
|
|
2124
2156
|
include_adult?: boolean;
|
|
2125
2157
|
language?: Language;
|
|
@@ -2162,7 +2194,7 @@ type DiscoverMovieParams = Prettify<Omit<DiscoverBaseParams, "sort_by"> & {
|
|
|
2162
2194
|
with_cast?: DiscoverFilterExpression<number>;
|
|
2163
2195
|
with_crew?: DiscoverFilterExpression<number>;
|
|
2164
2196
|
with_people?: DiscoverFilterExpression<number>;
|
|
2165
|
-
with_release_type?: DiscoverFilterExpression<
|
|
2197
|
+
with_release_type?: DiscoverFilterExpression<MovieReleaseType>;
|
|
2166
2198
|
"with_runtime.gte"?: number;
|
|
2167
2199
|
"with_runtime.lte"?: number;
|
|
2168
2200
|
year?: number;
|
|
@@ -2195,7 +2227,8 @@ type TrendingTimeWindow = "day" | "week";
|
|
|
2195
2227
|
*/
|
|
2196
2228
|
type TrendingParams = {
|
|
2197
2229
|
/** Time window for trending data. `"day"` returns the last 24 hours, `"week"` returns the last 7 days. */time_window: TrendingTimeWindow; /** Language for localised results (ISO 639-1 + ISO 3166-1, e.g. `"en-US"`). */
|
|
2198
|
-
language?: Language;
|
|
2230
|
+
language?: Language; /** Page number. Defaults to 1. */
|
|
2231
|
+
page?: number;
|
|
2199
2232
|
};
|
|
2200
2233
|
/**
|
|
2201
2234
|
* A trending movie result.
|
|
@@ -2241,7 +2274,8 @@ type TrendingAllResult = TrendingMovieResult | TrendingTVResult | TrendingPerson
|
|
|
2241
2274
|
* Complete movie details with metadata, production info, and statistics
|
|
2242
2275
|
*/
|
|
2243
2276
|
type MovieDetails = {
|
|
2244
|
-
/** Whether the movie is marked as adult content */adult: boolean; /**
|
|
2277
|
+
/** Whether the movie is marked as adult content */adult: boolean; /** Whether the movie is flagged as softcore content */
|
|
2278
|
+
softcore: boolean; /** Path to backdrop image, null if not available */
|
|
2245
2279
|
backdrop_path?: string; /** Collection the movie belongs to (e.g., "The Lord of the Rings Collection"), null if standalone */
|
|
2246
2280
|
belongs_to_collection?: MovieCollection; /** Production budget in US dollars */
|
|
2247
2281
|
budget: number; /** Array of genres associated with the movie */
|
|
@@ -2306,7 +2340,7 @@ type MovieDetailsWithAppends<T extends readonly MovieAppendToResponseNamespace[]
|
|
|
2306
2340
|
* Alternative titles for a movie in different countries/languages
|
|
2307
2341
|
*/
|
|
2308
2342
|
type MovieAlternativeTitles = {
|
|
2309
|
-
/** Movie identifier */id
|
|
2343
|
+
/** Movie identifier. Absent when fetched via `append_to_response` rather than standalone. */id?: number; /** Array of alternative titles */
|
|
2310
2344
|
titles: AlternativeTitle[];
|
|
2311
2345
|
};
|
|
2312
2346
|
type MovieChanges = Changes;
|
|
@@ -2314,7 +2348,7 @@ type MovieChanges = Changes;
|
|
|
2314
2348
|
* Cast and crew credits for a movie
|
|
2315
2349
|
*/
|
|
2316
2350
|
type MovieCredits = {
|
|
2317
|
-
/** Movie identifier */id
|
|
2351
|
+
/** Movie identifier. Absent when fetched via `append_to_response` rather than standalone. */id?: number; /** Array of cast members (actors) */
|
|
2318
2352
|
cast: Cast[]; /** Array of crew members (directors, writers, etc.) */
|
|
2319
2353
|
crew: Crew[];
|
|
2320
2354
|
};
|
|
@@ -2322,7 +2356,7 @@ type MovieCredits = {
|
|
|
2322
2356
|
* External platform identifiers for a movie
|
|
2323
2357
|
*/
|
|
2324
2358
|
type MovieExternalIDs = {
|
|
2325
|
-
/** Movie identifier in TMDB */id
|
|
2359
|
+
/** Movie identifier in TMDB. Absent when fetched via `append_to_response` rather than standalone. */id?: number; /** IMDb identifier (e.g., "tt0133093"), null if not available */
|
|
2326
2360
|
imdb_id?: string; /** Wikidata identifier (e.g., "Q190050"), null if not available */
|
|
2327
2361
|
wikidata_id?: string; /** Facebook page identifier, null if not available */
|
|
2328
2362
|
facebook_id?: string; /** Twitter/X handle, null if not available */
|
|
@@ -2337,18 +2371,20 @@ type MovieImages = ImagesResult<ImageItem, "backdrops" | "logos" | "posters">;
|
|
|
2337
2371
|
* Keywords/tags associated with a movie
|
|
2338
2372
|
*/
|
|
2339
2373
|
type MovieKeywords = {
|
|
2340
|
-
/** Movie identifier */id
|
|
2374
|
+
/** Movie identifier. Absent when fetched via `append_to_response` rather than standalone. */id?: number; /** Array of keyword objects */
|
|
2341
2375
|
keywords: Keyword[];
|
|
2342
2376
|
};
|
|
2343
2377
|
/**
|
|
2344
2378
|
* Paginated list of recommended movies based on this movie
|
|
2345
2379
|
*/
|
|
2346
|
-
type MovieRecommendations = PaginatedResponse<MovieResultItem
|
|
2380
|
+
type MovieRecommendations = PaginatedResponse<MovieResultItem & {
|
|
2381
|
+
media_type?: "movie";
|
|
2382
|
+
}>;
|
|
2347
2383
|
/**
|
|
2348
2384
|
* Release dates and certifications across different countries
|
|
2349
2385
|
*/
|
|
2350
2386
|
type MovieReleaseDates = {
|
|
2351
|
-
/** Movie identifier */id
|
|
2387
|
+
/** Movie identifier. Absent when fetched via `append_to_response` rather than standalone. */id?: number; /** Array of release date results grouped by country */
|
|
2352
2388
|
results: MovieReleaseDateResult[];
|
|
2353
2389
|
};
|
|
2354
2390
|
/**
|
|
@@ -2365,14 +2401,16 @@ type MovieReleaseDate = {
|
|
|
2365
2401
|
/** Age certification/rating (e.g., "PG-13", "R", "12A") */certification: string; /** ISO 639-1 language code */
|
|
2366
2402
|
iso_639_1: string; /** Release date and time in ISO 8601 format */
|
|
2367
2403
|
release_date: string; /** Type of release (1=Premiere, 2=Theatrical (limited), 3=Theatrical, 4=Digital, 5=Physical, 6=TV) */
|
|
2368
|
-
type:
|
|
2404
|
+
type: LiteralUnionNumber<MovieReleaseType>; /** Additional notes about this release */
|
|
2369
2405
|
note: string; /** Content descriptors (currently unused by TMDB) */
|
|
2370
2406
|
descriptors: unknown[];
|
|
2371
2407
|
};
|
|
2372
2408
|
/**
|
|
2373
2409
|
* Paginated list of user reviews for a movie
|
|
2374
2410
|
*/
|
|
2375
|
-
type MovieReviews = PaginatedResponse<Review
|
|
2411
|
+
type MovieReviews = PaginatedResponse<Review> & {
|
|
2412
|
+
/** Movie identifier. Absent when fetched via `append_to_response` rather than standalone. */id?: number;
|
|
2413
|
+
};
|
|
2376
2414
|
/**
|
|
2377
2415
|
* Paginated list of movies similar to this movie
|
|
2378
2416
|
*/
|
|
@@ -2405,6 +2443,16 @@ type MovieWatchProviders = {
|
|
|
2405
2443
|
* Parameters for movie list endpoints (popular, top rated, now playing, upcoming).
|
|
2406
2444
|
*/
|
|
2407
2445
|
type MovieListParams = TMDBQueryParams;
|
|
2446
|
+
/**
|
|
2447
|
+
* Paginated movie list response for endpoints that also report the queried release-date window
|
|
2448
|
+
* (`now_playing` and `upcoming`).
|
|
2449
|
+
*/
|
|
2450
|
+
type MovieDateRangeList = PaginatedResponse<MovieResultItem> & {
|
|
2451
|
+
/** The release-date window this list was queried over */dates: {
|
|
2452
|
+
/** Latest release date included in this list */maximum: string; /** Earliest release date included in this list */
|
|
2453
|
+
minimum: string;
|
|
2454
|
+
};
|
|
2455
|
+
};
|
|
2408
2456
|
/**
|
|
2409
2457
|
* Almost every query within the Movie domain
|
|
2410
2458
|
* will take this required param to identify the movie.
|
|
@@ -2530,8 +2578,9 @@ type NetworkBaseParams = {
|
|
|
2530
2578
|
* Represent the detailed information about a TV show.
|
|
2531
2579
|
*/
|
|
2532
2580
|
type TVSeriesDetails = {
|
|
2533
|
-
/**
|
|
2534
|
-
|
|
2581
|
+
/** Whether the TV show is marked as adult content */adult: boolean; /** The path to the backdrop image, or null if not available */
|
|
2582
|
+
backdrop_path?: string; /** Array of creators who developed the TV show */
|
|
2583
|
+
created_by: Pick<Credit, "id" | "credit_id" | "gender" | "name" | "original_name" | "profile_path">[]; /** Array of typical episode runtimes in minutes */
|
|
2535
2584
|
episode_run_time: number[]; /** The date the first episode aired */
|
|
2536
2585
|
first_air_date: string; /** Array of genres associated with the TV show */
|
|
2537
2586
|
genres: Genre[]; /** The official homepage URL for the TV show, or null if not available */
|
|
@@ -2554,9 +2603,11 @@ type TVSeriesDetails = {
|
|
|
2554
2603
|
poster_path?: string; /** Array of companies that produced the TV show */
|
|
2555
2604
|
production_companies?: ProductionCompany[]; /** Array of countries where the TV show was produced */
|
|
2556
2605
|
production_countries?: ProductionCountry[]; /** Array of all seasons in the TV show */
|
|
2557
|
-
seasons?: TVSeasonItem[]; /**
|
|
2606
|
+
seasons?: TVSeasonItem[]; /** Whether the TV show is flagged as softcore content */
|
|
2607
|
+
softcore: boolean; /** Array of languages spoken in the TV show with full names */
|
|
2558
2608
|
spoken_languages?: SpokenLanguage[]; /** The current status of the TV show (e.g., "Returning Series", "Ended") */
|
|
2559
|
-
status?: string; /**
|
|
2609
|
+
status?: string; /** TV show tagline/slogan, null if not available */
|
|
2610
|
+
tagline?: string; /** The type of TV show (e.g., "Scripted", "Documentary", "Reality") */
|
|
2560
2611
|
type?: string; /** The average rating score for the TV show (0-10 scale) */
|
|
2561
2612
|
vote_average: number; /** The total number of votes received for the TV show */
|
|
2562
2613
|
vote_count: number;
|
|
@@ -2568,7 +2619,8 @@ type TVEpisodeItem = {
|
|
|
2568
2619
|
vote_average: number; /** The total number of votes received for the episode */
|
|
2569
2620
|
vote_count: number; /** The date the episode first aired */
|
|
2570
2621
|
air_date?: string; /** The episode number within its season */
|
|
2571
|
-
episode_number: number; /**
|
|
2622
|
+
episode_number: number; /** Episode type reported by TMDB (e.g., "standard", "finale") */
|
|
2623
|
+
episode_type?: LiteralUnion<"standard" | "finale">; /** The production code used internally during filming */
|
|
2572
2624
|
production_code?: string; /** The runtime of the episode in minutes */
|
|
2573
2625
|
runtime?: number; /** The season number this episode belongs to */
|
|
2574
2626
|
season_number: number; /** The unique identifier of the TV show this episode belongs to */
|
|
@@ -2582,25 +2634,35 @@ type TVSeasonItem = {
|
|
|
2582
2634
|
name: string; /** A brief description or summary of the season */
|
|
2583
2635
|
overview: string; /** The path to the season's poster image, or null if not available */
|
|
2584
2636
|
poster_path?: string; /** The season number within the TV show */
|
|
2585
|
-
season_number: number;
|
|
2637
|
+
season_number: number; /** The average vote score for the season */
|
|
2638
|
+
vote_average: number;
|
|
2586
2639
|
};
|
|
2587
2640
|
/**
|
|
2588
2641
|
* Available append-to-response options for TV show details.
|
|
2589
2642
|
* These allow fetching additional related data in a single API request.
|
|
2590
2643
|
*/
|
|
2591
|
-
type TVAppendToResponseNamespace = "credits" | "external_ids" | "images" | "keywords" | "recommendations" | "similar" | "translations" | "videos";
|
|
2644
|
+
type TVAppendToResponseNamespace = "aggregate_credits" | "alternative_titles" | "changes" | "content_ratings" | "credits" | "episode_groups" | "external_ids" | "images" | "keywords" | "lists" | "recommendations" | "reviews" | "screened_theatrically" | "similar" | "translations" | "videos" | "watch/providers";
|
|
2592
2645
|
/**
|
|
2593
2646
|
* Maps append-to-response keys to their corresponding response types.
|
|
2594
2647
|
*/
|
|
2595
2648
|
type TVAppendableMap = {
|
|
2649
|
+
aggregate_credits: TVAggregateCredits;
|
|
2650
|
+
alternative_titles: TVAlternativeTitles;
|
|
2651
|
+
changes: TVSeriesChanges;
|
|
2652
|
+
content_ratings: TVContentRatings;
|
|
2596
2653
|
credits: TVCredits;
|
|
2654
|
+
episode_groups: TVEpisodeGroups;
|
|
2597
2655
|
external_ids: TVExternalIDs;
|
|
2598
2656
|
images: TVImages;
|
|
2599
2657
|
keywords: TVKeywords;
|
|
2658
|
+
lists: TVSeriesLists;
|
|
2600
2659
|
recommendations: TVRecommendations;
|
|
2660
|
+
reviews: TVReviews;
|
|
2661
|
+
screened_theatrically: TVScreenedTheatrically;
|
|
2601
2662
|
similar: TVSimilar;
|
|
2602
2663
|
translations: TVTranslations;
|
|
2603
2664
|
videos: TVVideos;
|
|
2665
|
+
"watch/providers": MediaWatchProviders;
|
|
2604
2666
|
};
|
|
2605
2667
|
/**
|
|
2606
2668
|
* TV show details with additional appended data based on the requested namespaces.
|
|
@@ -2611,7 +2673,7 @@ type TVDetailsWithAppends<T extends readonly TVAppendToResponseNamespace[]> = TV
|
|
|
2611
2673
|
* Aggregate credits for a TV show, including cast and crew across all seasons and episodes.
|
|
2612
2674
|
*/
|
|
2613
2675
|
type TVAggregateCredits = {
|
|
2614
|
-
/** TMDB unique identifier for the TV show. */id
|
|
2676
|
+
/** TMDB unique identifier for the TV show. Absent when fetched via `append_to_response` rather than standalone. */id?: number; /** List of all the known cast for the TV show. */
|
|
2615
2677
|
cast: TVAggregateCreditsCastItem[]; /** List of all the known crew members for the TV show. */
|
|
2616
2678
|
crew: TVAggregateCreditsCrewItem[];
|
|
2617
2679
|
};
|
|
@@ -2651,11 +2713,12 @@ type TVCreditJob = {
|
|
|
2651
2713
|
* Alternative titles for a tv show in different countries/languages
|
|
2652
2714
|
*/
|
|
2653
2715
|
type TVAlternativeTitles = {
|
|
2654
|
-
/**
|
|
2716
|
+
/** TV show identifier. Absent when fetched via `append_to_response` rather than standalone. */id?: number; /** Array of alternative titles */
|
|
2655
2717
|
results: AlternativeTitle[];
|
|
2656
2718
|
};
|
|
2657
2719
|
type TVSeriesChanges = Changes;
|
|
2658
2720
|
type TVContentRatings = {
|
|
2721
|
+
/** TMDB unique identifier for the TV show. Absent when fetched via `append_to_response` rather than standalone. */id?: number;
|
|
2659
2722
|
results: ContentRating[];
|
|
2660
2723
|
};
|
|
2661
2724
|
/**
|
|
@@ -2664,7 +2727,7 @@ type TVContentRatings = {
|
|
|
2664
2727
|
* you should use the aggregate_credits method.
|
|
2665
2728
|
*/
|
|
2666
2729
|
type TVCredits = {
|
|
2667
|
-
/** TMDB unique identifier for the TV show. */id
|
|
2730
|
+
/** TMDB unique identifier for the TV show. Absent when fetched via `append_to_response` rather than standalone. */id?: number; /** List of all the known cast for the TV show. */
|
|
2668
2731
|
cast: Cast[]; /** List of all the known crew members for the TV show. */
|
|
2669
2732
|
crew: Crew[];
|
|
2670
2733
|
};
|
|
@@ -2672,7 +2735,7 @@ type TVCredits = {
|
|
|
2672
2735
|
* Collection of episode groups for a TV series
|
|
2673
2736
|
*/
|
|
2674
2737
|
type TVEpisodeGroups = {
|
|
2675
|
-
/** TV series identifier */id
|
|
2738
|
+
/** TV series identifier. Absent when fetched via `append_to_response` rather than standalone. */id?: number; /** Array of episode group items */
|
|
2676
2739
|
results: TVEpisodeGroupItem[];
|
|
2677
2740
|
};
|
|
2678
2741
|
/**
|
|
@@ -2683,15 +2746,15 @@ type TVEpisodeGroupItem = {
|
|
|
2683
2746
|
episode_count: number; /** Number of sub-groups within this episode group */
|
|
2684
2747
|
group_count: number; /** Unique episode group identifier */
|
|
2685
2748
|
id: string; /** Name of the episode group */
|
|
2686
|
-
name: string; /** Network that created or distributed this episode grouping */
|
|
2687
|
-
network: NetworkItem; /** Type of grouping (1=Original air date, 2=Absolute, 3=DVD, 4=Digital, 5=Story arc, 6=Production, 7=TV) */
|
|
2749
|
+
name: string; /** Network that created or distributed this episode grouping, if any */
|
|
2750
|
+
network: NetworkItem | null; /** Type of grouping (1=Original air date, 2=Absolute, 3=DVD, 4=Digital, 5=Story arc, 6=Production, 7=TV) */
|
|
2688
2751
|
type: number;
|
|
2689
2752
|
};
|
|
2690
2753
|
/**
|
|
2691
2754
|
* External platform identifiers for a TV series
|
|
2692
2755
|
*/
|
|
2693
2756
|
type TVExternalIDs = {
|
|
2694
|
-
/** TV series identifier in TMDB */id
|
|
2757
|
+
/** TV series identifier in TMDB. Absent when fetched via `append_to_response` rather than standalone. */id?: number; /** IMDb identifier (e.g., "tt0944947"), null if not available */
|
|
2695
2758
|
imdb_id?: string; /** Freebase MID identifier (deprecated), null if not available */
|
|
2696
2759
|
freebase_mid?: string; /** Freebase ID (deprecated), null if not available */
|
|
2697
2760
|
freebase_id?: string; /** TheTVDB identifier, null if not available */
|
|
@@ -2706,20 +2769,12 @@ type TVExternalIDs = {
|
|
|
2706
2769
|
* Images related to a TV show.
|
|
2707
2770
|
* Contains backdrops, logos, posters and stills.
|
|
2708
2771
|
*/
|
|
2709
|
-
type TVImages = ImagesResult<
|
|
2710
|
-
/**
|
|
2711
|
-
* Image items for TVShows have an undocumented "iso_3166_1" property
|
|
2712
|
-
* I decided to put it anyway as an optional property,
|
|
2713
|
-
* but only for tv shows images.
|
|
2714
|
-
*/
|
|
2715
|
-
type TVImageItem = ImageItem & {
|
|
2716
|
-
iso_3166_1?: string;
|
|
2717
|
-
};
|
|
2772
|
+
type TVImages = ImagesResult<ImageItem, "backdrops" | "logos" | "posters">;
|
|
2718
2773
|
/**
|
|
2719
2774
|
* List of keywords related to the TV show.
|
|
2720
2775
|
*/
|
|
2721
2776
|
type TVKeywords = {
|
|
2722
|
-
/** TMDB unique identifier for the TV show. */id
|
|
2777
|
+
/** TMDB unique identifier for the TV show. Absent when fetched via `append_to_response` rather than standalone. */id?: number; /** List of keywords related to the TV show. */
|
|
2723
2778
|
results: Keyword[];
|
|
2724
2779
|
};
|
|
2725
2780
|
/**
|
|
@@ -2728,7 +2783,7 @@ type TVKeywords = {
|
|
|
2728
2783
|
* that uniquely identifies the tv show.
|
|
2729
2784
|
*/
|
|
2730
2785
|
type TVSeriesLists = PaginatedResponse<TVSeriesListItem> & {
|
|
2731
|
-
id
|
|
2786
|
+
/** Absent when fetched via `append_to_response` rather than standalone. */id?: number;
|
|
2732
2787
|
};
|
|
2733
2788
|
/**
|
|
2734
2789
|
* Represents a single TV series list entry as returned by the TMDB API.
|
|
@@ -2738,22 +2793,26 @@ type TVSeriesListItem = {
|
|
|
2738
2793
|
favorite_count: number; /** The unique identifier for this list on TMDB. */
|
|
2739
2794
|
id: number; /** The total number of items (TV series) currently in this list. */
|
|
2740
2795
|
item_count: number; /** The primary language of the list content as an ISO 639-1 code (e.g. `"en"`). */
|
|
2741
|
-
iso_639_1:
|
|
2742
|
-
iso_3166_1:
|
|
2796
|
+
iso_639_1: LiteralUnion<LanguageISO6391>; /** The country associated with the list as an ISO 3166-1 alpha-2 code (e.g. `"US"`). */
|
|
2797
|
+
iso_3166_1: LiteralUnion<CountryISO3166_1>; /** The display name of the list. */
|
|
2743
2798
|
name: string; /** Path to the list's poster image on the TMDB CDN. Combine with a base URL to get the full image path. */
|
|
2744
2799
|
poster_path?: string;
|
|
2745
2800
|
};
|
|
2746
2801
|
/** List of TV shows that are recommended for a TV show. */
|
|
2747
|
-
type TVRecommendations = PaginatedResponse<TVSeriesResultItem
|
|
2802
|
+
type TVRecommendations = PaginatedResponse<TVSeriesResultItem & {
|
|
2803
|
+
media_type?: "tv";
|
|
2804
|
+
}>;
|
|
2748
2805
|
/**
|
|
2749
2806
|
* Paginated list of user reviews for a tv show
|
|
2750
2807
|
*/
|
|
2751
|
-
type TVReviews = PaginatedResponse<Review
|
|
2808
|
+
type TVReviews = PaginatedResponse<Review> & {
|
|
2809
|
+
/** TV show identifier. Absent when fetched via `append_to_response` rather than standalone. */id?: number;
|
|
2810
|
+
};
|
|
2752
2811
|
/**
|
|
2753
2812
|
* Represents the response for TV episodes that have been screened theatrically.
|
|
2754
2813
|
*/
|
|
2755
2814
|
type TVScreenedTheatrically = {
|
|
2756
|
-
/** The unique identifier of the TV series. */id
|
|
2815
|
+
/** The unique identifier of the TV series. Absent when fetched via `append_to_response` rather than standalone. */id?: number; /** The list of episodes that received a theatrical screening. */
|
|
2757
2816
|
results: TVScreeningItem[];
|
|
2758
2817
|
};
|
|
2759
2818
|
/**
|
|
@@ -2782,7 +2841,7 @@ type TVTranslationData = {
|
|
|
2782
2841
|
};
|
|
2783
2842
|
/** List of videos related to a TV show. */
|
|
2784
2843
|
type TVVideos = {
|
|
2785
|
-
/** TMDB unique identifier for the TV show. */id
|
|
2844
|
+
/** TMDB unique identifier for the TV show. Absent when fetched via `append_to_response` rather than standalone. */id?: number; /** List of video results. */
|
|
2786
2845
|
results: VideoItem[];
|
|
2787
2846
|
};
|
|
2788
2847
|
/**
|
|
@@ -2883,7 +2942,8 @@ type TVSeasonEpisode = TVEpisodeItem & {
|
|
|
2883
2942
|
* Detailed information about a TV season returned by the TMDB API.
|
|
2884
2943
|
*/
|
|
2885
2944
|
type TVSeason = {
|
|
2886
|
-
/** ISO 8601 date when the season first aired */air_date?: string; /**
|
|
2945
|
+
/** ISO 8601 date when the season first aired */air_date?: string; /** Legacy MongoDB identifier for the season */
|
|
2946
|
+
_id?: string; /** Array of episodes in this season */
|
|
2887
2947
|
episodes: TVSeasonEpisode[]; /** Unique TMDB identifier for the season */
|
|
2888
2948
|
id: number; /** Season name */
|
|
2889
2949
|
name: string; /** Networks that broadcast this season */
|
|
@@ -2897,7 +2957,7 @@ type TVSeason = {
|
|
|
2897
2957
|
* Available append-to-response options for TV season details.
|
|
2898
2958
|
* These allow fetching additional related data in a single API request.
|
|
2899
2959
|
*/
|
|
2900
|
-
type TVSeasonAppendToResponseNamespace = "aggregate_credits" | "credits" | "external_ids" | "images" | "translations" | "videos" | "
|
|
2960
|
+
type TVSeasonAppendToResponseNamespace = "aggregate_credits" | "credits" | "external_ids" | "images" | "translations" | "videos" | "watch/providers";
|
|
2901
2961
|
/**
|
|
2902
2962
|
* Maps append-to-response keys to their corresponding response types.
|
|
2903
2963
|
*/
|
|
@@ -2908,7 +2968,7 @@ type TVSeasonAppendableMap = {
|
|
|
2908
2968
|
images: TVSeasonImages;
|
|
2909
2969
|
translations: TVSeasonTranslations;
|
|
2910
2970
|
videos: TVSeasonVideos;
|
|
2911
|
-
|
|
2971
|
+
"watch/providers": MediaWatchProviders;
|
|
2912
2972
|
};
|
|
2913
2973
|
/**
|
|
2914
2974
|
* TV season details with additional appended data based on the requested namespaces.
|
|
@@ -2921,7 +2981,7 @@ type TVSeasonAggregateCredits = TVAggregateCredits;
|
|
|
2921
2981
|
type TVSeasonChanges = Changes;
|
|
2922
2982
|
/** Credits (cast & crew) for a TV season, mirroring the series-level credits shape. */
|
|
2923
2983
|
type TVSeasonCredits = {
|
|
2924
|
-
/** TMDB unique identifier */id
|
|
2984
|
+
/** TMDB unique identifier. Absent when fetched via `append_to_response` rather than standalone. */id?: number; /** Cast members */
|
|
2925
2985
|
cast: Cast[]; /** Crew members */
|
|
2926
2986
|
crew: Crew[];
|
|
2927
2987
|
};
|
|
@@ -2970,7 +3030,8 @@ type TVSeasonChangesParams = TVSeasonId & Prettify<WithParams<"page"> & DateRang
|
|
|
2970
3030
|
type TVEpisode = {
|
|
2971
3031
|
/** ISO 8601 formatted date when the episode first aired (e.g. `"2023-05-15"`) */air_date: string; /** Array of crew members who worked on this specific episode */
|
|
2972
3032
|
crew: Crew[]; /** Sequential number of this episode within its season (1-based) */
|
|
2973
|
-
episode_number: number; /**
|
|
3033
|
+
episode_number: number; /** Episode type reported by TMDB (e.g., "standard", "finale") */
|
|
3034
|
+
episode_type?: LiteralUnion<"standard" | "finale">; /** Array of guest stars appearing in this episode (subset of cast without `cast_id`) */
|
|
2974
3035
|
guest_stars: Omit<Cast, "cast_id">[]; /** Episode title or name */
|
|
2975
3036
|
name: string; /** Episode synopsis or description */
|
|
2976
3037
|
overview: string; /** Unique TMDB identifier for this episode */
|
|
@@ -3003,7 +3064,7 @@ type TVEpisodeAppendableMap = {
|
|
|
3003
3064
|
*/
|
|
3004
3065
|
type TVEpisodeDetailsWithAppends<T extends readonly TVEpisodeAppendToResponseNamespace[]> = TVEpisode & { [K in T[number]]: TVEpisodeAppendableMap[K] };
|
|
3005
3066
|
type TVEpisodeCredits = {
|
|
3006
|
-
id
|
|
3067
|
+
/** Absent when fetched via `append_to_response` rather than standalone. */id?: number | string;
|
|
3007
3068
|
cast: Omit<Cast, "cast_id">[];
|
|
3008
3069
|
crew: Crew[];
|
|
3009
3070
|
guest_stars: Omit<Cast, "cast_id">[];
|
|
@@ -3028,6 +3089,8 @@ type TVEpisodeBaseParams = TVSeasonBaseParams & {
|
|
|
3028
3089
|
type TVEpisodeId = {
|
|
3029
3090
|
episode_id: string | number;
|
|
3030
3091
|
};
|
|
3092
|
+
/** Parameters for the episode changes endpoint. */
|
|
3093
|
+
type TVEpisodeChangesParams = TVEpisodeId & Prettify<WithParams<"page"> & DateRange>;
|
|
3031
3094
|
/**
|
|
3032
3095
|
* Parameters for fetching TV episode details with optional additional data appended.
|
|
3033
3096
|
*/
|
|
@@ -3057,14 +3120,12 @@ type Collection = {
|
|
|
3057
3120
|
};
|
|
3058
3121
|
/**
|
|
3059
3122
|
* Represents a single media item within a collection.
|
|
3060
|
-
* Extends {@link MovieResultItem}
|
|
3061
|
-
*
|
|
3062
|
-
*
|
|
3123
|
+
* Extends {@link MovieResultItem} with a `media_type` discriminator.
|
|
3124
|
+
* Despite what the TMDB API docs show, the actual API response uses `title` and
|
|
3125
|
+
* `original_title` (not `name`/`original_name`) for items in the `parts` array.
|
|
3063
3126
|
*/
|
|
3064
|
-
type CollectionItem =
|
|
3065
|
-
/** The type of media (e.g. `"movie"` or `"tv"`), used as a discriminator */media_type: MediaType;
|
|
3066
|
-
name: string; /** Name of the media item in its original language */
|
|
3067
|
-
original_name: string;
|
|
3127
|
+
type CollectionItem = MovieResultItem & {
|
|
3128
|
+
/** The type of media (e.g. `"movie"` or `"tv"`), used as a discriminator */media_type: MediaType;
|
|
3068
3129
|
};
|
|
3069
3130
|
/**
|
|
3070
3131
|
* Represents the images associated with a TMDB collection,
|
|
@@ -3161,23 +3222,13 @@ type TVEpisodeGroupDetailsItem = {
|
|
|
3161
3222
|
};
|
|
3162
3223
|
/**
|
|
3163
3224
|
* A simplified TV episode item returned in episode group details.
|
|
3225
|
+
* Unlike a standalone episode, grouped episodes have no `crew`, but do carry
|
|
3226
|
+
* their `order` within the group and the parent show's `show_id`.
|
|
3164
3227
|
*/
|
|
3165
|
-
type TVEpisodeGroupEpisode = Omit<TVEpisode, "guest_stars" | "
|
|
3166
|
-
/**
|
|
3167
|
-
|
|
3228
|
+
type TVEpisodeGroupEpisode = Omit<TVEpisode, "guest_stars" | "crew"> & {
|
|
3229
|
+
/** Display order of the episode within the group */order: number; /** Unique identifier of the parent TV show */
|
|
3230
|
+
show_id: number;
|
|
3168
3231
|
};
|
|
3169
|
-
/**
|
|
3170
|
-
* Supported episode group type identifiers.
|
|
3171
|
-
*/
|
|
3172
|
-
declare enum TVEpisodeGroupType {
|
|
3173
|
-
OriginalAirDate = 1,
|
|
3174
|
-
Absolute = 2,
|
|
3175
|
-
Dvd = 3,
|
|
3176
|
-
Digital = 4,
|
|
3177
|
-
StoryArc = 5,
|
|
3178
|
-
Production = 6,
|
|
3179
|
-
TV = 7
|
|
3180
|
-
}
|
|
3181
3232
|
type TVEpisodeGroupParams = {
|
|
3182
3233
|
/** Episode group identifier */episode_group_id: string;
|
|
3183
3234
|
};
|
|
@@ -3200,11 +3251,13 @@ type FindByIDParams = {
|
|
|
3200
3251
|
type FindMediaResultBase = {
|
|
3201
3252
|
adult: boolean;
|
|
3202
3253
|
backdrop_path?: string;
|
|
3254
|
+
genre_ids: number[];
|
|
3203
3255
|
id: number;
|
|
3204
3256
|
original_language: string;
|
|
3205
3257
|
overview: string;
|
|
3206
3258
|
poster_path?: string;
|
|
3207
3259
|
popularity: number;
|
|
3260
|
+
softcore: boolean;
|
|
3208
3261
|
vote_average: number;
|
|
3209
3262
|
vote_count: number;
|
|
3210
3263
|
};
|
|
@@ -3345,7 +3398,9 @@ type CreditDetailsParams = CreditBaseParam & WithLanguage;
|
|
|
3345
3398
|
/**
|
|
3346
3399
|
* Person data attached to a credit details response.
|
|
3347
3400
|
*/
|
|
3348
|
-
type CreditDetailsPerson = Omit<Credit, "credit_id"
|
|
3401
|
+
type CreditDetailsPerson = Omit<Credit, "credit_id"> & {
|
|
3402
|
+
/** Media type discriminator. */media_type: "person";
|
|
3403
|
+
};
|
|
3349
3404
|
type CreditDetailsMediaBase = {
|
|
3350
3405
|
/** Indicates whether the title is marked for adult content. */adult: boolean; /** Relative path to the backdrop image, if available. */
|
|
3351
3406
|
backdrop_path?: string; /** Character name when the credit belongs to cast. */
|
|
@@ -3355,7 +3410,8 @@ type CreditDetailsMediaBase = {
|
|
|
3355
3410
|
original_language: string; /** Plot summary. */
|
|
3356
3411
|
overview: string; /** Relative path to the poster image, if available. */
|
|
3357
3412
|
poster_path?: string; /** Popularity score. */
|
|
3358
|
-
popularity: number; /**
|
|
3413
|
+
popularity: number; /** Whether the media is flagged as softcore content. */
|
|
3414
|
+
softcore: boolean; /** Average vote score. */
|
|
3359
3415
|
vote_average: number; /** Total vote count. */
|
|
3360
3416
|
vote_count: number;
|
|
3361
3417
|
};
|
|
@@ -3489,7 +3545,7 @@ type PersonChanges = Changes;
|
|
|
3489
3545
|
* External identifiers linked to a person.
|
|
3490
3546
|
*/
|
|
3491
3547
|
type PersonExternalIDs = {
|
|
3492
|
-
id
|
|
3548
|
+
/** Absent when fetched via `append_to_response` rather than standalone. */id?: number;
|
|
3493
3549
|
freebase_mid?: string;
|
|
3494
3550
|
freebase_id?: string;
|
|
3495
3551
|
imdb_id?: string;
|
|
@@ -3525,7 +3581,7 @@ type PersonMovieCrewCredit = MovieResultItem & {
|
|
|
3525
3581
|
* Movie credits for a person.
|
|
3526
3582
|
*/
|
|
3527
3583
|
type PersonMovieCredits = {
|
|
3528
|
-
id
|
|
3584
|
+
/** Absent when fetched via `append_to_response` rather than standalone. */id?: number;
|
|
3529
3585
|
cast: PersonMovieCastCredit[];
|
|
3530
3586
|
crew: PersonMovieCrewCredit[];
|
|
3531
3587
|
};
|
|
@@ -3535,7 +3591,8 @@ type PersonMovieCredits = {
|
|
|
3535
3591
|
type PersonTVCastCredit = TVSeriesResultItem & {
|
|
3536
3592
|
character: string;
|
|
3537
3593
|
credit_id: string;
|
|
3538
|
-
episode_count: number;
|
|
3594
|
+
episode_count: number; /** Air date of this person's first credited episode for the show */
|
|
3595
|
+
first_credit_air_date?: string;
|
|
3539
3596
|
};
|
|
3540
3597
|
/**
|
|
3541
3598
|
* Crew credit for a TV show on a person profile.
|
|
@@ -3543,14 +3600,15 @@ type PersonTVCastCredit = TVSeriesResultItem & {
|
|
|
3543
3600
|
type PersonTVCrewCredit = TVSeriesResultItem & {
|
|
3544
3601
|
credit_id: string;
|
|
3545
3602
|
department: string;
|
|
3546
|
-
episode_count: number;
|
|
3603
|
+
episode_count: number; /** Air date of this person's first credited episode for the show */
|
|
3604
|
+
first_credit_air_date?: string;
|
|
3547
3605
|
job: string;
|
|
3548
3606
|
};
|
|
3549
3607
|
/**
|
|
3550
3608
|
* TV credits for a person.
|
|
3551
3609
|
*/
|
|
3552
3610
|
type PersonTVCredits = {
|
|
3553
|
-
id
|
|
3611
|
+
/** Absent when fetched via `append_to_response` rather than standalone. */id?: number;
|
|
3554
3612
|
cast: PersonTVCastCredit[];
|
|
3555
3613
|
crew: PersonTVCrewCredit[];
|
|
3556
3614
|
};
|
|
@@ -3574,7 +3632,7 @@ type PersonCombinedCrewCredit = (PersonMovieCrewCredit & {
|
|
|
3574
3632
|
* Combined credits for a person.
|
|
3575
3633
|
*/
|
|
3576
3634
|
type PersonCombinedCredits = {
|
|
3577
|
-
id
|
|
3635
|
+
/** Absent when fetched via `append_to_response` rather than standalone. */id?: number;
|
|
3578
3636
|
cast: PersonCombinedCastCredit[];
|
|
3579
3637
|
crew: PersonCombinedCrewCredit[];
|
|
3580
3638
|
};
|
|
@@ -3599,14 +3657,15 @@ type PersonTaggedImage = ImageItem & {
|
|
|
3599
3657
|
* Paginated tagged images for a person.
|
|
3600
3658
|
*/
|
|
3601
3659
|
type PersonTaggedImages = PaginatedResponse<PersonTaggedImage> & {
|
|
3602
|
-
id
|
|
3660
|
+
/** Absent when fetched via `append_to_response` rather than standalone. */id?: number;
|
|
3603
3661
|
};
|
|
3604
3662
|
/**
|
|
3605
3663
|
* Translation payload for person records.
|
|
3606
3664
|
*/
|
|
3607
3665
|
type PersonTranslationData = {
|
|
3608
3666
|
biography?: string;
|
|
3609
|
-
name?: string;
|
|
3667
|
+
name?: string; /** Whether this is the primary translation for the language */
|
|
3668
|
+
primary?: boolean;
|
|
3610
3669
|
};
|
|
3611
3670
|
/**
|
|
3612
3671
|
* Available translations for a person.
|
|
@@ -3983,7 +4042,7 @@ declare class ApiClient {
|
|
|
3983
4042
|
* call triggers a fresh fetch. Deduplication can be disabled globally via
|
|
3984
4043
|
* `TMDBOptions.deduplication = false`.
|
|
3985
4044
|
*/
|
|
3986
|
-
request<T>(endpoint: string, params?: Record<string, unknown
|
|
4045
|
+
request<T>(endpoint: string, params?: Record<string, unknown>): Promise<T>;
|
|
3987
4046
|
/**
|
|
3988
4047
|
* Removes a single entry from the response cache.
|
|
3989
4048
|
*
|
|
@@ -4024,7 +4083,7 @@ declare class ApiClient {
|
|
|
4024
4083
|
* @param body - JSON body to send (omit for DELETE/GET requests without a body)
|
|
4025
4084
|
* @param params - Optional query string parameters (e.g. session_id)
|
|
4026
4085
|
*/
|
|
4027
|
-
mutate<T>(method: "GET" | "POST" | "PUT" | "DELETE", endpoint: string, body?: Record<string, unknown>, params?: Record<string, unknown
|
|
4086
|
+
mutate<T>(method: "GET" | "POST" | "PUT" | "DELETE", endpoint: string, body?: Record<string, unknown>, params?: Record<string, unknown>): Promise<T>;
|
|
4028
4087
|
/**
|
|
4029
4088
|
* Shared fetch + response-parsing pipeline used by both `request` and `mutate`.
|
|
4030
4089
|
* Handles URL construction, auth, logging, error mapping, and null sanitisation.
|
|
@@ -4392,7 +4451,9 @@ declare class KeywordsAPI extends TMDBAPIBase {
|
|
|
4392
4451
|
* @param include_adult Include adult titles in results
|
|
4393
4452
|
* @reference https://developer.themoviedb.org/reference/keyword-movies
|
|
4394
4453
|
*/
|
|
4395
|
-
movies(params: KeywordMoviesParams): Promise<PaginatedResponse<MovieResultItem
|
|
4454
|
+
movies(params: KeywordMoviesParams): Promise<PaginatedResponse<MovieResultItem> & {
|
|
4455
|
+
id: number;
|
|
4456
|
+
}>;
|
|
4396
4457
|
}
|
|
4397
4458
|
//#endregion
|
|
4398
4459
|
//#region src/endpoints/movie_lists.d.ts
|
|
@@ -4414,7 +4475,7 @@ declare class MovieListsAPI extends TMDBAPIBase {
|
|
|
4414
4475
|
* @param page Page (Defaults to 1)
|
|
4415
4476
|
* @param region ISO-3166-1 code
|
|
4416
4477
|
*/
|
|
4417
|
-
now_playing(params?: MovieListParams): Promise<
|
|
4478
|
+
now_playing(params?: MovieListParams): Promise<MovieDateRangeList>;
|
|
4418
4479
|
/**
|
|
4419
4480
|
* Popular
|
|
4420
4481
|
* GET - https://api.themoviedb.org/3/movie/popular
|
|
@@ -4444,7 +4505,7 @@ declare class MovieListsAPI extends TMDBAPIBase {
|
|
|
4444
4505
|
* @param page Page (Defaults to 1)
|
|
4445
4506
|
* @param region ISO-3166-1 code
|
|
4446
4507
|
*/
|
|
4447
|
-
upcoming(params?: MovieListParams): Promise<
|
|
4508
|
+
upcoming(params?: MovieListParams): Promise<MovieDateRangeList>;
|
|
4448
4509
|
}
|
|
4449
4510
|
//#endregion
|
|
4450
4511
|
//#region src/endpoints/movies.d.ts
|
|
@@ -5176,9 +5237,7 @@ declare class TVEpisodesAPI extends TMDBAPIBase {
|
|
|
5176
5237
|
* GET - https://api.themoviedb.org/3/tv/episode/{episode_id}/changes
|
|
5177
5238
|
*
|
|
5178
5239
|
* Get the changes for a TV episode. By default only the last 24 hours are returned.
|
|
5179
|
-
* ACCORDING TO TMDB DOCS:
|
|
5180
5240
|
* You can query up to 14 days in a single query by using the start_date and end_date query parameters.
|
|
5181
|
-
* BUT NO start_date or end_date query params are specified in the documentation
|
|
5182
5241
|
*
|
|
5183
5242
|
* NOTE: TV show changes are a little different than movie changes in that there are some edits
|
|
5184
5243
|
* on seasons and episodes that will create a top level change entry at the show level.
|
|
@@ -5187,10 +5246,13 @@ declare class TVEpisodesAPI extends TMDBAPIBase {
|
|
|
5187
5246
|
* You can use the season changes and episode changes methods to look these up individually.
|
|
5188
5247
|
*
|
|
5189
5248
|
* @param episode_id The ID of the TV episode.
|
|
5249
|
+
* @param start_date Filter changes by start date (ISO 8601 format, e.g. "2024-01-01").
|
|
5250
|
+
* @param end_date Filter changes by end date (ISO 8601 format, e.g. "2024-01-14").
|
|
5251
|
+
* @param page The page of results to return.
|
|
5190
5252
|
* @returns A promise that resolves to the TV episode changes history.
|
|
5191
5253
|
* @reference https://developer.themoviedb.org/reference/tv-episode-changes-by-id
|
|
5192
5254
|
*/
|
|
5193
|
-
changes(params:
|
|
5255
|
+
changes(params: TVEpisodeChangesParams): Promise<Changes>;
|
|
5194
5256
|
/**
|
|
5195
5257
|
* Credits
|
|
5196
5258
|
* GET - https://api.themoviedb.org/3/tv/{series_id}/season/{season_number}/episode/{episode_number}/credits
|
|
@@ -6223,4 +6285,4 @@ type PageInfo = {
|
|
|
6223
6285
|
*/
|
|
6224
6286
|
declare function getPageInfo(response: PaginatedResponse<unknown>): PageInfo;
|
|
6225
6287
|
//#endregion
|
|
6226
|
-
export { AccountAPI, AccountAddFavoriteBody, AccountAddToWatchlistBody, AccountAvatar, AccountDetails, AccountDetailsParams, AccountListItem, AccountListsParams, AccountListsResponse, AccountMediaListParams, AccountMovieItem, AccountMovieListResponse, AccountMutationParams, AccountMutationResponse, AccountRatedEpisodeItem, AccountRatedEpisodesResponse, AccountRatedMovieItem, AccountRatedMoviesResponse, AccountRatedTVItem, AccountRatedTVResponse, AccountSortBy, AccountTVItem, AccountTVListResponse, AlternativeName, AlternativeNamesResult, AlternativeTitle, AuthCreateSessionBody, AuthCreateSessionResponse, AuthCreateSessionWithLoginBody, AuthDeleteSessionBody, AuthDeleteSessionResponse, AuthGuestSessionResponse, AuthRequestTokenResponse, AuthValidateKeyResponse, AuthenticationAPI, BACKDROP_SIZES, BackdropSize, Cast, CertificationItem, Certifications, CertificationsAPI, Change, ChangeItem, ChangeResultItem, Changes, ChangesAPI, Collection, CollectionBaseParam, CollectionDetailsParams, CollectionImages, CollectionImagesParams, CollectionItem, CollectionResultItem, CollectionTranslationData, CollectionTranslations, CollectionsAPI, CompaniesAPI, Company, CompanyAlternativeName, CompanyAlternativeNames, CompanyAlternativeNamesParams, CompanyBaseParam, CompanyDetailsParams, CompanyImages, CompanyImagesParams, CompanyResultItem, CompanySummary, ConfigurationAPI, ConfigurationCountriesParams, ConfigurationCountry, ConfigurationJob, ConfigurationLanguage, ConfigurationResponse, ConfigurationTimezone, ContentRating, CountryISO3166_1, Credit, CreditBaseParam, CreditDetails, CreditDetailsMedia, CreditDetailsMovieMedia, CreditDetailsParams, CreditDetailsPerson, CreditDetailsTVEpisode, CreditDetailsTVMedia, CreditDetailsTVSeason, CreditsAPI, Crew, DateRange, DefaultImageSizesConfig, DiscoverAPI, DiscoverFilterExpression, DiscoverMovieParams, DiscoverMovieSortBy, DiscoverTVParams, DiscoverTVResultItem, DiscoverTVSortBy, DiscoverTVStatus, DiscoverTVType, FallbackUrlConfig, FetchAllPagesOptions, FileType, FindAPI, FindByIDParams, FindExternalSource, FindMovieResultItem, FindPersonResultItem, FindResults, FindTVEpisodeResultItem, FindTVResultItem, FindTVSeasonResultItem, Genre, GenresAPI, GenresResponse, GuestSessionRatedEpisodesResponse, GuestSessionRatedMoviesResponse, GuestSessionRatedParams, GuestSessionRatedTVResponse, GuestSessionsAPI, IMAGE_BASE_URL, IMAGE_SECURE_BASE_URL, ImageCollectionKey, ImageConfiguration, ImageItem, ImageLanguagePriorityConfig, ImageSize, ImageSizeTypes, ImagesConfig, ImagesResult, Keyword, KeywordBaseParam, KeywordDetailsParams, KeywordMoviesParams, KeywordResultItem, KeywordsAPI, KnownForItem, KnownForMovie, KnownForTV, LOGO_SIZES, Language, LanguageISO6391, ListClearParams, ListCreateBody, ListCreateParams, ListCreateResponse, ListDetails, ListDetailsParams, ListItem, ListItemStatusParams, ListItemStatusResponse, ListMovieBody, ListMutationParams, ListMutationResponse, ListsAPI, LiteralUnion, LogoSize, MediaType, MediaWatchProviders, MovieAlternativeTitles, MovieAlternativeTitlesParams, MovieAppendToResponseNamespace, MovieAppendableMap, MovieChanges, MovieChangesParams, MovieCollection, MovieCredits, MovieCreditsParams, MovieDetails, MovieDetailsParams, MovieDetailsWithAppends, MovieExternalIDs, MovieExternalIDsParams, MovieImages, MovieImagesParams, MovieKeywords, MovieKeywordsParams, MovieListParams, MovieListsAPI, MovieRecommendations, MovieRecommendationsParams, MovieReleaseDate, MovieReleaseDateResult, MovieReleaseDates, MovieReleaseDatesParams, MovieResultItem, MovieReviews, MovieReviewsParams, MovieSimilar, MovieSimilarParams, MovieTranslationData, MovieTranslations, MovieTranslationsParams, MovieVideos, MovieVideosParams, MovieWatchProviders, MovieWatchProvidersParams, MoviesAPI, MultiSearchResultItem, Network, NetworkBaseParams, NetworkImages, NetworkItem, NetworksAPI, OrganizationImage, POSTER_SIZES, PROFILE_SIZES, PageInfo, PaginatedResponse, PeopleAPI, PeopleListParams, PeopleListsAPI, PersonAppendToResponseNamespace, PersonAppendableMap, PersonBaseParam, PersonChanges, PersonChangesParams, PersonCombinedCastCredit, PersonCombinedCredits, PersonCombinedCrewCredit, PersonCreditsParams, PersonDetails, PersonDetailsParams, PersonDetailsWithAppends, PersonExternalIDs, PersonExternalIDsParams, PersonImages, PersonImagesParams, PersonMovieCastCredit, PersonMovieCredits, PersonMovieCrewCredit, PersonResultItem, PersonTVCastCredit, PersonTVCredits, PersonTVCrewCredit, PersonTaggedImage, PersonTaggedImageMedia, PersonTaggedImages, PersonTaggedImagesParams, PersonTranslationData, PersonTranslations, PersonTranslationsParams, PosterSize, Prettify, PrimaryTranslations, ProductionCompany, ProductionCountry, ProfileSize, RequestInterceptor, RequestInterceptorContext, ResponseErrorInterceptor, ResponseSuccessInterceptor, RetryOptions, Review, ReviewAuthorDetails, ReviewDetails, ReviewDetailsParams, ReviewsAPI, STILL_SIZES, SearchAPI, SearchCollectionsParams, SearchCompanyParams, SearchKeywordsParams, SearchMoviesParams, SearchMultiParams, SearchPersonParams, SearchTVSeriesParams, SpokenLanguage, StillSize, TMDB, TMDBCountries, TMDBError, TMDBLogger, TMDBLoggerEntry, TMDBLoggerFn, TMDBOptions, TMDBQueryParams, TMDBv4, TVAggregateCredits, TVAggregateCreditsCastItem, TVAggregateCreditsCrewItem, TVAggregateCreditsParams, TVAlternativeTitles, TVAppendToResponseNamespace, TVAppendableMap, TVBaseParam, TVChangeParams, TVContentRatings, TVCreditJob, TVCreditRole, TVCredits, TVCreditsParams, TVDetailsParams, TVDetailsWithAppends, TVEpisode, TVEpisodeAppendToResponseNamespace, TVEpisodeAppendableMap, TVEpisodeBaseParams, TVEpisodeCredits, TVEpisodeCreditsParams, TVEpisodeDetailsParams, TVEpisodeDetailsWithAppends, TVEpisodeExternalIDs, TVEpisodeGroupDetails, TVEpisodeGroupDetailsItem, TVEpisodeGroupEpisode, TVEpisodeGroupItem, TVEpisodeGroupParams, TVEpisodeGroupType, TVEpisodeGroups, TVEpisodeGroupsAPI, TVEpisodeId, TVEpisodeImages, TVEpisodeImagesParams, TVEpisodeItem, TVEpisodeTranslationData, TVEpisodeTranslations, TVEpisodeVideos, TVEpisodesAPI, TVExternalIDs,
|
|
6288
|
+
export { AccountAPI, AccountAddFavoriteBody, AccountAddToWatchlistBody, AccountAvatar, AccountDetails, AccountDetailsParams, AccountListItem, AccountListsParams, AccountListsResponse, AccountMediaListParams, AccountMovieItem, AccountMovieListResponse, AccountMutationParams, AccountMutationResponse, AccountRatedEpisodeItem, AccountRatedEpisodesResponse, AccountRatedMovieItem, AccountRatedMoviesResponse, AccountRatedTVItem, AccountRatedTVResponse, AccountSortBy, AccountTVItem, AccountTVListResponse, AlternativeName, AlternativeNamesResult, AlternativeTitle, AuthCreateSessionBody, AuthCreateSessionResponse, AuthCreateSessionWithLoginBody, AuthDeleteSessionBody, AuthDeleteSessionResponse, AuthGuestSessionResponse, AuthRequestTokenResponse, AuthValidateKeyResponse, AuthenticationAPI, BACKDROP_SIZES, BackdropSize, Cast, CertificationItem, Certifications, CertificationsAPI, Change, ChangeItem, ChangeResultItem, Changes, ChangesAPI, Collection, CollectionBaseParam, CollectionDetailsParams, CollectionImages, CollectionImagesParams, CollectionItem, CollectionResultItem, CollectionTranslationData, CollectionTranslations, CollectionsAPI, CompaniesAPI, Company, CompanyAlternativeName, CompanyAlternativeNames, CompanyAlternativeNamesParams, CompanyBaseParam, CompanyDetailsParams, CompanyImages, CompanyImagesParams, CompanyResultItem, CompanySummary, ConfigurationAPI, ConfigurationCountriesParams, ConfigurationCountry, ConfigurationJob, ConfigurationLanguage, ConfigurationResponse, ConfigurationTimezone, ContentRating, CountryISO3166_1, Credit, CreditBaseParam, CreditDetails, CreditDetailsMedia, CreditDetailsMovieMedia, CreditDetailsParams, CreditDetailsPerson, CreditDetailsTVEpisode, CreditDetailsTVMedia, CreditDetailsTVSeason, CreditsAPI, Crew, DateRange, DefaultImageSizesConfig, DiscoverAPI, DiscoverFilterExpression, DiscoverMovieParams, DiscoverMovieSortBy, DiscoverTVParams, DiscoverTVResultItem, DiscoverTVSortBy, DiscoverTVStatus, DiscoverTVStatusLabel, DiscoverTVType, DiscoverTVTypeLabel, FallbackUrlConfig, FetchAllPagesOptions, FileType, FindAPI, FindByIDParams, FindExternalSource, FindMovieResultItem, FindPersonResultItem, FindResults, FindTVEpisodeResultItem, FindTVResultItem, FindTVSeasonResultItem, Genre, GenresAPI, GenresResponse, GuestSessionRatedEpisodesResponse, GuestSessionRatedMoviesResponse, GuestSessionRatedParams, GuestSessionRatedTVResponse, GuestSessionsAPI, IMAGE_BASE_URL, IMAGE_SECURE_BASE_URL, ImageCollectionKey, ImageConfiguration, ImageItem, ImageLanguagePriorityConfig, ImageSize, ImageSizeTypes, ImagesConfig, ImagesResult, Keyword, KeywordBaseParam, KeywordDetailsParams, KeywordMoviesParams, KeywordResultItem, KeywordsAPI, KnownForItem, KnownForMovie, KnownForTV, LOGO_SIZES, Language, LanguageISO6391, ListClearParams, ListCreateBody, ListCreateParams, ListCreateResponse, ListDetails, ListDetailsParams, ListItem, ListItemStatusParams, ListItemStatusResponse, ListMovieBody, ListMutationParams, ListMutationResponse, ListsAPI, LiteralUnion, LiteralUnionNumber, LogoSize, MediaType, MediaWatchProviders, MovieAlternativeTitles, MovieAlternativeTitlesParams, MovieAppendToResponseNamespace, MovieAppendableMap, MovieChanges, MovieChangesParams, MovieCollection, MovieCredits, MovieCreditsParams, MovieDateRangeList, MovieDetails, MovieDetailsParams, MovieDetailsWithAppends, MovieExternalIDs, MovieExternalIDsParams, MovieImages, MovieImagesParams, MovieKeywords, MovieKeywordsParams, MovieListParams, MovieListsAPI, MovieRecommendations, MovieRecommendationsParams, MovieReleaseDate, MovieReleaseDateResult, MovieReleaseDates, MovieReleaseDatesParams, MovieReleaseType, MovieReleaseTypeLabel, MovieResultItem, MovieReviews, MovieReviewsParams, MovieSimilar, MovieSimilarParams, MovieTranslationData, MovieTranslations, MovieTranslationsParams, MovieVideos, MovieVideosParams, MovieWatchProviders, MovieWatchProvidersParams, MoviesAPI, MultiSearchResultItem, Network, NetworkBaseParams, NetworkImages, NetworkItem, NetworksAPI, OrganizationImage, POSTER_SIZES, PROFILE_SIZES, PageInfo, PaginatedResponse, PeopleAPI, PeopleListParams, PeopleListsAPI, PersonAppendToResponseNamespace, PersonAppendableMap, PersonBaseParam, PersonChanges, PersonChangesParams, PersonCombinedCastCredit, PersonCombinedCredits, PersonCombinedCrewCredit, PersonCreditsParams, PersonDetails, PersonDetailsParams, PersonDetailsWithAppends, PersonExternalIDs, PersonExternalIDsParams, PersonImages, PersonImagesParams, PersonMovieCastCredit, PersonMovieCredits, PersonMovieCrewCredit, PersonResultItem, PersonTVCastCredit, PersonTVCredits, PersonTVCrewCredit, PersonTaggedImage, PersonTaggedImageMedia, PersonTaggedImages, PersonTaggedImagesParams, PersonTranslationData, PersonTranslations, PersonTranslationsParams, PosterSize, Prettify, PrimaryTranslations, ProductionCompany, ProductionCountry, ProfileSize, RequestInterceptor, RequestInterceptorContext, ResponseErrorInterceptor, ResponseSuccessInterceptor, RetryOptions, Review, ReviewAuthorDetails, ReviewDetails, ReviewDetailsParams, ReviewsAPI, STILL_SIZES, SearchAPI, SearchCollectionsParams, SearchCompanyParams, SearchKeywordsParams, SearchMoviesParams, SearchMultiParams, SearchPersonParams, SearchTVSeriesParams, SpokenLanguage, StillSize, TMDB, TMDBCountries, TMDBError, TMDBLogger, TMDBLoggerEntry, TMDBLoggerFn, TMDBOptions, TMDBQueryParams, TMDBv4, TVAggregateCredits, TVAggregateCreditsCastItem, TVAggregateCreditsCrewItem, TVAggregateCreditsParams, TVAlternativeTitles, TVAppendToResponseNamespace, TVAppendableMap, TVBaseParam, TVChangeParams, TVContentRatings, TVCreditJob, TVCreditRole, TVCredits, TVCreditsParams, TVDetailsParams, TVDetailsWithAppends, TVEpisode, TVEpisodeAppendToResponseNamespace, TVEpisodeAppendableMap, TVEpisodeBaseParams, TVEpisodeChangesParams, TVEpisodeCredits, TVEpisodeCreditsParams, TVEpisodeDetailsParams, TVEpisodeDetailsWithAppends, TVEpisodeExternalIDs, TVEpisodeGroupDetails, TVEpisodeGroupDetailsItem, TVEpisodeGroupEpisode, TVEpisodeGroupItem, TVEpisodeGroupParams, TVEpisodeGroupType, TVEpisodeGroupTypeLabel, TVEpisodeGroups, TVEpisodeGroupsAPI, TVEpisodeId, TVEpisodeImages, TVEpisodeImagesParams, TVEpisodeItem, TVEpisodeTranslationData, TVEpisodeTranslations, TVEpisodeVideos, TVEpisodesAPI, TVExternalIDs, TVImages, TVImagesParams, TVKeywords, TVRecommendations, TVRecommendationsParams, TVReviews, TVReviewsParams, TVScreenedTheatrically, TVScreeningItem, TVSeason, TVSeasonAggregateCredits, TVSeasonAggregateCreditsParams, TVSeasonAppendToResponseNamespace, TVSeasonAppendableMap, TVSeasonBaseParams, TVSeasonChanges, TVSeasonChangesParams, TVSeasonCredits, TVSeasonCreditsParams, TVSeasonDetailsParams, TVSeasonDetailsWithAppends, TVSeasonEpisode, TVSeasonExternalIDs, TVSeasonId, TVSeasonImages, TVSeasonImagesParams, TVSeasonItem, TVSeasonTranslationData, TVSeasonTranslations, TVSeasonVideos, TVSeasonVideosParams, TVSeasonWatchProvidersParams, TVSeasonsAPI, TVSeriesAPI, TVSeriesChanges, TVSeriesDetails, TVSeriesListItem, TVSeriesListParams, TVSeriesLists, TVSeriesListsAPI, TVSeriesListsParams, TVSeriesResultItem, TVSimilar, TVSimilarParams, TVTranslationData, TVTranslations, TVVideos, Timezone, Translation, TranslationResults, TrendingAPI, TrendingAllResult, TrendingMovieResult, TrendingParams, TrendingPersonResult, TrendingTVResult, TrendingTimeWindow, V4AccountAPI, V4AddListItemsBody, V4AddListItemsResponse, V4AuthAPI, V4AuthAccessTokenResponse, V4AuthCreateAccessTokenBody, V4AuthCreateRequestTokenBody, V4AuthDeleteAccessTokenBody, V4AuthDeleteAccessTokenResponse, V4AuthRequestTokenResponse, V4CreateListBody, V4CreateListResponse, V4DeleteListParams, V4ListDetails, V4ListDetailsParams, V4ListItemInput, V4ListItemResult, V4ListItemStatusParams, V4ListItemStatusResponse, V4ListMediaType, V4ListResult, V4ListStatusResponse, V4ListsAPI, V4RemoveListItemsBody, V4UpdateListBody, V4UpdateListItemsBody, V4UpdateListItemsResponse, VideoItem, VideoResults, WatchMonetizationType, WatchProvider, WatchProviderDisplayPriorities, WatchProviderItem, WatchProviderListItem, WatchProviderListParams, WatchProviderListResponse, WatchProviderRegionsParams, WatchProviderRegionsResponse, WatchProvidersAPI, WithLanguage, WithLanguagePage, WithPage, WithPageAndDateRange, WithParams, WithRegion, fetchAllPages, getPageInfo, hasBackdropPath, hasLogoPath, hasNextPage, hasPosterPath, hasPreviousPage, hasProfilePath, hasStillPath, isJwt, isKnownForMovie, isKnownForTV, isPlainObject, isRecord, paginate };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=class extends Error{tmdb_status_code;message;http_status_code;constructor(e,t,n){super(e),this.name=`TMDBError`,this.tmdb_status_code=n||-1,this.message=e,this.http_status_code=t}};const t=`http://image.tmdb.org/t/p/`,n=`https://image.tmdb.org/t/p/`,r=[`w300`,`w780`,`w1280`,`original`],i=[`w45`,`w92`,`w154`,`w185`,`w300`,`w500`,`original`],a=[`w92`,`w154`,`w185`,`w342`,`w500`,`w780`,`original`],o=[`w45`,`w185`,`h632`,`original`],s=[`w92`,`w185`,`w300`,`original`];var c=class e{logger;constructor(e){this.logger=e}static from(t){if(t)return t===!0?new e(e.defaultLogger):new e(t)}log(e){if(this.logger)try{this.logger(e)}catch(e){console.warn(`TMDB logger error: ${e}`)}}static defaultLogger(e){let t=`🎬 [tmdb]`,n=new Date().toISOString();if(e.type===`request`){console.log(`${t} ${n} 🛰️ REQUEST ${e.method} ${e.endpoint} \n`);return}if(e.type===`response`){console.log(`${t} ${n} ✅ RESPONSE ${e.method} ${e.status} ${e.statusText} ${e.endpoint} (${e.durationMs}ms)\n`);return}let r=e.status==null?`NETWORK ERROR`:`${e.status} ${e.statusText}`,i=e.tmdbStatusCode==null?``:` (tmdb: ${e.tmdbStatusCode})`;console.log(`${t} ${n} ❌ ${e.method} ${r} ${e.endpoint} - ${e.errorMessage}${i}\n`)}};function l(e){return/^[A-Za-z0-9\-_]+$/.test(e)}function u(e){try{let t=e.replace(/-/g,`+`).replace(/_/g,`/`),n=t.padEnd(t.length+(4-t.length%4)%4,`=`);return atob(n)}catch{return null}}function d(e){return typeof e==`object`&&!!e}function f(e){return d(e)?typeof e.alg==`string`:!1}function p(e){return!(!d(e)||`exp`in e&&typeof e.exp!=`number`||`nbf`in e&&typeof e.nbf!=`number`||`iat`in e&&typeof e.iat!=`number`)}function m(e){if(typeof e!=`string`)return!1;let t=e.split(`.`);if(t.length!==3)return!1;let[n,r,i]=t;if(!l(n)||!l(r)||!l(i))return!1;let a=u(n),o=u(r);if(!a||!o)return!1;let s,c;try{s=JSON.parse(a),c=JSON.parse(o)}catch{return!1}return!(!f(s)||!p(c))}function h(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function g(e){if(!h(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function _(e){return typeof e==`object`&&!!e&&`poster_path`in e&&typeof e.poster_path==`string`}function ee(e){return typeof e==`object`&&!!e&&`backdrop_path`in e&&typeof e.backdrop_path==`string`}function te(e){return typeof e==`object`&&!!e&&`profile_path`in e&&typeof e.profile_path==`string`}function ne(e){return typeof e==`object`&&!!e&&`still_path`in e&&typeof e.still_path==`string`}function re(e){return typeof e==`object`&&!!e&&`logo_path`in e&&typeof e.logo_path==`string`}const v={NO_ACCESS_TOKEN:`TMDB requires a valid access token, please provide one.`,INVALID_CLIENT:`TMDB received an invalid ApiClient instance. Pass a valid ApiClient or an access token string.`,V4_REQUIRES_JWT:`TMDB v4 requires a Bearer (JWT) access token. API key strings are not supported for v4 endpoints.`,INVALID_START_PAGE:`Invalid page: Pages start at 1 and max at 500. They are expected to be an integer.`};async function*ie(e,t=1){if(!Number.isInteger(t)||t<1||t>500)throw RangeError(v.INVALID_START_PAGE);let n=t;for(;;){let t=await e(n);if(yield t,t.page>=t.total_pages)break;n++}}async function ae(e,t={}){let{maxPages:n=500,deduplicateBy:r}=t,i=[],a=1;for(;;){let t=await e(a);if(i.push(...t.results),t.page>=t.total_pages||a>=n)break;a++}if(r){let e=new Map;for(let t of i){let n=r(t);e.has(n)&&e.delete(n),e.set(n,t)}return[...e.values()]}return i}function oe(e){return e.page<e.total_pages}function se(e){return e.page>1}function ce(e){return{current:e.page,total:e.total_pages,totalResults:e.total_results,isFirst:e.page===1,isLast:e.page>=e.total_pages}}const y={backdrop_path:`backdrop`,logo_path:`logo`,poster_path:`poster`,profile_path:`profile`,still_path:`still`},le={backdrop_path:`backdrops`,logo_path:`logos`,poster_path:`posters`,profile_path:`profiles`,still_path:`stills`},b={backdrops:`backdrop_path`,logos:`logo_path`,posters:`poster_path`,profiles:`profile_path`,stills:`still_path`};var x=class{options;constructor(e={}){this.options={secure_images_url:!0,...e}}buildUrl(e,r){return`${this.options.secure_images_url?n:t}${r}${e}`}backdrop(e,t=this.options.default_image_sizes?.backdrops||`w780`){return this.buildUrl(e,t)}logo(e,t=this.options.default_image_sizes?.logos||`w185`){return this.buildUrl(e,t)}poster(e,t=this.options.default_image_sizes?.posters||`w500`){return this.buildUrl(e,t)}profile(e,t=this.options.default_image_sizes?.profiles||`w185`){return this.buildUrl(e,t)}still(e,t=this.options.default_image_sizes?.still||`w300`){return this.buildUrl(e,t)}autocompleteImagePaths(e,t){return this.traverse(e,t,!0)}applyFallbacksOnly(e){return this.traverse(e,void 0,!1)}traverse(e,t,n){if(Array.isArray(e)){let r=n&&t&&this.options.image_language_priority?.[t];return(r?this.sortByLanguagePriority(e,r):e).map(e=>this.traverse(e,t,n))}if(!g(e))return e;let r=Object.create(null);for(let[i,a]of Object.entries(e)){if(i===`__proto__`||i===`constructor`||i===`prototype`){r[i]=a;continue}if(a==null){if(Object.hasOwn(y,i)){let e=le[i];r[i]=this.getFallbackForCollection(e)??a;continue}if(i===`file_path`&&t){r[i]=this.getFallbackForCollection(t)??a;continue}r[i]=a;continue}if(typeof a==`string`){r[i]=n?this.transformPathValue(i,a,t):a;continue}let e=this.isImageCollectionKey(i)?i:t;r[i]=this.traverse(a,e,n)}return r}sortByLanguagePriority(e,t){let n=[],r=[...e];for(let e of t){if(e===`*`){n.push(...r.splice(0,r.length));break}let t=[];for(let i of r){let r=i?.iso_639_1;(e===`null`?r==null:r===e)?n.push(i):t.push(i)}r.length=0,r.push(...t)}return n.push(...r),n}isImageCollectionKey(e){return Object.hasOwn(b,e)}getFallbackForCollection(e){let t=this.options.fallback_url;if(t!=null)return typeof t==`string`?t:t[e]}isFullUrl(e){return/^https?:\/\//.test(e)}buildImageUrl(e,t){let n=y[e];return Object.hasOwn(this,n)||this[n],this[n](t)}transformPathValue(e,t,n){return!t.startsWith(`/`)||this.isFullUrl(t)?t:Object.hasOwn(y,e)?this.buildImageUrl(e,t):e===`file_path`&&n?this.buildImageUrl(b[n],t):t}},ue=class{ttl;maxSize;excludedEndpoints;store=new Map;constructor(e={}){let t=e.ttl??3e5;if(!Number.isFinite(t)||!Number.isInteger(t)||t<1)throw RangeError(`cache.ttl must be a finite integer >= 1 (got ${t})`);if(e.max_size!==void 0&&(!Number.isFinite(e.max_size)||!Number.isInteger(e.max_size)||e.max_size<1))throw RangeError(`cache.max_size must be a finite integer >= 1 (got ${e.max_size})`);this.ttl=t,this.maxSize=e.max_size,this.excludedEndpoints=(e.excluded_endpoints??[]).map(e=>typeof e!=`string`&&/[gy]/.test(e.flags)?new RegExp(e.source,e.flags.replace(/[gy]/g,``)):e)}shouldCache(e){return!this.excludedEndpoints.some(t=>typeof t==`string`?e.startsWith(t):t.test(e))}get(e){let t=this.store.get(e);if(t){if(Date.now()>t.expiresAt){this.store.delete(e);return}return t.value}}has(e){let t=this.store.get(e);return t?Date.now()>t.expiresAt?(this.store.delete(e),!1):!0:!1}set(e,t){this.maxSize!==void 0&&!this.store.has(e)&&this.store.size>=this.maxSize&&this.store.delete(this.store.keys().next().value),this.store.set(e,{value:t,expiresAt:Date.now()+this.ttl})}delete(e){return this.store.delete(e)}clear(){this.store.clear()}get size(){return this.store.size}},de=class{maxRequests;windowMs;timestamps=[];queue=[];processing=!1;constructor(e={}){let t=e.max_requests??40,n=e.per_ms??1e3;if(!Number.isFinite(t)||!Number.isInteger(t)||t<1)throw RangeError(`rate_limit.max_requests must be a finite integer >= 1 (got ${t})`);if(!Number.isFinite(n)||!Number.isInteger(n)||n<1)throw RangeError(`rate_limit.per_ms must be a finite integer >= 1 (got ${n})`);this.maxRequests=t,this.windowMs=n}acquire(){return new Promise(e=>{this.queue.push(e),this.processing||this.process()})}async process(){for(this.processing=!0;this.queue.length>0;){let e=Date.now();if(this.timestamps=this.timestamps.filter(t=>e-t<this.windowMs),this.timestamps.length<this.maxRequests)this.timestamps.push(Date.now()),this.queue.shift()();else{let e=this.timestamps[0],t=this.windowMs-(Date.now()-e)+1;await new Promise(e=>setTimeout(e,t))}}this.processing=!1}};function fe(t){if(t instanceof e)return t.http_status_code>=500;if(t instanceof Error)switch(t.name){case`FetchError`:case`AbortError`:return!0;case`SyntaxError`:return!1;case`TypeError`:return!0;default:return!1}return!0}var pe=class{maxRetries;baseDelayMs;maxDelayMs;shouldRetry;constructor(e={}){let t=e.max_retries??3,n=e.base_delay_ms??500,r=e.max_delay_ms??3e4;if(!Number.isFinite(t)||!Number.isInteger(t)||t<0)throw RangeError(`retry.max_retries must be a finite integer >= 0 (got ${t})`);if(!Number.isFinite(n)||!Number.isInteger(n)||n<1)throw RangeError(`retry.base_delay_ms must be a finite integer >= 1 (got ${n})`);if(!Number.isFinite(r)||!Number.isInteger(r)||r<1)throw RangeError(`retry.max_delay_ms must be a finite integer >= 1 (got ${r})`);this.maxRetries=t,this.baseDelayMs=n,this.maxDelayMs=r,this.shouldRetry=e.shouldRetry??fe}delayFor(e){let t=Math.min(this.baseDelayMs*2**(e-1),this.maxDelayMs);return Math.floor(Math.random()*t)}async execute(e,t=me){let n;for(let r=0;r<=this.maxRetries;r++)try{return await e()}catch(e){if(n=e,r>=this.maxRetries||!await this.shouldRetry(e,r+1))break;let i=this.delayFor(r+1);i>0&&await t(i)}throw n}};function me(e){return new Promise(t=>setTimeout(t,e))}var S=class{accessToken;baseUrl;logger;inflightRequests=new Map;deduplication;rateLimiter;retryManager;requestInterceptors;onSuccessInterceptor;onErrorInterceptor;imageApi;imageOptions;responseCache;constructor(e,t={}){this.accessToken=e,this.baseUrl=`https://api.themoviedb.org/${t.version??3}`,this.logger=c.from(t.logger),this.deduplication=t.deduplication!==!1,t.rate_limit&&(this.rateLimiter=new de(t.rate_limit===!0?{}:t.rate_limit)),t.retry&&(this.retryManager=new pe(t.retry===!0?{}:t.retry)),t.cache&&(this.responseCache=new ue(t.cache===!0?{}:t.cache));let n=t.interceptors?.request;this.requestInterceptors=n==null?[]:Array.isArray(n)?n:[n],this.onSuccessInterceptor=t.interceptors?.response?.onSuccess,this.onErrorInterceptor=t.interceptors?.response?.onError,this.imageApi=t.images?.autocomplete_paths||t.images?.fallback_url!=null?new x(t.images):void 0,this.imageOptions=t.images}buildRequestKey(e,t){let n=this.serializeParams(t).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>`${e}=${t}`);return n.length>0?`${e}?${n.join(`&`)}`:e}serializeParams(e){return Object.entries(e).flatMap(([e,t])=>t===void 0?[]:[[e,String(t)]])}async request(e,t={}){let n=await this.runRequestInterceptors({endpoint:e,params:t,method:`GET`}),r=n.endpoint,i=n.params,a=this.buildRequestKey(r,i),o=!!this.responseCache?.shouldCache(a);if(o&&this.responseCache.has(a))return this.responseCache.get(a);if(!this.deduplication){let e=await this.execute(`GET`,r,i,void 0,!0);return o&&this.responseCache.set(a,e),e}let s=this.inflightRequests.get(a);if(s)return s;let c=o?this.responseCache:void 0,l=this.execute(`GET`,r,i,void 0,!0).then(e=>(c?.set(a,e),e)).finally(()=>{this.inflightRequests.delete(a)});return this.inflightRequests.set(a,l),l}invalidateCache(e,t={}){return this.responseCache?this.responseCache.delete(this.buildRequestKey(e,t)):!1}clearCache(){this.responseCache?.clear()}get cacheSize(){return this.responseCache?.size??0}async runRequestInterceptors(e){let t=e;for(let e of this.requestInterceptors){let n=await e(t);n!=null&&(t=n)}return t}sanitizeNulls(e){if(e===null)return;if(typeof e!=`object`)return e;if(Array.isArray(e))return e.map(e=>this.sanitizeNulls(e));let t={};for(let[n,r]of Object.entries(e))t[n]=this.sanitizeNulls(r);return t}async normalizeError(t,n,r){let i=t.statusText,a=-1;try{let e=await t.json();if(e&&typeof e==`object`){let t=e;i=t.status_message||i,a=t.status_code||-1}}catch(e){console.error(`Unknown error: ${e}`)}return this.logger?.log({type:`error`,method:r,endpoint:n,status:t.status,statusText:t.statusText,tmdbStatusCode:a,errorMessage:i}),new e(i,t.status,a)}async notifyErrorInterceptor(e){this.onErrorInterceptor&&await this.onErrorInterceptor(e)}async mutate(e,t,n,r={}){return this.execute(e,t,r,n)}async execute(t,n,r,i,a=!1){let o=i===void 0?void 0:JSON.stringify(i),s,c;if(a)s=n,c=r;else{let e=await this.runRequestInterceptors({endpoint:n,params:r,method:t});s=e.endpoint,c=e.params}let l=new URL(`${this.baseUrl}${s}`),u=m(this.accessToken);for(let[e,t]of this.serializeParams(c))l.searchParams.append(e,t);u||l.searchParams.append(`api_key`,this.accessToken);let d=Date.now();this.logger?.log({type:`request`,method:t,endpoint:s});let f=async()=>{this.rateLimiter&&await this.rateLimiter.acquire();let e;try{e=await fetch(l.toString(),{method:t,headers:u?{Authorization:`Bearer ${this.accessToken}`,"Content-Type":`application/json;charset=utf-8`}:{"Content-Type":`application/json;charset=utf-8`},...o===void 0?{}:{body:o}})}catch(e){throw this.logger?.log({type:`error`,method:t,endpoint:s,errorMessage:e instanceof Error?e.message:String(e),durationMs:Date.now()-d}),e}if(!e.ok)throw await this.normalizeError(e,s,t);return e},p;try{p=this.retryManager?await this.retryManager.execute(f):await f()}catch(t){throw t instanceof e&&await this.notifyErrorInterceptor(t),t}this.logger?.log({type:`response`,method:t,endpoint:s,status:p.status,statusText:p.statusText,durationMs:Date.now()-d});let h=await p.json(),g=this.sanitizeNulls(h),_=this.imageApi?this.imageOptions?.autocomplete_paths?this.imageApi.autocompleteImagePaths(g):this.imageApi.applyFallbacksOnly(g):g;if(this.onSuccessInterceptor){let e=await this.onSuccessInterceptor(_);return e===void 0?_:e}return _}};const C={AUTHENTICATION:{VALIDATE:`/authentication`,GUEST_SESSION:`/authentication/guest_session/new`,REQUEST_TOKEN:`/authentication/token/new`,CREATE_SESSION:`/authentication/session/new`,CREATE_SESSION_WITH_LOGIN:`/authentication/token/validate_with_login`,DELETE_SESSION:`/authentication/session`},ACCOUNT:{DETAILS:`/account`,ADD_FAVORITE:`/favorite`,ADD_TO_WATCHLIST:`/watchlist`,FAVORITE_MOVIES:`/favorite/movies`,FAVORITE_TV:`/favorite/tv`,WATCHLIST_MOVIES:`/watchlist/movies`,WATCHLIST_TV:`/watchlist/tv`,RATED_MOVIES:`/rated/movies`,RATED_TV:`/rated/tv`,RATED_TV_EPISODES:`/rated/tv/episodes`,LISTS:`/lists`},CONFIGURATION:{DETAILS:`/configuration`,COUNTRIES:`/configuration/countries`,JOBS:`/configuration/jobs`,LANGUAGES:`/configuration/languages`,TIMEZONES:`/configuration/timezones`,PRIMARY_TRANSLATIONS:`/configuration/primary_translations`},CERTIFICATIONS:{MOVIE_CERTIFICATIONS:`/certification/movie/list`,TV_CERTIFICATIONS:`/certification/tv/list`},CHANGES:{MOVIE_LIST:`/movie/changes`,PEOPLE_LIST:`/person/changes`,TV_LIST:`/tv/changes`},DISCOVER:{MOVIE:`/discover/movie`,TV:`/discover/tv`},FIND:`/find`,CREDITS:{DETAILS:`/credit`},COMPANIES:{DETAILS:`/company`,ALTERNATIVE_NAMES:`/alternative_names`,IMAGES:`/images`},COLLECTIONS:{DETAILS:`/collection`,IMAGES:`/images`,TRANSLATIONS:`/translations`},GENRES:{MOVIE_LIST:`/genre/movie/list`,TV_LIST:`/genre/tv/list`},KEYWORDS:{DETAILS:`/keyword`,MOVIES:`/movies`},MOVIES:{DETAILS:`/movie`,ALTERNATIVE_TITLES:`/alternative_titles`,CREDITS:`/credits`,EXTERNAL_IDS:`/external_ids`,KEYWORDS:`/keywords`,CHANGES:`/changes`,IMAGES:`/images`,LATEST:`/latest`,NOW_PLAYING:`/now_playing`,POPULAR:`/popular`,RECOMMENDATIONS:`/recommendations`,RELEASE_DATES:`/release_dates`,REVIEWS:`/reviews`,SIMILAR:`/similar`,TOP_RATED:`/top_rated`,TRANSLATIONS:`/translations`,UPCOMING:`/upcoming`,VIDEOS:`/videos`,WATCH_PROVIDERS:`/watch/providers`},NETWORKS:{DETAILS:`/network`,ALTERNATIVE_NAMES:`/alternative_names`,IMAGES:`/images`},PEOPLE:{DETAILS:`/person`,CHANGES:`/changes`,COMBINED_CREDITS:`/combined_credits`,EXTERNAL_IDS:`/external_ids`,IMAGES:`/images`,LATEST:`/latest`,MOVIE_CREDITS:`/movie_credits`,TAGGED_IMAGES:`/tagged_images`,TRANSLATIONS:`/translations`,TV_CREDITS:`/tv_credits`},SEARCH:{MOVIE:`/search/movie`,COLLECTION:`/search/collection`,COMPANY:`/search/company`,KEYWORD:`/search/keyword`,MULTI:`/search/multi`,PERSON:`/search/person`,TV:`/search/tv`},TV_SERIES:{DETAILS:`/tv`,AGGREGATE_CREDITS:`/aggregate_credits`,AIRING_TODAY:`/airing_today`,ALTERNATIVE_TITLES:`/alternative_titles`,CHANGES:`/changes`,CONTENT_RATINGS:`/content_ratings`,CREDITS:`/credits`,EPISODE_GROUPS:`/episode_groups`,EXTERNAL_IDS:`/external_ids`,IMAGES:`/images`,KEYWORDS:`/keywords`,LATEST:`/latest`,LISTS:`/lists`,ON_THE_AIR:`/on_the_air`,POPULAR:`/popular`,RECOMMENDATIONS:`/recommendations`,REVIEWS:`/reviews`,SCREENED_THEATRICALLY:`/screened_theatrically`,SIMILAR:`/similar`,TOP_RATED:`/top_rated`,TRANSLATIONS:`/translations`,VIDEOS:`/videos`,WATCH_PROVIDERS:`/watch/providers`},TV_SEASONS:{DETAILS:`/season`,AGGREGATE_CREDITS:`/aggregate_credits`,CHANGES:`/changes`,CREDITS:`/credits`,EXTERNAL_IDS:`/external_ids`,IMAGES:`/images`,TRANSLATIONS:`/translations`,VIDEOS:`/videos`,WATCH_PROVIDERS:`/watch/providers`},TV_EPISODES:{DETAILS:`/episode`,CHANGES:`/changes`,CREDITS:`/credits`,EXTERNAL_IDS:`/external_ids`,IMAGES:`/images`,TRANSLATIONS:`/translations`,VIDEOS:`/videos`},TV_EPISODE_GROUPS:{DETAILS:`/tv/episode_group`},WATCH_PROVIDERS:{MOVIE:`/watch/providers/movie`,TV:`/watch/providers/tv`,REGIONS:`/watch/providers/regions`},TRENDING:{ALL:`/trending/all`,MOVIE:`/trending/movie`,TV:`/trending/tv`,PERSON:`/trending/person`},REVIEWS:{DETAILS:`/review`},PEOPLE_LISTS:{POPULAR:`/person/popular`},LISTS:{DETAILS:`/list`,ADD_ITEM:`/add_item`,ITEM_STATUS:`/item_status`,CLEAR:`/clear`,REMOVE_ITEM:`/remove_item`},GUEST_SESSIONS:{DETAILS:`/guest_session`,RATED_MOVIES:`/rated/movies`,RATED_TV:`/rated/tv`,RATED_TV_EPISODES:`/rated/tv/episodes`}},w={AUTH:{REQUEST_TOKEN:`/auth/request_token`,ACCESS_TOKEN:`/auth/access_token`},ACCOUNT:{DETAILS:`/account`,LISTS:`/lists`,FAVORITE_MOVIES:`/favorite/movies`,FAVORITE_TV:`/favorite/tv`,WATCHLIST_MOVIES:`/watchlist/movies`,WATCHLIST_TV:`/watchlist/tv`,RATED_MOVIES:`/rated/movies`,RATED_TV:`/rated/tv`},LISTS:{DETAILS:`/list`,ITEMS:`/items`,ITEM_STATUS:`/item_status`,CLEAR:`/clear`}};var T=class{client;defaultOptions;constructor(e,t={}){if(typeof e==`string`){if(!e)throw Error(v.NO_ACCESS_TOKEN);this.client=new S(e,{logger:t.logger,deduplication:t.deduplication,rate_limit:t.rate_limit,interceptors:t.interceptors})}else if(e instanceof S)this.client=e;else throw Error(e==null?v.NO_ACCESS_TOKEN:v.INVALID_CLIENT);this.defaultOptions=t}applyDefaults(e){let{language:t,region:n}=this.defaultOptions;return{...t!==void 0&&{language:t},...n!==void 0&&{region:n},...e}}withLanguage(e){let t=this.defaultOptions?.language;return e?e.language!==void 0||t===void 0?e:{...e,language:t}:t===void 0?void 0:{language:t}}injectImageLanguage(e){if(!this.defaultOptions.images?.auto_include_image_language||e.include_image_language!==void 0)return e;let t=this.defaultOptions.images?.image_language_priority;if(!t)return e;let n=[...new Set(Object.values(t).flat().filter(e=>e!==`*`))];return n.length?{...e,include_image_language:n}:e}},E=class extends T{async movie_certifications(){return this.client.request(C.CERTIFICATIONS.MOVIE_CERTIFICATIONS)}async tv_certifications(){return this.client.request(C.CERTIFICATIONS.TV_CERTIFICATIONS)}},D=class extends T{async movie_list(e){return this.client.request(C.CHANGES.MOVIE_LIST,e)}async people_list(e){return this.client.request(C.CHANGES.PEOPLE_LIST,e)}async tv_list(e){return this.client.request(C.CHANGES.TV_LIST,e)}},O=class extends T{companyPath(e){return`${C.COMPANIES.DETAILS}/${e}`}async details(e){let t=this.companyPath(e.company_id);return this.client.request(t)}async alternative_names(e){let t=`${this.companyPath(e.company_id)}${C.COMPANIES.ALTERNATIVE_NAMES}`;return this.client.request(t)}async images(e){let{company_id:t,...n}=e,r=`${this.companyPath(t)}${C.COMPANIES.IMAGES}`;return this.client.request(r,this.injectImageLanguage(this.withLanguage(n)??n))}},k=class extends T{creditPath(e){return`${C.CREDITS.DETAILS}/${e}`}async details(e){let{credit_id:t,...n}=e,r=this.creditPath(t);return this.client.request(r,this.withLanguage(n))}},A=class extends T{collectionPath(e){return`${C.COLLECTIONS.DETAILS}/${e}`}async details(e){let{language:t=this.defaultOptions.language,collection_id:n}=e,r=this.collectionPath(n);return this.client.request(r,{language:t})}async images(e){let{collection_id:t,...n}=e,r=`${this.collectionPath(t)}${C.COLLECTIONS.IMAGES}`;return this.client.request(r,this.injectImageLanguage(this.withLanguage(n)??n))}async translations(e){let t=`${this.collectionPath(e.collection_id)}${C.COLLECTIONS.TRANSLATIONS}`;return this.client.request(t)}},j=class extends T{async details(){return this.client.request(C.CONFIGURATION.DETAILS)}async countries(e){return this.client.request(C.CONFIGURATION.COUNTRIES,this.withLanguage(e))}async jobs(){return this.client.request(C.CONFIGURATION.JOBS)}async languages(){return this.client.request(C.CONFIGURATION.LANGUAGES)}async primary_translations(){return this.client.request(C.CONFIGURATION.PRIMARY_TRANSLATIONS)}async timezones(){return this.client.request(C.CONFIGURATION.TIMEZONES)}},M=class extends T{withMovieDefaults(e){if(!e&&!this.defaultOptions.language&&!this.defaultOptions.region)return;let t=e?.language??this.defaultOptions.language,n=e?.region??this.defaultOptions.region;return{...e,language:t,region:n}}withTVDefaults(e){if(!e&&!this.defaultOptions.language&&!this.defaultOptions.timezone)return;let t=e?.language??this.defaultOptions.language,n=e?.timezone??this.defaultOptions.timezone;return{...e,language:t,timezone:n}}async movie(e={}){return this.client.request(C.DISCOVER.MOVIE,this.withMovieDefaults(e))}async tv(e={}){return this.client.request(C.DISCOVER.TV,this.withTVDefaults(e))}},N=class extends T{async by_id(e){let{external_id:t,...n}=e,r=`${C.FIND}/${encodeURIComponent(t)}`,i=this.withLanguage(n);return this.client.request(r,i)}},he=class extends T{async movie_list(e){return this.client.request(C.GENRES.MOVIE_LIST,this.withLanguage(e))}async tv_list(e){return this.client.request(C.GENRES.TV_LIST,this.withLanguage(e))}},P=class extends T{keywordPath(e){return`${C.KEYWORDS.DETAILS}/${e}`}async details(e){let t=this.keywordPath(e.keyword_id);return this.client.request(t)}async movies(e){let{keyword_id:t,...n}=e,r=`${this.keywordPath(t)}${C.KEYWORDS.MOVIES}`,i=this.withLanguage(n);return this.client.request(r,i)}},F=class extends T{withDefaults(e){let{language:t=this.defaultOptions.language,region:n=this.defaultOptions.region,...r}=e;return{language:t,region:n,...r}}fetch_movie_list(e,t={}){return this.client.request(C.MOVIES.DETAILS+e,this.withDefaults(t))}async now_playing(e={}){return this.fetch_movie_list(C.MOVIES.NOW_PLAYING,e)}async popular(e={}){return this.fetch_movie_list(C.MOVIES.POPULAR,e)}async top_rated(e={}){return this.fetch_movie_list(C.MOVIES.TOP_RATED,e)}async upcoming(e={}){return this.fetch_movie_list(C.MOVIES.UPCOMING,e)}},I=class extends T{moviePath(e){return`${C.MOVIES.DETAILS}/${e}`}movieSubPath(e,t){return`${this.moviePath(e)}${t}`}async details(e){let{language:t=this.defaultOptions.language,movie_id:n,append_to_response:r}=e,i=this.moviePath(n);return this.client.request(i,{language:t,append_to_response:r})}async alternative_titles(e){let{movie_id:t,...n}=e,r=this.movieSubPath(t,C.MOVIES.ALTERNATIVE_TITLES);return this.client.request(r,n)}async credits(e){let{movie_id:t,language:n=this.defaultOptions.language,...r}=e,i=this.movieSubPath(t,C.MOVIES.CREDITS);return this.client.request(i,{language:n,...r})}async external_ids(e){let t=this.movieSubPath(e.movie_id,C.MOVIES.EXTERNAL_IDS);return this.client.request(t)}async keywords(e){let t=this.movieSubPath(e.movie_id,C.MOVIES.KEYWORDS);return this.client.request(t)}async changes(e){let{movie_id:t,...n}=e,r=this.movieSubPath(t,C.MOVIES.CHANGES);return this.client.request(r,n)}async images(e){let{movie_id:t,language:n=this.defaultOptions.language,...r}=e,i=this.movieSubPath(t,C.MOVIES.IMAGES);return this.client.request(i,this.injectImageLanguage({language:n,...r}))}async latest(){let e=`${C.MOVIES.DETAILS}${C.MOVIES.LATEST}`;return this.client.request(e)}async recommendations(e){let{movie_id:t,language:n=this.defaultOptions.language,...r}=e,i=this.movieSubPath(t,C.MOVIES.RECOMMENDATIONS);return this.client.request(i,{language:n,...r})}async release_dates(e){let t=this.movieSubPath(e.movie_id,C.MOVIES.RELEASE_DATES);return this.client.request(t)}async reviews(e){let{movie_id:t,language:n=this.defaultOptions.language,...r}=e,i=this.movieSubPath(t,C.MOVIES.REVIEWS);return this.client.request(i,{language:n,...r})}async similar(e){let{movie_id:t,language:n=this.defaultOptions.language,...r}=e,i=this.movieSubPath(t,C.MOVIES.SIMILAR);return this.client.request(i,{language:n,...r})}async translations(e){let t=this.movieSubPath(e.movie_id,C.MOVIES.TRANSLATIONS);return this.client.request(t)}async videos(e){let{movie_id:t,language:n=this.defaultOptions.language,...r}=e,i=this.movieSubPath(t,C.MOVIES.VIDEOS);return this.client.request(i,{language:n,...r})}async watch_providers(e){let t=this.movieSubPath(e.movie_id,C.MOVIES.WATCH_PROVIDERS);return this.client.request(t)}},L=class extends T{async collections(e){return this.client.request(C.SEARCH.COLLECTION,this.applyDefaults(e))}async movies(e){return this.client.request(C.SEARCH.MOVIE,this.applyDefaults(e))}async company(e){return this.client.request(C.SEARCH.COMPANY,this.applyDefaults(e))}async keyword(e){return this.client.request(C.SEARCH.KEYWORD,this.applyDefaults(e))}async person(e){return this.client.request(C.SEARCH.PERSON,this.applyDefaults(e))}async tv_series(e){return this.client.request(C.SEARCH.TV,this.applyDefaults(e))}async multi(e){return this.client.request(C.SEARCH.MULTI,this.applyDefaults(e))}},R=class extends T{seriesPath(e){return`${C.TV_SERIES.DETAILS}/${e}`}seriesSubPath(e,t){return`${this.seriesPath(e)}${t}`}async details(e){let{language:t=this.defaultOptions.language,series_id:n,...r}=e,i=this.seriesPath(n);return this.client.request(i,{language:t,...r})}async aggregate_credits(e){let{language:t=this.defaultOptions.language,series_id:n,...r}=e,i=this.seriesSubPath(n,C.TV_SERIES.AGGREGATE_CREDITS);return this.client.request(i,{language:t,...r})}async alternative_titles(e){let t=this.seriesSubPath(e.series_id,C.TV_SERIES.ALTERNATIVE_TITLES);return this.client.request(t)}async changes(e){let{series_id:t,...n}=e,r=this.seriesSubPath(t,C.TV_SERIES.CHANGES);return this.client.request(r,{...n})}async content_ratings(e){let t=this.seriesSubPath(e.series_id,C.TV_SERIES.CONTENT_RATINGS);return this.client.request(t)}async credits(e){let{language:t=this.defaultOptions.language,series_id:n,...r}=e,i=this.seriesSubPath(n,C.TV_SERIES.CREDITS);return this.client.request(i,{language:t,...r})}async episode_groups(e){let t=this.seriesSubPath(e.series_id,C.TV_SERIES.EPISODE_GROUPS);return this.client.request(t)}async external_ids(e){let t=this.seriesSubPath(e.series_id,C.TV_SERIES.EXTERNAL_IDS);return this.client.request(t)}async images(e){let{language:t=this.defaultOptions.language,series_id:n,...r}=e,i=this.seriesSubPath(n,C.TV_SERIES.IMAGES);return this.client.request(i,this.injectImageLanguage({language:t,...r}))}async keywords(e){let t=this.seriesSubPath(e.series_id,C.TV_SERIES.KEYWORDS);return this.client.request(t)}async latest(){let e=`${C.TV_SERIES.DETAILS}${C.TV_SERIES.LATEST}`;return this.client.request(e)}async lists(e){let{language:t=this.defaultOptions.language,series_id:n,...r}=e,i=this.seriesSubPath(n,C.TV_SERIES.LISTS);return this.client.request(i,{language:t,...r})}async recommendations(e){let{language:t=this.defaultOptions.language,series_id:n,...r}=e,i=this.seriesSubPath(n,C.TV_SERIES.RECOMMENDATIONS);return this.client.request(i,{language:t,...r})}async reviews(e){let{language:t=this.defaultOptions.language,series_id:n,...r}=e,i=this.seriesSubPath(n,C.TV_SERIES.REVIEWS);return this.client.request(i,{language:t,...r})}async screened_theatrically(e){let t=this.seriesSubPath(e.series_id,C.TV_SERIES.SCREENED_THEATRICALLY);return this.client.request(t)}async similar(e){let{language:t=this.defaultOptions.language,series_id:n,...r}=e,i=this.seriesSubPath(n,C.TV_SERIES.SIMILAR);return this.client.request(i,{language:t,...r})}async translations(e){let t=this.seriesSubPath(e.series_id,C.TV_SERIES.TRANSLATIONS);return this.client.request(t)}async videos(e){let t=this.seriesSubPath(e.series_id,C.TV_SERIES.VIDEOS);return this.client.request(t)}async watch_providers(e){let t=this.seriesSubPath(e.series_id,C.TV_SERIES.WATCH_PROVIDERS);return this.client.request(t)}},z=class extends T{withDefaults(e){let{language:t=this.defaultOptions.language,timezone:n=this.defaultOptions.timezone,...r}=e;return{language:t,timezone:n,...r}}fetch_tv_series_list(e,t={}){return this.client.request(C.TV_SERIES.DETAILS+e,this.withDefaults(t))}async airing_today(e={}){return this.fetch_tv_series_list(C.TV_SERIES.AIRING_TODAY,e)}async on_the_air(e={}){return this.fetch_tv_series_list(C.TV_SERIES.ON_THE_AIR,e)}async popular(e={}){return this.fetch_tv_series_list(C.TV_SERIES.POPULAR,e)}async top_rated(e={}){return this.fetch_tv_series_list(C.TV_SERIES.TOP_RATED,e)}},B=class extends T{async movie_providers(e){let t=e?.language??this.defaultOptions.language,n=t===void 0?e:{...e,language:t};return this.client.request(C.WATCH_PROVIDERS.MOVIE,n)}async tv_providers(e){let t=e?.language??this.defaultOptions.language,n=t===void 0?e:{...e,language:t};return this.client.request(C.WATCH_PROVIDERS.TV,n)}async available_regions(e){let t=e?.language??this.defaultOptions.language,n=t===void 0?e:{...e,language:t};return this.client.request(C.WATCH_PROVIDERS.REGIONS,n)}},V=class extends T{networkPath(e){return`${C.NETWORKS.DETAILS}/${e}`}async details(e){let t=this.networkPath(e.network_id);return this.client.request(t)}async alternative_names(e){let t=`${this.networkPath(e.network_id)}${C.NETWORKS.ALTERNATIVE_NAMES}`;return this.client.request(t)}async images(e){let t=`${this.networkPath(e.network_id)}${C.NETWORKS.IMAGES}`;return this.client.request(t)}},H=class extends T{episodePath(e){return`${C.TV_SERIES.DETAILS}/${e.series_id}${C.TV_SEASONS.DETAILS}/${e.season_number}${C.TV_EPISODES.DETAILS}/${e.episode_number}`}episodeSubPath(e,t){return`${this.episodePath(e)}${t}`}async details(e){let{language:t=this.defaultOptions.language,append_to_response:n,...r}=e,i=this.episodePath(r);return this.client.request(i,{language:t,append_to_response:n})}async changes(e){let t=`${C.TV_SERIES.DETAILS}${C.TV_EPISODES.DETAILS}/${e.episode_id}${C.TV_EPISODES.CHANGES}`;return this.client.request(t)}async credits(e){let{language:t=this.defaultOptions.language,...n}=e,r=this.episodeSubPath(n,C.TV_EPISODES.CREDITS);return this.client.request(r,{language:t})}async external_ids(e){let t=this.episodeSubPath(e,C.TV_EPISODES.EXTERNAL_IDS);return this.client.request(t)}async images(e){let{language:t=this.defaultOptions.language,include_image_language:n,...r}=e,i=this.episodeSubPath(r,C.TV_EPISODES.IMAGES);return this.client.request(i,this.injectImageLanguage({language:t,include_image_language:n}))}async translations(e){let t=this.episodeSubPath(e,C.TV_EPISODES.TRANSLATIONS);return this.client.request(t)}async videos(e){let t=this.episodeSubPath(e,C.TV_EPISODES.VIDEOS);return this.client.request(t)}},U=class extends T{async details(e){let t=`${C.TV_EPISODE_GROUPS.DETAILS}/${e.episode_group_id}`;return this.client.request(t)}},W=class extends T{seasonPath(e){return`${C.TV_SERIES.DETAILS}/${e.series_id}${C.TV_SEASONS.DETAILS}/${e.season_number}`}seasonSubPath(e,t){return`${this.seasonPath(e)}${t}`}async details(e){let{language:t=this.defaultOptions.language,append_to_response:n,...r}=e,i=this.seasonPath(r);return this.client.request(i,{language:t,append_to_response:n})}async aggregate_credits(e){let{language:t=this.defaultOptions.language,...n}=e,r=this.seasonSubPath(n,C.TV_SEASONS.AGGREGATE_CREDITS);return this.client.request(r,{language:t})}async changes(e){let{season_id:t,...n}=e,r=`${C.TV_SERIES.DETAILS}${C.TV_SEASONS.DETAILS}/${t}${C.TV_SEASONS.CHANGES}`;return this.client.request(r,{...n})}async credits(e){let{language:t=this.defaultOptions.language,...n}=e,r=this.seasonSubPath(n,C.TV_SEASONS.CREDITS);return this.client.request(r,{language:t})}async external_ids(e){let t=this.seasonSubPath(e,C.TV_SEASONS.EXTERNAL_IDS);return this.client.request(t)}async images(e){let{language:t=this.defaultOptions.language,include_image_language:n,...r}=e,i=this.seasonSubPath(r,C.TV_SEASONS.IMAGES);return this.client.request(i,this.injectImageLanguage({language:t,include_image_language:n}))}async translations(e){let t=this.seasonSubPath(e,C.TV_SEASONS.TRANSLATIONS);return this.client.request(t)}async videos(e){let{language:t=this.defaultOptions.language,include_video_language:n,...r}=e,i=this.seasonSubPath(r,C.TV_SEASONS.VIDEOS);return this.client.request(i,{language:t,include_video_language:n})}async watch_providers(e){let{language:t=this.defaultOptions.language,...n}=e,r=this.seasonSubPath(n,C.TV_SEASONS.WATCH_PROVIDERS);return this.client.request(r,{language:t})}},G=class extends T{async all(e){let{time_window:t,language:n=this.defaultOptions.language}=e;return this.client.request(`${C.TRENDING.ALL}/${t}`,{language:n})}async movies(e){let{time_window:t,language:n=this.defaultOptions.language}=e;return this.client.request(`${C.TRENDING.MOVIE}/${t}`,{language:n})}async tv(e){let{time_window:t,language:n=this.defaultOptions.language}=e;return this.client.request(`${C.TRENDING.TV}/${t}`,{language:n})}async people(e){let{time_window:t,language:n=this.defaultOptions.language}=e;return this.client.request(`${C.TRENDING.PERSON}/${t}`,{language:n})}},K=class extends T{async details(e){return this.client.request(`${C.REVIEWS.DETAILS}/${e.review_id}`)}},q=class extends T{async popular(e={}){return this.client.request(C.PEOPLE_LISTS.POPULAR,this.withLanguage(e))}},J=class extends T{personPath(e){return`${C.PEOPLE.DETAILS}/${e}`}personSubPath(e,t){return`${this.personPath(e)}${t}`}async details(e){let{language:t=this.defaultOptions.language,person_id:n,...r}=e;return this.client.request(this.personPath(n),{language:t,...r})}async changes(e){let{person_id:t,...n}=e;return this.client.request(this.personSubPath(t,C.PEOPLE.CHANGES),n)}async combined_credits(e){let{language:t=this.defaultOptions.language,person_id:n,...r}=e;return this.client.request(this.personSubPath(n,C.PEOPLE.COMBINED_CREDITS),{language:t,...r})}async external_ids(e){return this.client.request(this.personSubPath(e.person_id,C.PEOPLE.EXTERNAL_IDS))}async images(e){return this.client.request(this.personSubPath(e.person_id,C.PEOPLE.IMAGES))}async latest(){return this.client.request(`${C.PEOPLE.DETAILS}${C.PEOPLE.LATEST}`)}async movie_credits(e){let{language:t=this.defaultOptions.language,person_id:n,...r}=e;return this.client.request(this.personSubPath(n,C.PEOPLE.MOVIE_CREDITS),{language:t,...r})}async tagged_images(e){let{person_id:t,...n}=e;return this.client.request(this.personSubPath(t,C.PEOPLE.TAGGED_IMAGES),n)}async translations(e){return this.client.request(this.personSubPath(e.person_id,C.PEOPLE.TRANSLATIONS))}async tv_credits(e){let{language:t=this.defaultOptions.language,person_id:n,...r}=e;return this.client.request(this.personSubPath(n,C.PEOPLE.TV_CREDITS),{language:t,...r})}},Y=class extends T{accountPath(e){return`${C.ACCOUNT.DETAILS}/${e}`}accountSubPath(e,t){return`${this.accountPath(e)}${t}`}async details(e){let{account_id:t,...n}=e;return this.client.request(this.accountPath(t),n)}async add_favorite(e,t){let{account_id:n,...r}=e;return this.client.mutate(`POST`,this.accountSubPath(n,C.ACCOUNT.ADD_FAVORITE),t,r)}async add_to_watchlist(e,t){let{account_id:n,...r}=e;return this.client.mutate(`POST`,this.accountSubPath(n,C.ACCOUNT.ADD_TO_WATCHLIST),t,r)}async favorite_movies(e){let{account_id:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(this.accountSubPath(t,C.ACCOUNT.FAVORITE_MOVIES),{language:n,...r})}async favorite_tv(e){let{account_id:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(this.accountSubPath(t,C.ACCOUNT.FAVORITE_TV),{language:n,...r})}async watchlist_movies(e){let{account_id:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(this.accountSubPath(t,C.ACCOUNT.WATCHLIST_MOVIES),{language:n,...r})}async watchlist_tv(e){let{account_id:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(this.accountSubPath(t,C.ACCOUNT.WATCHLIST_TV),{language:n,...r})}async rated_movies(e){let{account_id:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(this.accountSubPath(t,C.ACCOUNT.RATED_MOVIES),{language:n,...r})}async rated_tv(e){let{account_id:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(this.accountSubPath(t,C.ACCOUNT.RATED_TV),{language:n,...r})}async rated_tv_episodes(e){let{account_id:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(this.accountSubPath(t,C.ACCOUNT.RATED_TV_EPISODES),{language:n,...r})}async lists(e){let{account_id:t,...n}=e;return this.client.request(this.accountSubPath(t,C.ACCOUNT.LISTS),n)}},X=class extends T{async validate_key(){return this.client.request(C.AUTHENTICATION.VALIDATE)}async create_guest_session(){return this.client.request(C.AUTHENTICATION.GUEST_SESSION)}async create_request_token(){return this.client.request(C.AUTHENTICATION.REQUEST_TOKEN)}async create_session(e){return this.client.mutate(`POST`,C.AUTHENTICATION.CREATE_SESSION,e)}async create_session_with_login(e){return this.client.mutate(`POST`,C.AUTHENTICATION.CREATE_SESSION_WITH_LOGIN,e)}async delete_session(e){return this.client.mutate(`DELETE`,C.AUTHENTICATION.DELETE_SESSION,e)}},Z=class extends T{guestSessionPath(e){return`${C.GUEST_SESSIONS.DETAILS}/${e}`}guestSessionSubPath(e,t){return`${this.guestSessionPath(e)}${t}`}async rated_movies(e){let{guest_session_id:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(this.guestSessionSubPath(t,C.GUEST_SESSIONS.RATED_MOVIES),{language:n,...r})}async rated_tv(e){let{guest_session_id:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(this.guestSessionSubPath(t,C.GUEST_SESSIONS.RATED_TV),{language:n,...r})}async rated_tv_episodes(e){let{guest_session_id:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(this.guestSessionSubPath(t,C.GUEST_SESSIONS.RATED_TV_EPISODES),{language:n,...r})}},Q=class extends T{listPath(e){return`${C.LISTS.DETAILS}/${e}`}listSubPath(e,t){return`${this.listPath(e)}${t}`}async details(e){let{list_id:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(this.listPath(t),{language:n,...r})}async create(e,t){return this.client.mutate(`POST`,C.LISTS.DETAILS,t,e)}async delete(e){let{list_id:t,...n}=e;return this.client.mutate(`DELETE`,this.listPath(t),void 0,n)}async add_movie(e,t){let{list_id:n,...r}=e;return this.client.mutate(`POST`,this.listSubPath(n,C.LISTS.ADD_ITEM),t,r)}async remove_movie(e,t){let{list_id:n,...r}=e;return this.client.mutate(`POST`,this.listSubPath(n,C.LISTS.REMOVE_ITEM),t,r)}async check_item_status(e){let{list_id:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(this.listSubPath(t,C.LISTS.ITEM_STATUS),{language:n,...r})}async clear(e){let{list_id:t,...n}=e;return this.client.mutate(`POST`,this.listSubPath(t,C.LISTS.CLEAR),void 0,n)}},ge=class extends T{async create_request_token(e){return this.client.mutate(`POST`,w.AUTH.REQUEST_TOKEN,e??{})}async create_access_token(e){return this.client.mutate(`POST`,w.AUTH.ACCESS_TOKEN,e)}async delete_access_token(e){return this.client.mutate(`DELETE`,w.AUTH.ACCESS_TOKEN,e)}},_e=class extends T{},ve=class extends T{listPath(e){return`${w.LISTS.DETAILS}/${e}`}async create(e){return this.client.mutate(`POST`,w.LISTS.DETAILS,e)}async details({list_id:e,...t}){return this.client.request(this.listPath(e),this.withLanguage(t))}async update({list_id:e,...t}){return this.client.mutate(`PUT`,this.listPath(e),t)}async delete({list_id:e}){return this.client.mutate(`DELETE`,this.listPath(e),{})}async add_items(e,t){return this.client.mutate(`POST`,`${this.listPath(e)}${w.LISTS.ITEMS}`,t)}async update_items(e,t){return this.client.mutate(`PUT`,`${this.listPath(e)}${w.LISTS.ITEMS}`,t)}async remove_items(e,t){return this.client.mutate(`DELETE`,`${this.listPath(e)}${w.LISTS.ITEMS}`,t)}async item_status({list_id:e,...t}){return this.client.request(`${this.listPath(e)}${w.LISTS.ITEM_STATUS}`,t)}async clear(e){return this.client.mutate(`GET`,`${this.listPath(e)}${w.LISTS.CLEAR}`)}},$=class{client;auth;account;lists;constructor(e,t={}){if(!e)throw Error(v.NO_ACCESS_TOKEN);this.client=new S(e,{...t,version:4}),this.auth=new ge(this.client,t),this.account=new _e(this.client,t),this.lists=new ve(this.client,t)}},ye=class{client;accessToken;options;movies;movie_lists;search;images;configuration;genres;keywords;tv_lists;tv_series;watch_providers;certifications;changes;companies;credits;collections;discover;find;networks;tv_episodes;tv_episode_groups;tv_seasons;trending;reviews;people_lists;people;account;authentication;guest_sessions;lists;get v4(){if(!m(this.accessToken))throw Error(v.V4_REQUIRES_JWT);return this._v4||=new $(this.accessToken,this.options),this._v4}_v4;get cache(){if(!this.options.cache)return;let e=this.client;return{clear(){e.clearCache()},invalidate(t,n){return e.invalidateCache(t,n)},get size(){return e.cacheSize}}}constructor(e,t={}){if(!e)throw Error(v.NO_ACCESS_TOKEN);this.accessToken=e,this.options=t,this.client=new S(e,{logger:t.logger,deduplication:t.deduplication,images:t.images,rate_limit:t.rate_limit,cache:t.cache,interceptors:t.interceptors}),this.movies=new I(this.client,this.options),this.movie_lists=new F(this.client,this.options),this.search=new L(this.client,this.options),this.images=new x(this.options.images),this.configuration=new j(this.client,this.options),this.genres=new he(this.client,this.options),this.keywords=new P(this.client,this.options),this.tv_lists=new z(this.client,this.options),this.tv_series=new R(this.client,this.options),this.watch_providers=new B(this.client,this.options),this.certifications=new E(this.client,this.options),this.changes=new D(this.client,this.options),this.companies=new O(this.client,this.options),this.credits=new k(this.client,this.options),this.collections=new A(this.client,this.options),this.discover=new M(this.client,this.options),this.find=new N(this.client,this.options),this.networks=new V(this.client,this.options),this.tv_episodes=new H(this.client,this.options),this.tv_episode_groups=new U(this.client,this.options),this.tv_seasons=new W(this.client,this.options),this.trending=new G(this.client,this.options),this.reviews=new K(this.client,this.options),this.people_lists=new q(this.client,this.options),this.people=new J(this.client,this.options),this.account=new Y(this.client,this.options),this.authentication=new X(this.client,this.options),this.guest_sessions=new Z(this.client,this.options),this.lists=new Q(this.client,this.options)}};const be=[{iso_3166_1:`AD`,english_name:`Andorra`,native_name:`Andorra`},{iso_3166_1:`AE`,english_name:`United Arab Emirates`,native_name:`United Arab Emirates`},{iso_3166_1:`AF`,english_name:`Afghanistan`,native_name:`Afghanistan`},{iso_3166_1:`AG`,english_name:`Antigua and Barbuda`,native_name:`Antigua & Barbuda`},{iso_3166_1:`AI`,english_name:`Anguilla`,native_name:`Anguilla`},{iso_3166_1:`AL`,english_name:`Albania`,native_name:`Albania`},{iso_3166_1:`AM`,english_name:`Armenia`,native_name:`Armenia`},{iso_3166_1:`AN`,english_name:`Netherlands Antilles`,native_name:`Netherlands Antilles`},{iso_3166_1:`AO`,english_name:`Angola`,native_name:`Angola`},{iso_3166_1:`AQ`,english_name:`Antarctica`,native_name:`Antarctica`},{iso_3166_1:`AR`,english_name:`Argentina`,native_name:`Argentina`},{iso_3166_1:`AS`,english_name:`American Samoa`,native_name:`American Samoa`},{iso_3166_1:`AT`,english_name:`Austria`,native_name:`Austria`},{iso_3166_1:`AU`,english_name:`Australia`,native_name:`Australia`},{iso_3166_1:`AW`,english_name:`Aruba`,native_name:`Aruba`},{iso_3166_1:`AZ`,english_name:`Azerbaijan`,native_name:`Azerbaijan`},{iso_3166_1:`BA`,english_name:`Bosnia and Herzegovina`,native_name:`Bosnia & Herzegovina`},{iso_3166_1:`BB`,english_name:`Barbados`,native_name:`Barbados`},{iso_3166_1:`BD`,english_name:`Bangladesh`,native_name:`Bangladesh`},{iso_3166_1:`BE`,english_name:`Belgium`,native_name:`Belgium`},{iso_3166_1:`BF`,english_name:`Burkina Faso`,native_name:`Burkina Faso`},{iso_3166_1:`BG`,english_name:`Bulgaria`,native_name:`Bulgaria`},{iso_3166_1:`BH`,english_name:`Bahrain`,native_name:`Bahrain`},{iso_3166_1:`BI`,english_name:`Burundi`,native_name:`Burundi`},{iso_3166_1:`BJ`,english_name:`Benin`,native_name:`Benin`},{iso_3166_1:`BM`,english_name:`Bermuda`,native_name:`Bermuda`},{iso_3166_1:`BN`,english_name:`Brunei Darussalam`,native_name:`Brunei`},{iso_3166_1:`BO`,english_name:`Bolivia`,native_name:`Bolivia`},{iso_3166_1:`BR`,english_name:`Brazil`,native_name:`Brazil`},{iso_3166_1:`BS`,english_name:`Bahamas`,native_name:`Bahamas`},{iso_3166_1:`BT`,english_name:`Bhutan`,native_name:`Bhutan`},{iso_3166_1:`BU`,english_name:`Burma`,native_name:`Burma`},{iso_3166_1:`BV`,english_name:`Bouvet Island`,native_name:`Bouvet Island`},{iso_3166_1:`BW`,english_name:`Botswana`,native_name:`Botswana`},{iso_3166_1:`BY`,english_name:`Belarus`,native_name:`Belarus`},{iso_3166_1:`BZ`,english_name:`Belize`,native_name:`Belize`},{iso_3166_1:`CA`,english_name:`Canada`,native_name:`Canada`},{iso_3166_1:`CC`,english_name:`Cocos Islands`,native_name:`Cocos (Keeling) Islands`},{iso_3166_1:`CD`,english_name:`Congo`,native_name:`Democratic Republic of the Congo (Kinshasa)`},{iso_3166_1:`CF`,english_name:`Central African Republic`,native_name:`Central African Republic`},{iso_3166_1:`CG`,english_name:`Congo`,native_name:`Republic of the Congo (Brazzaville)`},{iso_3166_1:`CH`,english_name:`Switzerland`,native_name:`Switzerland`},{iso_3166_1:`CI`,english_name:`Cote D'Ivoire`,native_name:`Côte d’Ivoire`},{iso_3166_1:`CK`,english_name:`Cook Islands`,native_name:`Cook Islands`},{iso_3166_1:`CL`,english_name:`Chile`,native_name:`Chile`},{iso_3166_1:`CM`,english_name:`Cameroon`,native_name:`Cameroon`},{iso_3166_1:`CN`,english_name:`China`,native_name:`China`},{iso_3166_1:`CO`,english_name:`Colombia`,native_name:`Colombia`},{iso_3166_1:`CR`,english_name:`Costa Rica`,native_name:`Costa Rica`},{iso_3166_1:`CS`,english_name:`Serbia and Montenegro`,native_name:`Serbia and Montenegro`},{iso_3166_1:`CU`,english_name:`Cuba`,native_name:`Cuba`},{iso_3166_1:`CV`,english_name:`Cape Verde`,native_name:`Cape Verde`},{iso_3166_1:`CX`,english_name:`Christmas Island`,native_name:`Christmas Island`},{iso_3166_1:`CY`,english_name:`Cyprus`,native_name:`Cyprus`},{iso_3166_1:`CZ`,english_name:`Czech Republic`,native_name:`Czech Republic`},{iso_3166_1:`DE`,english_name:`Germany`,native_name:`Germany`},{iso_3166_1:`DJ`,english_name:`Djibouti`,native_name:`Djibouti`},{iso_3166_1:`DK`,english_name:`Denmark`,native_name:`Denmark`},{iso_3166_1:`DM`,english_name:`Dominica`,native_name:`Dominica`},{iso_3166_1:`DO`,english_name:`Dominican Republic`,native_name:`Dominican Republic`},{iso_3166_1:`DZ`,english_name:`Algeria`,native_name:`Algeria`},{iso_3166_1:`EC`,english_name:`Ecuador`,native_name:`Ecuador`},{iso_3166_1:`EE`,english_name:`Estonia`,native_name:`Estonia`},{iso_3166_1:`EG`,english_name:`Egypt`,native_name:`Egypt`},{iso_3166_1:`EH`,english_name:`Western Sahara`,native_name:`Western Sahara`},{iso_3166_1:`ER`,english_name:`Eritrea`,native_name:`Eritrea`},{iso_3166_1:`ES`,english_name:`Spain`,native_name:`Spain`},{iso_3166_1:`ET`,english_name:`Ethiopia`,native_name:`Ethiopia`},{iso_3166_1:`FI`,english_name:`Finland`,native_name:`Finland`},{iso_3166_1:`FJ`,english_name:`Fiji`,native_name:`Fiji`},{iso_3166_1:`FK`,english_name:`Falkland Islands`,native_name:`Falkland Islands`},{iso_3166_1:`FM`,english_name:`Micronesia`,native_name:`Micronesia`},{iso_3166_1:`FO`,english_name:`Faeroe Islands`,native_name:`Faroe Islands`},{iso_3166_1:`FR`,english_name:`France`,native_name:`France`},{iso_3166_1:`GA`,english_name:`Gabon`,native_name:`Gabon`},{iso_3166_1:`GB`,english_name:`United Kingdom`,native_name:`United Kingdom`},{iso_3166_1:`GD`,english_name:`Grenada`,native_name:`Grenada`},{iso_3166_1:`GE`,english_name:`Georgia`,native_name:`Georgia`},{iso_3166_1:`GF`,english_name:`French Guiana`,native_name:`French Guiana`},{iso_3166_1:`GH`,english_name:`Ghana`,native_name:`Ghana`},{iso_3166_1:`GI`,english_name:`Gibraltar`,native_name:`Gibraltar`},{iso_3166_1:`GL`,english_name:`Greenland`,native_name:`Greenland`},{iso_3166_1:`GM`,english_name:`Gambia`,native_name:`Gambia`},{iso_3166_1:`GN`,english_name:`Guinea`,native_name:`Guinea`},{iso_3166_1:`GP`,english_name:`Guadaloupe`,native_name:`Guadeloupe`},{iso_3166_1:`GQ`,english_name:`Equatorial Guinea`,native_name:`Equatorial Guinea`},{iso_3166_1:`GR`,english_name:`Greece`,native_name:`Greece`},{iso_3166_1:`GS`,english_name:`South Georgia and the South Sandwich Islands`,native_name:`South Georgia & South Sandwich Islands`},{iso_3166_1:`GT`,english_name:`Guatemala`,native_name:`Guatemala`},{iso_3166_1:`GU`,english_name:`Guam`,native_name:`Guam`},{iso_3166_1:`GW`,english_name:`Guinea-Bissau`,native_name:`Guinea-Bissau`},{iso_3166_1:`GY`,english_name:`Guyana`,native_name:`Guyana`},{iso_3166_1:`HK`,english_name:`Hong Kong`,native_name:`Hong Kong SAR China`},{iso_3166_1:`HM`,english_name:`Heard and McDonald Islands`,native_name:`Heard & McDonald Islands`},{iso_3166_1:`HN`,english_name:`Honduras`,native_name:`Honduras`},{iso_3166_1:`HR`,english_name:`Croatia`,native_name:`Croatia`},{iso_3166_1:`HT`,english_name:`Haiti`,native_name:`Haiti`},{iso_3166_1:`HU`,english_name:`Hungary`,native_name:`Hungary`},{iso_3166_1:`ID`,english_name:`Indonesia`,native_name:`Indonesia`},{iso_3166_1:`IE`,english_name:`Ireland`,native_name:`Ireland`},{iso_3166_1:`IL`,english_name:`Israel`,native_name:`Israel`},{iso_3166_1:`IN`,english_name:`India`,native_name:`India`},{iso_3166_1:`IO`,english_name:`British Indian Ocean Territory`,native_name:`British Indian Ocean Territory`},{iso_3166_1:`IQ`,english_name:`Iraq`,native_name:`Iraq`},{iso_3166_1:`IR`,english_name:`Iran`,native_name:`Iran`},{iso_3166_1:`IS`,english_name:`Iceland`,native_name:`Iceland`},{iso_3166_1:`IT`,english_name:`Italy`,native_name:`Italy`},{iso_3166_1:`JM`,english_name:`Jamaica`,native_name:`Jamaica`},{iso_3166_1:`JO`,english_name:`Jordan`,native_name:`Jordan`},{iso_3166_1:`JP`,english_name:`Japan`,native_name:`Japan`},{iso_3166_1:`KE`,english_name:`Kenya`,native_name:`Kenya`},{iso_3166_1:`KG`,english_name:`Kyrgyz Republic`,native_name:`Kyrgyzstan`},{iso_3166_1:`KH`,english_name:`Cambodia`,native_name:`Cambodia`},{iso_3166_1:`KI`,english_name:`Kiribati`,native_name:`Kiribati`},{iso_3166_1:`KM`,english_name:`Comoros`,native_name:`Comoros`},{iso_3166_1:`KN`,english_name:`St. Kitts and Nevis`,native_name:`St. Kitts & Nevis`},{iso_3166_1:`KP`,english_name:`North Korea`,native_name:`North Korea`},{iso_3166_1:`KR`,english_name:`South Korea`,native_name:`South Korea`},{iso_3166_1:`KW`,english_name:`Kuwait`,native_name:`Kuwait`},{iso_3166_1:`KY`,english_name:`Cayman Islands`,native_name:`Cayman Islands`},{iso_3166_1:`KZ`,english_name:`Kazakhstan`,native_name:`Kazakhstan`},{iso_3166_1:`LA`,english_name:`Lao People's Democratic Republic`,native_name:`Laos`},{iso_3166_1:`LB`,english_name:`Lebanon`,native_name:`Lebanon`},{iso_3166_1:`LC`,english_name:`St. Lucia`,native_name:`St. Lucia`},{iso_3166_1:`LI`,english_name:`Liechtenstein`,native_name:`Liechtenstein`},{iso_3166_1:`LK`,english_name:`Sri Lanka`,native_name:`Sri Lanka`},{iso_3166_1:`LR`,english_name:`Liberia`,native_name:`Liberia`},{iso_3166_1:`LS`,english_name:`Lesotho`,native_name:`Lesotho`},{iso_3166_1:`LT`,english_name:`Lithuania`,native_name:`Lithuania`},{iso_3166_1:`LU`,english_name:`Luxembourg`,native_name:`Luxembourg`},{iso_3166_1:`LV`,english_name:`Latvia`,native_name:`Latvia`},{iso_3166_1:`LY`,english_name:`Libyan Arab Jamahiriya`,native_name:`Libya`},{iso_3166_1:`MA`,english_name:`Morocco`,native_name:`Morocco`},{iso_3166_1:`MC`,english_name:`Monaco`,native_name:`Monaco`},{iso_3166_1:`MD`,english_name:`Moldova`,native_name:`Moldova`},{iso_3166_1:`ME`,english_name:`Montenegro`,native_name:`Montenegro`},{iso_3166_1:`MG`,english_name:`Madagascar`,native_name:`Madagascar`},{iso_3166_1:`MH`,english_name:`Marshall Islands`,native_name:`Marshall Islands`},{iso_3166_1:`MK`,english_name:`Macedonia`,native_name:`Macedonia`},{iso_3166_1:`ML`,english_name:`Mali`,native_name:`Mali`},{iso_3166_1:`MM`,english_name:`Myanmar`,native_name:`Myanmar (Burma)`},{iso_3166_1:`MN`,english_name:`Mongolia`,native_name:`Mongolia`},{iso_3166_1:`MO`,english_name:`Macao`,native_name:`Macau SAR China`},{iso_3166_1:`MP`,english_name:`Northern Mariana Islands`,native_name:`Northern Mariana Islands`},{iso_3166_1:`MQ`,english_name:`Martinique`,native_name:`Martinique`},{iso_3166_1:`MR`,english_name:`Mauritania`,native_name:`Mauritania`},{iso_3166_1:`MS`,english_name:`Montserrat`,native_name:`Montserrat`},{iso_3166_1:`MT`,english_name:`Malta`,native_name:`Malta`},{iso_3166_1:`MU`,english_name:`Mauritius`,native_name:`Mauritius`},{iso_3166_1:`MV`,english_name:`Maldives`,native_name:`Maldives`},{iso_3166_1:`MW`,english_name:`Malawi`,native_name:`Malawi`},{iso_3166_1:`MX`,english_name:`Mexico`,native_name:`Mexico`},{iso_3166_1:`MY`,english_name:`Malaysia`,native_name:`Malaysia`},{iso_3166_1:`MZ`,english_name:`Mozambique`,native_name:`Mozambique`},{iso_3166_1:`NA`,english_name:`Namibia`,native_name:`Namibia`},{iso_3166_1:`NC`,english_name:`New Caledonia`,native_name:`New Caledonia`},{iso_3166_1:`NE`,english_name:`Niger`,native_name:`Niger`},{iso_3166_1:`NF`,english_name:`Norfolk Island`,native_name:`Norfolk Island`},{iso_3166_1:`NG`,english_name:`Nigeria`,native_name:`Nigeria`},{iso_3166_1:`NI`,english_name:`Nicaragua`,native_name:`Nicaragua`},{iso_3166_1:`NL`,english_name:`Netherlands`,native_name:`Netherlands`},{iso_3166_1:`NO`,english_name:`Norway`,native_name:`Norway`},{iso_3166_1:`NP`,english_name:`Nepal`,native_name:`Nepal`},{iso_3166_1:`NR`,english_name:`Nauru`,native_name:`Nauru`},{iso_3166_1:`NU`,english_name:`Niue`,native_name:`Niue`},{iso_3166_1:`NZ`,english_name:`New Zealand`,native_name:`New Zealand`},{iso_3166_1:`OM`,english_name:`Oman`,native_name:`Oman`},{iso_3166_1:`PA`,english_name:`Panama`,native_name:`Panama`},{iso_3166_1:`PE`,english_name:`Peru`,native_name:`Peru`},{iso_3166_1:`PF`,english_name:`French Polynesia`,native_name:`French Polynesia`},{iso_3166_1:`PG`,english_name:`Papua New Guinea`,native_name:`Papua New Guinea`},{iso_3166_1:`PH`,english_name:`Philippines`,native_name:`Philippines`},{iso_3166_1:`PK`,english_name:`Pakistan`,native_name:`Pakistan`},{iso_3166_1:`PL`,english_name:`Poland`,native_name:`Poland`},{iso_3166_1:`PM`,english_name:`St. Pierre and Miquelon`,native_name:`St. Pierre & Miquelon`},{iso_3166_1:`PN`,english_name:`Pitcairn Island`,native_name:`Pitcairn Islands`},{iso_3166_1:`PR`,english_name:`Puerto Rico`,native_name:`Puerto Rico`},{iso_3166_1:`PS`,english_name:`Palestinian Territory`,native_name:`Palestinian Territories`},{iso_3166_1:`PT`,english_name:`Portugal`,native_name:`Portugal`},{iso_3166_1:`PW`,english_name:`Palau`,native_name:`Palau`},{iso_3166_1:`PY`,english_name:`Paraguay`,native_name:`Paraguay`},{iso_3166_1:`QA`,english_name:`Qatar`,native_name:`Qatar`},{iso_3166_1:`RE`,english_name:`Reunion`,native_name:`Réunion`},{iso_3166_1:`RO`,english_name:`Romania`,native_name:`Romania`},{iso_3166_1:`RS`,english_name:`Serbia`,native_name:`Serbia`},{iso_3166_1:`RU`,english_name:`Russia`,native_name:`Russia`},{iso_3166_1:`RW`,english_name:`Rwanda`,native_name:`Rwanda`},{iso_3166_1:`SA`,english_name:`Saudi Arabia`,native_name:`Saudi Arabia`},{iso_3166_1:`SB`,english_name:`Solomon Islands`,native_name:`Solomon Islands`},{iso_3166_1:`SC`,english_name:`Seychelles`,native_name:`Seychelles`},{iso_3166_1:`SD`,english_name:`Sudan`,native_name:`Sudan`},{iso_3166_1:`SE`,english_name:`Sweden`,native_name:`Sweden`},{iso_3166_1:`SG`,english_name:`Singapore`,native_name:`Singapore`},{iso_3166_1:`SH`,english_name:`St. Helena`,native_name:`St. Helena`},{iso_3166_1:`SI`,english_name:`Slovenia`,native_name:`Slovenia`},{iso_3166_1:`SJ`,english_name:`Svalbard & Jan Mayen Islands`,native_name:`Svalbard & Jan Mayen`},{iso_3166_1:`SK`,english_name:`Slovakia`,native_name:`Slovakia`},{iso_3166_1:`SL`,english_name:`Sierra Leone`,native_name:`Sierra Leone`},{iso_3166_1:`SM`,english_name:`San Marino`,native_name:`San Marino`},{iso_3166_1:`SN`,english_name:`Senegal`,native_name:`Senegal`},{iso_3166_1:`SO`,english_name:`Somalia`,native_name:`Somalia`},{iso_3166_1:`SR`,english_name:`Suriname`,native_name:`Suriname`},{iso_3166_1:`SS`,english_name:`South Sudan`,native_name:`South Sudan`},{iso_3166_1:`ST`,english_name:`Sao Tome and Principe`,native_name:`São Tomé & Príncipe`},{iso_3166_1:`SU`,english_name:`Soviet Union`,native_name:`Soviet Union`},{iso_3166_1:`SV`,english_name:`El Salvador`,native_name:`El Salvador`},{iso_3166_1:`SY`,english_name:`Syrian Arab Republic`,native_name:`Syria`},{iso_3166_1:`SZ`,english_name:`Swaziland`,native_name:`Eswatini (Swaziland)`},{iso_3166_1:`TC`,english_name:`Turks and Caicos Islands`,native_name:`Turks & Caicos Islands`},{iso_3166_1:`TD`,english_name:`Chad`,native_name:`Chad`},{iso_3166_1:`TF`,english_name:`French Southern Territories`,native_name:`French Southern Territories`},{iso_3166_1:`TG`,english_name:`Togo`,native_name:`Togo`},{iso_3166_1:`TH`,english_name:`Thailand`,native_name:`Thailand`},{iso_3166_1:`TJ`,english_name:`Tajikistan`,native_name:`Tajikistan`},{iso_3166_1:`TK`,english_name:`Tokelau`,native_name:`Tokelau`},{iso_3166_1:`TL`,english_name:`Timor-Leste`,native_name:`Timor-Leste`},{iso_3166_1:`TM`,english_name:`Turkmenistan`,native_name:`Turkmenistan`},{iso_3166_1:`TN`,english_name:`Tunisia`,native_name:`Tunisia`},{iso_3166_1:`TO`,english_name:`Tonga`,native_name:`Tonga`},{iso_3166_1:`TP`,english_name:`East Timor`,native_name:`East Timor`},{iso_3166_1:`TR`,english_name:`Turkey`,native_name:`Turkey`},{iso_3166_1:`TT`,english_name:`Trinidad and Tobago`,native_name:`Trinidad & Tobago`},{iso_3166_1:`TV`,english_name:`Tuvalu`,native_name:`Tuvalu`},{iso_3166_1:`TW`,english_name:`Taiwan`,native_name:`Taiwan`},{iso_3166_1:`TZ`,english_name:`Tanzania`,native_name:`Tanzania`},{iso_3166_1:`UA`,english_name:`Ukraine`,native_name:`Ukraine`},{iso_3166_1:`UG`,english_name:`Uganda`,native_name:`Uganda`},{iso_3166_1:`UM`,english_name:`United States Minor Outlying Islands`,native_name:`U.S. Outlying Islands`},{iso_3166_1:`US`,english_name:`United States of America`,native_name:`United States`},{iso_3166_1:`UY`,english_name:`Uruguay`,native_name:`Uruguay`},{iso_3166_1:`UZ`,english_name:`Uzbekistan`,native_name:`Uzbekistan`},{iso_3166_1:`VA`,english_name:`Holy See`,native_name:`Vatican City`},{iso_3166_1:`VC`,english_name:`St. Vincent and the Grenadines`,native_name:`St. Vincent & Grenadines`},{iso_3166_1:`VE`,english_name:`Venezuela`,native_name:`Venezuela`},{iso_3166_1:`VG`,english_name:`British Virgin Islands`,native_name:`British Virgin Islands`},{iso_3166_1:`VI`,english_name:`US Virgin Islands`,native_name:`U.S. Virgin Islands`},{iso_3166_1:`VN`,english_name:`Vietnam`,native_name:`Vietnam`},{iso_3166_1:`VU`,english_name:`Vanuatu`,native_name:`Vanuatu`},{iso_3166_1:`WF`,english_name:`Wallis and Futuna Islands`,native_name:`Wallis & Futuna`},{iso_3166_1:`WS`,english_name:`Samoa`,native_name:`Samoa`},{iso_3166_1:`XC`,english_name:`Czechoslovakia`,native_name:`Czechoslovakia`},{iso_3166_1:`XG`,english_name:`East Germany`,native_name:`East Germany`},{iso_3166_1:`XI`,english_name:`Northern Ireland`,native_name:`Northern Ireland`},{iso_3166_1:`XK`,english_name:`Kosovo`,native_name:`Kosovo`},{iso_3166_1:`YE`,english_name:`Yemen`,native_name:`Yemen`},{iso_3166_1:`YT`,english_name:`Mayotte`,native_name:`Mayotte`},{iso_3166_1:`YU`,english_name:`Yugoslavia`,native_name:`Yugoslavia`},{iso_3166_1:`ZA`,english_name:`South Africa`,native_name:`South Africa`},{iso_3166_1:`ZM`,english_name:`Zambia`,native_name:`Zambia`},{iso_3166_1:`ZR`,english_name:`Zaire`,native_name:`Zaire`},{iso_3166_1:`ZW`,english_name:`Zimbabwe`,native_name:`Zimbabwe`}];let xe=function(e){return e[e.ReturningSeries=0]=`ReturningSeries`,e[e.Planned=1]=`Planned`,e[e.InProduction=2]=`InProduction`,e[e.Ended=3]=`Ended`,e[e.Canceled=4]=`Canceled`,e[e.Pilot=5]=`Pilot`,e}({}),Se=function(e){return e[e.Documentary=0]=`Documentary`,e[e.News=1]=`News`,e[e.Miniseries=2]=`Miniseries`,e[e.Reality=3]=`Reality`,e[e.Scripted=4]=`Scripted`,e[e.TalkShow=5]=`TalkShow`,e[e.Video=6]=`Video`,e}({});function Ce(e){return e.media_type===`movie`}function we(e){return e.media_type===`tv`}let Te=function(e){return e[e.OriginalAirDate=1]=`OriginalAirDate`,e[e.Absolute=2]=`Absolute`,e[e.Dvd=3]=`Dvd`,e[e.Digital=4]=`Digital`,e[e.StoryArc=5]=`StoryArc`,e[e.Production=6]=`Production`,e[e.TV=7]=`TV`,e}({});export{Y as AccountAPI,X as AuthenticationAPI,r as BACKDROP_SIZES,E as CertificationsAPI,D as ChangesAPI,A as CollectionsAPI,O as CompaniesAPI,j as ConfigurationAPI,k as CreditsAPI,M as DiscoverAPI,xe as DiscoverTVStatus,Se as DiscoverTVType,N as FindAPI,he as GenresAPI,Z as GuestSessionsAPI,t as IMAGE_BASE_URL,n as IMAGE_SECURE_BASE_URL,P as KeywordsAPI,i as LOGO_SIZES,Q as ListsAPI,F as MovieListsAPI,I as MoviesAPI,V as NetworksAPI,a as POSTER_SIZES,o as PROFILE_SIZES,J as PeopleAPI,q as PeopleListsAPI,K as ReviewsAPI,s as STILL_SIZES,L as SearchAPI,ye as TMDB,be as TMDBCountries,e as TMDBError,c as TMDBLogger,$ as TMDBv4,Te as TVEpisodeGroupType,U as TVEpisodeGroupsAPI,H as TVEpisodesAPI,W as TVSeasonsAPI,R as TVSeriesAPI,z as TVSeriesListsAPI,G as TrendingAPI,_e as V4AccountAPI,ge as V4AuthAPI,ve as V4ListsAPI,B as WatchProvidersAPI,ae as fetchAllPages,ce as getPageInfo,ee as hasBackdropPath,re as hasLogoPath,oe as hasNextPage,_ as hasPosterPath,se as hasPreviousPage,te as hasProfilePath,ne as hasStillPath,m as isJwt,Ce as isKnownForMovie,we as isKnownForTV,g as isPlainObject,h as isRecord,ie as paginate};
|
|
1
|
+
var e=class extends Error{tmdb_status_code;message;http_status_code;constructor(e,t,n){super(e),this.name=`TMDBError`,this.tmdb_status_code=n||-1,this.message=e,this.http_status_code=t}};const t=`http://image.tmdb.org/t/p/`,n=`https://image.tmdb.org/t/p/`,r=[`w300`,`w780`,`w1280`,`original`],i=[`w45`,`w92`,`w154`,`w185`,`w300`,`w500`,`original`],a=[`w92`,`w154`,`w185`,`w342`,`w500`,`w780`,`original`],o=[`w45`,`w185`,`h632`,`original`],s=[`w92`,`w185`,`w300`,`original`];var c=class e{logger;constructor(e){this.logger=e}static from(t){if(t)return t===!0?new e(e.defaultLogger):new e(t)}log(e){if(this.logger)try{this.logger(e)}catch(e){console.warn(`TMDB logger error: ${String(e)}`)}}static defaultLogger=e=>{let t=`🎬 [tmdb]`,n=new Date().toISOString();if(e.type===`request`){console.log(`${t} ${n} 🛰️ REQUEST ${e.method} ${e.endpoint} \n`);return}if(e.type===`response`){console.log(`${t} ${n} ✅ RESPONSE ${e.method} ${e.status} ${e.statusText} ${e.endpoint} (${e.durationMs}ms)\n`);return}let r=e.status==null?`NETWORK ERROR`:`${e.status} ${e.statusText}`,i=e.tmdbStatusCode==null?``:` (tmdb: ${e.tmdbStatusCode})`;console.log(`${t} ${n} ❌ ${e.method} ${r} ${e.endpoint} - ${e.errorMessage}${i}\n`)}};function l(e){return/^[A-Za-z0-9\-_]+$/.test(e)}function u(e){try{let t=e.replace(/-/g,`+`).replace(/_/g,`/`),n=t.padEnd(t.length+(4-t.length%4)%4,`=`);return atob(n)}catch{return null}}function d(e){return typeof e==`object`&&!!e}function f(e){return d(e)?typeof e.alg==`string`:!1}function p(e){return!(!d(e)||`exp`in e&&typeof e.exp!=`number`||`nbf`in e&&typeof e.nbf!=`number`||`iat`in e&&typeof e.iat!=`number`)}function m(e){if(typeof e!=`string`)return!1;let t=e.split(`.`);if(t.length!==3)return!1;let[n,r,i]=t;if(!l(n)||!l(r)||!l(i))return!1;let a=u(n),o=u(r);if(!a||!o)return!1;let s,c;try{s=JSON.parse(a),c=JSON.parse(o)}catch{return!1}return!(!f(s)||!p(c))}function h(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function g(e){if(!h(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function _(e){return typeof e==`object`&&!!e&&`poster_path`in e&&typeof e.poster_path==`string`}function ee(e){return typeof e==`object`&&!!e&&`backdrop_path`in e&&typeof e.backdrop_path==`string`}function te(e){return typeof e==`object`&&!!e&&`profile_path`in e&&typeof e.profile_path==`string`}function ne(e){return typeof e==`object`&&!!e&&`still_path`in e&&typeof e.still_path==`string`}function re(e){return typeof e==`object`&&!!e&&`logo_path`in e&&typeof e.logo_path==`string`}const v={NO_ACCESS_TOKEN:`TMDB requires a valid access token, please provide one.`,INVALID_CLIENT:`TMDB received an invalid ApiClient instance. Pass a valid ApiClient or an access token string.`,V4_REQUIRES_JWT:`TMDB v4 requires a Bearer (JWT) access token. API key strings are not supported for v4 endpoints.`,INVALID_START_PAGE:`Invalid page: Pages start at 1 and max at 500. They are expected to be an integer.`};async function*ie(e,t=1){if(!Number.isInteger(t)||t<1||t>500)throw RangeError(v.INVALID_START_PAGE);let n=t;for(;;){let t=await e(n);if(yield t,t.page>=t.total_pages)break;n++}}async function ae(e,t={}){let{maxPages:n=500,deduplicateBy:r}=t,i=[],a=1;for(;;){let t=await e(a);if(i.push(...t.results),t.page>=t.total_pages||a>=n)break;a++}if(r){let e=new Map;for(let t of i){let n=r(t);e.has(n)&&e.delete(n),e.set(n,t)}return[...e.values()]}return i}function oe(e){return e.page<e.total_pages}function se(e){return e.page>1}function ce(e){return{current:e.page,total:e.total_pages,totalResults:e.total_results,isFirst:e.page===1,isLast:e.page>=e.total_pages}}const y={backdrop_path:`backdrop`,logo_path:`logo`,poster_path:`poster`,profile_path:`profile`,still_path:`still`},le={backdrop_path:`backdrops`,logo_path:`logos`,poster_path:`posters`,profile_path:`profiles`,still_path:`stills`},b={backdrops:`backdrop_path`,logos:`logo_path`,posters:`poster_path`,profiles:`profile_path`,stills:`still_path`};var x=class{options;constructor(e={}){this.options={secure_images_url:!0,...e}}buildUrl(e,r){return`${this.options.secure_images_url?n:t}${r}${e}`}backdrop(e,t=this.options.default_image_sizes?.backdrops||`w780`){return this.buildUrl(e,t)}logo(e,t=this.options.default_image_sizes?.logos||`w185`){return this.buildUrl(e,t)}poster(e,t=this.options.default_image_sizes?.posters||`w500`){return this.buildUrl(e,t)}profile(e,t=this.options.default_image_sizes?.profiles||`w185`){return this.buildUrl(e,t)}still(e,t=this.options.default_image_sizes?.still||`w300`){return this.buildUrl(e,t)}autocompleteImagePaths(e,t){return this.traverse(e,t,!0)}applyFallbacksOnly(e){return this.traverse(e,void 0,!1)}traverse(e,t,n){if(Array.isArray(e)){let r=n&&t&&this.options.image_language_priority?.[t];return(r?this.sortByLanguagePriority(e,r):e).map(e=>this.traverse(e,t,n))}if(!g(e))return e;let r=Object.create(null);for(let[i,a]of Object.entries(e)){if(i===`__proto__`||i===`constructor`||i===`prototype`){r[i]=a;continue}if(a==null){if(Object.hasOwn(y,i)){let e=le[i];r[i]=this.getFallbackForCollection(e)??a;continue}if(i===`file_path`&&t){r[i]=this.getFallbackForCollection(t)??a;continue}r[i]=a;continue}if(typeof a==`string`){r[i]=n?this.transformPathValue(i,a,t):a;continue}let e=this.isImageCollectionKey(i)?i:t;r[i]=this.traverse(a,e,n)}return r}sortByLanguagePriority(e,t){let n=[],r=[...e];for(let e of t){if(e===`*`){n.push(...r.splice(0,r.length));break}let t=[];for(let i of r){let r=i?.iso_639_1;(e===`null`?r==null:r===e)?n.push(i):t.push(i)}r.length=0,r.push(...t)}return n.push(...r),n}isImageCollectionKey(e){return Object.hasOwn(b,e)}getFallbackForCollection(e){let t=this.options.fallback_url;if(t!=null)return typeof t==`string`?t:t[e]}isFullUrl(e){return/^https?:\/\//.test(e)}buildImageUrl(e,t){let n=y[e];return Object.hasOwn(this,n)||this[n],this[n](t)}transformPathValue(e,t,n){return!t.startsWith(`/`)||this.isFullUrl(t)?t:Object.hasOwn(y,e)?this.buildImageUrl(e,t):e===`file_path`&&n?this.buildImageUrl(b[n],t):t}},ue=class{ttl;maxSize;excludedEndpoints;store=new Map;constructor(e={}){let t=e.ttl??3e5;if(!Number.isFinite(t)||!Number.isInteger(t)||t<1)throw RangeError(`cache.ttl must be a finite integer >= 1 (got ${t})`);if(e.max_size!==void 0&&(!Number.isFinite(e.max_size)||!Number.isInteger(e.max_size)||e.max_size<1))throw RangeError(`cache.max_size must be a finite integer >= 1 (got ${e.max_size})`);this.ttl=t,this.maxSize=e.max_size,this.excludedEndpoints=(e.excluded_endpoints??[]).map(e=>typeof e!=`string`&&/[gy]/.test(e.flags)?new RegExp(e.source,e.flags.replace(/[gy]/g,``)):e)}shouldCache(e){return!this.excludedEndpoints.some(t=>typeof t==`string`?e.startsWith(t):t.test(e))}get(e){let t=this.store.get(e);if(t){if(Date.now()>t.expiresAt){this.store.delete(e);return}return t.value}}has(e){let t=this.store.get(e);return t?Date.now()>t.expiresAt?(this.store.delete(e),!1):!0:!1}set(e,t){this.maxSize!==void 0&&!this.store.has(e)&&this.store.size>=this.maxSize&&this.store.delete(this.store.keys().next().value),this.store.set(e,{value:t,expiresAt:Date.now()+this.ttl})}delete(e){return this.store.delete(e)}clear(){this.store.clear()}get size(){return this.store.size}},de=class{maxRequests;windowMs;timestamps=[];queue=[];processing=!1;constructor(e={}){let t=e.max_requests??40,n=e.per_ms??1e3;if(!Number.isFinite(t)||!Number.isInteger(t)||t<1)throw RangeError(`rate_limit.max_requests must be a finite integer >= 1 (got ${t})`);if(!Number.isFinite(n)||!Number.isInteger(n)||n<1)throw RangeError(`rate_limit.per_ms must be a finite integer >= 1 (got ${n})`);this.maxRequests=t,this.windowMs=n}acquire(){return new Promise(e=>{this.queue.push(e),this.processing||this.process()})}async process(){for(this.processing=!0;this.queue.length>0;){let e=Date.now();if(this.timestamps=this.timestamps.filter(t=>e-t<this.windowMs),this.timestamps.length<this.maxRequests)this.timestamps.push(Date.now()),this.queue.shift()();else{let e=this.timestamps[0],t=this.windowMs-(Date.now()-e)+1;await new Promise(e=>setTimeout(e,t))}}this.processing=!1}};function fe(t){if(t instanceof e)return t.http_status_code>=500;if(t instanceof Error)switch(t.name){case`FetchError`:case`AbortError`:return!0;case`SyntaxError`:return!1;case`TypeError`:return!0;default:return!1}return!0}var pe=class{maxRetries;baseDelayMs;maxDelayMs;shouldRetry;constructor(e={}){let t=e.max_retries??3,n=e.base_delay_ms??500,r=e.max_delay_ms??3e4;if(!Number.isFinite(t)||!Number.isInteger(t)||t<0)throw RangeError(`retry.max_retries must be a finite integer >= 0 (got ${t})`);if(!Number.isFinite(n)||!Number.isInteger(n)||n<1)throw RangeError(`retry.base_delay_ms must be a finite integer >= 1 (got ${n})`);if(!Number.isFinite(r)||!Number.isInteger(r)||r<1)throw RangeError(`retry.max_delay_ms must be a finite integer >= 1 (got ${r})`);this.maxRetries=t,this.baseDelayMs=n,this.maxDelayMs=r,this.shouldRetry=e.shouldRetry??fe}delayFor(e){let t=Math.min(this.baseDelayMs*2**(e-1),this.maxDelayMs);return Math.floor(Math.random()*t)}async execute(e,t=me){let n;for(let r=0;r<=this.maxRetries;r++)try{return await e()}catch(e){if(n=e,r>=this.maxRetries||!await this.shouldRetry(e,r+1))break;let i=this.delayFor(r+1);i>0&&await t(i)}throw n}};function me(e){return new Promise(t=>setTimeout(t,e))}var S=class{accessToken;baseUrl;logger;inflightRequests=new Map;deduplication;rateLimiter;retryManager;requestInterceptors;onSuccessInterceptor;onErrorInterceptor;imageApi;imageOptions;responseCache;constructor(e,t={}){this.accessToken=e,this.baseUrl=`https://api.themoviedb.org/${t.version??3}`,this.logger=c.from(t.logger),this.deduplication=t.deduplication!==!1,t.rate_limit&&(this.rateLimiter=new de(t.rate_limit===!0?{}:t.rate_limit)),t.retry&&(this.retryManager=new pe(t.retry===!0?{}:t.retry)),t.cache&&(this.responseCache=new ue(t.cache===!0?{}:t.cache));let n=t.interceptors?.request;this.requestInterceptors=n==null?[]:Array.isArray(n)?n:[n],this.onSuccessInterceptor=t.interceptors?.response?.onSuccess,this.onErrorInterceptor=t.interceptors?.response?.onError,this.imageApi=t.images?.autocomplete_paths||t.images?.fallback_url!=null?new x(t.images):void 0,this.imageOptions=t.images}buildRequestKey(e,t){let n=this.serializeParams(t).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>`${e}=${t}`);return n.length>0?`${e}?${n.join(`&`)}`:e}serializeParams(e){return Object.entries(e).flatMap(([e,t])=>t===void 0?[]:[[e,String(t)]])}async request(e,t={}){let n=await this.runRequestInterceptors({endpoint:e,params:t,method:`GET`}),r=n.endpoint,i=n.params,a=this.buildRequestKey(r,i),o=!!this.responseCache?.shouldCache(a);if(o&&this.responseCache.has(a))return this.responseCache.get(a);if(!this.deduplication){let e=await this.execute(`GET`,r,i,void 0,!0);return o&&this.responseCache.set(a,e),e}let s=this.inflightRequests.get(a);if(s)return s;let c=o?this.responseCache:void 0,l=this.execute(`GET`,r,i,void 0,!0).then(e=>(c?.set(a,e),e)).finally(()=>{this.inflightRequests.delete(a)});return this.inflightRequests.set(a,l),l}invalidateCache(e,t={}){return this.responseCache?this.responseCache.delete(this.buildRequestKey(e,t)):!1}clearCache(){this.responseCache?.clear()}get cacheSize(){return this.responseCache?.size??0}async runRequestInterceptors(e){let t=e;for(let e of this.requestInterceptors){let n=await e(t);n!=null&&(t=n)}return t}sanitizeNulls(e){if(e===null)return;if(typeof e!=`object`)return e;if(Array.isArray(e))return e.map(e=>this.sanitizeNulls(e));let t={};for(let[n,r]of Object.entries(e))t[n]=this.sanitizeNulls(r);return t}async normalizeError(t,n,r){let i=t.statusText,a=-1;try{let e=await t.json();if(e&&typeof e==`object`){let t=e;i=t.status_message||i,a=t.status_code||-1}}catch(e){console.error(`Unknown error: ${String(e)}`)}return this.logger?.log({type:`error`,method:r,endpoint:n,status:t.status,statusText:t.statusText,tmdbStatusCode:a,errorMessage:i}),new e(i,t.status,a)}async notifyErrorInterceptor(e){this.onErrorInterceptor&&await this.onErrorInterceptor(e)}async mutate(e,t,n,r={}){return this.execute(e,t,r,n)}async execute(t,n,r,i,a=!1){let o=i===void 0?void 0:JSON.stringify(i),s,c;if(a)s=n,c=r;else{let e=await this.runRequestInterceptors({endpoint:n,params:r,method:t});s=e.endpoint,c=e.params}let l=new URL(`${this.baseUrl}${s}`),u=m(this.accessToken);for(let[e,t]of this.serializeParams(c))l.searchParams.append(e,t);u||l.searchParams.append(`api_key`,this.accessToken);let d=Date.now();this.logger?.log({type:`request`,method:t,endpoint:s});let f=async()=>{this.rateLimiter&&await this.rateLimiter.acquire();let e;try{e=await fetch(l.toString(),{method:t,headers:u?{Authorization:`Bearer ${this.accessToken}`,"Content-Type":`application/json;charset=utf-8`}:{"Content-Type":`application/json;charset=utf-8`},...o===void 0?{}:{body:o}})}catch(e){throw this.logger?.log({type:`error`,method:t,endpoint:s,errorMessage:e instanceof Error?e.message:String(e),durationMs:Date.now()-d}),e}if(!e.ok)throw await this.normalizeError(e,s,t);return e},p;try{p=this.retryManager?await this.retryManager.execute(f):await f()}catch(t){throw t instanceof e&&await this.notifyErrorInterceptor(t),t}this.logger?.log({type:`response`,method:t,endpoint:s,status:p.status,statusText:p.statusText,durationMs:Date.now()-d});let h=await p.json(),g=this.sanitizeNulls(h),_=this.imageApi?this.imageOptions?.autocomplete_paths?this.imageApi.autocompleteImagePaths(g):this.imageApi.applyFallbacksOnly(g):g;if(this.onSuccessInterceptor){let e=await this.onSuccessInterceptor(_);return e===void 0?_:e}return _}};const C={AUTHENTICATION:{VALIDATE:`/authentication`,GUEST_SESSION:`/authentication/guest_session/new`,REQUEST_TOKEN:`/authentication/token/new`,CREATE_SESSION:`/authentication/session/new`,CREATE_SESSION_WITH_LOGIN:`/authentication/token/validate_with_login`,DELETE_SESSION:`/authentication/session`},ACCOUNT:{DETAILS:`/account`,ADD_FAVORITE:`/favorite`,ADD_TO_WATCHLIST:`/watchlist`,FAVORITE_MOVIES:`/favorite/movies`,FAVORITE_TV:`/favorite/tv`,WATCHLIST_MOVIES:`/watchlist/movies`,WATCHLIST_TV:`/watchlist/tv`,RATED_MOVIES:`/rated/movies`,RATED_TV:`/rated/tv`,RATED_TV_EPISODES:`/rated/tv/episodes`,LISTS:`/lists`},CONFIGURATION:{DETAILS:`/configuration`,COUNTRIES:`/configuration/countries`,JOBS:`/configuration/jobs`,LANGUAGES:`/configuration/languages`,TIMEZONES:`/configuration/timezones`,PRIMARY_TRANSLATIONS:`/configuration/primary_translations`},CERTIFICATIONS:{MOVIE_CERTIFICATIONS:`/certification/movie/list`,TV_CERTIFICATIONS:`/certification/tv/list`},CHANGES:{MOVIE_LIST:`/movie/changes`,PEOPLE_LIST:`/person/changes`,TV_LIST:`/tv/changes`},DISCOVER:{MOVIE:`/discover/movie`,TV:`/discover/tv`},FIND:`/find`,CREDITS:{DETAILS:`/credit`},COMPANIES:{DETAILS:`/company`,ALTERNATIVE_NAMES:`/alternative_names`,IMAGES:`/images`},COLLECTIONS:{DETAILS:`/collection`,IMAGES:`/images`,TRANSLATIONS:`/translations`},GENRES:{MOVIE_LIST:`/genre/movie/list`,TV_LIST:`/genre/tv/list`},KEYWORDS:{DETAILS:`/keyword`,MOVIES:`/movies`},MOVIES:{DETAILS:`/movie`,ALTERNATIVE_TITLES:`/alternative_titles`,CREDITS:`/credits`,EXTERNAL_IDS:`/external_ids`,KEYWORDS:`/keywords`,CHANGES:`/changes`,IMAGES:`/images`,LATEST:`/latest`,NOW_PLAYING:`/now_playing`,POPULAR:`/popular`,RECOMMENDATIONS:`/recommendations`,RELEASE_DATES:`/release_dates`,REVIEWS:`/reviews`,SIMILAR:`/similar`,TOP_RATED:`/top_rated`,TRANSLATIONS:`/translations`,UPCOMING:`/upcoming`,VIDEOS:`/videos`,WATCH_PROVIDERS:`/watch/providers`},NETWORKS:{DETAILS:`/network`,ALTERNATIVE_NAMES:`/alternative_names`,IMAGES:`/images`},PEOPLE:{DETAILS:`/person`,CHANGES:`/changes`,COMBINED_CREDITS:`/combined_credits`,EXTERNAL_IDS:`/external_ids`,IMAGES:`/images`,LATEST:`/latest`,MOVIE_CREDITS:`/movie_credits`,TAGGED_IMAGES:`/tagged_images`,TRANSLATIONS:`/translations`,TV_CREDITS:`/tv_credits`},SEARCH:{MOVIE:`/search/movie`,COLLECTION:`/search/collection`,COMPANY:`/search/company`,KEYWORD:`/search/keyword`,MULTI:`/search/multi`,PERSON:`/search/person`,TV:`/search/tv`},TV_SERIES:{DETAILS:`/tv`,AGGREGATE_CREDITS:`/aggregate_credits`,AIRING_TODAY:`/airing_today`,ALTERNATIVE_TITLES:`/alternative_titles`,CHANGES:`/changes`,CONTENT_RATINGS:`/content_ratings`,CREDITS:`/credits`,EPISODE_GROUPS:`/episode_groups`,EXTERNAL_IDS:`/external_ids`,IMAGES:`/images`,KEYWORDS:`/keywords`,LATEST:`/latest`,LISTS:`/lists`,ON_THE_AIR:`/on_the_air`,POPULAR:`/popular`,RECOMMENDATIONS:`/recommendations`,REVIEWS:`/reviews`,SCREENED_THEATRICALLY:`/screened_theatrically`,SIMILAR:`/similar`,TOP_RATED:`/top_rated`,TRANSLATIONS:`/translations`,VIDEOS:`/videos`,WATCH_PROVIDERS:`/watch/providers`},TV_SEASONS:{DETAILS:`/season`,AGGREGATE_CREDITS:`/aggregate_credits`,CHANGES:`/changes`,CREDITS:`/credits`,EXTERNAL_IDS:`/external_ids`,IMAGES:`/images`,TRANSLATIONS:`/translations`,VIDEOS:`/videos`,WATCH_PROVIDERS:`/watch/providers`},TV_EPISODES:{DETAILS:`/episode`,CHANGES:`/changes`,CREDITS:`/credits`,EXTERNAL_IDS:`/external_ids`,IMAGES:`/images`,TRANSLATIONS:`/translations`,VIDEOS:`/videos`},TV_EPISODE_GROUPS:{DETAILS:`/tv/episode_group`},WATCH_PROVIDERS:{MOVIE:`/watch/providers/movie`,TV:`/watch/providers/tv`,REGIONS:`/watch/providers/regions`},TRENDING:{ALL:`/trending/all`,MOVIE:`/trending/movie`,TV:`/trending/tv`,PERSON:`/trending/person`},REVIEWS:{DETAILS:`/review`},PEOPLE_LISTS:{POPULAR:`/person/popular`},LISTS:{DETAILS:`/list`,ADD_ITEM:`/add_item`,ITEM_STATUS:`/item_status`,CLEAR:`/clear`,REMOVE_ITEM:`/remove_item`},GUEST_SESSIONS:{DETAILS:`/guest_session`,RATED_MOVIES:`/rated/movies`,RATED_TV:`/rated/tv`,RATED_TV_EPISODES:`/rated/tv/episodes`}},w={AUTH:{REQUEST_TOKEN:`/auth/request_token`,ACCESS_TOKEN:`/auth/access_token`},ACCOUNT:{DETAILS:`/account`,LISTS:`/lists`,FAVORITE_MOVIES:`/favorite/movies`,FAVORITE_TV:`/favorite/tv`,WATCHLIST_MOVIES:`/watchlist/movies`,WATCHLIST_TV:`/watchlist/tv`,RATED_MOVIES:`/rated/movies`,RATED_TV:`/rated/tv`},LISTS:{DETAILS:`/list`,ITEMS:`/items`,ITEM_STATUS:`/item_status`,CLEAR:`/clear`}};var T=class{client;defaultOptions;constructor(e,t={}){if(typeof e==`string`){if(!e)throw Error(v.NO_ACCESS_TOKEN);this.client=new S(e,{logger:t.logger,deduplication:t.deduplication,rate_limit:t.rate_limit,interceptors:t.interceptors})}else if(e instanceof S)this.client=e;else throw Error(e==null?v.NO_ACCESS_TOKEN:v.INVALID_CLIENT);this.defaultOptions=t}applyDefaults(e){let{language:t,region:n}=this.defaultOptions;return{...t!==void 0&&{language:t},...n!==void 0&&{region:n},...e}}withLanguage(e){let t=this.defaultOptions?.language;return e?e.language!==void 0||t===void 0?e:{...e,language:t}:t===void 0?void 0:{language:t}}injectImageLanguage(e){if(!this.defaultOptions.images?.auto_include_image_language||e.include_image_language!==void 0)return e;let t=this.defaultOptions.images?.image_language_priority;if(!t)return e;let n=[...new Set(Object.values(t).flat().filter(e=>e!==`*`))];return n.length?{...e,include_image_language:n}:e}},E=class extends T{async movie_certifications(){return this.client.request(C.CERTIFICATIONS.MOVIE_CERTIFICATIONS)}async tv_certifications(){return this.client.request(C.CERTIFICATIONS.TV_CERTIFICATIONS)}},D=class extends T{async movie_list(e){return this.client.request(C.CHANGES.MOVIE_LIST,e)}async people_list(e){return this.client.request(C.CHANGES.PEOPLE_LIST,e)}async tv_list(e){return this.client.request(C.CHANGES.TV_LIST,e)}},O=class extends T{companyPath(e){return`${C.COMPANIES.DETAILS}/${e}`}async details(e){let t=this.companyPath(e.company_id);return this.client.request(t)}async alternative_names(e){let t=`${this.companyPath(e.company_id)}${C.COMPANIES.ALTERNATIVE_NAMES}`;return this.client.request(t)}async images(e){let{company_id:t,...n}=e,r=`${this.companyPath(t)}${C.COMPANIES.IMAGES}`;return this.client.request(r,this.injectImageLanguage(this.withLanguage(n)??n))}},k=class extends T{creditPath(e){return`${C.CREDITS.DETAILS}/${e}`}async details(e){let{credit_id:t,...n}=e,r=this.creditPath(t);return this.client.request(r,this.withLanguage(n))}},A=class extends T{collectionPath(e){return`${C.COLLECTIONS.DETAILS}/${e}`}async details(e){let{language:t=this.defaultOptions.language,collection_id:n}=e,r=this.collectionPath(n);return this.client.request(r,{language:t})}async images(e){let{collection_id:t,...n}=e,r=`${this.collectionPath(t)}${C.COLLECTIONS.IMAGES}`;return this.client.request(r,this.injectImageLanguage(this.withLanguage(n)??n))}async translations(e){let t=`${this.collectionPath(e.collection_id)}${C.COLLECTIONS.TRANSLATIONS}`;return this.client.request(t)}},j=class extends T{async details(){return this.client.request(C.CONFIGURATION.DETAILS)}async countries(e){return this.client.request(C.CONFIGURATION.COUNTRIES,this.withLanguage(e))}async jobs(){return this.client.request(C.CONFIGURATION.JOBS)}async languages(){return this.client.request(C.CONFIGURATION.LANGUAGES)}async primary_translations(){return this.client.request(C.CONFIGURATION.PRIMARY_TRANSLATIONS)}async timezones(){return this.client.request(C.CONFIGURATION.TIMEZONES)}},M=class extends T{withMovieDefaults(e){if(!e&&!this.defaultOptions.language&&!this.defaultOptions.region)return;let t=e?.language??this.defaultOptions.language,n=e?.region??this.defaultOptions.region;return{...e,language:t,region:n}}withTVDefaults(e){if(!e&&!this.defaultOptions.language&&!this.defaultOptions.timezone)return;let t=e?.language??this.defaultOptions.language,n=e?.timezone??this.defaultOptions.timezone;return{...e,language:t,timezone:n}}async movie(e={}){return this.client.request(C.DISCOVER.MOVIE,this.withMovieDefaults(e))}async tv(e={}){return this.client.request(C.DISCOVER.TV,this.withTVDefaults(e))}},N=class extends T{async by_id(e){let{external_id:t,...n}=e,r=`${C.FIND}/${encodeURIComponent(t)}`,i=this.withLanguage(n);return this.client.request(r,i)}},P=class extends T{async movie_list(e){return this.client.request(C.GENRES.MOVIE_LIST,this.withLanguage(e))}async tv_list(e){return this.client.request(C.GENRES.TV_LIST,this.withLanguage(e))}},F=class extends T{keywordPath(e){return`${C.KEYWORDS.DETAILS}/${e}`}async details(e){let t=this.keywordPath(e.keyword_id);return this.client.request(t)}async movies(e){let{keyword_id:t,...n}=e,r=`${this.keywordPath(t)}${C.KEYWORDS.MOVIES}`,i=this.withLanguage(n);return this.client.request(r,i)}},I=class extends T{withDefaults(e){let{language:t=this.defaultOptions.language,region:n=this.defaultOptions.region,...r}=e;return{language:t,region:n,...r}}fetch_movie_list(e,t={}){return this.client.request(C.MOVIES.DETAILS+e,this.withDefaults(t))}async now_playing(e={}){return this.client.request(C.MOVIES.DETAILS+C.MOVIES.NOW_PLAYING,this.withDefaults(e))}async popular(e={}){return this.fetch_movie_list(C.MOVIES.POPULAR,e)}async top_rated(e={}){return this.fetch_movie_list(C.MOVIES.TOP_RATED,e)}async upcoming(e={}){return this.client.request(C.MOVIES.DETAILS+C.MOVIES.UPCOMING,this.withDefaults(e))}},L=class extends T{moviePath(e){return`${C.MOVIES.DETAILS}/${e}`}movieSubPath(e,t){return`${this.moviePath(e)}${t}`}async details(e){let{language:t=this.defaultOptions.language,movie_id:n,append_to_response:r}=e,i=this.moviePath(n);return this.client.request(i,{language:t,append_to_response:r})}async alternative_titles(e){let{movie_id:t,...n}=e,r=this.movieSubPath(t,C.MOVIES.ALTERNATIVE_TITLES);return this.client.request(r,n)}async credits(e){let{movie_id:t,language:n=this.defaultOptions.language,...r}=e,i=this.movieSubPath(t,C.MOVIES.CREDITS);return this.client.request(i,{language:n,...r})}async external_ids(e){let t=this.movieSubPath(e.movie_id,C.MOVIES.EXTERNAL_IDS);return this.client.request(t)}async keywords(e){let t=this.movieSubPath(e.movie_id,C.MOVIES.KEYWORDS);return this.client.request(t)}async changes(e){let{movie_id:t,...n}=e,r=this.movieSubPath(t,C.MOVIES.CHANGES);return this.client.request(r,n)}async images(e){let{movie_id:t,language:n=this.defaultOptions.language,...r}=e,i=this.movieSubPath(t,C.MOVIES.IMAGES);return this.client.request(i,this.injectImageLanguage({language:n,...r}))}async latest(){let e=`${C.MOVIES.DETAILS}${C.MOVIES.LATEST}`;return this.client.request(e)}async recommendations(e){let{movie_id:t,language:n=this.defaultOptions.language,...r}=e,i=this.movieSubPath(t,C.MOVIES.RECOMMENDATIONS);return this.client.request(i,{language:n,...r})}async release_dates(e){let t=this.movieSubPath(e.movie_id,C.MOVIES.RELEASE_DATES);return this.client.request(t)}async reviews(e){let{movie_id:t,language:n=this.defaultOptions.language,...r}=e,i=this.movieSubPath(t,C.MOVIES.REVIEWS);return this.client.request(i,{language:n,...r})}async similar(e){let{movie_id:t,language:n=this.defaultOptions.language,...r}=e,i=this.movieSubPath(t,C.MOVIES.SIMILAR);return this.client.request(i,{language:n,...r})}async translations(e){let t=this.movieSubPath(e.movie_id,C.MOVIES.TRANSLATIONS);return this.client.request(t)}async videos(e){let{movie_id:t,language:n=this.defaultOptions.language,...r}=e,i=this.movieSubPath(t,C.MOVIES.VIDEOS);return this.client.request(i,{language:n,...r})}async watch_providers(e){let t=this.movieSubPath(e.movie_id,C.MOVIES.WATCH_PROVIDERS);return this.client.request(t)}},R=class extends T{async collections(e){return this.client.request(C.SEARCH.COLLECTION,this.applyDefaults(e))}async movies(e){return this.client.request(C.SEARCH.MOVIE,this.applyDefaults(e))}async company(e){return this.client.request(C.SEARCH.COMPANY,this.applyDefaults(e))}async keyword(e){return this.client.request(C.SEARCH.KEYWORD,this.applyDefaults(e))}async person(e){return this.client.request(C.SEARCH.PERSON,this.applyDefaults(e))}async tv_series(e){return this.client.request(C.SEARCH.TV,this.applyDefaults(e))}async multi(e){return this.client.request(C.SEARCH.MULTI,this.applyDefaults(e))}},z=class extends T{seriesPath(e){return`${C.TV_SERIES.DETAILS}/${e}`}seriesSubPath(e,t){return`${this.seriesPath(e)}${t}`}async details(e){let{language:t=this.defaultOptions.language,series_id:n,...r}=e,i=this.seriesPath(n);return this.client.request(i,{language:t,...r})}async aggregate_credits(e){let{language:t=this.defaultOptions.language,series_id:n,...r}=e,i=this.seriesSubPath(n,C.TV_SERIES.AGGREGATE_CREDITS);return this.client.request(i,{language:t,...r})}async alternative_titles(e){let t=this.seriesSubPath(e.series_id,C.TV_SERIES.ALTERNATIVE_TITLES);return this.client.request(t)}async changes(e){let{series_id:t,...n}=e,r=this.seriesSubPath(t,C.TV_SERIES.CHANGES);return this.client.request(r,{...n})}async content_ratings(e){let t=this.seriesSubPath(e.series_id,C.TV_SERIES.CONTENT_RATINGS);return this.client.request(t)}async credits(e){let{language:t=this.defaultOptions.language,series_id:n,...r}=e,i=this.seriesSubPath(n,C.TV_SERIES.CREDITS);return this.client.request(i,{language:t,...r})}async episode_groups(e){let t=this.seriesSubPath(e.series_id,C.TV_SERIES.EPISODE_GROUPS);return this.client.request(t)}async external_ids(e){let t=this.seriesSubPath(e.series_id,C.TV_SERIES.EXTERNAL_IDS);return this.client.request(t)}async images(e){let{language:t=this.defaultOptions.language,series_id:n,...r}=e,i=this.seriesSubPath(n,C.TV_SERIES.IMAGES);return this.client.request(i,this.injectImageLanguage({language:t,...r}))}async keywords(e){let t=this.seriesSubPath(e.series_id,C.TV_SERIES.KEYWORDS);return this.client.request(t)}async latest(){let e=`${C.TV_SERIES.DETAILS}${C.TV_SERIES.LATEST}`;return this.client.request(e)}async lists(e){let{language:t=this.defaultOptions.language,series_id:n,...r}=e,i=this.seriesSubPath(n,C.TV_SERIES.LISTS);return this.client.request(i,{language:t,...r})}async recommendations(e){let{language:t=this.defaultOptions.language,series_id:n,...r}=e,i=this.seriesSubPath(n,C.TV_SERIES.RECOMMENDATIONS);return this.client.request(i,{language:t,...r})}async reviews(e){let{language:t=this.defaultOptions.language,series_id:n,...r}=e,i=this.seriesSubPath(n,C.TV_SERIES.REVIEWS);return this.client.request(i,{language:t,...r})}async screened_theatrically(e){let t=this.seriesSubPath(e.series_id,C.TV_SERIES.SCREENED_THEATRICALLY);return this.client.request(t)}async similar(e){let{language:t=this.defaultOptions.language,series_id:n,...r}=e,i=this.seriesSubPath(n,C.TV_SERIES.SIMILAR);return this.client.request(i,{language:t,...r})}async translations(e){let t=this.seriesSubPath(e.series_id,C.TV_SERIES.TRANSLATIONS);return this.client.request(t)}async videos(e){let t=this.seriesSubPath(e.series_id,C.TV_SERIES.VIDEOS);return this.client.request(t)}async watch_providers(e){let t=this.seriesSubPath(e.series_id,C.TV_SERIES.WATCH_PROVIDERS);return this.client.request(t)}},he=class extends T{withDefaults(e){let{language:t=this.defaultOptions.language,timezone:n=this.defaultOptions.timezone,...r}=e;return{language:t,timezone:n,...r}}fetch_tv_series_list(e,t={}){return this.client.request(C.TV_SERIES.DETAILS+e,this.withDefaults(t))}async airing_today(e={}){return this.fetch_tv_series_list(C.TV_SERIES.AIRING_TODAY,e)}async on_the_air(e={}){return this.fetch_tv_series_list(C.TV_SERIES.ON_THE_AIR,e)}async popular(e={}){return this.fetch_tv_series_list(C.TV_SERIES.POPULAR,e)}async top_rated(e={}){return this.fetch_tv_series_list(C.TV_SERIES.TOP_RATED,e)}},B=class extends T{async movie_providers(e){let t=e?.language??this.defaultOptions.language,n=t===void 0?e:{...e,language:t};return this.client.request(C.WATCH_PROVIDERS.MOVIE,n)}async tv_providers(e){let t=e?.language??this.defaultOptions.language,n=t===void 0?e:{...e,language:t};return this.client.request(C.WATCH_PROVIDERS.TV,n)}async available_regions(e){let t=e?.language??this.defaultOptions.language,n=t===void 0?e:{...e,language:t};return this.client.request(C.WATCH_PROVIDERS.REGIONS,n)}},V=class extends T{networkPath(e){return`${C.NETWORKS.DETAILS}/${e}`}async details(e){let t=this.networkPath(e.network_id);return this.client.request(t)}async alternative_names(e){let t=`${this.networkPath(e.network_id)}${C.NETWORKS.ALTERNATIVE_NAMES}`;return this.client.request(t)}async images(e){let t=`${this.networkPath(e.network_id)}${C.NETWORKS.IMAGES}`;return this.client.request(t)}},H=class extends T{episodePath(e){return`${C.TV_SERIES.DETAILS}/${e.series_id}${C.TV_SEASONS.DETAILS}/${e.season_number}${C.TV_EPISODES.DETAILS}/${e.episode_number}`}episodeSubPath(e,t){return`${this.episodePath(e)}${t}`}async details(e){let{language:t=this.defaultOptions.language,append_to_response:n,...r}=e,i=this.episodePath(r);return this.client.request(i,{language:t,append_to_response:n})}async changes(e){let{episode_id:t,...n}=e,r=`${C.TV_SERIES.DETAILS}${C.TV_EPISODES.DETAILS}/${t}${C.TV_EPISODES.CHANGES}`;return this.client.request(r,{...n})}async credits(e){let{language:t=this.defaultOptions.language,...n}=e,r=this.episodeSubPath(n,C.TV_EPISODES.CREDITS);return this.client.request(r,{language:t})}async external_ids(e){let t=this.episodeSubPath(e,C.TV_EPISODES.EXTERNAL_IDS);return this.client.request(t)}async images(e){let{language:t=this.defaultOptions.language,include_image_language:n,...r}=e,i=this.episodeSubPath(r,C.TV_EPISODES.IMAGES);return this.client.request(i,this.injectImageLanguage({language:t,include_image_language:n}))}async translations(e){let t=this.episodeSubPath(e,C.TV_EPISODES.TRANSLATIONS);return this.client.request(t)}async videos(e){let t=this.episodeSubPath(e,C.TV_EPISODES.VIDEOS);return this.client.request(t)}},U=class extends T{async details(e){let t=`${C.TV_EPISODE_GROUPS.DETAILS}/${e.episode_group_id}`;return this.client.request(t)}},W=class extends T{seasonPath(e){return`${C.TV_SERIES.DETAILS}/${e.series_id}${C.TV_SEASONS.DETAILS}/${e.season_number}`}seasonSubPath(e,t){return`${this.seasonPath(e)}${t}`}async details(e){let{language:t=this.defaultOptions.language,append_to_response:n,...r}=e,i=this.seasonPath(r);return this.client.request(i,{language:t,append_to_response:n})}async aggregate_credits(e){let{language:t=this.defaultOptions.language,...n}=e,r=this.seasonSubPath(n,C.TV_SEASONS.AGGREGATE_CREDITS);return this.client.request(r,{language:t})}async changes(e){let{season_id:t,...n}=e,r=`${C.TV_SERIES.DETAILS}${C.TV_SEASONS.DETAILS}/${t}${C.TV_SEASONS.CHANGES}`;return this.client.request(r,{...n})}async credits(e){let{language:t=this.defaultOptions.language,...n}=e,r=this.seasonSubPath(n,C.TV_SEASONS.CREDITS);return this.client.request(r,{language:t})}async external_ids(e){let t=this.seasonSubPath(e,C.TV_SEASONS.EXTERNAL_IDS);return this.client.request(t)}async images(e){let{language:t=this.defaultOptions.language,include_image_language:n,...r}=e,i=this.seasonSubPath(r,C.TV_SEASONS.IMAGES);return this.client.request(i,this.injectImageLanguage({language:t,include_image_language:n}))}async translations(e){let t=this.seasonSubPath(e,C.TV_SEASONS.TRANSLATIONS);return this.client.request(t)}async videos(e){let{language:t=this.defaultOptions.language,include_video_language:n,...r}=e,i=this.seasonSubPath(r,C.TV_SEASONS.VIDEOS);return this.client.request(i,{language:t,include_video_language:n})}async watch_providers(e){let{language:t=this.defaultOptions.language,...n}=e,r=this.seasonSubPath(n,C.TV_SEASONS.WATCH_PROVIDERS);return this.client.request(r,{language:t})}},G=class extends T{async all(e){let{time_window:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(`${C.TRENDING.ALL}/${t}`,{language:n,...r})}async movies(e){let{time_window:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(`${C.TRENDING.MOVIE}/${t}`,{language:n,...r})}async tv(e){let{time_window:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(`${C.TRENDING.TV}/${t}`,{language:n,...r})}async people(e){let{time_window:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(`${C.TRENDING.PERSON}/${t}`,{language:n,...r})}},K=class extends T{async details(e){return this.client.request(`${C.REVIEWS.DETAILS}/${e.review_id}`)}},q=class extends T{async popular(e={}){return this.client.request(C.PEOPLE_LISTS.POPULAR,this.withLanguage(e))}},J=class extends T{personPath(e){return`${C.PEOPLE.DETAILS}/${e}`}personSubPath(e,t){return`${this.personPath(e)}${t}`}async details(e){let{language:t=this.defaultOptions.language,person_id:n,...r}=e;return this.client.request(this.personPath(n),{language:t,...r})}async changes(e){let{person_id:t,...n}=e;return this.client.request(this.personSubPath(t,C.PEOPLE.CHANGES),n)}async combined_credits(e){let{language:t=this.defaultOptions.language,person_id:n,...r}=e;return this.client.request(this.personSubPath(n,C.PEOPLE.COMBINED_CREDITS),{language:t,...r})}async external_ids(e){return this.client.request(this.personSubPath(e.person_id,C.PEOPLE.EXTERNAL_IDS))}async images(e){return this.client.request(this.personSubPath(e.person_id,C.PEOPLE.IMAGES))}async latest(){return this.client.request(`${C.PEOPLE.DETAILS}${C.PEOPLE.LATEST}`)}async movie_credits(e){let{language:t=this.defaultOptions.language,person_id:n,...r}=e;return this.client.request(this.personSubPath(n,C.PEOPLE.MOVIE_CREDITS),{language:t,...r})}async tagged_images(e){let{person_id:t,...n}=e;return this.client.request(this.personSubPath(t,C.PEOPLE.TAGGED_IMAGES),n)}async translations(e){return this.client.request(this.personSubPath(e.person_id,C.PEOPLE.TRANSLATIONS))}async tv_credits(e){let{language:t=this.defaultOptions.language,person_id:n,...r}=e;return this.client.request(this.personSubPath(n,C.PEOPLE.TV_CREDITS),{language:t,...r})}},Y=class extends T{accountPath(e){return`${C.ACCOUNT.DETAILS}/${e}`}accountSubPath(e,t){return`${this.accountPath(e)}${t}`}async details(e){let{account_id:t,...n}=e;return this.client.request(this.accountPath(t),n)}async add_favorite(e,t){let{account_id:n,...r}=e;return this.client.mutate(`POST`,this.accountSubPath(n,C.ACCOUNT.ADD_FAVORITE),t,r)}async add_to_watchlist(e,t){let{account_id:n,...r}=e;return this.client.mutate(`POST`,this.accountSubPath(n,C.ACCOUNT.ADD_TO_WATCHLIST),t,r)}async favorite_movies(e){let{account_id:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(this.accountSubPath(t,C.ACCOUNT.FAVORITE_MOVIES),{language:n,...r})}async favorite_tv(e){let{account_id:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(this.accountSubPath(t,C.ACCOUNT.FAVORITE_TV),{language:n,...r})}async watchlist_movies(e){let{account_id:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(this.accountSubPath(t,C.ACCOUNT.WATCHLIST_MOVIES),{language:n,...r})}async watchlist_tv(e){let{account_id:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(this.accountSubPath(t,C.ACCOUNT.WATCHLIST_TV),{language:n,...r})}async rated_movies(e){let{account_id:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(this.accountSubPath(t,C.ACCOUNT.RATED_MOVIES),{language:n,...r})}async rated_tv(e){let{account_id:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(this.accountSubPath(t,C.ACCOUNT.RATED_TV),{language:n,...r})}async rated_tv_episodes(e){let{account_id:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(this.accountSubPath(t,C.ACCOUNT.RATED_TV_EPISODES),{language:n,...r})}async lists(e){let{account_id:t,...n}=e;return this.client.request(this.accountSubPath(t,C.ACCOUNT.LISTS),n)}},X=class extends T{async validate_key(){return this.client.request(C.AUTHENTICATION.VALIDATE)}async create_guest_session(){return this.client.request(C.AUTHENTICATION.GUEST_SESSION)}async create_request_token(){return this.client.request(C.AUTHENTICATION.REQUEST_TOKEN)}async create_session(e){return this.client.mutate(`POST`,C.AUTHENTICATION.CREATE_SESSION,e)}async create_session_with_login(e){return this.client.mutate(`POST`,C.AUTHENTICATION.CREATE_SESSION_WITH_LOGIN,e)}async delete_session(e){return this.client.mutate(`DELETE`,C.AUTHENTICATION.DELETE_SESSION,e)}},Z=class extends T{guestSessionPath(e){return`${C.GUEST_SESSIONS.DETAILS}/${e}`}guestSessionSubPath(e,t){return`${this.guestSessionPath(e)}${t}`}async rated_movies(e){let{guest_session_id:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(this.guestSessionSubPath(t,C.GUEST_SESSIONS.RATED_MOVIES),{language:n,...r})}async rated_tv(e){let{guest_session_id:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(this.guestSessionSubPath(t,C.GUEST_SESSIONS.RATED_TV),{language:n,...r})}async rated_tv_episodes(e){let{guest_session_id:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(this.guestSessionSubPath(t,C.GUEST_SESSIONS.RATED_TV_EPISODES),{language:n,...r})}},Q=class extends T{listPath(e){return`${C.LISTS.DETAILS}/${e}`}listSubPath(e,t){return`${this.listPath(e)}${t}`}async details(e){let{list_id:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(this.listPath(t),{language:n,...r})}async create(e,t){return this.client.mutate(`POST`,C.LISTS.DETAILS,t,e)}async delete(e){let{list_id:t,...n}=e;return this.client.mutate(`DELETE`,this.listPath(t),void 0,n)}async add_movie(e,t){let{list_id:n,...r}=e;return this.client.mutate(`POST`,this.listSubPath(n,C.LISTS.ADD_ITEM),t,r)}async remove_movie(e,t){let{list_id:n,...r}=e;return this.client.mutate(`POST`,this.listSubPath(n,C.LISTS.REMOVE_ITEM),t,r)}async check_item_status(e){let{list_id:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(this.listSubPath(t,C.LISTS.ITEM_STATUS),{language:n,...r})}async clear(e){let{list_id:t,...n}=e;return this.client.mutate(`POST`,this.listSubPath(t,C.LISTS.CLEAR),void 0,n)}},ge=class extends T{async create_request_token(e){return this.client.mutate(`POST`,w.AUTH.REQUEST_TOKEN,e??{})}async create_access_token(e){return this.client.mutate(`POST`,w.AUTH.ACCESS_TOKEN,e)}async delete_access_token(e){return this.client.mutate(`DELETE`,w.AUTH.ACCESS_TOKEN,e)}},_e=class extends T{},ve=class extends T{listPath(e){return`${w.LISTS.DETAILS}/${e}`}async create(e){return this.client.mutate(`POST`,w.LISTS.DETAILS,e)}async details({list_id:e,...t}){return this.client.request(this.listPath(e),this.withLanguage(t))}async update({list_id:e,...t}){return this.client.mutate(`PUT`,this.listPath(e),t)}async delete({list_id:e}){return this.client.mutate(`DELETE`,this.listPath(e),{})}async add_items(e,t){return this.client.mutate(`POST`,`${this.listPath(e)}${w.LISTS.ITEMS}`,t)}async update_items(e,t){return this.client.mutate(`PUT`,`${this.listPath(e)}${w.LISTS.ITEMS}`,t)}async remove_items(e,t){return this.client.mutate(`DELETE`,`${this.listPath(e)}${w.LISTS.ITEMS}`,t)}async item_status({list_id:e,...t}){return this.client.request(`${this.listPath(e)}${w.LISTS.ITEM_STATUS}`,t)}async clear(e){return this.client.mutate(`GET`,`${this.listPath(e)}${w.LISTS.CLEAR}`)}},$=class{client;auth;account;lists;constructor(e,t={}){if(!e)throw Error(v.NO_ACCESS_TOKEN);this.client=new S(e,{...t,version:4}),this.auth=new ge(this.client,t),this.account=new _e(this.client,t),this.lists=new ve(this.client,t)}},ye=class{client;accessToken;options;movies;movie_lists;search;images;configuration;genres;keywords;tv_lists;tv_series;watch_providers;certifications;changes;companies;credits;collections;discover;find;networks;tv_episodes;tv_episode_groups;tv_seasons;trending;reviews;people_lists;people;account;authentication;guest_sessions;lists;get v4(){if(!m(this.accessToken))throw Error(v.V4_REQUIRES_JWT);return this._v4||=new $(this.accessToken,this.options),this._v4}_v4;get cache(){if(!this.options.cache)return;let e=this.client;return{clear(){e.clearCache()},invalidate(t,n){return e.invalidateCache(t,n)},get size(){return e.cacheSize}}}constructor(e,t={}){if(!e)throw Error(v.NO_ACCESS_TOKEN);this.accessToken=e,this.options=t,this.client=new S(e,{logger:t.logger,deduplication:t.deduplication,images:t.images,rate_limit:t.rate_limit,retry:t.retry,cache:t.cache,interceptors:t.interceptors}),this.movies=new L(this.client,this.options),this.movie_lists=new I(this.client,this.options),this.search=new R(this.client,this.options),this.images=new x(this.options.images),this.configuration=new j(this.client,this.options),this.genres=new P(this.client,this.options),this.keywords=new F(this.client,this.options),this.tv_lists=new he(this.client,this.options),this.tv_series=new z(this.client,this.options),this.watch_providers=new B(this.client,this.options),this.certifications=new E(this.client,this.options),this.changes=new D(this.client,this.options),this.companies=new O(this.client,this.options),this.credits=new k(this.client,this.options),this.collections=new A(this.client,this.options),this.discover=new M(this.client,this.options),this.find=new N(this.client,this.options),this.networks=new V(this.client,this.options),this.tv_episodes=new H(this.client,this.options),this.tv_episode_groups=new U(this.client,this.options),this.tv_seasons=new W(this.client,this.options),this.trending=new G(this.client,this.options),this.reviews=new K(this.client,this.options),this.people_lists=new q(this.client,this.options),this.people=new J(this.client,this.options),this.account=new Y(this.client,this.options),this.authentication=new X(this.client,this.options),this.guest_sessions=new Z(this.client,this.options),this.lists=new Q(this.client,this.options)}};const be={Premiere:1,TheatricalLimited:2,Theatrical:3,Digital:4,Physical:5,TV:6},xe={1:`Premiere`,2:`Theatrical (Limited)`,3:`Theatrical`,4:`Digital`,5:`Physical`,6:`TV`},Se={ReturningSeries:0,Planned:1,InProduction:2,Ended:3,Canceled:4,Pilot:5},Ce={0:`Returning Series`,1:`Planned`,2:`In Production`,3:`Ended`,4:`Canceled`,5:`Pilot`},we={Documentary:0,News:1,Miniseries:2,Reality:3,Scripted:4,TalkShow:5,Video:6},Te={0:`Documentary`,1:`News`,2:`Miniseries`,3:`Reality`,4:`Scripted`,5:`Talk Show`,6:`Video`},Ee={OriginalAirDate:1,Absolute:2,Dvd:3,Digital:4,StoryArc:5,Production:6,TV:7},De={1:`Original Air Date`,2:`Absolute`,3:`DVD`,4:`Digital`,5:`Story Arc`,6:`Production`,7:`TV`},Oe=[{iso_3166_1:`AD`,english_name:`Andorra`,native_name:`Andorra`},{iso_3166_1:`AE`,english_name:`United Arab Emirates`,native_name:`United Arab Emirates`},{iso_3166_1:`AF`,english_name:`Afghanistan`,native_name:`Afghanistan`},{iso_3166_1:`AG`,english_name:`Antigua and Barbuda`,native_name:`Antigua & Barbuda`},{iso_3166_1:`AI`,english_name:`Anguilla`,native_name:`Anguilla`},{iso_3166_1:`AL`,english_name:`Albania`,native_name:`Albania`},{iso_3166_1:`AM`,english_name:`Armenia`,native_name:`Armenia`},{iso_3166_1:`AN`,english_name:`Netherlands Antilles`,native_name:`Netherlands Antilles`},{iso_3166_1:`AO`,english_name:`Angola`,native_name:`Angola`},{iso_3166_1:`AQ`,english_name:`Antarctica`,native_name:`Antarctica`},{iso_3166_1:`AR`,english_name:`Argentina`,native_name:`Argentina`},{iso_3166_1:`AS`,english_name:`American Samoa`,native_name:`American Samoa`},{iso_3166_1:`AT`,english_name:`Austria`,native_name:`Austria`},{iso_3166_1:`AU`,english_name:`Australia`,native_name:`Australia`},{iso_3166_1:`AW`,english_name:`Aruba`,native_name:`Aruba`},{iso_3166_1:`AZ`,english_name:`Azerbaijan`,native_name:`Azerbaijan`},{iso_3166_1:`BA`,english_name:`Bosnia and Herzegovina`,native_name:`Bosnia & Herzegovina`},{iso_3166_1:`BB`,english_name:`Barbados`,native_name:`Barbados`},{iso_3166_1:`BD`,english_name:`Bangladesh`,native_name:`Bangladesh`},{iso_3166_1:`BE`,english_name:`Belgium`,native_name:`Belgium`},{iso_3166_1:`BF`,english_name:`Burkina Faso`,native_name:`Burkina Faso`},{iso_3166_1:`BG`,english_name:`Bulgaria`,native_name:`Bulgaria`},{iso_3166_1:`BH`,english_name:`Bahrain`,native_name:`Bahrain`},{iso_3166_1:`BI`,english_name:`Burundi`,native_name:`Burundi`},{iso_3166_1:`BJ`,english_name:`Benin`,native_name:`Benin`},{iso_3166_1:`BM`,english_name:`Bermuda`,native_name:`Bermuda`},{iso_3166_1:`BN`,english_name:`Brunei Darussalam`,native_name:`Brunei`},{iso_3166_1:`BO`,english_name:`Bolivia`,native_name:`Bolivia`},{iso_3166_1:`BR`,english_name:`Brazil`,native_name:`Brazil`},{iso_3166_1:`BS`,english_name:`Bahamas`,native_name:`Bahamas`},{iso_3166_1:`BT`,english_name:`Bhutan`,native_name:`Bhutan`},{iso_3166_1:`BU`,english_name:`Burma`,native_name:`Burma`},{iso_3166_1:`BV`,english_name:`Bouvet Island`,native_name:`Bouvet Island`},{iso_3166_1:`BW`,english_name:`Botswana`,native_name:`Botswana`},{iso_3166_1:`BY`,english_name:`Belarus`,native_name:`Belarus`},{iso_3166_1:`BZ`,english_name:`Belize`,native_name:`Belize`},{iso_3166_1:`CA`,english_name:`Canada`,native_name:`Canada`},{iso_3166_1:`CC`,english_name:`Cocos Islands`,native_name:`Cocos (Keeling) Islands`},{iso_3166_1:`CD`,english_name:`Congo`,native_name:`Democratic Republic of the Congo (Kinshasa)`},{iso_3166_1:`CF`,english_name:`Central African Republic`,native_name:`Central African Republic`},{iso_3166_1:`CG`,english_name:`Congo`,native_name:`Republic of the Congo (Brazzaville)`},{iso_3166_1:`CH`,english_name:`Switzerland`,native_name:`Switzerland`},{iso_3166_1:`CI`,english_name:`Cote D'Ivoire`,native_name:`Côte d’Ivoire`},{iso_3166_1:`CK`,english_name:`Cook Islands`,native_name:`Cook Islands`},{iso_3166_1:`CL`,english_name:`Chile`,native_name:`Chile`},{iso_3166_1:`CM`,english_name:`Cameroon`,native_name:`Cameroon`},{iso_3166_1:`CN`,english_name:`China`,native_name:`China`},{iso_3166_1:`CO`,english_name:`Colombia`,native_name:`Colombia`},{iso_3166_1:`CR`,english_name:`Costa Rica`,native_name:`Costa Rica`},{iso_3166_1:`CS`,english_name:`Serbia and Montenegro`,native_name:`Serbia and Montenegro`},{iso_3166_1:`CU`,english_name:`Cuba`,native_name:`Cuba`},{iso_3166_1:`CV`,english_name:`Cape Verde`,native_name:`Cape Verde`},{iso_3166_1:`CX`,english_name:`Christmas Island`,native_name:`Christmas Island`},{iso_3166_1:`CY`,english_name:`Cyprus`,native_name:`Cyprus`},{iso_3166_1:`CZ`,english_name:`Czech Republic`,native_name:`Czech Republic`},{iso_3166_1:`DE`,english_name:`Germany`,native_name:`Germany`},{iso_3166_1:`DJ`,english_name:`Djibouti`,native_name:`Djibouti`},{iso_3166_1:`DK`,english_name:`Denmark`,native_name:`Denmark`},{iso_3166_1:`DM`,english_name:`Dominica`,native_name:`Dominica`},{iso_3166_1:`DO`,english_name:`Dominican Republic`,native_name:`Dominican Republic`},{iso_3166_1:`DZ`,english_name:`Algeria`,native_name:`Algeria`},{iso_3166_1:`EC`,english_name:`Ecuador`,native_name:`Ecuador`},{iso_3166_1:`EE`,english_name:`Estonia`,native_name:`Estonia`},{iso_3166_1:`EG`,english_name:`Egypt`,native_name:`Egypt`},{iso_3166_1:`EH`,english_name:`Western Sahara`,native_name:`Western Sahara`},{iso_3166_1:`ER`,english_name:`Eritrea`,native_name:`Eritrea`},{iso_3166_1:`ES`,english_name:`Spain`,native_name:`Spain`},{iso_3166_1:`ET`,english_name:`Ethiopia`,native_name:`Ethiopia`},{iso_3166_1:`FI`,english_name:`Finland`,native_name:`Finland`},{iso_3166_1:`FJ`,english_name:`Fiji`,native_name:`Fiji`},{iso_3166_1:`FK`,english_name:`Falkland Islands`,native_name:`Falkland Islands`},{iso_3166_1:`FM`,english_name:`Micronesia`,native_name:`Micronesia`},{iso_3166_1:`FO`,english_name:`Faeroe Islands`,native_name:`Faroe Islands`},{iso_3166_1:`FR`,english_name:`France`,native_name:`France`},{iso_3166_1:`GA`,english_name:`Gabon`,native_name:`Gabon`},{iso_3166_1:`GB`,english_name:`United Kingdom`,native_name:`United Kingdom`},{iso_3166_1:`GD`,english_name:`Grenada`,native_name:`Grenada`},{iso_3166_1:`GE`,english_name:`Georgia`,native_name:`Georgia`},{iso_3166_1:`GF`,english_name:`French Guiana`,native_name:`French Guiana`},{iso_3166_1:`GH`,english_name:`Ghana`,native_name:`Ghana`},{iso_3166_1:`GI`,english_name:`Gibraltar`,native_name:`Gibraltar`},{iso_3166_1:`GL`,english_name:`Greenland`,native_name:`Greenland`},{iso_3166_1:`GM`,english_name:`Gambia`,native_name:`Gambia`},{iso_3166_1:`GN`,english_name:`Guinea`,native_name:`Guinea`},{iso_3166_1:`GP`,english_name:`Guadaloupe`,native_name:`Guadeloupe`},{iso_3166_1:`GQ`,english_name:`Equatorial Guinea`,native_name:`Equatorial Guinea`},{iso_3166_1:`GR`,english_name:`Greece`,native_name:`Greece`},{iso_3166_1:`GS`,english_name:`South Georgia and the South Sandwich Islands`,native_name:`South Georgia & South Sandwich Islands`},{iso_3166_1:`GT`,english_name:`Guatemala`,native_name:`Guatemala`},{iso_3166_1:`GU`,english_name:`Guam`,native_name:`Guam`},{iso_3166_1:`GW`,english_name:`Guinea-Bissau`,native_name:`Guinea-Bissau`},{iso_3166_1:`GY`,english_name:`Guyana`,native_name:`Guyana`},{iso_3166_1:`HK`,english_name:`Hong Kong`,native_name:`Hong Kong SAR China`},{iso_3166_1:`HM`,english_name:`Heard and McDonald Islands`,native_name:`Heard & McDonald Islands`},{iso_3166_1:`HN`,english_name:`Honduras`,native_name:`Honduras`},{iso_3166_1:`HR`,english_name:`Croatia`,native_name:`Croatia`},{iso_3166_1:`HT`,english_name:`Haiti`,native_name:`Haiti`},{iso_3166_1:`HU`,english_name:`Hungary`,native_name:`Hungary`},{iso_3166_1:`ID`,english_name:`Indonesia`,native_name:`Indonesia`},{iso_3166_1:`IE`,english_name:`Ireland`,native_name:`Ireland`},{iso_3166_1:`IL`,english_name:`Israel`,native_name:`Israel`},{iso_3166_1:`IN`,english_name:`India`,native_name:`India`},{iso_3166_1:`IO`,english_name:`British Indian Ocean Territory`,native_name:`British Indian Ocean Territory`},{iso_3166_1:`IQ`,english_name:`Iraq`,native_name:`Iraq`},{iso_3166_1:`IR`,english_name:`Iran`,native_name:`Iran`},{iso_3166_1:`IS`,english_name:`Iceland`,native_name:`Iceland`},{iso_3166_1:`IT`,english_name:`Italy`,native_name:`Italy`},{iso_3166_1:`JM`,english_name:`Jamaica`,native_name:`Jamaica`},{iso_3166_1:`JO`,english_name:`Jordan`,native_name:`Jordan`},{iso_3166_1:`JP`,english_name:`Japan`,native_name:`Japan`},{iso_3166_1:`KE`,english_name:`Kenya`,native_name:`Kenya`},{iso_3166_1:`KG`,english_name:`Kyrgyz Republic`,native_name:`Kyrgyzstan`},{iso_3166_1:`KH`,english_name:`Cambodia`,native_name:`Cambodia`},{iso_3166_1:`KI`,english_name:`Kiribati`,native_name:`Kiribati`},{iso_3166_1:`KM`,english_name:`Comoros`,native_name:`Comoros`},{iso_3166_1:`KN`,english_name:`St. Kitts and Nevis`,native_name:`St. Kitts & Nevis`},{iso_3166_1:`KP`,english_name:`North Korea`,native_name:`North Korea`},{iso_3166_1:`KR`,english_name:`South Korea`,native_name:`South Korea`},{iso_3166_1:`KW`,english_name:`Kuwait`,native_name:`Kuwait`},{iso_3166_1:`KY`,english_name:`Cayman Islands`,native_name:`Cayman Islands`},{iso_3166_1:`KZ`,english_name:`Kazakhstan`,native_name:`Kazakhstan`},{iso_3166_1:`LA`,english_name:`Lao People's Democratic Republic`,native_name:`Laos`},{iso_3166_1:`LB`,english_name:`Lebanon`,native_name:`Lebanon`},{iso_3166_1:`LC`,english_name:`St. Lucia`,native_name:`St. Lucia`},{iso_3166_1:`LI`,english_name:`Liechtenstein`,native_name:`Liechtenstein`},{iso_3166_1:`LK`,english_name:`Sri Lanka`,native_name:`Sri Lanka`},{iso_3166_1:`LR`,english_name:`Liberia`,native_name:`Liberia`},{iso_3166_1:`LS`,english_name:`Lesotho`,native_name:`Lesotho`},{iso_3166_1:`LT`,english_name:`Lithuania`,native_name:`Lithuania`},{iso_3166_1:`LU`,english_name:`Luxembourg`,native_name:`Luxembourg`},{iso_3166_1:`LV`,english_name:`Latvia`,native_name:`Latvia`},{iso_3166_1:`LY`,english_name:`Libyan Arab Jamahiriya`,native_name:`Libya`},{iso_3166_1:`MA`,english_name:`Morocco`,native_name:`Morocco`},{iso_3166_1:`MC`,english_name:`Monaco`,native_name:`Monaco`},{iso_3166_1:`MD`,english_name:`Moldova`,native_name:`Moldova`},{iso_3166_1:`ME`,english_name:`Montenegro`,native_name:`Montenegro`},{iso_3166_1:`MG`,english_name:`Madagascar`,native_name:`Madagascar`},{iso_3166_1:`MH`,english_name:`Marshall Islands`,native_name:`Marshall Islands`},{iso_3166_1:`MK`,english_name:`Macedonia`,native_name:`Macedonia`},{iso_3166_1:`ML`,english_name:`Mali`,native_name:`Mali`},{iso_3166_1:`MM`,english_name:`Myanmar`,native_name:`Myanmar (Burma)`},{iso_3166_1:`MN`,english_name:`Mongolia`,native_name:`Mongolia`},{iso_3166_1:`MO`,english_name:`Macao`,native_name:`Macau SAR China`},{iso_3166_1:`MP`,english_name:`Northern Mariana Islands`,native_name:`Northern Mariana Islands`},{iso_3166_1:`MQ`,english_name:`Martinique`,native_name:`Martinique`},{iso_3166_1:`MR`,english_name:`Mauritania`,native_name:`Mauritania`},{iso_3166_1:`MS`,english_name:`Montserrat`,native_name:`Montserrat`},{iso_3166_1:`MT`,english_name:`Malta`,native_name:`Malta`},{iso_3166_1:`MU`,english_name:`Mauritius`,native_name:`Mauritius`},{iso_3166_1:`MV`,english_name:`Maldives`,native_name:`Maldives`},{iso_3166_1:`MW`,english_name:`Malawi`,native_name:`Malawi`},{iso_3166_1:`MX`,english_name:`Mexico`,native_name:`Mexico`},{iso_3166_1:`MY`,english_name:`Malaysia`,native_name:`Malaysia`},{iso_3166_1:`MZ`,english_name:`Mozambique`,native_name:`Mozambique`},{iso_3166_1:`NA`,english_name:`Namibia`,native_name:`Namibia`},{iso_3166_1:`NC`,english_name:`New Caledonia`,native_name:`New Caledonia`},{iso_3166_1:`NE`,english_name:`Niger`,native_name:`Niger`},{iso_3166_1:`NF`,english_name:`Norfolk Island`,native_name:`Norfolk Island`},{iso_3166_1:`NG`,english_name:`Nigeria`,native_name:`Nigeria`},{iso_3166_1:`NI`,english_name:`Nicaragua`,native_name:`Nicaragua`},{iso_3166_1:`NL`,english_name:`Netherlands`,native_name:`Netherlands`},{iso_3166_1:`NO`,english_name:`Norway`,native_name:`Norway`},{iso_3166_1:`NP`,english_name:`Nepal`,native_name:`Nepal`},{iso_3166_1:`NR`,english_name:`Nauru`,native_name:`Nauru`},{iso_3166_1:`NU`,english_name:`Niue`,native_name:`Niue`},{iso_3166_1:`NZ`,english_name:`New Zealand`,native_name:`New Zealand`},{iso_3166_1:`OM`,english_name:`Oman`,native_name:`Oman`},{iso_3166_1:`PA`,english_name:`Panama`,native_name:`Panama`},{iso_3166_1:`PE`,english_name:`Peru`,native_name:`Peru`},{iso_3166_1:`PF`,english_name:`French Polynesia`,native_name:`French Polynesia`},{iso_3166_1:`PG`,english_name:`Papua New Guinea`,native_name:`Papua New Guinea`},{iso_3166_1:`PH`,english_name:`Philippines`,native_name:`Philippines`},{iso_3166_1:`PK`,english_name:`Pakistan`,native_name:`Pakistan`},{iso_3166_1:`PL`,english_name:`Poland`,native_name:`Poland`},{iso_3166_1:`PM`,english_name:`St. Pierre and Miquelon`,native_name:`St. Pierre & Miquelon`},{iso_3166_1:`PN`,english_name:`Pitcairn Island`,native_name:`Pitcairn Islands`},{iso_3166_1:`PR`,english_name:`Puerto Rico`,native_name:`Puerto Rico`},{iso_3166_1:`PS`,english_name:`Palestinian Territory`,native_name:`Palestinian Territories`},{iso_3166_1:`PT`,english_name:`Portugal`,native_name:`Portugal`},{iso_3166_1:`PW`,english_name:`Palau`,native_name:`Palau`},{iso_3166_1:`PY`,english_name:`Paraguay`,native_name:`Paraguay`},{iso_3166_1:`QA`,english_name:`Qatar`,native_name:`Qatar`},{iso_3166_1:`RE`,english_name:`Reunion`,native_name:`Réunion`},{iso_3166_1:`RO`,english_name:`Romania`,native_name:`Romania`},{iso_3166_1:`RS`,english_name:`Serbia`,native_name:`Serbia`},{iso_3166_1:`RU`,english_name:`Russia`,native_name:`Russia`},{iso_3166_1:`RW`,english_name:`Rwanda`,native_name:`Rwanda`},{iso_3166_1:`SA`,english_name:`Saudi Arabia`,native_name:`Saudi Arabia`},{iso_3166_1:`SB`,english_name:`Solomon Islands`,native_name:`Solomon Islands`},{iso_3166_1:`SC`,english_name:`Seychelles`,native_name:`Seychelles`},{iso_3166_1:`SD`,english_name:`Sudan`,native_name:`Sudan`},{iso_3166_1:`SE`,english_name:`Sweden`,native_name:`Sweden`},{iso_3166_1:`SG`,english_name:`Singapore`,native_name:`Singapore`},{iso_3166_1:`SH`,english_name:`St. Helena`,native_name:`St. Helena`},{iso_3166_1:`SI`,english_name:`Slovenia`,native_name:`Slovenia`},{iso_3166_1:`SJ`,english_name:`Svalbard & Jan Mayen Islands`,native_name:`Svalbard & Jan Mayen`},{iso_3166_1:`SK`,english_name:`Slovakia`,native_name:`Slovakia`},{iso_3166_1:`SL`,english_name:`Sierra Leone`,native_name:`Sierra Leone`},{iso_3166_1:`SM`,english_name:`San Marino`,native_name:`San Marino`},{iso_3166_1:`SN`,english_name:`Senegal`,native_name:`Senegal`},{iso_3166_1:`SO`,english_name:`Somalia`,native_name:`Somalia`},{iso_3166_1:`SR`,english_name:`Suriname`,native_name:`Suriname`},{iso_3166_1:`SS`,english_name:`South Sudan`,native_name:`South Sudan`},{iso_3166_1:`ST`,english_name:`Sao Tome and Principe`,native_name:`São Tomé & Príncipe`},{iso_3166_1:`SU`,english_name:`Soviet Union`,native_name:`Soviet Union`},{iso_3166_1:`SV`,english_name:`El Salvador`,native_name:`El Salvador`},{iso_3166_1:`SY`,english_name:`Syrian Arab Republic`,native_name:`Syria`},{iso_3166_1:`SZ`,english_name:`Swaziland`,native_name:`Eswatini (Swaziland)`},{iso_3166_1:`TC`,english_name:`Turks and Caicos Islands`,native_name:`Turks & Caicos Islands`},{iso_3166_1:`TD`,english_name:`Chad`,native_name:`Chad`},{iso_3166_1:`TF`,english_name:`French Southern Territories`,native_name:`French Southern Territories`},{iso_3166_1:`TG`,english_name:`Togo`,native_name:`Togo`},{iso_3166_1:`TH`,english_name:`Thailand`,native_name:`Thailand`},{iso_3166_1:`TJ`,english_name:`Tajikistan`,native_name:`Tajikistan`},{iso_3166_1:`TK`,english_name:`Tokelau`,native_name:`Tokelau`},{iso_3166_1:`TL`,english_name:`Timor-Leste`,native_name:`Timor-Leste`},{iso_3166_1:`TM`,english_name:`Turkmenistan`,native_name:`Turkmenistan`},{iso_3166_1:`TN`,english_name:`Tunisia`,native_name:`Tunisia`},{iso_3166_1:`TO`,english_name:`Tonga`,native_name:`Tonga`},{iso_3166_1:`TP`,english_name:`East Timor`,native_name:`East Timor`},{iso_3166_1:`TR`,english_name:`Turkey`,native_name:`Turkey`},{iso_3166_1:`TT`,english_name:`Trinidad and Tobago`,native_name:`Trinidad & Tobago`},{iso_3166_1:`TV`,english_name:`Tuvalu`,native_name:`Tuvalu`},{iso_3166_1:`TW`,english_name:`Taiwan`,native_name:`Taiwan`},{iso_3166_1:`TZ`,english_name:`Tanzania`,native_name:`Tanzania`},{iso_3166_1:`UA`,english_name:`Ukraine`,native_name:`Ukraine`},{iso_3166_1:`UG`,english_name:`Uganda`,native_name:`Uganda`},{iso_3166_1:`UM`,english_name:`United States Minor Outlying Islands`,native_name:`U.S. Outlying Islands`},{iso_3166_1:`US`,english_name:`United States of America`,native_name:`United States`},{iso_3166_1:`UY`,english_name:`Uruguay`,native_name:`Uruguay`},{iso_3166_1:`UZ`,english_name:`Uzbekistan`,native_name:`Uzbekistan`},{iso_3166_1:`VA`,english_name:`Holy See`,native_name:`Vatican City`},{iso_3166_1:`VC`,english_name:`St. Vincent and the Grenadines`,native_name:`St. Vincent & Grenadines`},{iso_3166_1:`VE`,english_name:`Venezuela`,native_name:`Venezuela`},{iso_3166_1:`VG`,english_name:`British Virgin Islands`,native_name:`British Virgin Islands`},{iso_3166_1:`VI`,english_name:`US Virgin Islands`,native_name:`U.S. Virgin Islands`},{iso_3166_1:`VN`,english_name:`Vietnam`,native_name:`Vietnam`},{iso_3166_1:`VU`,english_name:`Vanuatu`,native_name:`Vanuatu`},{iso_3166_1:`WF`,english_name:`Wallis and Futuna Islands`,native_name:`Wallis & Futuna`},{iso_3166_1:`WS`,english_name:`Samoa`,native_name:`Samoa`},{iso_3166_1:`XC`,english_name:`Czechoslovakia`,native_name:`Czechoslovakia`},{iso_3166_1:`XG`,english_name:`East Germany`,native_name:`East Germany`},{iso_3166_1:`XI`,english_name:`Northern Ireland`,native_name:`Northern Ireland`},{iso_3166_1:`XK`,english_name:`Kosovo`,native_name:`Kosovo`},{iso_3166_1:`YE`,english_name:`Yemen`,native_name:`Yemen`},{iso_3166_1:`YT`,english_name:`Mayotte`,native_name:`Mayotte`},{iso_3166_1:`YU`,english_name:`Yugoslavia`,native_name:`Yugoslavia`},{iso_3166_1:`ZA`,english_name:`South Africa`,native_name:`South Africa`},{iso_3166_1:`ZM`,english_name:`Zambia`,native_name:`Zambia`},{iso_3166_1:`ZR`,english_name:`Zaire`,native_name:`Zaire`},{iso_3166_1:`ZW`,english_name:`Zimbabwe`,native_name:`Zimbabwe`}];function ke(e){return e.media_type===`movie`}function Ae(e){return e.media_type===`tv`}export{Y as AccountAPI,X as AuthenticationAPI,r as BACKDROP_SIZES,E as CertificationsAPI,D as ChangesAPI,A as CollectionsAPI,O as CompaniesAPI,j as ConfigurationAPI,k as CreditsAPI,M as DiscoverAPI,Se as DiscoverTVStatus,Ce as DiscoverTVStatusLabel,we as DiscoverTVType,Te as DiscoverTVTypeLabel,N as FindAPI,P as GenresAPI,Z as GuestSessionsAPI,t as IMAGE_BASE_URL,n as IMAGE_SECURE_BASE_URL,F as KeywordsAPI,i as LOGO_SIZES,Q as ListsAPI,I as MovieListsAPI,be as MovieReleaseType,xe as MovieReleaseTypeLabel,L as MoviesAPI,V as NetworksAPI,a as POSTER_SIZES,o as PROFILE_SIZES,J as PeopleAPI,q as PeopleListsAPI,K as ReviewsAPI,s as STILL_SIZES,R as SearchAPI,ye as TMDB,Oe as TMDBCountries,e as TMDBError,c as TMDBLogger,$ as TMDBv4,Ee as TVEpisodeGroupType,De as TVEpisodeGroupTypeLabel,U as TVEpisodeGroupsAPI,H as TVEpisodesAPI,W as TVSeasonsAPI,z as TVSeriesAPI,he as TVSeriesListsAPI,G as TrendingAPI,_e as V4AccountAPI,ge as V4AuthAPI,ve as V4ListsAPI,B as WatchProvidersAPI,ae as fetchAllPages,ce as getPageInfo,ee as hasBackdropPath,re as hasLogoPath,oe as hasNextPage,_ as hasPosterPath,se as hasPreviousPage,te as hasProfilePath,ne as hasStillPath,m as isJwt,ke as isKnownForMovie,Ae as isKnownForTV,g as isPlainObject,h as isRecord,ie as paginate};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lorenzopant/tmdb",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.23.0",
|
|
4
4
|
"description": "A completely type-safe The Movie Database (TMDB) API wrapper for typescript applications.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"api",
|
|
@@ -45,12 +45,14 @@
|
|
|
45
45
|
"lint": "oxlint .",
|
|
46
46
|
"lint:check": "oxlint --type-aware --type-check .",
|
|
47
47
|
"test": "pnpm run test:unit",
|
|
48
|
-
"test:unit": "vitest run --exclude '**/*.integration.test.ts'",
|
|
48
|
+
"test:unit": "vitest run --exclude '**/*.integration.test.ts' --exclude '**/*.drift.test.ts'",
|
|
49
49
|
"test:integration": "vitest run integration",
|
|
50
|
+
"test:drift": "tsx scripts/gen-type-tree.ts && vitest run drift --coverage.enabled=false",
|
|
51
|
+
"gen:type-tree": "tsx scripts/gen-type-tree.ts",
|
|
50
52
|
"test:watch": "vitest",
|
|
51
53
|
"test:ui": "vitest --ui",
|
|
52
54
|
"test:coverage": "vitest --coverage",
|
|
53
|
-
"typecheck": "tsc --noEmit"
|
|
55
|
+
"typecheck": "tsc --noEmit && tsc -p scripts/tsconfig.json"
|
|
54
56
|
},
|
|
55
57
|
"devDependencies": {
|
|
56
58
|
"@types/node": "^25.5.0",
|