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