@lorenzopant/tmdb 1.13.0 → 1.14.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.
Files changed (277) hide show
  1. package/README.md +20 -1
  2. package/dist/client.d.ts +5 -1
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +47 -8
  5. package/dist/endpoints/base.d.ts +1 -0
  6. package/dist/endpoints/base.d.ts.map +1 -1
  7. package/dist/endpoints/base.js +3 -1
  8. package/dist/endpoints/collections.d.ts +1 -1
  9. package/dist/endpoints/collections.d.ts.map +1 -1
  10. package/dist/endpoints/companies.d.ts +1 -1
  11. package/dist/endpoints/companies.d.ts.map +1 -1
  12. package/dist/endpoints/credits.d.ts +1 -1
  13. package/dist/endpoints/credits.d.ts.map +1 -1
  14. package/dist/endpoints/movies.d.ts +4 -10
  15. package/dist/endpoints/movies.d.ts.map +1 -1
  16. package/dist/endpoints/movies.js +2 -7
  17. package/dist/endpoints/networks.d.ts +2 -1
  18. package/dist/endpoints/networks.d.ts.map +1 -1
  19. package/dist/endpoints/search.d.ts +1 -6
  20. package/dist/endpoints/search.d.ts.map +1 -1
  21. package/dist/endpoints/tv_episode_groups.d.ts +1 -1
  22. package/dist/endpoints/tv_episode_groups.d.ts.map +1 -1
  23. package/dist/endpoints/tv_episodes.d.ts +1 -8
  24. package/dist/endpoints/tv_episodes.d.ts.map +1 -1
  25. package/dist/endpoints/tv_seasons.d.ts +129 -0
  26. package/dist/endpoints/tv_seasons.d.ts.map +1 -0
  27. package/dist/endpoints/tv_seasons.js +164 -0
  28. package/dist/endpoints/tv_series.d.ts +1 -8
  29. package/dist/endpoints/tv_series.d.ts.map +1 -1
  30. package/dist/endpoints/tv_series_lists.d.ts +3 -7
  31. package/dist/endpoints/tv_series_lists.d.ts.map +1 -1
  32. package/dist/endpoints/tv_series_lists.js +2 -7
  33. package/dist/index.d.ts +1 -0
  34. package/dist/index.d.ts.map +1 -1
  35. package/dist/index.js +1 -0
  36. package/dist/routes.d.ts +8 -0
  37. package/dist/routes.d.ts.map +1 -1
  38. package/dist/routes.js +8 -0
  39. package/dist/tmdb.d.ts +2 -0
  40. package/dist/tmdb.d.ts.map +1 -1
  41. package/dist/tmdb.js +4 -1
  42. package/dist/types/{other/collections.d.ts → collections.d.ts} +4 -4
  43. package/dist/types/collections.d.ts.map +1 -0
  44. package/dist/types/common/media.d.ts +1 -1
  45. package/dist/types/{other/companies.d.ts → companies.d.ts} +4 -4
  46. package/dist/types/companies.d.ts.map +1 -0
  47. package/dist/types/config/options.d.ts +7 -0
  48. package/dist/types/config/options.d.ts.map +1 -1
  49. package/dist/types/{other/credits.d.ts → credits.d.ts} +2 -2
  50. package/dist/types/credits.d.ts.map +1 -0
  51. package/dist/types/discover.d.ts +131 -0
  52. package/dist/types/discover.d.ts.map +1 -0
  53. package/dist/types/{other/find.d.ts → find.d.ts} +3 -3
  54. package/dist/types/find.d.ts.map +1 -0
  55. package/dist/types/index.d.ts +11 -3
  56. package/dist/types/index.d.ts.map +1 -1
  57. package/dist/types/index.js +11 -3
  58. package/dist/types/{other/keywords.d.ts → keywords.d.ts} +1 -1
  59. package/dist/types/keywords.d.ts.map +1 -0
  60. package/dist/types/movies.d.ts +305 -0
  61. package/dist/types/movies.d.ts.map +1 -0
  62. package/dist/types/{other/networks.d.ts → networks.d.ts} +2 -2
  63. package/dist/types/networks.d.ts.map +1 -0
  64. package/dist/types/search.d.ts +167 -0
  65. package/dist/types/search.d.ts.map +1 -0
  66. package/dist/types/{other/tv_episode_groups.d.ts → tv-episode-groups.d.ts} +2 -2
  67. package/dist/types/tv-episode-groups.d.ts.map +1 -0
  68. package/dist/types/{tv-episodes/tv_episodes.d.ts → tv-episodes.d.ts} +44 -7
  69. package/dist/types/tv-episodes.d.ts.map +1 -0
  70. package/dist/types/tv-seasons.d.ts +132 -0
  71. package/dist/types/tv-seasons.d.ts.map +1 -0
  72. package/dist/types/tv-series.d.ts +446 -0
  73. package/dist/types/tv-series.d.ts.map +1 -0
  74. package/dist/types/{other/watch_providers.d.ts → watch-providers.d.ts} +5 -5
  75. package/dist/types/watch-providers.d.ts.map +1 -0
  76. package/dist/utils/index.d.ts +2 -0
  77. package/dist/utils/index.d.ts.map +1 -0
  78. package/dist/utils/index.js +1 -0
  79. package/dist/utils/logger.d.ts +19 -0
  80. package/dist/utils/logger.d.ts.map +1 -0
  81. package/dist/utils/logger.js +41 -0
  82. package/package.json +1 -1
  83. package/dist/types/discover/index.d.ts +0 -4
  84. package/dist/types/discover/index.d.ts.map +0 -1
  85. package/dist/types/discover/index.js +0 -3
  86. package/dist/types/discover/movie.d.ts +0 -6
  87. package/dist/types/discover/movie.d.ts.map +0 -1
  88. package/dist/types/discover/params.d.ts +0 -81
  89. package/dist/types/discover/params.d.ts.map +0 -1
  90. package/dist/types/discover/tv.d.ts +0 -50
  91. package/dist/types/discover/tv.d.ts.map +0 -1
  92. package/dist/types/movies/alternative_titles.d.ts +0 -11
  93. package/dist/types/movies/alternative_titles.d.ts.map +0 -1
  94. package/dist/types/movies/changes.d.ts +0 -3
  95. package/dist/types/movies/changes.d.ts.map +0 -1
  96. package/dist/types/movies/credits.d.ts +0 -13
  97. package/dist/types/movies/credits.d.ts.map +0 -1
  98. package/dist/types/movies/external_ids.d.ts +0 -16
  99. package/dist/types/movies/external_ids.d.ts.map +0 -1
  100. package/dist/types/movies/images.d.ts +0 -6
  101. package/dist/types/movies/images.d.ts.map +0 -1
  102. package/dist/types/movies/index.d.ts +0 -15
  103. package/dist/types/movies/index.d.ts.map +0 -1
  104. package/dist/types/movies/index.js +0 -14
  105. package/dist/types/movies/keywords.d.ts +0 -11
  106. package/dist/types/movies/keywords.d.ts.map +0 -1
  107. package/dist/types/movies/movie.d.ts +0 -106
  108. package/dist/types/movies/movie.d.ts.map +0 -1
  109. package/dist/types/movies/movie.js +0 -1
  110. package/dist/types/movies/params.d.ts +0 -94
  111. package/dist/types/movies/params.d.ts.map +0 -1
  112. package/dist/types/movies/params.js +0 -1
  113. package/dist/types/movies/recommendations.d.ts +0 -7
  114. package/dist/types/movies/recommendations.d.ts.map +0 -1
  115. package/dist/types/movies/recommendations.js +0 -1
  116. package/dist/types/movies/release_dates.d.ts +0 -37
  117. package/dist/types/movies/release_dates.d.ts.map +0 -1
  118. package/dist/types/movies/release_dates.js +0 -1
  119. package/dist/types/movies/reviews.d.ts +0 -6
  120. package/dist/types/movies/reviews.d.ts.map +0 -1
  121. package/dist/types/movies/reviews.js +0 -1
  122. package/dist/types/movies/similar.d.ts +0 -7
  123. package/dist/types/movies/similar.d.ts.map +0 -1
  124. package/dist/types/movies/similar.js +0 -1
  125. package/dist/types/movies/translations.d.ts +0 -21
  126. package/dist/types/movies/translations.d.ts.map +0 -1
  127. package/dist/types/movies/translations.js +0 -1
  128. package/dist/types/movies/videos.d.ts +0 -6
  129. package/dist/types/movies/videos.d.ts.map +0 -1
  130. package/dist/types/movies/videos.js +0 -1
  131. package/dist/types/other/collections.d.ts.map +0 -1
  132. package/dist/types/other/companies.d.ts.map +0 -1
  133. package/dist/types/other/credits.d.ts.map +0 -1
  134. package/dist/types/other/credits.js +0 -1
  135. package/dist/types/other/find.d.ts.map +0 -1
  136. package/dist/types/other/index.d.ts +0 -9
  137. package/dist/types/other/index.d.ts.map +0 -1
  138. package/dist/types/other/index.js +0 -8
  139. package/dist/types/other/keywords.d.ts.map +0 -1
  140. package/dist/types/other/keywords.js +0 -1
  141. package/dist/types/other/networks.d.ts.map +0 -1
  142. package/dist/types/other/tv_episode_groups.d.ts.map +0 -1
  143. package/dist/types/other/watch_providers.d.ts.map +0 -1
  144. package/dist/types/other/watch_providers.js +0 -1
  145. package/dist/types/search/collection.d.ts +0 -22
  146. package/dist/types/search/collection.d.ts.map +0 -1
  147. package/dist/types/search/collection.js +0 -1
  148. package/dist/types/search/company.d.ts +0 -15
  149. package/dist/types/search/company.d.ts.map +0 -1
  150. package/dist/types/search/company.js +0 -1
  151. package/dist/types/search/index.d.ts +0 -7
  152. package/dist/types/search/index.d.ts.map +0 -1
  153. package/dist/types/search/index.js +0 -6
  154. package/dist/types/search/keyword.d.ts +0 -6
  155. package/dist/types/search/keyword.d.ts.map +0 -1
  156. package/dist/types/search/keyword.js +0 -1
  157. package/dist/types/search/movie.d.ts +0 -34
  158. package/dist/types/search/movie.d.ts.map +0 -1
  159. package/dist/types/search/movie.js +0 -1
  160. package/dist/types/search/multi.d.ts +0 -1
  161. package/dist/types/search/multi.d.ts.map +0 -1
  162. package/dist/types/search/multi.js +0 -1
  163. package/dist/types/search/params.d.ts +0 -37
  164. package/dist/types/search/params.d.ts.map +0 -1
  165. package/dist/types/search/params.js +0 -1
  166. package/dist/types/search/person.d.ts +0 -13
  167. package/dist/types/search/person.d.ts.map +0 -1
  168. package/dist/types/search/person.js +0 -1
  169. package/dist/types/search/tv.d.ts +0 -39
  170. package/dist/types/search/tv.d.ts.map +0 -1
  171. package/dist/types/search/tv.js +0 -1
  172. package/dist/types/tv/aggregate_credits.d.ts +0 -58
  173. package/dist/types/tv/aggregate_credits.d.ts.map +0 -1
  174. package/dist/types/tv/aggregate_credits.js +0 -1
  175. package/dist/types/tv/alternative_titles.d.ts +0 -11
  176. package/dist/types/tv/alternative_titles.d.ts.map +0 -1
  177. package/dist/types/tv/alternative_titles.js +0 -1
  178. package/dist/types/tv/changes.d.ts +0 -3
  179. package/dist/types/tv/changes.d.ts.map +0 -1
  180. package/dist/types/tv/changes.js +0 -1
  181. package/dist/types/tv/content_ratings.d.ts +0 -5
  182. package/dist/types/tv/content_ratings.d.ts.map +0 -1
  183. package/dist/types/tv/content_ratings.js +0 -1
  184. package/dist/types/tv/credits.d.ts +0 -15
  185. package/dist/types/tv/credits.d.ts.map +0 -1
  186. package/dist/types/tv/credits.js +0 -1
  187. package/dist/types/tv/episode_groups.d.ts +0 -30
  188. package/dist/types/tv/episode_groups.d.ts.map +0 -1
  189. package/dist/types/tv/episode_groups.js +0 -1
  190. package/dist/types/tv/episodes.d.ts +0 -27
  191. package/dist/types/tv/episodes.d.ts.map +0 -1
  192. package/dist/types/tv/episodes.js +0 -1
  193. package/dist/types/tv/external_ids.d.ts +0 -26
  194. package/dist/types/tv/external_ids.d.ts.map +0 -1
  195. package/dist/types/tv/external_ids.js +0 -1
  196. package/dist/types/tv/images.d.ts +0 -15
  197. package/dist/types/tv/images.d.ts.map +0 -1
  198. package/dist/types/tv/images.js +0 -1
  199. package/dist/types/tv/index.d.ts +0 -21
  200. package/dist/types/tv/index.d.ts.map +0 -1
  201. package/dist/types/tv/index.js +0 -20
  202. package/dist/types/tv/keywords.d.ts +0 -11
  203. package/dist/types/tv/keywords.d.ts.map +0 -1
  204. package/dist/types/tv/keywords.js +0 -1
  205. package/dist/types/tv/lists.d.ts +0 -32
  206. package/dist/types/tv/lists.d.ts.map +0 -1
  207. package/dist/types/tv/lists.js +0 -1
  208. package/dist/types/tv/params.d.ts +0 -74
  209. package/dist/types/tv/params.d.ts.map +0 -1
  210. package/dist/types/tv/params.js +0 -1
  211. package/dist/types/tv/recommendations.d.ts +0 -5
  212. package/dist/types/tv/recommendations.d.ts.map +0 -1
  213. package/dist/types/tv/recommendations.js +0 -1
  214. package/dist/types/tv/reviews.d.ts +0 -6
  215. package/dist/types/tv/reviews.d.ts.map +0 -1
  216. package/dist/types/tv/reviews.js +0 -1
  217. package/dist/types/tv/screened_theatrically.d.ts +0 -21
  218. package/dist/types/tv/screened_theatrically.d.ts.map +0 -1
  219. package/dist/types/tv/screened_theatrically.js +0 -1
  220. package/dist/types/tv/seasons.d.ts +0 -17
  221. package/dist/types/tv/seasons.d.ts.map +0 -1
  222. package/dist/types/tv/seasons.js +0 -1
  223. package/dist/types/tv/similar.d.ts +0 -5
  224. package/dist/types/tv/similar.d.ts.map +0 -1
  225. package/dist/types/tv/similar.js +0 -1
  226. package/dist/types/tv/translations.d.ts +0 -20
  227. package/dist/types/tv/translations.d.ts.map +0 -1
  228. package/dist/types/tv/translations.js +0 -1
  229. package/dist/types/tv/tv_series.d.ts +0 -104
  230. package/dist/types/tv/tv_series.d.ts.map +0 -1
  231. package/dist/types/tv/tv_series.js +0 -1
  232. package/dist/types/tv/videos.d.ts +0 -9
  233. package/dist/types/tv/videos.d.ts.map +0 -1
  234. package/dist/types/tv/videos.js +0 -1
  235. package/dist/types/tv-episodes/credits.d.ts +0 -8
  236. package/dist/types/tv-episodes/credits.d.ts.map +0 -1
  237. package/dist/types/tv-episodes/credits.js +0 -1
  238. package/dist/types/tv-episodes/external_ids.d.ts +0 -3
  239. package/dist/types/tv-episodes/external_ids.d.ts.map +0 -1
  240. package/dist/types/tv-episodes/external_ids.js +0 -1
  241. package/dist/types/tv-episodes/images.d.ts +0 -3
  242. package/dist/types/tv-episodes/images.d.ts.map +0 -1
  243. package/dist/types/tv-episodes/images.js +0 -1
  244. package/dist/types/tv-episodes/index.d.ts +0 -4
  245. package/dist/types/tv-episodes/index.d.ts.map +0 -1
  246. package/dist/types/tv-episodes/index.js +0 -3
  247. package/dist/types/tv-episodes/params.d.ts +0 -30
  248. package/dist/types/tv-episodes/params.d.ts.map +0 -1
  249. package/dist/types/tv-episodes/params.js +0 -1
  250. package/dist/types/tv-episodes/translations.d.ts +0 -7
  251. package/dist/types/tv-episodes/translations.d.ts.map +0 -1
  252. package/dist/types/tv-episodes/translations.js +0 -1
  253. package/dist/types/tv-episodes/tv_episodes.d.ts.map +0 -1
  254. package/dist/types/tv-episodes/tv_episodes.js +0 -1
  255. package/dist/types/tv-episodes/videos.d.ts +0 -3
  256. package/dist/types/tv-episodes/videos.d.ts.map +0 -1
  257. package/dist/types/tv-episodes/videos.js +0 -1
  258. package/dist/types/tv-seasons/params.d.ts +0 -15
  259. package/dist/types/tv-seasons/params.d.ts.map +0 -1
  260. package/dist/types/tv-seasons/params.js +0 -1
  261. package/dist/types/tv-seasons/tv-season.d.ts +0 -1
  262. package/dist/types/tv-seasons/tv-season.d.ts.map +0 -1
  263. package/dist/types/tv-seasons/tv-season.js +0 -1
  264. /package/dist/types/{other/collections.js → collections.js} +0 -0
  265. /package/dist/types/{other/companies.js → companies.js} +0 -0
  266. /package/dist/types/{movies/credits.js → credits.js} +0 -0
  267. /package/dist/types/{discover/tv.js → discover.js} +0 -0
  268. /package/dist/types/{other/find.js → find.js} +0 -0
  269. /package/dist/types/{movies/keywords.js → keywords.js} +0 -0
  270. /package/dist/types/{discover/movie.js → movies.js} +0 -0
  271. /package/dist/types/{other/networks.js → networks.js} +0 -0
  272. /package/dist/types/{discover/params.js → search.js} +0 -0
  273. /package/dist/types/{other/tv_episode_groups.js → tv-episode-groups.js} +0 -0
  274. /package/dist/types/{movies/alternative_titles.js → tv-episodes.js} +0 -0
  275. /package/dist/types/{movies/changes.js → tv-seasons.js} +0 -0
  276. /package/dist/types/{movies/external_ids.js → tv-series.js} +0 -0
  277. /package/dist/types/{movies/images.js → watch-providers.js} +0 -0
package/README.md CHANGED
@@ -61,10 +61,29 @@ The main client class. **Each API method supports all the parameters supported b
61
61
  #### Constructor
62
62
 
63
63
  ```typescript
64
- const tmdb = new TMDB(accessToken: string);
64
+ const tmdb = new TMDB(accessToken: string, options?: TMDBOptions);
65
65
  ```
66
66
 
67
67
  - `accessToken`: **required**. Your TMDB API v4 access token.
68
+ - `options.logger`: Enable debug logging for all network requests.
69
+
70
+ Example:
71
+
72
+ ```typescript
73
+ const tmdb = new TMDB("your_access_token", { logger: true });
74
+ ```
75
+
76
+ Custom logger:
77
+
78
+ ```typescript
79
+ const tmdb = new TMDB("your_access_token", {
80
+ logger: (entry) => {
81
+ if (entry.type === "response") {
82
+ console.log("TMDB:", entry.endpoint, entry.status, entry.durationMs);
83
+ }
84
+ },
85
+ });
86
+ ```
68
87
 
69
88
  ---
70
89
 
package/dist/client.d.ts CHANGED
@@ -1,7 +1,11 @@
1
+ import { TMDBLoggerFn } from "./utils/logger";
1
2
  export declare class ApiClient {
2
3
  private accessToken;
3
4
  private baseUrl;
4
- constructor(accessToken: string);
5
+ private logger?;
6
+ constructor(accessToken: string, options?: {
7
+ logger?: boolean | TMDBLoggerFn;
8
+ });
5
9
  request<T>(endpoint: string, params?: Record<string, unknown | undefined>): Promise<T>;
6
10
  /**
7
11
  * Recursively converts null values to undefined in API responses.
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAEA,qBAAa,SAAS;IACrB,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,OAAO,CAA0C;gBAE7C,WAAW,EAAE,MAAM;IAIzB,OAAO,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,SAAS,CAAM,GAAG,OAAO,CAAC,CAAC,CAAC;IAmBhG;;;;OAIG;IACH,OAAO,CAAC,aAAa;YA2BP,WAAW;CAmBzB"}
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE1D,qBAAa,SAAS;IACrB,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,OAAO,CAA0C;IACzD,OAAO,CAAC,MAAM,CAAC,CAAa;gBAEhB,WAAW,EAAE,MAAM,EAAE,OAAO,GAAE;QAAE,MAAM,CAAC,EAAE,OAAO,GAAG,YAAY,CAAA;KAAO;IAK5E,OAAO,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,SAAS,CAAM,GAAG,OAAO,CAAC,CAAC,CAAC;IAgDhG;;;;OAIG;IACH,OAAO,CAAC,aAAa;YA2BP,WAAW;CA6BzB"}
package/dist/client.js CHANGED
@@ -1,9 +1,12 @@
1
1
  import { TMDBError } from "./errors/tmdb";
2
+ import { TMDBLogger } from "./utils/logger";
2
3
  export class ApiClient {
3
4
  accessToken;
4
5
  baseUrl = "https://api.themoviedb.org/3";
5
- constructor(accessToken) {
6
+ logger;
7
+ constructor(accessToken, options = {}) {
6
8
  this.accessToken = accessToken;
9
+ this.logger = TMDBLogger.from(options.logger);
7
10
  }
8
11
  async request(endpoint, params = {}) {
9
12
  const url = new URL(`${this.baseUrl}${endpoint}`);
@@ -12,14 +15,41 @@ export class ApiClient {
12
15
  continue;
13
16
  url.searchParams.append(key, String(value));
14
17
  }
15
- const res = await fetch(url.toString(), {
16
- headers: {
17
- Authorization: `Bearer ${this.accessToken}`,
18
- "Content-Type": "application/json;charset=utf-8",
19
- },
18
+ const startedAt = Date.now();
19
+ this.logger?.log({
20
+ type: "request",
21
+ method: "GET",
22
+ endpoint,
20
23
  });
24
+ let res;
25
+ try {
26
+ res = await fetch(url.toString(), {
27
+ headers: {
28
+ Authorization: `Bearer ${this.accessToken}`,
29
+ "Content-Type": "application/json;charset=utf-8",
30
+ },
31
+ });
32
+ }
33
+ catch (error) {
34
+ this.logger?.log({
35
+ type: "error",
36
+ method: "GET",
37
+ endpoint,
38
+ errorMessage: error instanceof Error ? error.message : String(error),
39
+ durationMs: Date.now() - startedAt,
40
+ });
41
+ throw error;
42
+ }
21
43
  if (!res.ok)
22
- await this.handleError(res);
44
+ await this.handleError(res, endpoint);
45
+ this.logger?.log({
46
+ type: "response",
47
+ method: "GET",
48
+ endpoint,
49
+ status: res.status,
50
+ statusText: res.statusText,
51
+ durationMs: Date.now() - startedAt,
52
+ });
23
53
  const data = await res.json();
24
54
  return this.sanitizeNulls(data);
25
55
  }
@@ -50,7 +80,7 @@ export class ApiClient {
50
80
  }
51
81
  return sanitized;
52
82
  }
53
- async handleError(res) {
83
+ async handleError(res, endpoint) {
54
84
  let errorMessage = res.statusText;
55
85
  let tmdbStatusCode = -1;
56
86
  try {
@@ -65,6 +95,15 @@ export class ApiClient {
65
95
  console.error(`Unknown error: ${error}`);
66
96
  // If response is not JSON, fallback to HTTP status text
67
97
  }
98
+ this.logger?.log({
99
+ type: "error",
100
+ method: "GET",
101
+ endpoint,
102
+ status: res.status,
103
+ statusText: res.statusText,
104
+ tmdbStatusCode,
105
+ errorMessage,
106
+ });
68
107
  const error = new TMDBError(errorMessage, res.status, tmdbStatusCode);
69
108
  throw error;
70
109
  }
@@ -8,6 +8,7 @@ export declare abstract class TMDBAPIBase {
8
8
  /**
9
9
  * Merges the endpoint's params with TMDB-wide defaults (language, region).
10
10
  * Works only for param types that include optional `language` and `region` fields.
11
+ * Only request-safe defaults are merged — config-only options (logger, images, etc.) are excluded.
11
12
  */
12
13
  protected applyDefaults<T extends object>(params?: T): T | undefined;
13
14
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/endpoints/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,8BAAsB,WAAW;IAChC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC;IAC5B,SAAS,CAAC,cAAc,EAAE,WAAW,CAAC;gBAE1B,MAAM,EAAE,SAAS,EAAE,cAAc,GAAE,WAAgB;IAK/D;;;OAGG;IACH,SAAS,CAAC,aAAa,CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS;IAIpE;;;OAGG;IACH,SAAS,CAAC,YAAY,CAAC,CAAC,SAAS;QAAE,QAAQ,CAAC,EAAE,QAAQ,CAAA;KAAE,EAAE,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS;CAOpF"}
1
+ {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/endpoints/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,8BAAsB,WAAW;IAChC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC;IAC5B,SAAS,CAAC,cAAc,EAAE,WAAW,CAAC;gBAE1B,MAAM,EAAE,SAAS,EAAE,cAAc,GAAE,WAAgB;IAK/D;;;;OAIG;IACH,SAAS,CAAC,aAAa,CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS;IAKpE;;;OAGG;IACH,SAAS,CAAC,YAAY,CAAC,CAAC,SAAS;QAAE,QAAQ,CAAC,EAAE,QAAQ,CAAA;KAAE,EAAE,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS;CAOpF"}
@@ -8,9 +8,11 @@ export class TMDBAPIBase {
8
8
  /**
9
9
  * Merges the endpoint's params with TMDB-wide defaults (language, region).
10
10
  * Works only for param types that include optional `language` and `region` fields.
11
+ * Only request-safe defaults are merged — config-only options (logger, images, etc.) are excluded.
11
12
  */
12
13
  applyDefaults(params) {
13
- return { ...this.defaultOptions, ...params };
14
+ const { language, region } = this.defaultOptions;
15
+ return { ...(language !== undefined && { language }), ...(region !== undefined && { region }), ...params };
14
16
  }
15
17
  /**
16
18
  * Ensures params contains a language: prefer explicit param, fallback to defaultOptions.language.
@@ -1,4 +1,4 @@
1
- import { CollectionBaseParam, Collection, CollectionDetailsParams, CollectionImages, CollectionImagesParams, CollectionTranslations } from "../types/other/collections";
1
+ import { CollectionBaseParam, Collection, CollectionDetailsParams, CollectionImages, CollectionImagesParams, CollectionTranslations } from "../types/collections";
2
2
  import { TMDBAPIBase } from "./base";
3
3
  export declare class CollectionsAPI extends TMDBAPIBase {
4
4
  private collectionPath;
@@ -1 +1 @@
1
- {"version":3,"file":"collections.d.ts","sourceRoot":"","sources":["../../src/endpoints/collections.ts"],"names":[],"mappings":"AACA,OAAO,EACN,mBAAmB,EACnB,UAAU,EACV,uBAAuB,EACvB,gBAAgB,EAChB,sBAAsB,EACtB,sBAAsB,EACtB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,qBAAa,cAAe,SAAQ,WAAW;IAC9C,OAAO,CAAC,cAAc;IAItB;;;;;;;;;OASG;IACG,OAAO,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,UAAU,CAAC;IAMnE;;;;;;;;;;;OAWG;IACG,MAAM,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAMvE;;;;;;;;OAQG;IACG,YAAY,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,sBAAsB,CAAC;CAIhF"}
1
+ {"version":3,"file":"collections.d.ts","sourceRoot":"","sources":["../../src/endpoints/collections.ts"],"names":[],"mappings":"AACA,OAAO,EACN,mBAAmB,EACnB,UAAU,EACV,uBAAuB,EACvB,gBAAgB,EAChB,sBAAsB,EACtB,sBAAsB,EACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,qBAAa,cAAe,SAAQ,WAAW;IAC9C,OAAO,CAAC,cAAc;IAItB;;;;;;;;;OASG;IACG,OAAO,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,UAAU,CAAC;IAMnE;;;;;;;;;;;OAWG;IACG,MAAM,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAMvE;;;;;;;;OAQG;IACG,YAAY,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,sBAAsB,CAAC;CAIhF"}
@@ -1,4 +1,4 @@
1
- import { Company, CompanyAlternativeNames, CompanyAlternativeNamesParams, CompanyImages, CompanyImagesParams, CompanyDetailsParams } from "../types/other/companies";
1
+ import { Company, CompanyAlternativeNames, CompanyAlternativeNamesParams, CompanyImages, CompanyImagesParams, CompanyDetailsParams } from "../types/companies";
2
2
  import { TMDBAPIBase } from "./base";
3
3
  export declare class CompaniesAPI extends TMDBAPIBase {
4
4
  private companyPath;
@@ -1 +1 @@
1
- {"version":3,"file":"companies.d.ts","sourceRoot":"","sources":["../../src/endpoints/companies.ts"],"names":[],"mappings":"AACA,OAAO,EACN,OAAO,EACP,uBAAuB,EACvB,6BAA6B,EAC7B,aAAa,EACb,mBAAmB,EACnB,oBAAoB,EACpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,qBAAa,YAAa,SAAQ,WAAW;IAC5C,OAAO,CAAC,WAAW;IAInB;;;;;;;;OAQG;IACG,OAAO,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,OAAO,CAAC;IAK7D;;;;;;;;OAQG;IACG,iBAAiB,CAAC,MAAM,EAAE,6BAA6B,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAKhG;;;;;;;;;;OAUG;IACG,MAAM,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,aAAa,CAAC;CAKjE"}
1
+ {"version":3,"file":"companies.d.ts","sourceRoot":"","sources":["../../src/endpoints/companies.ts"],"names":[],"mappings":"AACA,OAAO,EACN,OAAO,EACP,uBAAuB,EACvB,6BAA6B,EAC7B,aAAa,EACb,mBAAmB,EACnB,oBAAoB,EACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,qBAAa,YAAa,SAAQ,WAAW;IAC5C,OAAO,CAAC,WAAW;IAInB;;;;;;;;OAQG;IACG,OAAO,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,OAAO,CAAC;IAK7D;;;;;;;;OAQG;IACG,iBAAiB,CAAC,MAAM,EAAE,6BAA6B,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAKhG;;;;;;;;;;OAUG;IACG,MAAM,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,aAAa,CAAC;CAKjE"}
@@ -1,4 +1,4 @@
1
- import { CreditDetails, CreditDetailsParams } from "../types/other/credits";
1
+ import { CreditDetails, CreditDetailsParams } from "../types/credits";
2
2
  import { TMDBAPIBase } from "./base";
3
3
  export declare class CreditsAPI extends TMDBAPIBase {
4
4
  private creditPath;
@@ -1 +1 @@
1
- {"version":3,"file":"credits.d.ts","sourceRoot":"","sources":["../../src/endpoints/credits.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,qBAAa,UAAW,SAAQ,WAAW;IAC1C,OAAO,CAAC,UAAU;IAIlB;;;;;;;;;OASG;IACG,OAAO,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,aAAa,CAAC;CAKlE"}
1
+ {"version":3,"file":"credits.d.ts","sourceRoot":"","sources":["../../src/endpoints/credits.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,qBAAa,UAAW,SAAQ,WAAW;IAC1C,OAAO,CAAC,UAAU;IAIlB;;;;;;;;;OASG;IACG,OAAO,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,aAAa,CAAC;CAKlE"}
@@ -1,13 +1,7 @@
1
- import { ApiClient } from "../client";
2
- import { MediaWatchProviders } from "../types";
3
- import { TMDBOptions } from "../types/config";
4
- import { MovieAlternativeTitles, MovieAppendToResponseNamespace, MovieCredits, MovieDetails, MovieDetailsWithAppends, MovieExternalIDs, MovieImages, MovieKeywords, MovieRecommendations, MovieReleaseDates, MovieReviews, MovieSimilar, MovieTranslations, MovieVideos } from "../types/movies";
5
- import { MovieChanges } from "../types/movies/changes";
6
- import { MovieAlternativeTitlesParams, MovieChangesParams, MovieCreditsParams, MovieDetailsParams, MovieExternalIDsParams, MovieImagesParams, MovieKeywordsParams, MovieRecommendationsParams, MovieReleaseDatesParams, MovieReviewsParams, MovieSimilarParams, MovieTranslationsParams, MovieVideosParams, MovieWatchProvidersParams } from "../types/movies/params";
7
- export declare class MoviesAPI {
8
- private client;
9
- private defaultOptions;
10
- constructor(client: ApiClient, options?: TMDBOptions);
1
+ import { MediaWatchProviders, MovieAlternativeTitlesParams, MovieChangesParams, MovieCreditsParams, MovieDetailsParams, MovieExternalIDsParams, MovieImagesParams, MovieKeywordsParams, MovieRecommendationsParams, MovieReleaseDatesParams, MovieReviewsParams, MovieSimilarParams, MovieTranslationsParams, MovieVideosParams, MovieWatchProvidersParams } from "../types";
2
+ import { MovieAlternativeTitles, MovieAppendToResponseNamespace, MovieChanges, MovieCredits, MovieDetails, MovieDetailsWithAppends, MovieExternalIDs, MovieImages, MovieKeywords, MovieRecommendations, MovieReleaseDates, MovieReviews, MovieSimilar, MovieTranslations, MovieVideos } from "../types/movies";
3
+ import { TMDBAPIBase } from "./base";
4
+ export declare class MoviesAPI extends TMDBAPIBase {
11
5
  private moviePath;
12
6
  private movieSubPath;
13
7
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"movies.d.ts","sourceRoot":"","sources":["../../src/endpoints/movies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EACN,sBAAsB,EACtB,8BAA8B,EAC9B,YAAY,EACZ,YAAY,EACZ,uBAAuB,EACvB,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,oBAAoB,EACpB,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EACN,4BAA4B,EA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AAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAKhF;;;;;;;;;;OAUG;IACG,OAAO,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,YAAY,CAAC;IAMhE;;;;;;;;;;;;OAYG;IACG,OAAO,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,YAAY,CAAC;IAMhE;;;;;;;;;;OAUG;IACG,YAAY,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAK/E;;;;;;;;OAQG;IACG,MAAM,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,WAAW,CAAC;IAM7D;;;;;;;;;;;;;;;OAeG;IACG,eAAe,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAItF"}
@@ -1,11 +1,6 @@
1
1
  import { ENDPOINTS } from "../routes";
2
- export class MoviesAPI {
3
- client;
4
- defaultOptions;
5
- constructor(client, options = {}) {
6
- this.client = client;
7
- this.defaultOptions = options;
8
- }
2
+ import { TMDBAPIBase } from "./base";
3
+ export class MoviesAPI extends TMDBAPIBase {
9
4
  moviePath(movie_id) {
10
5
  return `${ENDPOINTS.MOVIES.DETAILS}/${movie_id}`;
11
6
  }
@@ -1,4 +1,5 @@
1
- import { AlternativeNamesResult, Network, NetworkBaseParams, NetworkImages } from "../types";
1
+ import { AlternativeNamesResult } from "../types";
2
+ import { Network, NetworkBaseParams, NetworkImages } from "../types/networks";
2
3
  import { TMDBAPIBase } from "./base";
3
4
  export declare class NetworksAPI extends TMDBAPIBase {
4
5
  private networkPath;
@@ -1 +1 @@
1
- {"version":3,"file":"networks.d.ts","sourceRoot":"","sources":["../../src/endpoints/networks.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC7F,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,qBAAa,WAAY,SAAQ,WAAW;IAC3C,OAAO,CAAC,WAAW;IAInB;;;;;;;;OAQG;IACG,OAAO,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC;IAK1D;;;;;;;;OAQG;IACG,iBAAiB,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAKnF;;;;;;;;OAQG;IACG,MAAM,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,aAAa,CAAC;CAI/D"}
1
+ {"version":3,"file":"networks.d.ts","sourceRoot":"","sources":["../../src/endpoints/networks.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,qBAAa,WAAY,SAAQ,WAAW;IAC3C,OAAO,CAAC,WAAW;IAInB;;;;;;;;OAQG;IACG,OAAO,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC;IAK1D;;;;;;;;OAQG;IACG,iBAAiB,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAKnF;;;;;;;;OAQG;IACG,MAAM,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,aAAa,CAAC;CAI/D"}
@@ -1,10 +1,5 @@
1
- import { MovieResultItem, PaginatedResponse } from "../types";
2
- import { SearchCollectionsParams, SearchCompanyParams, SearchKeywordsParams, SearchMoviesParams, SearchPersonParams } from "../types/search/params";
3
- import { CollectionResultItem } from "../types/search/collection";
4
- import { CompanyResultItem } from "../types/search/company";
5
- import { KeywordResultItem } from "../types/search/keyword";
1
+ import { CollectionResultItem, CompanyResultItem, KeywordResultItem, MovieResultItem, PaginatedResponse, PersonResultItem, SearchCollectionsParams, SearchCompanyParams, SearchKeywordsParams, SearchMoviesParams, SearchPersonParams } from "../types";
6
2
  import { TMDBAPIBase } from "./base";
7
- import { PersonResultItem } from "../types/search/person";
8
3
  export declare class SearchAPI extends TMDBAPIBase {
9
4
  /**
10
5
  * Search Collection
@@ -1 +1 @@
1
- {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/endpoints/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE9D,OAAO,EACN,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,qBAAa,SAAU,SAAQ,WAAW;IACzC;;;;;;;;;;;OAWG;IACG,WAAW,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,iBAAiB,CAAC,oBAAoB,CAAC,CAAC;IAIpG;;;;;;;;;;;;;OAaG;IACG,MAAM,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC,eAAe,CAAC,CAAC;IAIrF;;;;;;;;OAQG;IACG,OAAO,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IAIzF;;;;;;;;OAQG;IACG,OAAO,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IAI1F;;;;;;;;OAQG;IACG,MAAM,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;CAGtF"}
1
+ {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/endpoints/search.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,qBAAa,SAAU,SAAQ,WAAW;IACzC;;;;;;;;;;;OAWG;IACG,WAAW,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,iBAAiB,CAAC,oBAAoB,CAAC,CAAC;IAIpG;;;;;;;;;;;;;OAaG;IACG,MAAM,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC,eAAe,CAAC,CAAC;IAIrF;;;;;;;;OAQG;IACG,OAAO,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IAIzF;;;;;;;;OAQG;IACG,OAAO,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IAI1F;;;;;;;;OAQG;IACG,MAAM,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;CAGtF"}
@@ -1,4 +1,4 @@
1
- import { TVEpisodeGroupDetails, TVEpisodeGroupParams } from "../types/other/tv_episode_groups";
1
+ import { TVEpisodeGroupDetails, TVEpisodeGroupParams } from "../types/tv-episode-groups";
2
2
  import { TMDBAPIBase } from "./base";
3
3
  export declare class TVEpisodeGroupsAPI extends TMDBAPIBase {
4
4
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"tv_episode_groups.d.ts","sourceRoot":"","sources":["../../src/endpoints/tv_episode_groups.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAC/F,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,qBAAa,kBAAmB,SAAQ,WAAW;IAClD;;;;;;;OAOG;IACG,OAAO,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAI3E"}
1
+ {"version":3,"file":"tv_episode_groups.d.ts","sourceRoot":"","sources":["../../src/endpoints/tv_episode_groups.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AACzF,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,qBAAa,kBAAmB,SAAQ,WAAW;IAClD;;;;;;;OAOG;IACG,OAAO,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAI3E"}
@@ -1,11 +1,4 @@
1
- import { Changes } from "../types";
2
- import { TVEpisodeCredits } from "../types/tv-episodes";
3
- import { TVEpisodeExternalIDs } from "../types/tv-episodes/external_ids";
4
- import { TVEpisodeImages } from "../types/tv-episodes/images";
5
- import { TVEpisodeBaseParams, TVEpisodeCreditsParams, TVEpisodeDetailsParams, TVEpisodeId, TVEpisodeImagesParams } from "../types/tv-episodes/params";
6
- import { TVEpisodeTranslations } from "../types/tv-episodes/translations";
7
- import { TVEpisode, TVEpisodeAppendToResponseNamespace, TVEpisodeDetailsWithAppends } from "../types/tv-episodes/tv_episodes";
8
- import { TVEpisodeVideos } from "../types/tv-episodes/videos";
1
+ import { Changes, TVEpisode, TVEpisodeAppendToResponseNamespace, TVEpisodeBaseParams, TVEpisodeCredits, TVEpisodeCreditsParams, TVEpisodeDetailsParams, TVEpisodeDetailsWithAppends, TVEpisodeExternalIDs, TVEpisodeId, TVEpisodeImages, TVEpisodeImagesParams, TVEpisodeTranslations, TVEpisodeVideos } from "../types";
9
2
  import { TMDBAPIBase } from "./base";
10
3
  export declare class TVEpisodesAPI extends TMDBAPIBase {
11
4
  private episodePath;
@@ -1 +1 @@
1
- {"version":3,"file":"tv_episodes.d.ts","sourceRoot":"","sources":["../../src/endpoints/tv_episodes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EACN,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,EACtB,WAAW,EACX,qBAAqB,EACrB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,kCAAkC,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC9H,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,qBAAa,aAAc,SAAQ,WAAW;IAC7C,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,cAAc;IAItB;;;;;;;;;;;;OAYG;IACG,OAAO,CAAC,CAAC,SAAS,SAAS,kCAAkC,EAAE,GAAG,EAAE,EACzE,MAAM,EAAE,sBAAsB,GAAG;QAAE,kBAAkB,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;KAAE,GACrE,OAAO,CAAC,CAAC,SAAS,EAAE,GAAG,SAAS,GAAG,2BAA2B,CAAC,CAAC,CAAC,CAAC;IAMrE;;;;;;;;;;;;;;;;;;OAkBG;IACG,OAAO,CAAC,MAAM,EAAE,WAA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AMrE;;;;;;;;;;;;;;;;;;OAkBG;IACG,OAAO,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC;IAKpD;;;;;;;;;;OAUG;IACG,OAAO,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAMxE;;;;;;;;;;OAUG;IACG,YAAY,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAK9E;;;;;;;;;;;;;;;;OAgBG;IACG,MAAM,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,eAAe,CAAC;IAMrE;;;;;;;;;;;;OAYG;IACG,YAAY,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAK/E;;;;;;;;;;OAUG;IACG,MAAM,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,eAAe,CAAC;CAInE"}
@@ -0,0 +1,129 @@
1
+ import { Changes, MediaWatchProviders, TVSeasonAggregateCredits, TVSeasonAggregateCreditsParams, TVSeasonAppendToResponseNamespace, TVSeasonBaseParams, TVSeasonChangesParams, TVSeasonCredits, TVSeasonCreditsParams, TVSeasonDetailsParams, TVSeasonDetailsWithAppends, TVSeasonExternalIDs, TVSeasonImages, TVSeasonImagesParams, TVSeasonTranslations, TVSeasonVideos, TVSeasonVideosParams, TVSeasonWatchProvidersParams, TVSeason } from "../types";
2
+ import { TMDBAPIBase } from "./base";
3
+ export declare class TVSeasonsAPI extends TMDBAPIBase {
4
+ private seasonPath;
5
+ private seasonSubPath;
6
+ /**
7
+ * Details
8
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/season/{season_number}
9
+ *
10
+ * Query the details of a TV season.
11
+ * @param series_id The ID of the TV series.
12
+ * @param season_number The season number within the TV show.
13
+ * @param append_to_response A comma-separated list of the fields to include in the response.
14
+ * @param language The language to use for the response.
15
+ * @returns A promise that resolves to the TV season details.
16
+ * @reference https://developer.themoviedb.org/reference/tv-season-details
17
+ */
18
+ details<T extends readonly TVSeasonAppendToResponseNamespace[] = []>(params: Omit<TVSeasonDetailsParams, "append_to_response"> & {
19
+ append_to_response?: T;
20
+ }): Promise<T extends [] ? TVSeason : TVSeasonDetailsWithAppends<T>>;
21
+ /**
22
+ * Aggregate Credits
23
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/season/{season_number}/aggregate_credits
24
+ *
25
+ * Get the aggregate credits for a TV season.
26
+ * This returns the full cast and crew across all episodes of the season.
27
+ * @param series_id The ID of the TV series.
28
+ * @param season_number The season number within the TV show.
29
+ * @param language The language to use for the response.
30
+ * @returns A promise that resolves to the TV season aggregate credits.
31
+ * @reference https://developer.themoviedb.org/reference/tv-season-aggregate-credits
32
+ */
33
+ aggregate_credits(params: TVSeasonAggregateCreditsParams): Promise<TVSeasonAggregateCredits>;
34
+ /**
35
+ * Changes
36
+ * GET - https://api.themoviedb.org/3/tv/season/{season_id}/changes
37
+ *
38
+ * Get the changes for a TV season by season ID. By default only the last 24 hours are returned.
39
+ * You can query up to 14 days in a single query by using the start_date and end_date query parameters.
40
+ * @param season_id The ID of the TV season.
41
+ * @param start_date Filter changes by start date (ISO 8601 format, e.g. "2024-01-01").
42
+ * @param end_date Filter changes by end date (ISO 8601 format, e.g. "2024-01-14").
43
+ * @param page The page of results to return.
44
+ * @returns A promise that resolves to the TV season changes history.
45
+ * @reference https://developer.themoviedb.org/reference/tv-season-changes-by-id
46
+ */
47
+ changes(params: TVSeasonChangesParams): Promise<Changes>;
48
+ /**
49
+ * Credits
50
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/season/{season_number}/credits
51
+ *
52
+ * Get the credits for a TV season.
53
+ * @param series_id The ID of the TV series.
54
+ * @param season_number The season number within the TV show.
55
+ * @param language The language to use for the response.
56
+ * @returns A promise that resolves to the TV season credits.
57
+ * @reference https://developer.themoviedb.org/reference/tv-season-credits
58
+ */
59
+ credits(params: TVSeasonCreditsParams): Promise<TVSeasonCredits>;
60
+ /**
61
+ * External IDs
62
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/season/{season_number}/external_ids
63
+ *
64
+ * Get a list of external IDs that have been added to a TV season.
65
+ * @param series_id The ID of the TV series.
66
+ * @param season_number The season number within the TV show.
67
+ * @returns A promise that resolves to the TV season external IDs.
68
+ * @reference https://developer.themoviedb.org/reference/tv-season-external-ids
69
+ */
70
+ external_ids(params: TVSeasonBaseParams): Promise<TVSeasonExternalIDs>;
71
+ /**
72
+ * Images
73
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/season/{season_number}/images
74
+ *
75
+ * Get the images that belong to a TV season. Returns season posters.
76
+ *
77
+ * NOTE: If you have a language specified, it will act as a filter on the returned items.
78
+ * You can use the include_image_language param to query additional languages.
79
+ *
80
+ * @param series_id The ID of the TV series.
81
+ * @param season_number The season number within the TV show.
82
+ * @param language The language code to filter images by language.
83
+ * @param include_image_language A comma-separated list of language codes to include images for.
84
+ * @returns A promise that resolves to the TV season images.
85
+ * @reference https://developer.themoviedb.org/reference/tv-season-images
86
+ */
87
+ images(params: TVSeasonImagesParams): Promise<TVSeasonImages>;
88
+ /**
89
+ * Translations
90
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/season/{season_number}/translations
91
+ *
92
+ * Get the translations that have been added to a TV season.
93
+ * Take a read through our language documentation for more information about languages on TMDB.
94
+ * https://developer.themoviedb.org/docs/languages
95
+ * @param series_id The ID of the TV series.
96
+ * @param season_number The season number within the TV show.
97
+ * @returns A promise that resolves to the TV season translations.
98
+ * @reference https://developer.themoviedb.org/reference/tv-season-translations
99
+ */
100
+ translations(params: TVSeasonBaseParams): Promise<TVSeasonTranslations>;
101
+ /**
102
+ * Videos
103
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/season/{season_number}/videos
104
+ *
105
+ * Get the videos that belong to a TV season.
106
+ * @param series_id The ID of the TV series.
107
+ * @param season_number The season number within the TV show.
108
+ * @param language The language to use for the response.
109
+ * @param include_video_language A comma-separated list of language codes to include videos for.
110
+ * @returns A promise that resolves to the TV season videos.
111
+ * @reference https://developer.themoviedb.org/reference/tv-season-videos
112
+ */
113
+ videos(params: TVSeasonVideosParams): Promise<TVSeasonVideos>;
114
+ /**
115
+ * Watch Providers
116
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/season/{season_number}/watch/providers
117
+ *
118
+ * Get the watch providers for a specific TV season.
119
+ * Powered by our partnership with JustWatch, you can query which streaming services
120
+ * have the season available.
121
+ * @param series_id The ID of the TV series.
122
+ * @param season_number The season number within the TV show.
123
+ * @param language The language to use for the response.
124
+ * @returns A promise that resolves to the TV season watch providers.
125
+ * @reference https://developer.themoviedb.org/reference/tv-season-watch-providers
126
+ */
127
+ watch_providers(params: TVSeasonWatchProvidersParams): Promise<MediaWatchProviders>;
128
+ }
129
+ //# sourceMappingURL=tv_seasons.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tv_seasons.d.ts","sourceRoot":"","sources":["../../src/endpoints/tv_seasons.ts"],"names":[],"mappings":"AACA,OAAO,EACN,OAAO,EACP,mBAAmB,EACnB,wBAAwB,EACxB,8BAA8B,EAC9B,iCAAiC,EACjC,kBAAkB,EAClB,qBAAqB,EACrB,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACrB,0BAA0B,EAC1B,mBAAmB,EACnB,cAAc,EACd,oBAAoB,EACpB,oBAAoB,EACpB,cAAc,EACd,oBAAoB,EACpB,4BAA4B,EAC5B,QAAQ,EACR,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,qBAAa,YAAa,SAAQ,WAAW;IAC5C,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,aAAa;IAIrB;;;;;;;;;;;OAWG;IACG,OAAO,CAAC,CAAC,SAAS,SAAS,iCAAiC,EAAE,GAAG,EAAE,EACxE,MAAM,EAAE,IAAI,CAAC,qBAAqB,EAAE,oBAAoB,CAAC,GAAG;QAAE,kBAAkB,CAAC,EAAE,CAAC,CAAA;KAAE,GACpF,OAAO,CAAC,CAAC,SAAS,EAAE,GAAG,QAAQ,GAAG,0BAA0B,CAAC,CAAC,CAAC,CAAC;IAMnE;;;;;;;;;;;OAWG;IACG,iBAAiB,CAAC,MAAM,EAAE,8BAA8B,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAMlG;;;;;;;;;;;;OAYG;IACG,OAAO,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,OAAO,CAAC;IAM9D;;;;;;;;;;OAUG;IACG,OAAO,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,eAAe,CAAC;IAMtE;;;;;;;;;OASG;IACG,YAAY,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAK5E;;;;;;;;;;;;;;;OAeG;IACG,MAAM,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,cAAc,CAAC;IAMnE;;;;;;;;;;;OAWG;IACG,YAAY,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAK7E;;;;;;;;;;;OAWG;IACG,MAAM,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,cAAc,CAAC;IAMnE;;;;;;;;;;;;OAYG;IACG,eAAe,CAAC,MAAM,EAAE,4BAA4B,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAKzF"}
@@ -0,0 +1,164 @@
1
+ import { ENDPOINTS } from "../routes";
2
+ import { TMDBAPIBase } from "./base";
3
+ export class TVSeasonsAPI extends TMDBAPIBase {
4
+ seasonPath(params) {
5
+ return `${ENDPOINTS.TV_SERIES.DETAILS}/${params.series_id}${ENDPOINTS.TV_SEASONS.DETAILS}/${params.season_number}`;
6
+ }
7
+ seasonSubPath(params, route) {
8
+ return `${this.seasonPath(params)}${route}`;
9
+ }
10
+ /**
11
+ * Details
12
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/season/{season_number}
13
+ *
14
+ * Query the details of a TV season.
15
+ * @param series_id The ID of the TV series.
16
+ * @param season_number The season number within the TV show.
17
+ * @param append_to_response A comma-separated list of the fields to include in the response.
18
+ * @param language The language to use for the response.
19
+ * @returns A promise that resolves to the TV season details.
20
+ * @reference https://developer.themoviedb.org/reference/tv-season-details
21
+ */
22
+ async details(params) {
23
+ const { language = this.defaultOptions.language, append_to_response, ...rest } = params;
24
+ const endpoint = this.seasonPath(rest);
25
+ return this.client.request(endpoint, { language, append_to_response });
26
+ }
27
+ /**
28
+ * Aggregate Credits
29
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/season/{season_number}/aggregate_credits
30
+ *
31
+ * Get the aggregate credits for a TV season.
32
+ * This returns the full cast and crew across all episodes of the season.
33
+ * @param series_id The ID of the TV series.
34
+ * @param season_number The season number within the TV show.
35
+ * @param language The language to use for the response.
36
+ * @returns A promise that resolves to the TV season aggregate credits.
37
+ * @reference https://developer.themoviedb.org/reference/tv-season-aggregate-credits
38
+ */
39
+ async aggregate_credits(params) {
40
+ const { language = this.defaultOptions.language, ...rest } = params;
41
+ const endpoint = this.seasonSubPath(rest, ENDPOINTS.TV_SEASONS.AGGREGATE_CREDITS);
42
+ return this.client.request(endpoint, { language });
43
+ }
44
+ /**
45
+ * Changes
46
+ * GET - https://api.themoviedb.org/3/tv/season/{season_id}/changes
47
+ *
48
+ * Get the changes for a TV season by season ID. By default only the last 24 hours are returned.
49
+ * You can query up to 14 days in a single query by using the start_date and end_date query parameters.
50
+ * @param season_id The ID of the TV season.
51
+ * @param start_date Filter changes by start date (ISO 8601 format, e.g. "2024-01-01").
52
+ * @param end_date Filter changes by end date (ISO 8601 format, e.g. "2024-01-14").
53
+ * @param page The page of results to return.
54
+ * @returns A promise that resolves to the TV season changes history.
55
+ * @reference https://developer.themoviedb.org/reference/tv-season-changes-by-id
56
+ */
57
+ async changes(params) {
58
+ const { season_id, ...rest } = params;
59
+ const endpoint = `${ENDPOINTS.TV_SERIES.DETAILS}${ENDPOINTS.TV_SEASONS.DETAILS}/${season_id}${ENDPOINTS.TV_SEASONS.CHANGES}`;
60
+ return this.client.request(endpoint, { ...rest });
61
+ }
62
+ /**
63
+ * Credits
64
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/season/{season_number}/credits
65
+ *
66
+ * Get the credits for a TV season.
67
+ * @param series_id The ID of the TV series.
68
+ * @param season_number The season number within the TV show.
69
+ * @param language The language to use for the response.
70
+ * @returns A promise that resolves to the TV season credits.
71
+ * @reference https://developer.themoviedb.org/reference/tv-season-credits
72
+ */
73
+ async credits(params) {
74
+ const { language = this.defaultOptions.language, ...rest } = params;
75
+ const endpoint = this.seasonSubPath(rest, ENDPOINTS.TV_SEASONS.CREDITS);
76
+ return this.client.request(endpoint, { language });
77
+ }
78
+ /**
79
+ * External IDs
80
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/season/{season_number}/external_ids
81
+ *
82
+ * Get a list of external IDs that have been added to a TV season.
83
+ * @param series_id The ID of the TV series.
84
+ * @param season_number The season number within the TV show.
85
+ * @returns A promise that resolves to the TV season external IDs.
86
+ * @reference https://developer.themoviedb.org/reference/tv-season-external-ids
87
+ */
88
+ async external_ids(params) {
89
+ const endpoint = this.seasonSubPath(params, ENDPOINTS.TV_SEASONS.EXTERNAL_IDS);
90
+ return this.client.request(endpoint);
91
+ }
92
+ /**
93
+ * Images
94
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/season/{season_number}/images
95
+ *
96
+ * Get the images that belong to a TV season. Returns season posters.
97
+ *
98
+ * NOTE: If you have a language specified, it will act as a filter on the returned items.
99
+ * You can use the include_image_language param to query additional languages.
100
+ *
101
+ * @param series_id The ID of the TV series.
102
+ * @param season_number The season number within the TV show.
103
+ * @param language The language code to filter images by language.
104
+ * @param include_image_language A comma-separated list of language codes to include images for.
105
+ * @returns A promise that resolves to the TV season images.
106
+ * @reference https://developer.themoviedb.org/reference/tv-season-images
107
+ */
108
+ async images(params) {
109
+ const { language = this.defaultOptions.language, include_image_language, ...rest } = params;
110
+ const endpoint = this.seasonSubPath(rest, ENDPOINTS.TV_SEASONS.IMAGES);
111
+ return this.client.request(endpoint, { language, include_image_language });
112
+ }
113
+ /**
114
+ * Translations
115
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/season/{season_number}/translations
116
+ *
117
+ * Get the translations that have been added to a TV season.
118
+ * Take a read through our language documentation for more information about languages on TMDB.
119
+ * https://developer.themoviedb.org/docs/languages
120
+ * @param series_id The ID of the TV series.
121
+ * @param season_number The season number within the TV show.
122
+ * @returns A promise that resolves to the TV season translations.
123
+ * @reference https://developer.themoviedb.org/reference/tv-season-translations
124
+ */
125
+ async translations(params) {
126
+ const endpoint = this.seasonSubPath(params, ENDPOINTS.TV_SEASONS.TRANSLATIONS);
127
+ return this.client.request(endpoint);
128
+ }
129
+ /**
130
+ * Videos
131
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/season/{season_number}/videos
132
+ *
133
+ * Get the videos that belong to a TV season.
134
+ * @param series_id The ID of the TV series.
135
+ * @param season_number The season number within the TV show.
136
+ * @param language The language to use for the response.
137
+ * @param include_video_language A comma-separated list of language codes to include videos for.
138
+ * @returns A promise that resolves to the TV season videos.
139
+ * @reference https://developer.themoviedb.org/reference/tv-season-videos
140
+ */
141
+ async videos(params) {
142
+ const { language = this.defaultOptions.language, include_video_language, ...rest } = params;
143
+ const endpoint = this.seasonSubPath(rest, ENDPOINTS.TV_SEASONS.VIDEOS);
144
+ return this.client.request(endpoint, { language, include_video_language });
145
+ }
146
+ /**
147
+ * Watch Providers
148
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/season/{season_number}/watch/providers
149
+ *
150
+ * Get the watch providers for a specific TV season.
151
+ * Powered by our partnership with JustWatch, you can query which streaming services
152
+ * have the season available.
153
+ * @param series_id The ID of the TV series.
154
+ * @param season_number The season number within the TV show.
155
+ * @param language The language to use for the response.
156
+ * @returns A promise that resolves to the TV season watch providers.
157
+ * @reference https://developer.themoviedb.org/reference/tv-season-watch-providers
158
+ */
159
+ async watch_providers(params) {
160
+ const { language = this.defaultOptions.language, ...rest } = params;
161
+ const endpoint = this.seasonSubPath(rest, ENDPOINTS.TV_SEASONS.WATCH_PROVIDERS);
162
+ return this.client.request(endpoint, { language });
163
+ }
164
+ }