@lorenzopant/tmdb 1.19.0 → 1.20.1

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