@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.
Files changed (141) hide show
  1. package/dist/index.d.ts +5087 -4
  2. package/dist/index.js +3721 -5
  3. package/package.json +12 -5
  4. package/dist/client.d.ts +0 -51
  5. package/dist/client.js +0 -166
  6. package/dist/endpoints/base.d.ts +0 -22
  7. package/dist/endpoints/base.js +0 -32
  8. package/dist/endpoints/certifications.d.ts +0 -20
  9. package/dist/endpoints/certifications.js +0 -24
  10. package/dist/endpoints/changes.d.ts +0 -40
  11. package/dist/endpoints/changes.js +0 -46
  12. package/dist/endpoints/collections.d.ts +0 -39
  13. package/dist/endpoints/collections.js +0 -52
  14. package/dist/endpoints/companies.d.ts +0 -37
  15. package/dist/endpoints/companies.js +0 -49
  16. package/dist/endpoints/configuration.d.ts +0 -72
  17. package/dist/endpoints/configuration.js +0 -83
  18. package/dist/endpoints/credits.d.ts +0 -16
  19. package/dist/endpoints/credits.js +0 -22
  20. package/dist/endpoints/discover.d.ts +0 -36
  21. package/dist/endpoints/discover.js +0 -61
  22. package/dist/endpoints/find.d.ts +0 -16
  23. package/dist/endpoints/find.js +0 -21
  24. package/dist/endpoints/genres.d.ts +0 -25
  25. package/dist/endpoints/genres.js +0 -28
  26. package/dist/endpoints/keywords.d.ts +0 -29
  27. package/dist/endpoints/keywords.js +0 -38
  28. package/dist/endpoints/movie_lists.d.ts +0 -53
  29. package/dist/endpoints/movie_lists.js +0 -65
  30. package/dist/endpoints/movies.d.ts +0 -202
  31. package/dist/endpoints/movies.js +0 -255
  32. package/dist/endpoints/networks.d.ts +0 -36
  33. package/dist/endpoints/networks.js +0 -46
  34. package/dist/endpoints/people.d.ts +0 -91
  35. package/dist/endpoints/people.js +0 -128
  36. package/dist/endpoints/people_lists.d.ts +0 -16
  37. package/dist/endpoints/people_lists.js +0 -16
  38. package/dist/endpoints/reviews.d.ts +0 -14
  39. package/dist/endpoints/reviews.js +0 -16
  40. package/dist/endpoints/search.d.ts +0 -88
  41. package/dist/endpoints/search.js +0 -102
  42. package/dist/endpoints/trending.d.ts +0 -36
  43. package/dist/endpoints/trending.js +0 -48
  44. package/dist/endpoints/tv_episode_groups.d.ts +0 -13
  45. package/dist/endpoints/tv_episode_groups.js +0 -16
  46. package/dist/endpoints/tv_episodes.d.ts +0 -110
  47. package/dist/endpoints/tv_episodes.js +0 -136
  48. package/dist/endpoints/tv_seasons.d.ts +0 -128
  49. package/dist/endpoints/tv_seasons.js +0 -164
  50. package/dist/endpoints/tv_series.d.ts +0 -244
  51. package/dist/endpoints/tv_series.js +0 -311
  52. package/dist/endpoints/tv_series_lists.d.ts +0 -51
  53. package/dist/endpoints/tv_series_lists.js +0 -63
  54. package/dist/endpoints/watch_providers.d.ts +0 -34
  55. package/dist/endpoints/watch_providers.js +0 -46
  56. package/dist/errors/messages.d.ts +0 -15
  57. package/dist/errors/messages.js +0 -47
  58. package/dist/errors/tmdb.d.ts +0 -45
  59. package/dist/errors/tmdb.js +0 -39
  60. package/dist/images/images.d.ts +0 -12
  61. package/dist/images/images.js +0 -26
  62. package/dist/routes.d.ts +0 -157
  63. package/dist/routes.js +0 -157
  64. package/dist/tmdb.d.ts +0 -61
  65. package/dist/tmdb.js +0 -94
  66. package/dist/types/collections.d.ts +0 -72
  67. package/dist/types/collections.js +0 -1
  68. package/dist/types/common/certifications.d.ts +0 -19
  69. package/dist/types/common/certifications.js +0 -1
  70. package/dist/types/common/changes.d.ts +0 -44
  71. package/dist/types/common/changes.js +0 -1
  72. package/dist/types/common/images.d.ts +0 -64
  73. package/dist/types/common/images.js +0 -1
  74. package/dist/types/common/index.d.ts +0 -6
  75. package/dist/types/common/index.js +0 -6
  76. package/dist/types/common/media.d.ts +0 -305
  77. package/dist/types/common/media.js +0 -1
  78. package/dist/types/common/pagination.d.ts +0 -6
  79. package/dist/types/common/pagination.js +0 -1
  80. package/dist/types/common/params.d.ts +0 -27
  81. package/dist/types/common/params.js +0 -1
  82. package/dist/types/companies.d.ts +0 -53
  83. package/dist/types/companies.js +0 -1
  84. package/dist/types/config/configuration.d.ts +0 -56
  85. package/dist/types/config/configuration.js +0 -1
  86. package/dist/types/config/countries.d.ts +0 -3
  87. package/dist/types/config/countries.js +0 -1257
  88. package/dist/types/config/images.d.ts +0 -49
  89. package/dist/types/config/images.js +0 -13
  90. package/dist/types/config/index.d.ts +0 -6
  91. package/dist/types/config/index.js +0 -6
  92. package/dist/types/config/languages.d.ts +0 -11
  93. package/dist/types/config/languages.js +0 -1
  94. package/dist/types/config/options.d.ts +0 -46
  95. package/dist/types/config/options.js +0 -1
  96. package/dist/types/config/timezones.d.ts +0 -751
  97. package/dist/types/config/timezones.js +0 -1149
  98. package/dist/types/credits.d.ts +0 -148
  99. package/dist/types/credits.js +0 -1
  100. package/dist/types/discover.d.ts +0 -130
  101. package/dist/types/discover.js +0 -27
  102. package/dist/types/enums.d.ts +0 -8
  103. package/dist/types/enums.js +0 -9
  104. package/dist/types/find.d.ts +0 -103
  105. package/dist/types/find.js +0 -1
  106. package/dist/types/index.d.ts +0 -21
  107. package/dist/types/index.js +0 -21
  108. package/dist/types/keywords.d.ts +0 -19
  109. package/dist/types/keywords.js +0 -1
  110. package/dist/types/movies.d.ts +0 -304
  111. package/dist/types/movies.js +0 -1
  112. package/dist/types/networks.d.ts +0 -45
  113. package/dist/types/networks.js +0 -1
  114. package/dist/types/people-lists.d.ts +0 -5
  115. package/dist/types/people-lists.js +0 -1
  116. package/dist/types/people.d.ts +0 -214
  117. package/dist/types/people.js +0 -1
  118. package/dist/types/reviews.d.ts +0 -22
  119. package/dist/types/reviews.js +0 -1
  120. package/dist/types/search.d.ts +0 -198
  121. package/dist/types/search.js +0 -1
  122. package/dist/types/trending.d.ts +0 -55
  123. package/dist/types/trending.js +0 -1
  124. package/dist/types/tv-episode-groups.d.ts +0 -63
  125. package/dist/types/tv-episode-groups.js +0 -13
  126. package/dist/types/tv-episodes.d.ts +0 -98
  127. package/dist/types/tv-episodes.js +0 -1
  128. package/dist/types/tv-seasons.d.ts +0 -133
  129. package/dist/types/tv-seasons.js +0 -1
  130. package/dist/types/tv-series.d.ts +0 -445
  131. package/dist/types/tv-series.js +0 -1
  132. package/dist/types/utility.d.ts +0 -16
  133. package/dist/types/utility.js +0 -10
  134. package/dist/types/watch-providers.d.ts +0 -34
  135. package/dist/types/watch-providers.js +0 -1
  136. package/dist/utils/index.d.ts +0 -2
  137. package/dist/utils/index.js +0 -2
  138. package/dist/utils/jwt.d.ts +0 -1
  139. package/dist/utils/jwt.js +0 -61
  140. package/dist/utils/logger.d.ts +0 -18
  141. package/dist/utils/logger.js +0 -40
@@ -1,198 +0,0 @@
1
- import { Keyword, KnownForItem } from "./common";
2
- import { CountryISO3166_1, Language } from "./config";
3
- /**
4
- * Collection information in search results
5
- */
6
- export type CollectionResultItem = {
7
- /** Whether the collection contains adult content */
8
- adult: boolean;
9
- /** Path to backdrop image */
10
- backdrop_path: string;
11
- /** Unique collection identifier */
12
- id: number;
13
- /** Collection name (localized) */
14
- name: string;
15
- /** Original collection name in the original language */
16
- original_name: string;
17
- /** Original language of the collection (ISO 639-1 code) */
18
- original_language: string;
19
- /** Collection overview/description */
20
- overview: string;
21
- /** Path to poster image */
22
- poster_path?: string | null;
23
- };
24
- /**
25
- * Company information in search results
26
- */
27
- export type CompanyResultItem = {
28
- /** Unique company identifier */
29
- id: number;
30
- /** Path to company logo image */
31
- logo_path?: string | null;
32
- /** Company name */
33
- name: string;
34
- /** ISO 3166-1 country code of company's origin */
35
- origin_country: CountryISO3166_1;
36
- };
37
- /**
38
- * Keyword information in search results
39
- */
40
- export type KeywordResultItem = Keyword;
41
- /**
42
- * Person information in search results
43
- */
44
- export type PersonResultItem = {
45
- /** Whether the person is flagged as adult content creator */
46
- adult: boolean;
47
- /** Gender code: 0 = Not specified, 1 = Female, 2 = Male, 3 = Non-binary */
48
- gender: number;
49
- /** Unique person identifier */
50
- id: number;
51
- /** Primary department the person is known for (e.g. "Acting", "Directing") */
52
- known_for_department: string;
53
- /** Localized display name */
54
- name: string;
55
- /** Original name, typically in the person's native language */
56
- original_name: string;
57
- /** TMDB popularity score based on views, votes, and activity */
58
- popularity: number;
59
- /** Path to person's profile image */
60
- profile_path?: string | null;
61
- /** List of notable movies or TV shows the person is known for */
62
- known_for: KnownForItem[];
63
- };
64
- /**
65
- * A single TV series result as returned by TMDB APIs.
66
- *
67
- * Contains identifiers, localized and original titles, image path references,
68
- * release and origin information, genre ids, and popularity/vote statistics.
69
- * It is a partial representation of the TVDetails type.
70
- */
71
- export type TVSeriesResultItem = {
72
- /** Relative path to the backdrop image for the series (nullable on some responses). */
73
- backdrop_path?: string | null;
74
- /** First air date of the series (YYYY-MM-DD). */
75
- first_air_date: string;
76
- /** Array of genre ids associated with the series. */
77
- genre_ids: number[];
78
- /** Unique TMDB id for the series. */
79
- id: number;
80
- /** Series name (localized). */
81
- name: string;
82
- /** Origin country codes for the series (ISO 3166-1). */
83
- origin_country: CountryISO3166_1[];
84
- /** Original language code (ISO 639-1). */
85
- original_language: string;
86
- /** Brief synopsis/overview of the series. */
87
- overview: string;
88
- /** Popularity score as returned by TMDB. */
89
- popularity: number;
90
- /** Relative path to the poster image for the series (nullable on some responses). */
91
- poster_path?: string | null;
92
- /** Average vote score for the series. */
93
- vote_average: number;
94
- /** Total number of votes the series has received. */
95
- vote_count: number;
96
- /** Original (non-localized) title of the series. */
97
- original_name: string;
98
- };
99
- /**
100
- * Simplified movie information used in lists and search results
101
- */
102
- export type MovieResultItem = {
103
- /** Path to backdrop image */
104
- backdrop_path?: string | null;
105
- /** Unique movie identifier */
106
- id: number;
107
- /** Movie title (localized) */
108
- title: string;
109
- /** Original title in the original language */
110
- original_title: string;
111
- /** Plot synopsis/overview */
112
- overview: string;
113
- /** Path to poster image */
114
- poster_path?: string | null;
115
- /** Whether the movie is marked as adult content */
116
- adult: boolean;
117
- /** Original language of the movie (ISO 639-1 code) */
118
- original_language: string;
119
- /** Array of genre IDs (use /genre/movie/list to map to names) */
120
- genre_ids: number[];
121
- /** Popularity score calculated by TMDB */
122
- popularity: number;
123
- /** Release date in ISO 8601 format (YYYY-MM-DD) */
124
- release_date: string;
125
- /** Whether a video is available on TMDB */
126
- video: boolean;
127
- /** Average user rating (0-10 scale) */
128
- vote_average: number;
129
- /** Total number of votes received */
130
- vote_count: number;
131
- };
132
- /**
133
- * A single result item from the multi-search endpoint.
134
- * Discriminated on `media_type`.
135
- */
136
- export type MultiSearchResultItem = (MovieResultItem & {
137
- media_type: "movie";
138
- }) | (TVSeriesResultItem & {
139
- media_type: "tv";
140
- }) | (PersonResultItem & {
141
- media_type: "person";
142
- });
143
- /**
144
- * Parameters for searching movies
145
- */
146
- export type SearchMoviesParams = {
147
- /** Search query text */
148
- query: string;
149
- /** Include adult (18+) content in results (default: false) */
150
- include_adult?: boolean;
151
- /** ISO 639-1 language code with optional region (e.g., "en-US") */
152
- language?: Language;
153
- /** Page number for paginated results (default: 1) */
154
- page?: number;
155
- /** Filter results by primary release year (YYYY format) */
156
- primary_release_year?: string;
157
- /** ISO 3166-1 country code to filter results by region */
158
- region?: CountryISO3166_1;
159
- /** Filter results by any release year (YYYY format) */
160
- year?: string;
161
- };
162
- /**
163
- * Parameters for searching collections
164
- */
165
- export type SearchCollectionsParams = Omit<SearchMoviesParams, "primary_release_year" | "year">;
166
- /**
167
- * Parameters for searching keywords
168
- */
169
- export type SearchKeywordsParams = Pick<SearchMoviesParams, "query" | "page">;
170
- /**
171
- * Parameters for searching companies
172
- */
173
- export type SearchCompanyParams = Pick<SearchMoviesParams, "query" | "page">;
174
- /**
175
- * Parameters for searching people
176
- */
177
- export type SearchPersonParams = Pick<SearchMoviesParams, "query" | "page" | "include_adult" | "language">;
178
- /**
179
- * Parameters for searching TV series
180
- */
181
- export type SearchTVSeriesParams = {
182
- /** Search query text */
183
- query: string;
184
- /** Include adult (18+) content in results (default: false) */
185
- include_adult?: boolean;
186
- /** ISO 639-1 language code with optional region (e.g., "en-US") */
187
- language?: Language;
188
- /** Page number for paginated results (default: 1) */
189
- page?: number;
190
- /** Filter by first air date year (1000–9999) */
191
- first_air_date_year?: number;
192
- /** Filter by any air date year, including episodes (1000–9999) */
193
- year?: number;
194
- };
195
- /**
196
- * Parameters for multi-search (movies, TV shows, and people in a single request)
197
- */
198
- export type SearchMultiParams = Pick<SearchTVSeriesParams, "query" | "include_adult" | "language" | "page">;
@@ -1 +0,0 @@
1
- export {};
@@ -1,55 +0,0 @@
1
- import type { Language } from "./config/languages";
2
- import type { MovieResultItem, PersonResultItem, TVSeriesResultItem } from "./search";
3
- /** Time window for trending data */
4
- export type TrendingTimeWindow = "day" | "week";
5
- /**
6
- * Query parameters for all trending endpoints.
7
- * `time_window` is embedded in the URL path; `language` is a query param.
8
- */
9
- export type TrendingParams = {
10
- /** Time window for trending data. `"day"` returns the last 24 hours, `"week"` returns the last 7 days. */
11
- time_window: TrendingTimeWindow;
12
- /** Language for localised results (ISO 639-1 + ISO 3166-1, e.g. `"en-US"`). */
13
- language?: Language;
14
- };
15
- /**
16
- * A trending movie result.
17
- * Extends {@link MovieResultItem} with the `media_type` discriminator.
18
- */
19
- export type TrendingMovieResult = MovieResultItem & {
20
- /** Media type discriminator — always `"movie"` for this endpoint. */
21
- media_type: "movie";
22
- };
23
- /**
24
- * A trending TV series result.
25
- * Extends {@link TVSeriesResultItem} with the `media_type` discriminator.
26
- */
27
- export type TrendingTVResult = TVSeriesResultItem & {
28
- /** Media type discriminator — always `"tv"` for this endpoint. */
29
- media_type: "tv";
30
- };
31
- /**
32
- * A trending person result.
33
- * Extends {@link PersonResultItem} with the `media_type` discriminator.
34
- */
35
- export type TrendingPersonResult = PersonResultItem & {
36
- /** Media type discriminator — always `"person"` for this endpoint. */
37
- media_type: "person";
38
- };
39
- /**
40
- * Union of all trending result types returned by the `trending.all()` endpoint.
41
- * Discriminated by `media_type`.
42
- *
43
- * @example
44
- * ```ts
45
- * import { isTrendingMovie, isTrendingTV } from "@lorenzopant/tmdb";
46
- *
47
- * const results = await tmdb.trending.all({ time_window: "day" });
48
- * for (const item of results.results) {
49
- * if (item.media_type === "movie") console.log(item.title);
50
- * if (item.media_type === "tv") console.log(item.name);
51
- * if (item.media_type === "person") console.log(item.name);
52
- * }
53
- * ```
54
- */
55
- export type TrendingAllResult = TrendingMovieResult | TrendingTVResult | TrendingPersonResult;
@@ -1 +0,0 @@
1
- export {};
@@ -1,63 +0,0 @@
1
- import { NetworkItem } from "./networks";
2
- import { TVEpisode } from "./tv-episodes";
3
- /**
4
- * Full details for a TV episode group, including grouped episode lists.
5
- */
6
- export type TVEpisodeGroupDetails = {
7
- /** Description of the episode group */
8
- description: string;
9
- /** Total number of episodes across all groups */
10
- episode_count: number;
11
- /** Number of group entries in this episode group */
12
- group_count: number;
13
- /** Unique episode group identifier */
14
- id: string;
15
- /** Name of the episode group */
16
- name: string;
17
- /** Network associated with the episode group, if available */
18
- network: NetworkItem | null;
19
- /** Grouping strategy type (e.g., numbered by season, collections, etc.) */
20
- type: TVEpisodeGroupType;
21
- /** Grouped episode entries */
22
- groups: TVEpisodeGroupDetailsItem[];
23
- };
24
- /**
25
- * A group within an episode group (e.g., a season-like grouping).
26
- */
27
- export type TVEpisodeGroupDetailsItem = {
28
- /** Unique group identifier */
29
- id: string;
30
- /** Group name */
31
- name: string;
32
- /** Display order */
33
- order: number;
34
- /** Whether the group is locked on TMDB */
35
- locked: boolean;
36
- /** Episodes included in this group */
37
- episodes: TVEpisodeGroupEpisode[];
38
- };
39
- /**
40
- * A simplified TV episode item returned in episode group details.
41
- */
42
- export type TVEpisodeGroupEpisode = Omit<TVEpisode, "guest_stars" | "runtime"> & {
43
- /** Production code for the episode, if available */
44
- production_code?: string | null;
45
- /** Path to the episode still image, if available */
46
- still_path?: string | null;
47
- };
48
- /**
49
- * Supported episode group type identifiers.
50
- */
51
- export declare enum TVEpisodeGroupType {
52
- OriginalAirDate = 1,
53
- Absolute = 2,
54
- Dvd = 3,
55
- Digital = 4,
56
- StoryArc = 5,
57
- Production = 6,
58
- TV = 7
59
- }
60
- export type TVEpisodeGroupParams = {
61
- /** Episode group identifier */
62
- episode_group_id: string;
63
- };
@@ -1,13 +0,0 @@
1
- /**
2
- * Supported episode group type identifiers.
3
- */
4
- export var TVEpisodeGroupType;
5
- (function (TVEpisodeGroupType) {
6
- TVEpisodeGroupType[TVEpisodeGroupType["OriginalAirDate"] = 1] = "OriginalAirDate";
7
- TVEpisodeGroupType[TVEpisodeGroupType["Absolute"] = 2] = "Absolute";
8
- TVEpisodeGroupType[TVEpisodeGroupType["Dvd"] = 3] = "Dvd";
9
- TVEpisodeGroupType[TVEpisodeGroupType["Digital"] = 4] = "Digital";
10
- TVEpisodeGroupType[TVEpisodeGroupType["StoryArc"] = 5] = "StoryArc";
11
- TVEpisodeGroupType[TVEpisodeGroupType["Production"] = 6] = "Production";
12
- TVEpisodeGroupType[TVEpisodeGroupType["TV"] = 7] = "TV";
13
- })(TVEpisodeGroupType || (TVEpisodeGroupType = {}));
@@ -1,98 +0,0 @@
1
- import { Cast, Crew, ImageItem, ImagesResult, TranslationResults, VideoResults, WithLanguage, WithParams } from "./common";
2
- import { Language } from "./config";
3
- import { TVSeasonBaseParams } from "./tv-seasons";
4
- import { TVExternalIDs } from "./tv-series";
5
- import { Prettify } from "./utility";
6
- /**
7
- * Represents a single episode of a TV series from the TMDB API.
8
- * Contains detailed metadata including crew, guest stars, and voting stats.
9
- */
10
- export type TVEpisode = {
11
- /** ISO 8601 formatted date when the episode first aired (e.g. `"2023-05-15"`) */
12
- air_date: string;
13
- /** Array of crew members who worked on this specific episode */
14
- crew: Crew[];
15
- /** Sequential number of this episode within its season (1-based) */
16
- episode_number: number;
17
- /** Array of guest stars appearing in this episode (subset of cast without `cast_id`) */
18
- guest_stars: Omit<Cast, "cast_id">[];
19
- /** Episode title or name */
20
- name: string;
21
- /** Episode synopsis or description */
22
- overview: string;
23
- /** Unique TMDB identifier for this episode */
24
- id: number;
25
- /** Production code assigned by the production company, if available */
26
- production_code?: string | null;
27
- /** Runtime of the episode in minutes */
28
- runtime: number;
29
- /** Season number this episode belongs to (1-based) */
30
- season_number: number;
31
- /** Relative path to the episode still/image (e.g. `"/abc123.jpg"`), or null if none */
32
- still_path?: string | null;
33
- /** Average user rating of the episode (0-10 scale) */
34
- vote_average: number;
35
- /** Total number of user votes for the episode */
36
- vote_count: number;
37
- };
38
- /**
39
- * Available append-to-response options for TV episode details.
40
- * These allow fetching additional related data in a single API request.
41
- */
42
- export type TVEpisodeAppendToResponseNamespace = "credits" | "external_ids" | "images" | "translations" | "videos";
43
- /**
44
- * Maps append-to-response keys to their corresponding response types.
45
- */
46
- export type TVEpisodeAppendableMap = {
47
- credits: TVEpisodeCredits;
48
- external_ids: TVEpisodeExternalIDs;
49
- images: TVEpisodeImages;
50
- translations: TVEpisodeTranslations;
51
- videos: TVEpisodeVideos;
52
- };
53
- /**
54
- * TV show details with additional appended data based on the requested namespaces.
55
- * @template T - Array of append-to-response namespace keys to include
56
- */
57
- export type TVEpisodeDetailsWithAppends<T extends readonly TVEpisodeAppendToResponseNamespace[]> = TVEpisode & {
58
- [K in T[number]]: TVEpisodeAppendableMap[K];
59
- };
60
- export type TVEpisodeCredits = {
61
- id: number | string;
62
- cast: Omit<Cast, "cast_id">[];
63
- crew: Crew[];
64
- guest_stars: Omit<Cast, "cast_id">[];
65
- };
66
- export type TVEpisodeExternalIDs = Omit<TVExternalIDs, "facebook_id" | "instagram_id" | "twitter_id">;
67
- export type TVEpisodeImages = ImagesResult<ImageItem, "stills">;
68
- export type TVEpisodeTranslations = TranslationResults<TVEpisodeTranslationData>;
69
- export type TVEpisodeTranslationData = {
70
- name?: string | null;
71
- overview?: string | null;
72
- };
73
- export type TVEpisodeVideos = VideoResults;
74
- /**
75
- * Almost every query within the TV Episodes domain
76
- * will take this required param to identify the
77
- * tv show episode.
78
- */
79
- export type TVEpisodeBaseParams = TVSeasonBaseParams & {
80
- /** Episode number */
81
- episode_number: number;
82
- };
83
- /** Uniquely identifies an episode across different tv shows. */
84
- export type TVEpisodeId = {
85
- episode_id: string | number;
86
- };
87
- /**
88
- * Parameters for fetching TV episode details with optional additional data appended.
89
- */
90
- export type TVEpisodeDetailsParams = Prettify<TVEpisodeBaseParams & {
91
- append_to_response?: TVEpisodeAppendToResponseNamespace[];
92
- } & WithParams<"language">>;
93
- /** Parameters for tv episode credits endpoint */
94
- export type TVEpisodeCreditsParams = TVEpisodeBaseParams & WithLanguage;
95
- export type TVEpisodeImagesParams = TVEpisodeBaseParams & WithLanguage & {
96
- /** 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. */
97
- include_image_language?: (Language | "null")[];
98
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,133 +0,0 @@
1
- import { Cast, Crew, DateRange, ImageItem, ImagesResult, TranslationResults, VideoResults, WithLanguage, WithParams } from "./common";
2
- import { Language } from "./config";
3
- import { TVAggregateCredits, TVBaseParam, TVEpisodeItem, TVExternalIDs } from "./tv-series";
4
- import { MediaWatchProviders } from "./common/media";
5
- import { NetworkItem } from "./networks";
6
- import { LiteralUnion, Prettify } from "./utility";
7
- /**
8
- * Almost every query within the TV Series Seasons domain
9
- * will take this required param to identify the
10
- * tv show season.
11
- */
12
- export type TVSeasonBaseParams = TVBaseParam & {
13
- /** The Season */
14
- season_number: number;
15
- };
16
- /** Uniquely identifies a season across different tv shows. */
17
- export type TVSeasonId = {
18
- season_id: string | number;
19
- };
20
- /**
21
- * Represents a single episode within a TV season from the TMDB API.
22
- * Extends {@link TVEpisodeItem} (rather than `TVEpisode`) with crew, guest stars, and episode type.
23
- *
24
- * NOTE: `TVEpisode` is intentionally not used here to avoid a circular dependency:
25
- * `tv-episodes.ts` imports `TVSeasonBaseParams` from this file, so importing
26
- * `TVEpisode` back would form a cycle. `TVEpisodeItem` carries the same scalar
27
- * fields (including `show_id`) and produces an identical runtime shape.
28
- */
29
- export type TVSeasonEpisode = TVEpisodeItem & {
30
- /** Array of crew members for this episode */
31
- crew: Crew[];
32
- /** Episode type */
33
- episode_type: LiteralUnion<"standard" | "finale">;
34
- /** Array of guest stars in this episode */
35
- guest_stars: Omit<Cast, "cast_id">[];
36
- };
37
- /**
38
- * Detailed information about a TV season returned by the TMDB API.
39
- */
40
- export type TVSeason = {
41
- /** ISO 8601 date when the season first aired */
42
- air_date?: string | null;
43
- /** Array of episodes in this season */
44
- episodes: TVSeasonEpisode[];
45
- /** Unique TMDB identifier for the season */
46
- id: number;
47
- /** Season name */
48
- name: string;
49
- /** Networks that broadcast this season */
50
- networks: NetworkItem[];
51
- /** Season overview/description */
52
- overview: string;
53
- /** Relative path to the season poster */
54
- poster_path?: string | null;
55
- /** Season number within the TV show */
56
- season_number: number;
57
- /** Average user rating (0–10) */
58
- vote_average: number;
59
- };
60
- /**
61
- * Available append-to-response options for TV season details.
62
- * These allow fetching additional related data in a single API request.
63
- */
64
- export type TVSeasonAppendToResponseNamespace = "aggregate_credits" | "credits" | "external_ids" | "images" | "translations" | "videos" | "watch_providers";
65
- /**
66
- * Maps append-to-response keys to their corresponding response types.
67
- */
68
- export type TVSeasonAppendableMap = {
69
- aggregate_credits: TVSeasonAggregateCredits;
70
- credits: TVSeasonCredits;
71
- external_ids: TVSeasonExternalIDs;
72
- images: TVSeasonImages;
73
- translations: TVSeasonTranslations;
74
- videos: TVSeasonVideos;
75
- watch_providers: MediaWatchProviders;
76
- };
77
- /**
78
- * TV season details with additional appended data based on the requested namespaces.
79
- * @template T - Array of append-to-response namespace keys to include
80
- */
81
- export type TVSeasonDetailsWithAppends<T extends readonly TVSeasonAppendToResponseNamespace[]> = TVSeason & {
82
- [K in T[number]]: TVSeasonAppendableMap[K];
83
- };
84
- /** Aggregate cast and crew credits for a TV season across all its episodes. */
85
- export type TVSeasonAggregateCredits = TVAggregateCredits;
86
- /** Season change history, using the same structure as other TMDB change responses. */
87
- export type TVSeasonChanges = import("./common").Changes;
88
- /** Credits (cast & crew) for a TV season, mirroring the series-level credits shape. */
89
- export type TVSeasonCredits = {
90
- /** TMDB unique identifier */
91
- id: number;
92
- /** Cast members */
93
- cast: Cast[];
94
- /** Crew members */
95
- crew: Crew[];
96
- };
97
- /** External platform identifiers for a TV season (subset of TV series external IDs). */
98
- export type TVSeasonExternalIDs = Pick<TVExternalIDs, "id" | "freebase_mid" | "freebase_id" | "tvdb_id" | "tvrage_id" | "wikidata_id">;
99
- /**
100
- * Images associated with a TV season.
101
- * Contains posters only.
102
- */
103
- export type TVSeasonImages = ImagesResult<ImageItem, "posters">;
104
- /** Translation data for a TV season. */
105
- export type TVSeasonTranslationData = {
106
- name?: string | null;
107
- overview?: string | null;
108
- };
109
- /** Collection of all available translations for a TV season. */
110
- export type TVSeasonTranslations = TranslationResults<TVSeasonTranslationData>;
111
- /** Videos (trailers, teasers, clips) for a TV season. */
112
- export type TVSeasonVideos = VideoResults;
113
- /** Parameters for the season details endpoint. */
114
- export type TVSeasonDetailsParams = Prettify<TVSeasonBaseParams & {
115
- append_to_response?: TVSeasonAppendToResponseNamespace[];
116
- } & WithParams<"language">>;
117
- /** Parameters for the season aggregate credits endpoint. */
118
- export type TVSeasonAggregateCreditsParams = TVSeasonBaseParams & WithLanguage;
119
- /** Parameters for the season credits endpoint. */
120
- export type TVSeasonCreditsParams = TVSeasonBaseParams & WithLanguage;
121
- /** Parameters for the season images endpoint, with optional language filtering. */
122
- export type TVSeasonImagesParams = TVSeasonBaseParams & WithLanguage & {
123
- /** 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. */
124
- include_image_language?: (Language | "null")[];
125
- };
126
- /** Parameters for the season videos endpoint, with optional language filtering. */
127
- export type TVSeasonVideosParams = TVSeasonBaseParams & WithLanguage & {
128
- include_video_language?: string;
129
- };
130
- /** Parameters for the season watch providers endpoint. */
131
- export type TVSeasonWatchProvidersParams = TVSeasonBaseParams & WithLanguage;
132
- /** Parameters for the season changes endpoint. */
133
- export type TVSeasonChangesParams = TVSeasonId & Prettify<WithParams<"page"> & DateRange>;
@@ -1 +0,0 @@
1
- export {};