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