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