@lorenzopant/tmdb 1.1.5 → 1.2.0-beta.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 (284) hide show
  1. package/dist/client.js +3 -7
  2. package/dist/endpoints/base.d.ts +2 -1
  3. package/dist/endpoints/base.d.ts.map +1 -1
  4. package/dist/endpoints/base.js +1 -5
  5. package/dist/endpoints/configuration.d.ts +1 -1
  6. package/dist/endpoints/configuration.d.ts.map +1 -1
  7. package/dist/endpoints/configuration.js +9 -13
  8. package/dist/endpoints/genres.d.ts +4 -4
  9. package/dist/endpoints/genres.d.ts.map +1 -1
  10. package/dist/endpoints/genres.js +5 -9
  11. package/dist/endpoints/movie_lists.d.ts +3 -3
  12. package/dist/endpoints/movie_lists.d.ts.map +1 -1
  13. package/dist/endpoints/movie_lists.js +5 -9
  14. package/dist/endpoints/movies.d.ts +4 -4
  15. package/dist/endpoints/movies.d.ts.map +1 -1
  16. package/dist/endpoints/movies.js +17 -21
  17. package/dist/endpoints/search.d.ts +5 -5
  18. package/dist/endpoints/search.d.ts.map +1 -1
  19. package/dist/endpoints/search.js +8 -12
  20. package/dist/endpoints/tv_series.d.ts +111 -12
  21. package/dist/endpoints/tv_series.d.ts.map +1 -1
  22. package/dist/endpoints/tv_series.js +132 -17
  23. package/dist/endpoints/tv_series_lists.d.ts +3 -4
  24. package/dist/endpoints/tv_series_lists.d.ts.map +1 -1
  25. package/dist/endpoints/tv_series_lists.js +5 -9
  26. package/dist/errors/messages.js +2 -5
  27. package/dist/errors/tmdb.js +1 -5
  28. package/dist/images/images.d.ts +1 -1
  29. package/dist/images/images.d.ts.map +1 -1
  30. package/dist/images/images.js +3 -7
  31. package/dist/index.d.ts +0 -1
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +3 -22
  34. package/dist/routes.js +1 -4
  35. package/dist/scripts/check-exports.d.ts +2 -0
  36. package/dist/scripts/check-exports.d.ts.map +1 -0
  37. package/dist/scripts/check-exports.js +87 -0
  38. package/dist/scripts/find-missing.d.ts +2 -0
  39. package/dist/scripts/find-missing.d.ts.map +1 -0
  40. package/dist/scripts/find-missing.js +95 -0
  41. package/dist/scripts/generate-explicit-exports.d.ts +2 -0
  42. package/dist/scripts/generate-explicit-exports.d.ts.map +1 -0
  43. package/dist/scripts/generate-explicit-exports.js +47 -0
  44. package/dist/scripts/generate-index-files.d.ts +2 -0
  45. package/dist/scripts/generate-index-files.d.ts.map +1 -0
  46. package/dist/scripts/generate-index-files.js +27 -0
  47. package/dist/tmdb.d.ts +1 -1
  48. package/dist/tmdb.d.ts.map +1 -1
  49. package/dist/tmdb.js +21 -25
  50. package/dist/types/common/changes.d.ts +36 -0
  51. package/dist/types/common/changes.d.ts.map +1 -0
  52. package/dist/types/common/changes.js +1 -0
  53. package/dist/types/common/index.d.ts +5 -0
  54. package/dist/types/common/index.d.ts.map +1 -0
  55. package/dist/types/common/index.js +4 -0
  56. package/dist/types/common/media.d.ts +202 -0
  57. package/dist/types/common/media.d.ts.map +1 -0
  58. package/dist/types/common/media.js +2 -0
  59. package/dist/types/common/pagination.d.ts +7 -0
  60. package/dist/types/common/pagination.d.ts.map +1 -0
  61. package/dist/types/common/pagination.js +1 -0
  62. package/dist/types/{params/common.d.ts → common/params.d.ts} +12 -3
  63. package/dist/types/common/params.d.ts.map +1 -0
  64. package/dist/types/common/params.js +1 -0
  65. package/dist/types/config/configuration.d.ts +48 -0
  66. package/dist/types/config/configuration.d.ts.map +1 -0
  67. package/dist/types/config/configuration.js +1 -0
  68. package/dist/types/{countries.d.ts → config/countries.d.ts} +3 -0
  69. package/dist/types/{countries.d.ts.map → config/countries.d.ts.map} +1 -1
  70. package/dist/types/{countries.js → config/countries.js} +1 -4
  71. package/dist/types/config/images.d.ts +50 -0
  72. package/dist/types/config/images.d.ts.map +1 -0
  73. package/dist/types/config/images.js +13 -0
  74. package/dist/types/config/index.d.ts +7 -0
  75. package/dist/types/config/index.d.ts.map +1 -0
  76. package/dist/types/config/index.js +6 -0
  77. package/dist/types/{lang.d.ts → config/languages.d.ts} +2 -3
  78. package/dist/types/{lang.d.ts.map → config/languages.d.ts.map} +1 -1
  79. package/dist/types/config/languages.js +1 -0
  80. package/dist/types/config/options.d.ts +30 -0
  81. package/dist/types/config/options.d.ts.map +1 -0
  82. package/dist/types/config/options.js +1 -0
  83. package/dist/types/{timezones.d.ts.map → config/timezones.d.ts.map} +1 -1
  84. package/dist/types/{timezones.js → config/timezones.js} +1 -2
  85. package/dist/types/enums.js +2 -5
  86. package/dist/types/index.d.ts +5 -5
  87. package/dist/types/index.d.ts.map +1 -1
  88. package/dist/types/index.js +8 -24
  89. package/dist/types/movies/alternative_titles.d.ts +11 -0
  90. package/dist/types/movies/alternative_titles.d.ts.map +1 -0
  91. package/dist/types/movies/alternative_titles.js +1 -0
  92. package/dist/types/movies/changes.d.ts +3 -0
  93. package/dist/types/movies/changes.d.ts.map +1 -0
  94. package/dist/types/movies/changes.js +1 -0
  95. package/dist/types/movies/credits.d.ts +13 -0
  96. package/dist/types/movies/credits.d.ts.map +1 -0
  97. package/dist/types/movies/credits.js +1 -0
  98. package/dist/types/movies/external_ids.d.ts +16 -0
  99. package/dist/types/movies/external_ids.d.ts.map +1 -0
  100. package/dist/types/movies/external_ids.js +1 -0
  101. package/dist/types/movies/images.d.ts +15 -0
  102. package/dist/types/movies/images.d.ts.map +1 -0
  103. package/dist/types/movies/images.js +1 -0
  104. package/dist/types/movies/index.d.ts +16 -0
  105. package/dist/types/movies/index.d.ts.map +1 -0
  106. package/dist/types/movies/index.js +15 -0
  107. package/dist/types/movies/keywords.d.ts +11 -0
  108. package/dist/types/movies/keywords.d.ts.map +1 -0
  109. package/dist/types/movies/keywords.js +1 -0
  110. package/dist/types/movies/movie.d.ts +106 -0
  111. package/dist/types/movies/movie.d.ts.map +1 -0
  112. package/dist/types/movies/movie.js +1 -0
  113. package/dist/types/movies/params.d.ts +94 -0
  114. package/dist/types/movies/params.d.ts.map +1 -0
  115. package/dist/types/movies/params.js +1 -0
  116. package/dist/types/movies/reccomendations.d.ts +7 -0
  117. package/dist/types/movies/reccomendations.d.ts.map +1 -0
  118. package/dist/types/movies/reccomendations.js +1 -0
  119. package/dist/types/movies/release_dates.d.ts +37 -0
  120. package/dist/types/movies/release_dates.d.ts.map +1 -0
  121. package/dist/types/movies/release_dates.js +1 -0
  122. package/dist/types/movies/reviews.d.ts +38 -0
  123. package/dist/types/movies/reviews.d.ts.map +1 -0
  124. package/dist/types/movies/reviews.js +1 -0
  125. package/dist/types/movies/similar.d.ts +7 -0
  126. package/dist/types/movies/similar.d.ts.map +1 -0
  127. package/dist/types/movies/similar.js +1 -0
  128. package/dist/types/movies/translations.d.ts +36 -0
  129. package/dist/types/movies/translations.d.ts.map +1 -0
  130. package/dist/types/movies/translations.js +1 -0
  131. package/dist/types/movies/videos.d.ts +11 -0
  132. package/dist/types/movies/videos.d.ts.map +1 -0
  133. package/dist/types/movies/videos.js +1 -0
  134. package/dist/types/movies/watch_providers.d.ts +37 -0
  135. package/dist/types/movies/watch_providers.d.ts.map +1 -0
  136. package/dist/types/movies/watch_providers.js +1 -0
  137. package/dist/types/networks/alternative_names.d.ts +1 -0
  138. package/dist/types/networks/alternative_names.d.ts.map +1 -0
  139. package/dist/types/networks/alternative_names.js +1 -0
  140. package/dist/types/networks/images.d.ts +1 -0
  141. package/dist/types/networks/images.d.ts.map +1 -0
  142. package/dist/types/networks/images.js +1 -0
  143. package/dist/types/networks/index.d.ts +2 -0
  144. package/dist/types/networks/index.d.ts.map +1 -0
  145. package/dist/types/networks/index.js +1 -0
  146. package/dist/types/{networks.d.ts → networks/network.d.ts} +2 -2
  147. package/dist/types/networks/network.d.ts.map +1 -0
  148. package/dist/types/networks/network.js +1 -0
  149. package/dist/types/person/index.d.ts +2 -0
  150. package/dist/types/person/index.d.ts.map +1 -0
  151. package/dist/types/person/index.js +1 -0
  152. package/dist/types/{person.d.ts → person/person.d.ts} +2 -5
  153. package/dist/types/person/person.d.ts.map +1 -0
  154. package/dist/types/person/person.js +1 -0
  155. package/dist/types/search/collection.d.ts +22 -0
  156. package/dist/types/search/collection.d.ts.map +1 -0
  157. package/dist/types/search/collection.js +1 -0
  158. package/dist/types/search/company.d.ts +15 -0
  159. package/dist/types/search/company.d.ts.map +1 -0
  160. package/dist/types/search/company.js +1 -0
  161. package/dist/types/search/index.d.ts +7 -0
  162. package/dist/types/search/index.d.ts.map +1 -0
  163. package/dist/types/search/index.js +6 -0
  164. package/dist/types/search/keyword.d.ts +10 -0
  165. package/dist/types/search/keyword.d.ts.map +1 -0
  166. package/dist/types/search/keyword.js +1 -0
  167. package/dist/types/search/movies.d.ts +34 -0
  168. package/dist/types/search/movies.d.ts.map +1 -0
  169. package/dist/types/search/movies.js +1 -0
  170. package/dist/types/search/multi.d.ts +1 -0
  171. package/dist/types/search/multi.d.ts.map +1 -0
  172. package/dist/types/search/multi.js +1 -0
  173. package/dist/types/search/params.d.ts +37 -0
  174. package/dist/types/search/params.d.ts.map +1 -0
  175. package/dist/types/search/params.js +1 -0
  176. package/dist/types/search/tv.d.ts +39 -0
  177. package/dist/types/search/tv.d.ts.map +1 -0
  178. package/dist/types/search/tv.js +1 -0
  179. package/dist/types/tv/{tv_credits.d.ts → aggregate_credits.d.ts} +12 -1
  180. package/dist/types/tv/aggregate_credits.d.ts.map +1 -0
  181. package/dist/types/tv/aggregate_credits.js +1 -0
  182. package/dist/types/tv/alternative_titles.d.ts +11 -0
  183. package/dist/types/tv/alternative_titles.d.ts.map +1 -0
  184. package/dist/types/tv/alternative_titles.js +1 -0
  185. package/dist/types/tv/changes.d.ts +3 -0
  186. package/dist/types/tv/changes.d.ts.map +1 -0
  187. package/dist/types/tv/changes.js +1 -0
  188. package/dist/types/tv/content_ratings.d.ts +5 -0
  189. package/dist/types/tv/content_ratings.d.ts.map +1 -0
  190. package/dist/types/tv/content_ratings.js +1 -0
  191. package/dist/types/tv/credits.d.ts +15 -0
  192. package/dist/types/tv/credits.d.ts.map +1 -0
  193. package/dist/types/tv/credits.js +1 -0
  194. package/dist/types/tv/episode_groups.d.ts +30 -0
  195. package/dist/types/tv/episode_groups.d.ts.map +1 -0
  196. package/dist/types/tv/episode_groups.js +1 -0
  197. package/dist/types/tv/{tv_episodes.d.ts → episodes.d.ts} +1 -1
  198. package/dist/types/tv/episodes.d.ts.map +1 -0
  199. package/dist/types/tv/episodes.js +1 -0
  200. package/dist/types/tv/external_ids.d.ts +26 -0
  201. package/dist/types/tv/external_ids.d.ts.map +1 -0
  202. package/dist/types/tv/external_ids.js +1 -0
  203. package/dist/types/tv/images.d.ts +24 -0
  204. package/dist/types/tv/images.d.ts.map +1 -0
  205. package/dist/types/tv/images.js +1 -0
  206. package/dist/types/tv/index.d.ts +15 -0
  207. package/dist/types/tv/index.d.ts.map +1 -0
  208. package/dist/types/tv/index.js +14 -0
  209. package/dist/types/tv/keywords.d.ts +11 -0
  210. package/dist/types/tv/keywords.d.ts.map +1 -0
  211. package/dist/types/tv/keywords.js +1 -0
  212. package/dist/types/tv/params.d.ts +58 -0
  213. package/dist/types/tv/params.d.ts.map +1 -0
  214. package/dist/types/tv/params.js +1 -0
  215. package/dist/types/tv/reccomendations.d.ts +5 -0
  216. package/dist/types/tv/reccomendations.d.ts.map +1 -0
  217. package/dist/types/tv/reccomendations.js +1 -0
  218. package/dist/types/tv/{tv_seasons.d.ts → seasons.d.ts} +1 -1
  219. package/dist/types/tv/seasons.d.ts.map +1 -0
  220. package/dist/types/tv/seasons.js +1 -0
  221. package/dist/types/tv/similar.d.ts +5 -0
  222. package/dist/types/tv/similar.d.ts.map +1 -0
  223. package/dist/types/tv/similar.js +1 -0
  224. package/dist/types/tv/tv_series.d.ts +11 -42
  225. package/dist/types/tv/tv_series.d.ts.map +1 -1
  226. package/dist/types/tv/tv_series.js +1 -2
  227. package/dist/types/tv/videos.d.ts +9 -0
  228. package/dist/types/tv/videos.d.ts.map +1 -0
  229. package/dist/types/tv/videos.js +1 -0
  230. package/dist/types/utility.d.ts +7 -49
  231. package/dist/types/utility.d.ts.map +1 -1
  232. package/dist/types/utility.js +10 -2
  233. package/package.json +8 -2
  234. package/tsconfig.json +2 -2
  235. package/dist/types/collections.d.ts +0 -11
  236. package/dist/types/collections.d.ts.map +0 -1
  237. package/dist/types/collections.js +0 -2
  238. package/dist/types/common.d.ts +0 -110
  239. package/dist/types/common.d.ts.map +0 -1
  240. package/dist/types/common.js +0 -3
  241. package/dist/types/companies.d.ts +0 -8
  242. package/dist/types/companies.d.ts.map +0 -1
  243. package/dist/types/companies.js +0 -2
  244. package/dist/types/configuration.d.ts +0 -31
  245. package/dist/types/configuration.d.ts.map +0 -1
  246. package/dist/types/configuration.js +0 -2
  247. package/dist/types/genres.d.ts +0 -8
  248. package/dist/types/genres.d.ts.map +0 -1
  249. package/dist/types/genres.js +0 -2
  250. package/dist/types/images.d.ts +0 -14
  251. package/dist/types/images.d.ts.map +0 -1
  252. package/dist/types/images.js +0 -16
  253. package/dist/types/intl.d.ts +0 -2
  254. package/dist/types/intl.d.ts.map +0 -1
  255. package/dist/types/intl.js +0 -2
  256. package/dist/types/keywords.d.ts +0 -5
  257. package/dist/types/keywords.d.ts.map +0 -1
  258. package/dist/types/keywords.js +0 -2
  259. package/dist/types/lang.js +0 -940
  260. package/dist/types/movies.d.ts +0 -171
  261. package/dist/types/movies.d.ts.map +0 -1
  262. package/dist/types/movies.js +0 -3
  263. package/dist/types/networks.d.ts.map +0 -1
  264. package/dist/types/networks.js +0 -2
  265. package/dist/types/params/common.d.ts.map +0 -1
  266. package/dist/types/params/common.js +0 -2
  267. package/dist/types/params/tv.d.ts +0 -30
  268. package/dist/types/params/tv.d.ts.map +0 -1
  269. package/dist/types/params/tv.js +0 -2
  270. package/dist/types/params.d.ts +0 -84
  271. package/dist/types/params.d.ts.map +0 -1
  272. package/dist/types/params.js +0 -2
  273. package/dist/types/person.d.ts.map +0 -1
  274. package/dist/types/person.js +0 -2
  275. package/dist/types/tv/tv_credits.d.ts.map +0 -1
  276. package/dist/types/tv/tv_credits.js +0 -2
  277. package/dist/types/tv/tv_episodes.d.ts.map +0 -1
  278. package/dist/types/tv/tv_episodes.js +0 -2
  279. package/dist/types/tv/tv_others.d.ts +0 -81
  280. package/dist/types/tv/tv_others.d.ts.map +0 -1
  281. package/dist/types/tv/tv_others.js +0 -2
  282. package/dist/types/tv/tv_seasons.d.ts.map +0 -1
  283. package/dist/types/tv/tv_seasons.js +0 -2
  284. /package/dist/types/{timezones.d.ts → config/timezones.d.ts} +0 -0
@@ -1,19 +1,28 @@
1
- import { ApiClient } from "../client";
2
- import { TMDBOptions } from "../types";
3
- import { TVDetails, TVDetailsWithAppends, TVAppendToResponseNamespace } from "../types/tv/tv_series";
4
- import { TVAggregateCreditsParams, TVDetailsParams } from "../types/params/tv";
5
- import { TVAggregateCredits } from "../types/tv/tv_others";
1
+ import { TVAggregateCreditsParams, TVAlternativeTitles, TVBaseParam, TVChangeParams, TVCredits, TVCreditsParams, TVDetailsParams, TVExternalIDs, TVImages, TVImagesParams, TVSeriesChanges } from "../types/tv";
2
+ import { TVAggregateCredits } from "../types/tv/aggregate_credits";
3
+ import { TVContentRatings } from "../types/tv/content_ratings";
4
+ import { TVEpisodeGroups } from "../types/tv/episode_groups";
5
+ import { TVAppendToResponseNamespace, TVDetails, TVDetailsWithAppends } from "../types/tv/tv_series";
6
+ import { TMDBAPIBase } from "./base";
6
7
  export declare const TV_SERIES_ENDPOINTS: {
7
8
  TV: string;
8
9
  TV_AGGREGATE_CREDITS: string;
10
+ TV_ALTERNATIVE_TITLES: string;
11
+ TV_CHANGES: string;
12
+ TV_CONTENT_RATINGS: string;
13
+ TV_CREDITS: string;
14
+ TV_EPISODE_GROUPS: string;
15
+ TV_EXTERNAL_IDS: string;
16
+ TV_IMAGES: string;
17
+ TV_KEYWORDS: string;
18
+ TV_LATEST: string;
19
+ TV_LISTS: string;
20
+ TV_RECCOMENDATIONS: string;
9
21
  };
10
- export declare class TVSeriesAPI {
11
- private client;
12
- private defaultOptions;
13
- constructor(client: ApiClient, defaultOptions?: TMDBOptions);
22
+ export declare class TVSeriesAPI extends TMDBAPIBase {
14
23
  /**
15
24
  * Details
16
- * GET - https://api.themoviedb.org/3/tv/{tv_id}
25
+ * GET - https://api.themoviedb.org/3/tv/{series_id}
17
26
  *
18
27
  * Get the top level details of a TV series by ID.
19
28
  * @param series_id The ID of the TV series.
@@ -27,7 +36,7 @@ export declare class TVSeriesAPI {
27
36
  }): Promise<T extends [] ? TVDetails : TVDetailsWithAppends<T>>;
28
37
  /**
29
38
  * Aggregate Credits
30
- * GET - https://api.themoviedb.org/3/tv/{tv_id}/aggregate_credits
39
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/aggregate_credits
31
40
  *
32
41
  * Get the aggregate credits (cast and crew) that have been added to a TV show.
33
42
  *
@@ -35,9 +44,99 @@ export declare class TVSeriesAPI {
35
44
  * Instead, it is a view of all the entire cast & crew for all episodes belonging to a TV show.
36
45
  * @param series_id The ID of the TV series.
37
46
  * @param language The language to use for the response.
38
- * @returns A promise that resolves to the TV series details.
47
+ * @returns A promise that resolves to the TV series aggregate credits.
39
48
  * @reference https://developer.themoviedb.org/reference/tv-series-aggregate-credits
40
49
  */
41
50
  aggregate_credits(params: TVAggregateCreditsParams): Promise<TVAggregateCredits>;
51
+ /**
52
+ * Alternative Titles
53
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/alternative_tiles
54
+ *
55
+ * Get the alternative titles that have been added to a TV show.
56
+ * @param series_id The ID of the TV series.
57
+ * @returns A promise that resolves to the TV series alternative tiles.
58
+ * @reference https://developer.themoviedb.org/reference/tv-series-alternative-titles
59
+ */
60
+ alternative_titles(params: TVBaseParam): Promise<TVAlternativeTitles>;
61
+ /**
62
+ * Changes
63
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/changes
64
+ *
65
+ * Get the changes for a TV show. By default only the last 24 hours are returned.
66
+ * You can query up to 14 days in a single query by using the start_date and end_date query parameters.
67
+ *
68
+ * NOTE: TV show changes are a little different than movie changes in that there are some edits
69
+ * on seasons and episodes that will create a top level change entry at the show level.
70
+ * These can be found under the season and episode keys.
71
+ * These keys will contain a series_id and episode_id.
72
+ * You can use the season changes and episode changes methods to look these up individually.
73
+ *
74
+ * @param series_id The ID of the TV series.
75
+ * @returns A promise that resolves to the TV series changes history.
76
+ * @reference https://developer.themoviedb.org/reference/tv-series-changes
77
+ */
78
+ changes(params: TVChangeParams): Promise<TVSeriesChanges>;
79
+ /**
80
+ * Content Ratings
81
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/content_ratings
82
+ *
83
+ * Get the content ratings that have been added to a TV show.
84
+ * @param series_id The ID of the TV series.
85
+ * @returns A promise that resolves to the TV series content ratings.
86
+ * @reference https://developer.themoviedb.org/reference/tv-series-content-ratings
87
+ */
88
+ content_ratings(params: TVBaseParam): Promise<TVContentRatings>;
89
+ /**
90
+ * Credits
91
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/credits
92
+ *
93
+ * Get the latest season credits of a TV show.
94
+ *
95
+ * This is the original TV credits method which returns the latest season credit data.
96
+ * If you would like to request the aggregate view (which is what you see on our website)
97
+ * you should use the /aggregate_credits method.
98
+ * @param series_id The ID of the TV series.
99
+ * @param language The Language for the credits
100
+ * @returns A promise that resolves to the TV series credits.
101
+ * @reference https://developer.themoviedb.org/reference/tv-series-credits
102
+ */
103
+ credits(params: TVCreditsParams): Promise<TVCredits>;
104
+ /**
105
+ * Episode Groups
106
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/episode_groups
107
+ *
108
+ * Get the episode groups that have been added to a TV show.
109
+ * With a group ID you can call the get TV episode group details method.
110
+ * @param series_id The ID of the TV series.
111
+ * @returns A promise that resolves to the TV series episode groups.
112
+ * @reference https://developer.themoviedb.org/reference/tv-series-episode-groups
113
+ */
114
+ episode_groups(params: TVBaseParam): Promise<TVEpisodeGroups>;
115
+ /**
116
+ * External IDs
117
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/external_ids
118
+ *
119
+ * Get a list of external IDs that have been added to a TV show.
120
+ * @param series_id The ID of the TV series.
121
+ * @returns A promise that resolves to the TV series external ids.
122
+ * @reference https://developer.themoviedb.org/reference/tv-series-external-ids
123
+ */
124
+ external_ids(params: TVBaseParam): Promise<TVExternalIDs>;
125
+ /**
126
+ * Images
127
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/images
128
+ *
129
+ * Fetches images related to a specific tv show, such as posters and backdrops.
130
+ * The images are returned in various sizes and formats.
131
+ *
132
+ * NOTE: If you have a language specified, it will act as a filter on the returned items. You can use the include_image_language param to query additional languages.
133
+ *
134
+ * @param series_id - The unique identifier of the tv show.
135
+ * @param language - (Optional) The language code to filter the images by language.
136
+ * @param include_image_language - (Optional) A comma-separated list of language codes to include images for.
137
+ * @returns A promise that resolves to a `TVImages` object containing the tv show's images.
138
+ * @reference https://developer.themoviedb.org/reference/tv-series-images
139
+ */
140
+ images(params: TVImagesParams): Promise<TVImages>;
42
141
  }
43
142
  //# sourceMappingURL=tv_series.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tv_series.d.ts","sourceRoot":"","sources":["../../src/endpoints/tv_series.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACrG,OAAO,EAAE,wBAAwB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,eAAO,MAAM,mBAAmB;;;CAG/B,CAAC;AAEF,qBAAa,WAAW;IACvB,OAAO,CAAC,MAAM,CAAY;IAC1B,OAAO,CAAC,cAAc,CAAc;gBAExB,MAAM,EAAE,SAAS,EAAE,cAAc,GAAE,WAAgB;IAK/D;;;;;;;;;;OAUG;IACG,OAAO,CAAC,CAAC,SAAS,SAAS,2BAA2B,EAAE,GAAG,EAAE,EAClE,MAAM,EAAE,eAAe,GAAG;QAAE,kBAAkB,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;KAAE,GAC9D,OAAO,CAAC,CAAC,SAAS,EAAE,GAAG,SAAS,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAC;IAM9D;;;;;;;;;;;;OAYG;IACG,iBAAiB,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAKtF"}
1
+ {"version":3,"file":"tv_series.d.ts","sourceRoot":"","sources":["../../src/endpoints/tv_series.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,wBAAwB,EACxB,mBAAmB,EACnB,WAAW,EACX,cAAc,EACd,SAAS,EACT,eAAe,EACf,eAAe,EACf,aAAa,EACb,QAAQ,EACR,cAAc,EACd,eAAe,EACf,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,2BAA2B,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AACrG,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;CAc/B,CAAC;AAEF,qBAAa,WAAY,SAAQ,WAAW;IAC3C;;;;;;;;;;OAUG;IACG,OAAO,CAAC,CAAC,SAAS,SAAS,2BAA2B,EAAE,GAAG,EAAE,EAClE,MAAM,EAAE,eAAe,GAAG;QAAE,kBAAkB,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;KAAE,GAC9D,OAAO,CAAC,CAAC,SAAS,EAAE,GAAG,SAAS,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAC;IAM9D;;;;;;;;;;;;OAYG;IACG,iBAAiB,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAMtF;;;;;;;;OAQG;IACG,kBAAkB,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAK3E;;;;;;;;;;;;;;;;OAgBG;IACG,OAAO,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC;IAK/D;;;;;;;;OAQG;IACG,eAAe,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAKrE;;;;;;;;;;;;;OAaG;IACG,OAAO,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,SAAS,CAAC;IAM1D;;;;;;;;;OASG;IACG,cAAc,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,eAAe,CAAC;IAKnE;;;;;;;;OAQG;IACG,YAAY,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC;IAK/D;;;;;;;;;;;;;;OAcG;IACG,MAAM,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,QAAQ,CAAC;CAKvD"}
@@ -1,20 +1,23 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TVSeriesAPI = exports.TV_SERIES_ENDPOINTS = void 0;
4
- exports.TV_SERIES_ENDPOINTS = {
1
+ import { TMDBAPIBase } from "./base";
2
+ export const TV_SERIES_ENDPOINTS = {
5
3
  TV: "/tv",
6
4
  TV_AGGREGATE_CREDITS: "/aggregate_credits",
5
+ TV_ALTERNATIVE_TITLES: "/alternative_titles",
6
+ TV_CHANGES: "/changes",
7
+ TV_CONTENT_RATINGS: "/content_ratings",
8
+ TV_CREDITS: "/credits",
9
+ TV_EPISODE_GROUPS: "/episode_groups",
10
+ TV_EXTERNAL_IDS: "/external_ids",
11
+ TV_IMAGES: "/images",
12
+ TV_KEYWORDS: "/keywords",
13
+ TV_LATEST: "/latest",
14
+ TV_LISTS: "/lists",
15
+ TV_RECCOMENDATIONS: "/reccomendations",
7
16
  };
8
- class TVSeriesAPI {
9
- client;
10
- defaultOptions;
11
- constructor(client, defaultOptions = {}) {
12
- this.client = client;
13
- this.defaultOptions = defaultOptions;
14
- }
17
+ export class TVSeriesAPI extends TMDBAPIBase {
15
18
  /**
16
19
  * Details
17
- * GET - https://api.themoviedb.org/3/tv/{tv_id}
20
+ * GET - https://api.themoviedb.org/3/tv/{series_id}
18
21
  *
19
22
  * Get the top level details of a TV series by ID.
20
23
  * @param series_id The ID of the TV series.
@@ -25,12 +28,12 @@ class TVSeriesAPI {
25
28
  */
26
29
  async details(params) {
27
30
  const { language = this.defaultOptions.language, ...rest } = params;
28
- const endpoint = `${exports.TV_SERIES_ENDPOINTS.TV}/${params.series_id}`;
31
+ const endpoint = `${TV_SERIES_ENDPOINTS.TV}/${params.series_id}`;
29
32
  return this.client.request(endpoint, { language, ...rest });
30
33
  }
31
34
  /**
32
35
  * Aggregate Credits
33
- * GET - https://api.themoviedb.org/3/tv/{tv_id}/aggregate_credits
36
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/aggregate_credits
34
37
  *
35
38
  * Get the aggregate credits (cast and crew) that have been added to a TV show.
36
39
  *
@@ -38,13 +41,125 @@ class TVSeriesAPI {
38
41
  * Instead, it is a view of all the entire cast & crew for all episodes belonging to a TV show.
39
42
  * @param series_id The ID of the TV series.
40
43
  * @param language The language to use for the response.
41
- * @returns A promise that resolves to the TV series details.
44
+ * @returns A promise that resolves to the TV series aggregate credits.
42
45
  * @reference https://developer.themoviedb.org/reference/tv-series-aggregate-credits
43
46
  */
44
47
  async aggregate_credits(params) {
45
48
  const { language = this.defaultOptions.language, ...rest } = params;
46
- const endpoint = `${exports.TV_SERIES_ENDPOINTS.TV}/${params.series_id}${exports.TV_SERIES_ENDPOINTS.TV_AGGREGATE_CREDITS}`;
49
+ const endpoint = `${TV_SERIES_ENDPOINTS.TV}/${params.series_id}${TV_SERIES_ENDPOINTS.TV_AGGREGATE_CREDITS}`;
50
+ return this.client.request(endpoint, { language, ...rest });
51
+ }
52
+ /**
53
+ * Alternative Titles
54
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/alternative_tiles
55
+ *
56
+ * Get the alternative titles that have been added to a TV show.
57
+ * @param series_id The ID of the TV series.
58
+ * @returns A promise that resolves to the TV series alternative tiles.
59
+ * @reference https://developer.themoviedb.org/reference/tv-series-alternative-titles
60
+ */
61
+ async alternative_titles(params) {
62
+ const endpoint = `${TV_SERIES_ENDPOINTS.TV}/${params.series_id}${TV_SERIES_ENDPOINTS.TV_ALTERNATIVE_TITLES}`;
63
+ return this.client.request(endpoint);
64
+ }
65
+ /**
66
+ * Changes
67
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/changes
68
+ *
69
+ * Get the changes for a TV show. By default only the last 24 hours are returned.
70
+ * You can query up to 14 days in a single query by using the start_date and end_date query parameters.
71
+ *
72
+ * NOTE: TV show changes are a little different than movie changes in that there are some edits
73
+ * on seasons and episodes that will create a top level change entry at the show level.
74
+ * These can be found under the season and episode keys.
75
+ * These keys will contain a series_id and episode_id.
76
+ * You can use the season changes and episode changes methods to look these up individually.
77
+ *
78
+ * @param series_id The ID of the TV series.
79
+ * @returns A promise that resolves to the TV series changes history.
80
+ * @reference https://developer.themoviedb.org/reference/tv-series-changes
81
+ */
82
+ async changes(params) {
83
+ const endpoint = `${TV_SERIES_ENDPOINTS.TV}/${params.series_id}${TV_SERIES_ENDPOINTS.TV_CHANGES}`;
84
+ return this.client.request(endpoint, { ...params });
85
+ }
86
+ /**
87
+ * Content Ratings
88
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/content_ratings
89
+ *
90
+ * Get the content ratings that have been added to a TV show.
91
+ * @param series_id The ID of the TV series.
92
+ * @returns A promise that resolves to the TV series content ratings.
93
+ * @reference https://developer.themoviedb.org/reference/tv-series-content-ratings
94
+ */
95
+ async content_ratings(params) {
96
+ const endpoint = `${TV_SERIES_ENDPOINTS.TV}/${params.series_id}${TV_SERIES_ENDPOINTS.TV_CONTENT_RATINGS}`;
97
+ return this.client.request(endpoint);
98
+ }
99
+ /**
100
+ * Credits
101
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/credits
102
+ *
103
+ * Get the latest season credits of a TV show.
104
+ *
105
+ * This is the original TV credits method which returns the latest season credit data.
106
+ * If you would like to request the aggregate view (which is what you see on our website)
107
+ * you should use the /aggregate_credits method.
108
+ * @param series_id The ID of the TV series.
109
+ * @param language The Language for the credits
110
+ * @returns A promise that resolves to the TV series credits.
111
+ * @reference https://developer.themoviedb.org/reference/tv-series-credits
112
+ */
113
+ async credits(params) {
114
+ const endpoint = `${TV_SERIES_ENDPOINTS.TV}/${params.series_id}${TV_SERIES_ENDPOINTS.TV_CREDITS}`;
115
+ const { language = this.defaultOptions.language, ...rest } = params;
116
+ return this.client.request(endpoint, { language, ...rest });
117
+ }
118
+ /**
119
+ * Episode Groups
120
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/episode_groups
121
+ *
122
+ * Get the episode groups that have been added to a TV show.
123
+ * With a group ID you can call the get TV episode group details method.
124
+ * @param series_id The ID of the TV series.
125
+ * @returns A promise that resolves to the TV series episode groups.
126
+ * @reference https://developer.themoviedb.org/reference/tv-series-episode-groups
127
+ */
128
+ async episode_groups(params) {
129
+ const endpoint = `${TV_SERIES_ENDPOINTS.TV}/${params.series_id}${TV_SERIES_ENDPOINTS.TV_EPISODE_GROUPS}`;
130
+ return this.client.request(endpoint);
131
+ }
132
+ /**
133
+ * External IDs
134
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/external_ids
135
+ *
136
+ * Get a list of external IDs that have been added to a TV show.
137
+ * @param series_id The ID of the TV series.
138
+ * @returns A promise that resolves to the TV series external ids.
139
+ * @reference https://developer.themoviedb.org/reference/tv-series-external-ids
140
+ */
141
+ async external_ids(params) {
142
+ const endpoint = `${TV_SERIES_ENDPOINTS.TV}/${params.series_id}${TV_SERIES_ENDPOINTS.TV_EXTERNAL_IDS}`;
143
+ return this.client.request(endpoint);
144
+ }
145
+ /**
146
+ * Images
147
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/images
148
+ *
149
+ * Fetches images related to a specific tv show, such as posters and backdrops.
150
+ * The images are returned in various sizes and formats.
151
+ *
152
+ * NOTE: If you have a language specified, it will act as a filter on the returned items. You can use the include_image_language param to query additional languages.
153
+ *
154
+ * @param series_id - The unique identifier of the tv show.
155
+ * @param language - (Optional) The language code to filter the images by language.
156
+ * @param include_image_language - (Optional) A comma-separated list of language codes to include images for.
157
+ * @returns A promise that resolves to a `TVImages` object containing the tv show's images.
158
+ * @reference https://developer.themoviedb.org/reference/tv-series-images
159
+ */
160
+ async images(params) {
161
+ const { language = this.defaultOptions.language, ...rest } = params;
162
+ const endpoint = `${TV_SERIES_ENDPOINTS.TV}/${params.series_id}${TV_SERIES_ENDPOINTS.TV_IMAGES}`;
47
163
  return this.client.request(endpoint, { language, ...rest });
48
164
  }
49
165
  }
50
- exports.TVSeriesAPI = TVSeriesAPI;
@@ -1,8 +1,7 @@
1
1
  import { ApiClient } from "../client";
2
- import { TMDBOptions } from "../types";
3
- import { PaginatedResponse } from "../types/params";
4
- import { TVSeriesListParams } from "../types/params/tv";
5
- import { TVSeriesResultItem } from "../types/tv/tv_series";
2
+ import { PaginatedResponse, TVSeriesResultItem } from "../types";
3
+ import { TMDBOptions } from "../types/config";
4
+ import { TVSeriesListParams } from "../types/tv";
6
5
  export declare enum TVSeriesListEndpoints {
7
6
  AIRING_TODAY = "/airing_today",
8
7
  ON_THE_AIR = "/on_the_air",
@@ -1 +1 @@
1
- {"version":3,"file":"tv_series_lists.d.ts","sourceRoot":"","sources":["../../src/endpoints/tv_series_lists.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAI3D,oBAAY,qBAAqB;IAChC,YAAY,kBAAkB;IAC9B,UAAU,gBAAgB;IAC1B,SAAS,eAAe;IACxB,OAAO,aAAa;CACpB;AAED,qBAAa,gBAAgB;IAC5B,OAAO,CAAC,MAAM,CAAY;IAC1B,OAAO,CAAC,cAAc,CAAc;gBAExB,MAAM,EAAE,SAAS,EAAE,cAAc,GAAE,WAAgB;IAK/D,OAAO,CAAC,YAAY;IAKpB;;;;;OAKG;IACH,OAAO,CAAC,oBAAoB;IAI5B;;;;;;;;OAQG;IACG,YAAY,CAAC,MAAM,GAAE,kBAAuB,GAAG,OAAO,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,CAAC;IAInG;;;;;;;;OAQG;IACG,UAAU,CAAC,MAAM,GAAE,kBAAuB,GAAG,OAAO,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,CAAC;IAIjG;;;;;;;OAOG;IACG,OAAO,CAAC,MAAM,GAAE,kBAAuB,GAAG,OAAO,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,CAAC;IAI9F;;;;;;;OAOG;IACG,SAAS,CAAC,MAAM,GAAE,kBAAuB,GAAG,OAAO,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,CAAC;CAGhG"}
1
+ {"version":3,"file":"tv_series_lists.d.ts","sourceRoot":"","sources":["../../src/endpoints/tv_series_lists.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAIjD,oBAAY,qBAAqB;IAChC,YAAY,kBAAkB;IAC9B,UAAU,gBAAgB;IAC1B,SAAS,eAAe;IACxB,OAAO,aAAa;CACpB;AAED,qBAAa,gBAAgB;IAC5B,OAAO,CAAC,MAAM,CAAY;IAC1B,OAAO,CAAC,cAAc,CAAc;gBAExB,MAAM,EAAE,SAAS,EAAE,cAAc,GAAE,WAAgB;IAK/D,OAAO,CAAC,YAAY;IAKpB;;;;;OAKG;IACH,OAAO,CAAC,oBAAoB;IAI5B;;;;;;;;OAQG;IACG,YAAY,CAAC,MAAM,GAAE,kBAAuB,GAAG,OAAO,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,CAAC;IAInG;;;;;;;;OAQG;IACG,UAAU,CAAC,MAAM,GAAE,kBAAuB,GAAG,OAAO,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,CAAC;IAIjG;;;;;;;OAOG;IACG,OAAO,CAAC,MAAM,GAAE,kBAAuB,GAAG,OAAO,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,CAAC;IAI9F;;;;;;;OAOG;IACG,SAAS,CAAC,MAAM,GAAE,kBAAuB,GAAG,OAAO,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,CAAC;CAGhG"}
@@ -1,15 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TVSeriesListsAPI = exports.TVSeriesListEndpoints = void 0;
4
- const tv_series_1 = require("./tv_series");
5
- var TVSeriesListEndpoints;
1
+ import { TV_SERIES_ENDPOINTS } from "./tv_series";
2
+ export var TVSeriesListEndpoints;
6
3
  (function (TVSeriesListEndpoints) {
7
4
  TVSeriesListEndpoints["AIRING_TODAY"] = "/airing_today";
8
5
  TVSeriesListEndpoints["ON_THE_AIR"] = "/on_the_air";
9
6
  TVSeriesListEndpoints["TOP_RATED"] = "/top_rated";
10
7
  TVSeriesListEndpoints["POPULAR"] = "/popular";
11
- })(TVSeriesListEndpoints || (exports.TVSeriesListEndpoints = TVSeriesListEndpoints = {}));
12
- class TVSeriesListsAPI {
8
+ })(TVSeriesListEndpoints || (TVSeriesListEndpoints = {}));
9
+ export class TVSeriesListsAPI {
13
10
  client;
14
11
  defaultOptions;
15
12
  constructor(client, defaultOptions = {}) {
@@ -27,7 +24,7 @@ class TVSeriesListsAPI {
27
24
  * @returns PaginatedResponse of TVSeriesResultItem
28
25
  */
29
26
  fetch_tv_series_list(endpoint, params = {}) {
30
- return this.client.request(tv_series_1.TV_SERIES_ENDPOINTS.TV + endpoint, this.withDefaults(params));
27
+ return this.client.request(TV_SERIES_ENDPOINTS.TV + endpoint, this.withDefaults(params));
31
28
  }
32
29
  /**
33
30
  * Airing Today
@@ -76,4 +73,3 @@ class TVSeriesListsAPI {
76
73
  return this.fetch_tv_series_list(TVSeriesListEndpoints.TOP_RATED, params);
77
74
  }
78
75
  }
79
- exports.TVSeriesListsAPI = TVSeriesListsAPI;
@@ -1,18 +1,15 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TMDB_ERRORS = exports.Errors = void 0;
4
1
  /**
5
2
  * A collection of error messages used throughout the application.
6
3
  * For library-specific errors (-1 status code) only.
7
4
  */
8
- exports.Errors = {
5
+ export const Errors = {
9
6
  NO_ACCESS_TOKEN: "TMDB requires a valid access token, please provide one.",
10
7
  };
11
8
  /**
12
9
  * TMDB Error Codes and messages.
13
10
  * @reference https://developer.themoviedb.org/docs/errors
14
11
  */
15
- exports.TMDB_ERRORS = new Map([
12
+ export const TMDB_ERRORS = new Map([
16
13
  [1, { message: "Success", http_status: 200 }],
17
14
  [2, { message: "Invalid service: this service does not exist.", http_status: 501 }],
18
15
  [3, { message: "Authentication failed: You do not have permissions to access the service.", http_status: 401 }],
@@ -1,12 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TMDBError = void 0;
4
1
  /**
5
2
  * Represents a generic error or an error specific to the TMDB (The Movie Database) API.
6
3
  * This error class extends the built-in `Error` class and includes additional
7
4
  * properties to provide more context about the error.
8
5
  */
9
- class TMDBError extends Error {
6
+ export class TMDBError extends Error {
10
7
  /**
11
8
  * The status code returned by the TMDB API.
12
9
  * If the value is `-1`, it indicates a library-specific error rather than a TMDB API error.
@@ -40,4 +37,3 @@ class TMDBError extends Error {
40
37
  this.http_status_code = http_status;
41
38
  }
42
39
  }
43
- exports.TMDBError = TMDBError;
@@ -1,5 +1,5 @@
1
1
  import { ImagesConfig } from "../types";
2
- import { BackdropSize, LogoSize, PosterSize, ProfileSize, StillSize } from "../types/images";
2
+ import { BackdropSize, LogoSize, PosterSize, ProfileSize, StillSize } from "../types/config/images";
3
3
  export declare class ImageAPI {
4
4
  private options;
5
5
  constructor(options?: ImagesConfig);
@@ -1 +1 @@
1
- {"version":3,"file":"images.d.ts","sourceRoot":"","sources":["../../src/images/images.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,YAAY,EAAyC,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEpI,qBAAa,QAAQ;IACpB,OAAO,CAAC,OAAO,CAAe;gBAElB,OAAO,GAAE,YAAiB;IAItC,OAAO,CAAC,QAAQ;IAKT,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,YAAoE,GAAG,MAAM;IAI1G,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,QAA4D,GAAG,MAAM;IAI9F,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,UAAgE,GAAG,MAAM;IAIpG,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,WAAkE,GAAG,MAAM;IAIvG,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,SAA6D,GAAG,MAAM;CAGvG"}
1
+ {"version":3,"file":"images.d.ts","sourceRoot":"","sources":["../../src/images/images.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,YAAY,EAAyC,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAE3I,qBAAa,QAAQ;IACpB,OAAO,CAAC,OAAO,CAAe;gBAElB,OAAO,GAAE,YAAiB;IAItC,OAAO,CAAC,QAAQ;IAKT,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,YAAoE,GAAG,MAAM;IAI1G,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,QAA4D,GAAG,MAAM;IAI9F,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,UAAgE,GAAG,MAAM;IAIpG,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,WAAkE,GAAG,MAAM;IAIvG,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,SAA6D,GAAG,MAAM;CAGvG"}
@@ -1,14 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ImageAPI = void 0;
4
- const images_1 = require("../types/images");
5
- class ImageAPI {
1
+ import { IMAGE_BASE_URL, IMAGE_SECURE_BASE_URL } from "../types/config/images";
2
+ export class ImageAPI {
6
3
  options;
7
4
  constructor(options = {}) {
8
5
  this.options = { secure_images_url: true, ...options };
9
6
  }
10
7
  buildUrl(path, size) {
11
- const baseUrl = this.options.secure_images_url ? images_1.IMAGE_SECURE_BASE_URL : images_1.IMAGE_BASE_URL;
8
+ const baseUrl = this.options.secure_images_url ? IMAGE_SECURE_BASE_URL : IMAGE_BASE_URL;
12
9
  return `${baseUrl}${size}${path}`;
13
10
  }
14
11
  backdrop(path, size = this.options.default_image_sizes?.backdrops || "w780") {
@@ -27,4 +24,3 @@ class ImageAPI {
27
24
  return this.buildUrl(path, size);
28
25
  }
29
26
  }
30
- exports.ImageAPI = ImageAPI;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  export { TMDB } from "./tmdb";
2
2
  export { TMDBError } from "./errors/tmdb";
3
- export { TMDBOptions } from "./types";
4
3
  export * from "./types";
5
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,cAAc,SAAS,CAAC"}
package/dist/index.js CHANGED
@@ -1,23 +1,4 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.TMDBError = exports.TMDB = void 0;
18
1
  // src/index.ts
19
- var tmdb_1 = require("./tmdb");
20
- Object.defineProperty(exports, "TMDB", { enumerable: true, get: function () { return tmdb_1.TMDB; } });
21
- var tmdb_2 = require("./errors/tmdb");
22
- Object.defineProperty(exports, "TMDBError", { enumerable: true, get: function () { return tmdb_2.TMDBError; } });
23
- __exportStar(require("./types"), exports);
2
+ export { TMDB } from "./tmdb";
3
+ export { TMDBError } from "./errors/tmdb";
4
+ export * from "./types";
package/dist/routes.js CHANGED
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ENDPOINTS = void 0;
4
- exports.ENDPOINTS = {
1
+ export const ENDPOINTS = {
5
2
  CONFIGURATION: {
6
3
  DETAILS: "/configuration",
7
4
  COUNTRIES: "/configuration/countries",
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=check-exports.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-exports.d.ts","sourceRoot":"","sources":["../../src/scripts/check-exports.ts"],"names":[],"mappings":""}
@@ -0,0 +1,87 @@
1
+ // scripts/check-exports.ts
2
+ import * as fs from "fs";
3
+ import * as path from "path";
4
+ import { Project } from "ts-morph";
5
+ function findAllExportedTypes(dir) {
6
+ const types = new Set();
7
+ const files = fs.readdirSync(dir);
8
+ files.forEach((file) => {
9
+ const filePath = path.join(dir, file);
10
+ const stat = fs.statSync(filePath);
11
+ if (stat.isDirectory()) {
12
+ const subTypes = findAllExportedTypes(filePath);
13
+ subTypes.forEach((t) => types.add(t));
14
+ }
15
+ else if (file.endsWith(".ts") && file !== "index.ts") {
16
+ // Estrai i nomi dei tipi esportati
17
+ const content = fs.readFileSync(filePath, "utf-8");
18
+ const exportMatches = content.matchAll(/export (?:type|interface) (\w+)/g);
19
+ for (const match of exportMatches) {
20
+ types.add(match[1]);
21
+ }
22
+ }
23
+ });
24
+ return types;
25
+ }
26
+ function checkIndexExports(dir) {
27
+ const indexPath = path.join(dir, "index.ts");
28
+ if (!fs.existsSync(indexPath)) {
29
+ return [`Missing index.ts in ${dir}`];
30
+ }
31
+ const content = fs.readFileSync(indexPath, "utf-8");
32
+ const subdirs = fs.readdirSync(dir).filter((f) => fs.statSync(path.join(dir, f)).isDirectory());
33
+ const files = fs
34
+ .readdirSync(dir)
35
+ .filter((f) => f.endsWith(".ts") && f !== "index.ts")
36
+ .map((f) => f.replace(".ts", ""));
37
+ const missing = [];
38
+ // Controlla se tutti i file sono esportati
39
+ files.forEach((file) => {
40
+ if (!content.includes(`from './${file}'`) && !content.includes(`from "./${file}"`)) {
41
+ missing.push(`${dir}/index.ts missing: export * from './${file}'`);
42
+ }
43
+ });
44
+ // Controlla se tutte le subdirectory sono esportate
45
+ subdirs.forEach((subdir) => {
46
+ if (!content.includes(`from './${subdir}'`)) {
47
+ missing.push(`${dir}/index.ts missing: export * from './${subdir}'`);
48
+ }
49
+ });
50
+ // Ricorsivamente controlla subdirectories
51
+ subdirs.forEach((subdir) => {
52
+ const subMissing = checkIndexExports(path.join(dir, subdir));
53
+ missing.push(...subMissing);
54
+ });
55
+ return missing;
56
+ }
57
+ // Run checks
58
+ const allDefinedTypes = findAllExportedTypes("src/types");
59
+ const missingExports = checkIndexExports("src/types");
60
+ console.log("=== All defined types ===");
61
+ console.log(Array.from(allDefinedTypes).sort());
62
+ console.log("\n=== Missing exports ===");
63
+ if (missingExports.length === 0) {
64
+ console.log("✅ All exports are correct!");
65
+ }
66
+ else {
67
+ missingExports.forEach((m) => console.log("❌", m));
68
+ }
69
+ // Controlla cosa viene effettivamente esportato dal package
70
+ const project = new Project({ tsConfigFilePath: "tsconfig.json" });
71
+ const sourceFile = project.getSourceFileOrThrow("src/index.ts");
72
+ const exported = sourceFile.getExportedDeclarations();
73
+ console.log("\n=== Actually exported from package ===");
74
+ const exportedTypeNames = new Set();
75
+ exported.forEach((_decl, name) => {
76
+ exportedTypeNames.add(name);
77
+ });
78
+ console.log(Array.from(exportedTypeNames).sort());
79
+ // Trova differenze
80
+ console.log("\n=== Types defined but NOT exported ===");
81
+ const notExported = Array.from(allDefinedTypes).filter((t) => !exportedTypeNames.has(t));
82
+ if (notExported.length === 0) {
83
+ console.log("✅ All types are exported!");
84
+ }
85
+ else {
86
+ notExported.forEach((t) => console.log("❌", t));
87
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=find-missing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-missing.d.ts","sourceRoot":"","sources":["../../src/scripts/find-missing.ts"],"names":[],"mappings":""}