@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
@@ -0,0 +1,95 @@
1
+ // scripts/find-missing.ts
2
+ import * as fs from "fs";
3
+ import * as path from "path";
4
+ function findAllDefinedTypes(dir, types = new Set()) {
5
+ const files = fs.readdirSync(dir);
6
+ files.forEach((file) => {
7
+ const filePath = path.join(dir, file);
8
+ const stat = fs.statSync(filePath);
9
+ if (stat.isDirectory()) {
10
+ findAllDefinedTypes(filePath, types);
11
+ }
12
+ else if (file.endsWith(".ts") && file !== "index.ts") {
13
+ const content = fs.readFileSync(filePath, "utf-8");
14
+ const matches = content.matchAll(/export (?:type|interface) (\w+)/g);
15
+ for (const match of matches) {
16
+ types.add(match[1]);
17
+ }
18
+ }
19
+ });
20
+ return types;
21
+ }
22
+ function findExportedTypes(distPath) {
23
+ if (!fs.existsSync(distPath)) {
24
+ console.log("❌ dist/index.d.ts not found. Run npm run build first!");
25
+ return new Set();
26
+ }
27
+ const content = fs.readFileSync(distPath, "utf-8");
28
+ const types = new Set();
29
+ // Pattern diversi per trovare export
30
+ const patterns = [
31
+ /export \{ ([^}]+) \}/g, // export { Type1, Type2 }
32
+ /export type (\w+)/g, // export type MyType
33
+ /export interface (\w+)/g, // export interface MyInterface
34
+ /export declare type (\w+)/g, // export declare type MyType
35
+ /export declare interface (\w+)/g, // export declare interface MyInterface
36
+ ];
37
+ patterns.forEach((pattern) => {
38
+ let match;
39
+ while ((match = pattern.exec(content)) !== null) {
40
+ if (match[1] && match[1].includes(",")) {
41
+ // Multiple exports in {}
42
+ match[1].split(",").forEach((t) => {
43
+ const trimmed = t.trim().split(" as ")[0].trim();
44
+ types.add(trimmed);
45
+ });
46
+ }
47
+ else if (match[1]) {
48
+ types.add(match[1]);
49
+ }
50
+ }
51
+ });
52
+ return types;
53
+ }
54
+ // Run analysis
55
+ console.log("🔍 Analyzing types...\n");
56
+ const definedTypes = findAllDefinedTypes("src/types");
57
+ console.log(`📊 Total defined types: ${definedTypes.size}\n`);
58
+ const exportedTypes = findExportedTypes("dist/index.d.ts");
59
+ console.log(`📦 Total exported types: ${exportedTypes.size}\n`);
60
+ // Find missing
61
+ const missing = Array.from(definedTypes)
62
+ .filter((t) => !exportedTypes.has(t))
63
+ .sort();
64
+ if (missing.length === 0) {
65
+ console.log("✅ All types are exported!\n");
66
+ }
67
+ else {
68
+ console.log("❌ Types defined but NOT exported:\n");
69
+ missing.slice(0, 30).forEach((t) => console.log(` - ${t}`));
70
+ if (missing.length > 30) {
71
+ console.log(` ... and ${missing.length - 30} more\n`);
72
+ }
73
+ console.log(`\nTotal missing: ${missing.length}\n`);
74
+ // Find where they are defined
75
+ console.log("📍 Location of first 5 missing types:\n");
76
+ missing.slice(0, 5).forEach((typeName) => {
77
+ const location = findTypeLocation("src/types", typeName);
78
+ if (location) {
79
+ console.log(` ${typeName} → ${location}`);
80
+ }
81
+ });
82
+ }
83
+ function findTypeLocation(dir, typeName) {
84
+ const files = fs.readdirSync(dir, { recursive: true });
85
+ for (const file of files) {
86
+ if (!file.endsWith(".ts") || file.endsWith("index.ts"))
87
+ continue;
88
+ const filePath = path.join(dir, file);
89
+ const content = fs.readFileSync(filePath, "utf-8");
90
+ if (content.includes(`export type ${typeName}`) || content.includes(`export interface ${typeName}`)) {
91
+ return filePath;
92
+ }
93
+ }
94
+ return null;
95
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=generate-explicit-exports.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-explicit-exports.d.ts","sourceRoot":"","sources":["../../src/scripts/generate-explicit-exports.ts"],"names":[],"mappings":""}
@@ -0,0 +1,47 @@
1
+ // scripts/generate-explicit-exports.ts
2
+ import * as fs from "fs";
3
+ import * as path from "path";
4
+ function extractExports(filePath) {
5
+ const content = fs.readFileSync(filePath, "utf-8");
6
+ const exports = [];
7
+ const typeMatches = content.matchAll(/export (?:type|interface) (\w+)/g);
8
+ for (const match of typeMatches) {
9
+ exports.push(match[1]);
10
+ }
11
+ return exports;
12
+ }
13
+ function generateExplicitIndex(dir) {
14
+ const indexPath = path.join(dir, "index.ts");
15
+ const files = fs.readdirSync(dir);
16
+ const lines = [];
17
+ files.forEach((file) => {
18
+ const filePath = path.join(dir, file);
19
+ const stat = fs.statSync(filePath);
20
+ if (file === "index.ts")
21
+ return;
22
+ if (stat.isDirectory()) {
23
+ // Per subdirectory, usa export *
24
+ lines.push(`export * from './${file}';`);
25
+ }
26
+ else if (file.endsWith(".ts")) {
27
+ // Per file, usa export named espliciti
28
+ const fileName = file.replace(".ts", "");
29
+ const exports = extractExports(filePath);
30
+ if (exports.length > 0) {
31
+ lines.push(`export { ${exports.join(", ")} } from './${fileName}';`);
32
+ }
33
+ }
34
+ });
35
+ fs.writeFileSync(indexPath, lines.join("\n") + "\n");
36
+ console.log(`✅ Generated ${indexPath}`);
37
+ // Ricorsivo per subdirectories
38
+ files.forEach((file) => {
39
+ const filePath = path.join(dir, file);
40
+ const stat = fs.statSync(filePath);
41
+ if (stat.isDirectory()) {
42
+ generateExplicitIndex(filePath);
43
+ }
44
+ });
45
+ }
46
+ generateExplicitIndex("src/types");
47
+ console.log("✅ All explicit exports generated!");
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=generate-index-files.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-index-files.d.ts","sourceRoot":"","sources":["../../src/scripts/generate-index-files.ts"],"names":[],"mappings":""}
@@ -0,0 +1,27 @@
1
+ // scripts/generate-index-files.ts
2
+ /// <reference types="node" />
3
+ import * as fs from "fs";
4
+ import * as path from "path";
5
+ function generateIndexForDir(dir) {
6
+ const files = fs.readdirSync(dir);
7
+ const exports = [];
8
+ files.forEach((file) => {
9
+ const filePath = path.join(dir, file);
10
+ const stat = fs.statSync(filePath);
11
+ if (stat.isDirectory()) {
12
+ exports.push(`export * from './${file}';`);
13
+ generateIndexForDir(filePath); // Ricorsivo
14
+ }
15
+ else if (file.endsWith(".ts") && file !== "index.ts") {
16
+ const fileName = file.replace(".ts", "");
17
+ exports.push(`export * from './${fileName}';`);
18
+ }
19
+ });
20
+ if (exports.length > 0) {
21
+ const indexPath = path.join(dir, "index.ts");
22
+ fs.writeFileSync(indexPath, exports.join("\n") + "\n");
23
+ console.log(`✅ Generated ${indexPath}`);
24
+ }
25
+ }
26
+ generateIndexForDir("src/types");
27
+ console.log("✅ All index.ts files generated!");
package/dist/tmdb.d.ts CHANGED
@@ -6,7 +6,7 @@ import { SearchAPI } from "./endpoints/search";
6
6
  import { TVSeriesAPI } from "./endpoints/tv_series";
7
7
  import { TVSeriesListsAPI } from "./endpoints/tv_series_lists";
8
8
  import { ImageAPI } from "./images/images";
9
- import { TMDBOptions } from "./types";
9
+ import { TMDBOptions } from "./types/config";
10
10
  export declare class TMDB {
11
11
  private client;
12
12
  private options;
@@ -1 +1 @@
1
- {"version":3,"file":"tmdb.d.ts","sourceRoot":"","sources":["../src/tmdb.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;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AM,EAAE,QAAQ,CAAC;IACjB,MAAM,EAAE,gBAAgB,CAAC;IACzB,MAAM,EAAE,SAAS,CAAC;IAClB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,SAAS,EAAE,WAAW,CAAC;IAG9B;;;;OAIG;gBACS,WAAW,EAAE,MAAM,EAAE,OAAO,GAAE,WAAgB;CAa1D"}
package/dist/tmdb.js CHANGED
@@ -1,18 +1,15 @@
1
- "use strict";
2
1
  // src.tmdb.ts
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.TMDB = void 0;
5
- const client_1 = require("./client");
6
- const configuration_1 = require("./endpoints/configuration");
7
- const genres_1 = require("./endpoints/genres");
8
- const movie_lists_1 = require("./endpoints/movie_lists");
9
- const movies_1 = require("./endpoints/movies");
10
- const search_1 = require("./endpoints/search");
11
- const tv_series_1 = require("./endpoints/tv_series");
12
- const tv_series_lists_1 = require("./endpoints/tv_series_lists");
13
- const messages_1 = require("./errors/messages");
14
- const images_1 = require("./images/images");
15
- class TMDB {
2
+ import { ApiClient } from "./client";
3
+ import { ConfigurationAPI } from "./endpoints/configuration";
4
+ import { GenresAPI } from "./endpoints/genres";
5
+ import { MovieListsAPI } from "./endpoints/movie_lists";
6
+ import { MoviesAPI } from "./endpoints/movies";
7
+ import { SearchAPI } from "./endpoints/search";
8
+ import { TVSeriesAPI } from "./endpoints/tv_series";
9
+ import { TVSeriesListsAPI } from "./endpoints/tv_series_lists";
10
+ import { Errors } from "./errors/messages";
11
+ import { ImageAPI } from "./images/images";
12
+ export class TMDB {
16
13
  client;
17
14
  options; // ** Default options for all requests
18
15
  movies;
@@ -31,17 +28,16 @@ class TMDB {
31
28
  */
32
29
  constructor(accessToken, options = {}) {
33
30
  if (!accessToken)
34
- throw new Error(messages_1.Errors.NO_ACCESS_TOKEN);
31
+ throw new Error(Errors.NO_ACCESS_TOKEN);
35
32
  this.options = options;
36
- this.client = new client_1.ApiClient(accessToken);
37
- this.movies = new movies_1.MoviesAPI(this.client, this.options);
38
- this.movie_lists = new movie_lists_1.MovieListsAPI(this.client, this.options);
39
- this.search = new search_1.SearchAPI(this.client, this.options);
40
- this.images = new images_1.ImageAPI(this.options.images);
41
- this.config = new configuration_1.ConfigurationAPI(this.client, this.options);
42
- this.genres = new genres_1.GenresAPI(this.client, this.options);
43
- this.tv_lists = new tv_series_lists_1.TVSeriesListsAPI(this.client, this.options);
44
- this.tv_series = new tv_series_1.TVSeriesAPI(this.client, this.options);
33
+ this.client = new ApiClient(accessToken);
34
+ this.movies = new MoviesAPI(this.client, this.options);
35
+ this.movie_lists = new MovieListsAPI(this.client, this.options);
36
+ this.search = new SearchAPI(this.client, this.options);
37
+ this.images = new ImageAPI(this.options.images);
38
+ this.config = new ConfigurationAPI(this.client, this.options);
39
+ this.genres = new GenresAPI(this.client, this.options);
40
+ this.tv_lists = new TVSeriesListsAPI(this.client, this.options);
41
+ this.tv_series = new TVSeriesAPI(this.client, this.options);
45
42
  }
46
43
  }
47
- exports.TMDB = TMDB;
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Container for entity change history
3
+ */
4
+ export type Changes = {
5
+ /** Array of changes grouped by type */
6
+ changes: Change[];
7
+ };
8
+ /**
9
+ * Group of changes for a specific field or property
10
+ */
11
+ export type Change = {
12
+ /** Name of the field that changed (e.g., "title", "overview", "images") */
13
+ key: string;
14
+ /** Individual change entries for this field */
15
+ items: ChangeItem[];
16
+ };
17
+ /**
18
+ * Individual change record with action details
19
+ */
20
+ export type ChangeItem = {
21
+ /** Unique identifier for the changed item */
22
+ id: number;
23
+ /** Type of change performed (e.g., "added", "updated", "deleted") */
24
+ action: string;
25
+ /** Timestamp of when the change occurred (ISO 8601 format) */
26
+ time: string;
27
+ /** ISO 639-1 language code associated with the change */
28
+ iso_639_1: string;
29
+ /** ISO 3166-1 country code associated with the change */
30
+ iso_3166_1: string;
31
+ /** The changed data object (structure varies by change type) */
32
+ value: object;
33
+ /** The original data object (structure varies by change type) */
34
+ original_value?: object;
35
+ };
36
+ //# sourceMappingURL=changes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"changes.d.ts","sourceRoot":"","sources":["../../../src/types/common/changes.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG;IACrB,uCAAuC;IACvC,OAAO,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG;IACpB,2EAA2E;IAC3E,GAAG,EAAE,MAAM,CAAC;IACZ,+CAA+C;IAC/C,KAAK,EAAE,UAAU,EAAE,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACxB,6CAA6C;IAC7C,EAAE,EAAE,MAAM,CAAC;IACX,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAC;IACf,8DAA8D;IAC9D,IAAI,EAAE,MAAM,CAAC;IACb,yDAAyD;IACzD,SAAS,EAAE,MAAM,CAAC;IAClB,yDAAyD;IACzD,UAAU,EAAE,MAAM,CAAC;IACnB,gEAAgE;IAChE,KAAK,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,cAAc,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ export * from "./changes";
2
+ export * from "./media";
3
+ export * from "./pagination";
4
+ export * from "./params";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from "./changes";
2
+ export * from "./media";
3
+ export * from "./pagination";
4
+ export * from "./params";
@@ -0,0 +1,202 @@
1
+ import { CountryISO3166_1 } from "../config/countries";
2
+ /**
3
+ * Represents a genre of a movie or TV show.
4
+ */
5
+ export type Genre = {
6
+ id: number;
7
+ name: string;
8
+ };
9
+ /**
10
+ * Response containing available genres
11
+ */
12
+ export type GenresResponse = {
13
+ /** Array of genre objects with ID and name */
14
+ genres: Genre[];
15
+ };
16
+ /**
17
+ * Represents a production company involved in creating a movie or TV show.
18
+ */
19
+ export type ProductionCompany = {
20
+ id: number;
21
+ logo_path: string | null;
22
+ name: string;
23
+ origin_country: string;
24
+ };
25
+ /**
26
+ * Represents a country where a movie or TV show was produced.
27
+ */
28
+ export type ProductionCountry = {
29
+ iso_3166_1: string;
30
+ name: string;
31
+ };
32
+ /**
33
+ * Represents a spoken language in a movie or TV show.
34
+ */
35
+ export type SpokenLanguage = {
36
+ english_name: string;
37
+ iso_639_1: string;
38
+ name: string;
39
+ };
40
+ /**
41
+ * Represents a collection of movies.
42
+ */
43
+ export type Collection = {
44
+ id: number;
45
+ name: string;
46
+ poster_path: string | null;
47
+ backdrop_path: string | null;
48
+ };
49
+ /**
50
+ * Represents common class for cast and crew types
51
+ */
52
+ export type Credit = {
53
+ adult: boolean;
54
+ gender: number | null;
55
+ id: number;
56
+ known_for_department: string;
57
+ name: string;
58
+ original_name: string;
59
+ popularity: number;
60
+ profile_path?: string | null;
61
+ credit_id: string;
62
+ };
63
+ /**
64
+ * Represents a cast member in a movie or TV show.
65
+ */
66
+ export type Cast = Credit & {
67
+ cast_id: number;
68
+ character: string;
69
+ order: number;
70
+ };
71
+ /**
72
+ * Represents a crew member in a movie or TV show.
73
+ */
74
+ export type Crew = Credit & {
75
+ department: string;
76
+ job: string;
77
+ };
78
+ /**
79
+ * Represents a keyword entry
80
+ */
81
+ export type Keyword = {
82
+ id: number;
83
+ name: string;
84
+ };
85
+ /**
86
+ * Alternative title entry
87
+ */
88
+ export type AlternativeTitle = {
89
+ /** Alternative title text */
90
+ title: string;
91
+ /** ISO 3166-1 country code where this title is used */
92
+ iso_3166_1: string;
93
+ /** Type of title (e.g., "original title", "working title") */
94
+ type: string;
95
+ };
96
+ /**
97
+ * Video metadata and details
98
+ */
99
+ export type VideoItem = {
100
+ /** ISO 639-1 language code of the video */
101
+ iso_649_1: string;
102
+ /** ISO 3166-1 country code where the video is available */
103
+ iso_3166_1: string;
104
+ /** Video title or name */
105
+ name: string;
106
+ /** Unique video key/ID on the hosting platform */
107
+ key: string;
108
+ /** Video hosting platform (e.g., "YouTube", "Vimeo") */
109
+ site: string;
110
+ /** Video resolution/size (e.g., 1080, 720) */
111
+ size: number;
112
+ /** Type of video (e.g., "Trailer", "Teaser", "Clip", "Featurette", "Behind the Scenes") */
113
+ type: string;
114
+ /** Whether this is an official video from the content distributor */
115
+ official: boolean;
116
+ /** Publication date and time (ISO 8601 format) */
117
+ published_at: string;
118
+ /** Unique video identifier in TMDB */
119
+ id: string;
120
+ };
121
+ /**
122
+ * Image metadata and details
123
+ */
124
+ export type ImageItem = {
125
+ /** Aspect ratio of the image (width/height) */
126
+ aspect_ratio: number;
127
+ /** Image height in pixels */
128
+ height: number;
129
+ /** ISO 639-1 language code if image contains text, null otherwise */
130
+ iso_639_1: string | null;
131
+ /** Relative path to the image file (append to base URL) */
132
+ file_path: string;
133
+ /** Average user rating for this image */
134
+ vote_average: number;
135
+ /** Total number of votes for this image */
136
+ vote_count: number;
137
+ /** Image width in pixels */
138
+ width: number;
139
+ };
140
+ /**
141
+ * Base properties shared between movie and TV show results
142
+ */
143
+ type BaseKnownForItem = {
144
+ adult: boolean;
145
+ backdrop_path: string | null;
146
+ id: number;
147
+ original_language: string;
148
+ overview: string;
149
+ poster_path: string | null;
150
+ genre_ids: number[];
151
+ popularity: number;
152
+ vote_average: number;
153
+ vote_count: number;
154
+ };
155
+ /**
156
+ * Movie item in known_for array
157
+ */
158
+ export type KnownForMovie = BaseKnownForItem & {
159
+ /** Media type discriminator */
160
+ media_type: "movie";
161
+ /** Movie title (localized) */
162
+ title: string;
163
+ /** Original title in the original language */
164
+ original_title: string;
165
+ /** Release date in ISO 8601 format (YYYY-MM-DD) */
166
+ release_date: string;
167
+ /** Whether a video is available on TMDB */
168
+ video: boolean;
169
+ };
170
+ /**
171
+ * TV show item in known_for array
172
+ */
173
+ export type KnownForTV = BaseKnownForItem & {
174
+ /** Media type discriminator */
175
+ media_type: "tv";
176
+ /** Series name (localized) */
177
+ name: string;
178
+ /** Original series name */
179
+ original_name: string;
180
+ /** First air date (YYYY-MM-DD) */
181
+ first_air_date: string;
182
+ /** Origin country codes (ISO 3166-1 array) */
183
+ origin_country: CountryISO3166_1[];
184
+ };
185
+ /**
186
+ * Union type for items in the known_for array (can be either movie or TV show)
187
+ */
188
+ export type KnownForItem = KnownForMovie | KnownForTV;
189
+ export type MediaType = "movie" | "tv";
190
+ /**
191
+ * Content rating information for a TV show or movie
192
+ */
193
+ export type ContentRating = {
194
+ /** Additional content descriptors or advisory warnings (e.g., "violence", "language", "nudity") */
195
+ descriptors: string[];
196
+ /** ISO 3166-1 country code where this rating applies */
197
+ iso_3166_1: string;
198
+ /** Age or content rating (e.g., "TV-MA", "PG-13", "TV-14", "R") */
199
+ rating: string;
200
+ };
201
+ export {};
202
+ //# sourceMappingURL=media.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../../../src/types/common/media.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;GAEG;AACH,MAAM,MAAM,KAAK,GAAG;IAEnB,EAAE,EAAE,MAAM,CAAC;IAEX,IAAI,EAAE,MAAM,CAAC;CACb,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC5B,8CAA8C;IAC9C,MAAM,EAAE,KAAK,EAAE,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAE/B,EAAE,EAAE,MAAM,CAAC;IAEX,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB,IAAI,EAAE,MAAM,CAAC;IAEb,cAAc,EAAE,MAAM,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type PaginatedResponse<T> = {
2
+ page: number;
3
+ total_pages: number;
4
+ total_results: number;
5
+ results: T[];
6
+ };
7
+ //# sourceMappingURL=pagination.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../../src/types/common/pagination.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAAI;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,CAAC,EAAE,CAAC;CACb,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,5 @@
1
- import { CountryISO3166_1 } from "../countries";
2
- import { Language } from "../lang";
1
+ import { CountryISO3166_1 } from "../config/countries";
2
+ import { Language } from "../config/languages";
3
3
  /**
4
4
  * Most of the commonly used params for
5
5
  * TMDB queries. Defined here for reuse.
@@ -9,10 +9,19 @@ export type TMDBQueryParams = {
9
9
  page?: number;
10
10
  region?: CountryISO3166_1;
11
11
  };
12
+ /**
13
+ * Specify a date range with start and end date.
14
+ */
15
+ export type DateRange = {
16
+ /** Start date for changes in ISO 8601 format (YYYY-MM-DD) */
17
+ start_date?: string;
18
+ /** End date for changes in ISO 8601 format (YYYY-MM-DD) */
19
+ end_date?: string;
20
+ };
12
21
  /** Generic utility */
13
22
  export type WithParams<T extends keyof TMDBQueryParams> = Pick<TMDBQueryParams, T>;
14
23
  export type WithLanguage = WithParams<"language">;
15
24
  export type WithPage = WithParams<"page">;
16
25
  export type WithRegion = WithParams<"region">;
17
26
  export type WithLanguagePage = WithParams<"language" | "page">;
18
- //# sourceMappingURL=common.d.ts.map
27
+ //# sourceMappingURL=params.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"params.d.ts","sourceRoot":"","sources":["../../../src/types/common/params.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG;IAC7B,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,gBAAgB,CAAC;CAC1B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG;IACvB,6DAA6D;IAC7D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,sBAAsB;AACtB,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,MAAM,eAAe,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC;AAEnF,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,UAAU,CAAC,CAAC;AAClD,MAAM,MAAM,QAAQ,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;AAC1C,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;AAC9C,MAAM,MAAM,gBAAgB,GAAG,UAAU,CAAC,UAAU,GAAG,MAAM,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,48 @@
1
+ import { Language } from "./languages";
2
+ export type ImageConfiguration = {
3
+ /** Base URL for constructing image URLs (HTTP) */
4
+ base_url: string;
5
+ /** Secure base URL for constructing image URLs (HTTPS) */
6
+ secure_base_url: string;
7
+ /** Available size options for backdrop images */
8
+ backdrop_sizes: string[];
9
+ /** Available size options for logo images */
10
+ logo_sizes: string[];
11
+ /** Available size options for poster images */
12
+ poster_sizes: string[];
13
+ /** Available size options for profile images */
14
+ profile_sizes: string[];
15
+ /** Available size options for still images (from TV shows/episodes) */
16
+ still_sizes: string[];
17
+ };
18
+ export type ConfigurationResponse = {
19
+ /** Image configuration settings including base URLs and available sizes */
20
+ images: ImageConfiguration;
21
+ /** List of keys that can be used to track configuration changes */
22
+ change_keys: string[];
23
+ };
24
+ export type ConfigurationCountriesParams = {
25
+ /** ISO 639-1 language code for localized country names */
26
+ language?: Language;
27
+ };
28
+ export type ConfigurationJob = {
29
+ /** Name of the department (e.g., "Production", "Sound", "Camera") */
30
+ department: string;
31
+ /** List of job titles within this department */
32
+ jobs: string[];
33
+ };
34
+ export type ConfigurationLanguage = {
35
+ /** ISO 639-1 two-letter language code */
36
+ iso_639_1: string;
37
+ /** English name of the language */
38
+ english_name: string;
39
+ /** Native name of the language */
40
+ name: string;
41
+ };
42
+ export type ConfigurationTimezone = {
43
+ /** ISO 3166-1 two-letter country code */
44
+ iso_3166_1: string;
45
+ /** List of timezone identifiers for this country (e.g., "America/New_York") */
46
+ zones: string[];
47
+ };
48
+ //# sourceMappingURL=configuration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../src/types/config/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,MAAM,MAAM,kBAAkB,GAAG;IAChC,kDAAkD;IAClD,QAAQ,EAAE,MAAM,CAAC;IACjB,0DAA0D;IAC1D,eAAe,EAAE,MAAM,CAAC;IACxB,iDAAiD;IACjD,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,6CAA6C;IAC7C,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,+CAA+C;IAC/C,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,gDAAgD;IAChD,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,uEAAuE;IACvE,WAAW,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IACnC,2EAA2E;IAC3E,MAAM,EAAE,kBAAkB,CAAC;IAC3B,mEAAmE;IACnE,WAAW,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG;IAC1C,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC9B,qEAAqE;IACrE,UAAU,EAAE,MAAM,CAAC;IACnB,gDAAgD;IAChD,IAAI,EAAE,MAAM,EAAE,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IACnC,yCAAyC;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,mCAAmC;IACnC,YAAY,EAAE,MAAM,CAAC;IACrB,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IACnC,yCAAyC;IACzC,UAAU,EAAE,MAAM,CAAC;IACnB,+EAA+E;IAC/E,KAAK,EAAE,MAAM,EAAE,CAAC;CAChB,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -1,6 +1,9 @@
1
1
  export type Country = {
2
+ /** ISO 3166-1 alpha-2 country code */
2
3
  iso_3166_1: CountryISO3166_1;
4
+ /** English name of the country */
3
5
  english_name: string;
6
+ /** Native name of the country in its local language */
4
7
  native_name: string;
5
8
  };
6
9
  export declare const TMDBCountries: Country[];