@lorenzopant/tmdb 1.17.1 → 1.17.2
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.ts +5087 -4
- package/dist/index.js +3721 -5
- package/package.json +12 -5
- package/dist/client.d.ts +0 -51
- package/dist/client.js +0 -166
- package/dist/endpoints/base.d.ts +0 -22
- package/dist/endpoints/base.js +0 -32
- package/dist/endpoints/certifications.d.ts +0 -20
- package/dist/endpoints/certifications.js +0 -24
- package/dist/endpoints/changes.d.ts +0 -40
- package/dist/endpoints/changes.js +0 -46
- package/dist/endpoints/collections.d.ts +0 -39
- package/dist/endpoints/collections.js +0 -52
- package/dist/endpoints/companies.d.ts +0 -37
- package/dist/endpoints/companies.js +0 -49
- package/dist/endpoints/configuration.d.ts +0 -72
- package/dist/endpoints/configuration.js +0 -83
- package/dist/endpoints/credits.d.ts +0 -16
- package/dist/endpoints/credits.js +0 -22
- package/dist/endpoints/discover.d.ts +0 -36
- package/dist/endpoints/discover.js +0 -61
- package/dist/endpoints/find.d.ts +0 -16
- package/dist/endpoints/find.js +0 -21
- package/dist/endpoints/genres.d.ts +0 -25
- package/dist/endpoints/genres.js +0 -28
- package/dist/endpoints/keywords.d.ts +0 -29
- package/dist/endpoints/keywords.js +0 -38
- package/dist/endpoints/movie_lists.d.ts +0 -53
- package/dist/endpoints/movie_lists.js +0 -65
- package/dist/endpoints/movies.d.ts +0 -202
- package/dist/endpoints/movies.js +0 -255
- package/dist/endpoints/networks.d.ts +0 -36
- package/dist/endpoints/networks.js +0 -46
- package/dist/endpoints/people.d.ts +0 -91
- package/dist/endpoints/people.js +0 -128
- package/dist/endpoints/people_lists.d.ts +0 -16
- package/dist/endpoints/people_lists.js +0 -16
- package/dist/endpoints/reviews.d.ts +0 -14
- package/dist/endpoints/reviews.js +0 -16
- package/dist/endpoints/search.d.ts +0 -88
- package/dist/endpoints/search.js +0 -102
- package/dist/endpoints/trending.d.ts +0 -36
- package/dist/endpoints/trending.js +0 -48
- package/dist/endpoints/tv_episode_groups.d.ts +0 -13
- package/dist/endpoints/tv_episode_groups.js +0 -16
- package/dist/endpoints/tv_episodes.d.ts +0 -110
- package/dist/endpoints/tv_episodes.js +0 -136
- package/dist/endpoints/tv_seasons.d.ts +0 -128
- package/dist/endpoints/tv_seasons.js +0 -164
- package/dist/endpoints/tv_series.d.ts +0 -244
- package/dist/endpoints/tv_series.js +0 -311
- package/dist/endpoints/tv_series_lists.d.ts +0 -51
- package/dist/endpoints/tv_series_lists.js +0 -63
- package/dist/endpoints/watch_providers.d.ts +0 -34
- package/dist/endpoints/watch_providers.js +0 -46
- package/dist/errors/messages.d.ts +0 -15
- package/dist/errors/messages.js +0 -47
- package/dist/errors/tmdb.d.ts +0 -45
- package/dist/errors/tmdb.js +0 -39
- package/dist/images/images.d.ts +0 -12
- package/dist/images/images.js +0 -26
- package/dist/routes.d.ts +0 -157
- package/dist/routes.js +0 -157
- package/dist/tmdb.d.ts +0 -61
- package/dist/tmdb.js +0 -94
- package/dist/types/collections.d.ts +0 -72
- package/dist/types/collections.js +0 -1
- package/dist/types/common/certifications.d.ts +0 -19
- package/dist/types/common/certifications.js +0 -1
- package/dist/types/common/changes.d.ts +0 -44
- package/dist/types/common/changes.js +0 -1
- package/dist/types/common/images.d.ts +0 -64
- package/dist/types/common/images.js +0 -1
- package/dist/types/common/index.d.ts +0 -6
- package/dist/types/common/index.js +0 -6
- package/dist/types/common/media.d.ts +0 -305
- package/dist/types/common/media.js +0 -1
- package/dist/types/common/pagination.d.ts +0 -6
- package/dist/types/common/pagination.js +0 -1
- package/dist/types/common/params.d.ts +0 -27
- package/dist/types/common/params.js +0 -1
- package/dist/types/companies.d.ts +0 -53
- package/dist/types/companies.js +0 -1
- package/dist/types/config/configuration.d.ts +0 -56
- package/dist/types/config/configuration.js +0 -1
- package/dist/types/config/countries.d.ts +0 -3
- package/dist/types/config/countries.js +0 -1257
- package/dist/types/config/images.d.ts +0 -49
- package/dist/types/config/images.js +0 -13
- package/dist/types/config/index.d.ts +0 -6
- package/dist/types/config/index.js +0 -6
- package/dist/types/config/languages.d.ts +0 -11
- package/dist/types/config/languages.js +0 -1
- package/dist/types/config/options.d.ts +0 -46
- package/dist/types/config/options.js +0 -1
- package/dist/types/config/timezones.d.ts +0 -751
- package/dist/types/config/timezones.js +0 -1149
- package/dist/types/credits.d.ts +0 -148
- package/dist/types/credits.js +0 -1
- package/dist/types/discover.d.ts +0 -130
- package/dist/types/discover.js +0 -27
- package/dist/types/enums.d.ts +0 -8
- package/dist/types/enums.js +0 -9
- package/dist/types/find.d.ts +0 -103
- package/dist/types/find.js +0 -1
- package/dist/types/index.d.ts +0 -21
- package/dist/types/index.js +0 -21
- package/dist/types/keywords.d.ts +0 -19
- package/dist/types/keywords.js +0 -1
- package/dist/types/movies.d.ts +0 -304
- package/dist/types/movies.js +0 -1
- package/dist/types/networks.d.ts +0 -45
- package/dist/types/networks.js +0 -1
- package/dist/types/people-lists.d.ts +0 -5
- package/dist/types/people-lists.js +0 -1
- package/dist/types/people.d.ts +0 -214
- package/dist/types/people.js +0 -1
- package/dist/types/reviews.d.ts +0 -22
- package/dist/types/reviews.js +0 -1
- package/dist/types/search.d.ts +0 -198
- package/dist/types/search.js +0 -1
- package/dist/types/trending.d.ts +0 -55
- package/dist/types/trending.js +0 -1
- package/dist/types/tv-episode-groups.d.ts +0 -63
- package/dist/types/tv-episode-groups.js +0 -13
- package/dist/types/tv-episodes.d.ts +0 -98
- package/dist/types/tv-episodes.js +0 -1
- package/dist/types/tv-seasons.d.ts +0 -133
- package/dist/types/tv-seasons.js +0 -1
- package/dist/types/tv-series.d.ts +0 -445
- package/dist/types/tv-series.js +0 -1
- package/dist/types/utility.d.ts +0 -16
- package/dist/types/utility.js +0 -10
- package/dist/types/watch-providers.d.ts +0 -34
- package/dist/types/watch-providers.js +0 -1
- package/dist/utils/index.d.ts +0 -2
- package/dist/utils/index.js +0 -2
- package/dist/utils/jwt.d.ts +0 -1
- package/dist/utils/jwt.js +0 -61
- package/dist/utils/logger.d.ts +0 -18
- package/dist/utils/logger.js +0 -40
|
@@ -1,445 +0,0 @@
|
|
|
1
|
-
import { AlternativeTitle, Cast, Changes, ContentRating, Credit, Crew, DateRange, Genre, ImageItem, ImagesResult, Keyword, PaginatedResponse, ProductionCompany, ProductionCountry, Review, SpokenLanguage, TranslationResults, WithLanguage, WithLanguagePage, WithParams } from "./common";
|
|
2
|
-
import { CountryISO3166_1 } from "./config/countries";
|
|
3
|
-
import { NetworkItem } from "./networks";
|
|
4
|
-
import { VideoItem } from "./common";
|
|
5
|
-
import { Language, LanguageISO6391, Timezone } from "./config";
|
|
6
|
-
import { TVSeriesResultItem } from "./search";
|
|
7
|
-
import { Prettify } from "./utility";
|
|
8
|
-
/**
|
|
9
|
-
* Represent the detailed information about a TV show.
|
|
10
|
-
*/
|
|
11
|
-
export type TVSeriesDetails = {
|
|
12
|
-
/** The path to the backdrop image, or null if not available */
|
|
13
|
-
backdrop_path: string | null;
|
|
14
|
-
/** Array of creators who developed the TV show */
|
|
15
|
-
created_by: Pick<Credit, "id" | "credit_id" | "gender" | "name" | "profile_path">[];
|
|
16
|
-
/** Array of typical episode runtimes in minutes */
|
|
17
|
-
episode_run_time: number[];
|
|
18
|
-
/** The date the first episode aired */
|
|
19
|
-
first_air_date: string;
|
|
20
|
-
/** Array of genres associated with the TV show */
|
|
21
|
-
genres: Genre[];
|
|
22
|
-
/** The official homepage URL for the TV show, or null if not available */
|
|
23
|
-
homepage: string | null;
|
|
24
|
-
/** The unique identifier for the TV show */
|
|
25
|
-
id: number;
|
|
26
|
-
/** Indicates whether the TV show is currently in production */
|
|
27
|
-
in_production: boolean;
|
|
28
|
-
/** Array of language codes used in the TV show */
|
|
29
|
-
languages: string[];
|
|
30
|
-
/** The date the most recent episode aired */
|
|
31
|
-
last_air_date: string;
|
|
32
|
-
/** Details of the last episode that aired, if available */
|
|
33
|
-
last_episode_to_air?: TVEpisodeItem | null;
|
|
34
|
-
/** The title of the TV show */
|
|
35
|
-
name: string;
|
|
36
|
-
/** Details of the next episode to air, if available */
|
|
37
|
-
next_episode_to_air?: TVEpisodeItem;
|
|
38
|
-
/** Array of networks that broadcast the TV show */
|
|
39
|
-
networks?: NetworkItem[];
|
|
40
|
-
/** The total number of episodes across all seasons */
|
|
41
|
-
number_of_episodes: number;
|
|
42
|
-
/** The total number of seasons */
|
|
43
|
-
number_of_seasons: number;
|
|
44
|
-
/** Array of country codes where the show originated (ISO 3166-1 format) */
|
|
45
|
-
origin_country: CountryISO3166_1[];
|
|
46
|
-
/** The original language code of the TV show */
|
|
47
|
-
original_language: string;
|
|
48
|
-
/** The original title of the TV show */
|
|
49
|
-
original_name: string;
|
|
50
|
-
/** A brief description or summary of the TV show, or null if not available */
|
|
51
|
-
overview: string | null;
|
|
52
|
-
/** The popularity score of the TV show */
|
|
53
|
-
popularity: number;
|
|
54
|
-
/** The path to the poster image, or null if not available */
|
|
55
|
-
poster_path: string | null;
|
|
56
|
-
/** Array of companies that produced the TV show */
|
|
57
|
-
production_companies?: ProductionCompany[];
|
|
58
|
-
/** Array of countries where the TV show was produced */
|
|
59
|
-
production_countries?: ProductionCountry[];
|
|
60
|
-
/** Array of all seasons in the TV show */
|
|
61
|
-
seasons?: TVSeasonItem[];
|
|
62
|
-
/** Array of languages spoken in the TV show with full names */
|
|
63
|
-
spoken_languages?: SpokenLanguage[];
|
|
64
|
-
/** The current status of the TV show (e.g., "Returning Series", "Ended") */
|
|
65
|
-
status?: string;
|
|
66
|
-
/** The type of TV show (e.g., "Scripted", "Documentary", "Reality") */
|
|
67
|
-
type?: string;
|
|
68
|
-
/** The average rating score for the TV show (0-10 scale) */
|
|
69
|
-
vote_average: number;
|
|
70
|
-
/** The total number of votes received for the TV show */
|
|
71
|
-
vote_count: number;
|
|
72
|
-
};
|
|
73
|
-
export type TVEpisodeItem = {
|
|
74
|
-
/** The unique identifier for the episode */
|
|
75
|
-
id: number;
|
|
76
|
-
/** The title of the episode */
|
|
77
|
-
name: string;
|
|
78
|
-
/** A brief description or summary of the episode's plot */
|
|
79
|
-
overview: string;
|
|
80
|
-
/** The average rating score for the episode (0-10 scale) */
|
|
81
|
-
vote_average: number;
|
|
82
|
-
/** The total number of votes received for the episode */
|
|
83
|
-
vote_count: number;
|
|
84
|
-
/** The date the episode first aired */
|
|
85
|
-
air_date?: string | null;
|
|
86
|
-
/** The episode number within its season */
|
|
87
|
-
episode_number: number;
|
|
88
|
-
/** The production code used internally during filming */
|
|
89
|
-
production_code?: string | null;
|
|
90
|
-
/** The runtime of the episode in minutes */
|
|
91
|
-
runtime?: number | null;
|
|
92
|
-
/** The season number this episode belongs to */
|
|
93
|
-
season_number: number;
|
|
94
|
-
/** The unique identifier of the TV show this episode belongs to */
|
|
95
|
-
show_id: number;
|
|
96
|
-
/** The path to the episode's still image (screenshot) */
|
|
97
|
-
still_path?: string | null;
|
|
98
|
-
};
|
|
99
|
-
export type TVSeasonItem = {
|
|
100
|
-
/** The date the season first aired, or null if not available */
|
|
101
|
-
air_date?: string;
|
|
102
|
-
/** The total number of episodes in the season */
|
|
103
|
-
episode_count: number;
|
|
104
|
-
/** The unique identifier for the season */
|
|
105
|
-
id: number;
|
|
106
|
-
/** The title of the season */
|
|
107
|
-
name: string;
|
|
108
|
-
/** A brief description or summary of the season */
|
|
109
|
-
overview: string;
|
|
110
|
-
/** The path to the season's poster image, or null if not available */
|
|
111
|
-
poster_path?: string;
|
|
112
|
-
/** The season number within the TV show */
|
|
113
|
-
season_number: number;
|
|
114
|
-
};
|
|
115
|
-
/**
|
|
116
|
-
* Available append-to-response options for TV show details.
|
|
117
|
-
* These allow fetching additional related data in a single API request.
|
|
118
|
-
*/
|
|
119
|
-
export type TVAppendToResponseNamespace = "credits" | "external_ids" | "images" | "keywords" | "recommendations" | "similar" | "translations" | "videos";
|
|
120
|
-
/**
|
|
121
|
-
* Maps append-to-response keys to their corresponding response types.
|
|
122
|
-
*/
|
|
123
|
-
export type TVAppendableMap = {
|
|
124
|
-
credits: TVCredits;
|
|
125
|
-
external_ids: TVExternalIDs;
|
|
126
|
-
images: TVImages;
|
|
127
|
-
keywords: TVKeywords;
|
|
128
|
-
recommendations: TVRecommendations;
|
|
129
|
-
similar: TVSimilar;
|
|
130
|
-
translations: TVTranslations;
|
|
131
|
-
videos: TVVideos;
|
|
132
|
-
};
|
|
133
|
-
/**
|
|
134
|
-
* TV show details with additional appended data based on the requested namespaces.
|
|
135
|
-
* @template T - Array of append-to-response namespace keys to include
|
|
136
|
-
*/
|
|
137
|
-
export type TVDetailsWithAppends<T extends readonly TVAppendToResponseNamespace[]> = TVSeriesDetails & {
|
|
138
|
-
[K in T[number]]: TVAppendableMap[K];
|
|
139
|
-
};
|
|
140
|
-
/**
|
|
141
|
-
* Aggregate credits for a TV show, including cast and crew across all seasons and episodes.
|
|
142
|
-
*/
|
|
143
|
-
export type TVAggregateCredits = {
|
|
144
|
-
/** TMDB unique identifier for the TV show. */
|
|
145
|
-
id: number;
|
|
146
|
-
/** List of all the known cast for the TV show. */
|
|
147
|
-
cast: TVAggregateCreditsCastItem[];
|
|
148
|
-
/** List of all the known crew members for the TV show. */
|
|
149
|
-
crew: TVAggregateCreditsCrewItem[];
|
|
150
|
-
};
|
|
151
|
-
/**
|
|
152
|
-
* Cast member in TV show aggregate credits with their roles across all seasons.
|
|
153
|
-
*/
|
|
154
|
-
export type TVAggregateCreditsCastItem = Omit<Credit, "credit_id"> & {
|
|
155
|
-
/** Array of roles played by this cast member across different episodes */
|
|
156
|
-
roles: TVCreditRole[];
|
|
157
|
-
/** Total number of episodes this cast member appeared in */
|
|
158
|
-
total_episode_count: number;
|
|
159
|
-
/** Position in the cast list */
|
|
160
|
-
order: number;
|
|
161
|
-
};
|
|
162
|
-
/**
|
|
163
|
-
* Crew member in TV show aggregate credits with their jobs across all seasons.
|
|
164
|
-
*/
|
|
165
|
-
export type TVAggregateCreditsCrewItem = Omit<Credit, "credit_id"> & {
|
|
166
|
-
/** Array of jobs performed by this crew member across different episodes */
|
|
167
|
-
jobs: TVCreditJob[];
|
|
168
|
-
/** Total number of episodes this crew member worked on */
|
|
169
|
-
total_episode_count: number;
|
|
170
|
-
/** Department the crew member belongs to (e.g., "Directing", "Writing") */
|
|
171
|
-
department: string;
|
|
172
|
-
};
|
|
173
|
-
/**
|
|
174
|
-
* Represents a specific role a cast member played in a TV show.
|
|
175
|
-
*/
|
|
176
|
-
export type TVCreditRole = {
|
|
177
|
-
/** Unique identifier for this specific credit */
|
|
178
|
-
credit_id: string;
|
|
179
|
-
/** Character name played in this role */
|
|
180
|
-
character: string;
|
|
181
|
-
/** Number of episodes in which this character appeared */
|
|
182
|
-
episode_count: number;
|
|
183
|
-
};
|
|
184
|
-
/**
|
|
185
|
-
* Represents a specific job a crew member performed on a TV show.
|
|
186
|
-
*/
|
|
187
|
-
export type TVCreditJob = {
|
|
188
|
-
/** Unique identifier for this specific credit */
|
|
189
|
-
credit_id: string;
|
|
190
|
-
/** Job title (e.g., "Director", "Writer", "Producer") */
|
|
191
|
-
job: string;
|
|
192
|
-
/** Number of episodes for which this job was performed */
|
|
193
|
-
episode_count: number;
|
|
194
|
-
};
|
|
195
|
-
/**
|
|
196
|
-
* Alternative titles for a tv show in different countries/languages
|
|
197
|
-
*/
|
|
198
|
-
export type TVAlternativeTitles = {
|
|
199
|
-
/** Movie identifier */
|
|
200
|
-
id: number;
|
|
201
|
-
/** Array of alternative titles */
|
|
202
|
-
results: AlternativeTitle[];
|
|
203
|
-
};
|
|
204
|
-
export type TVSeriesChanges = Changes;
|
|
205
|
-
export type TVContentRatings = {
|
|
206
|
-
results: ContentRating[];
|
|
207
|
-
};
|
|
208
|
-
/**
|
|
209
|
-
* This is the original TV credits method which returns the latest season credit data.
|
|
210
|
-
* If you would like to request the aggregate view (which is what you see on the TMDB website)
|
|
211
|
-
* you should use the aggregate_credits method.
|
|
212
|
-
*/
|
|
213
|
-
export type TVCredits = {
|
|
214
|
-
/** TMDB unique identifier for the TV show. */
|
|
215
|
-
id: number;
|
|
216
|
-
/** List of all the known cast for the TV show. */
|
|
217
|
-
cast: Cast[];
|
|
218
|
-
/** List of all the known crew members for the TV show. */
|
|
219
|
-
crew: Crew[];
|
|
220
|
-
};
|
|
221
|
-
/**
|
|
222
|
-
* Collection of episode groups for a TV series
|
|
223
|
-
*/
|
|
224
|
-
export type TVEpisodeGroups = {
|
|
225
|
-
/** TV series identifier */
|
|
226
|
-
id: number;
|
|
227
|
-
/** Array of episode group items */
|
|
228
|
-
results: TVEpisodeGroupItem[];
|
|
229
|
-
};
|
|
230
|
-
/**
|
|
231
|
-
* Alternative grouping of episodes (e.g., chronological order, director's cut)
|
|
232
|
-
*/
|
|
233
|
-
export type TVEpisodeGroupItem = {
|
|
234
|
-
/** Description explaining the purpose of this episode grouping */
|
|
235
|
-
description: string;
|
|
236
|
-
/** Total number of episodes in this group */
|
|
237
|
-
episode_count: number;
|
|
238
|
-
/** Number of sub-groups within this episode group */
|
|
239
|
-
group_count: number;
|
|
240
|
-
/** Unique episode group identifier */
|
|
241
|
-
id: string;
|
|
242
|
-
/** Name of the episode group */
|
|
243
|
-
name: string;
|
|
244
|
-
/** Network that created or distributed this episode grouping */
|
|
245
|
-
network: NetworkItem;
|
|
246
|
-
/** Type of grouping (1=Original air date, 2=Absolute, 3=DVD, 4=Digital, 5=Story arc, 6=Production, 7=TV) */
|
|
247
|
-
type: number;
|
|
248
|
-
};
|
|
249
|
-
/**
|
|
250
|
-
* External platform identifiers for a TV series
|
|
251
|
-
*/
|
|
252
|
-
export type TVExternalIDs = {
|
|
253
|
-
/** TV series identifier in TMDB */
|
|
254
|
-
id: number;
|
|
255
|
-
/** IMDb identifier (e.g., "tt0944947"), null if not available */
|
|
256
|
-
imdb_id?: string | null;
|
|
257
|
-
/** Freebase MID identifier (deprecated), null if not available */
|
|
258
|
-
freebase_mid?: string | null;
|
|
259
|
-
/** Freebase ID (deprecated), null if not available */
|
|
260
|
-
freebase_id?: string | null;
|
|
261
|
-
/** TheTVDB identifier, null if not available */
|
|
262
|
-
tvdb_id?: number | null;
|
|
263
|
-
/** TVRage identifier (service discontinued), null if not available */
|
|
264
|
-
tvrage_id?: number | null;
|
|
265
|
-
/** Wikidata identifier (e.g., "Q23572"), null if not available */
|
|
266
|
-
wikidata_id?: string | null;
|
|
267
|
-
/** Facebook page identifier, null if not available */
|
|
268
|
-
facebook_id?: string | null;
|
|
269
|
-
/** Instagram handle, null if not available */
|
|
270
|
-
instagram_id?: string | null;
|
|
271
|
-
/** Twitter/X handle, null if not available */
|
|
272
|
-
twitter_id?: string | null;
|
|
273
|
-
};
|
|
274
|
-
/**
|
|
275
|
-
* Images related to a TV show.
|
|
276
|
-
* Contains backdrops, logos, posters and stills.
|
|
277
|
-
*/
|
|
278
|
-
export type TVImages = ImagesResult<TVImageItem, "backdrops" | "logos" | "posters">;
|
|
279
|
-
/**
|
|
280
|
-
* Image items for TVShows have an undocumented "iso_3166_1" property
|
|
281
|
-
* I decided to put it anyway as an optional property,
|
|
282
|
-
* but only for tv shows images.
|
|
283
|
-
*/
|
|
284
|
-
export type TVImageItem = ImageItem & {
|
|
285
|
-
iso_3166_1?: string;
|
|
286
|
-
};
|
|
287
|
-
/**
|
|
288
|
-
* List of keywords related to the TV show.
|
|
289
|
-
*/
|
|
290
|
-
export type TVKeywords = {
|
|
291
|
-
/** TMDB unique identifier for the TV show. */
|
|
292
|
-
id: number;
|
|
293
|
-
/** List of keywords related to the TV show. */
|
|
294
|
-
results: Keyword[];
|
|
295
|
-
};
|
|
296
|
-
/**
|
|
297
|
-
* Represents a paginated collection of TV series lists, extended with a unique identifier.
|
|
298
|
-
* Combines a standard `PaginatedResponse<TVSeriesListItem>` with an `id` field
|
|
299
|
-
* that uniquely identifies the tv show.
|
|
300
|
-
*/
|
|
301
|
-
export type TVSeriesLists = PaginatedResponse<TVSeriesListItem> & {
|
|
302
|
-
id: number;
|
|
303
|
-
};
|
|
304
|
-
/**
|
|
305
|
-
* Represents a single TV series list entry as returned by the TMDB API.
|
|
306
|
-
*/
|
|
307
|
-
export type TVSeriesListItem = {
|
|
308
|
-
/** A brief description of the list provided by its creator. */
|
|
309
|
-
description: string;
|
|
310
|
-
/** The number of times this list has been marked as a favorite by TMDB users. */
|
|
311
|
-
favorite_count: number;
|
|
312
|
-
/** The unique identifier for this list on TMDB. */
|
|
313
|
-
id: number;
|
|
314
|
-
/** The total number of items (TV series) currently in this list. */
|
|
315
|
-
item_count: number;
|
|
316
|
-
/** The primary language of the list content as an ISO 639-1 code (e.g. `"en"`). */
|
|
317
|
-
iso_639_1: string | LanguageISO6391;
|
|
318
|
-
/** The country associated with the list as an ISO 3166-1 alpha-2 code (e.g. `"US"`). */
|
|
319
|
-
iso_3166_1: string | CountryISO3166_1;
|
|
320
|
-
/** The display name of the list. */
|
|
321
|
-
name: string;
|
|
322
|
-
/** Path to the list's poster image on the TMDB CDN. Combine with a base URL to get the full image path. */
|
|
323
|
-
poster_path?: string;
|
|
324
|
-
};
|
|
325
|
-
/** List of TV shows that are recommended for a TV show. */
|
|
326
|
-
export type TVRecommendations = PaginatedResponse<TVSeriesResultItem>;
|
|
327
|
-
/**
|
|
328
|
-
* Paginated list of user reviews for a tv show
|
|
329
|
-
*/
|
|
330
|
-
export type TVReviews = PaginatedResponse<Review>;
|
|
331
|
-
/**
|
|
332
|
-
* Represents the response for TV episodes that have been screened theatrically.
|
|
333
|
-
*/
|
|
334
|
-
export type TVScreenedTheatrically = {
|
|
335
|
-
/** The unique identifier of the TV series. */
|
|
336
|
-
id: number;
|
|
337
|
-
/** The list of episodes that received a theatrical screening. */
|
|
338
|
-
results: TVScreeningItem[];
|
|
339
|
-
};
|
|
340
|
-
/**
|
|
341
|
-
* Represents a single TV episode that was screened theatrically.
|
|
342
|
-
*/
|
|
343
|
-
export type TVScreeningItem = {
|
|
344
|
-
/** The unique identifier of the episode. */
|
|
345
|
-
id: number;
|
|
346
|
-
/** The episode number within its season. */
|
|
347
|
-
episode_number: number;
|
|
348
|
-
/** The season number the episode belongs to. */
|
|
349
|
-
season_number: number;
|
|
350
|
-
};
|
|
351
|
-
/** List of TV shows that are similar to a TV show. */
|
|
352
|
-
export type TVSimilar = PaginatedResponse<TVSeriesResultItem>;
|
|
353
|
-
/**
|
|
354
|
-
* Represents the collection of available translations for a TV series.
|
|
355
|
-
*/
|
|
356
|
-
export type TVTranslations = TranslationResults<TVTranslationData>;
|
|
357
|
-
/**
|
|
358
|
-
* The translated text fields for a TV series in a specific language.
|
|
359
|
-
* All fields are optional as not every translation may provide all values.
|
|
360
|
-
*/
|
|
361
|
-
export type TVTranslationData = {
|
|
362
|
-
/** The translated name of the TV series. */
|
|
363
|
-
name?: string;
|
|
364
|
-
/** The translated overview or synopsis of the TV series. */
|
|
365
|
-
overview?: string;
|
|
366
|
-
/** The translated homepage URL for the TV series. */
|
|
367
|
-
homepage?: string;
|
|
368
|
-
/** The translated tagline of the TV series. */
|
|
369
|
-
tagline?: string;
|
|
370
|
-
};
|
|
371
|
-
/** List of videos related to a TV show. */
|
|
372
|
-
export type TVVideos = {
|
|
373
|
-
/** TMDB unique identifier for the TV show. */
|
|
374
|
-
id: number;
|
|
375
|
-
/** List of video results. */
|
|
376
|
-
results: VideoItem[];
|
|
377
|
-
};
|
|
378
|
-
/**
|
|
379
|
-
* Almost every query within the TV Series domain
|
|
380
|
-
* will take this required param to identify the
|
|
381
|
-
* tv show.
|
|
382
|
-
*/
|
|
383
|
-
export type TVBaseParam = {
|
|
384
|
-
series_id: number;
|
|
385
|
-
};
|
|
386
|
-
/**
|
|
387
|
-
* Parameters for TV series list endpoints (popular, top rated, airing today, on the air).
|
|
388
|
-
*/
|
|
389
|
-
export type TVSeriesListParams = Prettify<WithLanguagePage & {
|
|
390
|
-
timezone?: Timezone;
|
|
391
|
-
}>;
|
|
392
|
-
/**
|
|
393
|
-
* Parameters for fetching TV show details with optional additional data appended.
|
|
394
|
-
*/
|
|
395
|
-
export type TVDetailsParams = Prettify<TVBaseParam & {
|
|
396
|
-
append_to_response?: TVAppendToResponseNamespace[];
|
|
397
|
-
} & WithParams<"language">>;
|
|
398
|
-
/**
|
|
399
|
-
* Parameters for fetching aggregate credits for a TV show (cast and crew across all seasons).
|
|
400
|
-
*/
|
|
401
|
-
export type TVAggregateCreditsParams = Prettify<TVBaseParam & WithParams<"language">>;
|
|
402
|
-
/**
|
|
403
|
-
* Parameters for fetching tv show change history.
|
|
404
|
-
*/
|
|
405
|
-
export type TVChangeParams = Prettify<TVBaseParam & WithParams<"page"> & DateRange>;
|
|
406
|
-
/**
|
|
407
|
-
* Parameters for fetching tv show credits (cast and crew last season).
|
|
408
|
-
*/
|
|
409
|
-
export type TVCreditsParams = Prettify<TVBaseParam & WithLanguage>;
|
|
410
|
-
/**
|
|
411
|
-
* Parameters for fetching tv shows images (backdrops, logos, posters).
|
|
412
|
-
*
|
|
413
|
-
* Note: language and include_image_language params still only support
|
|
414
|
-
* ISO-639-1 language definition according to TMDB docs:
|
|
415
|
-
*
|
|
416
|
-
* "These are all specified as IETF tags to identify the languages we use on TMDB.
|
|
417
|
-
* There is one exception which is image languages.
|
|
418
|
-
* They are currently only designated by a ISO-639-1 tag. This is a planned upgrade for the future."
|
|
419
|
-
* https://developer.themoviedb.org/reference/configuration-primary-translations
|
|
420
|
-
*
|
|
421
|
-
* However, in practice, language in format "en-US" is still accepted.
|
|
422
|
-
* So we allow for both formats.
|
|
423
|
-
*/
|
|
424
|
-
export type TVImagesParams = Prettify<TVBaseParam & {
|
|
425
|
-
/** Language for image metadata (supports both ISO-639-1 and full Language format) */
|
|
426
|
-
language?: Language | LanguageISO6391;
|
|
427
|
-
/** Languages to include images for. Pass an array — it will be serialized as a comma-separated list (e.g. ["en", "null"]). Use "null" to include untagged images. */
|
|
428
|
-
include_image_language?: (Language | "null")[];
|
|
429
|
-
}>;
|
|
430
|
-
/**
|
|
431
|
-
* Parameters for fetching TV series lists (lists endpoint, different from airing_today ecc...).
|
|
432
|
-
*/
|
|
433
|
-
export type TVSeriesListsParams = Prettify<TVBaseParam & WithLanguagePage>;
|
|
434
|
-
/**
|
|
435
|
-
* Parameters for fetching tv shows recommendations.
|
|
436
|
-
*/
|
|
437
|
-
export type TVRecommendationsParams = Prettify<TVBaseParam & WithLanguagePage>;
|
|
438
|
-
/**
|
|
439
|
-
* Parameters for fetching similar tv shows.
|
|
440
|
-
*/
|
|
441
|
-
export type TVSimilarParams = Prettify<TVBaseParam & WithLanguagePage>;
|
|
442
|
-
/**
|
|
443
|
-
* Parameters for fetching tv show reviews.
|
|
444
|
-
*/
|
|
445
|
-
export type TVReviewsParams = Prettify<TVBaseParam & WithLanguagePage>;
|
package/dist/types/tv-series.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/types/utility.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { KnownForItem, KnownForMovie, KnownForTV } from "./common";
|
|
2
|
-
/**
|
|
3
|
-
* Forces TypeScript to resolve and display the final shape of a type.
|
|
4
|
-
* Useful for seeing the actual properties when hovering in the IDE.
|
|
5
|
-
*/
|
|
6
|
-
export type Prettify<T> = T extends object ? (T extends infer O ? {
|
|
7
|
-
[K in keyof O]: Prettify<O[K]>;
|
|
8
|
-
} : never) : T;
|
|
9
|
-
/** Keep literal suggestions but allow any string */
|
|
10
|
-
export type LiteralUnion<T extends string> = T | (string & {});
|
|
11
|
-
/**
|
|
12
|
-
* Type guard checks for KnowForItems (tv or movie)
|
|
13
|
-
* @returns
|
|
14
|
-
*/
|
|
15
|
-
export declare function isKnownForMovie(item: KnownForItem): item is KnownForMovie;
|
|
16
|
-
export declare function isKnownForTV(item: KnownForItem): item is KnownForTV;
|
package/dist/types/utility.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { WithLanguage } from "./common";
|
|
2
|
-
import { WatchProviderItem } from "./common/media";
|
|
3
|
-
import { CountryISO3166_1 } from "./config";
|
|
4
|
-
import { ConfigurationCountry } from "./config/configuration";
|
|
5
|
-
/**
|
|
6
|
-
* Parameters supported by watch provider namespace endpoints.
|
|
7
|
-
*/
|
|
8
|
-
export type WatchProviderListParams = WithLanguage;
|
|
9
|
-
/**
|
|
10
|
-
* Parameters for listing the available watch provider regions.
|
|
11
|
-
*/
|
|
12
|
-
export type WatchProviderRegionsParams = WithLanguage;
|
|
13
|
-
/**
|
|
14
|
-
* Country-specific display priorities returned by top-level watch provider list endpoints.
|
|
15
|
-
*/
|
|
16
|
-
export type WatchProviderDisplayPriorities = Partial<Record<CountryISO3166_1, number>>;
|
|
17
|
-
/**
|
|
18
|
-
* A watch provider returned by top-level movie and TV provider list endpoints.
|
|
19
|
-
*/
|
|
20
|
-
export type WatchProviderListItem = WatchProviderItem & {
|
|
21
|
-
display_priorities: WatchProviderDisplayPriorities;
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* Response returned by movie and TV watch provider list endpoints.
|
|
25
|
-
*/
|
|
26
|
-
export type WatchProviderListResponse = {
|
|
27
|
-
results: WatchProviderListItem[];
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* Response returned by the available regions endpoint.
|
|
31
|
-
*/
|
|
32
|
-
export type WatchProviderRegionsResponse = {
|
|
33
|
-
results: ConfigurationCountry[];
|
|
34
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/utils/index.d.ts
DELETED
package/dist/utils/index.js
DELETED
package/dist/utils/jwt.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function isJwt(token: string): boolean;
|
package/dist/utils/jwt.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
function isBase64Url(str) {
|
|
2
|
-
return /^[A-Za-z0-9\-_]+$/.test(str);
|
|
3
|
-
}
|
|
4
|
-
function decodeBase64Url(str) {
|
|
5
|
-
try {
|
|
6
|
-
const base64 = str.replace(/-/g, "+").replace(/_/g, "/");
|
|
7
|
-
const padded = base64.padEnd(base64.length + ((4 - (base64.length % 4)) % 4), "=");
|
|
8
|
-
return atob(padded);
|
|
9
|
-
}
|
|
10
|
-
catch {
|
|
11
|
-
return null;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
function isObject(value) {
|
|
15
|
-
return typeof value === "object" && value !== null;
|
|
16
|
-
}
|
|
17
|
-
function isJwtHeader(value) {
|
|
18
|
-
if (!isObject(value))
|
|
19
|
-
return false;
|
|
20
|
-
return typeof value.alg === "string";
|
|
21
|
-
}
|
|
22
|
-
function isJwtPayload(value) {
|
|
23
|
-
if (!isObject(value))
|
|
24
|
-
return false;
|
|
25
|
-
if ("exp" in value && typeof value.exp !== "number")
|
|
26
|
-
return false;
|
|
27
|
-
if ("nbf" in value && typeof value.nbf !== "number")
|
|
28
|
-
return false;
|
|
29
|
-
if ("iat" in value && typeof value.iat !== "number")
|
|
30
|
-
return false;
|
|
31
|
-
return true;
|
|
32
|
-
}
|
|
33
|
-
export function isJwt(token) {
|
|
34
|
-
if (typeof token !== "string")
|
|
35
|
-
return false;
|
|
36
|
-
const parts = token.split(".");
|
|
37
|
-
if (parts.length !== 3)
|
|
38
|
-
return false;
|
|
39
|
-
const [headerB64, payloadB64, signatureB64] = parts;
|
|
40
|
-
if (!isBase64Url(headerB64) || !isBase64Url(payloadB64) || !isBase64Url(signatureB64)) {
|
|
41
|
-
return false;
|
|
42
|
-
}
|
|
43
|
-
const headerStr = decodeBase64Url(headerB64);
|
|
44
|
-
const payloadStr = decodeBase64Url(payloadB64);
|
|
45
|
-
if (!headerStr || !payloadStr)
|
|
46
|
-
return false;
|
|
47
|
-
let parsedHeader;
|
|
48
|
-
let parsedPayload;
|
|
49
|
-
try {
|
|
50
|
-
parsedHeader = JSON.parse(headerStr);
|
|
51
|
-
parsedPayload = JSON.parse(payloadStr);
|
|
52
|
-
}
|
|
53
|
-
catch {
|
|
54
|
-
return false;
|
|
55
|
-
}
|
|
56
|
-
if (!isJwtHeader(parsedHeader))
|
|
57
|
-
return false;
|
|
58
|
-
if (!isJwtPayload(parsedPayload))
|
|
59
|
-
return false;
|
|
60
|
-
return true;
|
|
61
|
-
}
|
package/dist/utils/logger.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export type TMDBLoggerEntry = {
|
|
2
|
-
type: "request" | "response" | "error";
|
|
3
|
-
method: "GET";
|
|
4
|
-
endpoint: string;
|
|
5
|
-
status?: number;
|
|
6
|
-
statusText?: string;
|
|
7
|
-
durationMs?: number;
|
|
8
|
-
tmdbStatusCode?: number;
|
|
9
|
-
errorMessage?: string;
|
|
10
|
-
};
|
|
11
|
-
export type TMDBLoggerFn = (entry: TMDBLoggerEntry) => void;
|
|
12
|
-
export declare class TMDBLogger {
|
|
13
|
-
private logger?;
|
|
14
|
-
constructor(logger?: TMDBLoggerFn);
|
|
15
|
-
static from(logger?: boolean | TMDBLoggerFn): TMDBLogger | undefined;
|
|
16
|
-
log(entry: TMDBLoggerEntry): void;
|
|
17
|
-
private static defaultLogger;
|
|
18
|
-
}
|
package/dist/utils/logger.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
export class TMDBLogger {
|
|
2
|
-
logger;
|
|
3
|
-
constructor(logger) {
|
|
4
|
-
this.logger = logger;
|
|
5
|
-
}
|
|
6
|
-
static from(logger) {
|
|
7
|
-
if (!logger)
|
|
8
|
-
return undefined;
|
|
9
|
-
if (logger === true)
|
|
10
|
-
return new TMDBLogger(TMDBLogger.defaultLogger);
|
|
11
|
-
// Assume it's a function if it's not a boolean. We could be more strict here, but this is just a utility method, and I want 100% test coverage.
|
|
12
|
-
return new TMDBLogger(logger);
|
|
13
|
-
}
|
|
14
|
-
log(entry) {
|
|
15
|
-
if (!this.logger)
|
|
16
|
-
return;
|
|
17
|
-
try {
|
|
18
|
-
this.logger(entry);
|
|
19
|
-
}
|
|
20
|
-
catch (error) {
|
|
21
|
-
// Avoid breaking requests if the logger throws.
|
|
22
|
-
console.warn(`TMDB logger error: ${error}`);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
static defaultLogger(entry) {
|
|
26
|
-
const prefix = "🎬 [tmdb]";
|
|
27
|
-
const timestamp = new Date().toISOString();
|
|
28
|
-
if (entry.type === "request") {
|
|
29
|
-
console.log(`${prefix} ${timestamp} 🛰️ REQUEST ${entry.method} ${entry.endpoint}\n`);
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
if (entry.type === "response") {
|
|
33
|
-
console.log(`${prefix} ${timestamp} ✅ RESPONSE ${entry.method} ${entry.status} ${entry.statusText} ${entry.endpoint} (${entry.durationMs}ms)\n`);
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
const statusPart = entry.status != null ? `${entry.status} ${entry.statusText}` : "NETWORK ERROR";
|
|
37
|
-
const tmdbPart = entry.tmdbStatusCode != null ? ` (tmdb: ${entry.tmdbStatusCode})` : "";
|
|
38
|
-
console.log(`${prefix} ${timestamp} ❌ ${entry.method} ${statusPart} ${entry.endpoint} - ${entry.errorMessage}${tmdbPart}\n`);
|
|
39
|
-
}
|
|
40
|
-
}
|