@tdanks2000/tmdb-wrapper 1.4.0 → 1.6.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/README.md +7 -7
- package/dist/index.cjs +233 -127
- package/dist/index.d.cts +201 -377
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +201 -377
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +233 -128
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -113,6 +113,39 @@ let ReleaseDateType = /* @__PURE__ */ function(ReleaseDateType$1) {
|
|
|
113
113
|
//#endregion
|
|
114
114
|
//#region src/utils/api.ts
|
|
115
115
|
const BASE_URL_V3 = "https://api.themoviedb.org/3";
|
|
116
|
+
var TMDBError = class extends Error {
|
|
117
|
+
constructor(message, status, url, payload) {
|
|
118
|
+
super(message);
|
|
119
|
+
this.status = status;
|
|
120
|
+
this.url = url;
|
|
121
|
+
this.payload = payload;
|
|
122
|
+
this.name = "TMDBError";
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
const parseOptions = (options) => {
|
|
126
|
+
if (!options) return "";
|
|
127
|
+
const entries = [];
|
|
128
|
+
for (const [key, value] of Object.entries(options)) {
|
|
129
|
+
if (value === void 0 || value === null) continue;
|
|
130
|
+
if (Array.isArray(value)) for (const item of value) {
|
|
131
|
+
if (item === void 0 || item === null) continue;
|
|
132
|
+
entries.push([key, String(item)]);
|
|
133
|
+
}
|
|
134
|
+
else entries.push([key, String(value)]);
|
|
135
|
+
}
|
|
136
|
+
return new URLSearchParams(entries).toString();
|
|
137
|
+
};
|
|
138
|
+
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
139
|
+
const shouldRetry = (status) => status === 429 || status === 502 || status === 503 || status === 504;
|
|
140
|
+
const readRetryAfterMs = (res) => {
|
|
141
|
+
const raw = res.headers.get("retry-after");
|
|
142
|
+
if (!raw) return void 0;
|
|
143
|
+
const asSeconds = Number(raw);
|
|
144
|
+
if (Number.isFinite(asSeconds)) return Math.max(0, asSeconds * 1e3);
|
|
145
|
+
const asDate = Date.parse(raw);
|
|
146
|
+
if (!Number.isNaN(asDate)) return Math.max(0, asDate - Date.now());
|
|
147
|
+
return void 0;
|
|
148
|
+
};
|
|
116
149
|
var API = class {
|
|
117
150
|
apiKey;
|
|
118
151
|
accessToken;
|
|
@@ -123,41 +156,55 @@ var API = class {
|
|
|
123
156
|
this.accessToken = auth.accessToken;
|
|
124
157
|
}
|
|
125
158
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
* @template O — options (query params) type
|
|
130
|
-
*/
|
|
131
|
-
async get(path, options) {
|
|
132
|
-
const rawOptions = {
|
|
133
|
-
...options ?? {},
|
|
159
|
+
async get(path, opts = {}) {
|
|
160
|
+
const query = {
|
|
161
|
+
...opts.query ? opts.query : {},
|
|
134
162
|
...this.apiKey ? { api_key: this.apiKey } : {}
|
|
135
163
|
};
|
|
136
|
-
const
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
164
|
+
const qs = parseOptions(query);
|
|
165
|
+
const url = `${BASE_URL_V3}${path}${qs ? `?${qs}` : ""}`;
|
|
166
|
+
const retries = opts.retries ?? 2;
|
|
167
|
+
const retryDelayMs = opts.retryDelayMs ?? 300;
|
|
168
|
+
const timeoutMs = opts.timeoutMs ?? 3e4;
|
|
169
|
+
const controller = new AbortController();
|
|
170
|
+
const timeout = setTimeout(() => controller.abort(), timeoutMs);
|
|
171
|
+
if (opts.signal) if (opts.signal.aborted) controller.abort();
|
|
172
|
+
else opts.signal.addEventListener("abort", () => controller.abort(), { once: true });
|
|
173
|
+
try {
|
|
174
|
+
for (let attempt = 0; attempt <= retries; attempt++) {
|
|
175
|
+
const res = await fetch(url, {
|
|
176
|
+
method: "GET",
|
|
177
|
+
signal: controller.signal,
|
|
178
|
+
headers: {
|
|
179
|
+
...this.accessToken ? { Authorization: `Bearer ${this.accessToken}` } : {},
|
|
180
|
+
Accept: "application/json"
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
if (res.ok) return await res.json();
|
|
184
|
+
let payload;
|
|
185
|
+
let message = `${res.status} ${res.statusText}`;
|
|
186
|
+
try {
|
|
187
|
+
payload = await res.json();
|
|
188
|
+
if (payload && typeof payload === "object" && "status_message" in payload) message = String(payload.status_message);
|
|
189
|
+
} catch {
|
|
190
|
+
try {
|
|
191
|
+
payload = await res.text();
|
|
192
|
+
} catch {}
|
|
193
|
+
}
|
|
194
|
+
if (attempt < retries && shouldRetry(res.status)) {
|
|
195
|
+
const retryAfter = readRetryAfterMs(res);
|
|
196
|
+
const delay = retryAfter ?? retryDelayMs * 2 ** attempt;
|
|
197
|
+
await sleep(delay);
|
|
198
|
+
continue;
|
|
199
|
+
}
|
|
200
|
+
throw new TMDBError(message, res.status, url, payload);
|
|
142
201
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
return Promise.reject(error);
|
|
202
|
+
throw new TMDBError("Request failed", 0, url);
|
|
203
|
+
} finally {
|
|
204
|
+
clearTimeout(timeout);
|
|
147
205
|
}
|
|
148
|
-
return await response.json();
|
|
149
206
|
}
|
|
150
207
|
};
|
|
151
|
-
const parseOptions = (options) => {
|
|
152
|
-
if (!options) return "";
|
|
153
|
-
const entries = [];
|
|
154
|
-
for (const [key, value] of Object.entries(options)) {
|
|
155
|
-
if (value === void 0 || value === null) continue;
|
|
156
|
-
if (Array.isArray(value)) for (const item of value) entries.push([key, String(item)]);
|
|
157
|
-
else entries.push([key, String(value)]);
|
|
158
|
-
}
|
|
159
|
-
return new URLSearchParams(entries).toString();
|
|
160
|
-
};
|
|
161
208
|
|
|
162
209
|
//#endregion
|
|
163
210
|
//#region src/utils/getimagePath.ts
|
|
@@ -214,8 +261,23 @@ const formImage = (image, fileSize, format) => {
|
|
|
214
261
|
|
|
215
262
|
//#endregion
|
|
216
263
|
//#region src/@types/models/baseEndpoint.ts
|
|
264
|
+
/**
|
|
265
|
+
* Base class for all TMDB API endpoints.
|
|
266
|
+
*
|
|
267
|
+
* Provides a configured {@link API} client instance to subclasses.
|
|
268
|
+
*/
|
|
217
269
|
var BaseEndpoint = class {
|
|
270
|
+
/**
|
|
271
|
+
* Low-level HTTP client wrapper used by all endpoints.
|
|
272
|
+
*/
|
|
218
273
|
api;
|
|
274
|
+
/**
|
|
275
|
+
* Create a new endpoint instance.
|
|
276
|
+
*
|
|
277
|
+
* @param {TokenType} auth - Authentication information.
|
|
278
|
+
* - If a string: treated as a v4 API Read Access Token (Bearer token).
|
|
279
|
+
* - If an object: can include an API key and/or access token.
|
|
280
|
+
*/
|
|
219
281
|
constructor(auth) {
|
|
220
282
|
this.auth = auth;
|
|
221
283
|
this.api = new API(auth);
|
|
@@ -226,11 +288,20 @@ var BaseEndpoint = class {
|
|
|
226
288
|
//#region src/endpoints/account.ts
|
|
227
289
|
/**
|
|
228
290
|
* Represents an endpoint for retrieving account details.
|
|
291
|
+
*
|
|
292
|
+
* TMDB v3 reference:
|
|
293
|
+
* - GET /account/{account_id}
|
|
294
|
+
*
|
|
295
|
+
* Note:
|
|
296
|
+
* TMDB does not expose a generic "GET /account" for account details. You must
|
|
297
|
+
* provide an `account_id`. Most apps obtain it from an auth flow and then cache
|
|
298
|
+
* it for subsequent requests.
|
|
229
299
|
*/
|
|
230
300
|
var AccountEndpoint = class extends BaseEndpoint {
|
|
231
301
|
/**
|
|
232
302
|
* Constructs a new AccountEndpoint instance.
|
|
233
|
-
*
|
|
303
|
+
*
|
|
304
|
+
* @param {TokenType} access_token - The access token used for authentication.
|
|
234
305
|
*/
|
|
235
306
|
constructor(access_token) {
|
|
236
307
|
super(access_token);
|
|
@@ -238,10 +309,14 @@ var AccountEndpoint = class extends BaseEndpoint {
|
|
|
238
309
|
}
|
|
239
310
|
/**
|
|
240
311
|
* Retrieves account details asynchronously.
|
|
312
|
+
*
|
|
313
|
+
* TMDB: GET /account/{account_id}
|
|
314
|
+
*
|
|
315
|
+
* @param {number} accountId - The TMDB account ID.
|
|
241
316
|
* @returns {Promise<AccountDetails>} A Promise that resolves with the account details.
|
|
242
317
|
*/
|
|
243
|
-
|
|
244
|
-
return
|
|
318
|
+
details(accountId) {
|
|
319
|
+
return this.api.get(`/account/${accountId}`);
|
|
245
320
|
}
|
|
246
321
|
};
|
|
247
322
|
|
|
@@ -249,11 +324,16 @@ var AccountEndpoint = class extends BaseEndpoint {
|
|
|
249
324
|
//#region src/endpoints/certification.ts
|
|
250
325
|
/**
|
|
251
326
|
* Represents an endpoint for retrieving certifications for movies and TV shows.
|
|
327
|
+
*
|
|
328
|
+
* TMDB v3 reference:
|
|
329
|
+
* - GET /certification/movie/list
|
|
330
|
+
* - GET /certification/tv/list
|
|
252
331
|
*/
|
|
253
332
|
var CertificationEndpoint = class extends BaseEndpoint {
|
|
254
333
|
/**
|
|
255
334
|
* Constructs a new CertificationEndpoint instance.
|
|
256
|
-
*
|
|
335
|
+
*
|
|
336
|
+
* @param {TokenType} access_token - The access token used for authentication.
|
|
257
337
|
*/
|
|
258
338
|
constructor(access_token) {
|
|
259
339
|
super(access_token);
|
|
@@ -261,17 +341,23 @@ var CertificationEndpoint = class extends BaseEndpoint {
|
|
|
261
341
|
}
|
|
262
342
|
/**
|
|
263
343
|
* Retrieves certifications for movies asynchronously.
|
|
344
|
+
*
|
|
345
|
+
* TMDB: GET /certification/movie/list
|
|
346
|
+
*
|
|
264
347
|
* @returns {Promise<Certifications>} A Promise that resolves with the certifications for movies.
|
|
265
348
|
*/
|
|
266
|
-
|
|
267
|
-
return
|
|
349
|
+
movies() {
|
|
350
|
+
return this.api.get("/certification/movie/list");
|
|
268
351
|
}
|
|
269
352
|
/**
|
|
270
353
|
* Retrieves certifications for TV shows asynchronously.
|
|
354
|
+
*
|
|
355
|
+
* TMDB: GET /certification/tv/list
|
|
356
|
+
*
|
|
271
357
|
* @returns {Promise<Certifications>} A Promise that resolves with the certifications for TV shows.
|
|
272
358
|
*/
|
|
273
|
-
|
|
274
|
-
return
|
|
359
|
+
tv() {
|
|
360
|
+
return this.api.get("/certification/tv/list");
|
|
275
361
|
}
|
|
276
362
|
};
|
|
277
363
|
|
|
@@ -279,11 +365,17 @@ var CertificationEndpoint = class extends BaseEndpoint {
|
|
|
279
365
|
//#region src/endpoints/changes.ts
|
|
280
366
|
/**
|
|
281
367
|
* Represents an endpoint for retrieving changes in movies, TV shows, and persons.
|
|
368
|
+
*
|
|
369
|
+
* TMDB v3 reference:
|
|
370
|
+
* - GET /movie/changes
|
|
371
|
+
* - GET /tv/changes
|
|
372
|
+
* - GET /person/changes
|
|
282
373
|
*/
|
|
283
374
|
var ChangeEndpoint = class extends BaseEndpoint {
|
|
284
375
|
/**
|
|
285
376
|
* Constructs a new ChangeEndpoint instance.
|
|
286
|
-
*
|
|
377
|
+
*
|
|
378
|
+
* @param {TokenType} access_token - The access token used for authentication.
|
|
287
379
|
*/
|
|
288
380
|
constructor(access_token) {
|
|
289
381
|
super(access_token);
|
|
@@ -291,27 +383,36 @@ var ChangeEndpoint = class extends BaseEndpoint {
|
|
|
291
383
|
}
|
|
292
384
|
/**
|
|
293
385
|
* Retrieves changes in movies asynchronously.
|
|
386
|
+
*
|
|
387
|
+
* TMDB: GET /movie/changes
|
|
388
|
+
*
|
|
294
389
|
* @param {ChangeOption} [options] - Optional parameters for filtering the changes.
|
|
295
390
|
* @returns {Promise<MediaChanges>} A Promise that resolves with the changes in movies.
|
|
296
391
|
*/
|
|
297
|
-
|
|
298
|
-
return
|
|
392
|
+
movies(options) {
|
|
393
|
+
return this.api.get("/movie/changes", { query: options });
|
|
299
394
|
}
|
|
300
395
|
/**
|
|
301
396
|
* Retrieves changes in TV shows asynchronously.
|
|
397
|
+
*
|
|
398
|
+
* TMDB: GET /tv/changes
|
|
399
|
+
*
|
|
302
400
|
* @param {ChangeOption} [options] - Optional parameters for filtering the changes.
|
|
303
401
|
* @returns {Promise<MediaChanges>} A Promise that resolves with the changes in TV shows.
|
|
304
402
|
*/
|
|
305
|
-
|
|
306
|
-
return
|
|
403
|
+
tv(options) {
|
|
404
|
+
return this.api.get("/tv/changes", { query: options });
|
|
307
405
|
}
|
|
308
406
|
/**
|
|
309
407
|
* Retrieves changes related to persons asynchronously.
|
|
408
|
+
*
|
|
409
|
+
* TMDB: GET /person/changes
|
|
410
|
+
*
|
|
310
411
|
* @param {ChangeOption} [options] - Optional parameters for filtering the changes.
|
|
311
412
|
* @returns {Promise<MediaChanges>} A Promise that resolves with the changes related to persons.
|
|
312
413
|
*/
|
|
313
|
-
|
|
314
|
-
return
|
|
414
|
+
person(options) {
|
|
415
|
+
return this.api.get("/person/changes", { query: options });
|
|
315
416
|
}
|
|
316
417
|
};
|
|
317
418
|
|
|
@@ -337,7 +438,7 @@ var CollectionsEndpoint = class extends BaseEndpoint {
|
|
|
337
438
|
* @returns {Promise<DetailedCollection>} A Promise that resolves with the detailed information of the collection.
|
|
338
439
|
*/
|
|
339
440
|
async details(id, options) {
|
|
340
|
-
return await this.api.get(`${BASE_COLLECTION}/${id}`, options);
|
|
441
|
+
return await this.api.get(`${BASE_COLLECTION}/${id}`, { query: options });
|
|
341
442
|
}
|
|
342
443
|
/**
|
|
343
444
|
* Retrieves images associated with a specific collection asynchronously.
|
|
@@ -350,7 +451,7 @@ var CollectionsEndpoint = class extends BaseEndpoint {
|
|
|
350
451
|
include_image_language: options?.include_image_language?.join(","),
|
|
351
452
|
language: options?.language
|
|
352
453
|
};
|
|
353
|
-
return await this.api.get(`${BASE_COLLECTION}/${id}/images`, computedOptions);
|
|
454
|
+
return await this.api.get(`${BASE_COLLECTION}/${id}/images`, { query: computedOptions });
|
|
354
455
|
}
|
|
355
456
|
/**
|
|
356
457
|
* Retrieves translations for a specific collection asynchronously.
|
|
@@ -359,7 +460,7 @@ var CollectionsEndpoint = class extends BaseEndpoint {
|
|
|
359
460
|
* @returns {Promise<Translations>} A Promise that resolves with the translations of the collection.
|
|
360
461
|
*/
|
|
361
462
|
async translations(id, options) {
|
|
362
|
-
return await this.api.get(`${BASE_COLLECTION}/${id}/translations`, options);
|
|
463
|
+
return await this.api.get(`${BASE_COLLECTION}/${id}/translations`, { query: options });
|
|
363
464
|
}
|
|
364
465
|
};
|
|
365
466
|
|
|
@@ -455,11 +556,16 @@ var CreditsEndpoint = class extends BaseEndpoint {
|
|
|
455
556
|
const BASE_DISCOVER = "/discover";
|
|
456
557
|
/**
|
|
457
558
|
* Represents an endpoint for discovering movies and TV shows based on various criteria.
|
|
559
|
+
*
|
|
560
|
+
* TMDB v3 reference:
|
|
561
|
+
* - GET /discover/movie
|
|
562
|
+
* - GET /discover/tv
|
|
458
563
|
*/
|
|
459
564
|
var DiscoverEndpoint = class extends BaseEndpoint {
|
|
460
565
|
/**
|
|
461
566
|
* Constructs a new DiscoverEndpoint instance.
|
|
462
|
-
*
|
|
567
|
+
*
|
|
568
|
+
* @param {TokenType} access_token - The access token used for authentication.
|
|
463
569
|
*/
|
|
464
570
|
constructor(access_token) {
|
|
465
571
|
super(access_token);
|
|
@@ -467,19 +573,25 @@ var DiscoverEndpoint = class extends BaseEndpoint {
|
|
|
467
573
|
}
|
|
468
574
|
/**
|
|
469
575
|
* Retrieves a list of movies based on the provided query options asynchronously.
|
|
576
|
+
*
|
|
577
|
+
* TMDB: GET /discover/movie
|
|
578
|
+
*
|
|
470
579
|
* @param {MovieQueryOptions} [options] - Optional parameters for refining the movie discovery.
|
|
471
580
|
* @returns {Promise<MovieDiscoverResult>} A Promise that resolves with the movie discovery results.
|
|
472
581
|
*/
|
|
473
|
-
|
|
474
|
-
return
|
|
582
|
+
movie(options) {
|
|
583
|
+
return this.api.get(`${BASE_DISCOVER}/movie`, { query: options });
|
|
475
584
|
}
|
|
476
585
|
/**
|
|
477
586
|
* Retrieves a list of TV shows based on the provided query options asynchronously.
|
|
587
|
+
*
|
|
588
|
+
* TMDB: GET /discover/tv
|
|
589
|
+
*
|
|
478
590
|
* @param {TvShowQueryOptions} [options] - Optional parameters for refining the TV show discovery.
|
|
479
591
|
* @returns {Promise<TvShowDiscoverResult>} A Promise that resolves with the TV show discovery results.
|
|
480
592
|
*/
|
|
481
|
-
|
|
482
|
-
return
|
|
593
|
+
tvShow(options) {
|
|
594
|
+
return this.api.get(`${BASE_DISCOVER}/tv`, { query: options });
|
|
483
595
|
}
|
|
484
596
|
};
|
|
485
597
|
|
|
@@ -504,7 +616,7 @@ var FindEndpoint = class extends BaseEndpoint {
|
|
|
504
616
|
* @returns {Promise<FindResult>} A Promise that resolves with the result of the find operation.
|
|
505
617
|
*/
|
|
506
618
|
async byId(externalId, options) {
|
|
507
|
-
return await this.api.get(`/find/${externalId}`, options);
|
|
619
|
+
return await this.api.get(`/find/${externalId}`, { query: options });
|
|
508
620
|
}
|
|
509
621
|
};
|
|
510
622
|
|
|
@@ -528,7 +640,7 @@ var GenreEndpoint = class extends BaseEndpoint {
|
|
|
528
640
|
* @returns {Promise<Genres>} A Promise that resolves with the genre information for movies.
|
|
529
641
|
*/
|
|
530
642
|
async movies(options) {
|
|
531
|
-
return await this.api.get("/genre/movie/list", options);
|
|
643
|
+
return await this.api.get("/genre/movie/list", { query: options });
|
|
532
644
|
}
|
|
533
645
|
/**
|
|
534
646
|
* Retrieves genre information for TV shows asynchronously.
|
|
@@ -536,7 +648,7 @@ var GenreEndpoint = class extends BaseEndpoint {
|
|
|
536
648
|
* @returns {Promise<Genres>} A Promise that resolves with the genre information for TV shows.
|
|
537
649
|
*/
|
|
538
650
|
async tv(options) {
|
|
539
|
-
return await this.api.get("/genre/tv/list", options);
|
|
651
|
+
return await this.api.get("/genre/tv/list", { query: options });
|
|
540
652
|
}
|
|
541
653
|
};
|
|
542
654
|
|
|
@@ -570,7 +682,7 @@ var KeywordsEndpoint = class extends BaseEndpoint {
|
|
|
570
682
|
* @returns {Promise<BelongingMovies>} A Promise that resolves with the movies belonging to the keyword.
|
|
571
683
|
*/
|
|
572
684
|
async belongingMovies(keywordId, options) {
|
|
573
|
-
return await this.api.get(`${BASE_KEYWORD}/${keywordId}/movies`, options);
|
|
685
|
+
return await this.api.get(`${BASE_KEYWORD}/${keywordId}/movies`, { query: options });
|
|
574
686
|
}
|
|
575
687
|
};
|
|
576
688
|
|
|
@@ -597,11 +709,11 @@ var MoviesEndpoint = class extends BaseEndpoint {
|
|
|
597
709
|
* @returns {Promise<AppendToResponse<MovieDetails, AppendToResponseMovieKey[], 'movie'>>} A Promise that resolves with the details of the movie.
|
|
598
710
|
*/
|
|
599
711
|
async details(id, appendToResponse, language) {
|
|
600
|
-
const
|
|
712
|
+
const query = {
|
|
601
713
|
append_to_response: appendToResponse ? appendToResponse.join(",") : void 0,
|
|
602
714
|
language
|
|
603
715
|
};
|
|
604
|
-
return await this.api.get(`${BASE_MOVIE}/${id}`,
|
|
716
|
+
return await this.api.get(`${BASE_MOVIE}/${id}`, { query });
|
|
605
717
|
}
|
|
606
718
|
/**
|
|
607
719
|
* Retrieves alternative titles of a specific movie asynchronously.
|
|
@@ -618,7 +730,7 @@ var MoviesEndpoint = class extends BaseEndpoint {
|
|
|
618
730
|
* @returns {Promise<Changes<MovieChangeValue>>} A Promise that resolves with the changes made to the movie.
|
|
619
731
|
*/
|
|
620
732
|
async changes(id, options) {
|
|
621
|
-
return await this.api.get(`${BASE_MOVIE}/${id}/changes`, options);
|
|
733
|
+
return await this.api.get(`${BASE_MOVIE}/${id}/changes`, { query: options });
|
|
622
734
|
}
|
|
623
735
|
/**
|
|
624
736
|
* Retrieves credits of a specific movie asynchronously.
|
|
@@ -627,7 +739,7 @@ var MoviesEndpoint = class extends BaseEndpoint {
|
|
|
627
739
|
* @returns {Promise<Credits>} A Promise that resolves with the credits of the movie.
|
|
628
740
|
*/
|
|
629
741
|
async credits(id, options) {
|
|
630
|
-
return await this.api.get(`${BASE_MOVIE}/${id}/credits`, options);
|
|
742
|
+
return await this.api.get(`${BASE_MOVIE}/${id}/credits`, { query: options });
|
|
631
743
|
}
|
|
632
744
|
/**
|
|
633
745
|
* Retrieves external IDs of a specific movie asynchronously.
|
|
@@ -648,7 +760,7 @@ var MoviesEndpoint = class extends BaseEndpoint {
|
|
|
648
760
|
include_image_language: options?.include_image_language?.join(","),
|
|
649
761
|
language: options?.language
|
|
650
762
|
};
|
|
651
|
-
return await this.api.get(`${BASE_MOVIE}/${id}/images`, computedOptions);
|
|
763
|
+
return await this.api.get(`${BASE_MOVIE}/${id}/images`, { query: computedOptions });
|
|
652
764
|
}
|
|
653
765
|
/**
|
|
654
766
|
* Retrieves keywords of a specific movie asynchronously.
|
|
@@ -665,7 +777,7 @@ var MoviesEndpoint = class extends BaseEndpoint {
|
|
|
665
777
|
* @returns {Promise<MovieLists>} A Promise that resolves with the lists containing the movie.
|
|
666
778
|
*/
|
|
667
779
|
async lists(id, options) {
|
|
668
|
-
return await this.api.get(`${BASE_MOVIE}/${id}/lists`, options);
|
|
780
|
+
return await this.api.get(`${BASE_MOVIE}/${id}/lists`, { query: options });
|
|
669
781
|
}
|
|
670
782
|
/**
|
|
671
783
|
* Retrieves recommendations for a specific movie asynchronously.
|
|
@@ -674,7 +786,7 @@ var MoviesEndpoint = class extends BaseEndpoint {
|
|
|
674
786
|
* @returns {Promise<Recommendations>} A Promise that resolves with the recommendations for the movie.
|
|
675
787
|
*/
|
|
676
788
|
async recommendations(id, options) {
|
|
677
|
-
return await this.api.get(`${BASE_MOVIE}/${id}/recommendations`, options);
|
|
789
|
+
return await this.api.get(`${BASE_MOVIE}/${id}/recommendations`, { query: options });
|
|
678
790
|
}
|
|
679
791
|
/**
|
|
680
792
|
* Retrieves release dates of a specific movie asynchronously.
|
|
@@ -691,7 +803,7 @@ var MoviesEndpoint = class extends BaseEndpoint {
|
|
|
691
803
|
* @returns {Promise<Reviews>} A Promise that resolves with the reviews for the movie.
|
|
692
804
|
*/
|
|
693
805
|
async reviews(id, options) {
|
|
694
|
-
return await this.api.get(`${BASE_MOVIE}/${id}/reviews`, options);
|
|
806
|
+
return await this.api.get(`${BASE_MOVIE}/${id}/reviews`, { query: options });
|
|
695
807
|
}
|
|
696
808
|
/**
|
|
697
809
|
* Retrieves similar movies for a specific movie asynchronously.
|
|
@@ -700,7 +812,7 @@ var MoviesEndpoint = class extends BaseEndpoint {
|
|
|
700
812
|
* @returns {Promise<SimilarMovies>} A Promise that resolves with the similar movies for the movie.
|
|
701
813
|
*/
|
|
702
814
|
async similar(id, options) {
|
|
703
|
-
return await this.api.get(`${BASE_MOVIE}/${id}/similar`, options);
|
|
815
|
+
return await this.api.get(`${BASE_MOVIE}/${id}/similar`, { query: options });
|
|
704
816
|
}
|
|
705
817
|
/**
|
|
706
818
|
* Retrieves translations of a specific movie asynchronously.
|
|
@@ -717,7 +829,7 @@ var MoviesEndpoint = class extends BaseEndpoint {
|
|
|
717
829
|
* @returns {Promise<Videos>} A Promise that resolves with the videos of the movie.
|
|
718
830
|
*/
|
|
719
831
|
async videos(id, options) {
|
|
720
|
-
return await this.api.get(`${BASE_MOVIE}/${id}/videos`, options);
|
|
832
|
+
return await this.api.get(`${BASE_MOVIE}/${id}/videos`, { query: options });
|
|
721
833
|
}
|
|
722
834
|
/**
|
|
723
835
|
* Retrieves watch providers of a specific movie asynchronously.
|
|
@@ -740,7 +852,7 @@ var MoviesEndpoint = class extends BaseEndpoint {
|
|
|
740
852
|
* @returns {Promise<MoviesPlayingNow>} A Promise that resolves with the movies playing now.
|
|
741
853
|
*/
|
|
742
854
|
async nowPlaying(options) {
|
|
743
|
-
return await this.api.get(`${BASE_MOVIE}/now_playing`, options);
|
|
855
|
+
return await this.api.get(`${BASE_MOVIE}/now_playing`, { query: options });
|
|
744
856
|
}
|
|
745
857
|
/**
|
|
746
858
|
* Retrieves popular movies asynchronously.
|
|
@@ -748,7 +860,7 @@ var MoviesEndpoint = class extends BaseEndpoint {
|
|
|
748
860
|
* @returns {Promise<PopularMovies>} A Promise that resolves with the popular movies.
|
|
749
861
|
*/
|
|
750
862
|
async popular(options) {
|
|
751
|
-
return await this.api.get(`${BASE_MOVIE}/popular`, options);
|
|
863
|
+
return await this.api.get(`${BASE_MOVIE}/popular`, { query: options });
|
|
752
864
|
}
|
|
753
865
|
/**
|
|
754
866
|
* Retrieves top rated movies asynchronously.
|
|
@@ -756,7 +868,7 @@ var MoviesEndpoint = class extends BaseEndpoint {
|
|
|
756
868
|
* @returns {Promise<TopRatedMovies>} A Promise that resolves with the top rated movies.
|
|
757
869
|
*/
|
|
758
870
|
async topRated(options) {
|
|
759
|
-
return await this.api.get(`${BASE_MOVIE}/top_rated`, options);
|
|
871
|
+
return await this.api.get(`${BASE_MOVIE}/top_rated`, { query: options });
|
|
760
872
|
}
|
|
761
873
|
/**
|
|
762
874
|
* Retrieves upcoming movies asynchronously.
|
|
@@ -764,7 +876,7 @@ var MoviesEndpoint = class extends BaseEndpoint {
|
|
|
764
876
|
* @returns {Promise<UpcomingMovies>} A Promise that resolves with the upcoming movies.
|
|
765
877
|
*/
|
|
766
878
|
async upcoming(options) {
|
|
767
|
-
return await this.api.get(`${BASE_MOVIE}/upcoming`, options);
|
|
879
|
+
return await this.api.get(`${BASE_MOVIE}/upcoming`, { query: options });
|
|
768
880
|
}
|
|
769
881
|
};
|
|
770
882
|
|
|
@@ -835,7 +947,7 @@ var PeopleEndpoint = class extends BaseEndpoint {
|
|
|
835
947
|
append_to_response: appendToResponse ? appendToResponse.join(",") : void 0,
|
|
836
948
|
language
|
|
837
949
|
};
|
|
838
|
-
return await this.api.get(`${BASE_PERSON}/${id}`, options);
|
|
950
|
+
return await this.api.get(`${BASE_PERSON}/${id}`, { query: options });
|
|
839
951
|
}
|
|
840
952
|
/**
|
|
841
953
|
* Retrieves changes made to a specific person asynchronously.
|
|
@@ -844,7 +956,7 @@ var PeopleEndpoint = class extends BaseEndpoint {
|
|
|
844
956
|
* @returns {Promise<Changes<PersonChangeValue>>} A Promise that resolves with the changes made to the person.
|
|
845
957
|
*/
|
|
846
958
|
async changes(id, options) {
|
|
847
|
-
return await this.api.get(`${BASE_PERSON}/${id}/changes`, options);
|
|
959
|
+
return await this.api.get(`${BASE_PERSON}/${id}/changes`, { query: options });
|
|
848
960
|
}
|
|
849
961
|
/**
|
|
850
962
|
* Retrieves movie credits of a specific person asynchronously.
|
|
@@ -853,7 +965,7 @@ var PeopleEndpoint = class extends BaseEndpoint {
|
|
|
853
965
|
* @returns {Promise<PersonMovieCredit>} A Promise that resolves with the movie credits of the person.
|
|
854
966
|
*/
|
|
855
967
|
async movieCredits(id, options) {
|
|
856
|
-
return await this.api.get(`${BASE_PERSON}/${id}/movie_credits`, options);
|
|
968
|
+
return await this.api.get(`${BASE_PERSON}/${id}/movie_credits`, { query: options });
|
|
857
969
|
}
|
|
858
970
|
/**
|
|
859
971
|
* Retrieves TV show credits of a specific person asynchronously.
|
|
@@ -862,7 +974,7 @@ var PeopleEndpoint = class extends BaseEndpoint {
|
|
|
862
974
|
* @returns {Promise<PersonTvShowCredit>} A Promise that resolves with the TV show credits of the person.
|
|
863
975
|
*/
|
|
864
976
|
async tvShowCredits(id, options) {
|
|
865
|
-
return await this.api.get(`${BASE_PERSON}/${id}/tv_credits`, options);
|
|
977
|
+
return await this.api.get(`${BASE_PERSON}/${id}/tv_credits`, { query: options });
|
|
866
978
|
}
|
|
867
979
|
/**
|
|
868
980
|
* Retrieves combined credits of a specific person asynchronously.
|
|
@@ -871,7 +983,7 @@ var PeopleEndpoint = class extends BaseEndpoint {
|
|
|
871
983
|
* @returns {Promise<PersonCombinedCredits>} A Promise that resolves with the combined credits of the person.
|
|
872
984
|
*/
|
|
873
985
|
async combinedCredits(id, options) {
|
|
874
|
-
return await this.api.get(`${BASE_PERSON}/${id}/combined_credits`, options);
|
|
986
|
+
return await this.api.get(`${BASE_PERSON}/${id}/combined_credits`, { query: options });
|
|
875
987
|
}
|
|
876
988
|
/**
|
|
877
989
|
* Retrieves external IDs of a specific person asynchronously.
|
|
@@ -896,7 +1008,7 @@ var PeopleEndpoint = class extends BaseEndpoint {
|
|
|
896
1008
|
* @returns {Promise<TaggedImages>} A Promise that resolves with the tagged images of the person.
|
|
897
1009
|
*/
|
|
898
1010
|
async taggedImages(id, options) {
|
|
899
|
-
return await this.api.get(`${BASE_PERSON}/${id}/tagged_images`, options);
|
|
1011
|
+
return await this.api.get(`${BASE_PERSON}/${id}/tagged_images`, { query: options });
|
|
900
1012
|
}
|
|
901
1013
|
/**
|
|
902
1014
|
* Retrieves translations of a specific person asynchronously.
|
|
@@ -919,7 +1031,7 @@ var PeopleEndpoint = class extends BaseEndpoint {
|
|
|
919
1031
|
* @returns {Promise<PopularPersons>} A Promise that resolves with the popular persons.
|
|
920
1032
|
*/
|
|
921
1033
|
async popular(options) {
|
|
922
|
-
return await this.api.get(`${BASE_PERSON}/popular`, options);
|
|
1034
|
+
return await this.api.get(`${BASE_PERSON}/popular`, { query: options });
|
|
923
1035
|
}
|
|
924
1036
|
};
|
|
925
1037
|
|
|
@@ -968,7 +1080,7 @@ var SearchEndpoint = class extends BaseEndpoint {
|
|
|
968
1080
|
* @returns {Promise<Search<Company>>} A Promise that resolves with the search results for companies.
|
|
969
1081
|
*/
|
|
970
1082
|
async companies(options) {
|
|
971
|
-
return await this.api.get(`${BASE_SEARCH}/company`, options);
|
|
1083
|
+
return await this.api.get(`${BASE_SEARCH}/company`, { query: options });
|
|
972
1084
|
}
|
|
973
1085
|
/**
|
|
974
1086
|
* Searches for collections asynchronously.
|
|
@@ -976,7 +1088,7 @@ var SearchEndpoint = class extends BaseEndpoint {
|
|
|
976
1088
|
* @returns {Promise<Search<Collection>>} A Promise that resolves with the search results for collections.
|
|
977
1089
|
*/
|
|
978
1090
|
async collections(options) {
|
|
979
|
-
return await this.api.get(`${BASE_SEARCH}/collection`, options);
|
|
1091
|
+
return await this.api.get(`${BASE_SEARCH}/collection`, { query: options });
|
|
980
1092
|
}
|
|
981
1093
|
/**
|
|
982
1094
|
* Searches for keywords asynchronously.
|
|
@@ -984,7 +1096,7 @@ var SearchEndpoint = class extends BaseEndpoint {
|
|
|
984
1096
|
* @returns {Promise<Search<{ id: string; name: string }>>} A Promise that resolves with the search results for keywords.
|
|
985
1097
|
*/
|
|
986
1098
|
async keywords(options) {
|
|
987
|
-
return await this.api.get(`${BASE_SEARCH}/keyword`, options);
|
|
1099
|
+
return await this.api.get(`${BASE_SEARCH}/keyword`, { query: options });
|
|
988
1100
|
}
|
|
989
1101
|
/**
|
|
990
1102
|
* Searches for movies asynchronously.
|
|
@@ -992,7 +1104,7 @@ var SearchEndpoint = class extends BaseEndpoint {
|
|
|
992
1104
|
* @returns {Promise<Search<Movie>>} A Promise that resolves with the search results for movies.
|
|
993
1105
|
*/
|
|
994
1106
|
async movies(options) {
|
|
995
|
-
return await this.api.get(`${BASE_SEARCH}/movie`, options);
|
|
1107
|
+
return await this.api.get(`${BASE_SEARCH}/movie`, { query: options });
|
|
996
1108
|
}
|
|
997
1109
|
/**
|
|
998
1110
|
* Searches for people asynchronously.
|
|
@@ -1000,7 +1112,7 @@ var SearchEndpoint = class extends BaseEndpoint {
|
|
|
1000
1112
|
* @returns {Promise<Search<Person>>} A Promise that resolves with the search results for people.
|
|
1001
1113
|
*/
|
|
1002
1114
|
async people(options) {
|
|
1003
|
-
return await this.api.get(`${BASE_SEARCH}/person`, options);
|
|
1115
|
+
return await this.api.get(`${BASE_SEARCH}/person`, { query: options });
|
|
1004
1116
|
}
|
|
1005
1117
|
/**
|
|
1006
1118
|
* Searches for TV shows asynchronously.
|
|
@@ -1008,7 +1120,7 @@ var SearchEndpoint = class extends BaseEndpoint {
|
|
|
1008
1120
|
* @returns {Promise<Search<TV>>} A Promise that resolves with the search results for TV shows.
|
|
1009
1121
|
*/
|
|
1010
1122
|
async tv(options) {
|
|
1011
|
-
return await this.api.get(`${BASE_SEARCH}/tv`, options);
|
|
1123
|
+
return await this.api.get(`${BASE_SEARCH}/tv`, { query: options });
|
|
1012
1124
|
}
|
|
1013
1125
|
/**
|
|
1014
1126
|
* Performs a multi-search asynchronously.
|
|
@@ -1016,7 +1128,7 @@ var SearchEndpoint = class extends BaseEndpoint {
|
|
|
1016
1128
|
* @returns {Promise<Search<MultiSearchResult>>} A Promise that resolves with the multi-search results.
|
|
1017
1129
|
*/
|
|
1018
1130
|
async multi(options) {
|
|
1019
|
-
return await this.api.get(`${BASE_SEARCH}/multi`, options);
|
|
1131
|
+
return await this.api.get(`${BASE_SEARCH}/multi`, { query: options });
|
|
1020
1132
|
}
|
|
1021
1133
|
};
|
|
1022
1134
|
|
|
@@ -1043,7 +1155,7 @@ var TrendingEndpoint = class extends BaseEndpoint {
|
|
|
1043
1155
|
* @template T - The type of media being searched for (e.g., 'movie', 'tv').
|
|
1044
1156
|
*/
|
|
1045
1157
|
async trending(mediaType, timeWindow, options) {
|
|
1046
|
-
return await this.api.get(`/trending/${mediaType}/${timeWindow}`, options);
|
|
1158
|
+
return await this.api.get(`/trending/${mediaType}/${timeWindow}`, { query: options });
|
|
1047
1159
|
}
|
|
1048
1160
|
};
|
|
1049
1161
|
|
|
@@ -1077,7 +1189,7 @@ var TvEpisodesEndpoint = class extends BaseEndpoint {
|
|
|
1077
1189
|
append_to_response: appendToResponse ? appendToResponse.join(",") : void 0,
|
|
1078
1190
|
...options
|
|
1079
1191
|
};
|
|
1080
|
-
return await this.api.get(`${BASE_EPISODE(episodeSelection)}`, combinedOptions);
|
|
1192
|
+
return await this.api.get(`${BASE_EPISODE(episodeSelection)}`, { query: combinedOptions });
|
|
1081
1193
|
}
|
|
1082
1194
|
/**
|
|
1083
1195
|
* Retrieves changes related to a specific TV episode asynchronously.
|
|
@@ -1086,7 +1198,7 @@ var TvEpisodesEndpoint = class extends BaseEndpoint {
|
|
|
1086
1198
|
* @returns {Promise<Changes<TvEpisodeChangeValue>>} A Promise that resolves with the changes related to the TV episode.
|
|
1087
1199
|
*/
|
|
1088
1200
|
async changes(episodeID, options) {
|
|
1089
|
-
return await this.api.get(`/tv/episode/${episodeID}/changes`, options);
|
|
1201
|
+
return await this.api.get(`/tv/episode/${episodeID}/changes`, { query: options });
|
|
1090
1202
|
}
|
|
1091
1203
|
/**
|
|
1092
1204
|
* Retrieves credits for a specific TV episode asynchronously.
|
|
@@ -1095,7 +1207,7 @@ var TvEpisodesEndpoint = class extends BaseEndpoint {
|
|
|
1095
1207
|
* @returns {Promise<TvEpisodeCredit>} A Promise that resolves with the credits for the TV episode.
|
|
1096
1208
|
*/
|
|
1097
1209
|
async credits(episodeSelection, options) {
|
|
1098
|
-
return await this.api.get(`${BASE_EPISODE(episodeSelection)}/credits`, options);
|
|
1210
|
+
return await this.api.get(`${BASE_EPISODE(episodeSelection)}/credits`, { query: options });
|
|
1099
1211
|
}
|
|
1100
1212
|
/**
|
|
1101
1213
|
* Retrieves external IDs for a specific TV episode asynchronously.
|
|
@@ -1116,7 +1228,7 @@ var TvEpisodesEndpoint = class extends BaseEndpoint {
|
|
|
1116
1228
|
include_image_language: options?.include_image_language?.join(","),
|
|
1117
1229
|
language: options?.language
|
|
1118
1230
|
};
|
|
1119
|
-
return await this.api.get(`${BASE_EPISODE(episodeSelection)}/images`, computedOptions);
|
|
1231
|
+
return await this.api.get(`${BASE_EPISODE(episodeSelection)}/images`, { query: computedOptions });
|
|
1120
1232
|
}
|
|
1121
1233
|
/**
|
|
1122
1234
|
* Retrieves translations for a specific TV episode asynchronously.
|
|
@@ -1137,7 +1249,7 @@ var TvEpisodesEndpoint = class extends BaseEndpoint {
|
|
|
1137
1249
|
include_video_language: options?.include_video_language?.join(","),
|
|
1138
1250
|
language: options?.language
|
|
1139
1251
|
};
|
|
1140
|
-
return await this.api.get(`${BASE_EPISODE(episodeSelection)}/videos`, computedOptions);
|
|
1252
|
+
return await this.api.get(`${BASE_EPISODE(episodeSelection)}/videos`, { query: computedOptions });
|
|
1141
1253
|
}
|
|
1142
1254
|
};
|
|
1143
1255
|
|
|
@@ -1171,7 +1283,7 @@ var TvSeasonsEndpoint = class extends BaseEndpoint {
|
|
|
1171
1283
|
append_to_response: appendToResponse ? appendToResponse.join(",") : void 0,
|
|
1172
1284
|
...options
|
|
1173
1285
|
};
|
|
1174
|
-
return await this.api.get(`${BASE_SEASON(seasonSelection)}`, combinedOptions);
|
|
1286
|
+
return await this.api.get(`${BASE_SEASON(seasonSelection)}`, { query: combinedOptions });
|
|
1175
1287
|
}
|
|
1176
1288
|
/**
|
|
1177
1289
|
* Retrieves aggregate credits for a specific TV season asynchronously.
|
|
@@ -1180,7 +1292,7 @@ var TvSeasonsEndpoint = class extends BaseEndpoint {
|
|
|
1180
1292
|
* @returns {Promise<AggregateCredits>} A Promise that resolves with the aggregate credits for the TV season.
|
|
1181
1293
|
*/
|
|
1182
1294
|
async aggregateCredits(seasonSelection, options) {
|
|
1183
|
-
return await this.api.get(`${BASE_SEASON(seasonSelection)}/aggregate_credits`, options);
|
|
1295
|
+
return await this.api.get(`${BASE_SEASON(seasonSelection)}/aggregate_credits`, { query: options });
|
|
1184
1296
|
}
|
|
1185
1297
|
/**
|
|
1186
1298
|
* Retrieves changes related to a specific TV season asynchronously.
|
|
@@ -1189,7 +1301,7 @@ var TvSeasonsEndpoint = class extends BaseEndpoint {
|
|
|
1189
1301
|
* @returns {Promise<Changes<TvSeasonChangeValue>>} A Promise that resolves with the changes related to the TV season.
|
|
1190
1302
|
*/
|
|
1191
1303
|
async changes(seasonId, options) {
|
|
1192
|
-
return await this.api.get(`/tv/season/${seasonId}/changes`, options);
|
|
1304
|
+
return await this.api.get(`/tv/season/${seasonId}/changes`, { query: options });
|
|
1193
1305
|
}
|
|
1194
1306
|
/**
|
|
1195
1307
|
* Retrieves credits for a specific TV season asynchronously.
|
|
@@ -1198,7 +1310,7 @@ var TvSeasonsEndpoint = class extends BaseEndpoint {
|
|
|
1198
1310
|
* @returns {Promise<Credits>} A Promise that resolves with the credits for the TV season.
|
|
1199
1311
|
*/
|
|
1200
1312
|
async credits(seasonSelection, options) {
|
|
1201
|
-
return await this.api.get(`${BASE_SEASON(seasonSelection)}/credits`, options);
|
|
1313
|
+
return await this.api.get(`${BASE_SEASON(seasonSelection)}/credits`, { query: options });
|
|
1202
1314
|
}
|
|
1203
1315
|
/**
|
|
1204
1316
|
* Retrieves external IDs for a specific TV season asynchronously.
|
|
@@ -1207,7 +1319,7 @@ var TvSeasonsEndpoint = class extends BaseEndpoint {
|
|
|
1207
1319
|
* @returns {Promise<ExternalIds>} A Promise that resolves with the external IDs for the TV season.
|
|
1208
1320
|
*/
|
|
1209
1321
|
async externalIds(seasonSelection, options) {
|
|
1210
|
-
return await this.api.get(`${BASE_SEASON(seasonSelection)}/external_ids`, options);
|
|
1322
|
+
return await this.api.get(`${BASE_SEASON(seasonSelection)}/external_ids`, { query: options });
|
|
1211
1323
|
}
|
|
1212
1324
|
/**
|
|
1213
1325
|
* Retrieves images for a specific TV season asynchronously.
|
|
@@ -1220,7 +1332,7 @@ var TvSeasonsEndpoint = class extends BaseEndpoint {
|
|
|
1220
1332
|
include_image_language: options?.include_image_language?.join(","),
|
|
1221
1333
|
language: options?.language
|
|
1222
1334
|
};
|
|
1223
|
-
return await this.api.get(`${BASE_SEASON(seasonSelection)}/images`, computedOptions);
|
|
1335
|
+
return await this.api.get(`${BASE_SEASON(seasonSelection)}/images`, { query: computedOptions });
|
|
1224
1336
|
}
|
|
1225
1337
|
/**
|
|
1226
1338
|
* Retrieves videos for a specific TV season asynchronously.
|
|
@@ -1233,7 +1345,7 @@ var TvSeasonsEndpoint = class extends BaseEndpoint {
|
|
|
1233
1345
|
include_video_language: options?.include_video_language?.join(","),
|
|
1234
1346
|
language: options?.language
|
|
1235
1347
|
};
|
|
1236
|
-
return await this.api.get(`${BASE_SEASON(seasonSelection)}/videos`, computedOptions);
|
|
1348
|
+
return await this.api.get(`${BASE_SEASON(seasonSelection)}/videos`, { query: computedOptions });
|
|
1237
1349
|
}
|
|
1238
1350
|
/**
|
|
1239
1351
|
* Retrieves translations for a specific TV season asynchronously.
|
|
@@ -1242,7 +1354,7 @@ var TvSeasonsEndpoint = class extends BaseEndpoint {
|
|
|
1242
1354
|
* @returns {Promise<Translations>} A Promise that resolves with the translations for the TV season.
|
|
1243
1355
|
*/
|
|
1244
1356
|
async translations(seasonSelection, options) {
|
|
1245
|
-
return await this.api.get(`${BASE_SEASON(seasonSelection)}/translations`, options);
|
|
1357
|
+
return await this.api.get(`${BASE_SEASON(seasonSelection)}/translations`, { query: options });
|
|
1246
1358
|
}
|
|
1247
1359
|
};
|
|
1248
1360
|
|
|
@@ -1274,7 +1386,7 @@ var TvShowsEndpoint = class extends BaseEndpoint {
|
|
|
1274
1386
|
append_to_response: appendToResponse ? appendToResponse.join(",") : void 0,
|
|
1275
1387
|
language
|
|
1276
1388
|
};
|
|
1277
|
-
return await this.api.get(`${BASE_TV}/${id}`, options);
|
|
1389
|
+
return await this.api.get(`${BASE_TV}/${id}`, { query: options });
|
|
1278
1390
|
}
|
|
1279
1391
|
/**
|
|
1280
1392
|
* Retrieves alternative titles of a specific TV show asynchronously.
|
|
@@ -1292,7 +1404,7 @@ var TvShowsEndpoint = class extends BaseEndpoint {
|
|
|
1292
1404
|
* A Promise that resolves with the changes for the TV show.
|
|
1293
1405
|
*/
|
|
1294
1406
|
async changes(id, options) {
|
|
1295
|
-
return await this.api.get(`${BASE_TV}/${id}/changes`, options);
|
|
1407
|
+
return await this.api.get(`${BASE_TV}/${id}/changes`, { query: options });
|
|
1296
1408
|
}
|
|
1297
1409
|
/**
|
|
1298
1410
|
* Retrieves content ratings for a specific TV show asynchronously.
|
|
@@ -1309,7 +1421,7 @@ var TvShowsEndpoint = class extends BaseEndpoint {
|
|
|
1309
1421
|
* @returns {Promise<AggregateCredits>} A Promise that resolves with the aggregate credits of the TV show.
|
|
1310
1422
|
*/
|
|
1311
1423
|
async aggregateCredits(id, options) {
|
|
1312
|
-
return await this.api.get(`${BASE_TV}/${id}/aggregate_credits`, options);
|
|
1424
|
+
return await this.api.get(`${BASE_TV}/${id}/aggregate_credits`, { query: options });
|
|
1313
1425
|
}
|
|
1314
1426
|
/**
|
|
1315
1427
|
* Retrieves credits for a specific TV show asynchronously.
|
|
@@ -1318,7 +1430,7 @@ var TvShowsEndpoint = class extends BaseEndpoint {
|
|
|
1318
1430
|
* @returns {Promise<Credits>} A Promise that resolves with the credits of the TV show.
|
|
1319
1431
|
*/
|
|
1320
1432
|
async credits(id, options) {
|
|
1321
|
-
return await this.api.get(`${BASE_TV}/${id}/credits`, options);
|
|
1433
|
+
return await this.api.get(`${BASE_TV}/${id}/credits`, { query: options });
|
|
1322
1434
|
}
|
|
1323
1435
|
/**
|
|
1324
1436
|
* Retrieves details of a specific season of a TV show asynchronously.
|
|
@@ -1356,7 +1468,7 @@ var TvShowsEndpoint = class extends BaseEndpoint {
|
|
|
1356
1468
|
include_image_language: options?.include_image_language?.join(","),
|
|
1357
1469
|
language: options?.language
|
|
1358
1470
|
};
|
|
1359
|
-
return await this.api.get(`${BASE_TV}/${id}/images`, computedOptions);
|
|
1471
|
+
return await this.api.get(`${BASE_TV}/${id}/images`, { query: computedOptions });
|
|
1360
1472
|
}
|
|
1361
1473
|
/**
|
|
1362
1474
|
* Retrieves keywords for a specific TV show asynchronously.
|
|
@@ -1373,7 +1485,7 @@ var TvShowsEndpoint = class extends BaseEndpoint {
|
|
|
1373
1485
|
* @returns {Promise<Recommendations>} A Promise that resolves with the recommendations for the TV show.
|
|
1374
1486
|
*/
|
|
1375
1487
|
async recommendations(id, options) {
|
|
1376
|
-
return await this.api.get(`${BASE_TV}/${id}/recommendations`, options);
|
|
1488
|
+
return await this.api.get(`${BASE_TV}/${id}/recommendations`, { query: options });
|
|
1377
1489
|
}
|
|
1378
1490
|
/**
|
|
1379
1491
|
* Retrieves reviews for a specific TV show asynchronously.
|
|
@@ -1382,7 +1494,7 @@ var TvShowsEndpoint = class extends BaseEndpoint {
|
|
|
1382
1494
|
* @returns {Promise<Reviews>} A Promise that resolves with the reviews of the TV show.
|
|
1383
1495
|
*/
|
|
1384
1496
|
async reviews(id, options) {
|
|
1385
|
-
return await this.api.get(`${BASE_TV}/${id}/reviews`, options);
|
|
1497
|
+
return await this.api.get(`${BASE_TV}/${id}/reviews`, { query: options });
|
|
1386
1498
|
}
|
|
1387
1499
|
/**
|
|
1388
1500
|
* Retrieves information about whether the TV show was screened theatrically asynchronously.
|
|
@@ -1399,7 +1511,7 @@ var TvShowsEndpoint = class extends BaseEndpoint {
|
|
|
1399
1511
|
* @returns {Promise<Similartv>} A Promise that resolves with the similar TV shows.
|
|
1400
1512
|
*/
|
|
1401
1513
|
async similar(id, options) {
|
|
1402
|
-
return await this.api.get(`${BASE_TV}/${id}/similar`, options);
|
|
1514
|
+
return await this.api.get(`${BASE_TV}/${id}/similar`, { query: options });
|
|
1403
1515
|
}
|
|
1404
1516
|
/**
|
|
1405
1517
|
* Retrieves translations for a specific TV show asynchronously.
|
|
@@ -1420,7 +1532,7 @@ var TvShowsEndpoint = class extends BaseEndpoint {
|
|
|
1420
1532
|
include_video_language: options?.include_video_language?.join(","),
|
|
1421
1533
|
language: options?.language
|
|
1422
1534
|
};
|
|
1423
|
-
return await this.api.get(`${BASE_TV}/${id}/videos`, computedOptions);
|
|
1535
|
+
return await this.api.get(`${BASE_TV}/${id}/videos`, { query: computedOptions });
|
|
1424
1536
|
}
|
|
1425
1537
|
/**
|
|
1426
1538
|
* Retrieves watch providers for a specific TV show asynchronously.
|
|
@@ -1444,7 +1556,7 @@ var TvShowsEndpoint = class extends BaseEndpoint {
|
|
|
1444
1556
|
* @returns {Promise<OnTheAir>} A Promise that resolves with TV shows currently on the air.
|
|
1445
1557
|
*/
|
|
1446
1558
|
async onTheAir(options) {
|
|
1447
|
-
return await this.api.get(`${BASE_TV}/on_the_air`, options);
|
|
1559
|
+
return await this.api.get(`${BASE_TV}/on_the_air`, { query: options });
|
|
1448
1560
|
}
|
|
1449
1561
|
/**
|
|
1450
1562
|
* Retrieves TV shows that are airing today asynchronously.
|
|
@@ -1452,7 +1564,7 @@ var TvShowsEndpoint = class extends BaseEndpoint {
|
|
|
1452
1564
|
* @returns {Promise<tvAiringToday>} A Promise that resolves with TV shows airing today.
|
|
1453
1565
|
*/
|
|
1454
1566
|
async airingToday(options) {
|
|
1455
|
-
return await this.api.get(`${BASE_TV}/airing_today`, options);
|
|
1567
|
+
return await this.api.get(`${BASE_TV}/airing_today`, { query: options });
|
|
1456
1568
|
}
|
|
1457
1569
|
/**
|
|
1458
1570
|
* Retrieves popular TV shows asynchronously.
|
|
@@ -1460,7 +1572,7 @@ var TvShowsEndpoint = class extends BaseEndpoint {
|
|
|
1460
1572
|
* @returns {Promise<Populartv>} A Promise that resolves with popular TV shows.
|
|
1461
1573
|
*/
|
|
1462
1574
|
async popular(options) {
|
|
1463
|
-
return await this.api.get(`${BASE_TV}/popular`, options);
|
|
1575
|
+
return await this.api.get(`${BASE_TV}/popular`, { query: options });
|
|
1464
1576
|
}
|
|
1465
1577
|
/**
|
|
1466
1578
|
* Retrieves top-rated TV shows asynchronously.
|
|
@@ -1468,7 +1580,7 @@ var TvShowsEndpoint = class extends BaseEndpoint {
|
|
|
1468
1580
|
* @returns {Promise<TopRatedtv>} A Promise that resolves with top-rated TV shows.
|
|
1469
1581
|
*/
|
|
1470
1582
|
async topRated(options) {
|
|
1471
|
-
return await this.api.get(`${BASE_TV}/top_rated`, options);
|
|
1583
|
+
return await this.api.get(`${BASE_TV}/top_rated`, { query: options });
|
|
1472
1584
|
}
|
|
1473
1585
|
};
|
|
1474
1586
|
|
|
@@ -1487,33 +1599,26 @@ var WatchProvidersEndpoint = class extends BaseEndpoint {
|
|
|
1487
1599
|
this.access_token = access_token;
|
|
1488
1600
|
}
|
|
1489
1601
|
/**
|
|
1490
|
-
* Retrieves a list of all available watch providers (streaming services).
|
|
1491
|
-
* @returns {Promise<WatchProviders>} A Promise that resolves with the list of watch providers.
|
|
1492
|
-
*/
|
|
1493
|
-
async available() {
|
|
1494
|
-
return await this.api.get("/watch/providers/movie");
|
|
1495
|
-
}
|
|
1496
|
-
/**
|
|
1497
|
-
* Retrieves a list of available regions for watch providers.
|
|
1498
|
-
* @returns {Promise<WatchRegionsResponse>} A Promise that resolves with the list of available regions.
|
|
1499
|
-
*/
|
|
1500
|
-
async regions() {
|
|
1501
|
-
return await this.api.get("/watch/providers/regions");
|
|
1502
|
-
}
|
|
1503
|
-
/**
|
|
1504
1602
|
* Retrieves a list of watch providers for movies.
|
|
1505
|
-
* @returns {Promise<
|
|
1603
|
+
* @returns {Promise<WatchProviderListResponse>} A Promise that resolves with the list of movie watch providers.
|
|
1506
1604
|
*/
|
|
1507
1605
|
async movie() {
|
|
1508
1606
|
return await this.api.get("/watch/providers/movie");
|
|
1509
1607
|
}
|
|
1510
1608
|
/**
|
|
1511
1609
|
* Retrieves a list of watch providers for TV shows.
|
|
1512
|
-
* @returns {Promise<
|
|
1610
|
+
* @returns {Promise<WatchProviderListResponse>} A Promise that resolves with the list of TV watch providers.
|
|
1513
1611
|
*/
|
|
1514
1612
|
async tv() {
|
|
1515
1613
|
return await this.api.get("/watch/providers/tv");
|
|
1516
1614
|
}
|
|
1615
|
+
/**
|
|
1616
|
+
* Retrieves a list of available regions for watch providers.
|
|
1617
|
+
* @returns {Promise<WatchProviderListResponse>} A Promise that resolves with the list of available regions.
|
|
1618
|
+
*/
|
|
1619
|
+
async regions() {
|
|
1620
|
+
return await this.api.get("/watch/providers/regions");
|
|
1621
|
+
}
|
|
1517
1622
|
};
|
|
1518
1623
|
|
|
1519
1624
|
//#endregion
|
|
@@ -1566,5 +1671,5 @@ var TMDB = class {
|
|
|
1566
1671
|
};
|
|
1567
1672
|
|
|
1568
1673
|
//#endregion
|
|
1569
|
-
export { API, BackdropSizes, BaseEndpoint, ChangeKeys, ImageFormats, ImageSizes, LogoSizes, PosterSizes, ProfileSizes, ReleaseDateType, StillSizes, TMDB, TMDB_IMAGE_BASE_URL, formImage, getFullImagePath, parseOptions };
|
|
1674
|
+
export { API, BackdropSizes, BaseEndpoint, ChangeKeys, ImageFormats, ImageSizes, LogoSizes, PosterSizes, ProfileSizes, ReleaseDateType, StillSizes, TMDB, TMDBError, TMDB_IMAGE_BASE_URL, formImage, getFullImagePath, parseOptions };
|
|
1570
1675
|
//# sourceMappingURL=index.mjs.map
|