@tdanks2000/tmdb-wrapper 1.6.0 → 2.0.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.cjs +856 -501
- package/dist/index.d.cts +729 -383
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +729 -383
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +854 -501
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -135,6 +135,15 @@ const parseOptions = (options) => {
|
|
|
135
135
|
}
|
|
136
136
|
return new URLSearchParams(entries).toString();
|
|
137
137
|
};
|
|
138
|
+
const csv = (values) => {
|
|
139
|
+
if (!values) return void 0;
|
|
140
|
+
const normalized = values.filter((value) => value !== void 0 && value !== null).map(String);
|
|
141
|
+
return normalized.length > 0 ? normalized.join(",") : void 0;
|
|
142
|
+
};
|
|
143
|
+
const withQuery = (query, config) => ({
|
|
144
|
+
...config,
|
|
145
|
+
query
|
|
146
|
+
});
|
|
138
147
|
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
139
148
|
const shouldRetry = (status) => status === 429 || status === 502 || status === 503 || status === 504;
|
|
140
149
|
const readRetryAfterMs = (res) => {
|
|
@@ -157,6 +166,7 @@ var API = class {
|
|
|
157
166
|
}
|
|
158
167
|
}
|
|
159
168
|
async get(path, opts = {}) {
|
|
169
|
+
if (!this.apiKey && !this.accessToken) throw new TMDBError("No TMDB authentication provided", 0, `${BASE_URL_V3}${path}`);
|
|
160
170
|
const query = {
|
|
161
171
|
...opts.query ? opts.query : {},
|
|
162
172
|
...this.apiKey ? { api_key: this.apiKey } : {}
|
|
@@ -168,8 +178,9 @@ var API = class {
|
|
|
168
178
|
const timeoutMs = opts.timeoutMs ?? 3e4;
|
|
169
179
|
const controller = new AbortController();
|
|
170
180
|
const timeout = setTimeout(() => controller.abort(), timeoutMs);
|
|
181
|
+
const abortFromSignal = () => controller.abort();
|
|
171
182
|
if (opts.signal) if (opts.signal.aborted) controller.abort();
|
|
172
|
-
else opts.signal.addEventListener("abort",
|
|
183
|
+
else opts.signal.addEventListener("abort", abortFromSignal, { once: true });
|
|
173
184
|
try {
|
|
174
185
|
for (let attempt = 0; attempt <= retries; attempt++) {
|
|
175
186
|
const res = await fetch(url, {
|
|
@@ -202,6 +213,7 @@ var API = class {
|
|
|
202
213
|
throw new TMDBError("Request failed", 0, url);
|
|
203
214
|
} finally {
|
|
204
215
|
clearTimeout(timeout);
|
|
216
|
+
if (opts.signal) opts.signal.removeEventListener("abort", abortFromSignal);
|
|
205
217
|
}
|
|
206
218
|
}
|
|
207
219
|
};
|
|
@@ -425,42 +437,55 @@ const BASE_COLLECTION = "/collection";
|
|
|
425
437
|
var CollectionsEndpoint = class extends BaseEndpoint {
|
|
426
438
|
/**
|
|
427
439
|
* Constructs a new CollectionsEndpoint instance.
|
|
428
|
-
*
|
|
440
|
+
*
|
|
441
|
+
* @param {TokenType} auth - The authentication configuration.
|
|
429
442
|
*/
|
|
430
|
-
constructor(
|
|
431
|
-
super(
|
|
432
|
-
this.
|
|
443
|
+
constructor(auth) {
|
|
444
|
+
super(auth);
|
|
445
|
+
this.auth = auth;
|
|
433
446
|
}
|
|
434
447
|
/**
|
|
435
448
|
* Retrieves details of a specific collection asynchronously.
|
|
449
|
+
*
|
|
436
450
|
* @param {number} id - The ID of the collection.
|
|
437
|
-
* @param {LanguageOption} [options] - Optional parameters for specifying the
|
|
438
|
-
*
|
|
451
|
+
* @param {LanguageOption} [options] - Optional parameters for specifying the
|
|
452
|
+
* language.
|
|
453
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
454
|
+
* @returns {Promise<DetailedCollection>} A Promise that resolves with the
|
|
455
|
+
* detailed information of the collection.
|
|
439
456
|
*/
|
|
440
|
-
|
|
441
|
-
return
|
|
457
|
+
details(id, options, request) {
|
|
458
|
+
return this.api.get(`${BASE_COLLECTION}/${id}`, withQuery(options, request));
|
|
442
459
|
}
|
|
443
460
|
/**
|
|
444
461
|
* Retrieves images associated with a specific collection asynchronously.
|
|
462
|
+
*
|
|
445
463
|
* @param {number} id - The ID of the collection.
|
|
446
|
-
* @param {CollectionImageOptions} [options] - Optional parameters for
|
|
447
|
-
*
|
|
464
|
+
* @param {CollectionImageOptions} [options] - Optional parameters for
|
|
465
|
+
* specifying image options.
|
|
466
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
467
|
+
* @returns {Promise<ImageCollection>} A Promise that resolves with the
|
|
468
|
+
* collection images.
|
|
448
469
|
*/
|
|
449
|
-
|
|
450
|
-
const
|
|
451
|
-
include_image_language: options?.include_image_language
|
|
470
|
+
images(id, options, request) {
|
|
471
|
+
const query = {
|
|
472
|
+
include_image_language: csv(options?.include_image_language),
|
|
452
473
|
language: options?.language
|
|
453
474
|
};
|
|
454
|
-
return
|
|
475
|
+
return this.api.get(`${BASE_COLLECTION}/${id}/images`, withQuery(query, request));
|
|
455
476
|
}
|
|
456
477
|
/**
|
|
457
478
|
* Retrieves translations for a specific collection asynchronously.
|
|
479
|
+
*
|
|
458
480
|
* @param {number} id - The ID of the collection.
|
|
459
|
-
* @param {LanguageOption} [options] - Optional parameters for specifying the
|
|
460
|
-
*
|
|
481
|
+
* @param {LanguageOption} [options] - Optional parameters for specifying the
|
|
482
|
+
* language.
|
|
483
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
484
|
+
* @returns {Promise<Translations>} A Promise that resolves with the
|
|
485
|
+
* translations of the collection.
|
|
461
486
|
*/
|
|
462
|
-
|
|
463
|
-
return
|
|
487
|
+
translations(id, options, request) {
|
|
488
|
+
return this.api.get(`${BASE_COLLECTION}/${id}/translations`, withQuery(options, request));
|
|
464
489
|
}
|
|
465
490
|
};
|
|
466
491
|
|
|
@@ -472,35 +497,42 @@ var CollectionsEndpoint = class extends BaseEndpoint {
|
|
|
472
497
|
var CompaniesEndpoint = class extends BaseEndpoint {
|
|
473
498
|
/**
|
|
474
499
|
* Constructs a new CompaniesEndpoint instance.
|
|
475
|
-
*
|
|
500
|
+
*
|
|
501
|
+
* @param {TokenType} auth - The authentication configuration.
|
|
476
502
|
*/
|
|
477
|
-
constructor(
|
|
478
|
-
super(
|
|
479
|
-
this.
|
|
503
|
+
constructor(auth) {
|
|
504
|
+
super(auth);
|
|
505
|
+
this.auth = auth;
|
|
480
506
|
}
|
|
481
507
|
/**
|
|
482
508
|
* Retrieves details of a specific company asynchronously.
|
|
509
|
+
*
|
|
483
510
|
* @param {number} id - The ID of the company.
|
|
484
|
-
* @returns {Promise<CompanyDetails>} A Promise that resolves with the
|
|
511
|
+
* @returns {Promise<CompanyDetails>} A Promise that resolves with the
|
|
512
|
+
* detailed information of the company.
|
|
485
513
|
*/
|
|
486
|
-
|
|
487
|
-
return
|
|
514
|
+
details(id) {
|
|
515
|
+
return this.api.get(`/company/${id}`);
|
|
488
516
|
}
|
|
489
517
|
/**
|
|
490
518
|
* Retrieves alternative names of a specific company asynchronously.
|
|
519
|
+
*
|
|
491
520
|
* @param {number} id - The ID of the company.
|
|
492
|
-
* @returns {Promise<AlternativeNames>} A Promise that resolves with the
|
|
521
|
+
* @returns {Promise<AlternativeNames>} A Promise that resolves with the
|
|
522
|
+
* alternative names of the company.
|
|
493
523
|
*/
|
|
494
|
-
|
|
495
|
-
return
|
|
524
|
+
alternativeNames(id) {
|
|
525
|
+
return this.api.get(`/company/${id}/alternative_names`);
|
|
496
526
|
}
|
|
497
527
|
/**
|
|
498
528
|
* Retrieves images associated with a specific company asynchronously.
|
|
529
|
+
*
|
|
499
530
|
* @param {number} id - The ID of the company.
|
|
500
|
-
* @returns {Promise<CompanyImages>} A Promise that resolves with the images
|
|
531
|
+
* @returns {Promise<CompanyImages>} A Promise that resolves with the images
|
|
532
|
+
* of the company.
|
|
501
533
|
*/
|
|
502
|
-
|
|
503
|
-
return
|
|
534
|
+
images(id) {
|
|
535
|
+
return this.api.get(`/company/${id}/images`);
|
|
504
536
|
}
|
|
505
537
|
};
|
|
506
538
|
|
|
@@ -512,18 +544,21 @@ var CompaniesEndpoint = class extends BaseEndpoint {
|
|
|
512
544
|
var ConfigurationEndpoint = class extends BaseEndpoint {
|
|
513
545
|
/**
|
|
514
546
|
* Constructs a new ConfigurationEndpoint instance.
|
|
515
|
-
*
|
|
547
|
+
*
|
|
548
|
+
* @param {TokenType} auth - The authentication configuration.
|
|
516
549
|
*/
|
|
517
|
-
constructor(
|
|
518
|
-
super(
|
|
519
|
-
this.
|
|
550
|
+
constructor(auth) {
|
|
551
|
+
super(auth);
|
|
552
|
+
this.auth = auth;
|
|
520
553
|
}
|
|
521
554
|
/**
|
|
522
555
|
* Retrieves the current system configuration asynchronously.
|
|
523
|
-
*
|
|
556
|
+
*
|
|
557
|
+
* @returns {Promise<Configuration>} A Promise that resolves with the current
|
|
558
|
+
* system configuration.
|
|
524
559
|
*/
|
|
525
|
-
|
|
526
|
-
return
|
|
560
|
+
getCurrent() {
|
|
561
|
+
return this.api.get("/configuration");
|
|
527
562
|
}
|
|
528
563
|
};
|
|
529
564
|
|
|
@@ -535,19 +570,22 @@ var ConfigurationEndpoint = class extends BaseEndpoint {
|
|
|
535
570
|
var CreditsEndpoint = class extends BaseEndpoint {
|
|
536
571
|
/**
|
|
537
572
|
* Constructs a new CreditsEndpoint instance.
|
|
538
|
-
*
|
|
573
|
+
*
|
|
574
|
+
* @param {TokenType} auth - The authentication configuration.
|
|
539
575
|
*/
|
|
540
|
-
constructor(
|
|
541
|
-
super(
|
|
542
|
-
this.
|
|
576
|
+
constructor(auth) {
|
|
577
|
+
super(auth);
|
|
578
|
+
this.auth = auth;
|
|
543
579
|
}
|
|
544
580
|
/**
|
|
545
581
|
* Retrieves credit details by ID asynchronously.
|
|
582
|
+
*
|
|
546
583
|
* @param {string} id - The ID of the credit.
|
|
547
|
-
* @returns {Promise<CreditResponse>} A Promise that resolves with the credit
|
|
584
|
+
* @returns {Promise<CreditResponse>} A Promise that resolves with the credit
|
|
585
|
+
* details.
|
|
548
586
|
*/
|
|
549
|
-
|
|
550
|
-
return
|
|
587
|
+
getById(id) {
|
|
588
|
+
return this.api.get(`/credit/${id}`);
|
|
551
589
|
}
|
|
552
590
|
};
|
|
553
591
|
|
|
@@ -555,7 +593,8 @@ var CreditsEndpoint = class extends BaseEndpoint {
|
|
|
555
593
|
//#region src/endpoints/discover.ts
|
|
556
594
|
const BASE_DISCOVER = "/discover";
|
|
557
595
|
/**
|
|
558
|
-
* Represents an endpoint for discovering movies and TV shows based on various
|
|
596
|
+
* Represents an endpoint for discovering movies and TV shows based on various
|
|
597
|
+
* criteria.
|
|
559
598
|
*
|
|
560
599
|
* TMDB v3 reference:
|
|
561
600
|
* - GET /discover/movie
|
|
@@ -572,26 +611,30 @@ var DiscoverEndpoint = class extends BaseEndpoint {
|
|
|
572
611
|
this.access_token = access_token;
|
|
573
612
|
}
|
|
574
613
|
/**
|
|
575
|
-
* Retrieves a list of movies based on the provided query options
|
|
576
|
-
*
|
|
577
|
-
* TMDB: GET /discover/movie
|
|
614
|
+
* Retrieves a list of movies based on the provided query options
|
|
615
|
+
* asynchronously.
|
|
578
616
|
*
|
|
579
|
-
* @param {MovieQueryOptions} [options] - Optional parameters for refining the
|
|
580
|
-
*
|
|
617
|
+
* @param {MovieQueryOptions} [options] - Optional parameters for refining the
|
|
618
|
+
* movie discovery.
|
|
619
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
620
|
+
* @returns {Promise<MovieDiscoverResult>} A Promise that resolves with the
|
|
621
|
+
* movie discovery results.
|
|
581
622
|
*/
|
|
582
|
-
movie(options) {
|
|
583
|
-
return this.api.get(`${BASE_DISCOVER}/movie`,
|
|
623
|
+
movie(options, request) {
|
|
624
|
+
return this.api.get(`${BASE_DISCOVER}/movie`, withQuery(options, request));
|
|
584
625
|
}
|
|
585
626
|
/**
|
|
586
|
-
* Retrieves a list of TV shows based on the provided query options
|
|
627
|
+
* Retrieves a list of TV shows based on the provided query options
|
|
628
|
+
* asynchronously.
|
|
587
629
|
*
|
|
588
|
-
*
|
|
589
|
-
*
|
|
590
|
-
* @param {
|
|
591
|
-
* @returns {Promise<TvShowDiscoverResult>} A Promise that resolves with the
|
|
630
|
+
* @param {TvShowQueryOptions} [options] - Optional parameters for refining
|
|
631
|
+
* the TV show discovery.
|
|
632
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
633
|
+
* @returns {Promise<TvShowDiscoverResult>} A Promise that resolves with the
|
|
634
|
+
* TV show discovery results.
|
|
592
635
|
*/
|
|
593
|
-
tvShow(options) {
|
|
594
|
-
return this.api.get(`${BASE_DISCOVER}/tv`,
|
|
636
|
+
tvShow(options, request) {
|
|
637
|
+
return this.api.get(`${BASE_DISCOVER}/tv`, withQuery(options, request));
|
|
595
638
|
}
|
|
596
639
|
};
|
|
597
640
|
|
|
@@ -603,52 +646,64 @@ var DiscoverEndpoint = class extends BaseEndpoint {
|
|
|
603
646
|
var FindEndpoint = class extends BaseEndpoint {
|
|
604
647
|
/**
|
|
605
648
|
* Constructs a new FindEndpoint instance.
|
|
606
|
-
*
|
|
649
|
+
*
|
|
650
|
+
* @param {TokenType} auth - The authentication configuration.
|
|
607
651
|
*/
|
|
608
|
-
constructor(
|
|
609
|
-
super(
|
|
610
|
-
this.
|
|
652
|
+
constructor(auth) {
|
|
653
|
+
super(auth);
|
|
654
|
+
this.auth = auth;
|
|
611
655
|
}
|
|
612
656
|
/**
|
|
613
657
|
* Retrieves media by external ID asynchronously.
|
|
658
|
+
*
|
|
614
659
|
* @param {string} externalId - The external ID of the media.
|
|
615
|
-
* @param {ExternalIdOptions} options - Options for finding media by external
|
|
616
|
-
*
|
|
660
|
+
* @param {ExternalIdOptions} options - Options for finding media by external
|
|
661
|
+
* ID.
|
|
662
|
+
* @returns {Promise<FindResult>} A Promise that resolves with the result of
|
|
663
|
+
* the find operation.
|
|
617
664
|
*/
|
|
618
|
-
|
|
619
|
-
return
|
|
665
|
+
byId(externalId, options) {
|
|
666
|
+
return this.api.get(`/find/${externalId}`, { query: options });
|
|
620
667
|
}
|
|
621
668
|
};
|
|
622
669
|
|
|
623
670
|
//#endregion
|
|
624
671
|
//#region src/endpoints/genre.ts
|
|
625
672
|
/**
|
|
626
|
-
* Represents an endpoint for retrieving genre information for movies and TV
|
|
673
|
+
* Represents an endpoint for retrieving genre information for movies and TV
|
|
674
|
+
* shows.
|
|
627
675
|
*/
|
|
628
676
|
var GenreEndpoint = class extends BaseEndpoint {
|
|
629
677
|
/**
|
|
630
678
|
* Constructs a new GenreEndpoint instance.
|
|
631
|
-
*
|
|
679
|
+
*
|
|
680
|
+
* @param {TokenType} auth - The authentication configuration.
|
|
632
681
|
*/
|
|
633
|
-
constructor(
|
|
634
|
-
super(
|
|
635
|
-
this.
|
|
682
|
+
constructor(auth) {
|
|
683
|
+
super(auth);
|
|
684
|
+
this.auth = auth;
|
|
636
685
|
}
|
|
637
686
|
/**
|
|
638
687
|
* Retrieves genre information for movies asynchronously.
|
|
639
|
-
*
|
|
640
|
-
* @
|
|
688
|
+
*
|
|
689
|
+
* @param {LanguageOption} [options] - Optional parameters for specifying the
|
|
690
|
+
* language.
|
|
691
|
+
* @returns {Promise<Genres>} A Promise that resolves with the genre
|
|
692
|
+
* information for movies.
|
|
641
693
|
*/
|
|
642
|
-
|
|
643
|
-
return
|
|
694
|
+
movies(options) {
|
|
695
|
+
return this.api.get("/genre/movie/list", { query: options });
|
|
644
696
|
}
|
|
645
697
|
/**
|
|
646
698
|
* Retrieves genre information for TV shows asynchronously.
|
|
647
|
-
*
|
|
648
|
-
* @
|
|
699
|
+
*
|
|
700
|
+
* @param {LanguageOption} [options] - Optional parameters for specifying the
|
|
701
|
+
* language.
|
|
702
|
+
* @returns {Promise<Genres>} A Promise that resolves with the genre
|
|
703
|
+
* information for TV shows.
|
|
649
704
|
*/
|
|
650
|
-
|
|
651
|
-
return
|
|
705
|
+
tv(options) {
|
|
706
|
+
return this.api.get("/genre/tv/list", { query: options });
|
|
652
707
|
}
|
|
653
708
|
};
|
|
654
709
|
|
|
@@ -661,28 +716,34 @@ const BASE_KEYWORD = "/keyword";
|
|
|
661
716
|
var KeywordsEndpoint = class extends BaseEndpoint {
|
|
662
717
|
/**
|
|
663
718
|
* Constructs a new KeywordsEndpoint instance.
|
|
664
|
-
*
|
|
719
|
+
*
|
|
720
|
+
* @param {TokenType} auth - The authentication configuration.
|
|
665
721
|
*/
|
|
666
|
-
constructor(
|
|
667
|
-
super(
|
|
668
|
-
this.
|
|
722
|
+
constructor(auth) {
|
|
723
|
+
super(auth);
|
|
724
|
+
this.auth = auth;
|
|
669
725
|
}
|
|
670
726
|
/**
|
|
671
727
|
* Retrieves details of a specific keyword asynchronously.
|
|
728
|
+
*
|
|
672
729
|
* @param {number} keywordId - The ID of the keyword.
|
|
673
|
-
* @returns {Promise<Keyword>} A Promise that resolves with the details of
|
|
730
|
+
* @returns {Promise<Keyword>} A Promise that resolves with the details of
|
|
731
|
+
* the keyword.
|
|
674
732
|
*/
|
|
675
|
-
|
|
676
|
-
return
|
|
733
|
+
details(keywordId) {
|
|
734
|
+
return this.api.get(`${BASE_KEYWORD}/${keywordId}`);
|
|
677
735
|
}
|
|
678
736
|
/**
|
|
679
737
|
* Retrieves movies belonging to a specific keyword asynchronously.
|
|
738
|
+
*
|
|
680
739
|
* @param {number} keywordId - The ID of the keyword.
|
|
681
|
-
* @param {KeywordsOptions} [options] - Optional parameters for refining the
|
|
682
|
-
*
|
|
740
|
+
* @param {KeywordsOptions} [options] - Optional parameters for refining the
|
|
741
|
+
* search.
|
|
742
|
+
* @returns {Promise<BelongingMovies>} A Promise that resolves with the
|
|
743
|
+
* movies belonging to the keyword.
|
|
683
744
|
*/
|
|
684
|
-
|
|
685
|
-
return
|
|
745
|
+
belongingMovies(keywordId, options) {
|
|
746
|
+
return this.api.get(`${BASE_KEYWORD}/${keywordId}/movies`, { query: options });
|
|
686
747
|
}
|
|
687
748
|
};
|
|
688
749
|
|
|
@@ -695,188 +756,263 @@ const BASE_MOVIE = "/movie";
|
|
|
695
756
|
var MoviesEndpoint = class extends BaseEndpoint {
|
|
696
757
|
/**
|
|
697
758
|
* Constructs a new MoviesEndpoint instance.
|
|
698
|
-
*
|
|
759
|
+
*
|
|
760
|
+
* @param {TokenType} auth - The authentication configuration.
|
|
699
761
|
*/
|
|
700
|
-
constructor(
|
|
701
|
-
super(
|
|
702
|
-
this.
|
|
762
|
+
constructor(auth) {
|
|
763
|
+
super(auth);
|
|
764
|
+
this.auth = auth;
|
|
703
765
|
}
|
|
704
766
|
/**
|
|
705
767
|
* Retrieves details of a specific movie asynchronously.
|
|
768
|
+
*
|
|
706
769
|
* @param {number} id - The ID of the movie.
|
|
707
|
-
* @param {AppendToResponseMovieKey[]} [appendToResponse] - Optional keys to
|
|
708
|
-
*
|
|
709
|
-
* @
|
|
710
|
-
|
|
711
|
-
|
|
770
|
+
* @param {AppendToResponseMovieKey[]} [appendToResponse] - Optional keys to
|
|
771
|
+
* append to the response.
|
|
772
|
+
* @param {string} [language] - Optional parameter for specifying the
|
|
773
|
+
* language.
|
|
774
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
775
|
+
* @returns {Promise<AppendToResponse<MovieDetails, T, "movie">>} A Promise
|
|
776
|
+
* that resolves with the details of the movie.
|
|
777
|
+
*/
|
|
778
|
+
details(id, appendToResponse, language, request) {
|
|
712
779
|
const query = {
|
|
713
|
-
append_to_response: appendToResponse
|
|
780
|
+
append_to_response: csv(appendToResponse),
|
|
714
781
|
language
|
|
715
782
|
};
|
|
716
|
-
return
|
|
783
|
+
return this.api.get(`${BASE_MOVIE}/${id}`, withQuery(query, request));
|
|
717
784
|
}
|
|
718
785
|
/**
|
|
719
786
|
* Retrieves alternative titles of a specific movie asynchronously.
|
|
787
|
+
*
|
|
720
788
|
* @param {number} id - The ID of the movie.
|
|
721
|
-
* @
|
|
789
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
790
|
+
* @returns {Promise<AlternativeTitles>} A Promise that resolves with the
|
|
791
|
+
* alternative titles of the movie.
|
|
722
792
|
*/
|
|
723
|
-
|
|
724
|
-
return
|
|
793
|
+
alternativeTitles(id, request) {
|
|
794
|
+
return this.api.get(`${BASE_MOVIE}/${id}/alternative_titles`, request);
|
|
725
795
|
}
|
|
726
796
|
/**
|
|
727
797
|
* Retrieves changes made to a specific movie asynchronously.
|
|
798
|
+
*
|
|
728
799
|
* @param {number} id - The ID of the movie.
|
|
729
|
-
* @param {ChangeOption} [options] - Optional parameters for filtering
|
|
730
|
-
*
|
|
800
|
+
* @param {ChangeOption} [options] - Optional parameters for filtering
|
|
801
|
+
* changes.
|
|
802
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
803
|
+
* @returns {Promise<Changes<MovieChangeValue>>} A Promise that resolves with
|
|
804
|
+
* the changes made to the movie.
|
|
731
805
|
*/
|
|
732
|
-
|
|
733
|
-
return
|
|
806
|
+
changes(id, options, request) {
|
|
807
|
+
return this.api.get(`${BASE_MOVIE}/${id}/changes`, withQuery(options, request));
|
|
734
808
|
}
|
|
735
809
|
/**
|
|
736
810
|
* Retrieves credits of a specific movie asynchronously.
|
|
811
|
+
*
|
|
737
812
|
* @param {number} id - The ID of the movie.
|
|
738
|
-
* @param {LanguageOption} [options] - Optional parameters for specifying the
|
|
739
|
-
*
|
|
813
|
+
* @param {LanguageOption} [options] - Optional parameters for specifying the
|
|
814
|
+
* language.
|
|
815
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
816
|
+
* @returns {Promise<Credits>} A Promise that resolves with the credits of
|
|
817
|
+
* the movie.
|
|
740
818
|
*/
|
|
741
|
-
|
|
742
|
-
return
|
|
819
|
+
credits(id, options, request) {
|
|
820
|
+
return this.api.get(`${BASE_MOVIE}/${id}/credits`, withQuery(options, request));
|
|
743
821
|
}
|
|
744
822
|
/**
|
|
745
823
|
* Retrieves external IDs of a specific movie asynchronously.
|
|
824
|
+
*
|
|
746
825
|
* @param {number} id - The ID of the movie.
|
|
747
|
-
* @
|
|
826
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
827
|
+
* @returns {Promise<ExternalIds>} A Promise that resolves with the external
|
|
828
|
+
* IDs of the movie.
|
|
748
829
|
*/
|
|
749
|
-
|
|
750
|
-
return
|
|
830
|
+
externalIds(id, request) {
|
|
831
|
+
return this.api.get(`${BASE_MOVIE}/${id}/external_ids`, request);
|
|
751
832
|
}
|
|
752
833
|
/**
|
|
753
834
|
* Retrieves images of a specific movie asynchronously.
|
|
835
|
+
*
|
|
754
836
|
* @param {number} id - The ID of the movie.
|
|
755
|
-
* @param {MoviesImageSearchOptions} [options] - Optional parameters for
|
|
756
|
-
*
|
|
837
|
+
* @param {MoviesImageSearchOptions} [options] - Optional parameters for
|
|
838
|
+
* specifying image search options.
|
|
839
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
840
|
+
* @returns {Promise<Images>} A Promise that resolves with the images of the
|
|
841
|
+
* movie.
|
|
757
842
|
*/
|
|
758
|
-
|
|
759
|
-
const
|
|
760
|
-
include_image_language: options?.include_image_language
|
|
843
|
+
images(id, options, request) {
|
|
844
|
+
const query = {
|
|
845
|
+
include_image_language: csv(options?.include_image_language),
|
|
761
846
|
language: options?.language
|
|
762
847
|
};
|
|
763
|
-
return
|
|
848
|
+
return this.api.get(`${BASE_MOVIE}/${id}/images`, withQuery(query, request));
|
|
764
849
|
}
|
|
765
850
|
/**
|
|
766
851
|
* Retrieves keywords of a specific movie asynchronously.
|
|
852
|
+
*
|
|
767
853
|
* @param {number} id - The ID of the movie.
|
|
768
|
-
* @
|
|
854
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
855
|
+
* @returns {Promise<Keywords>} A Promise that resolves with the keywords of
|
|
856
|
+
* the movie.
|
|
769
857
|
*/
|
|
770
|
-
|
|
771
|
-
return
|
|
858
|
+
keywords(id, request) {
|
|
859
|
+
return this.api.get(`${BASE_MOVIE}/${id}/keywords`, request);
|
|
772
860
|
}
|
|
773
861
|
/**
|
|
774
862
|
* Retrieves lists containing a specific movie asynchronously.
|
|
863
|
+
*
|
|
775
864
|
* @param {number} id - The ID of the movie.
|
|
776
|
-
* @param {LanguageOption & PageOption} [options] - Optional parameters for
|
|
777
|
-
*
|
|
865
|
+
* @param {LanguageOption & PageOption} [options] - Optional parameters for
|
|
866
|
+
* specifying language and pagination options.
|
|
867
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
868
|
+
* @returns {Promise<MovieLists>} A Promise that resolves with the lists
|
|
869
|
+
* containing the movie.
|
|
778
870
|
*/
|
|
779
|
-
|
|
780
|
-
return
|
|
871
|
+
lists(id, options, request) {
|
|
872
|
+
return this.api.get(`${BASE_MOVIE}/${id}/lists`, withQuery(options, request));
|
|
781
873
|
}
|
|
782
874
|
/**
|
|
783
875
|
* Retrieves recommendations for a specific movie asynchronously.
|
|
876
|
+
*
|
|
784
877
|
* @param {number} id - The ID of the movie.
|
|
785
|
-
* @param {LanguageOption & PageOption} [options] - Optional parameters for
|
|
786
|
-
*
|
|
878
|
+
* @param {LanguageOption & PageOption} [options] - Optional parameters for
|
|
879
|
+
* specifying language and pagination options.
|
|
880
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
881
|
+
* @returns {Promise<Recommendations>} A Promise that resolves with the
|
|
882
|
+
* recommendations for the movie.
|
|
787
883
|
*/
|
|
788
|
-
|
|
789
|
-
return
|
|
884
|
+
recommendations(id, options, request) {
|
|
885
|
+
return this.api.get(`${BASE_MOVIE}/${id}/recommendations`, withQuery(options, request));
|
|
790
886
|
}
|
|
791
887
|
/**
|
|
792
888
|
* Retrieves release dates of a specific movie asynchronously.
|
|
889
|
+
*
|
|
793
890
|
* @param {number} id - The ID of the movie.
|
|
794
|
-
* @
|
|
891
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
892
|
+
* @returns {Promise<ReleaseDates>} A Promise that resolves with the release
|
|
893
|
+
* dates of the movie.
|
|
795
894
|
*/
|
|
796
|
-
|
|
797
|
-
return
|
|
895
|
+
releaseDates(id, request) {
|
|
896
|
+
return this.api.get(`${BASE_MOVIE}/${id}/release_dates`, request);
|
|
798
897
|
}
|
|
799
898
|
/**
|
|
800
899
|
* Retrieves reviews for a specific movie asynchronously.
|
|
900
|
+
*
|
|
801
901
|
* @param {number} id - The ID of the movie.
|
|
802
|
-
* @param {LanguageOption & PageOption} [options] - Optional parameters for
|
|
803
|
-
*
|
|
902
|
+
* @param {LanguageOption & PageOption} [options] - Optional parameters for
|
|
903
|
+
* specifying language and pagination options.
|
|
904
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
905
|
+
* @returns {Promise<Reviews>} A Promise that resolves with the reviews for
|
|
906
|
+
* the movie.
|
|
804
907
|
*/
|
|
805
|
-
|
|
806
|
-
return
|
|
908
|
+
reviews(id, options, request) {
|
|
909
|
+
return this.api.get(`${BASE_MOVIE}/${id}/reviews`, withQuery(options, request));
|
|
807
910
|
}
|
|
808
911
|
/**
|
|
809
912
|
* Retrieves similar movies for a specific movie asynchronously.
|
|
913
|
+
*
|
|
810
914
|
* @param {number} id - The ID of the movie.
|
|
811
|
-
* @param {LanguageOption & PageOption} [options] - Optional parameters for
|
|
812
|
-
*
|
|
915
|
+
* @param {LanguageOption & PageOption} [options] - Optional parameters for
|
|
916
|
+
* specifying language and pagination options.
|
|
917
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
918
|
+
* @returns {Promise<SimilarMovies>} A Promise that resolves with the similar
|
|
919
|
+
* movies for the movie.
|
|
813
920
|
*/
|
|
814
|
-
|
|
815
|
-
return
|
|
921
|
+
similar(id, options, request) {
|
|
922
|
+
return this.api.get(`${BASE_MOVIE}/${id}/similar`, withQuery(options, request));
|
|
816
923
|
}
|
|
817
924
|
/**
|
|
818
925
|
* Retrieves translations of a specific movie asynchronously.
|
|
926
|
+
*
|
|
819
927
|
* @param {number} id - The ID of the movie.
|
|
820
|
-
* @
|
|
928
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
929
|
+
* @returns {Promise<Translations>} A Promise that resolves with the
|
|
930
|
+
* translations of the movie.
|
|
821
931
|
*/
|
|
822
|
-
|
|
823
|
-
return
|
|
932
|
+
translations(id, request) {
|
|
933
|
+
return this.api.get(`${BASE_MOVIE}/${id}/translations`, request);
|
|
824
934
|
}
|
|
825
935
|
/**
|
|
826
936
|
* Retrieves videos of a specific movie asynchronously.
|
|
937
|
+
*
|
|
827
938
|
* @param {number} id - The ID of the movie.
|
|
828
|
-
* @param {LanguageOption} [options] - Optional parameters for specifying the
|
|
829
|
-
*
|
|
939
|
+
* @param {LanguageOption} [options] - Optional parameters for specifying the
|
|
940
|
+
* language.
|
|
941
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
942
|
+
* @returns {Promise<Videos>} A Promise that resolves with the videos of the
|
|
943
|
+
* movie.
|
|
830
944
|
*/
|
|
831
|
-
|
|
832
|
-
return
|
|
945
|
+
videos(id, options, request) {
|
|
946
|
+
return this.api.get(`${BASE_MOVIE}/${id}/videos`, withQuery(options, request));
|
|
833
947
|
}
|
|
834
948
|
/**
|
|
835
949
|
* Retrieves watch providers of a specific movie asynchronously.
|
|
950
|
+
*
|
|
836
951
|
* @param {number} id - The ID of the movie.
|
|
837
|
-
* @
|
|
952
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
953
|
+
* @returns {Promise<WatchProviders>} A Promise that resolves with the watch
|
|
954
|
+
* providers of the movie.
|
|
838
955
|
*/
|
|
839
|
-
|
|
840
|
-
return
|
|
956
|
+
watchProviders(id, request) {
|
|
957
|
+
return this.api.get(`${BASE_MOVIE}/${id}/watch/providers`, request);
|
|
841
958
|
}
|
|
842
959
|
/**
|
|
843
960
|
* Retrieves details of the latest movie asynchronously.
|
|
844
|
-
*
|
|
961
|
+
*
|
|
962
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
963
|
+
* @returns {Promise<LatestMovie>} A Promise that resolves with the details
|
|
964
|
+
* of the latest movie.
|
|
845
965
|
*/
|
|
846
|
-
|
|
847
|
-
return
|
|
966
|
+
latest(request) {
|
|
967
|
+
return this.api.get(`${BASE_MOVIE}/latest`, request);
|
|
848
968
|
}
|
|
849
969
|
/**
|
|
850
970
|
* Retrieves movies playing now asynchronously.
|
|
851
|
-
*
|
|
852
|
-
* @
|
|
971
|
+
*
|
|
972
|
+
* @param {PageOption & LanguageOption & RegionOption} [options] - Optional
|
|
973
|
+
* parameters for specifying language, region, and pagination options.
|
|
974
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
975
|
+
* @returns {Promise<MoviesPlayingNow>} A Promise that resolves with the
|
|
976
|
+
* movies playing now.
|
|
853
977
|
*/
|
|
854
|
-
|
|
855
|
-
return
|
|
978
|
+
nowPlaying(options, request) {
|
|
979
|
+
return this.api.get(`${BASE_MOVIE}/now_playing`, withQuery(options, request));
|
|
856
980
|
}
|
|
857
981
|
/**
|
|
858
982
|
* Retrieves popular movies asynchronously.
|
|
859
|
-
*
|
|
860
|
-
* @
|
|
983
|
+
*
|
|
984
|
+
* @param {LanguageOption & PageOption} [options] - Optional parameters for
|
|
985
|
+
* specifying language and pagination options.
|
|
986
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
987
|
+
* @returns {Promise<PopularMovies>} A Promise that resolves with the popular
|
|
988
|
+
* movies.
|
|
861
989
|
*/
|
|
862
|
-
|
|
863
|
-
return
|
|
990
|
+
popular(options, request) {
|
|
991
|
+
return this.api.get(`${BASE_MOVIE}/popular`, withQuery(options, request));
|
|
864
992
|
}
|
|
865
993
|
/**
|
|
866
994
|
* Retrieves top rated movies asynchronously.
|
|
867
|
-
*
|
|
868
|
-
* @
|
|
995
|
+
*
|
|
996
|
+
* @param {PageOption & LanguageOption & RegionOption} [options] - Optional
|
|
997
|
+
* parameters for specifying language, region, and pagination options.
|
|
998
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
999
|
+
* @returns {Promise<TopRatedMovies>} A Promise that resolves with the top
|
|
1000
|
+
* rated movies.
|
|
869
1001
|
*/
|
|
870
|
-
|
|
871
|
-
return
|
|
1002
|
+
topRated(options, request) {
|
|
1003
|
+
return this.api.get(`${BASE_MOVIE}/top_rated`, withQuery(options, request));
|
|
872
1004
|
}
|
|
873
1005
|
/**
|
|
874
1006
|
* Retrieves upcoming movies asynchronously.
|
|
875
|
-
*
|
|
876
|
-
* @
|
|
1007
|
+
*
|
|
1008
|
+
* @param {PageOption & LanguageOption & RegionOption} [options] - Optional
|
|
1009
|
+
* parameters for specifying language, region, and pagination options.
|
|
1010
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
1011
|
+
* @returns {Promise<UpcomingMovies>} A Promise that resolves with the
|
|
1012
|
+
* upcoming movies.
|
|
877
1013
|
*/
|
|
878
|
-
|
|
879
|
-
return
|
|
1014
|
+
upcoming(options, request) {
|
|
1015
|
+
return this.api.get(`${BASE_MOVIE}/upcoming`, withQuery(options, request));
|
|
880
1016
|
}
|
|
881
1017
|
};
|
|
882
1018
|
|
|
@@ -888,35 +1024,42 @@ var MoviesEndpoint = class extends BaseEndpoint {
|
|
|
888
1024
|
var NetworksEndpoint = class extends BaseEndpoint {
|
|
889
1025
|
/**
|
|
890
1026
|
* Constructs a new NetworksEndpoint instance.
|
|
891
|
-
*
|
|
1027
|
+
*
|
|
1028
|
+
* @param {TokenType} auth - The authentication configuration.
|
|
892
1029
|
*/
|
|
893
|
-
constructor(
|
|
894
|
-
super(
|
|
895
|
-
this.
|
|
1030
|
+
constructor(auth) {
|
|
1031
|
+
super(auth);
|
|
1032
|
+
this.auth = auth;
|
|
896
1033
|
}
|
|
897
1034
|
/**
|
|
898
1035
|
* Retrieves details of a specific network asynchronously.
|
|
1036
|
+
*
|
|
899
1037
|
* @param {number} id - The ID of the network.
|
|
900
|
-
* @returns {Promise<NetworkDetails>} A Promise that resolves with the
|
|
1038
|
+
* @returns {Promise<NetworkDetails>} A Promise that resolves with the
|
|
1039
|
+
* details of the network.
|
|
901
1040
|
*/
|
|
902
|
-
|
|
903
|
-
return
|
|
1041
|
+
details(id) {
|
|
1042
|
+
return this.api.get(`/network/${id}`);
|
|
904
1043
|
}
|
|
905
1044
|
/**
|
|
906
1045
|
* Retrieves alternative names of a specific network asynchronously.
|
|
1046
|
+
*
|
|
907
1047
|
* @param {number} id - The ID of the network.
|
|
908
|
-
* @returns {Promise<AlternativeNames>} A Promise that resolves with the
|
|
1048
|
+
* @returns {Promise<AlternativeNames>} A Promise that resolves with the
|
|
1049
|
+
* alternative names of the network.
|
|
909
1050
|
*/
|
|
910
|
-
|
|
911
|
-
return
|
|
1051
|
+
alternativeNames(id) {
|
|
1052
|
+
return this.api.get(`/network/${id}/alternative_names`);
|
|
912
1053
|
}
|
|
913
1054
|
/**
|
|
914
1055
|
* Retrieves images of a specific network asynchronously.
|
|
1056
|
+
*
|
|
915
1057
|
* @param {number} id - The ID of the network.
|
|
916
|
-
* @returns {Promise<NetworkImages>} A Promise that resolves with the images
|
|
1058
|
+
* @returns {Promise<NetworkImages>} A Promise that resolves with the images
|
|
1059
|
+
* of the network.
|
|
917
1060
|
*/
|
|
918
|
-
|
|
919
|
-
return
|
|
1061
|
+
images(id) {
|
|
1062
|
+
return this.api.get(`/network/${id}/images`);
|
|
920
1063
|
}
|
|
921
1064
|
};
|
|
922
1065
|
|
|
@@ -929,109 +1072,151 @@ const BASE_PERSON = "/person";
|
|
|
929
1072
|
var PeopleEndpoint = class extends BaseEndpoint {
|
|
930
1073
|
/**
|
|
931
1074
|
* Constructs a new PeopleEndpoint instance.
|
|
932
|
-
*
|
|
1075
|
+
*
|
|
1076
|
+
* @param {TokenType} auth - The authentication configuration.
|
|
933
1077
|
*/
|
|
934
|
-
constructor(
|
|
935
|
-
super(
|
|
936
|
-
this.
|
|
1078
|
+
constructor(auth) {
|
|
1079
|
+
super(auth);
|
|
1080
|
+
this.auth = auth;
|
|
937
1081
|
}
|
|
938
1082
|
/**
|
|
939
1083
|
* Retrieves details of a specific person asynchronously.
|
|
1084
|
+
*
|
|
940
1085
|
* @param {number} id - The ID of the person.
|
|
941
|
-
* @param {AppendToResponsePersonKey[]} [appendToResponse] - Optional keys to
|
|
942
|
-
*
|
|
943
|
-
* @
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
1086
|
+
* @param {AppendToResponsePersonKey[]} [appendToResponse] - Optional keys to
|
|
1087
|
+
* append to the response.
|
|
1088
|
+
* @param {string} [language] - Optional parameter for specifying the
|
|
1089
|
+
* language.
|
|
1090
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
1091
|
+
* @returns {Promise<AppendToResponse<PersonDetails, T, "person">>} A
|
|
1092
|
+
* Promise that resolves with the details of the person.
|
|
1093
|
+
*/
|
|
1094
|
+
details(id, appendToResponse, language, request) {
|
|
1095
|
+
const query = {
|
|
1096
|
+
append_to_response: csv(appendToResponse),
|
|
948
1097
|
language
|
|
949
1098
|
};
|
|
950
|
-
return
|
|
1099
|
+
return this.api.get(`${BASE_PERSON}/${id}`, withQuery(query, request));
|
|
951
1100
|
}
|
|
952
1101
|
/**
|
|
953
1102
|
* Retrieves changes made to a specific person asynchronously.
|
|
1103
|
+
*
|
|
954
1104
|
* @param {number} id - The ID of the person.
|
|
955
|
-
* @param {ChangeOption} [options] - Optional parameters for filtering
|
|
956
|
-
*
|
|
1105
|
+
* @param {ChangeOption} [options] - Optional parameters for filtering
|
|
1106
|
+
* changes.
|
|
1107
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
1108
|
+
* @returns {Promise<Changes<PersonChangeValue>>} A Promise that resolves
|
|
1109
|
+
* with the changes made to the person.
|
|
957
1110
|
*/
|
|
958
|
-
|
|
959
|
-
return
|
|
1111
|
+
changes(id, options, request) {
|
|
1112
|
+
return this.api.get(`${BASE_PERSON}/${id}/changes`, withQuery(options, request));
|
|
960
1113
|
}
|
|
961
1114
|
/**
|
|
962
1115
|
* Retrieves movie credits of a specific person asynchronously.
|
|
1116
|
+
*
|
|
963
1117
|
* @param {number} id - The ID of the person.
|
|
964
|
-
* @param {LanguageOption} [options] - Optional parameters for specifying the
|
|
965
|
-
*
|
|
1118
|
+
* @param {LanguageOption} [options] - Optional parameters for specifying the
|
|
1119
|
+
* language.
|
|
1120
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
1121
|
+
* @returns {Promise<PersonMovieCredit>} A Promise that resolves with the
|
|
1122
|
+
* movie credits of the person.
|
|
966
1123
|
*/
|
|
967
|
-
|
|
968
|
-
return
|
|
1124
|
+
movieCredits(id, options, request) {
|
|
1125
|
+
return this.api.get(`${BASE_PERSON}/${id}/movie_credits`, withQuery(options, request));
|
|
969
1126
|
}
|
|
970
1127
|
/**
|
|
971
1128
|
* Retrieves TV show credits of a specific person asynchronously.
|
|
1129
|
+
*
|
|
972
1130
|
* @param {number} id - The ID of the person.
|
|
973
|
-
* @param {LanguageOption} [options] - Optional parameters for specifying the
|
|
974
|
-
*
|
|
1131
|
+
* @param {LanguageOption} [options] - Optional parameters for specifying the
|
|
1132
|
+
* language.
|
|
1133
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
1134
|
+
* @returns {Promise<PersonTvShowCredit>} A Promise that resolves with the
|
|
1135
|
+
* TV show credits of the person.
|
|
975
1136
|
*/
|
|
976
|
-
|
|
977
|
-
return
|
|
1137
|
+
tvShowCredits(id, options, request) {
|
|
1138
|
+
return this.api.get(`${BASE_PERSON}/${id}/tv_credits`, withQuery(options, request));
|
|
978
1139
|
}
|
|
979
1140
|
/**
|
|
980
1141
|
* Retrieves combined credits of a specific person asynchronously.
|
|
1142
|
+
*
|
|
981
1143
|
* @param {number} id - The ID of the person.
|
|
982
|
-
* @param {LanguageOption} [options] - Optional parameters for specifying the
|
|
983
|
-
*
|
|
1144
|
+
* @param {LanguageOption} [options] - Optional parameters for specifying the
|
|
1145
|
+
* language.
|
|
1146
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
1147
|
+
* @returns {Promise<PersonCombinedCredits>} A Promise that resolves with the
|
|
1148
|
+
* combined credits of the person.
|
|
984
1149
|
*/
|
|
985
|
-
|
|
986
|
-
return
|
|
1150
|
+
combinedCredits(id, options, request) {
|
|
1151
|
+
return this.api.get(`${BASE_PERSON}/${id}/combined_credits`, withQuery(options, request));
|
|
987
1152
|
}
|
|
988
1153
|
/**
|
|
989
1154
|
* Retrieves external IDs of a specific person asynchronously.
|
|
1155
|
+
*
|
|
990
1156
|
* @param {number} id - The ID of the person.
|
|
991
|
-
* @
|
|
1157
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
1158
|
+
* @returns {Promise<ExternalIds>} A Promise that resolves with the external
|
|
1159
|
+
* IDs of the person.
|
|
992
1160
|
*/
|
|
993
|
-
|
|
994
|
-
return
|
|
1161
|
+
externalId(id, request) {
|
|
1162
|
+
return this.api.get(`${BASE_PERSON}/${id}/external_ids`, request);
|
|
995
1163
|
}
|
|
996
1164
|
/**
|
|
997
1165
|
* Retrieves images of a specific person asynchronously.
|
|
1166
|
+
*
|
|
998
1167
|
* @param {number} id - The ID of the person.
|
|
999
|
-
* @
|
|
1168
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
1169
|
+
* @returns {Promise<PeopleImages>} A Promise that resolves with the images
|
|
1170
|
+
* of the person.
|
|
1000
1171
|
*/
|
|
1001
|
-
|
|
1002
|
-
return
|
|
1172
|
+
images(id, request) {
|
|
1173
|
+
return this.api.get(`${BASE_PERSON}/${id}/images`, request);
|
|
1003
1174
|
}
|
|
1004
1175
|
/**
|
|
1005
1176
|
* Retrieves tagged images of a specific person asynchronously.
|
|
1177
|
+
*
|
|
1006
1178
|
* @param {number} id - The ID of the person.
|
|
1007
|
-
* @param {PageOption} [options] - Optional parameters for specifying
|
|
1008
|
-
*
|
|
1179
|
+
* @param {PageOption} [options] - Optional parameters for specifying
|
|
1180
|
+
* pagination options.
|
|
1181
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
1182
|
+
* @returns {Promise<TaggedImages>} A Promise that resolves with the tagged
|
|
1183
|
+
* images of the person.
|
|
1009
1184
|
*/
|
|
1010
|
-
|
|
1011
|
-
return
|
|
1185
|
+
taggedImages(id, options, request) {
|
|
1186
|
+
return this.api.get(`${BASE_PERSON}/${id}/tagged_images`, withQuery(options, request));
|
|
1012
1187
|
}
|
|
1013
1188
|
/**
|
|
1014
1189
|
* Retrieves translations of a specific person asynchronously.
|
|
1190
|
+
*
|
|
1015
1191
|
* @param {number} id - The ID of the person.
|
|
1016
|
-
* @
|
|
1192
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
1193
|
+
* @returns {Promise<PersonTranslations>} A Promise that resolves with the
|
|
1194
|
+
* translations of the person.
|
|
1017
1195
|
*/
|
|
1018
|
-
|
|
1019
|
-
return
|
|
1196
|
+
translation(id, request) {
|
|
1197
|
+
return this.api.get(`${BASE_PERSON}/${id}/translations`, request);
|
|
1020
1198
|
}
|
|
1021
1199
|
/**
|
|
1022
1200
|
* Retrieves details of the latest person asynchronously.
|
|
1023
|
-
*
|
|
1201
|
+
*
|
|
1202
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
1203
|
+
* @returns {Promise<PersonDetails>} A Promise that resolves with the details
|
|
1204
|
+
* of the latest person.
|
|
1024
1205
|
*/
|
|
1025
|
-
|
|
1026
|
-
return
|
|
1206
|
+
latest(request) {
|
|
1207
|
+
return this.api.get(`${BASE_PERSON}/latest`, request);
|
|
1027
1208
|
}
|
|
1028
1209
|
/**
|
|
1029
1210
|
* Retrieves popular persons asynchronously.
|
|
1030
|
-
*
|
|
1031
|
-
* @
|
|
1211
|
+
*
|
|
1212
|
+
* @param {LanguageOption & PageOption} [options] - Optional parameters for
|
|
1213
|
+
* specifying language and pagination options.
|
|
1214
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
1215
|
+
* @returns {Promise<PopularPersons>} A Promise that resolves with the
|
|
1216
|
+
* popular persons.
|
|
1032
1217
|
*/
|
|
1033
|
-
|
|
1034
|
-
return
|
|
1218
|
+
popular(options, request) {
|
|
1219
|
+
return this.api.get(`${BASE_PERSON}/popular`, withQuery(options, request));
|
|
1035
1220
|
}
|
|
1036
1221
|
};
|
|
1037
1222
|
|
|
@@ -1043,19 +1228,22 @@ var PeopleEndpoint = class extends BaseEndpoint {
|
|
|
1043
1228
|
var ReviewEndpoint = class extends BaseEndpoint {
|
|
1044
1229
|
/**
|
|
1045
1230
|
* Constructs a new ReviewEndpoint instance.
|
|
1046
|
-
*
|
|
1231
|
+
*
|
|
1232
|
+
* @param {TokenType} auth - The authentication configuration.
|
|
1047
1233
|
*/
|
|
1048
|
-
constructor(
|
|
1049
|
-
super(
|
|
1050
|
-
this.
|
|
1234
|
+
constructor(auth) {
|
|
1235
|
+
super(auth);
|
|
1236
|
+
this.auth = auth;
|
|
1051
1237
|
}
|
|
1052
1238
|
/**
|
|
1053
1239
|
* Retrieves details of a specific review asynchronously.
|
|
1240
|
+
*
|
|
1054
1241
|
* @param {string} id - The ID of the review.
|
|
1055
|
-
* @returns {Promise<ReviewDetails>} A Promise that resolves with the details
|
|
1242
|
+
* @returns {Promise<ReviewDetails>} A Promise that resolves with the details
|
|
1243
|
+
* of the review.
|
|
1056
1244
|
*/
|
|
1057
|
-
|
|
1058
|
-
return
|
|
1245
|
+
details(id) {
|
|
1246
|
+
return this.api.get(`/review/${id}`);
|
|
1059
1247
|
}
|
|
1060
1248
|
};
|
|
1061
1249
|
|
|
@@ -1068,7 +1256,8 @@ const BASE_SEARCH = "/search";
|
|
|
1068
1256
|
var SearchEndpoint = class extends BaseEndpoint {
|
|
1069
1257
|
/**
|
|
1070
1258
|
* Constructs a new SearchEndpoint instance.
|
|
1071
|
-
*
|
|
1259
|
+
*
|
|
1260
|
+
* @param {TokenType} access_token - The access token used for authentication.
|
|
1072
1261
|
*/
|
|
1073
1262
|
constructor(access_token) {
|
|
1074
1263
|
super(access_token);
|
|
@@ -1076,59 +1265,80 @@ var SearchEndpoint = class extends BaseEndpoint {
|
|
|
1076
1265
|
}
|
|
1077
1266
|
/**
|
|
1078
1267
|
* Searches for companies asynchronously.
|
|
1268
|
+
*
|
|
1079
1269
|
* @param {SearchOptions} options - The search options.
|
|
1080
|
-
* @
|
|
1270
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
1271
|
+
* @returns {Promise<Search<Company>>} A Promise that resolves with the
|
|
1272
|
+
* search results for companies.
|
|
1081
1273
|
*/
|
|
1082
|
-
|
|
1083
|
-
return
|
|
1274
|
+
companies(options, request) {
|
|
1275
|
+
return this.api.get(`${BASE_SEARCH}/company`, withQuery(options, request));
|
|
1084
1276
|
}
|
|
1085
1277
|
/**
|
|
1086
1278
|
* Searches for collections asynchronously.
|
|
1087
|
-
*
|
|
1088
|
-
* @
|
|
1279
|
+
*
|
|
1280
|
+
* @param {CollectionSearchOptions} options - The search options.
|
|
1281
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
1282
|
+
* @returns {Promise<Search<Collection>>} A Promise that resolves with the
|
|
1283
|
+
* search results for collections.
|
|
1089
1284
|
*/
|
|
1090
|
-
|
|
1091
|
-
return
|
|
1285
|
+
collections(options, request) {
|
|
1286
|
+
return this.api.get(`${BASE_SEARCH}/collection`, withQuery(options, request));
|
|
1092
1287
|
}
|
|
1093
1288
|
/**
|
|
1094
1289
|
* Searches for keywords asynchronously.
|
|
1290
|
+
*
|
|
1095
1291
|
* @param {SearchOptions} options - The search options.
|
|
1096
|
-
* @
|
|
1292
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
1293
|
+
* @returns {Promise<Search<{ id: string; name: string }>>} A Promise that
|
|
1294
|
+
* resolves with the search results for keywords.
|
|
1097
1295
|
*/
|
|
1098
|
-
|
|
1099
|
-
return
|
|
1296
|
+
keywords(options, request) {
|
|
1297
|
+
return this.api.get(`${BASE_SEARCH}/keyword`, withQuery(options, request));
|
|
1100
1298
|
}
|
|
1101
1299
|
/**
|
|
1102
1300
|
* Searches for movies asynchronously.
|
|
1301
|
+
*
|
|
1103
1302
|
* @param {MovieSearchOptions} options - The search options.
|
|
1104
|
-
* @
|
|
1303
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
1304
|
+
* @returns {Promise<Search<Movie>>} A Promise that resolves with the search
|
|
1305
|
+
* results for movies.
|
|
1105
1306
|
*/
|
|
1106
|
-
|
|
1107
|
-
return
|
|
1307
|
+
movies(options, request) {
|
|
1308
|
+
return this.api.get(`${BASE_SEARCH}/movie`, withQuery(options, request));
|
|
1108
1309
|
}
|
|
1109
1310
|
/**
|
|
1110
1311
|
* Searches for people asynchronously.
|
|
1312
|
+
*
|
|
1111
1313
|
* @param {PeopleSearchOptions} options - The search options.
|
|
1112
|
-
* @
|
|
1314
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
1315
|
+
* @returns {Promise<Search<Person>>} A Promise that resolves with the search
|
|
1316
|
+
* results for people.
|
|
1113
1317
|
*/
|
|
1114
|
-
|
|
1115
|
-
return
|
|
1318
|
+
people(options, request) {
|
|
1319
|
+
return this.api.get(`${BASE_SEARCH}/person`, withQuery(options, request));
|
|
1116
1320
|
}
|
|
1117
1321
|
/**
|
|
1118
1322
|
* Searches for TV shows asynchronously.
|
|
1323
|
+
*
|
|
1119
1324
|
* @param {TvSearchOptions} options - The search options.
|
|
1120
|
-
* @
|
|
1325
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
1326
|
+
* @returns {Promise<Search<TV>>} A Promise that resolves with the search
|
|
1327
|
+
* results for TV shows.
|
|
1121
1328
|
*/
|
|
1122
|
-
|
|
1123
|
-
return
|
|
1329
|
+
tv(options, request) {
|
|
1330
|
+
return this.api.get(`${BASE_SEARCH}/tv`, withQuery(options, request));
|
|
1124
1331
|
}
|
|
1125
1332
|
/**
|
|
1126
1333
|
* Performs a multi-search asynchronously.
|
|
1334
|
+
*
|
|
1127
1335
|
* @param {MultiSearchOptions} options - The search options.
|
|
1128
|
-
* @
|
|
1336
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
1337
|
+
* @returns {Promise<Search<MultiSearchResult>>} A Promise that resolves with
|
|
1338
|
+
* the multi-search results.
|
|
1129
1339
|
*/
|
|
1130
|
-
|
|
1131
|
-
return
|
|
1340
|
+
multi(options, request) {
|
|
1341
|
+
return this.api.get(`${BASE_SEARCH}/multi`, withQuery(options, request));
|
|
1132
1342
|
}
|
|
1133
1343
|
};
|
|
1134
1344
|
|
|
@@ -1140,22 +1350,28 @@ var SearchEndpoint = class extends BaseEndpoint {
|
|
|
1140
1350
|
var TrendingEndpoint = class extends BaseEndpoint {
|
|
1141
1351
|
/**
|
|
1142
1352
|
* Constructs a new TrendingEndpoint instance.
|
|
1143
|
-
*
|
|
1353
|
+
*
|
|
1354
|
+
* @param {TokenType} auth - The authentication configuration.
|
|
1144
1355
|
*/
|
|
1145
|
-
constructor(
|
|
1146
|
-
super(
|
|
1147
|
-
this.
|
|
1356
|
+
constructor(auth) {
|
|
1357
|
+
super(auth);
|
|
1358
|
+
this.auth = auth;
|
|
1148
1359
|
}
|
|
1149
1360
|
/**
|
|
1150
|
-
* Retrieves trending content asynchronously based on media type and time
|
|
1151
|
-
*
|
|
1152
|
-
*
|
|
1153
|
-
* @param {
|
|
1154
|
-
* @
|
|
1155
|
-
* @
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1361
|
+
* Retrieves trending content asynchronously based on media type and time
|
|
1362
|
+
* window.
|
|
1363
|
+
*
|
|
1364
|
+
* @param {TrendingMediaType} mediaType - The type of media.
|
|
1365
|
+
* @param {TimeWindow} timeWindow - The time window for trending content.
|
|
1366
|
+
* @param {LanguageOption & PageOption} [options] - Optional parameters for
|
|
1367
|
+
* specifying the language and pagination.
|
|
1368
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
1369
|
+
* @returns {Promise<TrendingResults<T>>} A Promise that resolves with the
|
|
1370
|
+
* trending results.
|
|
1371
|
+
* @template T - The type of media being searched for.
|
|
1372
|
+
*/
|
|
1373
|
+
trending(mediaType, timeWindow, options, request) {
|
|
1374
|
+
return this.api.get(`/trending/${mediaType}/${timeWindow}`, withQuery(options, request));
|
|
1159
1375
|
}
|
|
1160
1376
|
};
|
|
1161
1377
|
|
|
@@ -1170,86 +1386,120 @@ const BASE_EPISODE = (episodeSelection) => {
|
|
|
1170
1386
|
var TvEpisodesEndpoint = class extends BaseEndpoint {
|
|
1171
1387
|
/**
|
|
1172
1388
|
* Constructs a new TvEpisodesEndpoint instance.
|
|
1173
|
-
*
|
|
1389
|
+
*
|
|
1390
|
+
* @param {TokenType} auth - The authentication configuration.
|
|
1174
1391
|
*/
|
|
1175
|
-
constructor(
|
|
1176
|
-
super(
|
|
1177
|
-
this.
|
|
1392
|
+
constructor(auth) {
|
|
1393
|
+
super(auth);
|
|
1394
|
+
this.auth = auth;
|
|
1178
1395
|
}
|
|
1179
1396
|
/**
|
|
1180
1397
|
* Retrieves details of a specific TV episode asynchronously.
|
|
1181
|
-
*
|
|
1182
|
-
* @param {
|
|
1183
|
-
*
|
|
1184
|
-
* @
|
|
1185
|
-
*
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1398
|
+
*
|
|
1399
|
+
* @param {EpisodeSelection} episodeSelection - The selection criteria for
|
|
1400
|
+
* the TV episode.
|
|
1401
|
+
* @param {AppendToResponseTvEpisodeKey[]} [appendToResponse] - Additional
|
|
1402
|
+
* data to append to the response.
|
|
1403
|
+
* @param {LanguageOption} [options] - Optional parameters for specifying the
|
|
1404
|
+
* language.
|
|
1405
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
1406
|
+
* @returns {Promise<AppendToResponse<Omit<Episode, "show_id">, T,
|
|
1407
|
+
* "tvEpisode">>} A Promise that resolves with the details of the TV
|
|
1408
|
+
* episode.
|
|
1409
|
+
*/
|
|
1410
|
+
details(episodeSelection, appendToResponse, options, request) {
|
|
1411
|
+
const query = {
|
|
1412
|
+
append_to_response: csv(appendToResponse),
|
|
1190
1413
|
...options
|
|
1191
1414
|
};
|
|
1192
|
-
return
|
|
1415
|
+
return this.api.get(BASE_EPISODE(episodeSelection), withQuery(query, request));
|
|
1193
1416
|
}
|
|
1194
1417
|
/**
|
|
1195
1418
|
* Retrieves changes related to a specific TV episode asynchronously.
|
|
1419
|
+
*
|
|
1196
1420
|
* @param {number} episodeID - The ID of the TV episode.
|
|
1197
|
-
* @param {ChangeOption} [options] - Optional parameters for specifying
|
|
1198
|
-
*
|
|
1421
|
+
* @param {ChangeOption} [options] - Optional parameters for specifying
|
|
1422
|
+
* changes.
|
|
1423
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
1424
|
+
* @returns {Promise<Changes<TvEpisodeChangeValue>>} A Promise that resolves
|
|
1425
|
+
* with the changes related to the TV episode.
|
|
1199
1426
|
*/
|
|
1200
|
-
|
|
1201
|
-
return
|
|
1427
|
+
changes(episodeID, options, request) {
|
|
1428
|
+
return this.api.get(`/tv/episode/${episodeID}/changes`, withQuery(options, request));
|
|
1202
1429
|
}
|
|
1203
1430
|
/**
|
|
1204
1431
|
* Retrieves credits for a specific TV episode asynchronously.
|
|
1205
|
-
*
|
|
1206
|
-
* @param {
|
|
1207
|
-
*
|
|
1432
|
+
*
|
|
1433
|
+
* @param {EpisodeSelection} episodeSelection - The selection criteria for
|
|
1434
|
+
* the TV episode.
|
|
1435
|
+
* @param {LanguageOption} [options] - Optional parameters for specifying the
|
|
1436
|
+
* language.
|
|
1437
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
1438
|
+
* @returns {Promise<TvEpisodeCredit>} A Promise that resolves with the
|
|
1439
|
+
* credits for the TV episode.
|
|
1208
1440
|
*/
|
|
1209
|
-
|
|
1210
|
-
return
|
|
1441
|
+
credits(episodeSelection, options, request) {
|
|
1442
|
+
return this.api.get(`${BASE_EPISODE(episodeSelection)}/credits`, withQuery(options, request));
|
|
1211
1443
|
}
|
|
1212
1444
|
/**
|
|
1213
1445
|
* Retrieves external IDs for a specific TV episode asynchronously.
|
|
1214
|
-
*
|
|
1215
|
-
* @
|
|
1446
|
+
*
|
|
1447
|
+
* @param {EpisodeSelection} episodeSelection - The selection criteria for
|
|
1448
|
+
* the TV episode.
|
|
1449
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
1450
|
+
* @returns {Promise<ExternalIds>} A Promise that resolves with the external
|
|
1451
|
+
* IDs for the TV episode.
|
|
1216
1452
|
*/
|
|
1217
|
-
|
|
1218
|
-
return
|
|
1453
|
+
externalIds(episodeSelection, request) {
|
|
1454
|
+
return this.api.get(`${BASE_EPISODE(episodeSelection)}/external_ids`, request);
|
|
1219
1455
|
}
|
|
1220
1456
|
/**
|
|
1221
1457
|
* Retrieves images for a specific TV episode asynchronously.
|
|
1222
|
-
*
|
|
1223
|
-
* @param {
|
|
1224
|
-
*
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1458
|
+
*
|
|
1459
|
+
* @param {EpisodeSelection} episodeSelection - The selection criteria for
|
|
1460
|
+
* the TV episode.
|
|
1461
|
+
* @param {TvEpisodeImageSearchOptions} [options] - Optional parameters for
|
|
1462
|
+
* specifying image search options.
|
|
1463
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
1464
|
+
* @returns {Promise<Images>} A Promise that resolves with the images for the
|
|
1465
|
+
* TV episode.
|
|
1466
|
+
*/
|
|
1467
|
+
images(episodeSelection, options, request) {
|
|
1468
|
+
const query = {
|
|
1469
|
+
include_image_language: csv(options?.include_image_language),
|
|
1229
1470
|
language: options?.language
|
|
1230
1471
|
};
|
|
1231
|
-
return
|
|
1472
|
+
return this.api.get(`${BASE_EPISODE(episodeSelection)}/images`, withQuery(query, request));
|
|
1232
1473
|
}
|
|
1233
1474
|
/**
|
|
1234
1475
|
* Retrieves translations for a specific TV episode asynchronously.
|
|
1235
|
-
*
|
|
1236
|
-
* @
|
|
1476
|
+
*
|
|
1477
|
+
* @param {EpisodeSelection} episodeSelection - The selection criteria for
|
|
1478
|
+
* the TV episode.
|
|
1479
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
1480
|
+
* @returns {Promise<TvEpisodeTranslations>} A Promise that resolves with the
|
|
1481
|
+
* translations for the TV episode.
|
|
1237
1482
|
*/
|
|
1238
|
-
|
|
1239
|
-
return
|
|
1483
|
+
translations(episodeSelection, request) {
|
|
1484
|
+
return this.api.get(`${BASE_EPISODE(episodeSelection)}/translations`, request);
|
|
1240
1485
|
}
|
|
1241
1486
|
/**
|
|
1242
1487
|
* Retrieves videos for a specific TV episode asynchronously.
|
|
1243
|
-
*
|
|
1244
|
-
* @param {
|
|
1245
|
-
*
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1488
|
+
*
|
|
1489
|
+
* @param {EpisodeSelection} episodeSelection - The selection criteria for
|
|
1490
|
+
* the TV episode.
|
|
1491
|
+
* @param {TvEpisodeVideoSearchOptions} [options] - Optional parameters for
|
|
1492
|
+
* specifying video search options.
|
|
1493
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
1494
|
+
* @returns {Promise<Videos>} A Promise that resolves with the videos for the
|
|
1495
|
+
* TV episode.
|
|
1496
|
+
*/
|
|
1497
|
+
videos(episodeSelection, options, request) {
|
|
1498
|
+
const query = {
|
|
1499
|
+
include_video_language: csv(options?.include_video_language),
|
|
1250
1500
|
language: options?.language
|
|
1251
1501
|
};
|
|
1252
|
-
return
|
|
1502
|
+
return this.api.get(`${BASE_EPISODE(episodeSelection)}/videos`, withQuery(query, request));
|
|
1253
1503
|
}
|
|
1254
1504
|
};
|
|
1255
1505
|
|
|
@@ -1264,97 +1514,137 @@ const BASE_SEASON = (seasonSelection) => {
|
|
|
1264
1514
|
var TvSeasonsEndpoint = class extends BaseEndpoint {
|
|
1265
1515
|
/**
|
|
1266
1516
|
* Constructs a new TvSeasonsEndpoint instance.
|
|
1267
|
-
*
|
|
1517
|
+
*
|
|
1518
|
+
* @param {TokenType} auth - The authentication configuration.
|
|
1268
1519
|
*/
|
|
1269
|
-
constructor(
|
|
1270
|
-
super(
|
|
1271
|
-
this.
|
|
1520
|
+
constructor(auth) {
|
|
1521
|
+
super(auth);
|
|
1522
|
+
this.auth = auth;
|
|
1272
1523
|
}
|
|
1273
1524
|
/**
|
|
1274
1525
|
* Retrieves details of a specific TV season asynchronously.
|
|
1275
|
-
*
|
|
1276
|
-
* @param {
|
|
1277
|
-
*
|
|
1278
|
-
* @
|
|
1279
|
-
*
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1526
|
+
*
|
|
1527
|
+
* @param {SeasonSelection} seasonSelection - The selection criteria for the
|
|
1528
|
+
* TV season.
|
|
1529
|
+
* @param {AppendToResponseTvSeasonKey[]} [appendToResponse] - Additional
|
|
1530
|
+
* data to append to the response.
|
|
1531
|
+
* @param {LanguageOption} [options] - Optional parameters for specifying the
|
|
1532
|
+
* language.
|
|
1533
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
1534
|
+
* @returns {Promise<AppendToResponse<SeasonDetails, T, "tvSeason">>} A
|
|
1535
|
+
* Promise that resolves with the details of the TV season.
|
|
1536
|
+
*/
|
|
1537
|
+
details(seasonSelection, appendToResponse, options, request) {
|
|
1538
|
+
const query = {
|
|
1539
|
+
append_to_response: csv(appendToResponse),
|
|
1284
1540
|
...options
|
|
1285
1541
|
};
|
|
1286
|
-
return
|
|
1542
|
+
return this.api.get(BASE_SEASON(seasonSelection), withQuery(query, request));
|
|
1287
1543
|
}
|
|
1288
1544
|
/**
|
|
1289
1545
|
* Retrieves aggregate credits for a specific TV season asynchronously.
|
|
1290
|
-
*
|
|
1291
|
-
* @param {
|
|
1292
|
-
*
|
|
1546
|
+
*
|
|
1547
|
+
* @param {SeasonSelection} seasonSelection - The selection criteria for the
|
|
1548
|
+
* TV season.
|
|
1549
|
+
* @param {LanguageOption} [options] - Optional parameters for specifying the
|
|
1550
|
+
* language.
|
|
1551
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
1552
|
+
* @returns {Promise<AggregateCredits>} A Promise that resolves with the
|
|
1553
|
+
* aggregate credits for the TV season.
|
|
1293
1554
|
*/
|
|
1294
|
-
|
|
1295
|
-
return
|
|
1555
|
+
aggregateCredits(seasonSelection, options, request) {
|
|
1556
|
+
return this.api.get(`${BASE_SEASON(seasonSelection)}/aggregate_credits`, withQuery(options, request));
|
|
1296
1557
|
}
|
|
1297
1558
|
/**
|
|
1298
1559
|
* Retrieves changes related to a specific TV season asynchronously.
|
|
1560
|
+
*
|
|
1299
1561
|
* @param {number} seasonId - The ID of the TV season.
|
|
1300
|
-
* @param {ChangeOption} [options] - Optional parameters for specifying
|
|
1301
|
-
*
|
|
1562
|
+
* @param {ChangeOption} [options] - Optional parameters for specifying
|
|
1563
|
+
* changes.
|
|
1564
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
1565
|
+
* @returns {Promise<Changes<TvSeasonChangeValue>>} A Promise that resolves
|
|
1566
|
+
* with the changes related to the TV season.
|
|
1302
1567
|
*/
|
|
1303
|
-
|
|
1304
|
-
return
|
|
1568
|
+
changes(seasonId, options, request) {
|
|
1569
|
+
return this.api.get(`/tv/season/${seasonId}/changes`, withQuery(options, request));
|
|
1305
1570
|
}
|
|
1306
1571
|
/**
|
|
1307
1572
|
* Retrieves credits for a specific TV season asynchronously.
|
|
1308
|
-
*
|
|
1309
|
-
* @param {
|
|
1310
|
-
*
|
|
1573
|
+
*
|
|
1574
|
+
* @param {SeasonSelection} seasonSelection - The selection criteria for the
|
|
1575
|
+
* TV season.
|
|
1576
|
+
* @param {LanguageOption} [options] - Optional parameters for specifying the
|
|
1577
|
+
* language.
|
|
1578
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
1579
|
+
* @returns {Promise<Credits>} A Promise that resolves with the credits for
|
|
1580
|
+
* the TV season.
|
|
1311
1581
|
*/
|
|
1312
|
-
|
|
1313
|
-
return
|
|
1582
|
+
credits(seasonSelection, options, request) {
|
|
1583
|
+
return this.api.get(`${BASE_SEASON(seasonSelection)}/credits`, withQuery(options, request));
|
|
1314
1584
|
}
|
|
1315
1585
|
/**
|
|
1316
1586
|
* Retrieves external IDs for a specific TV season asynchronously.
|
|
1317
|
-
*
|
|
1318
|
-
* @param {
|
|
1319
|
-
*
|
|
1587
|
+
*
|
|
1588
|
+
* @param {SeasonSelection} seasonSelection - The selection criteria for the
|
|
1589
|
+
* TV season.
|
|
1590
|
+
* @param {LanguageOption} [options] - Optional parameters for specifying the
|
|
1591
|
+
* language.
|
|
1592
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
1593
|
+
* @returns {Promise<ExternalIds>} A Promise that resolves with the external
|
|
1594
|
+
* IDs for the TV season.
|
|
1320
1595
|
*/
|
|
1321
|
-
|
|
1322
|
-
return
|
|
1596
|
+
externalIds(seasonSelection, options, request) {
|
|
1597
|
+
return this.api.get(`${BASE_SEASON(seasonSelection)}/external_ids`, withQuery(options, request));
|
|
1323
1598
|
}
|
|
1324
1599
|
/**
|
|
1325
1600
|
* Retrieves images for a specific TV season asynchronously.
|
|
1326
|
-
*
|
|
1327
|
-
* @param {
|
|
1328
|
-
*
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1601
|
+
*
|
|
1602
|
+
* @param {SeasonSelection} seasonSelection - The selection criteria for the
|
|
1603
|
+
* TV season.
|
|
1604
|
+
* @param {TvSeasonImageSearchOptions} [options] - Optional parameters for
|
|
1605
|
+
* specifying image search options.
|
|
1606
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
1607
|
+
* @returns {Promise<Images>} A Promise that resolves with the images for the
|
|
1608
|
+
* TV season.
|
|
1609
|
+
*/
|
|
1610
|
+
images(seasonSelection, options, request) {
|
|
1611
|
+
const query = {
|
|
1612
|
+
include_image_language: csv(options?.include_image_language),
|
|
1333
1613
|
language: options?.language
|
|
1334
1614
|
};
|
|
1335
|
-
return
|
|
1615
|
+
return this.api.get(`${BASE_SEASON(seasonSelection)}/images`, withQuery(query, request));
|
|
1336
1616
|
}
|
|
1337
1617
|
/**
|
|
1338
1618
|
* Retrieves videos for a specific TV season asynchronously.
|
|
1339
|
-
*
|
|
1340
|
-
* @param {
|
|
1341
|
-
*
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1619
|
+
*
|
|
1620
|
+
* @param {SeasonSelection} seasonSelection - The selection criteria for the
|
|
1621
|
+
* TV season.
|
|
1622
|
+
* @param {TvSeasonVideoSearchOptions} [options] - Optional parameters for
|
|
1623
|
+
* specifying video search options.
|
|
1624
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
1625
|
+
* @returns {Promise<Videos>} A Promise that resolves with the videos for the
|
|
1626
|
+
* TV season.
|
|
1627
|
+
*/
|
|
1628
|
+
videos(seasonSelection, options, request) {
|
|
1629
|
+
const query = {
|
|
1630
|
+
include_video_language: csv(options?.include_video_language),
|
|
1346
1631
|
language: options?.language
|
|
1347
1632
|
};
|
|
1348
|
-
return
|
|
1633
|
+
return this.api.get(`${BASE_SEASON(seasonSelection)}/videos`, withQuery(query, request));
|
|
1349
1634
|
}
|
|
1350
1635
|
/**
|
|
1351
1636
|
* Retrieves translations for a specific TV season asynchronously.
|
|
1352
|
-
*
|
|
1353
|
-
* @param {
|
|
1354
|
-
*
|
|
1637
|
+
*
|
|
1638
|
+
* @param {SeasonSelection} seasonSelection - The selection criteria for the
|
|
1639
|
+
* TV season.
|
|
1640
|
+
* @param {LanguageOption} [options] - Optional parameters for specifying the
|
|
1641
|
+
* language.
|
|
1642
|
+
* @param {RequestConfig} [request] - Optional request behavior overrides.
|
|
1643
|
+
* @returns {Promise<Translations>} A Promise that resolves with the
|
|
1644
|
+
* translations for the TV season.
|
|
1355
1645
|
*/
|
|
1356
|
-
|
|
1357
|
-
return
|
|
1646
|
+
translations(seasonSelection, options, request) {
|
|
1647
|
+
return this.api.get(`${BASE_SEASON(seasonSelection)}/translations`, withQuery(options, request));
|
|
1358
1648
|
}
|
|
1359
1649
|
};
|
|
1360
1650
|
|
|
@@ -1367,220 +1657,276 @@ const BASE_TV = "/tv";
|
|
|
1367
1657
|
var TvShowsEndpoint = class extends BaseEndpoint {
|
|
1368
1658
|
/**
|
|
1369
1659
|
* Constructs a new TvShowsEndpoint instance.
|
|
1370
|
-
*
|
|
1660
|
+
*
|
|
1661
|
+
* @param {TokenType} auth - The authentication configuration.
|
|
1371
1662
|
*/
|
|
1372
|
-
constructor(
|
|
1373
|
-
super(
|
|
1374
|
-
this.
|
|
1663
|
+
constructor(auth) {
|
|
1664
|
+
super(auth);
|
|
1665
|
+
this.auth = auth;
|
|
1375
1666
|
}
|
|
1376
1667
|
/**
|
|
1377
1668
|
* Retrieves details of a specific TV show asynchronously.
|
|
1669
|
+
*
|
|
1378
1670
|
* @param {number} id - The ID of the TV show.
|
|
1379
|
-
* @param {AppendToResponseTvKey[]} [appendToResponse] - Additional data to
|
|
1671
|
+
* @param {AppendToResponseTvKey[]} [appendToResponse] - Additional data to
|
|
1672
|
+
* append to the response.
|
|
1380
1673
|
* @param {string} [language] - The language for the response.
|
|
1381
|
-
* @returns {Promise<AppendToResponse<TvShowDetails,
|
|
1382
|
-
*
|
|
1674
|
+
* @returns {Promise<AppendToResponse<TvShowDetails, T, "tvShow">>} A
|
|
1675
|
+
* Promise that resolves with the details of the TV show.
|
|
1383
1676
|
*/
|
|
1384
|
-
|
|
1677
|
+
details(id, appendToResponse, language) {
|
|
1385
1678
|
const options = {
|
|
1386
|
-
append_to_response: appendToResponse
|
|
1679
|
+
append_to_response: csv(appendToResponse),
|
|
1387
1680
|
language
|
|
1388
1681
|
};
|
|
1389
|
-
return
|
|
1682
|
+
return this.api.get(`${BASE_TV}/${id}`, { query: options });
|
|
1390
1683
|
}
|
|
1391
1684
|
/**
|
|
1392
1685
|
* Retrieves alternative titles of a specific TV show asynchronously.
|
|
1686
|
+
*
|
|
1393
1687
|
* @param {number} id - The ID of the TV show.
|
|
1394
|
-
* @returns {Promise<AlternativeTitles>} A Promise that resolves with the
|
|
1688
|
+
* @returns {Promise<AlternativeTitles>} A Promise that resolves with the
|
|
1689
|
+
* alternative titles of the TV show.
|
|
1395
1690
|
*/
|
|
1396
|
-
|
|
1397
|
-
return
|
|
1691
|
+
alternativeTitles(id) {
|
|
1692
|
+
return this.api.get(`${BASE_TV}/${id}/alternative_titles`);
|
|
1398
1693
|
}
|
|
1399
1694
|
/**
|
|
1400
1695
|
* Retrieves changes for a specific TV show asynchronously.
|
|
1696
|
+
*
|
|
1401
1697
|
* @param {number} id - The ID of the TV show.
|
|
1402
1698
|
* @param {ChangeOption} [options] - Additional options for the request.
|
|
1403
|
-
* @returns {Promise<Changes<TvShowChangeValue>>}
|
|
1404
|
-
*
|
|
1699
|
+
* @returns {Promise<Changes<TvShowChangeValue>>} A Promise that resolves
|
|
1700
|
+
* with the changes for the TV show.
|
|
1405
1701
|
*/
|
|
1406
|
-
|
|
1407
|
-
return
|
|
1702
|
+
changes(id, options) {
|
|
1703
|
+
return this.api.get(`${BASE_TV}/${id}/changes`, { query: options });
|
|
1408
1704
|
}
|
|
1409
1705
|
/**
|
|
1410
1706
|
* Retrieves content ratings for a specific TV show asynchronously.
|
|
1707
|
+
*
|
|
1411
1708
|
* @param {number} id - The ID of the TV show.
|
|
1412
|
-
* @returns {Promise<ContentRatings>} A Promise that resolves with the
|
|
1709
|
+
* @returns {Promise<ContentRatings>} A Promise that resolves with the
|
|
1710
|
+
* content ratings of the TV show.
|
|
1413
1711
|
*/
|
|
1414
|
-
|
|
1415
|
-
return
|
|
1712
|
+
contentRatings(id) {
|
|
1713
|
+
return this.api.get(`${BASE_TV}/${id}/content_ratings`);
|
|
1416
1714
|
}
|
|
1417
1715
|
/**
|
|
1418
1716
|
* Retrieves aggregate credits for a specific TV show asynchronously.
|
|
1717
|
+
*
|
|
1419
1718
|
* @param {number} id - The ID of the TV show.
|
|
1420
1719
|
* @param {LanguageOption} [options] - Additional options for the request.
|
|
1421
|
-
* @returns {Promise<AggregateCredits>} A Promise that resolves with the
|
|
1720
|
+
* @returns {Promise<AggregateCredits>} A Promise that resolves with the
|
|
1721
|
+
* aggregate credits of the TV show.
|
|
1422
1722
|
*/
|
|
1423
|
-
|
|
1424
|
-
return
|
|
1723
|
+
aggregateCredits(id, options) {
|
|
1724
|
+
return this.api.get(`${BASE_TV}/${id}/aggregate_credits`, { query: options });
|
|
1425
1725
|
}
|
|
1426
1726
|
/**
|
|
1427
1727
|
* Retrieves credits for a specific TV show asynchronously.
|
|
1728
|
+
*
|
|
1428
1729
|
* @param {number} id - The ID of the TV show.
|
|
1429
1730
|
* @param {LanguageOption} [options] - Additional options for the request.
|
|
1430
|
-
* @returns {Promise<Credits>} A Promise that resolves with the credits of
|
|
1731
|
+
* @returns {Promise<Credits>} A Promise that resolves with the credits of
|
|
1732
|
+
* the TV show.
|
|
1431
1733
|
*/
|
|
1432
|
-
|
|
1433
|
-
return
|
|
1734
|
+
credits(id, options) {
|
|
1735
|
+
return this.api.get(`${BASE_TV}/${id}/credits`, { query: options });
|
|
1434
1736
|
}
|
|
1435
1737
|
/**
|
|
1436
1738
|
* Retrieves details of a specific season of a TV show asynchronously.
|
|
1739
|
+
*
|
|
1437
1740
|
* @param {number} tvId - The ID of the TV show.
|
|
1438
1741
|
* @param {number} seasonNumber - The season number.
|
|
1439
|
-
* @returns {Promise<SeasonDetails>} A Promise that resolves with the details
|
|
1742
|
+
* @returns {Promise<SeasonDetails>} A Promise that resolves with the details
|
|
1743
|
+
* of the season.
|
|
1440
1744
|
*/
|
|
1441
|
-
|
|
1442
|
-
return
|
|
1745
|
+
season(tvId, seasonNumber) {
|
|
1746
|
+
return this.api.get(`${BASE_TV}/${tvId}/season/${seasonNumber}`);
|
|
1443
1747
|
}
|
|
1444
1748
|
/**
|
|
1445
1749
|
* Retrieves episode groups for a specific TV show asynchronously.
|
|
1750
|
+
*
|
|
1446
1751
|
* @param {number} id - The ID of the TV show.
|
|
1447
|
-
* @returns {Promise<EpisodeGroups>} A Promise that resolves with the episode
|
|
1752
|
+
* @returns {Promise<EpisodeGroups>} A Promise that resolves with the episode
|
|
1753
|
+
* groups of the TV show.
|
|
1448
1754
|
*/
|
|
1449
|
-
|
|
1450
|
-
return
|
|
1755
|
+
episodeGroups(id) {
|
|
1756
|
+
return this.api.get(`${BASE_TV}/${id}/episode_groups`);
|
|
1451
1757
|
}
|
|
1452
1758
|
/**
|
|
1453
1759
|
* Retrieves external IDs for a specific TV show asynchronously.
|
|
1760
|
+
*
|
|
1454
1761
|
* @param {number} id - The ID of the TV show.
|
|
1455
|
-
* @returns {Promise<ExternalIds>} A Promise that resolves with the external
|
|
1762
|
+
* @returns {Promise<ExternalIds>} A Promise that resolves with the external
|
|
1763
|
+
* IDs of the TV show.
|
|
1456
1764
|
*/
|
|
1457
|
-
|
|
1458
|
-
return
|
|
1765
|
+
externalIds(id) {
|
|
1766
|
+
return this.api.get(`${BASE_TV}/${id}/external_ids`);
|
|
1459
1767
|
}
|
|
1460
1768
|
/**
|
|
1461
1769
|
* Retrieves images for a specific TV show asynchronously.
|
|
1770
|
+
*
|
|
1462
1771
|
* @param {number} id - The ID of the TV show.
|
|
1463
|
-
* @param {TvShowImageOptions} [options] - Additional options for the
|
|
1464
|
-
*
|
|
1772
|
+
* @param {TvShowImageOptions} [options] - Additional options for the
|
|
1773
|
+
* request.
|
|
1774
|
+
* @returns {Promise<Images>} A Promise that resolves with the images of the
|
|
1775
|
+
* TV show.
|
|
1465
1776
|
*/
|
|
1466
|
-
|
|
1777
|
+
images(id, options) {
|
|
1467
1778
|
const computedOptions = {
|
|
1468
|
-
include_image_language: options?.include_image_language
|
|
1779
|
+
include_image_language: csv(options?.include_image_language),
|
|
1469
1780
|
language: options?.language
|
|
1470
1781
|
};
|
|
1471
|
-
return
|
|
1782
|
+
return this.api.get(`${BASE_TV}/${id}/images`, { query: computedOptions });
|
|
1472
1783
|
}
|
|
1473
1784
|
/**
|
|
1474
1785
|
* Retrieves keywords for a specific TV show asynchronously.
|
|
1786
|
+
*
|
|
1475
1787
|
* @param {number} id - The ID of the TV show.
|
|
1476
|
-
* @returns {Promise<Keywords>} A Promise that resolves with the keywords of
|
|
1788
|
+
* @returns {Promise<Keywords>} A Promise that resolves with the keywords of
|
|
1789
|
+
* the TV show.
|
|
1477
1790
|
*/
|
|
1478
|
-
|
|
1479
|
-
return
|
|
1791
|
+
keywords(id) {
|
|
1792
|
+
return this.api.get(`${BASE_TV}/${id}/keywords`);
|
|
1480
1793
|
}
|
|
1481
1794
|
/**
|
|
1482
1795
|
* Retrieves recommendations for a specific TV show asynchronously.
|
|
1796
|
+
*
|
|
1483
1797
|
* @param {number} id - The ID of the TV show.
|
|
1484
|
-
* @param {LanguageOption & PageOption} [options] - Additional options for
|
|
1485
|
-
*
|
|
1798
|
+
* @param {LanguageOption & PageOption} [options] - Additional options for
|
|
1799
|
+
* the request.
|
|
1800
|
+
* @returns {Promise<Recommendations>} A Promise that resolves with the
|
|
1801
|
+
* recommendations for the TV show.
|
|
1486
1802
|
*/
|
|
1487
|
-
|
|
1488
|
-
return
|
|
1803
|
+
recommendations(id, options) {
|
|
1804
|
+
return this.api.get(`${BASE_TV}/${id}/recommendations`, { query: options });
|
|
1489
1805
|
}
|
|
1490
1806
|
/**
|
|
1491
1807
|
* Retrieves reviews for a specific TV show asynchronously.
|
|
1808
|
+
*
|
|
1492
1809
|
* @param {number} id - The ID of the TV show.
|
|
1493
|
-
* @param {LanguageOption & PageOption} [options] - Additional options for
|
|
1494
|
-
*
|
|
1810
|
+
* @param {LanguageOption & PageOption} [options] - Additional options for
|
|
1811
|
+
* the request.
|
|
1812
|
+
* @returns {Promise<Reviews>} A Promise that resolves with the reviews of
|
|
1813
|
+
* the TV show.
|
|
1495
1814
|
*/
|
|
1496
|
-
|
|
1497
|
-
return
|
|
1815
|
+
reviews(id, options) {
|
|
1816
|
+
return this.api.get(`${BASE_TV}/${id}/reviews`, { query: options });
|
|
1498
1817
|
}
|
|
1499
1818
|
/**
|
|
1500
|
-
* Retrieves information about whether the TV show was screened theatrically
|
|
1819
|
+
* Retrieves information about whether the TV show was screened theatrically
|
|
1820
|
+
* asynchronously.
|
|
1821
|
+
*
|
|
1501
1822
|
* @param {number} id - The ID of the TV show.
|
|
1502
|
-
* @returns {Promise<ScreenedTheatrically>} A Promise that resolves with
|
|
1823
|
+
* @returns {Promise<ScreenedTheatrically>} A Promise that resolves with
|
|
1824
|
+
* information about theatrical screenings.
|
|
1503
1825
|
*/
|
|
1504
|
-
|
|
1505
|
-
return
|
|
1826
|
+
screenedTheatrically(id) {
|
|
1827
|
+
return this.api.get(`${BASE_TV}/${id}/screened_theatrically`);
|
|
1506
1828
|
}
|
|
1507
1829
|
/**
|
|
1508
1830
|
* Retrieves similar TV shows for a specific TV show asynchronously.
|
|
1831
|
+
*
|
|
1509
1832
|
* @param {number} id - The ID of the TV show.
|
|
1510
|
-
* @param {LanguageOption & PageOption} [options] - Additional options for
|
|
1511
|
-
*
|
|
1833
|
+
* @param {LanguageOption & PageOption} [options] - Additional options for
|
|
1834
|
+
* the request.
|
|
1835
|
+
* @returns {Promise<Similartv>} A Promise that resolves with the similar TV
|
|
1836
|
+
* shows.
|
|
1512
1837
|
*/
|
|
1513
|
-
|
|
1514
|
-
return
|
|
1838
|
+
similar(id, options) {
|
|
1839
|
+
return this.api.get(`${BASE_TV}/${id}/similar`, { query: options });
|
|
1515
1840
|
}
|
|
1516
1841
|
/**
|
|
1517
1842
|
* Retrieves translations for a specific TV show asynchronously.
|
|
1843
|
+
*
|
|
1518
1844
|
* @param {number} id - The ID of the TV show.
|
|
1519
|
-
* @returns {Promise<Translations>} A Promise that resolves with the
|
|
1845
|
+
* @returns {Promise<Translations>} A Promise that resolves with the
|
|
1846
|
+
* translations of the TV show.
|
|
1520
1847
|
*/
|
|
1521
|
-
|
|
1522
|
-
return
|
|
1848
|
+
translations(id) {
|
|
1849
|
+
return this.api.get(`${BASE_TV}/${id}/translations`);
|
|
1523
1850
|
}
|
|
1524
1851
|
/**
|
|
1525
1852
|
* Retrieves videos for a specific TV show asynchronously.
|
|
1853
|
+
*
|
|
1526
1854
|
* @param {number} id - The ID of the TV show.
|
|
1527
|
-
* @param {TvShowVideoOptions} [options] - Additional options for the
|
|
1528
|
-
*
|
|
1855
|
+
* @param {TvShowVideoOptions} [options] - Additional options for the
|
|
1856
|
+
* request.
|
|
1857
|
+
* @returns {Promise<Videos>} A Promise that resolves with the videos of the
|
|
1858
|
+
* TV show.
|
|
1529
1859
|
*/
|
|
1530
|
-
|
|
1860
|
+
videos(id, options) {
|
|
1531
1861
|
const computedOptions = {
|
|
1532
|
-
include_video_language: options?.include_video_language
|
|
1862
|
+
include_video_language: csv(options?.include_video_language),
|
|
1533
1863
|
language: options?.language
|
|
1534
1864
|
};
|
|
1535
|
-
return
|
|
1865
|
+
return this.api.get(`${BASE_TV}/${id}/videos`, { query: computedOptions });
|
|
1536
1866
|
}
|
|
1537
1867
|
/**
|
|
1538
1868
|
* Retrieves watch providers for a specific TV show asynchronously.
|
|
1539
1869
|
* Powered by JustWatch.
|
|
1870
|
+
*
|
|
1540
1871
|
* @param {number} id - The ID of the TV show.
|
|
1541
|
-
* @returns {Promise<WatchProviders>} A Promise that resolves with the watch
|
|
1872
|
+
* @returns {Promise<WatchProviders>} A Promise that resolves with the watch
|
|
1873
|
+
* providers of the TV show.
|
|
1542
1874
|
*/
|
|
1543
|
-
|
|
1544
|
-
return
|
|
1875
|
+
watchProviders(id) {
|
|
1876
|
+
return this.api.get(`${BASE_TV}/${id}/watch/providers`);
|
|
1545
1877
|
}
|
|
1546
1878
|
/**
|
|
1547
1879
|
* Retrieves the latest TV show asynchronously.
|
|
1548
|
-
*
|
|
1880
|
+
*
|
|
1881
|
+
* @returns {Promise<Latesttv>} A Promise that resolves with the latest TV
|
|
1882
|
+
* show.
|
|
1549
1883
|
*/
|
|
1550
|
-
|
|
1551
|
-
return
|
|
1884
|
+
latest() {
|
|
1885
|
+
return this.api.get(`${BASE_TV}/latest`);
|
|
1552
1886
|
}
|
|
1553
1887
|
/**
|
|
1554
1888
|
* Retrieves TV shows that are currently on the air asynchronously.
|
|
1555
|
-
*
|
|
1556
|
-
* @
|
|
1889
|
+
*
|
|
1890
|
+
* @param {PageOption & LanguageOption & TimezoneOption} [options] -
|
|
1891
|
+
* Additional options for the request.
|
|
1892
|
+
* @returns {Promise<OnTheAir>} A Promise that resolves with TV shows
|
|
1893
|
+
* currently on the air.
|
|
1557
1894
|
*/
|
|
1558
|
-
|
|
1559
|
-
return
|
|
1895
|
+
onTheAir(options) {
|
|
1896
|
+
return this.api.get(`${BASE_TV}/on_the_air`, { query: options });
|
|
1560
1897
|
}
|
|
1561
1898
|
/**
|
|
1562
1899
|
* Retrieves TV shows that are airing today asynchronously.
|
|
1563
|
-
*
|
|
1564
|
-
* @
|
|
1900
|
+
*
|
|
1901
|
+
* @param {PageOption & LanguageOption & TimezoneOption} [options] -
|
|
1902
|
+
* Additional options for the request.
|
|
1903
|
+
* @returns {Promise<tvAiringToday>} A Promise that resolves with TV shows
|
|
1904
|
+
* airing today.
|
|
1565
1905
|
*/
|
|
1566
|
-
|
|
1567
|
-
return
|
|
1906
|
+
airingToday(options) {
|
|
1907
|
+
return this.api.get(`${BASE_TV}/airing_today`, { query: options });
|
|
1568
1908
|
}
|
|
1569
1909
|
/**
|
|
1570
1910
|
* Retrieves popular TV shows asynchronously.
|
|
1571
|
-
*
|
|
1572
|
-
* @
|
|
1911
|
+
*
|
|
1912
|
+
* @param {PageOption & LanguageOption} [options] - Additional options for
|
|
1913
|
+
* the request.
|
|
1914
|
+
* @returns {Promise<Populartv>} A Promise that resolves with popular TV
|
|
1915
|
+
* shows.
|
|
1573
1916
|
*/
|
|
1574
|
-
|
|
1575
|
-
return
|
|
1917
|
+
popular(options) {
|
|
1918
|
+
return this.api.get(`${BASE_TV}/popular`, { query: options });
|
|
1576
1919
|
}
|
|
1577
1920
|
/**
|
|
1578
1921
|
* Retrieves top-rated TV shows asynchronously.
|
|
1579
|
-
*
|
|
1580
|
-
* @
|
|
1922
|
+
*
|
|
1923
|
+
* @param {PageOption & LanguageOption} [options] - Additional options for
|
|
1924
|
+
* the request.
|
|
1925
|
+
* @returns {Promise<TopRatedtv>} A Promise that resolves with top-rated TV
|
|
1926
|
+
* shows.
|
|
1581
1927
|
*/
|
|
1582
|
-
|
|
1583
|
-
return
|
|
1928
|
+
topRated(options) {
|
|
1929
|
+
return this.api.get(`${BASE_TV}/top_rated`, { query: options });
|
|
1584
1930
|
}
|
|
1585
1931
|
};
|
|
1586
1932
|
|
|
@@ -1592,7 +1938,8 @@ var TvShowsEndpoint = class extends BaseEndpoint {
|
|
|
1592
1938
|
var WatchProvidersEndpoint = class extends BaseEndpoint {
|
|
1593
1939
|
/**
|
|
1594
1940
|
* Constructs a new WatchProvidersEndpoint instance.
|
|
1595
|
-
*
|
|
1941
|
+
*
|
|
1942
|
+
* @param {TokenType} access_token - The access token used for authentication.
|
|
1596
1943
|
*/
|
|
1597
1944
|
constructor(access_token) {
|
|
1598
1945
|
super(access_token);
|
|
@@ -1600,30 +1947,57 @@ var WatchProvidersEndpoint = class extends BaseEndpoint {
|
|
|
1600
1947
|
}
|
|
1601
1948
|
/**
|
|
1602
1949
|
* Retrieves a list of watch providers for movies.
|
|
1603
|
-
*
|
|
1950
|
+
*
|
|
1951
|
+
* @returns {Promise<WatchProviderListResponse>} A Promise that resolves with
|
|
1952
|
+
* the list of movie watch providers.
|
|
1604
1953
|
*/
|
|
1605
|
-
|
|
1606
|
-
return
|
|
1954
|
+
movie() {
|
|
1955
|
+
return this.api.get("/watch/providers/movie");
|
|
1607
1956
|
}
|
|
1608
1957
|
/**
|
|
1609
1958
|
* Retrieves a list of watch providers for TV shows.
|
|
1610
|
-
*
|
|
1959
|
+
*
|
|
1960
|
+
* @returns {Promise<WatchProviderListResponse>} A Promise that resolves with
|
|
1961
|
+
* the list of TV watch providers.
|
|
1611
1962
|
*/
|
|
1612
|
-
|
|
1613
|
-
return
|
|
1963
|
+
tv() {
|
|
1964
|
+
return this.api.get("/watch/providers/tv");
|
|
1614
1965
|
}
|
|
1615
1966
|
/**
|
|
1616
1967
|
* Retrieves a list of available regions for watch providers.
|
|
1617
|
-
*
|
|
1968
|
+
*
|
|
1969
|
+
* @returns {Promise<WatchRegionsResponse>} A Promise that resolves with the
|
|
1970
|
+
* list of available regions.
|
|
1618
1971
|
*/
|
|
1619
|
-
|
|
1620
|
-
return
|
|
1972
|
+
regions() {
|
|
1973
|
+
return this.api.get("/watch/providers/regions");
|
|
1621
1974
|
}
|
|
1622
1975
|
};
|
|
1623
1976
|
|
|
1624
1977
|
//#endregion
|
|
1625
1978
|
//#region src/index.ts
|
|
1626
1979
|
var TMDB = class {
|
|
1980
|
+
account;
|
|
1981
|
+
certification;
|
|
1982
|
+
changes;
|
|
1983
|
+
collections;
|
|
1984
|
+
companies;
|
|
1985
|
+
configuration;
|
|
1986
|
+
credits;
|
|
1987
|
+
discover;
|
|
1988
|
+
find;
|
|
1989
|
+
genre;
|
|
1990
|
+
keywords;
|
|
1991
|
+
movies;
|
|
1992
|
+
networks;
|
|
1993
|
+
people;
|
|
1994
|
+
review;
|
|
1995
|
+
search;
|
|
1996
|
+
trending;
|
|
1997
|
+
tvEpisodes;
|
|
1998
|
+
tvSeasons;
|
|
1999
|
+
tvShows;
|
|
2000
|
+
watchProviders;
|
|
1627
2001
|
constructor(auth) {
|
|
1628
2002
|
this.account = new AccountEndpoint(auth);
|
|
1629
2003
|
this.certification = new CertificationEndpoint(auth);
|
|
@@ -1647,29 +2021,8 @@ var TMDB = class {
|
|
|
1647
2021
|
this.tvShows = new TvShowsEndpoint(auth);
|
|
1648
2022
|
this.watchProviders = new WatchProvidersEndpoint(auth);
|
|
1649
2023
|
}
|
|
1650
|
-
account;
|
|
1651
|
-
certification;
|
|
1652
|
-
changes;
|
|
1653
|
-
collections;
|
|
1654
|
-
companies;
|
|
1655
|
-
configuration;
|
|
1656
|
-
credits;
|
|
1657
|
-
discover;
|
|
1658
|
-
find;
|
|
1659
|
-
genre;
|
|
1660
|
-
keywords;
|
|
1661
|
-
movies;
|
|
1662
|
-
networks;
|
|
1663
|
-
people;
|
|
1664
|
-
review;
|
|
1665
|
-
search;
|
|
1666
|
-
trending;
|
|
1667
|
-
tvEpisodes;
|
|
1668
|
-
tvSeasons;
|
|
1669
|
-
tvShows;
|
|
1670
|
-
watchProviders;
|
|
1671
2024
|
};
|
|
1672
2025
|
|
|
1673
2026
|
//#endregion
|
|
1674
|
-
export { API, BackdropSizes, BaseEndpoint, ChangeKeys, ImageFormats, ImageSizes, LogoSizes, PosterSizes, ProfileSizes, ReleaseDateType, StillSizes, TMDB, TMDBError, TMDB_IMAGE_BASE_URL, formImage, getFullImagePath, parseOptions };
|
|
2027
|
+
export { API, BackdropSizes, BaseEndpoint, ChangeKeys, ImageFormats, ImageSizes, LogoSizes, PosterSizes, ProfileSizes, ReleaseDateType, StillSizes, TMDB, TMDBError, TMDB_IMAGE_BASE_URL, csv, formImage, getFullImagePath, parseOptions, withQuery };
|
|
1675
2028
|
//# sourceMappingURL=index.mjs.map
|