@lorenzopant/tmdb 1.17.0 → 1.17.2

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