@lorenzopant/tmdb 1.17.4 → 1.18.0

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