@lorenzopant/tmdb 1.17.1 → 1.17.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/dist/index.d.ts +5113 -4
  2. package/dist/index.js +3747 -5
  3. package/package.json +12 -5
  4. package/dist/client.d.ts +0 -51
  5. package/dist/client.js +0 -166
  6. package/dist/endpoints/base.d.ts +0 -22
  7. package/dist/endpoints/base.js +0 -32
  8. package/dist/endpoints/certifications.d.ts +0 -20
  9. package/dist/endpoints/certifications.js +0 -24
  10. package/dist/endpoints/changes.d.ts +0 -40
  11. package/dist/endpoints/changes.js +0 -46
  12. package/dist/endpoints/collections.d.ts +0 -39
  13. package/dist/endpoints/collections.js +0 -52
  14. package/dist/endpoints/companies.d.ts +0 -37
  15. package/dist/endpoints/companies.js +0 -49
  16. package/dist/endpoints/configuration.d.ts +0 -72
  17. package/dist/endpoints/configuration.js +0 -83
  18. package/dist/endpoints/credits.d.ts +0 -16
  19. package/dist/endpoints/credits.js +0 -22
  20. package/dist/endpoints/discover.d.ts +0 -36
  21. package/dist/endpoints/discover.js +0 -61
  22. package/dist/endpoints/find.d.ts +0 -16
  23. package/dist/endpoints/find.js +0 -21
  24. package/dist/endpoints/genres.d.ts +0 -25
  25. package/dist/endpoints/genres.js +0 -28
  26. package/dist/endpoints/keywords.d.ts +0 -29
  27. package/dist/endpoints/keywords.js +0 -38
  28. package/dist/endpoints/movie_lists.d.ts +0 -53
  29. package/dist/endpoints/movie_lists.js +0 -65
  30. package/dist/endpoints/movies.d.ts +0 -202
  31. package/dist/endpoints/movies.js +0 -255
  32. package/dist/endpoints/networks.d.ts +0 -36
  33. package/dist/endpoints/networks.js +0 -46
  34. package/dist/endpoints/people.d.ts +0 -91
  35. package/dist/endpoints/people.js +0 -128
  36. package/dist/endpoints/people_lists.d.ts +0 -16
  37. package/dist/endpoints/people_lists.js +0 -16
  38. package/dist/endpoints/reviews.d.ts +0 -14
  39. package/dist/endpoints/reviews.js +0 -16
  40. package/dist/endpoints/search.d.ts +0 -88
  41. package/dist/endpoints/search.js +0 -102
  42. package/dist/endpoints/trending.d.ts +0 -36
  43. package/dist/endpoints/trending.js +0 -48
  44. package/dist/endpoints/tv_episode_groups.d.ts +0 -13
  45. package/dist/endpoints/tv_episode_groups.js +0 -16
  46. package/dist/endpoints/tv_episodes.d.ts +0 -110
  47. package/dist/endpoints/tv_episodes.js +0 -136
  48. package/dist/endpoints/tv_seasons.d.ts +0 -128
  49. package/dist/endpoints/tv_seasons.js +0 -164
  50. package/dist/endpoints/tv_series.d.ts +0 -244
  51. package/dist/endpoints/tv_series.js +0 -311
  52. package/dist/endpoints/tv_series_lists.d.ts +0 -51
  53. package/dist/endpoints/tv_series_lists.js +0 -63
  54. package/dist/endpoints/watch_providers.d.ts +0 -34
  55. package/dist/endpoints/watch_providers.js +0 -46
  56. package/dist/errors/messages.d.ts +0 -15
  57. package/dist/errors/messages.js +0 -47
  58. package/dist/errors/tmdb.d.ts +0 -45
  59. package/dist/errors/tmdb.js +0 -39
  60. package/dist/images/images.d.ts +0 -12
  61. package/dist/images/images.js +0 -26
  62. package/dist/routes.d.ts +0 -157
  63. package/dist/routes.js +0 -157
  64. package/dist/tmdb.d.ts +0 -61
  65. package/dist/tmdb.js +0 -94
  66. package/dist/types/collections.d.ts +0 -72
  67. package/dist/types/collections.js +0 -1
  68. package/dist/types/common/certifications.d.ts +0 -19
  69. package/dist/types/common/certifications.js +0 -1
  70. package/dist/types/common/changes.d.ts +0 -44
  71. package/dist/types/common/changes.js +0 -1
  72. package/dist/types/common/images.d.ts +0 -64
  73. package/dist/types/common/images.js +0 -1
  74. package/dist/types/common/index.d.ts +0 -6
  75. package/dist/types/common/index.js +0 -6
  76. package/dist/types/common/media.d.ts +0 -305
  77. package/dist/types/common/media.js +0 -1
  78. package/dist/types/common/pagination.d.ts +0 -6
  79. package/dist/types/common/pagination.js +0 -1
  80. package/dist/types/common/params.d.ts +0 -27
  81. package/dist/types/common/params.js +0 -1
  82. package/dist/types/companies.d.ts +0 -53
  83. package/dist/types/companies.js +0 -1
  84. package/dist/types/config/configuration.d.ts +0 -56
  85. package/dist/types/config/configuration.js +0 -1
  86. package/dist/types/config/countries.d.ts +0 -3
  87. package/dist/types/config/countries.js +0 -1257
  88. package/dist/types/config/images.d.ts +0 -49
  89. package/dist/types/config/images.js +0 -13
  90. package/dist/types/config/index.d.ts +0 -6
  91. package/dist/types/config/index.js +0 -6
  92. package/dist/types/config/languages.d.ts +0 -11
  93. package/dist/types/config/languages.js +0 -1
  94. package/dist/types/config/options.d.ts +0 -46
  95. package/dist/types/config/options.js +0 -1
  96. package/dist/types/config/timezones.d.ts +0 -751
  97. package/dist/types/config/timezones.js +0 -1149
  98. package/dist/types/credits.d.ts +0 -148
  99. package/dist/types/credits.js +0 -1
  100. package/dist/types/discover.d.ts +0 -130
  101. package/dist/types/discover.js +0 -27
  102. package/dist/types/enums.d.ts +0 -8
  103. package/dist/types/enums.js +0 -9
  104. package/dist/types/find.d.ts +0 -103
  105. package/dist/types/find.js +0 -1
  106. package/dist/types/index.d.ts +0 -21
  107. package/dist/types/index.js +0 -21
  108. package/dist/types/keywords.d.ts +0 -19
  109. package/dist/types/keywords.js +0 -1
  110. package/dist/types/movies.d.ts +0 -304
  111. package/dist/types/movies.js +0 -1
  112. package/dist/types/networks.d.ts +0 -45
  113. package/dist/types/networks.js +0 -1
  114. package/dist/types/people-lists.d.ts +0 -5
  115. package/dist/types/people-lists.js +0 -1
  116. package/dist/types/people.d.ts +0 -214
  117. package/dist/types/people.js +0 -1
  118. package/dist/types/reviews.d.ts +0 -22
  119. package/dist/types/reviews.js +0 -1
  120. package/dist/types/search.d.ts +0 -198
  121. package/dist/types/search.js +0 -1
  122. package/dist/types/trending.d.ts +0 -55
  123. package/dist/types/trending.js +0 -1
  124. package/dist/types/tv-episode-groups.d.ts +0 -63
  125. package/dist/types/tv-episode-groups.js +0 -13
  126. package/dist/types/tv-episodes.d.ts +0 -98
  127. package/dist/types/tv-episodes.js +0 -1
  128. package/dist/types/tv-seasons.d.ts +0 -133
  129. package/dist/types/tv-seasons.js +0 -1
  130. package/dist/types/tv-series.d.ts +0 -445
  131. package/dist/types/tv-series.js +0 -1
  132. package/dist/types/utility.d.ts +0 -16
  133. package/dist/types/utility.js +0 -10
  134. package/dist/types/watch-providers.d.ts +0 -34
  135. package/dist/types/watch-providers.js +0 -1
  136. package/dist/utils/index.d.ts +0 -2
  137. package/dist/utils/index.js +0 -2
  138. package/dist/utils/jwt.d.ts +0 -1
  139. package/dist/utils/jwt.js +0 -61
  140. package/dist/utils/logger.d.ts +0 -18
  141. package/dist/utils/logger.js +0 -40
package/dist/index.js CHANGED
@@ -1,5 +1,3747 @@
1
- // src/index.ts
2
- export { TMDB } from "./tmdb";
3
- export { TMDBError } from "./errors/tmdb";
4
- export * from "./types";
5
- export * from "./utils";
1
+ // src/errors/tmdb.ts
2
+ var TMDBError = class extends Error {
3
+ /**
4
+ * The status code returned by the TMDB API.
5
+ * If the value is `-1`, it indicates a library-specific error rather than a TMDB API error.
6
+ * @reference https://developer.themoviedb.org/docs/errors - code
7
+ */
8
+ tmdb_status_code;
9
+ /**
10
+ * A descriptive message providing details about the error.
11
+ * If the error is specific to the TMDB API, this message will be derived from the API response
12
+ * @reference https://developer.themoviedb.org/docs/errors - message
13
+ */
14
+ message;
15
+ /**
16
+ * The HTTP status code associated with the error.
17
+ * If the error is specific to the TMDB API, this code will be derived from the API response.
18
+ * @reference https://developer.themoviedb.org/docs/errors - HTTP Status
19
+ */
20
+ http_status_code;
21
+ /**
22
+ * Creates an instance of `TMDBError`.
23
+ *
24
+ * @param message - A descriptive message providing details about the error.
25
+ * @param http_status - The HTTP status code associated with the error.
26
+ * @param tmdb_status_code - (Optional) The status code returned by the TMDB API. Defaults to `-1` for library-specific errors.
27
+ */
28
+ constructor(message, http_status, tmdb_status_code) {
29
+ super(message);
30
+ this.name = "TMDBError";
31
+ this.tmdb_status_code = tmdb_status_code || -1;
32
+ this.message = message;
33
+ this.http_status_code = http_status;
34
+ }
35
+ };
36
+
37
+ // src/utils/logger.ts
38
+ var TMDBLogger = class _TMDBLogger {
39
+ logger;
40
+ constructor(logger) {
41
+ this.logger = logger;
42
+ }
43
+ static from(logger) {
44
+ if (!logger) return void 0;
45
+ if (logger === true) return new _TMDBLogger(_TMDBLogger.defaultLogger);
46
+ return new _TMDBLogger(logger);
47
+ }
48
+ log(entry) {
49
+ if (!this.logger) return;
50
+ try {
51
+ this.logger(entry);
52
+ } catch (error) {
53
+ console.warn(`TMDB logger error: ${error}`);
54
+ }
55
+ }
56
+ static defaultLogger(entry) {
57
+ const prefix = "\u{1F3AC} [tmdb]";
58
+ const timestamp = (/* @__PURE__ */ new Date()).toISOString();
59
+ if (entry.type === "request") {
60
+ console.log(`${prefix} ${timestamp} \u{1F6F0}\uFE0F REQUEST ${entry.method} ${entry.endpoint}
61
+ `);
62
+ return;
63
+ }
64
+ if (entry.type === "response") {
65
+ console.log(
66
+ `${prefix} ${timestamp} \u2705 RESPONSE ${entry.method} ${entry.status} ${entry.statusText} ${entry.endpoint} (${entry.durationMs}ms)
67
+ `
68
+ );
69
+ return;
70
+ }
71
+ const statusPart = entry.status != null ? `${entry.status} ${entry.statusText}` : "NETWORK ERROR";
72
+ const tmdbPart = entry.tmdbStatusCode != null ? ` (tmdb: ${entry.tmdbStatusCode})` : "";
73
+ console.log(`${prefix} ${timestamp} \u274C ${entry.method} ${statusPart} ${entry.endpoint} - ${entry.errorMessage}${tmdbPart}
74
+ `);
75
+ }
76
+ };
77
+
78
+ // src/utils/jwt.ts
79
+ function isBase64Url(str) {
80
+ return /^[A-Za-z0-9\-_]+$/.test(str);
81
+ }
82
+ function decodeBase64Url(str) {
83
+ try {
84
+ const base64 = str.replace(/-/g, "+").replace(/_/g, "/");
85
+ const padded = base64.padEnd(base64.length + (4 - base64.length % 4) % 4, "=");
86
+ return atob(padded);
87
+ } catch {
88
+ return null;
89
+ }
90
+ }
91
+ function isObject(value) {
92
+ return typeof value === "object" && value !== null;
93
+ }
94
+ function isJwtHeader(value) {
95
+ if (!isObject(value)) return false;
96
+ return typeof value.alg === "string";
97
+ }
98
+ function isJwtPayload(value) {
99
+ if (!isObject(value)) return false;
100
+ if ("exp" in value && typeof value.exp !== "number") return false;
101
+ if ("nbf" in value && typeof value.nbf !== "number") return false;
102
+ if ("iat" in value && typeof value.iat !== "number") return false;
103
+ return true;
104
+ }
105
+ function isJwt(token) {
106
+ if (typeof token !== "string") return false;
107
+ const parts = token.split(".");
108
+ if (parts.length !== 3) return false;
109
+ const [headerB64, payloadB64, signatureB64] = parts;
110
+ if (!isBase64Url(headerB64) || !isBase64Url(payloadB64) || !isBase64Url(signatureB64)) {
111
+ return false;
112
+ }
113
+ const headerStr = decodeBase64Url(headerB64);
114
+ const payloadStr = decodeBase64Url(payloadB64);
115
+ if (!headerStr || !payloadStr) return false;
116
+ let parsedHeader;
117
+ let parsedPayload;
118
+ try {
119
+ parsedHeader = JSON.parse(headerStr);
120
+ parsedPayload = JSON.parse(payloadStr);
121
+ } catch {
122
+ return false;
123
+ }
124
+ if (!isJwtHeader(parsedHeader)) return false;
125
+ if (!isJwtPayload(parsedPayload)) return false;
126
+ return true;
127
+ }
128
+
129
+ // src/utils/index.ts
130
+ function hasPosterPath(data) {
131
+ return typeof data === "object" && data !== null && "poster_path" in data && typeof data.poster_path === "string";
132
+ }
133
+ function hasBackdropPath(data) {
134
+ return typeof data === "object" && data !== null && "backdrop_path" in data && typeof data.backdrop_path === "string";
135
+ }
136
+ function hasProfilePath(data) {
137
+ return typeof data === "object" && data !== null && "profile_path" in data && typeof data.profile_path === "string";
138
+ }
139
+ function hasStillPath(data) {
140
+ return typeof data === "object" && data !== null && "still_path" in data && typeof data.still_path === "string";
141
+ }
142
+ function hasLogoPath(data) {
143
+ return typeof data === "object" && data !== null && "logo_path" in data && typeof data.logo_path === "string";
144
+ }
145
+
146
+ // src/client.ts
147
+ var ApiClient = class {
148
+ accessToken;
149
+ baseUrl = "https://api.themoviedb.org/3";
150
+ logger;
151
+ /**
152
+ * Tracks in-flight requests keyed by a deterministic string derived from the endpoint
153
+ * and its parameters. When two identical requests are fired concurrently, the second
154
+ * caller receives the same Promise as the first — only one fetch is made.
155
+ * Entries are removed via `.finally()` so the map never holds settled promises.
156
+ */
157
+ inflightRequests = /* @__PURE__ */ new Map();
158
+ deduplication;
159
+ constructor(accessToken, options = {}) {
160
+ this.accessToken = accessToken;
161
+ this.logger = TMDBLogger.from(options.logger);
162
+ this.deduplication = options.deduplication !== false;
163
+ }
164
+ /**
165
+ * Builds a stable, order-independent cache key for a request.
166
+ *
167
+ * `undefined` values are excluded (they are never serialised into the URL),
168
+ * and the remaining entries are sorted alphabetically before joining so that
169
+ * `{ language, page }` and `{ page, language }` produce the same key.
170
+ */
171
+ buildRequestKey(endpoint, params) {
172
+ const definedEntries = this.serializeParams(params).sort(([a], [b]) => a.localeCompare(b)).map(([key, value]) => `${key}=${value}`);
173
+ return definedEntries.length > 0 ? `${endpoint}?${definedEntries.join("&")}` : endpoint;
174
+ }
175
+ /**
176
+ * Serializes request params once so URL construction and deduplication keys stay aligned.
177
+ * `undefined` values are intentionally skipped because they are not sent to TMDB.
178
+ */
179
+ serializeParams(params) {
180
+ return Object.entries(params).flatMap(([key, value]) => {
181
+ if (value === void 0) return [];
182
+ return [[key, String(value)]];
183
+ });
184
+ }
185
+ /**
186
+ * Makes an authenticated GET request to the TMDB API, returning the parsed and
187
+ * null-sanitised response.
188
+ *
189
+ * **Deduplication:** when enabled (the default), concurrent calls with the same
190
+ * `endpoint` + `params` share a single in-flight fetch. The second (and any
191
+ * subsequent) caller receives the same `Promise` — no extra network request is made.
192
+ * Once the promise settles (success or error) it is evicted from the map so the next
193
+ * call triggers a fresh fetch. Deduplication can be disabled globally via
194
+ * `TMDBOptions.deduplication = false`.
195
+ */
196
+ async request(endpoint, params = {}) {
197
+ if (!this.deduplication) return this.doRequest(endpoint, params);
198
+ const key = this.buildRequestKey(endpoint, params);
199
+ const existing = this.inflightRequests.get(key);
200
+ if (existing) return existing;
201
+ const promise = this.doRequest(endpoint, params).finally(() => {
202
+ this.inflightRequests.delete(key);
203
+ });
204
+ this.inflightRequests.set(key, promise);
205
+ return promise;
206
+ }
207
+ /**
208
+ * The actual fetch + response-parsing pipeline. Called by `request()` only when no
209
+ * matching in-flight promise exists. Handles URL construction, auth headers, logging,
210
+ * error mapping, and null sanitisation.
211
+ */
212
+ async doRequest(endpoint, params) {
213
+ const url = new URL(`${this.baseUrl}${endpoint}`);
214
+ const jwt = isJwt(this.accessToken);
215
+ for (const [key, value] of this.serializeParams(params)) {
216
+ url.searchParams.append(key, value);
217
+ }
218
+ if (!jwt) {
219
+ url.searchParams.append("api_key", this.accessToken);
220
+ }
221
+ const startedAt = Date.now();
222
+ this.logger?.log({
223
+ type: "request",
224
+ method: "GET",
225
+ endpoint
226
+ });
227
+ let res;
228
+ try {
229
+ res = await fetch(url.toString(), {
230
+ headers: jwt ? {
231
+ Authorization: `Bearer ${this.accessToken}`,
232
+ "Content-Type": "application/json;charset=utf-8"
233
+ } : {
234
+ "Content-Type": "application/json;charset=utf-8"
235
+ }
236
+ });
237
+ } catch (error) {
238
+ this.logger?.log({
239
+ type: "error",
240
+ method: "GET",
241
+ endpoint,
242
+ errorMessage: error instanceof Error ? error.message : String(error),
243
+ durationMs: Date.now() - startedAt
244
+ });
245
+ throw error;
246
+ }
247
+ if (!res.ok) await this.handleError(res, endpoint);
248
+ this.logger?.log({
249
+ type: "response",
250
+ method: "GET",
251
+ endpoint,
252
+ status: res.status,
253
+ statusText: res.statusText,
254
+ durationMs: Date.now() - startedAt
255
+ });
256
+ const data = await res.json();
257
+ return this.sanitizeNulls(data);
258
+ }
259
+ /**
260
+ * Recursively converts null values to undefined in API responses.
261
+ * This allows optional properties to model fields that TMDB returns as nullable.
262
+ * Response types for nullable fields should account for possible undefined values.
263
+ */
264
+ sanitizeNulls(value) {
265
+ if (value === null) {
266
+ return void 0;
267
+ }
268
+ if (typeof value !== "object") {
269
+ return value;
270
+ }
271
+ if (Array.isArray(value)) {
272
+ return value.map((v) => this.sanitizeNulls(v));
273
+ }
274
+ const sanitized = {};
275
+ for (const [key, val] of Object.entries(value)) {
276
+ sanitized[key] = this.sanitizeNulls(val);
277
+ }
278
+ return sanitized;
279
+ }
280
+ async handleError(res, endpoint) {
281
+ let errorMessage = res.statusText;
282
+ let tmdbStatusCode = -1;
283
+ try {
284
+ const errorBody = await res.json();
285
+ if (errorBody && typeof errorBody === "object") {
286
+ const err = errorBody;
287
+ errorMessage = err.status_message || errorMessage;
288
+ tmdbStatusCode = err.status_code || -1;
289
+ }
290
+ } catch (error2) {
291
+ console.error(`Unknown error: ${error2}`);
292
+ }
293
+ this.logger?.log({
294
+ type: "error",
295
+ method: "GET",
296
+ endpoint,
297
+ status: res.status,
298
+ statusText: res.statusText,
299
+ tmdbStatusCode,
300
+ errorMessage
301
+ });
302
+ const error = new TMDBError(errorMessage, res.status, tmdbStatusCode);
303
+ throw error;
304
+ }
305
+ };
306
+
307
+ // src/routes.ts
308
+ var ENDPOINTS = {
309
+ CONFIGURATION: {
310
+ DETAILS: "/configuration",
311
+ COUNTRIES: "/configuration/countries",
312
+ JOBS: "/configuration/jobs",
313
+ LANGUAGES: "/configuration/languages",
314
+ TIMEZONES: "/configuration/timezones",
315
+ PRIMARY_TRANSLATIONS: "/configuration/primary_translations"
316
+ },
317
+ CERTIFICATIONS: {
318
+ MOVIE_CERTIFICATIONS: "/certification/movie/list",
319
+ TV_CERTIFICATIONS: "/certification/tv/list"
320
+ },
321
+ CHANGES: {
322
+ MOVIE_LIST: "/movie/changes",
323
+ PEOPLE_LIST: "/person/changes",
324
+ TV_LIST: "/tv/changes"
325
+ },
326
+ DISCOVER: {
327
+ MOVIE: "/discover/movie",
328
+ TV: "/discover/tv"
329
+ },
330
+ FIND: "/find",
331
+ CREDITS: {
332
+ DETAILS: "/credit"
333
+ },
334
+ COMPANIES: {
335
+ DETAILS: "/company",
336
+ ALTERNATIVE_NAMES: "/alternative_names",
337
+ IMAGES: "/images"
338
+ },
339
+ COLLECTIONS: {
340
+ DETAILS: "/collection",
341
+ IMAGES: "/images",
342
+ TRANSLATIONS: "/translations"
343
+ },
344
+ GENRES: {
345
+ MOVIE_LIST: "/genre/movie/list",
346
+ TV_LIST: "/genre/tv/list"
347
+ },
348
+ KEYWORDS: {
349
+ DETAILS: "/keyword",
350
+ MOVIES: "/movies"
351
+ },
352
+ MOVIES: {
353
+ DETAILS: "/movie",
354
+ ALTERNATIVE_TITLES: "/alternative_titles",
355
+ CREDITS: "/credits",
356
+ EXTERNAL_IDS: "/external_ids",
357
+ KEYWORDS: "/keywords",
358
+ CHANGES: "/changes",
359
+ IMAGES: "/images",
360
+ LATEST: "/latest",
361
+ NOW_PLAYING: "/now_playing",
362
+ POPULAR: "/popular",
363
+ RECOMMENDATIONS: "/recommendations",
364
+ RELEASE_DATES: "/release_dates",
365
+ REVIEWS: "/reviews",
366
+ SIMILAR: "/similar",
367
+ TOP_RATED: "/top_rated",
368
+ TRANSLATIONS: "/translations",
369
+ UPCOMING: "/upcoming",
370
+ VIDEOS: "/videos",
371
+ WATCH_PROVIDERS: "/watch/providers"
372
+ },
373
+ NETWORKS: {
374
+ DETAILS: "/network",
375
+ ALTERNATIVE_NAMES: "/alternative_names",
376
+ IMAGES: "/images"
377
+ },
378
+ PEOPLE: {
379
+ DETAILS: "/person",
380
+ CHANGES: "/changes",
381
+ COMBINED_CREDITS: "/combined_credits",
382
+ EXTERNAL_IDS: "/external_ids",
383
+ IMAGES: "/images",
384
+ LATEST: "/latest",
385
+ MOVIE_CREDITS: "/movie_credits",
386
+ TAGGED_IMAGES: "/tagged_images",
387
+ TRANSLATIONS: "/translations",
388
+ TV_CREDITS: "/tv_credits"
389
+ },
390
+ SEARCH: {
391
+ MOVIE: "/search/movie",
392
+ COLLECTION: "/search/collection",
393
+ COMPANY: "/search/company",
394
+ KEYWORD: "/search/keyword",
395
+ MULTI: "/search/multi",
396
+ PERSON: "/search/person",
397
+ TV: "/search/tv"
398
+ },
399
+ TV_SERIES: {
400
+ DETAILS: "/tv",
401
+ AGGREGATE_CREDITS: "/aggregate_credits",
402
+ AIRING_TODAY: "/airing_today",
403
+ ALTERNATIVE_TITLES: "/alternative_titles",
404
+ CHANGES: "/changes",
405
+ CONTENT_RATINGS: "/content_ratings",
406
+ CREDITS: "/credits",
407
+ EPISODE_GROUPS: "/episode_groups",
408
+ EXTERNAL_IDS: "/external_ids",
409
+ IMAGES: "/images",
410
+ KEYWORDS: "/keywords",
411
+ LATEST: "/latest",
412
+ LISTS: "/lists",
413
+ ON_THE_AIR: "/on_the_air",
414
+ POPULAR: "/popular",
415
+ RECOMMENDATIONS: "/recommendations",
416
+ REVIEWS: "/reviews",
417
+ SCREENED_THEATRICALLY: "/screened_theatrically",
418
+ SIMILAR: "/similar",
419
+ TOP_RATED: "/top_rated",
420
+ TRANSLATIONS: "/translations",
421
+ VIDEOS: "/videos",
422
+ WATCH_PROVIDERS: "/watch/providers"
423
+ },
424
+ TV_SEASONS: {
425
+ DETAILS: "/season",
426
+ AGGREGATE_CREDITS: "/aggregate_credits",
427
+ CHANGES: "/changes",
428
+ CREDITS: "/credits",
429
+ EXTERNAL_IDS: "/external_ids",
430
+ IMAGES: "/images",
431
+ TRANSLATIONS: "/translations",
432
+ VIDEOS: "/videos",
433
+ WATCH_PROVIDERS: "/watch/providers"
434
+ },
435
+ TV_EPISODES: {
436
+ DETAILS: "/episode",
437
+ CHANGES: "/changes",
438
+ CREDITS: "/credits",
439
+ EXTERNAL_IDS: "/external_ids",
440
+ IMAGES: "/images",
441
+ TRANSLATIONS: "/translations",
442
+ VIDEOS: "/videos"
443
+ },
444
+ TV_EPISODE_GROUPS: {
445
+ DETAILS: "/tv/episode_group"
446
+ },
447
+ WATCH_PROVIDERS: {
448
+ MOVIE: "/watch/providers/movie",
449
+ TV: "/watch/providers/tv",
450
+ REGIONS: "/watch/providers/regions"
451
+ },
452
+ TRENDING: {
453
+ ALL: "/trending/all",
454
+ MOVIE: "/trending/movie",
455
+ TV: "/trending/tv",
456
+ PERSON: "/trending/person"
457
+ },
458
+ REVIEWS: {
459
+ DETAILS: "/review"
460
+ },
461
+ PEOPLE_LISTS: {
462
+ POPULAR: "/person/popular"
463
+ }
464
+ };
465
+
466
+ // src/endpoints/base.ts
467
+ var TMDBAPIBase = class {
468
+ client;
469
+ defaultOptions;
470
+ constructor(client, defaultOptions = {}) {
471
+ this.client = client;
472
+ this.defaultOptions = defaultOptions;
473
+ }
474
+ /**
475
+ * Merges the endpoint's params with TMDB-wide defaults (language, region).
476
+ * Works only for param types that include optional `language` and `region` fields.
477
+ * Only request-safe defaults are merged — config-only options (logger, images, etc.) are excluded.
478
+ */
479
+ applyDefaults(params) {
480
+ const { language, region } = this.defaultOptions;
481
+ return { ...language !== void 0 && { language }, ...region !== void 0 && { region }, ...params };
482
+ }
483
+ /**
484
+ * Ensures params contains a language: prefer explicit param, fallback to defaultOptions.language.
485
+ * If neither is present, returns the original params unmodified.
486
+ * When params is undefined but a default language is set, returns { language: defaultLang }.
487
+ */
488
+ withLanguage(params) {
489
+ const defaultLang = this.defaultOptions?.language;
490
+ if (!params) return defaultLang !== void 0 ? { language: defaultLang } : void 0;
491
+ if (params.language !== void 0) return params;
492
+ if (defaultLang === void 0) return params;
493
+ return { ...params, language: defaultLang };
494
+ }
495
+ };
496
+
497
+ // src/endpoints/certifications.ts
498
+ var CertificationsAPI = class extends TMDBAPIBase {
499
+ /**
500
+ * Movie Certifications
501
+ * GET - https://api.themoviedb.org/3/certification/movie/list
502
+ *
503
+ * Get an up to date list of the officially supported movie certifications on TMDB.
504
+ * @reference https://developer.themoviedb.org/reference/certification-movie-list
505
+ */
506
+ async movie_certifications() {
507
+ return this.client.request(ENDPOINTS.CERTIFICATIONS.MOVIE_CERTIFICATIONS);
508
+ }
509
+ /**
510
+ * TV Certifications
511
+ * GET - https://api.themoviedb.org/3/certification/tv/list
512
+ *
513
+ * Get an up to date list of the officially supported tv certifications on TMDB.
514
+ * @reference https://developer.themoviedb.org/reference/certification-tv-list
515
+ */
516
+ async tv_certifications() {
517
+ return this.client.request(ENDPOINTS.CERTIFICATIONS.TV_CERTIFICATIONS);
518
+ }
519
+ };
520
+
521
+ // src/endpoints/changes.ts
522
+ var ChangesAPI = class extends TMDBAPIBase {
523
+ /**
524
+ * Movie List
525
+ * GET - https://api.themoviedb.org/3/movie/changes
526
+ *
527
+ * Get a list of all of the movie ids that have been changed in the past 24 hours.
528
+ *
529
+ * @param page Page number
530
+ * @param start_date Start date for change items
531
+ * @param end_date End date for change items
532
+ * @reference https://developer.themoviedb.org/reference/changes-movie-list
533
+ */
534
+ async movie_list(params) {
535
+ return this.client.request(ENDPOINTS.CHANGES.MOVIE_LIST, params);
536
+ }
537
+ /**
538
+ * People List
539
+ * GET - https://api.themoviedb.org/3/person/changes
540
+ *
541
+ * Get a list of all of the person ids that have been changed in the past 24 hours.
542
+ *
543
+ * @param page Page number
544
+ * @param start_date Start date for change items
545
+ * @param end_date End date for change items
546
+ * @reference https://developer.themoviedb.org/reference/changes-people-list
547
+ */
548
+ async people_list(params) {
549
+ return this.client.request(ENDPOINTS.CHANGES.PEOPLE_LIST, params);
550
+ }
551
+ /**
552
+ * TV List
553
+ * GET - https://api.themoviedb.org/3/tv/changes
554
+ *
555
+ * Get a list of all of the tv show ids that have been changed in the past 24 hours.
556
+ *
557
+ * @param page Page number
558
+ * @param start_date Start date for change items
559
+ * @param end_date End date for change items
560
+ * @reference https://developer.themoviedb.org/reference/changes-tv-list
561
+ */
562
+ async tv_list(params) {
563
+ return this.client.request(ENDPOINTS.CHANGES.TV_LIST, params);
564
+ }
565
+ };
566
+
567
+ // src/endpoints/companies.ts
568
+ var CompaniesAPI = class extends TMDBAPIBase {
569
+ companyPath(company_id) {
570
+ return `${ENDPOINTS.COMPANIES.DETAILS}/${company_id}`;
571
+ }
572
+ /**
573
+ * Details
574
+ * GET - https://api.themoviedb.org/3/company/{company_id}
575
+ *
576
+ * Get the company details by ID.
577
+ *
578
+ * @param company_id Unique identifier for the company
579
+ * @reference https://developer.themoviedb.org/reference/company-details
580
+ */
581
+ async details(params) {
582
+ const endpoint = this.companyPath(params.company_id);
583
+ return this.client.request(endpoint);
584
+ }
585
+ /**
586
+ * Alternative names
587
+ * GET - https://api.themoviedb.org/3/company/{company_id}/alternative_names
588
+ *
589
+ * Get the list of alternative names for a company.
590
+ *
591
+ * @param company_id Unique identifier for the company
592
+ * @reference https://developer.themoviedb.org/reference/company-alternative-names
593
+ */
594
+ async alternative_names(params) {
595
+ const endpoint = `${this.companyPath(params.company_id)}${ENDPOINTS.COMPANIES.ALTERNATIVE_NAMES}`;
596
+ return this.client.request(endpoint);
597
+ }
598
+ /**
599
+ * Images
600
+ * GET - https://api.themoviedb.org/3/company/{company_id}/images
601
+ *
602
+ * Get the logos for a company by ID.
603
+ *
604
+ * @param company_id Unique identifier for the company
605
+ * @param language Language for the response
606
+ * @param include_image_language Additional language for images
607
+ * @reference https://developer.themoviedb.org/reference/company-images
608
+ */
609
+ async images(params) {
610
+ const { company_id, ...rest } = params;
611
+ const endpoint = `${this.companyPath(company_id)}${ENDPOINTS.COMPANIES.IMAGES}`;
612
+ return this.client.request(endpoint, this.withLanguage(rest));
613
+ }
614
+ };
615
+
616
+ // src/endpoints/credits.ts
617
+ var CreditsAPI = class extends TMDBAPIBase {
618
+ creditPath(credit_id) {
619
+ return `${ENDPOINTS.CREDITS.DETAILS}/${credit_id}`;
620
+ }
621
+ /**
622
+ * Details
623
+ * GET - https://api.themoviedb.org/3/credit/{credit_id}
624
+ *
625
+ * Get the detailed information for a movie or TV credit.
626
+ *
627
+ * @param credit_id Unique identifier for the credit
628
+ * @param language Language for the response
629
+ * @reference https://developer.themoviedb.org/reference/credit-details
630
+ */
631
+ async details(params) {
632
+ const { credit_id, ...rest } = params;
633
+ const endpoint = this.creditPath(credit_id);
634
+ return this.client.request(endpoint, this.withLanguage(rest));
635
+ }
636
+ };
637
+
638
+ // src/endpoints/collections.ts
639
+ var CollectionsAPI = class extends TMDBAPIBase {
640
+ collectionPath(collection_id) {
641
+ return `${ENDPOINTS.COLLECTIONS.DETAILS}/${collection_id}`;
642
+ }
643
+ /**
644
+ * Details
645
+ * GET - https://api.themoviedb.org/3/collection/{collection_id}
646
+ *
647
+ * Get collection details by ID.
648
+ *
649
+ * @param collection_id Unique identifier for the collection
650
+ * @param language Language for the response
651
+ * @reference https://developer.themoviedb.org/reference/collection-details
652
+ */
653
+ async details(params) {
654
+ const { language = this.defaultOptions.language, collection_id } = params;
655
+ const endpoint = this.collectionPath(collection_id);
656
+ return this.client.request(endpoint, { language });
657
+ }
658
+ /**
659
+ * Images
660
+ * GET - https://api.themoviedb.org/3/collection/{collection_id}/images
661
+ *
662
+ * Get the images that belong to a collection.
663
+ * This method will return the backdrops and posters that have been added to a collection.
664
+ *
665
+ * @param collection_id Unique identifier for the collection
666
+ * @param language Language for the response
667
+ * @param include_image_language Additional language for images
668
+ * @reference https://developer.themoviedb.org/reference/collection-images
669
+ */
670
+ async images(params) {
671
+ const { collection_id, ...rest } = params;
672
+ const endpoint = `${this.collectionPath(collection_id)}${ENDPOINTS.COLLECTIONS.IMAGES}`;
673
+ return this.client.request(endpoint, this.withLanguage(rest));
674
+ }
675
+ /**
676
+ * Translations
677
+ * GET - https://api.themoviedb.org/3/collection/{collection_id}/translations
678
+ *
679
+ * Get collection translations by ID.
680
+ *
681
+ * @param collection_id Unique identifier for the collection
682
+ * @reference https://developer.themoviedb.org/reference/collection-translations
683
+ */
684
+ async translations(params) {
685
+ const endpoint = `${this.collectionPath(params.collection_id)}${ENDPOINTS.COLLECTIONS.TRANSLATIONS}`;
686
+ return this.client.request(endpoint);
687
+ }
688
+ };
689
+
690
+ // src/endpoints/configuration.ts
691
+ var ConfigurationAPI = class extends TMDBAPIBase {
692
+ /**
693
+ * Details
694
+ * GET - https://api.themoviedb.org/3/configuration
695
+ *
696
+ * Query the API configuration details.
697
+ * The data returned here in the configuration endpoint is designed to provide some of
698
+ * the required information you'll need as you integrate our API.
699
+ * For example, you can get a list of valid image sizes and the valid image address.
700
+ * @reference https://developer.themoviedb.org/reference/configuration-details
701
+ */
702
+ async details() {
703
+ return this.client.request(ENDPOINTS.CONFIGURATION.DETAILS);
704
+ }
705
+ /**
706
+ * Countries
707
+ * GET - https://api.themoviedb.org/3/configuration/countries
708
+ *
709
+ * Get the list of countries (ISO 3166-1 tags) used throughout TMDB.
710
+ * @param language Language (Defaults to en-US)
711
+ * @reference https://developer.themoviedb.org/reference/configuration-countries
712
+ */
713
+ async countries(params) {
714
+ return this.client.request(ENDPOINTS.CONFIGURATION.COUNTRIES, this.withLanguage(params));
715
+ }
716
+ /**
717
+ * Jobs
718
+ * GET - https://api.themoviedb.org/3/configuration/jobs
719
+ *
720
+ * Get the list of the jobs and departments used throughout TMDB.
721
+ * @reference https://developer.themoviedb.org/reference/configuration-jobs
722
+ */
723
+ async jobs() {
724
+ return this.client.request(ENDPOINTS.CONFIGURATION.JOBS);
725
+ }
726
+ /**
727
+ * Languages
728
+ * GET - https://api.themoviedb.org/3/configuration/languages
729
+ *
730
+ * Get the list of the languages (ISO 639-1 tags) used throughout TMDB.
731
+ * @reference https://developer.themoviedb.org/reference/configuration-languages
732
+ */
733
+ async languages() {
734
+ return this.client.request(ENDPOINTS.CONFIGURATION.LANGUAGES);
735
+ }
736
+ /**
737
+ * Primary Translations
738
+ * GET - https://api.themoviedb.org/3/configuration/primary_translations
739
+ *
740
+ * Get a list of the officially supported translations on TMDB.
741
+ *
742
+ * While it's technically possible to add a translation in any one of the languages we have added to TMDB
743
+ * (we don't restrict content), the ones listed in this method are the ones
744
+ * we also support for localizing the website with which means they are "primary" translations.
745
+ *
746
+ * These are all specified as IETF tags to identify the languages we use on TMDB. There is one exception which is image languages.
747
+ * They are currently only designated by a ISO-639-1 tag.
748
+ * This is a planned upgrade for the future.
749
+ *
750
+ * We're always open to adding more if you think one should be added.
751
+ * You can ask about getting a new primary translation added by posting on the forums.
752
+ *
753
+ * One more thing to mention, these are the translations that map to our website translation project.
754
+ * You can view and contribute to that project here.
755
+ *
756
+ * @reference https://developer.themoviedb.org/reference/configuration-primary-translations
757
+ */
758
+ async primary_translations() {
759
+ return this.client.request(ENDPOINTS.CONFIGURATION.PRIMARY_TRANSLATIONS);
760
+ }
761
+ /**
762
+ * Timezones
763
+ * GET - https://api.themoviedb.org/3/configuration/timezones
764
+ *
765
+ * Get the list of timezones used throughout TMDB.
766
+ * @reference https://developer.themoviedb.org/reference/configuration-timezones
767
+ */
768
+ async timezones() {
769
+ return this.client.request(ENDPOINTS.CONFIGURATION.TIMEZONES);
770
+ }
771
+ };
772
+
773
+ // src/endpoints/discover.ts
774
+ var DiscoverAPI = class extends TMDBAPIBase {
775
+ /**
776
+ * TMDB discover filtering notes:
777
+ *
778
+ * - If `region` is provided on movie discover, TMDB uses the regional release date
779
+ * instead of the primary release date. When `with_release_type` is also provided,
780
+ * the returned release date follows the order of the specified release types.
781
+ * - Filters that accept comma-separated or pipe-separated values are forwarded as-is:
782
+ * commas mean AND, pipes mean OR.
783
+ *
784
+ * @reference https://developer.themoviedb.org/reference/discover-movie
785
+ * @reference https://developer.themoviedb.org/reference/discover-tv
786
+ */
787
+ withMovieDefaults(params) {
788
+ if (!params && !this.defaultOptions.language && !this.defaultOptions.region) return void 0;
789
+ const language = params?.language ?? this.defaultOptions.language;
790
+ const region = params?.region ?? this.defaultOptions.region;
791
+ return {
792
+ ...params,
793
+ language,
794
+ region
795
+ };
796
+ }
797
+ withTVDefaults(params) {
798
+ if (!params && !this.defaultOptions.language && !this.defaultOptions.timezone) {
799
+ return void 0;
800
+ }
801
+ const language = params?.language ?? this.defaultOptions.language;
802
+ const timezone = params?.timezone ?? this.defaultOptions.timezone;
803
+ return {
804
+ ...params,
805
+ language,
806
+ timezone
807
+ };
808
+ }
809
+ /**
810
+ * Movie
811
+ * GET - https://api.themoviedb.org/3/discover/movie
812
+ *
813
+ * Discover movies by applying filters and sort options.
814
+ *
815
+ * @reference https://developer.themoviedb.org/reference/discover-movie
816
+ */
817
+ async movie(params = {}) {
818
+ return this.client.request(ENDPOINTS.DISCOVER.MOVIE, this.withMovieDefaults(params));
819
+ }
820
+ /**
821
+ * TV
822
+ * GET - https://api.themoviedb.org/3/discover/tv
823
+ *
824
+ * Discover TV series by applying filters and sort options.
825
+ *
826
+ * @reference https://developer.themoviedb.org/reference/discover-tv
827
+ */
828
+ async tv(params = {}) {
829
+ return this.client.request(ENDPOINTS.DISCOVER.TV, this.withTVDefaults(params));
830
+ }
831
+ };
832
+
833
+ // src/endpoints/find.ts
834
+ var FindAPI = class extends TMDBAPIBase {
835
+ /**
836
+ * By ID
837
+ * GET - https://api.themoviedb.org/3/find/{external_id}
838
+ *
839
+ * Find movies, TV series, seasons, episodes, or people by an external ID.
840
+ *
841
+ * @param external_id External identifier to look up
842
+ * @param external_source Source namespace for the external ID
843
+ * @param language Language for localized results
844
+ * @reference https://developer.themoviedb.org/reference/find-by-id
845
+ */
846
+ async by_id(params) {
847
+ const { external_id, ...rest } = params;
848
+ const endpoint = `${ENDPOINTS.FIND}/${encodeURIComponent(external_id)}`;
849
+ const requestParams = this.withLanguage(rest);
850
+ return this.client.request(endpoint, requestParams);
851
+ }
852
+ };
853
+
854
+ // src/endpoints/genres.ts
855
+ var GenresAPI = class extends TMDBAPIBase {
856
+ /**
857
+ * Movie List
858
+ * GET - https://api.themoviedb.org/3/genre/movie/list
859
+ *
860
+ * Get the list of official genres for movies.
861
+ * @param language The language to use for the response.
862
+ * @returns A promise that resolves to the genres list.
863
+ * @reference https://developer.themoviedb.org/reference/genre-movie-list
864
+ */
865
+ async movie_list(params) {
866
+ return this.client.request(ENDPOINTS.GENRES.MOVIE_LIST, this.withLanguage(params));
867
+ }
868
+ /**
869
+ * TV List
870
+ * GET - https://api.themoviedb.org/3/genre/tv/list
871
+ *
872
+ * Get the list of official genres for TV shows.
873
+ * @param language The language to use for the response.
874
+ * @returns A promise that resolves to the genres list.
875
+ * @reference https://developer.themoviedb.org/reference/genre-tv-list
876
+ */
877
+ async tv_list(params) {
878
+ return this.client.request(ENDPOINTS.GENRES.TV_LIST, this.withLanguage(params));
879
+ }
880
+ };
881
+
882
+ // src/endpoints/keywords.ts
883
+ var KeywordsAPI = class extends TMDBAPIBase {
884
+ keywordPath(keyword_id) {
885
+ return `${ENDPOINTS.KEYWORDS.DETAILS}/${keyword_id}`;
886
+ }
887
+ /**
888
+ * Details
889
+ * GET - https://api.themoviedb.org/3/keyword/{keyword_id}
890
+ *
891
+ * Get the details of a keyword by ID.
892
+ *
893
+ * @param keyword_id Unique identifier for the keyword
894
+ * @reference https://developer.themoviedb.org/reference/keyword-details
895
+ */
896
+ async details(params) {
897
+ const endpoint = this.keywordPath(params.keyword_id);
898
+ return this.client.request(endpoint);
899
+ }
900
+ /**
901
+ * Movies
902
+ * GET - https://api.themoviedb.org/3/keyword/{keyword_id}/movies
903
+ *
904
+ * Get the movies associated with a keyword.
905
+ *
906
+ * @deprecated TMDB marks this endpoint as deprecated. Use discover/movie with_keywords instead.
907
+ * @param keyword_id Unique identifier for the keyword
908
+ * @param language Language for localized results
909
+ * @param page Page number for paginated results
910
+ * @param include_adult Include adult titles in results
911
+ * @reference https://developer.themoviedb.org/reference/keyword-movies
912
+ */
913
+ async movies(params) {
914
+ const { keyword_id, ...rest } = params;
915
+ const endpoint = `${this.keywordPath(keyword_id)}${ENDPOINTS.KEYWORDS.MOVIES}`;
916
+ const requestParams = this.withLanguage(rest);
917
+ return this.client.request(endpoint, requestParams);
918
+ }
919
+ };
920
+
921
+ // src/endpoints/movie_lists.ts
922
+ var MovieListsAPI = class extends TMDBAPIBase {
923
+ withDefaults(params) {
924
+ const { language = this.defaultOptions.language, region = this.defaultOptions.region, ...rest } = params;
925
+ return { language, region, ...rest };
926
+ }
927
+ /**
928
+ * Fetch Movie List Wrapper
929
+ * @param endpoint Endpoint to call
930
+ * @param params Params for the request (language, page, region, etc)
931
+ * @returns Specific to endpoint (MovieListResult)
932
+ */
933
+ fetch_movie_list(endpoint, params = {}) {
934
+ return this.client.request(ENDPOINTS.MOVIES.DETAILS + endpoint, this.withDefaults(params));
935
+ }
936
+ /**
937
+ * Now Playing
938
+ * GET - https://api.themoviedb.org/3/movie/now_playing
939
+ *
940
+ * Get a list of movies that are currently in theatres.
941
+ * @param language Language (Defaults to en-US or TMDB default)
942
+ * @param page Page (Defaults to 1)
943
+ * @param region ISO-3166-1 code
944
+ */
945
+ async now_playing(params = {}) {
946
+ return this.fetch_movie_list(ENDPOINTS.MOVIES.NOW_PLAYING, params);
947
+ }
948
+ /**
949
+ * Popular
950
+ * GET - https://api.themoviedb.org/3/movie/popular
951
+ *
952
+ * Get a list of movies ordered by popularity.
953
+ * @param language Language (Defaults to en-US or TMDB default)
954
+ * @param page Page (Defaults to 1)
955
+ * @param region ISO-3166-1 code
956
+ */
957
+ async popular(params = {}) {
958
+ return this.fetch_movie_list(ENDPOINTS.MOVIES.POPULAR, params);
959
+ }
960
+ /**
961
+ * Top Rated
962
+ * GET - https://api.themoviedb.org/3/movie/top_rated
963
+ *
964
+ * Get a list of movies ordered by rating.
965
+ * @param language Language (Defaults to en-US or TMDB default)
966
+ * @param page Page (Defaults to 1)
967
+ * @param region ISO-3166-1 code
968
+ */
969
+ async top_rated(params = {}) {
970
+ return this.fetch_movie_list(ENDPOINTS.MOVIES.TOP_RATED, params);
971
+ }
972
+ /**
973
+ * Upcoming
974
+ * GET - https://api.themoviedb.org/3/movie/upcoming
975
+ *
976
+ * Get a list of movies that are being released soon.
977
+ * @param language Language (Defaults to en-US or TMDB default)
978
+ * @param page Page (Defaults to 1)
979
+ * @param region ISO-3166-1 code
980
+ */
981
+ async upcoming(params = {}) {
982
+ return this.fetch_movie_list(ENDPOINTS.MOVIES.UPCOMING, params);
983
+ }
984
+ };
985
+
986
+ // src/endpoints/movies.ts
987
+ var MoviesAPI = class extends TMDBAPIBase {
988
+ moviePath(movie_id) {
989
+ return `${ENDPOINTS.MOVIES.DETAILS}/${movie_id}`;
990
+ }
991
+ movieSubPath(movie_id, route) {
992
+ return `${this.moviePath(movie_id)}${route}`;
993
+ }
994
+ /**
995
+ * Details
996
+ * GET - https://api.themoviedb.org/3/movie/{movie_id}
997
+ *
998
+ * Get the top level details of a movie by ID.
999
+ * @param movie_id The ID of the movie.
1000
+ * @param append_to_response A comma-separated list of the fields to include in the response.
1001
+ * @param language The language to use for the response.
1002
+ * @returns A promise that resolves to the movie details.
1003
+ * @reference https://developer.themoviedb.org/reference/movie-details
1004
+ */
1005
+ async details(params) {
1006
+ const { language = this.defaultOptions.language, movie_id, append_to_response } = params;
1007
+ const endpoint = this.moviePath(movie_id);
1008
+ return this.client.request(endpoint, { language, append_to_response });
1009
+ }
1010
+ /**
1011
+ * Alternative Titles
1012
+ * GET - https://api.themoviedb.org/3/movie/{movie_id}/alternative_titles
1013
+ *
1014
+ * Get the alternative titles for a movie (ex. Russian name, Indian names etc..).
1015
+ * @param movie_id The ID of the movie.
1016
+ * @param country The ISO 3166-1 code of the country to get alternative titles for.
1017
+ * @returns A promise that resolves to the movie alternative titles.
1018
+ * @reference https://developer.themoviedb.org/reference/movie-alternative-titles
1019
+ */
1020
+ async alternative_titles(params) {
1021
+ const { movie_id, ...rest } = params;
1022
+ const endpoint = this.movieSubPath(movie_id, ENDPOINTS.MOVIES.ALTERNATIVE_TITLES);
1023
+ return this.client.request(endpoint, rest);
1024
+ }
1025
+ /**
1026
+ * Credits
1027
+ * GET - https://api.themoviedb.org/3/movie/{movie_id}/credits
1028
+ *
1029
+ * Get the cast and crew members details for a movie.
1030
+ * @param movie_id The ID of the movie.
1031
+ * @param language The ISO 639-1 code of the language to use for the response. Default is "en-US".
1032
+ * @returns A promise that resolves to the movie credits.
1033
+ * @reference https://developer.themoviedb.org/reference/movie-credits
1034
+ */
1035
+ async credits(params) {
1036
+ const endpoint = this.movieSubPath(params.movie_id, ENDPOINTS.MOVIES.CREDITS);
1037
+ const { language = this.defaultOptions.language, ...rest } = params;
1038
+ return this.client.request(endpoint, { language, ...rest });
1039
+ }
1040
+ /**
1041
+ * External IDs
1042
+ * GET - https://api.themoviedb.org/3/movie/{movie_id}/external_ids
1043
+ *
1044
+ * Get the external IDs for a movie (ex. IMDB, Facebook, Instagram etc..).
1045
+ * Supported external IDs are: IMDB, Facebook, Instagram, Twitter, and Wikidata.
1046
+ *
1047
+ * @param movie_id The ID of the movie.
1048
+ * @returns A promise that resolves to the movie external IDs.
1049
+ * @reference https://developer.themoviedb.org/reference/movie-external-ids
1050
+ */
1051
+ async external_ids(params) {
1052
+ const endpoint = this.movieSubPath(params.movie_id, ENDPOINTS.MOVIES.EXTERNAL_IDS);
1053
+ return this.client.request(endpoint);
1054
+ }
1055
+ /**
1056
+ * Keywords
1057
+ * GET - https://api.themoviedb.org/3/movie/{movie_id}/keywords
1058
+ *
1059
+ * Get the keywords that have been added to a movie.
1060
+ * This is a list of keywords that have been added to the movie.
1061
+ * @param movie_id The ID of the movie.
1062
+ * @returns A promise that resolves to the movie keywords.
1063
+ * @reference https://developer.themoviedb.org/reference/movie-keywords
1064
+ */
1065
+ async keywords(params) {
1066
+ const endpoint = this.movieSubPath(params.movie_id, ENDPOINTS.MOVIES.KEYWORDS);
1067
+ return this.client.request(endpoint);
1068
+ }
1069
+ /**
1070
+ * Changes
1071
+ * GET - https://api.themoviedb.org/3/movie/{movie_id}/changes
1072
+ *
1073
+ * Get the changes for a movie. This is a list of all the changes that have been made to a movie.
1074
+ * By default, only the last 24 hours are returned.
1075
+ * You can query up to 14 days in a single query by using the start_date and end_date query parameters.
1076
+ * @param movie_id The ID of the movie.
1077
+ * @param page Page number of the results to return. Defaults to 1.
1078
+ * @param start_date Optional start date for the changes. Format: YYYY-MM-DD.
1079
+ * @param end_date Optional end date for the changes. Format: YYYY-MM-DD.
1080
+ * @returns A promise that resolves to the changes made to the movie.
1081
+ * @reference https://developer.themoviedb.org/reference/movie-changes
1082
+ */
1083
+ async changes(params) {
1084
+ const { movie_id, ...rest } = params;
1085
+ const endpoint = this.movieSubPath(movie_id, ENDPOINTS.MOVIES.CHANGES);
1086
+ return this.client.request(endpoint, rest);
1087
+ }
1088
+ /**
1089
+ * Images
1090
+ * GET - https://api.themoviedb.org/3/movie/{movie_id}/images
1091
+ *
1092
+ * Fetches images related to a specific movie, such as posters and backdrops.
1093
+ * The images are returned in various sizes and formats.
1094
+ *
1095
+ * 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.
1096
+ *
1097
+ * @param movie_id - The unique identifier of the movie.
1098
+ * @param language - (Optional) The language code to filter the images by language.
1099
+ * @param include_image_language - (Optional) A comma-separated list of language codes to include images for.
1100
+ * @returns A promise that resolves to a `MovieImages` object containing the movie's images.
1101
+ * @reference https://developer.themoviedb.org/reference/movie-images
1102
+ */
1103
+ async images(params) {
1104
+ const { language = this.defaultOptions.language, ...rest } = params;
1105
+ const endpoint = this.movieSubPath(params.movie_id, ENDPOINTS.MOVIES.IMAGES);
1106
+ return this.client.request(endpoint, { language, ...rest });
1107
+ }
1108
+ /**
1109
+ * Latest
1110
+ * GET - https://api.themoviedb.org/3/movie/latest
1111
+ *
1112
+ * Get the newest movie ID.
1113
+ * This is the most recent movie that has been added to TMDB. This is a live response will continuously change as new movies are added.
1114
+ * @returns A promise that resolves to the latest movie details.
1115
+ * @reference https://developer.themoviedb.org/reference/movie-latest-id
1116
+ */
1117
+ async latest() {
1118
+ const endpoint = `${ENDPOINTS.MOVIES.DETAILS}${ENDPOINTS.MOVIES.LATEST}`;
1119
+ return this.client.request(endpoint);
1120
+ }
1121
+ /**
1122
+ * Recommendations
1123
+ * GET - https://api.themoviedb.org/3/movie/{movie_id}/recommendations
1124
+ *
1125
+ * Get a list of recommended movies for a specific movie.
1126
+ * This is based on the movie's popularity and user ratings.
1127
+ * @param movie_id The ID of the movie.
1128
+ * @param page Page number of the results to return. Defaults to 1.
1129
+ * @param language Language code to filter the results. Default is "en-US".
1130
+ * @returns A promise that resolves to a paginated response of similar movies.
1131
+ * @reference https://developer.themoviedb.org/reference/movie-recommendations
1132
+ */
1133
+ async recommendations(params) {
1134
+ const { language = this.defaultOptions.language, ...rest } = params;
1135
+ const endpoint = this.movieSubPath(params.movie_id, ENDPOINTS.MOVIES.RECOMMENDATIONS);
1136
+ return this.client.request(endpoint, { language, ...rest });
1137
+ }
1138
+ /**
1139
+ * Release Dates
1140
+ * GET - https://api.themoviedb.org/3/movie/{movie_id}/release_dates
1141
+ *
1142
+ * Get the release dates and certifications for a movie. For different countries and release types.
1143
+ * The release types and statuses used on TMDB are the following:
1144
+ * - 1: Premiere
1145
+ * - 2: Theatrical (Limited)
1146
+ * - 3: Theatrical
1147
+ * - 4: Digital
1148
+ * - 5: Physical
1149
+ * - 6: TV
1150
+ * @param movie_id The ID of the movie.
1151
+ * @returns A promise that resolves to the release dates for the movie.
1152
+ * @reference https://developer.themoviedb.org/reference/movie-release-dates
1153
+ */
1154
+ async release_dates(params) {
1155
+ const endpoint = this.movieSubPath(params.movie_id, ENDPOINTS.MOVIES.RELEASE_DATES);
1156
+ return this.client.request(endpoint);
1157
+ }
1158
+ /**
1159
+ * Reviews
1160
+ * GET - https://api.themoviedb.org/3/movie/{movie_id}/reviews
1161
+ *
1162
+ * Get the user reviews for a movie.
1163
+ * @param movie_id The ID of the movie.
1164
+ * @param page Page number of the results to return. Defaults to 1.
1165
+ * @param language Language code to filter the results. Default is "en-US".
1166
+ * @returns A promise that resolves to a paginated response of movies reviews.
1167
+ * @reference https://developer.themoviedb.org/reference/movie-reviews
1168
+ */
1169
+ async reviews(params) {
1170
+ const { language = this.defaultOptions.language, ...rest } = params;
1171
+ const endpoint = this.movieSubPath(params.movie_id, ENDPOINTS.MOVIES.REVIEWS);
1172
+ return this.client.request(endpoint, { language, ...rest });
1173
+ }
1174
+ /**
1175
+ * Similar
1176
+ * GET -https://api.themoviedb.org/3/movie/{movie_id}/similar
1177
+ *
1178
+ * Get the similar movies based on genres and keywords.
1179
+ * This method only looks for other items based on genres and plot keywords.
1180
+ * As such, the results found here are not always going to be 💯. Use it with that in mind.
1181
+ * @param movie_id The ID of the movie
1182
+ * @param page Page number of the results to return. Defaults to 1.
1183
+ * @param language Language code to filter the results. Default is "en-US".
1184
+ * @returns A promise that resolves to a paginated response of similar movies.
1185
+ * @reference https://developer.themoviedb.org/reference/movie-similar
1186
+ */
1187
+ async similar(params) {
1188
+ const { language = this.defaultOptions.language, ...rest } = params;
1189
+ const endpoint = this.movieSubPath(params.movie_id, ENDPOINTS.MOVIES.SIMILAR);
1190
+ return this.client.request(endpoint, { language, ...rest });
1191
+ }
1192
+ /**
1193
+ * Translations
1194
+ * GET - https://api.themoviedb.org/3/movie/{movie_id}/translations
1195
+ *
1196
+ * Get the translations for a movie.
1197
+ * Take a read through our language documentation for more information about languages on TMDB.
1198
+ * https://developer.themoviedb.org/docs/languages
1199
+ * @param movie_id The ID of the movie
1200
+ * @returns A promise that resolves to the translations of the movie.
1201
+ * @reference https://developer.themoviedb.org/reference/movie-translations
1202
+ */
1203
+ async translations(params) {
1204
+ const endpoint = this.movieSubPath(params.movie_id, ENDPOINTS.MOVIES.TRANSLATIONS);
1205
+ return this.client.request(endpoint);
1206
+ }
1207
+ /**
1208
+ * Videos
1209
+ * GET - https://api.themoviedb.org/3/movie/{movie_id}/videos
1210
+ *
1211
+ * Get the available videos for a movie.
1212
+ * @param movie_id The ID of the movie
1213
+ * @returns A promise that resolves to a list of videos for the movie.
1214
+ * @reference https://developer.themoviedb.org/reference/movie-videos
1215
+ */
1216
+ async videos(params) {
1217
+ const { language = this.defaultOptions.language, ...rest } = params;
1218
+ const endpoint = this.movieSubPath(params.movie_id, ENDPOINTS.MOVIES.VIDEOS);
1219
+ return this.client.request(endpoint, { language, ...rest });
1220
+ }
1221
+ /**
1222
+ * Watch Providers
1223
+ * GET - https://api.themoviedb.org/3/movie/{movie_id}/watch/providers
1224
+ *
1225
+ * Get the list of streaming providers we have for a movie.
1226
+ * Powered by our partnership with JustWatch, you can query this method to get a list of the streaming/rental/purchase availabilities per country by provider.
1227
+ * This is not going to return full deep links, but rather, it's just enough information to display what's available where.
1228
+ * You can link to the provided TMDB URL to help support TMDB and provide the actual deep links to the content.
1229
+ *
1230
+ * JustWatch ATTRIBUTION REQUIRED
1231
+ * In order to use this data you must attribute the source of the data as JustWatch.
1232
+ * If we find any usage not complying with these terms we will revoke access to the API.
1233
+ * @param movie_id The ID of the movie
1234
+ * @returns A promise that resolves to a list of videos for the movie.
1235
+ * @reference https://developer.themoviedb.org/reference/movie-videos
1236
+ */
1237
+ async watch_providers(params) {
1238
+ const endpoint = this.movieSubPath(params.movie_id, ENDPOINTS.MOVIES.WATCH_PROVIDERS);
1239
+ return this.client.request(endpoint);
1240
+ }
1241
+ };
1242
+
1243
+ // src/endpoints/search.ts
1244
+ var SearchAPI = class extends TMDBAPIBase {
1245
+ /**
1246
+ * Search Collection
1247
+ * GET - https://api.themoviedb.org/3/search/collection
1248
+ *
1249
+ * Search for collections by their original, translated and alternative names.
1250
+ * @param query Search query (required)
1251
+ * @param include_adult Include Adult (Defaults to false)
1252
+ * @param language Language (Defaults to en-US)
1253
+ * @param page Page (Defaults to 1)
1254
+ * @param region Region
1255
+ * @reference https://developer.themoviedb.org/reference/search-collection
1256
+ */
1257
+ async collections(params) {
1258
+ return this.client.request(ENDPOINTS.SEARCH.COLLECTION, this.applyDefaults(params));
1259
+ }
1260
+ /**
1261
+ * Search Movies
1262
+ * GET - https://api.themoviedb.org/3/search/movie
1263
+ *
1264
+ * Search for movies by their original, translated and alternative titles.
1265
+ * @param query Search query (required)
1266
+ * @param include_adult Include Adult (Defaults to false)
1267
+ * @param language Language (Defaults to en-US)
1268
+ * @param primary_release_year: string
1269
+ * @param page Page (Defaults to 1)
1270
+ * @param region Region
1271
+ * @param year Year
1272
+ * @reference https://developer.themoviedb.org/reference/search-movie
1273
+ */
1274
+ async movies(params) {
1275
+ return this.client.request(ENDPOINTS.SEARCH.MOVIE, this.applyDefaults(params));
1276
+ }
1277
+ /**
1278
+ * Search Company
1279
+ * GET - https://api.themoviedb.org/3/search/company
1280
+ *
1281
+ * Search for companies by their original and alternative names.
1282
+ * @param query Search query (required)
1283
+ * @param page Page (Defaults to 1)
1284
+ * @reference https://developer.themoviedb.org/reference/search-company
1285
+ */
1286
+ async company(params) {
1287
+ return this.client.request(ENDPOINTS.SEARCH.COMPANY, this.applyDefaults(params));
1288
+ }
1289
+ /**
1290
+ * Search Keyword
1291
+ * GET - https://api.themoviedb.org/3/search/keyword
1292
+ *
1293
+ * Search for keywords by their name.
1294
+ * @param query Search query (required)
1295
+ * @param page Page (Defaults to 1)
1296
+ * @reference https://developer.themoviedb.org/reference/search-keyword
1297
+ */
1298
+ async keyword(params) {
1299
+ return this.client.request(ENDPOINTS.SEARCH.KEYWORD, this.applyDefaults(params));
1300
+ }
1301
+ /**
1302
+ * Search Person
1303
+ * GET - https://api.themoviedb.org/3/search/person
1304
+ *
1305
+ * Search for people by their name and also known as names.
1306
+ * @param query Search query (required)
1307
+ * @param page Page (Defaults to 1)
1308
+ * @reference https://developer.themoviedb.org/reference/search-person
1309
+ */
1310
+ async person(params) {
1311
+ return this.client.request(ENDPOINTS.SEARCH.PERSON, this.applyDefaults(params));
1312
+ }
1313
+ /**
1314
+ * Search TV Series
1315
+ * GET - https://api.themoviedb.org/3/search/tv
1316
+ *
1317
+ * Search for TV shows by their original, translated and also known as names.
1318
+ * @param query Search query (required)
1319
+ * @param include_adult Include Adult (Defaults to false)
1320
+ * @param language Language (Defaults to en-US)
1321
+ * @param page Page (Defaults to 1)
1322
+ * @param first_air_date_year Filter by first air date year
1323
+ * @param year Filter by any air date year (including episodes)
1324
+ * @reference https://developer.themoviedb.org/reference/search-tv
1325
+ */
1326
+ async tv_series(params) {
1327
+ return this.client.request(ENDPOINTS.SEARCH.TV, this.applyDefaults(params));
1328
+ }
1329
+ /**
1330
+ * Search Multi
1331
+ * GET - https://api.themoviedb.org/3/search/multi
1332
+ *
1333
+ * Search for movies, TV shows, and people in a single request.
1334
+ * @param query Search query (required)
1335
+ * @param include_adult Include Adult (Defaults to false)
1336
+ * @param language Language (Defaults to en-US)
1337
+ * @param page Page (Defaults to 1)
1338
+ * @reference https://developer.themoviedb.org/reference/search-multi
1339
+ */
1340
+ async multi(params) {
1341
+ return this.client.request(ENDPOINTS.SEARCH.MULTI, this.applyDefaults(params));
1342
+ }
1343
+ };
1344
+
1345
+ // src/endpoints/tv_series.ts
1346
+ var TVSeriesAPI = class extends TMDBAPIBase {
1347
+ seriesPath(series_id) {
1348
+ return `${ENDPOINTS.TV_SERIES.DETAILS}/${series_id}`;
1349
+ }
1350
+ seriesSubPath(series_id, route) {
1351
+ return `${this.seriesPath(series_id)}${route}`;
1352
+ }
1353
+ /**
1354
+ * Details
1355
+ * GET - https://api.themoviedb.org/3/tv/{series_id}
1356
+ *
1357
+ * Get the top level details of a TV series by ID.
1358
+ * @param series_id The ID of the TV series.
1359
+ * @param append_to_response A comma-separated list of the fields to include in the response.
1360
+ * @param language The language to use for the response.
1361
+ * @returns A promise that resolves to the TV series details.
1362
+ * @reference https://developer.themoviedb.org/reference/tv-series-details
1363
+ */
1364
+ async details(params) {
1365
+ const { language = this.defaultOptions.language, series_id, ...rest } = params;
1366
+ const endpoint = this.seriesPath(series_id);
1367
+ return this.client.request(endpoint, { language, ...rest });
1368
+ }
1369
+ /**
1370
+ * Aggregate Credits
1371
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/aggregate_credits
1372
+ *
1373
+ * Get the aggregate credits (cast and crew) that have been added to a TV show.
1374
+ *
1375
+ * NOTE: This call differs from the main credits call in that it does not return the newest season.
1376
+ * Instead, it is a view of all the entire cast & crew for all episodes belonging to a TV show.
1377
+ * @param series_id The ID of the TV series.
1378
+ * @param language The language to use for the response.
1379
+ * @returns A promise that resolves to the TV series aggregate credits.
1380
+ * @reference https://developer.themoviedb.org/reference/tv-series-aggregate-credits
1381
+ */
1382
+ async aggregate_credits(params) {
1383
+ const { language = this.defaultOptions.language, series_id, ...rest } = params;
1384
+ const endpoint = this.seriesSubPath(series_id, ENDPOINTS.TV_SERIES.AGGREGATE_CREDITS);
1385
+ return this.client.request(endpoint, { language, ...rest });
1386
+ }
1387
+ /**
1388
+ * Alternative Titles
1389
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/alternative_tiles
1390
+ *
1391
+ * Get the alternative titles that have been added to a TV show.
1392
+ * @param series_id The ID of the TV series.
1393
+ * @returns A promise that resolves to the TV series alternative tiles.
1394
+ * @reference https://developer.themoviedb.org/reference/tv-series-alternative-titles
1395
+ */
1396
+ async alternative_titles(params) {
1397
+ const endpoint = this.seriesSubPath(params.series_id, ENDPOINTS.TV_SERIES.ALTERNATIVE_TITLES);
1398
+ return this.client.request(endpoint);
1399
+ }
1400
+ /**
1401
+ * Changes
1402
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/changes
1403
+ *
1404
+ * Get the changes for a TV show. By default only the last 24 hours are returned.
1405
+ * You can query up to 14 days in a single query by using the start_date and end_date query parameters.
1406
+ *
1407
+ * NOTE: TV show changes are a little different than movie changes in that there are some edits
1408
+ * on seasons and episodes that will create a top level change entry at the show level.
1409
+ * These can be found under the season and episode keys.
1410
+ * These keys will contain a series_id and episode_id.
1411
+ * You can use the season changes and episode changes methods to look these up individually.
1412
+ *
1413
+ * @param series_id The ID of the TV series.
1414
+ * @returns A promise that resolves to the TV series changes history.
1415
+ * @reference https://developer.themoviedb.org/reference/tv-series-changes
1416
+ */
1417
+ async changes(params) {
1418
+ const { series_id, ...rest } = params;
1419
+ const endpoint = this.seriesSubPath(series_id, ENDPOINTS.TV_SERIES.CHANGES);
1420
+ return this.client.request(endpoint, { ...rest });
1421
+ }
1422
+ /**
1423
+ * Content Ratings
1424
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/content_ratings
1425
+ *
1426
+ * Get the content ratings that have been added to a TV show.
1427
+ * @param series_id The ID of the TV series.
1428
+ * @returns A promise that resolves to the TV series content ratings.
1429
+ * @reference https://developer.themoviedb.org/reference/tv-series-content-ratings
1430
+ */
1431
+ async content_ratings(params) {
1432
+ const endpoint = this.seriesSubPath(params.series_id, ENDPOINTS.TV_SERIES.CONTENT_RATINGS);
1433
+ return this.client.request(endpoint);
1434
+ }
1435
+ /**
1436
+ * Credits
1437
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/credits
1438
+ *
1439
+ * Get the latest season credits of a TV show.
1440
+ *
1441
+ * This is the original TV credits method which returns the latest season credit data.
1442
+ * If you would like to request the aggregate view (which is what you see on our website)
1443
+ * you should use the /aggregate_credits method.
1444
+ * @param series_id The ID of the TV series.
1445
+ * @param language The Language for the credits
1446
+ * @returns A promise that resolves to the TV series credits.
1447
+ * @reference https://developer.themoviedb.org/reference/tv-series-credits
1448
+ */
1449
+ async credits(params) {
1450
+ const { language = this.defaultOptions.language, series_id, ...rest } = params;
1451
+ const endpoint = this.seriesSubPath(series_id, ENDPOINTS.TV_SERIES.CREDITS);
1452
+ return this.client.request(endpoint, { language, ...rest });
1453
+ }
1454
+ /**
1455
+ * Episode Groups
1456
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/episode_groups
1457
+ *
1458
+ * Get the episode groups that have been added to a TV show.
1459
+ * With a group ID you can call the get TV episode group details method.
1460
+ * @param series_id The ID of the TV series.
1461
+ * @returns A promise that resolves to the TV series episode groups.
1462
+ * @reference https://developer.themoviedb.org/reference/tv-series-episode-groups
1463
+ */
1464
+ async episode_groups(params) {
1465
+ const endpoint = this.seriesSubPath(params.series_id, ENDPOINTS.TV_SERIES.EPISODE_GROUPS);
1466
+ return this.client.request(endpoint);
1467
+ }
1468
+ /**
1469
+ * External IDs
1470
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/external_ids
1471
+ *
1472
+ * Get a list of external IDs that have been added to a TV show.
1473
+ * @param series_id The ID of the TV series.
1474
+ * @returns A promise that resolves to the TV series external ids.
1475
+ * @reference https://developer.themoviedb.org/reference/tv-series-external-ids
1476
+ */
1477
+ async external_ids(params) {
1478
+ const endpoint = this.seriesSubPath(params.series_id, ENDPOINTS.TV_SERIES.EXTERNAL_IDS);
1479
+ return this.client.request(endpoint);
1480
+ }
1481
+ /**
1482
+ * Images
1483
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/images
1484
+ *
1485
+ * Fetches images related to a specific tv show, such as posters and backdrops.
1486
+ * The images are returned in various sizes and formats.
1487
+ *
1488
+ * 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.
1489
+ *
1490
+ * @param series_id - The unique identifier of the tv show.
1491
+ * @param language - (Optional) The language code to filter the images by language.
1492
+ * @param include_image_language - (Optional) A comma-separated list of language codes to include images for.
1493
+ * @returns A promise that resolves to a `TVImages` object containing the tv show's images.
1494
+ * @reference https://developer.themoviedb.org/reference/tv-series-images
1495
+ */
1496
+ async images(params) {
1497
+ const { language = this.defaultOptions.language, series_id, ...rest } = params;
1498
+ const endpoint = this.seriesSubPath(series_id, ENDPOINTS.TV_SERIES.IMAGES);
1499
+ return this.client.request(endpoint, { language, ...rest });
1500
+ }
1501
+ /**
1502
+ * Keywords
1503
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/keywords
1504
+ *
1505
+ * Get a list of keywords that have been added to a TV show.
1506
+ * @param series_id The ID of the TV series.
1507
+ * @returns A promise that resolves to the TV series keywords.
1508
+ * @reference https://developer.themoviedb.org/reference/tv-series-keywords
1509
+ */
1510
+ async keywords(params) {
1511
+ const endpoint = this.seriesSubPath(params.series_id, ENDPOINTS.TV_SERIES.KEYWORDS);
1512
+ return this.client.request(endpoint);
1513
+ }
1514
+ /**
1515
+ * Latest
1516
+ * GET - https://api.themoviedb.org/3/tv/latest
1517
+ *
1518
+ * Get the newest tv show.
1519
+ * This is a live response and will continuosly change.
1520
+ * @returns A promise that resolves to the lastest TV series.
1521
+ * @reference https://developer.themoviedb.org/reference/tv-series-latest-id
1522
+ */
1523
+ async latest() {
1524
+ const endpoint = `${ENDPOINTS.TV_SERIES.DETAILS}${ENDPOINTS.TV_SERIES.LATEST}`;
1525
+ return this.client.request(endpoint);
1526
+ }
1527
+ /**
1528
+ * Lists
1529
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/lists
1530
+ *
1531
+ * Get the lists that a TV series has been added to.
1532
+ * @param series_id The ID of the TV series.
1533
+ * @param language The Language for the lists
1534
+ * @param page Page number - Defaults to 1
1535
+ * @returns A promise that resolves to the TV series lists.
1536
+ * @reference https://developer.themoviedb.org/reference/lists-copy (TODO: Check this url for updates, it's like this on TMDB docs (??))
1537
+ */
1538
+ async lists(params) {
1539
+ const { language = this.defaultOptions.language, series_id, ...rest } = params;
1540
+ const endpoint = this.seriesSubPath(series_id, ENDPOINTS.TV_SERIES.LISTS);
1541
+ return this.client.request(endpoint, { language, ...rest });
1542
+ }
1543
+ /**
1544
+ * Recomendations
1545
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/recommendations
1546
+ *
1547
+ * Get the recommendations shows for a TV series.
1548
+ * @param series_id The ID of the TV series.
1549
+ * @param language The Language for the lists
1550
+ * @param page Page number - Defaults to 1
1551
+ * @returns A promise that resolves to TV series recommended shows.
1552
+ * @reference https://developer.themoviedb.org/reference/tv-series-recommendations
1553
+ */
1554
+ async recommendations(params) {
1555
+ const { language = this.defaultOptions.language, series_id, ...rest } = params;
1556
+ const endpoint = this.seriesSubPath(series_id, ENDPOINTS.TV_SERIES.RECOMMENDATIONS);
1557
+ return this.client.request(endpoint, { language, ...rest });
1558
+ }
1559
+ /**
1560
+ * Reviews
1561
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/reviews
1562
+ *
1563
+ * Get the reviews that have been added to a TV show.
1564
+ * @param series_id The ID of the TV series.
1565
+ * @param language The Language for the lists
1566
+ * @param page Page number - Defaults to 1
1567
+ * @returns A promise that resolves to TV series recommended shows.
1568
+ * @reference https://developer.themoviedb.org/reference/tv-series-recommendations
1569
+ */
1570
+ async reviews(params) {
1571
+ const { language = this.defaultOptions.language, series_id, ...rest } = params;
1572
+ const endpoint = this.seriesSubPath(series_id, ENDPOINTS.TV_SERIES.REVIEWS);
1573
+ return this.client.request(endpoint, { language, ...rest });
1574
+ }
1575
+ /**
1576
+ * Sreened Theatrically
1577
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/screened_theatrically
1578
+ *
1579
+ * Get the seasons and episodes that have screened theatrically.
1580
+ * @param series_id The ID of the TV series.
1581
+ * @returns A promise that resolves to the TV episodes that have been screened thatrically.
1582
+ * @reference https://developer.themoviedb.org/reference/tv-series-screened-theatrically
1583
+ */
1584
+ async screened_theatrically(params) {
1585
+ const endpoint = this.seriesSubPath(params.series_id, ENDPOINTS.TV_SERIES.SCREENED_THEATRICALLY);
1586
+ return this.client.request(endpoint);
1587
+ }
1588
+ /**
1589
+ * Similar
1590
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/similar
1591
+ *
1592
+ * Get the similar shows for a TV series.
1593
+ * @param series_id The ID of the TV series.
1594
+ * @param language The Language for the lists
1595
+ * @param page Page number - Defaults to 1
1596
+ * @returns A promise that resolves to TV series similar shows.
1597
+ * @reference https://developer.themoviedb.org/reference/tv-series-similar
1598
+ */
1599
+ async similar(params) {
1600
+ const { language = this.defaultOptions.language, series_id, ...rest } = params;
1601
+ const endpoint = this.seriesSubPath(series_id, ENDPOINTS.TV_SERIES.SIMILAR);
1602
+ return this.client.request(endpoint, { language, ...rest });
1603
+ }
1604
+ /**
1605
+ * Translations
1606
+ * GET - https://api.themoviedb.org/3/movie/{series_id}/translations
1607
+ *
1608
+ * Get the translations that have been added to a tv show.
1609
+ * Take a read through our language documentation for more information about languages on TMDB.
1610
+ * https://developer.themoviedb.org/docs/languages
1611
+ * @param series_id The ID of the TV Series
1612
+ * @returns A promise that resolves to the translations of the tv show.
1613
+ * @reference https://developer.themoviedb.org/reference/tv-series-translations
1614
+ */
1615
+ async translations(params) {
1616
+ const endpoint = this.seriesSubPath(params.series_id, ENDPOINTS.TV_SERIES.TRANSLATIONS);
1617
+ return this.client.request(endpoint);
1618
+ }
1619
+ /**
1620
+ * Videos
1621
+ * GET - https://api.themoviedb.org/3/movie/{series_id}/videos
1622
+ *
1623
+ * Get the videos that belong to a TV show.
1624
+ * @param series_id The ID of the TV Series
1625
+ * @returns A promise that resolves to the videos for the tv show.
1626
+ * @reference https://developer.themoviedb.org/reference/tv-series-videos
1627
+ */
1628
+ async videos(params) {
1629
+ const endpoint = this.seriesSubPath(params.series_id, ENDPOINTS.TV_SERIES.VIDEOS);
1630
+ return this.client.request(endpoint);
1631
+ }
1632
+ /**
1633
+ * Watch Providers
1634
+ * GET - https://api.themoviedb.org/3/movie/{series_id}/watch/providers
1635
+ *
1636
+ * Get the list of streaming providers we have for a TV show.
1637
+ *
1638
+ * Powered by our partnership with JustWatch, you can query this method to get a list of the streaming/rental/purchase availabilities per country by provider.
1639
+ * This is not going to return full deep links, but rather, it's just enough information to display what's available where.
1640
+ * You can link to the provided TMDB URL to help support TMDB and provide the actual deep links to the content.
1641
+ *
1642
+ * WARNING: JustWatch Attribution Required
1643
+ * In order to use this data you must attribute the source of the data as JustWatch.
1644
+ * If we find any usage not complying with these terms we will revoke access to the API.
1645
+ *
1646
+ * @param series_id The ID of the TV Series
1647
+ * @returns A promise that resolves to the watch providers for the tv show.
1648
+ * @reference https://developer.themoviedb.org/reference/tv-series-watch-providers
1649
+ */
1650
+ async watch_providers(params) {
1651
+ const endpoint = this.seriesSubPath(params.series_id, ENDPOINTS.TV_SERIES.WATCH_PROVIDERS);
1652
+ return this.client.request(endpoint);
1653
+ }
1654
+ };
1655
+
1656
+ // src/endpoints/tv_series_lists.ts
1657
+ var TVSeriesListsAPI = class extends TMDBAPIBase {
1658
+ withDefaults(params) {
1659
+ const { language = this.defaultOptions.language, timezone = this.defaultOptions.timezone, ...rest } = params;
1660
+ return { language, timezone, ...rest };
1661
+ }
1662
+ /**
1663
+ * Fetch TVSeries List Wrapper
1664
+ * @param endpoint Endpoint to call
1665
+ * @param params Params for the request
1666
+ * @returns PaginatedResponse of TVSeriesResultItem
1667
+ */
1668
+ fetch_tv_series_list(endpoint, params = {}) {
1669
+ return this.client.request(
1670
+ ENDPOINTS.TV_SERIES.DETAILS + endpoint,
1671
+ this.withDefaults(params)
1672
+ );
1673
+ }
1674
+ /**
1675
+ * Airing Today
1676
+ * GET - https://api.themoviedb.org/3/tv/airing_today
1677
+ *
1678
+ * Get a list of TV shows airing today.
1679
+ * @param language Language (Defaults to en-US or TMDB default)
1680
+ * @param page Page (Defaults to 1)
1681
+ * @param timezone Timezone for the "today"
1682
+ */
1683
+ async airing_today(params = {}) {
1684
+ return this.fetch_tv_series_list(ENDPOINTS.TV_SERIES.AIRING_TODAY, params);
1685
+ }
1686
+ /**
1687
+ * On The Air
1688
+ * GET - https://api.themoviedb.org/3/tv/on_the_air
1689
+ *
1690
+ * Get a list of TV shows that air in the next 7 days.
1691
+ * @param language Language (Defaults to en-US or TMDB default)
1692
+ * @param page Page (Defaults to 1)
1693
+ * @param timezone Timezone for the "today"
1694
+ */
1695
+ async on_the_air(params = {}) {
1696
+ return this.fetch_tv_series_list(ENDPOINTS.TV_SERIES.ON_THE_AIR, params);
1697
+ }
1698
+ /**
1699
+ * Popular
1700
+ * GET - https://api.themoviedb.org/3/tv/popular
1701
+ *
1702
+ * Get a list of TV shows ordered by popularity.
1703
+ * @param language Language (Defaults to en-US or TMDB default)
1704
+ * @param page Page (Defaults to 1)
1705
+ */
1706
+ async popular(params = {}) {
1707
+ return this.fetch_tv_series_list(ENDPOINTS.TV_SERIES.POPULAR, params);
1708
+ }
1709
+ /**
1710
+ * Top Rated
1711
+ * GET - https://api.themoviedb.org/3/tv/top_rated
1712
+ *
1713
+ * Get a list of movies ordered by rating.
1714
+ * @param language Language (Defaults to en-US or TMDB default)
1715
+ * @param page Page (Defaults to 1)
1716
+ */
1717
+ async top_rated(params = {}) {
1718
+ return this.fetch_tv_series_list(ENDPOINTS.TV_SERIES.TOP_RATED, params);
1719
+ }
1720
+ };
1721
+
1722
+ // src/endpoints/watch_providers.ts
1723
+ var WatchProvidersAPI = class extends TMDBAPIBase {
1724
+ /**
1725
+ * Movie Providers
1726
+ * GET - https://api.themoviedb.org/3/watch/providers/movie
1727
+ *
1728
+ * Get the list of movie watch providers supported by TMDB.
1729
+ *
1730
+ * @param language Language used for localized provider names
1731
+ * @reference https://developer.themoviedb.org/reference/watch-provider-movie-list
1732
+ */
1733
+ async movie_providers(params) {
1734
+ const language = params?.language ?? this.defaultOptions.language;
1735
+ const requestParams = language === void 0 ? params : { ...params, language };
1736
+ return this.client.request(ENDPOINTS.WATCH_PROVIDERS.MOVIE, requestParams);
1737
+ }
1738
+ /**
1739
+ * TV Providers
1740
+ * GET - https://api.themoviedb.org/3/watch/providers/tv
1741
+ *
1742
+ * Get the list of TV watch providers supported by TMDB.
1743
+ *
1744
+ * @param language Language used for localized provider names
1745
+ * @reference https://developer.themoviedb.org/reference/watch-provider-tv-list
1746
+ */
1747
+ async tv_providers(params) {
1748
+ const language = params?.language ?? this.defaultOptions.language;
1749
+ const requestParams = language === void 0 ? params : { ...params, language };
1750
+ return this.client.request(ENDPOINTS.WATCH_PROVIDERS.TV, requestParams);
1751
+ }
1752
+ /**
1753
+ * Available Regions
1754
+ * GET - https://api.themoviedb.org/3/watch/providers/regions
1755
+ *
1756
+ * Get the list of regions with watch provider support.
1757
+ *
1758
+ * @param language Language used for localized region names
1759
+ * @reference https://developer.themoviedb.org/reference/watch-providers-available-regions
1760
+ */
1761
+ async available_regions(params) {
1762
+ const language = params?.language ?? this.defaultOptions.language;
1763
+ const requestParams = language === void 0 ? params : { ...params, language };
1764
+ return this.client.request(ENDPOINTS.WATCH_PROVIDERS.REGIONS, requestParams);
1765
+ }
1766
+ };
1767
+
1768
+ // src/errors/messages.ts
1769
+ var Errors = {
1770
+ NO_ACCESS_TOKEN: "TMDB requires a valid access token, please provide one."
1771
+ };
1772
+
1773
+ // src/types/config/images.ts
1774
+ var IMAGE_BASE_URL = "http://image.tmdb.org/t/p/";
1775
+ var IMAGE_SECURE_BASE_URL = "https://image.tmdb.org/t/p/";
1776
+ var BACKDROP_SIZES = ["w300", "w780", "w1280", "original"];
1777
+ var LOGO_SIZES = ["w45", "w92", "w154", "w185", "w300", "w500", "original"];
1778
+ var POSTER_SIZES = ["w92", "w154", "w185", "w342", "w500", "w780", "original"];
1779
+ var PROFILE_SIZES = ["w45", "w185", "h632", "original"];
1780
+ var STILL_SIZES = ["w92", "w185", "w300", "original"];
1781
+
1782
+ // src/images/images.ts
1783
+ var ImageAPI = class {
1784
+ options;
1785
+ constructor(options = {}) {
1786
+ this.options = { secure_images_url: true, ...options };
1787
+ }
1788
+ buildUrl(path, size) {
1789
+ const baseUrl = this.options.secure_images_url ? IMAGE_SECURE_BASE_URL : IMAGE_BASE_URL;
1790
+ return `${baseUrl}${size}${path}`;
1791
+ }
1792
+ backdrop(path, size = this.options.default_image_sizes?.backdrops || "w780") {
1793
+ return this.buildUrl(path, size);
1794
+ }
1795
+ logo(path, size = this.options.default_image_sizes?.logos || "w185") {
1796
+ return this.buildUrl(path, size);
1797
+ }
1798
+ poster(path, size = this.options.default_image_sizes?.posters || "w500") {
1799
+ return this.buildUrl(path, size);
1800
+ }
1801
+ profile(path, size = this.options.default_image_sizes?.profiles || "w185") {
1802
+ return this.buildUrl(path, size);
1803
+ }
1804
+ still(path, size = this.options.default_image_sizes?.still || "w300") {
1805
+ return this.buildUrl(path, size);
1806
+ }
1807
+ };
1808
+
1809
+ // src/endpoints/networks.ts
1810
+ var NetworksAPI = class extends TMDBAPIBase {
1811
+ networkPath(network_id) {
1812
+ return `${ENDPOINTS.NETWORKS.DETAILS}/${network_id}`;
1813
+ }
1814
+ /**
1815
+ * Details
1816
+ * GET - https://api.themoviedb.org/3/network/{network_id}
1817
+ *
1818
+ * Get the network details by ID.
1819
+ *
1820
+ * @param network_id Unique identifier for the network
1821
+ * @reference https://developer.themoviedb.org/reference/network-details
1822
+ */
1823
+ async details(params) {
1824
+ const endpoint = this.networkPath(params.network_id);
1825
+ return this.client.request(endpoint);
1826
+ }
1827
+ /**
1828
+ * Alternative names
1829
+ * GET - https://api.themoviedb.org/3/network/{network_id}/alternative_names
1830
+ *
1831
+ * Get the list of alternative names for a network.
1832
+ *
1833
+ * @param network_id Unique identifier for the network
1834
+ * @reference https://developer.themoviedb.org/reference/network-alternative-names
1835
+ */
1836
+ async alternative_names(params) {
1837
+ const endpoint = `${this.networkPath(params.network_id)}${ENDPOINTS.NETWORKS.ALTERNATIVE_NAMES}`;
1838
+ return this.client.request(endpoint);
1839
+ }
1840
+ /**
1841
+ * Images
1842
+ * GET - https://api.themoviedb.org/3/network/{network_id}/images
1843
+ *
1844
+ * Get the logos for a network by ID.
1845
+ *
1846
+ * @param network_id Unique identifier for the network
1847
+ * @reference https://developer.themoviedb.org/reference/network-images
1848
+ */
1849
+ async images(params) {
1850
+ const endpoint = `${this.networkPath(params.network_id)}${ENDPOINTS.NETWORKS.IMAGES}`;
1851
+ return this.client.request(endpoint);
1852
+ }
1853
+ };
1854
+
1855
+ // src/endpoints/tv_episodes.ts
1856
+ var TVEpisodesAPI = class extends TMDBAPIBase {
1857
+ episodePath(params) {
1858
+ return `${ENDPOINTS.TV_SERIES.DETAILS}/${params.series_id}${ENDPOINTS.TV_SEASONS.DETAILS}/${params.season_number}${ENDPOINTS.TV_EPISODES.DETAILS}/${params.episode_number}`;
1859
+ }
1860
+ episodeSubPath(params, route) {
1861
+ return `${this.episodePath(params)}${route}`;
1862
+ }
1863
+ /**
1864
+ * Details
1865
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/season/{season_number}/episode/{episode_number}
1866
+ *
1867
+ * Query the details of a TV episode.
1868
+ * @param series_id The ID of the TV series.
1869
+ * @param season_number The number of the season within the TV show
1870
+ * @param episode_number The number of the episode within the season
1871
+ * @param append_to_response A comma-separated list of the fields to include in the response.
1872
+ * @param language The language to use for the response.
1873
+ * @returns A promise that resolves to the TV episode .
1874
+ * @reference https://developer.themoviedb.org/reference/tv-episode-details
1875
+ */
1876
+ async details(params) {
1877
+ const { language = this.defaultOptions.language, append_to_response, ...rest } = params;
1878
+ const endpoint = this.episodePath(rest);
1879
+ return this.client.request(endpoint, { language, append_to_response });
1880
+ }
1881
+ /**
1882
+ * Changes
1883
+ * GET - https://api.themoviedb.org/3/tv/episode/{episode_id}/changes
1884
+ *
1885
+ * Get the changes for a TV episode. By default only the last 24 hours are returned.
1886
+ * ACCORDING TO TMDB DOCS:
1887
+ * You can query up to 14 days in a single query by using the start_date and end_date query parameters.
1888
+ * BUT NO start_date or end_date query params are specified in the documentation
1889
+ *
1890
+ * NOTE: TV show changes are a little different than movie changes in that there are some edits
1891
+ * on seasons and episodes that will create a top level change entry at the show level.
1892
+ * These can be found under the season and episode keys.
1893
+ * These keys will contain a series_id and episode_id.
1894
+ * You can use the season changes and episode changes methods to look these up individually.
1895
+ *
1896
+ * @param episode_id The ID of the TV episode.
1897
+ * @returns A promise that resolves to the TV episode changes history.
1898
+ * @reference https://developer.themoviedb.org/reference/tv-episode-changes-by-id
1899
+ */
1900
+ async changes(params) {
1901
+ const endpoint = `${ENDPOINTS.TV_SERIES.DETAILS}${ENDPOINTS.TV_EPISODES.DETAILS}/${params.episode_id}${ENDPOINTS.TV_EPISODES.CHANGES}`;
1902
+ return this.client.request(endpoint);
1903
+ }
1904
+ /**
1905
+ * Credits
1906
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/season/{season_number}/episode/{episode_number}/credits
1907
+ *
1908
+ * Get the credits for a TV episode.
1909
+ * @param series_id The ID of the TV series.
1910
+ * @param season_number The number of the season within the TV show
1911
+ * @param episode_number The number of the episode within the season
1912
+ * @param language The language to use for the response.
1913
+ * @reference https://developer.themoviedb.org/reference/tv-episode-credits
1914
+ */
1915
+ async credits(params) {
1916
+ const { language = this.defaultOptions.language, ...rest } = params;
1917
+ const endpoint = this.episodeSubPath(rest, ENDPOINTS.TV_EPISODES.CREDITS);
1918
+ return this.client.request(endpoint, { language });
1919
+ }
1920
+ /**
1921
+ * External IDs
1922
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/season/{season_number}/episode/{episode_number}/external_ids
1923
+ *
1924
+ * Get a list of external IDs that have been added to a TV episode.
1925
+ * @param series_id The ID of the TV series.
1926
+ * @param season_number The number of the season within the TV show
1927
+ * @param episode_number The number of the episode within the season
1928
+ * @returns A promise that resolves to the TV episode external ids.
1929
+ * @reference https://developer.themoviedb.org/reference/tv-episode-external-ids
1930
+ */
1931
+ async external_ids(params) {
1932
+ const endpoint = this.episodeSubPath(params, ENDPOINTS.TV_EPISODES.EXTERNAL_IDS);
1933
+ return this.client.request(endpoint);
1934
+ }
1935
+ /**
1936
+ * Images
1937
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/season/{season_number}/episode/{episode_number}/images
1938
+ *
1939
+ * Fetches still images related to a specific tv episode
1940
+ * The images are returned in various sizes and formats.
1941
+ *
1942
+ * 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.
1943
+ *
1944
+ * @param series_id The ID of the TV series.
1945
+ * @param season_number The number of the season within the TV show
1946
+ * @param episode_number The number of the episode within the season
1947
+ * @param language - (Optional) The language code to filter the images by language.
1948
+ * @param include_image_language - (Optional) A comma-separated list of language codes to include images for.
1949
+ * @returns A promise that resolves to a `TVEpisodeImages` object containing the tv episode's images.
1950
+ * @reference https://developer.themoviedb.org/reference/tv-episode-images
1951
+ */
1952
+ async images(params) {
1953
+ const { language = this.defaultOptions.language, include_image_language, ...rest } = params;
1954
+ const endpoint = this.episodeSubPath(rest, ENDPOINTS.TV_EPISODES.IMAGES);
1955
+ return this.client.request(endpoint, { language, include_image_language });
1956
+ }
1957
+ /**
1958
+ * Translations
1959
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/season/{season_number}/episode/{episode_number}/translations
1960
+ *
1961
+ * Get the translations that have been added to a TV episode.
1962
+ * Take a read through our language documentation for more information about languages on TMDB.
1963
+ * https://developer.themoviedb.org/docs/languages
1964
+ * @param series_id The ID of the TV series.
1965
+ * @param season_number The number of the season within the TV show
1966
+ * @param episode_number The number of the episode within the season
1967
+ * @returns A promise that resolves to the translations of the tv episode.
1968
+ * @reference https://developer.themoviedb.org/reference/tv-episode-translations
1969
+ */
1970
+ async translations(params) {
1971
+ const endpoint = this.episodeSubPath(params, ENDPOINTS.TV_EPISODES.TRANSLATIONS);
1972
+ return this.client.request(endpoint);
1973
+ }
1974
+ /**
1975
+ * Videos
1976
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/season/{season_number}/episode/{episode_number}/videos
1977
+ *
1978
+ * Get the videos that belong to a TV episode.
1979
+ * @param series_id The ID of the TV series.
1980
+ * @param season_number The number of the season within the TV show
1981
+ * @param episode_number The number of the episode within the season
1982
+ * @returns A promise that resolves to the videos for the tv episode.
1983
+ * @reference https://developer.themoviedb.org/reference/tv-episode-videos
1984
+ */
1985
+ async videos(params) {
1986
+ const endpoint = this.episodeSubPath(params, ENDPOINTS.TV_EPISODES.VIDEOS);
1987
+ return this.client.request(endpoint);
1988
+ }
1989
+ };
1990
+
1991
+ // src/endpoints/tv_episode_groups.ts
1992
+ var TVEpisodeGroupsAPI = class extends TMDBAPIBase {
1993
+ /**
1994
+ * Details
1995
+ * GET - https://api.themoviedb.org/3/tv/episode_group/{episode_group_id}
1996
+ *
1997
+ * Get the details of a TV episode group by ID.
1998
+ * @param episode_group_id The ID of the episode group.
1999
+ * @reference https://developer.themoviedb.org/reference/tv-episode-group-details
2000
+ */
2001
+ async details(params) {
2002
+ const endpoint = `${ENDPOINTS.TV_EPISODE_GROUPS.DETAILS}/${params.episode_group_id}`;
2003
+ return this.client.request(endpoint);
2004
+ }
2005
+ };
2006
+
2007
+ // src/endpoints/tv_seasons.ts
2008
+ var TVSeasonsAPI = class extends TMDBAPIBase {
2009
+ seasonPath(params) {
2010
+ return `${ENDPOINTS.TV_SERIES.DETAILS}/${params.series_id}${ENDPOINTS.TV_SEASONS.DETAILS}/${params.season_number}`;
2011
+ }
2012
+ seasonSubPath(params, route) {
2013
+ return `${this.seasonPath(params)}${route}`;
2014
+ }
2015
+ /**
2016
+ * Details
2017
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/season/{season_number}
2018
+ *
2019
+ * Query the details of a TV season.
2020
+ * @param series_id The ID of the TV series.
2021
+ * @param season_number The season number within the TV show.
2022
+ * @param append_to_response A comma-separated list of the fields to include in the response.
2023
+ * @param language The language to use for the response.
2024
+ * @returns A promise that resolves to the TV season details.
2025
+ * @reference https://developer.themoviedb.org/reference/tv-season-details
2026
+ */
2027
+ async details(params) {
2028
+ const { language = this.defaultOptions.language, append_to_response, ...rest } = params;
2029
+ const endpoint = this.seasonPath(rest);
2030
+ return this.client.request(endpoint, { language, append_to_response });
2031
+ }
2032
+ /**
2033
+ * Aggregate Credits
2034
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/season/{season_number}/aggregate_credits
2035
+ *
2036
+ * Get the aggregate credits for a TV season.
2037
+ * This returns the full cast and crew across all episodes of the season.
2038
+ * @param series_id The ID of the TV series.
2039
+ * @param season_number The season number within the TV show.
2040
+ * @param language The language to use for the response.
2041
+ * @returns A promise that resolves to the TV season aggregate credits.
2042
+ * @reference https://developer.themoviedb.org/reference/tv-season-aggregate-credits
2043
+ */
2044
+ async aggregate_credits(params) {
2045
+ const { language = this.defaultOptions.language, ...rest } = params;
2046
+ const endpoint = this.seasonSubPath(rest, ENDPOINTS.TV_SEASONS.AGGREGATE_CREDITS);
2047
+ return this.client.request(endpoint, { language });
2048
+ }
2049
+ /**
2050
+ * Changes
2051
+ * GET - https://api.themoviedb.org/3/tv/season/{season_id}/changes
2052
+ *
2053
+ * Get the changes for a TV season by season ID. By default only the last 24 hours are returned.
2054
+ * You can query up to 14 days in a single query by using the start_date and end_date query parameters.
2055
+ * @param season_id The ID of the TV season.
2056
+ * @param start_date Filter changes by start date (ISO 8601 format, e.g. "2024-01-01").
2057
+ * @param end_date Filter changes by end date (ISO 8601 format, e.g. "2024-01-14").
2058
+ * @param page The page of results to return.
2059
+ * @returns A promise that resolves to the TV season changes history.
2060
+ * @reference https://developer.themoviedb.org/reference/tv-season-changes-by-id
2061
+ */
2062
+ async changes(params) {
2063
+ const { season_id, ...rest } = params;
2064
+ const endpoint = `${ENDPOINTS.TV_SERIES.DETAILS}${ENDPOINTS.TV_SEASONS.DETAILS}/${season_id}${ENDPOINTS.TV_SEASONS.CHANGES}`;
2065
+ return this.client.request(endpoint, { ...rest });
2066
+ }
2067
+ /**
2068
+ * Credits
2069
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/season/{season_number}/credits
2070
+ *
2071
+ * Get the credits for a TV season.
2072
+ * @param series_id The ID of the TV series.
2073
+ * @param season_number The season number within the TV show.
2074
+ * @param language The language to use for the response.
2075
+ * @returns A promise that resolves to the TV season credits.
2076
+ * @reference https://developer.themoviedb.org/reference/tv-season-credits
2077
+ */
2078
+ async credits(params) {
2079
+ const { language = this.defaultOptions.language, ...rest } = params;
2080
+ const endpoint = this.seasonSubPath(rest, ENDPOINTS.TV_SEASONS.CREDITS);
2081
+ return this.client.request(endpoint, { language });
2082
+ }
2083
+ /**
2084
+ * External IDs
2085
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/season/{season_number}/external_ids
2086
+ *
2087
+ * Get a list of external IDs that have been added to a TV season.
2088
+ * @param series_id The ID of the TV series.
2089
+ * @param season_number The season number within the TV show.
2090
+ * @returns A promise that resolves to the TV season external IDs.
2091
+ * @reference https://developer.themoviedb.org/reference/tv-season-external-ids
2092
+ */
2093
+ async external_ids(params) {
2094
+ const endpoint = this.seasonSubPath(params, ENDPOINTS.TV_SEASONS.EXTERNAL_IDS);
2095
+ return this.client.request(endpoint);
2096
+ }
2097
+ /**
2098
+ * Images
2099
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/season/{season_number}/images
2100
+ *
2101
+ * Get the images that belong to a TV season. Returns season posters.
2102
+ *
2103
+ * NOTE: If you have a language specified, it will act as a filter on the returned items.
2104
+ * You can use the include_image_language param to query additional languages.
2105
+ *
2106
+ * @param series_id The ID of the TV series.
2107
+ * @param season_number The season number within the TV show.
2108
+ * @param language The language code to filter images by language.
2109
+ * @param include_image_language A comma-separated list of language codes to include images for.
2110
+ * @returns A promise that resolves to the TV season images.
2111
+ * @reference https://developer.themoviedb.org/reference/tv-season-images
2112
+ */
2113
+ async images(params) {
2114
+ const { language = this.defaultOptions.language, include_image_language, ...rest } = params;
2115
+ const endpoint = this.seasonSubPath(rest, ENDPOINTS.TV_SEASONS.IMAGES);
2116
+ return this.client.request(endpoint, { language, include_image_language });
2117
+ }
2118
+ /**
2119
+ * Translations
2120
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/season/{season_number}/translations
2121
+ *
2122
+ * Get the translations that have been added to a TV season.
2123
+ * Take a read through our language documentation for more information about languages on TMDB.
2124
+ * https://developer.themoviedb.org/docs/languages
2125
+ * @param series_id The ID of the TV series.
2126
+ * @param season_number The season number within the TV show.
2127
+ * @returns A promise that resolves to the TV season translations.
2128
+ * @reference https://developer.themoviedb.org/reference/tv-season-translations
2129
+ */
2130
+ async translations(params) {
2131
+ const endpoint = this.seasonSubPath(params, ENDPOINTS.TV_SEASONS.TRANSLATIONS);
2132
+ return this.client.request(endpoint);
2133
+ }
2134
+ /**
2135
+ * Videos
2136
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/season/{season_number}/videos
2137
+ *
2138
+ * Get the videos that belong to a TV season.
2139
+ * @param series_id The ID of the TV series.
2140
+ * @param season_number The season number within the TV show.
2141
+ * @param language The language to use for the response.
2142
+ * @param include_video_language A comma-separated list of language codes to include videos for.
2143
+ * @returns A promise that resolves to the TV season videos.
2144
+ * @reference https://developer.themoviedb.org/reference/tv-season-videos
2145
+ */
2146
+ async videos(params) {
2147
+ const { language = this.defaultOptions.language, include_video_language, ...rest } = params;
2148
+ const endpoint = this.seasonSubPath(rest, ENDPOINTS.TV_SEASONS.VIDEOS);
2149
+ return this.client.request(endpoint, { language, include_video_language });
2150
+ }
2151
+ /**
2152
+ * Watch Providers
2153
+ * GET - https://api.themoviedb.org/3/tv/{series_id}/season/{season_number}/watch/providers
2154
+ *
2155
+ * Get the watch providers for a specific TV season.
2156
+ * Powered by our partnership with JustWatch, you can query which streaming services
2157
+ * have the season available.
2158
+ * @param series_id The ID of the TV series.
2159
+ * @param season_number The season number within the TV show.
2160
+ * @param language The language to use for the response.
2161
+ * @returns A promise that resolves to the TV season watch providers.
2162
+ * @reference https://developer.themoviedb.org/reference/tv-season-watch-providers
2163
+ */
2164
+ async watch_providers(params) {
2165
+ const { language = this.defaultOptions.language, ...rest } = params;
2166
+ const endpoint = this.seasonSubPath(rest, ENDPOINTS.TV_SEASONS.WATCH_PROVIDERS);
2167
+ return this.client.request(endpoint, { language });
2168
+ }
2169
+ };
2170
+
2171
+ // src/endpoints/trending.ts
2172
+ var TrendingAPI = class extends TMDBAPIBase {
2173
+ /**
2174
+ * Trending All
2175
+ * GET - https://api.themoviedb.org/3/trending/all/{time_window}
2176
+ *
2177
+ * Get the trending movies, TV shows and people on TMDB.
2178
+ * @reference https://developer.themoviedb.org/reference/trending-all
2179
+ */
2180
+ async all(params) {
2181
+ const { time_window, language = this.defaultOptions.language } = params;
2182
+ return this.client.request(`${ENDPOINTS.TRENDING.ALL}/${time_window}`, { language });
2183
+ }
2184
+ /**
2185
+ * Trending Movies
2186
+ * GET - https://api.themoviedb.org/3/trending/movie/{time_window}
2187
+ *
2188
+ * Get the trending movies on TMDB.
2189
+ * @reference https://developer.themoviedb.org/reference/trending-movies
2190
+ */
2191
+ async movies(params) {
2192
+ const { time_window, language = this.defaultOptions.language } = params;
2193
+ return this.client.request(`${ENDPOINTS.TRENDING.MOVIE}/${time_window}`, { language });
2194
+ }
2195
+ /**
2196
+ * Trending TV
2197
+ * GET - https://api.themoviedb.org/3/trending/tv/{time_window}
2198
+ *
2199
+ * Get the trending TV shows on TMDB.
2200
+ * @reference https://developer.themoviedb.org/reference/trending-tv
2201
+ */
2202
+ async tv(params) {
2203
+ const { time_window, language = this.defaultOptions.language } = params;
2204
+ return this.client.request(`${ENDPOINTS.TRENDING.TV}/${time_window}`, { language });
2205
+ }
2206
+ /**
2207
+ * Trending People
2208
+ * GET - https://api.themoviedb.org/3/trending/person/{time_window}
2209
+ *
2210
+ * Get the trending people on TMDB.
2211
+ * @reference https://developer.themoviedb.org/reference/trending-people
2212
+ */
2213
+ async people(params) {
2214
+ const { time_window, language = this.defaultOptions.language } = params;
2215
+ return this.client.request(`${ENDPOINTS.TRENDING.PERSON}/${time_window}`, { language });
2216
+ }
2217
+ };
2218
+
2219
+ // src/endpoints/reviews.ts
2220
+ var ReviewsAPI = class extends TMDBAPIBase {
2221
+ /**
2222
+ * Details
2223
+ * GET - https://api.themoviedb.org/3/review/{review_id}
2224
+ *
2225
+ * Retrieve the details of a single review by its TMDB review ID.
2226
+ * @param review_id The TMDB review identifier.
2227
+ * @returns A promise that resolves to the full review details.
2228
+ * @reference https://developer.themoviedb.org/reference/review-details
2229
+ */
2230
+ async details(params) {
2231
+ return this.client.request(`${ENDPOINTS.REVIEWS.DETAILS}/${params.review_id}`);
2232
+ }
2233
+ };
2234
+
2235
+ // src/endpoints/people_lists.ts
2236
+ var PeopleListsAPI = class extends TMDBAPIBase {
2237
+ /**
2238
+ * Popular
2239
+ * GET - https://api.themoviedb.org/3/person/popular
2240
+ *
2241
+ * Get a list of people ordered by popularity.
2242
+ * @param language Language for localised results (Defaults to en-US or TMDB default)
2243
+ * @param page Page number (Defaults to 1)
2244
+ * @reference https://developer.themoviedb.org/reference/person-popular-list
2245
+ */
2246
+ async popular(params = {}) {
2247
+ return this.client.request(ENDPOINTS.PEOPLE_LISTS.POPULAR, this.withLanguage(params));
2248
+ }
2249
+ };
2250
+
2251
+ // src/endpoints/people.ts
2252
+ var PeopleAPI = class extends TMDBAPIBase {
2253
+ personPath(person_id) {
2254
+ return `${ENDPOINTS.PEOPLE.DETAILS}/${person_id}`;
2255
+ }
2256
+ personSubPath(person_id, route) {
2257
+ return `${this.personPath(person_id)}${route}`;
2258
+ }
2259
+ /**
2260
+ * Details
2261
+ * GET - https://api.themoviedb.org/3/person/{person_id}
2262
+ *
2263
+ * Get the primary person details by TMDB person id.
2264
+ * @param person_id The TMDB person id.
2265
+ * @param append_to_response Additional person subresources to append.
2266
+ * @param language Language for localized results.
2267
+ * @reference https://developer.themoviedb.org/reference/person-details
2268
+ */
2269
+ async details(params) {
2270
+ const { language = this.defaultOptions.language, person_id, ...rest } = params;
2271
+ return this.client.request(this.personPath(person_id), { language, ...rest });
2272
+ }
2273
+ /**
2274
+ * Changes
2275
+ * GET - https://api.themoviedb.org/3/person/{person_id}/changes
2276
+ *
2277
+ * Get the change history for a person.
2278
+ * @reference https://developer.themoviedb.org/reference/person-changes
2279
+ */
2280
+ async changes(params) {
2281
+ const { person_id, ...rest } = params;
2282
+ return this.client.request(this.personSubPath(person_id, ENDPOINTS.PEOPLE.CHANGES), rest);
2283
+ }
2284
+ /**
2285
+ * Combined Credits
2286
+ * GET - https://api.themoviedb.org/3/person/{person_id}/combined_credits
2287
+ *
2288
+ * Get movie and TV credits in a single response.
2289
+ * @reference https://developer.themoviedb.org/reference/person-combined-credits
2290
+ */
2291
+ async combined_credits(params) {
2292
+ const { language = this.defaultOptions.language, person_id, ...rest } = params;
2293
+ return this.client.request(this.personSubPath(person_id, ENDPOINTS.PEOPLE.COMBINED_CREDITS), {
2294
+ language,
2295
+ ...rest
2296
+ });
2297
+ }
2298
+ /**
2299
+ * External IDs
2300
+ * GET - https://api.themoviedb.org/3/person/{person_id}/external_ids
2301
+ *
2302
+ * Get external platform identifiers for a person.
2303
+ * @reference https://developer.themoviedb.org/reference/person-external-ids
2304
+ */
2305
+ async external_ids(params) {
2306
+ return this.client.request(this.personSubPath(params.person_id, ENDPOINTS.PEOPLE.EXTERNAL_IDS));
2307
+ }
2308
+ /**
2309
+ * Images
2310
+ * GET - https://api.themoviedb.org/3/person/{person_id}/images
2311
+ *
2312
+ * Get profile images for a person.
2313
+ * @reference https://developer.themoviedb.org/reference/person-images
2314
+ */
2315
+ async images(params) {
2316
+ return this.client.request(this.personSubPath(params.person_id, ENDPOINTS.PEOPLE.IMAGES));
2317
+ }
2318
+ /**
2319
+ * Latest
2320
+ * GET - https://api.themoviedb.org/3/person/latest
2321
+ *
2322
+ * Get the newest person id added to TMDB.
2323
+ * @reference https://developer.themoviedb.org/reference/person-latest-id
2324
+ */
2325
+ async latest() {
2326
+ return this.client.request(`${ENDPOINTS.PEOPLE.DETAILS}${ENDPOINTS.PEOPLE.LATEST}`);
2327
+ }
2328
+ /**
2329
+ * Movie Credits
2330
+ * GET - https://api.themoviedb.org/3/person/{person_id}/movie_credits
2331
+ *
2332
+ * Get a person's movie cast and crew credits.
2333
+ * @reference https://developer.themoviedb.org/reference/person-movie-credits
2334
+ */
2335
+ async movie_credits(params) {
2336
+ const { language = this.defaultOptions.language, person_id, ...rest } = params;
2337
+ return this.client.request(this.personSubPath(person_id, ENDPOINTS.PEOPLE.MOVIE_CREDITS), {
2338
+ language,
2339
+ ...rest
2340
+ });
2341
+ }
2342
+ /**
2343
+ * Tagged Images
2344
+ * GET - https://api.themoviedb.org/3/person/{person_id}/tagged_images
2345
+ *
2346
+ * Get images where the person has been tagged.
2347
+ * @reference https://developer.themoviedb.org/reference/person-tagged-images
2348
+ */
2349
+ async tagged_images(params) {
2350
+ const { person_id, ...rest } = params;
2351
+ return this.client.request(this.personSubPath(person_id, ENDPOINTS.PEOPLE.TAGGED_IMAGES), rest);
2352
+ }
2353
+ /**
2354
+ * Translations
2355
+ * GET - https://api.themoviedb.org/3/person/{person_id}/translations
2356
+ *
2357
+ * Get the translations available for a person biography and name.
2358
+ * @reference https://developer.themoviedb.org/reference/person-translations
2359
+ */
2360
+ async translations(params) {
2361
+ return this.client.request(this.personSubPath(params.person_id, ENDPOINTS.PEOPLE.TRANSLATIONS));
2362
+ }
2363
+ /**
2364
+ * TV Credits
2365
+ * GET - https://api.themoviedb.org/3/person/{person_id}/tv_credits
2366
+ *
2367
+ * Get a person's TV cast and crew credits.
2368
+ * @reference https://developer.themoviedb.org/reference/person-tv-credits
2369
+ */
2370
+ async tv_credits(params) {
2371
+ const { language = this.defaultOptions.language, person_id, ...rest } = params;
2372
+ return this.client.request(this.personSubPath(person_id, ENDPOINTS.PEOPLE.TV_CREDITS), {
2373
+ language,
2374
+ ...rest
2375
+ });
2376
+ }
2377
+ };
2378
+
2379
+ // src/tmdb.ts
2380
+ var TMDB = class {
2381
+ client;
2382
+ options;
2383
+ // ** Default options for all requests
2384
+ movies;
2385
+ movie_lists;
2386
+ search;
2387
+ images;
2388
+ configuration;
2389
+ genres;
2390
+ keywords;
2391
+ tv_lists;
2392
+ tv_series;
2393
+ watch_providers;
2394
+ certifications;
2395
+ changes;
2396
+ companies;
2397
+ credits;
2398
+ collections;
2399
+ discover;
2400
+ find;
2401
+ networks;
2402
+ tv_episodes;
2403
+ tv_episode_groups;
2404
+ tv_seasons;
2405
+ trending;
2406
+ reviews;
2407
+ people_lists;
2408
+ people;
2409
+ // etc...
2410
+ /**
2411
+ * Creates a new TMDB instance.
2412
+ * @param accessToken The TMDB API access token.
2413
+ * @param options Optional default options (e.g., language) for all requests.
2414
+ */
2415
+ constructor(accessToken, options = {}) {
2416
+ if (!accessToken) throw new Error(Errors.NO_ACCESS_TOKEN);
2417
+ this.options = options;
2418
+ this.client = new ApiClient(accessToken, { logger: options.logger, deduplication: options.deduplication });
2419
+ this.movies = new MoviesAPI(this.client, this.options);
2420
+ this.movie_lists = new MovieListsAPI(this.client, this.options);
2421
+ this.search = new SearchAPI(this.client, this.options);
2422
+ this.images = new ImageAPI(this.options.images);
2423
+ this.configuration = new ConfigurationAPI(this.client, this.options);
2424
+ this.genres = new GenresAPI(this.client, this.options);
2425
+ this.keywords = new KeywordsAPI(this.client, this.options);
2426
+ this.tv_lists = new TVSeriesListsAPI(this.client, this.options);
2427
+ this.tv_series = new TVSeriesAPI(this.client, this.options);
2428
+ this.watch_providers = new WatchProvidersAPI(this.client, this.options);
2429
+ this.certifications = new CertificationsAPI(this.client, this.options);
2430
+ this.changes = new ChangesAPI(this.client, this.options);
2431
+ this.companies = new CompaniesAPI(this.client, this.options);
2432
+ this.credits = new CreditsAPI(this.client, this.options);
2433
+ this.collections = new CollectionsAPI(this.client, this.options);
2434
+ this.discover = new DiscoverAPI(this.client, this.options);
2435
+ this.find = new FindAPI(this.client, this.options);
2436
+ this.networks = new NetworksAPI(this.client, this.options);
2437
+ this.tv_episodes = new TVEpisodesAPI(this.client, this.options);
2438
+ this.tv_episode_groups = new TVEpisodeGroupsAPI(this.client, this.options);
2439
+ this.tv_seasons = new TVSeasonsAPI(this.client, this.options);
2440
+ this.trending = new TrendingAPI(this.client, this.options);
2441
+ this.reviews = new ReviewsAPI(this.client, this.options);
2442
+ this.people_lists = new PeopleListsAPI(this.client, this.options);
2443
+ this.people = new PeopleAPI(this.client, this.options);
2444
+ }
2445
+ };
2446
+
2447
+ // src/types/config/countries.ts
2448
+ var TMDBCountries = [
2449
+ {
2450
+ iso_3166_1: "AD",
2451
+ english_name: "Andorra",
2452
+ native_name: "Andorra"
2453
+ },
2454
+ {
2455
+ iso_3166_1: "AE",
2456
+ english_name: "United Arab Emirates",
2457
+ native_name: "United Arab Emirates"
2458
+ },
2459
+ {
2460
+ iso_3166_1: "AF",
2461
+ english_name: "Afghanistan",
2462
+ native_name: "Afghanistan"
2463
+ },
2464
+ {
2465
+ iso_3166_1: "AG",
2466
+ english_name: "Antigua and Barbuda",
2467
+ native_name: "Antigua & Barbuda"
2468
+ },
2469
+ {
2470
+ iso_3166_1: "AI",
2471
+ english_name: "Anguilla",
2472
+ native_name: "Anguilla"
2473
+ },
2474
+ {
2475
+ iso_3166_1: "AL",
2476
+ english_name: "Albania",
2477
+ native_name: "Albania"
2478
+ },
2479
+ {
2480
+ iso_3166_1: "AM",
2481
+ english_name: "Armenia",
2482
+ native_name: "Armenia"
2483
+ },
2484
+ {
2485
+ iso_3166_1: "AN",
2486
+ english_name: "Netherlands Antilles",
2487
+ native_name: "Netherlands Antilles"
2488
+ },
2489
+ {
2490
+ iso_3166_1: "AO",
2491
+ english_name: "Angola",
2492
+ native_name: "Angola"
2493
+ },
2494
+ {
2495
+ iso_3166_1: "AQ",
2496
+ english_name: "Antarctica",
2497
+ native_name: "Antarctica"
2498
+ },
2499
+ {
2500
+ iso_3166_1: "AR",
2501
+ english_name: "Argentina",
2502
+ native_name: "Argentina"
2503
+ },
2504
+ {
2505
+ iso_3166_1: "AS",
2506
+ english_name: "American Samoa",
2507
+ native_name: "American Samoa"
2508
+ },
2509
+ {
2510
+ iso_3166_1: "AT",
2511
+ english_name: "Austria",
2512
+ native_name: "Austria"
2513
+ },
2514
+ {
2515
+ iso_3166_1: "AU",
2516
+ english_name: "Australia",
2517
+ native_name: "Australia"
2518
+ },
2519
+ {
2520
+ iso_3166_1: "AW",
2521
+ english_name: "Aruba",
2522
+ native_name: "Aruba"
2523
+ },
2524
+ {
2525
+ iso_3166_1: "AZ",
2526
+ english_name: "Azerbaijan",
2527
+ native_name: "Azerbaijan"
2528
+ },
2529
+ {
2530
+ iso_3166_1: "BA",
2531
+ english_name: "Bosnia and Herzegovina",
2532
+ native_name: "Bosnia & Herzegovina"
2533
+ },
2534
+ {
2535
+ iso_3166_1: "BB",
2536
+ english_name: "Barbados",
2537
+ native_name: "Barbados"
2538
+ },
2539
+ {
2540
+ iso_3166_1: "BD",
2541
+ english_name: "Bangladesh",
2542
+ native_name: "Bangladesh"
2543
+ },
2544
+ {
2545
+ iso_3166_1: "BE",
2546
+ english_name: "Belgium",
2547
+ native_name: "Belgium"
2548
+ },
2549
+ {
2550
+ iso_3166_1: "BF",
2551
+ english_name: "Burkina Faso",
2552
+ native_name: "Burkina Faso"
2553
+ },
2554
+ {
2555
+ iso_3166_1: "BG",
2556
+ english_name: "Bulgaria",
2557
+ native_name: "Bulgaria"
2558
+ },
2559
+ {
2560
+ iso_3166_1: "BH",
2561
+ english_name: "Bahrain",
2562
+ native_name: "Bahrain"
2563
+ },
2564
+ {
2565
+ iso_3166_1: "BI",
2566
+ english_name: "Burundi",
2567
+ native_name: "Burundi"
2568
+ },
2569
+ {
2570
+ iso_3166_1: "BJ",
2571
+ english_name: "Benin",
2572
+ native_name: "Benin"
2573
+ },
2574
+ {
2575
+ iso_3166_1: "BM",
2576
+ english_name: "Bermuda",
2577
+ native_name: "Bermuda"
2578
+ },
2579
+ {
2580
+ iso_3166_1: "BN",
2581
+ english_name: "Brunei Darussalam",
2582
+ native_name: "Brunei"
2583
+ },
2584
+ {
2585
+ iso_3166_1: "BO",
2586
+ english_name: "Bolivia",
2587
+ native_name: "Bolivia"
2588
+ },
2589
+ {
2590
+ iso_3166_1: "BR",
2591
+ english_name: "Brazil",
2592
+ native_name: "Brazil"
2593
+ },
2594
+ {
2595
+ iso_3166_1: "BS",
2596
+ english_name: "Bahamas",
2597
+ native_name: "Bahamas"
2598
+ },
2599
+ {
2600
+ iso_3166_1: "BT",
2601
+ english_name: "Bhutan",
2602
+ native_name: "Bhutan"
2603
+ },
2604
+ {
2605
+ iso_3166_1: "BU",
2606
+ english_name: "Burma",
2607
+ native_name: "Burma"
2608
+ },
2609
+ {
2610
+ iso_3166_1: "BV",
2611
+ english_name: "Bouvet Island",
2612
+ native_name: "Bouvet Island"
2613
+ },
2614
+ {
2615
+ iso_3166_1: "BW",
2616
+ english_name: "Botswana",
2617
+ native_name: "Botswana"
2618
+ },
2619
+ {
2620
+ iso_3166_1: "BY",
2621
+ english_name: "Belarus",
2622
+ native_name: "Belarus"
2623
+ },
2624
+ {
2625
+ iso_3166_1: "BZ",
2626
+ english_name: "Belize",
2627
+ native_name: "Belize"
2628
+ },
2629
+ {
2630
+ iso_3166_1: "CA",
2631
+ english_name: "Canada",
2632
+ native_name: "Canada"
2633
+ },
2634
+ {
2635
+ iso_3166_1: "CC",
2636
+ english_name: "Cocos Islands",
2637
+ native_name: "Cocos (Keeling) Islands"
2638
+ },
2639
+ {
2640
+ iso_3166_1: "CD",
2641
+ english_name: "Congo",
2642
+ native_name: "Democratic Republic of the Congo (Kinshasa)"
2643
+ },
2644
+ {
2645
+ iso_3166_1: "CF",
2646
+ english_name: "Central African Republic",
2647
+ native_name: "Central African Republic"
2648
+ },
2649
+ {
2650
+ iso_3166_1: "CG",
2651
+ english_name: "Congo",
2652
+ native_name: "Republic of the Congo (Brazzaville)"
2653
+ },
2654
+ {
2655
+ iso_3166_1: "CH",
2656
+ english_name: "Switzerland",
2657
+ native_name: "Switzerland"
2658
+ },
2659
+ {
2660
+ iso_3166_1: "CI",
2661
+ english_name: "Cote D'Ivoire",
2662
+ native_name: "C\xF4te d\u2019Ivoire"
2663
+ },
2664
+ {
2665
+ iso_3166_1: "CK",
2666
+ english_name: "Cook Islands",
2667
+ native_name: "Cook Islands"
2668
+ },
2669
+ {
2670
+ iso_3166_1: "CL",
2671
+ english_name: "Chile",
2672
+ native_name: "Chile"
2673
+ },
2674
+ {
2675
+ iso_3166_1: "CM",
2676
+ english_name: "Cameroon",
2677
+ native_name: "Cameroon"
2678
+ },
2679
+ {
2680
+ iso_3166_1: "CN",
2681
+ english_name: "China",
2682
+ native_name: "China"
2683
+ },
2684
+ {
2685
+ iso_3166_1: "CO",
2686
+ english_name: "Colombia",
2687
+ native_name: "Colombia"
2688
+ },
2689
+ {
2690
+ iso_3166_1: "CR",
2691
+ english_name: "Costa Rica",
2692
+ native_name: "Costa Rica"
2693
+ },
2694
+ {
2695
+ iso_3166_1: "CS",
2696
+ english_name: "Serbia and Montenegro",
2697
+ native_name: "Serbia and Montenegro"
2698
+ },
2699
+ {
2700
+ iso_3166_1: "CU",
2701
+ english_name: "Cuba",
2702
+ native_name: "Cuba"
2703
+ },
2704
+ {
2705
+ iso_3166_1: "CV",
2706
+ english_name: "Cape Verde",
2707
+ native_name: "Cape Verde"
2708
+ },
2709
+ {
2710
+ iso_3166_1: "CX",
2711
+ english_name: "Christmas Island",
2712
+ native_name: "Christmas Island"
2713
+ },
2714
+ {
2715
+ iso_3166_1: "CY",
2716
+ english_name: "Cyprus",
2717
+ native_name: "Cyprus"
2718
+ },
2719
+ {
2720
+ iso_3166_1: "CZ",
2721
+ english_name: "Czech Republic",
2722
+ native_name: "Czech Republic"
2723
+ },
2724
+ {
2725
+ iso_3166_1: "DE",
2726
+ english_name: "Germany",
2727
+ native_name: "Germany"
2728
+ },
2729
+ {
2730
+ iso_3166_1: "DJ",
2731
+ english_name: "Djibouti",
2732
+ native_name: "Djibouti"
2733
+ },
2734
+ {
2735
+ iso_3166_1: "DK",
2736
+ english_name: "Denmark",
2737
+ native_name: "Denmark"
2738
+ },
2739
+ {
2740
+ iso_3166_1: "DM",
2741
+ english_name: "Dominica",
2742
+ native_name: "Dominica"
2743
+ },
2744
+ {
2745
+ iso_3166_1: "DO",
2746
+ english_name: "Dominican Republic",
2747
+ native_name: "Dominican Republic"
2748
+ },
2749
+ {
2750
+ iso_3166_1: "DZ",
2751
+ english_name: "Algeria",
2752
+ native_name: "Algeria"
2753
+ },
2754
+ {
2755
+ iso_3166_1: "EC",
2756
+ english_name: "Ecuador",
2757
+ native_name: "Ecuador"
2758
+ },
2759
+ {
2760
+ iso_3166_1: "EE",
2761
+ english_name: "Estonia",
2762
+ native_name: "Estonia"
2763
+ },
2764
+ {
2765
+ iso_3166_1: "EG",
2766
+ english_name: "Egypt",
2767
+ native_name: "Egypt"
2768
+ },
2769
+ {
2770
+ iso_3166_1: "EH",
2771
+ english_name: "Western Sahara",
2772
+ native_name: "Western Sahara"
2773
+ },
2774
+ {
2775
+ iso_3166_1: "ER",
2776
+ english_name: "Eritrea",
2777
+ native_name: "Eritrea"
2778
+ },
2779
+ {
2780
+ iso_3166_1: "ES",
2781
+ english_name: "Spain",
2782
+ native_name: "Spain"
2783
+ },
2784
+ {
2785
+ iso_3166_1: "ET",
2786
+ english_name: "Ethiopia",
2787
+ native_name: "Ethiopia"
2788
+ },
2789
+ {
2790
+ iso_3166_1: "FI",
2791
+ english_name: "Finland",
2792
+ native_name: "Finland"
2793
+ },
2794
+ {
2795
+ iso_3166_1: "FJ",
2796
+ english_name: "Fiji",
2797
+ native_name: "Fiji"
2798
+ },
2799
+ {
2800
+ iso_3166_1: "FK",
2801
+ english_name: "Falkland Islands",
2802
+ native_name: "Falkland Islands"
2803
+ },
2804
+ {
2805
+ iso_3166_1: "FM",
2806
+ english_name: "Micronesia",
2807
+ native_name: "Micronesia"
2808
+ },
2809
+ {
2810
+ iso_3166_1: "FO",
2811
+ english_name: "Faeroe Islands",
2812
+ native_name: "Faroe Islands"
2813
+ },
2814
+ {
2815
+ iso_3166_1: "FR",
2816
+ english_name: "France",
2817
+ native_name: "France"
2818
+ },
2819
+ {
2820
+ iso_3166_1: "GA",
2821
+ english_name: "Gabon",
2822
+ native_name: "Gabon"
2823
+ },
2824
+ {
2825
+ iso_3166_1: "GB",
2826
+ english_name: "United Kingdom",
2827
+ native_name: "United Kingdom"
2828
+ },
2829
+ {
2830
+ iso_3166_1: "GD",
2831
+ english_name: "Grenada",
2832
+ native_name: "Grenada"
2833
+ },
2834
+ {
2835
+ iso_3166_1: "GE",
2836
+ english_name: "Georgia",
2837
+ native_name: "Georgia"
2838
+ },
2839
+ {
2840
+ iso_3166_1: "GF",
2841
+ english_name: "French Guiana",
2842
+ native_name: "French Guiana"
2843
+ },
2844
+ {
2845
+ iso_3166_1: "GH",
2846
+ english_name: "Ghana",
2847
+ native_name: "Ghana"
2848
+ },
2849
+ {
2850
+ iso_3166_1: "GI",
2851
+ english_name: "Gibraltar",
2852
+ native_name: "Gibraltar"
2853
+ },
2854
+ {
2855
+ iso_3166_1: "GL",
2856
+ english_name: "Greenland",
2857
+ native_name: "Greenland"
2858
+ },
2859
+ {
2860
+ iso_3166_1: "GM",
2861
+ english_name: "Gambia",
2862
+ native_name: "Gambia"
2863
+ },
2864
+ {
2865
+ iso_3166_1: "GN",
2866
+ english_name: "Guinea",
2867
+ native_name: "Guinea"
2868
+ },
2869
+ {
2870
+ iso_3166_1: "GP",
2871
+ english_name: "Guadaloupe",
2872
+ native_name: "Guadeloupe"
2873
+ },
2874
+ {
2875
+ iso_3166_1: "GQ",
2876
+ english_name: "Equatorial Guinea",
2877
+ native_name: "Equatorial Guinea"
2878
+ },
2879
+ {
2880
+ iso_3166_1: "GR",
2881
+ english_name: "Greece",
2882
+ native_name: "Greece"
2883
+ },
2884
+ {
2885
+ iso_3166_1: "GS",
2886
+ english_name: "South Georgia and the South Sandwich Islands",
2887
+ native_name: "South Georgia & South Sandwich Islands"
2888
+ },
2889
+ {
2890
+ iso_3166_1: "GT",
2891
+ english_name: "Guatemala",
2892
+ native_name: "Guatemala"
2893
+ },
2894
+ {
2895
+ iso_3166_1: "GU",
2896
+ english_name: "Guam",
2897
+ native_name: "Guam"
2898
+ },
2899
+ {
2900
+ iso_3166_1: "GW",
2901
+ english_name: "Guinea-Bissau",
2902
+ native_name: "Guinea-Bissau"
2903
+ },
2904
+ {
2905
+ iso_3166_1: "GY",
2906
+ english_name: "Guyana",
2907
+ native_name: "Guyana"
2908
+ },
2909
+ {
2910
+ iso_3166_1: "HK",
2911
+ english_name: "Hong Kong",
2912
+ native_name: "Hong Kong SAR China"
2913
+ },
2914
+ {
2915
+ iso_3166_1: "HM",
2916
+ english_name: "Heard and McDonald Islands",
2917
+ native_name: "Heard & McDonald Islands"
2918
+ },
2919
+ {
2920
+ iso_3166_1: "HN",
2921
+ english_name: "Honduras",
2922
+ native_name: "Honduras"
2923
+ },
2924
+ {
2925
+ iso_3166_1: "HR",
2926
+ english_name: "Croatia",
2927
+ native_name: "Croatia"
2928
+ },
2929
+ {
2930
+ iso_3166_1: "HT",
2931
+ english_name: "Haiti",
2932
+ native_name: "Haiti"
2933
+ },
2934
+ {
2935
+ iso_3166_1: "HU",
2936
+ english_name: "Hungary",
2937
+ native_name: "Hungary"
2938
+ },
2939
+ {
2940
+ iso_3166_1: "ID",
2941
+ english_name: "Indonesia",
2942
+ native_name: "Indonesia"
2943
+ },
2944
+ {
2945
+ iso_3166_1: "IE",
2946
+ english_name: "Ireland",
2947
+ native_name: "Ireland"
2948
+ },
2949
+ {
2950
+ iso_3166_1: "IL",
2951
+ english_name: "Israel",
2952
+ native_name: "Israel"
2953
+ },
2954
+ {
2955
+ iso_3166_1: "IN",
2956
+ english_name: "India",
2957
+ native_name: "India"
2958
+ },
2959
+ {
2960
+ iso_3166_1: "IO",
2961
+ english_name: "British Indian Ocean Territory",
2962
+ native_name: "British Indian Ocean Territory"
2963
+ },
2964
+ {
2965
+ iso_3166_1: "IQ",
2966
+ english_name: "Iraq",
2967
+ native_name: "Iraq"
2968
+ },
2969
+ {
2970
+ iso_3166_1: "IR",
2971
+ english_name: "Iran",
2972
+ native_name: "Iran"
2973
+ },
2974
+ {
2975
+ iso_3166_1: "IS",
2976
+ english_name: "Iceland",
2977
+ native_name: "Iceland"
2978
+ },
2979
+ {
2980
+ iso_3166_1: "IT",
2981
+ english_name: "Italy",
2982
+ native_name: "Italy"
2983
+ },
2984
+ {
2985
+ iso_3166_1: "JM",
2986
+ english_name: "Jamaica",
2987
+ native_name: "Jamaica"
2988
+ },
2989
+ {
2990
+ iso_3166_1: "JO",
2991
+ english_name: "Jordan",
2992
+ native_name: "Jordan"
2993
+ },
2994
+ {
2995
+ iso_3166_1: "JP",
2996
+ english_name: "Japan",
2997
+ native_name: "Japan"
2998
+ },
2999
+ {
3000
+ iso_3166_1: "KE",
3001
+ english_name: "Kenya",
3002
+ native_name: "Kenya"
3003
+ },
3004
+ {
3005
+ iso_3166_1: "KG",
3006
+ english_name: "Kyrgyz Republic",
3007
+ native_name: "Kyrgyzstan"
3008
+ },
3009
+ {
3010
+ iso_3166_1: "KH",
3011
+ english_name: "Cambodia",
3012
+ native_name: "Cambodia"
3013
+ },
3014
+ {
3015
+ iso_3166_1: "KI",
3016
+ english_name: "Kiribati",
3017
+ native_name: "Kiribati"
3018
+ },
3019
+ {
3020
+ iso_3166_1: "KM",
3021
+ english_name: "Comoros",
3022
+ native_name: "Comoros"
3023
+ },
3024
+ {
3025
+ iso_3166_1: "KN",
3026
+ english_name: "St. Kitts and Nevis",
3027
+ native_name: "St. Kitts & Nevis"
3028
+ },
3029
+ {
3030
+ iso_3166_1: "KP",
3031
+ english_name: "North Korea",
3032
+ native_name: "North Korea"
3033
+ },
3034
+ {
3035
+ iso_3166_1: "KR",
3036
+ english_name: "South Korea",
3037
+ native_name: "South Korea"
3038
+ },
3039
+ {
3040
+ iso_3166_1: "KW",
3041
+ english_name: "Kuwait",
3042
+ native_name: "Kuwait"
3043
+ },
3044
+ {
3045
+ iso_3166_1: "KY",
3046
+ english_name: "Cayman Islands",
3047
+ native_name: "Cayman Islands"
3048
+ },
3049
+ {
3050
+ iso_3166_1: "KZ",
3051
+ english_name: "Kazakhstan",
3052
+ native_name: "Kazakhstan"
3053
+ },
3054
+ {
3055
+ iso_3166_1: "LA",
3056
+ english_name: "Lao People's Democratic Republic",
3057
+ native_name: "Laos"
3058
+ },
3059
+ {
3060
+ iso_3166_1: "LB",
3061
+ english_name: "Lebanon",
3062
+ native_name: "Lebanon"
3063
+ },
3064
+ {
3065
+ iso_3166_1: "LC",
3066
+ english_name: "St. Lucia",
3067
+ native_name: "St. Lucia"
3068
+ },
3069
+ {
3070
+ iso_3166_1: "LI",
3071
+ english_name: "Liechtenstein",
3072
+ native_name: "Liechtenstein"
3073
+ },
3074
+ {
3075
+ iso_3166_1: "LK",
3076
+ english_name: "Sri Lanka",
3077
+ native_name: "Sri Lanka"
3078
+ },
3079
+ {
3080
+ iso_3166_1: "LR",
3081
+ english_name: "Liberia",
3082
+ native_name: "Liberia"
3083
+ },
3084
+ {
3085
+ iso_3166_1: "LS",
3086
+ english_name: "Lesotho",
3087
+ native_name: "Lesotho"
3088
+ },
3089
+ {
3090
+ iso_3166_1: "LT",
3091
+ english_name: "Lithuania",
3092
+ native_name: "Lithuania"
3093
+ },
3094
+ {
3095
+ iso_3166_1: "LU",
3096
+ english_name: "Luxembourg",
3097
+ native_name: "Luxembourg"
3098
+ },
3099
+ {
3100
+ iso_3166_1: "LV",
3101
+ english_name: "Latvia",
3102
+ native_name: "Latvia"
3103
+ },
3104
+ {
3105
+ iso_3166_1: "LY",
3106
+ english_name: "Libyan Arab Jamahiriya",
3107
+ native_name: "Libya"
3108
+ },
3109
+ {
3110
+ iso_3166_1: "MA",
3111
+ english_name: "Morocco",
3112
+ native_name: "Morocco"
3113
+ },
3114
+ {
3115
+ iso_3166_1: "MC",
3116
+ english_name: "Monaco",
3117
+ native_name: "Monaco"
3118
+ },
3119
+ {
3120
+ iso_3166_1: "MD",
3121
+ english_name: "Moldova",
3122
+ native_name: "Moldova"
3123
+ },
3124
+ {
3125
+ iso_3166_1: "ME",
3126
+ english_name: "Montenegro",
3127
+ native_name: "Montenegro"
3128
+ },
3129
+ {
3130
+ iso_3166_1: "MG",
3131
+ english_name: "Madagascar",
3132
+ native_name: "Madagascar"
3133
+ },
3134
+ {
3135
+ iso_3166_1: "MH",
3136
+ english_name: "Marshall Islands",
3137
+ native_name: "Marshall Islands"
3138
+ },
3139
+ {
3140
+ iso_3166_1: "MK",
3141
+ english_name: "Macedonia",
3142
+ native_name: "Macedonia"
3143
+ },
3144
+ {
3145
+ iso_3166_1: "ML",
3146
+ english_name: "Mali",
3147
+ native_name: "Mali"
3148
+ },
3149
+ {
3150
+ iso_3166_1: "MM",
3151
+ english_name: "Myanmar",
3152
+ native_name: "Myanmar (Burma)"
3153
+ },
3154
+ {
3155
+ iso_3166_1: "MN",
3156
+ english_name: "Mongolia",
3157
+ native_name: "Mongolia"
3158
+ },
3159
+ {
3160
+ iso_3166_1: "MO",
3161
+ english_name: "Macao",
3162
+ native_name: "Macau SAR China"
3163
+ },
3164
+ {
3165
+ iso_3166_1: "MP",
3166
+ english_name: "Northern Mariana Islands",
3167
+ native_name: "Northern Mariana Islands"
3168
+ },
3169
+ {
3170
+ iso_3166_1: "MQ",
3171
+ english_name: "Martinique",
3172
+ native_name: "Martinique"
3173
+ },
3174
+ {
3175
+ iso_3166_1: "MR",
3176
+ english_name: "Mauritania",
3177
+ native_name: "Mauritania"
3178
+ },
3179
+ {
3180
+ iso_3166_1: "MS",
3181
+ english_name: "Montserrat",
3182
+ native_name: "Montserrat"
3183
+ },
3184
+ {
3185
+ iso_3166_1: "MT",
3186
+ english_name: "Malta",
3187
+ native_name: "Malta"
3188
+ },
3189
+ {
3190
+ iso_3166_1: "MU",
3191
+ english_name: "Mauritius",
3192
+ native_name: "Mauritius"
3193
+ },
3194
+ {
3195
+ iso_3166_1: "MV",
3196
+ english_name: "Maldives",
3197
+ native_name: "Maldives"
3198
+ },
3199
+ {
3200
+ iso_3166_1: "MW",
3201
+ english_name: "Malawi",
3202
+ native_name: "Malawi"
3203
+ },
3204
+ {
3205
+ iso_3166_1: "MX",
3206
+ english_name: "Mexico",
3207
+ native_name: "Mexico"
3208
+ },
3209
+ {
3210
+ iso_3166_1: "MY",
3211
+ english_name: "Malaysia",
3212
+ native_name: "Malaysia"
3213
+ },
3214
+ {
3215
+ iso_3166_1: "MZ",
3216
+ english_name: "Mozambique",
3217
+ native_name: "Mozambique"
3218
+ },
3219
+ {
3220
+ iso_3166_1: "NA",
3221
+ english_name: "Namibia",
3222
+ native_name: "Namibia"
3223
+ },
3224
+ {
3225
+ iso_3166_1: "NC",
3226
+ english_name: "New Caledonia",
3227
+ native_name: "New Caledonia"
3228
+ },
3229
+ {
3230
+ iso_3166_1: "NE",
3231
+ english_name: "Niger",
3232
+ native_name: "Niger"
3233
+ },
3234
+ {
3235
+ iso_3166_1: "NF",
3236
+ english_name: "Norfolk Island",
3237
+ native_name: "Norfolk Island"
3238
+ },
3239
+ {
3240
+ iso_3166_1: "NG",
3241
+ english_name: "Nigeria",
3242
+ native_name: "Nigeria"
3243
+ },
3244
+ {
3245
+ iso_3166_1: "NI",
3246
+ english_name: "Nicaragua",
3247
+ native_name: "Nicaragua"
3248
+ },
3249
+ {
3250
+ iso_3166_1: "NL",
3251
+ english_name: "Netherlands",
3252
+ native_name: "Netherlands"
3253
+ },
3254
+ {
3255
+ iso_3166_1: "NO",
3256
+ english_name: "Norway",
3257
+ native_name: "Norway"
3258
+ },
3259
+ {
3260
+ iso_3166_1: "NP",
3261
+ english_name: "Nepal",
3262
+ native_name: "Nepal"
3263
+ },
3264
+ {
3265
+ iso_3166_1: "NR",
3266
+ english_name: "Nauru",
3267
+ native_name: "Nauru"
3268
+ },
3269
+ {
3270
+ iso_3166_1: "NU",
3271
+ english_name: "Niue",
3272
+ native_name: "Niue"
3273
+ },
3274
+ {
3275
+ iso_3166_1: "NZ",
3276
+ english_name: "New Zealand",
3277
+ native_name: "New Zealand"
3278
+ },
3279
+ {
3280
+ iso_3166_1: "OM",
3281
+ english_name: "Oman",
3282
+ native_name: "Oman"
3283
+ },
3284
+ {
3285
+ iso_3166_1: "PA",
3286
+ english_name: "Panama",
3287
+ native_name: "Panama"
3288
+ },
3289
+ {
3290
+ iso_3166_1: "PE",
3291
+ english_name: "Peru",
3292
+ native_name: "Peru"
3293
+ },
3294
+ {
3295
+ iso_3166_1: "PF",
3296
+ english_name: "French Polynesia",
3297
+ native_name: "French Polynesia"
3298
+ },
3299
+ {
3300
+ iso_3166_1: "PG",
3301
+ english_name: "Papua New Guinea",
3302
+ native_name: "Papua New Guinea"
3303
+ },
3304
+ {
3305
+ iso_3166_1: "PH",
3306
+ english_name: "Philippines",
3307
+ native_name: "Philippines"
3308
+ },
3309
+ {
3310
+ iso_3166_1: "PK",
3311
+ english_name: "Pakistan",
3312
+ native_name: "Pakistan"
3313
+ },
3314
+ {
3315
+ iso_3166_1: "PL",
3316
+ english_name: "Poland",
3317
+ native_name: "Poland"
3318
+ },
3319
+ {
3320
+ iso_3166_1: "PM",
3321
+ english_name: "St. Pierre and Miquelon",
3322
+ native_name: "St. Pierre & Miquelon"
3323
+ },
3324
+ {
3325
+ iso_3166_1: "PN",
3326
+ english_name: "Pitcairn Island",
3327
+ native_name: "Pitcairn Islands"
3328
+ },
3329
+ {
3330
+ iso_3166_1: "PR",
3331
+ english_name: "Puerto Rico",
3332
+ native_name: "Puerto Rico"
3333
+ },
3334
+ {
3335
+ iso_3166_1: "PS",
3336
+ english_name: "Palestinian Territory",
3337
+ native_name: "Palestinian Territories"
3338
+ },
3339
+ {
3340
+ iso_3166_1: "PT",
3341
+ english_name: "Portugal",
3342
+ native_name: "Portugal"
3343
+ },
3344
+ {
3345
+ iso_3166_1: "PW",
3346
+ english_name: "Palau",
3347
+ native_name: "Palau"
3348
+ },
3349
+ {
3350
+ iso_3166_1: "PY",
3351
+ english_name: "Paraguay",
3352
+ native_name: "Paraguay"
3353
+ },
3354
+ {
3355
+ iso_3166_1: "QA",
3356
+ english_name: "Qatar",
3357
+ native_name: "Qatar"
3358
+ },
3359
+ {
3360
+ iso_3166_1: "RE",
3361
+ english_name: "Reunion",
3362
+ native_name: "R\xE9union"
3363
+ },
3364
+ {
3365
+ iso_3166_1: "RO",
3366
+ english_name: "Romania",
3367
+ native_name: "Romania"
3368
+ },
3369
+ {
3370
+ iso_3166_1: "RS",
3371
+ english_name: "Serbia",
3372
+ native_name: "Serbia"
3373
+ },
3374
+ {
3375
+ iso_3166_1: "RU",
3376
+ english_name: "Russia",
3377
+ native_name: "Russia"
3378
+ },
3379
+ {
3380
+ iso_3166_1: "RW",
3381
+ english_name: "Rwanda",
3382
+ native_name: "Rwanda"
3383
+ },
3384
+ {
3385
+ iso_3166_1: "SA",
3386
+ english_name: "Saudi Arabia",
3387
+ native_name: "Saudi Arabia"
3388
+ },
3389
+ {
3390
+ iso_3166_1: "SB",
3391
+ english_name: "Solomon Islands",
3392
+ native_name: "Solomon Islands"
3393
+ },
3394
+ {
3395
+ iso_3166_1: "SC",
3396
+ english_name: "Seychelles",
3397
+ native_name: "Seychelles"
3398
+ },
3399
+ {
3400
+ iso_3166_1: "SD",
3401
+ english_name: "Sudan",
3402
+ native_name: "Sudan"
3403
+ },
3404
+ {
3405
+ iso_3166_1: "SE",
3406
+ english_name: "Sweden",
3407
+ native_name: "Sweden"
3408
+ },
3409
+ {
3410
+ iso_3166_1: "SG",
3411
+ english_name: "Singapore",
3412
+ native_name: "Singapore"
3413
+ },
3414
+ {
3415
+ iso_3166_1: "SH",
3416
+ english_name: "St. Helena",
3417
+ native_name: "St. Helena"
3418
+ },
3419
+ {
3420
+ iso_3166_1: "SI",
3421
+ english_name: "Slovenia",
3422
+ native_name: "Slovenia"
3423
+ },
3424
+ {
3425
+ iso_3166_1: "SJ",
3426
+ english_name: "Svalbard & Jan Mayen Islands",
3427
+ native_name: "Svalbard & Jan Mayen"
3428
+ },
3429
+ {
3430
+ iso_3166_1: "SK",
3431
+ english_name: "Slovakia",
3432
+ native_name: "Slovakia"
3433
+ },
3434
+ {
3435
+ iso_3166_1: "SL",
3436
+ english_name: "Sierra Leone",
3437
+ native_name: "Sierra Leone"
3438
+ },
3439
+ {
3440
+ iso_3166_1: "SM",
3441
+ english_name: "San Marino",
3442
+ native_name: "San Marino"
3443
+ },
3444
+ {
3445
+ iso_3166_1: "SN",
3446
+ english_name: "Senegal",
3447
+ native_name: "Senegal"
3448
+ },
3449
+ {
3450
+ iso_3166_1: "SO",
3451
+ english_name: "Somalia",
3452
+ native_name: "Somalia"
3453
+ },
3454
+ {
3455
+ iso_3166_1: "SR",
3456
+ english_name: "Suriname",
3457
+ native_name: "Suriname"
3458
+ },
3459
+ {
3460
+ iso_3166_1: "SS",
3461
+ english_name: "South Sudan",
3462
+ native_name: "South Sudan"
3463
+ },
3464
+ {
3465
+ iso_3166_1: "ST",
3466
+ english_name: "Sao Tome and Principe",
3467
+ native_name: "S\xE3o Tom\xE9 & Pr\xEDncipe"
3468
+ },
3469
+ {
3470
+ iso_3166_1: "SU",
3471
+ english_name: "Soviet Union",
3472
+ native_name: "Soviet Union"
3473
+ },
3474
+ {
3475
+ iso_3166_1: "SV",
3476
+ english_name: "El Salvador",
3477
+ native_name: "El Salvador"
3478
+ },
3479
+ {
3480
+ iso_3166_1: "SY",
3481
+ english_name: "Syrian Arab Republic",
3482
+ native_name: "Syria"
3483
+ },
3484
+ {
3485
+ iso_3166_1: "SZ",
3486
+ english_name: "Swaziland",
3487
+ native_name: "Eswatini (Swaziland)"
3488
+ },
3489
+ {
3490
+ iso_3166_1: "TC",
3491
+ english_name: "Turks and Caicos Islands",
3492
+ native_name: "Turks & Caicos Islands"
3493
+ },
3494
+ {
3495
+ iso_3166_1: "TD",
3496
+ english_name: "Chad",
3497
+ native_name: "Chad"
3498
+ },
3499
+ {
3500
+ iso_3166_1: "TF",
3501
+ english_name: "French Southern Territories",
3502
+ native_name: "French Southern Territories"
3503
+ },
3504
+ {
3505
+ iso_3166_1: "TG",
3506
+ english_name: "Togo",
3507
+ native_name: "Togo"
3508
+ },
3509
+ {
3510
+ iso_3166_1: "TH",
3511
+ english_name: "Thailand",
3512
+ native_name: "Thailand"
3513
+ },
3514
+ {
3515
+ iso_3166_1: "TJ",
3516
+ english_name: "Tajikistan",
3517
+ native_name: "Tajikistan"
3518
+ },
3519
+ {
3520
+ iso_3166_1: "TK",
3521
+ english_name: "Tokelau",
3522
+ native_name: "Tokelau"
3523
+ },
3524
+ {
3525
+ iso_3166_1: "TL",
3526
+ english_name: "Timor-Leste",
3527
+ native_name: "Timor-Leste"
3528
+ },
3529
+ {
3530
+ iso_3166_1: "TM",
3531
+ english_name: "Turkmenistan",
3532
+ native_name: "Turkmenistan"
3533
+ },
3534
+ {
3535
+ iso_3166_1: "TN",
3536
+ english_name: "Tunisia",
3537
+ native_name: "Tunisia"
3538
+ },
3539
+ {
3540
+ iso_3166_1: "TO",
3541
+ english_name: "Tonga",
3542
+ native_name: "Tonga"
3543
+ },
3544
+ {
3545
+ iso_3166_1: "TP",
3546
+ english_name: "East Timor",
3547
+ native_name: "East Timor"
3548
+ },
3549
+ {
3550
+ iso_3166_1: "TR",
3551
+ english_name: "Turkey",
3552
+ native_name: "Turkey"
3553
+ },
3554
+ {
3555
+ iso_3166_1: "TT",
3556
+ english_name: "Trinidad and Tobago",
3557
+ native_name: "Trinidad & Tobago"
3558
+ },
3559
+ {
3560
+ iso_3166_1: "TV",
3561
+ english_name: "Tuvalu",
3562
+ native_name: "Tuvalu"
3563
+ },
3564
+ {
3565
+ iso_3166_1: "TW",
3566
+ english_name: "Taiwan",
3567
+ native_name: "Taiwan"
3568
+ },
3569
+ {
3570
+ iso_3166_1: "TZ",
3571
+ english_name: "Tanzania",
3572
+ native_name: "Tanzania"
3573
+ },
3574
+ {
3575
+ iso_3166_1: "UA",
3576
+ english_name: "Ukraine",
3577
+ native_name: "Ukraine"
3578
+ },
3579
+ {
3580
+ iso_3166_1: "UG",
3581
+ english_name: "Uganda",
3582
+ native_name: "Uganda"
3583
+ },
3584
+ {
3585
+ iso_3166_1: "UM",
3586
+ english_name: "United States Minor Outlying Islands",
3587
+ native_name: "U.S. Outlying Islands"
3588
+ },
3589
+ {
3590
+ iso_3166_1: "US",
3591
+ english_name: "United States of America",
3592
+ native_name: "United States"
3593
+ },
3594
+ {
3595
+ iso_3166_1: "UY",
3596
+ english_name: "Uruguay",
3597
+ native_name: "Uruguay"
3598
+ },
3599
+ {
3600
+ iso_3166_1: "UZ",
3601
+ english_name: "Uzbekistan",
3602
+ native_name: "Uzbekistan"
3603
+ },
3604
+ {
3605
+ iso_3166_1: "VA",
3606
+ english_name: "Holy See",
3607
+ native_name: "Vatican City"
3608
+ },
3609
+ {
3610
+ iso_3166_1: "VC",
3611
+ english_name: "St. Vincent and the Grenadines",
3612
+ native_name: "St. Vincent & Grenadines"
3613
+ },
3614
+ {
3615
+ iso_3166_1: "VE",
3616
+ english_name: "Venezuela",
3617
+ native_name: "Venezuela"
3618
+ },
3619
+ {
3620
+ iso_3166_1: "VG",
3621
+ english_name: "British Virgin Islands",
3622
+ native_name: "British Virgin Islands"
3623
+ },
3624
+ {
3625
+ iso_3166_1: "VI",
3626
+ english_name: "US Virgin Islands",
3627
+ native_name: "U.S. Virgin Islands"
3628
+ },
3629
+ {
3630
+ iso_3166_1: "VN",
3631
+ english_name: "Vietnam",
3632
+ native_name: "Vietnam"
3633
+ },
3634
+ {
3635
+ iso_3166_1: "VU",
3636
+ english_name: "Vanuatu",
3637
+ native_name: "Vanuatu"
3638
+ },
3639
+ {
3640
+ iso_3166_1: "WF",
3641
+ english_name: "Wallis and Futuna Islands",
3642
+ native_name: "Wallis & Futuna"
3643
+ },
3644
+ {
3645
+ iso_3166_1: "WS",
3646
+ english_name: "Samoa",
3647
+ native_name: "Samoa"
3648
+ },
3649
+ {
3650
+ iso_3166_1: "XC",
3651
+ english_name: "Czechoslovakia",
3652
+ native_name: "Czechoslovakia"
3653
+ },
3654
+ {
3655
+ iso_3166_1: "XG",
3656
+ english_name: "East Germany",
3657
+ native_name: "East Germany"
3658
+ },
3659
+ {
3660
+ iso_3166_1: "XI",
3661
+ english_name: "Northern Ireland",
3662
+ native_name: "Northern Ireland"
3663
+ },
3664
+ {
3665
+ iso_3166_1: "XK",
3666
+ english_name: "Kosovo",
3667
+ native_name: "Kosovo"
3668
+ },
3669
+ {
3670
+ iso_3166_1: "YE",
3671
+ english_name: "Yemen",
3672
+ native_name: "Yemen"
3673
+ },
3674
+ {
3675
+ iso_3166_1: "YT",
3676
+ english_name: "Mayotte",
3677
+ native_name: "Mayotte"
3678
+ },
3679
+ {
3680
+ iso_3166_1: "YU",
3681
+ english_name: "Yugoslavia",
3682
+ native_name: "Yugoslavia"
3683
+ },
3684
+ {
3685
+ iso_3166_1: "ZA",
3686
+ english_name: "South Africa",
3687
+ native_name: "South Africa"
3688
+ },
3689
+ {
3690
+ iso_3166_1: "ZM",
3691
+ english_name: "Zambia",
3692
+ native_name: "Zambia"
3693
+ },
3694
+ {
3695
+ iso_3166_1: "ZR",
3696
+ english_name: "Zaire",
3697
+ native_name: "Zaire"
3698
+ },
3699
+ {
3700
+ iso_3166_1: "ZW",
3701
+ english_name: "Zimbabwe",
3702
+ native_name: "Zimbabwe"
3703
+ }
3704
+ ];
3705
+
3706
+ // src/types/discover.ts
3707
+ var DiscoverTVStatus = /* @__PURE__ */ ((DiscoverTVStatus2) => {
3708
+ DiscoverTVStatus2[DiscoverTVStatus2["ReturningSeries"] = 0] = "ReturningSeries";
3709
+ DiscoverTVStatus2[DiscoverTVStatus2["Planned"] = 1] = "Planned";
3710
+ DiscoverTVStatus2[DiscoverTVStatus2["InProduction"] = 2] = "InProduction";
3711
+ DiscoverTVStatus2[DiscoverTVStatus2["Ended"] = 3] = "Ended";
3712
+ DiscoverTVStatus2[DiscoverTVStatus2["Canceled"] = 4] = "Canceled";
3713
+ DiscoverTVStatus2[DiscoverTVStatus2["Pilot"] = 5] = "Pilot";
3714
+ return DiscoverTVStatus2;
3715
+ })(DiscoverTVStatus || {});
3716
+ var DiscoverTVType = /* @__PURE__ */ ((DiscoverTVType2) => {
3717
+ DiscoverTVType2[DiscoverTVType2["Documentary"] = 0] = "Documentary";
3718
+ DiscoverTVType2[DiscoverTVType2["News"] = 1] = "News";
3719
+ DiscoverTVType2[DiscoverTVType2["Miniseries"] = 2] = "Miniseries";
3720
+ DiscoverTVType2[DiscoverTVType2["Reality"] = 3] = "Reality";
3721
+ DiscoverTVType2[DiscoverTVType2["Scripted"] = 4] = "Scripted";
3722
+ DiscoverTVType2[DiscoverTVType2["TalkShow"] = 5] = "TalkShow";
3723
+ DiscoverTVType2[DiscoverTVType2["Video"] = 6] = "Video";
3724
+ return DiscoverTVType2;
3725
+ })(DiscoverTVType || {});
3726
+
3727
+ // src/types/utility.ts
3728
+ function isKnownForMovie(item) {
3729
+ return item.media_type === "movie";
3730
+ }
3731
+ function isKnownForTV(item) {
3732
+ return item.media_type === "tv";
3733
+ }
3734
+
3735
+ // src/types/tv-episode-groups.ts
3736
+ var TVEpisodeGroupType = /* @__PURE__ */ ((TVEpisodeGroupType2) => {
3737
+ TVEpisodeGroupType2[TVEpisodeGroupType2["OriginalAirDate"] = 1] = "OriginalAirDate";
3738
+ TVEpisodeGroupType2[TVEpisodeGroupType2["Absolute"] = 2] = "Absolute";
3739
+ TVEpisodeGroupType2[TVEpisodeGroupType2["Dvd"] = 3] = "Dvd";
3740
+ TVEpisodeGroupType2[TVEpisodeGroupType2["Digital"] = 4] = "Digital";
3741
+ TVEpisodeGroupType2[TVEpisodeGroupType2["StoryArc"] = 5] = "StoryArc";
3742
+ TVEpisodeGroupType2[TVEpisodeGroupType2["Production"] = 6] = "Production";
3743
+ TVEpisodeGroupType2[TVEpisodeGroupType2["TV"] = 7] = "TV";
3744
+ return TVEpisodeGroupType2;
3745
+ })(TVEpisodeGroupType || {});
3746
+
3747
+ export { BACKDROP_SIZES, DiscoverTVStatus, DiscoverTVType, IMAGE_BASE_URL, IMAGE_SECURE_BASE_URL, LOGO_SIZES, POSTER_SIZES, PROFILE_SIZES, STILL_SIZES, TMDB, TMDBCountries, TMDBError, TMDBLogger, TVEpisodeGroupType, hasBackdropPath, hasLogoPath, hasPosterPath, hasProfilePath, hasStillPath, isJwt, isKnownForMovie, isKnownForTV };