@tdanks2000/tmdb-wrapper 1.5.0 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +154 -153
- package/dist/index.d.cts +115 -402
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +115 -402
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +154 -154
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -113,32 +113,42 @@ 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
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
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 sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
139
|
+
const shouldRetry = (status) => status === 429 || status === 502 || status === 503 || status === 504;
|
|
140
|
+
const readRetryAfterMs = (res) => {
|
|
141
|
+
const raw = res.headers.get("retry-after");
|
|
142
|
+
if (!raw) return void 0;
|
|
143
|
+
const asSeconds = Number(raw);
|
|
144
|
+
if (Number.isFinite(asSeconds)) return Math.max(0, asSeconds * 1e3);
|
|
145
|
+
const asDate = Date.parse(raw);
|
|
146
|
+
if (!Number.isNaN(asDate)) return Math.max(0, asDate - Date.now());
|
|
147
|
+
return void 0;
|
|
148
|
+
};
|
|
128
149
|
var API = class {
|
|
129
|
-
/**
|
|
130
|
-
* Optional v3 API key (sent as `api_key` query param).
|
|
131
|
-
*/
|
|
132
150
|
apiKey;
|
|
133
|
-
/**
|
|
134
|
-
* Optional v4 read access token (sent as `Authorization: Bearer ...`).
|
|
135
|
-
*/
|
|
136
151
|
accessToken;
|
|
137
|
-
/**
|
|
138
|
-
* Create a new API client.
|
|
139
|
-
*
|
|
140
|
-
* @param {TokenType} auth - Authentication information.
|
|
141
|
-
*/
|
|
142
152
|
constructor(auth) {
|
|
143
153
|
if (typeof auth === "string") this.accessToken = auth;
|
|
144
154
|
else {
|
|
@@ -146,58 +156,55 @@ var API = class {
|
|
|
146
156
|
this.accessToken = auth.accessToken;
|
|
147
157
|
}
|
|
148
158
|
}
|
|
149
|
-
|
|
150
|
-
|
|
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 ?? {},
|
|
159
|
+
async get(path, opts = {}) {
|
|
160
|
+
const query = {
|
|
161
|
+
...opts.query ? opts.query : {},
|
|
164
162
|
...this.apiKey ? { api_key: this.apiKey } : {}
|
|
165
163
|
};
|
|
166
|
-
const
|
|
167
|
-
const
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
164
|
+
const qs = parseOptions(query);
|
|
165
|
+
const url = `${BASE_URL_V3}${path}${qs ? `?${qs}` : ""}`;
|
|
166
|
+
const retries = opts.retries ?? 2;
|
|
167
|
+
const retryDelayMs = opts.retryDelayMs ?? 300;
|
|
168
|
+
const timeoutMs = opts.timeoutMs ?? 3e4;
|
|
169
|
+
const controller = new AbortController();
|
|
170
|
+
const timeout = setTimeout(() => controller.abort(), timeoutMs);
|
|
171
|
+
if (opts.signal) if (opts.signal.aborted) controller.abort();
|
|
172
|
+
else opts.signal.addEventListener("abort", () => controller.abort(), { once: true });
|
|
173
|
+
try {
|
|
174
|
+
for (let attempt = 0; attempt <= retries; attempt++) {
|
|
175
|
+
const res = await fetch(url, {
|
|
176
|
+
method: "GET",
|
|
177
|
+
signal: controller.signal,
|
|
178
|
+
headers: {
|
|
179
|
+
...this.accessToken ? { Authorization: `Bearer ${this.accessToken}` } : {},
|
|
180
|
+
Accept: "application/json"
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
if (res.ok) return await res.json();
|
|
184
|
+
let payload;
|
|
185
|
+
let message = `${res.status} ${res.statusText}`;
|
|
186
|
+
try {
|
|
187
|
+
payload = await res.json();
|
|
188
|
+
if (payload && typeof payload === "object" && "status_message" in payload) message = String(payload.status_message);
|
|
189
|
+
} catch {
|
|
190
|
+
try {
|
|
191
|
+
payload = await res.text();
|
|
192
|
+
} catch {}
|
|
193
|
+
}
|
|
194
|
+
if (attempt < retries && shouldRetry(res.status)) {
|
|
195
|
+
const retryAfter = readRetryAfterMs(res);
|
|
196
|
+
const delay = retryAfter ?? retryDelayMs * 2 ** attempt;
|
|
197
|
+
await sleep(delay);
|
|
198
|
+
continue;
|
|
199
|
+
}
|
|
200
|
+
throw new TMDBError(message, res.status, url, payload);
|
|
172
201
|
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
return Promise.reject(error);
|
|
202
|
+
throw new TMDBError("Request failed", 0, url);
|
|
203
|
+
} finally {
|
|
204
|
+
clearTimeout(timeout);
|
|
177
205
|
}
|
|
178
|
-
return await response.json();
|
|
179
206
|
}
|
|
180
207
|
};
|
|
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
|
-
}
|
|
199
|
-
return new URLSearchParams(entries).toString();
|
|
200
|
-
};
|
|
201
208
|
|
|
202
209
|
//#endregion
|
|
203
210
|
//#region src/utils/getimagePath.ts
|
|
@@ -269,7 +276,7 @@ var BaseEndpoint = class {
|
|
|
269
276
|
*
|
|
270
277
|
* @param {TokenType} auth - Authentication information.
|
|
271
278
|
* - 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
|
|
279
|
+
* - If an object: can include an API key and/or access token.
|
|
273
280
|
*/
|
|
274
281
|
constructor(auth) {
|
|
275
282
|
this.auth = auth;
|
|
@@ -383,7 +390,7 @@ var ChangeEndpoint = class extends BaseEndpoint {
|
|
|
383
390
|
* @returns {Promise<MediaChanges>} A Promise that resolves with the changes in movies.
|
|
384
391
|
*/
|
|
385
392
|
movies(options) {
|
|
386
|
-
return this.api.get("/movie/changes", options);
|
|
393
|
+
return this.api.get("/movie/changes", { query: options });
|
|
387
394
|
}
|
|
388
395
|
/**
|
|
389
396
|
* Retrieves changes in TV shows asynchronously.
|
|
@@ -394,7 +401,7 @@ var ChangeEndpoint = class extends BaseEndpoint {
|
|
|
394
401
|
* @returns {Promise<MediaChanges>} A Promise that resolves with the changes in TV shows.
|
|
395
402
|
*/
|
|
396
403
|
tv(options) {
|
|
397
|
-
return this.api.get("/tv/changes", options);
|
|
404
|
+
return this.api.get("/tv/changes", { query: options });
|
|
398
405
|
}
|
|
399
406
|
/**
|
|
400
407
|
* Retrieves changes related to persons asynchronously.
|
|
@@ -405,7 +412,7 @@ var ChangeEndpoint = class extends BaseEndpoint {
|
|
|
405
412
|
* @returns {Promise<MediaChanges>} A Promise that resolves with the changes related to persons.
|
|
406
413
|
*/
|
|
407
414
|
person(options) {
|
|
408
|
-
return this.api.get("/person/changes", options);
|
|
415
|
+
return this.api.get("/person/changes", { query: options });
|
|
409
416
|
}
|
|
410
417
|
};
|
|
411
418
|
|
|
@@ -431,7 +438,7 @@ var CollectionsEndpoint = class extends BaseEndpoint {
|
|
|
431
438
|
* @returns {Promise<DetailedCollection>} A Promise that resolves with the detailed information of the collection.
|
|
432
439
|
*/
|
|
433
440
|
async details(id, options) {
|
|
434
|
-
return await this.api.get(`${BASE_COLLECTION}/${id}`, options);
|
|
441
|
+
return await this.api.get(`${BASE_COLLECTION}/${id}`, { query: options });
|
|
435
442
|
}
|
|
436
443
|
/**
|
|
437
444
|
* Retrieves images associated with a specific collection asynchronously.
|
|
@@ -444,7 +451,7 @@ var CollectionsEndpoint = class extends BaseEndpoint {
|
|
|
444
451
|
include_image_language: options?.include_image_language?.join(","),
|
|
445
452
|
language: options?.language
|
|
446
453
|
};
|
|
447
|
-
return await this.api.get(`${BASE_COLLECTION}/${id}/images`, computedOptions);
|
|
454
|
+
return await this.api.get(`${BASE_COLLECTION}/${id}/images`, { query: computedOptions });
|
|
448
455
|
}
|
|
449
456
|
/**
|
|
450
457
|
* Retrieves translations for a specific collection asynchronously.
|
|
@@ -453,7 +460,7 @@ var CollectionsEndpoint = class extends BaseEndpoint {
|
|
|
453
460
|
* @returns {Promise<Translations>} A Promise that resolves with the translations of the collection.
|
|
454
461
|
*/
|
|
455
462
|
async translations(id, options) {
|
|
456
|
-
return await this.api.get(`${BASE_COLLECTION}/${id}/translations`, options);
|
|
463
|
+
return await this.api.get(`${BASE_COLLECTION}/${id}/translations`, { query: options });
|
|
457
464
|
}
|
|
458
465
|
};
|
|
459
466
|
|
|
@@ -573,7 +580,7 @@ var DiscoverEndpoint = class extends BaseEndpoint {
|
|
|
573
580
|
* @returns {Promise<MovieDiscoverResult>} A Promise that resolves with the movie discovery results.
|
|
574
581
|
*/
|
|
575
582
|
movie(options) {
|
|
576
|
-
return this.api.get(`${BASE_DISCOVER}/movie`, options);
|
|
583
|
+
return this.api.get(`${BASE_DISCOVER}/movie`, { query: options });
|
|
577
584
|
}
|
|
578
585
|
/**
|
|
579
586
|
* Retrieves a list of TV shows based on the provided query options asynchronously.
|
|
@@ -584,7 +591,7 @@ var DiscoverEndpoint = class extends BaseEndpoint {
|
|
|
584
591
|
* @returns {Promise<TvShowDiscoverResult>} A Promise that resolves with the TV show discovery results.
|
|
585
592
|
*/
|
|
586
593
|
tvShow(options) {
|
|
587
|
-
return this.api.get(`${BASE_DISCOVER}/tv`, options);
|
|
594
|
+
return this.api.get(`${BASE_DISCOVER}/tv`, { query: options });
|
|
588
595
|
}
|
|
589
596
|
};
|
|
590
597
|
|
|
@@ -609,7 +616,7 @@ var FindEndpoint = class extends BaseEndpoint {
|
|
|
609
616
|
* @returns {Promise<FindResult>} A Promise that resolves with the result of the find operation.
|
|
610
617
|
*/
|
|
611
618
|
async byId(externalId, options) {
|
|
612
|
-
return await this.api.get(`/find/${externalId}`, options);
|
|
619
|
+
return await this.api.get(`/find/${externalId}`, { query: options });
|
|
613
620
|
}
|
|
614
621
|
};
|
|
615
622
|
|
|
@@ -633,7 +640,7 @@ var GenreEndpoint = class extends BaseEndpoint {
|
|
|
633
640
|
* @returns {Promise<Genres>} A Promise that resolves with the genre information for movies.
|
|
634
641
|
*/
|
|
635
642
|
async movies(options) {
|
|
636
|
-
return await this.api.get("/genre/movie/list", options);
|
|
643
|
+
return await this.api.get("/genre/movie/list", { query: options });
|
|
637
644
|
}
|
|
638
645
|
/**
|
|
639
646
|
* Retrieves genre information for TV shows asynchronously.
|
|
@@ -641,7 +648,7 @@ var GenreEndpoint = class extends BaseEndpoint {
|
|
|
641
648
|
* @returns {Promise<Genres>} A Promise that resolves with the genre information for TV shows.
|
|
642
649
|
*/
|
|
643
650
|
async tv(options) {
|
|
644
|
-
return await this.api.get("/genre/tv/list", options);
|
|
651
|
+
return await this.api.get("/genre/tv/list", { query: options });
|
|
645
652
|
}
|
|
646
653
|
};
|
|
647
654
|
|
|
@@ -675,7 +682,7 @@ var KeywordsEndpoint = class extends BaseEndpoint {
|
|
|
675
682
|
* @returns {Promise<BelongingMovies>} A Promise that resolves with the movies belonging to the keyword.
|
|
676
683
|
*/
|
|
677
684
|
async belongingMovies(keywordId, options) {
|
|
678
|
-
return await this.api.get(`${BASE_KEYWORD}/${keywordId}/movies`, options);
|
|
685
|
+
return await this.api.get(`${BASE_KEYWORD}/${keywordId}/movies`, { query: options });
|
|
679
686
|
}
|
|
680
687
|
};
|
|
681
688
|
|
|
@@ -702,11 +709,11 @@ var MoviesEndpoint = class extends BaseEndpoint {
|
|
|
702
709
|
* @returns {Promise<AppendToResponse<MovieDetails, AppendToResponseMovieKey[], 'movie'>>} A Promise that resolves with the details of the movie.
|
|
703
710
|
*/
|
|
704
711
|
async details(id, appendToResponse, language) {
|
|
705
|
-
const
|
|
712
|
+
const query = {
|
|
706
713
|
append_to_response: appendToResponse ? appendToResponse.join(",") : void 0,
|
|
707
714
|
language
|
|
708
715
|
};
|
|
709
|
-
return await this.api.get(`${BASE_MOVIE}/${id}`,
|
|
716
|
+
return await this.api.get(`${BASE_MOVIE}/${id}`, { query });
|
|
710
717
|
}
|
|
711
718
|
/**
|
|
712
719
|
* Retrieves alternative titles of a specific movie asynchronously.
|
|
@@ -723,7 +730,7 @@ var MoviesEndpoint = class extends BaseEndpoint {
|
|
|
723
730
|
* @returns {Promise<Changes<MovieChangeValue>>} A Promise that resolves with the changes made to the movie.
|
|
724
731
|
*/
|
|
725
732
|
async changes(id, options) {
|
|
726
|
-
return await this.api.get(`${BASE_MOVIE}/${id}/changes`, options);
|
|
733
|
+
return await this.api.get(`${BASE_MOVIE}/${id}/changes`, { query: options });
|
|
727
734
|
}
|
|
728
735
|
/**
|
|
729
736
|
* Retrieves credits of a specific movie asynchronously.
|
|
@@ -732,7 +739,7 @@ var MoviesEndpoint = class extends BaseEndpoint {
|
|
|
732
739
|
* @returns {Promise<Credits>} A Promise that resolves with the credits of the movie.
|
|
733
740
|
*/
|
|
734
741
|
async credits(id, options) {
|
|
735
|
-
return await this.api.get(`${BASE_MOVIE}/${id}/credits`, options);
|
|
742
|
+
return await this.api.get(`${BASE_MOVIE}/${id}/credits`, { query: options });
|
|
736
743
|
}
|
|
737
744
|
/**
|
|
738
745
|
* Retrieves external IDs of a specific movie asynchronously.
|
|
@@ -753,7 +760,7 @@ var MoviesEndpoint = class extends BaseEndpoint {
|
|
|
753
760
|
include_image_language: options?.include_image_language?.join(","),
|
|
754
761
|
language: options?.language
|
|
755
762
|
};
|
|
756
|
-
return await this.api.get(`${BASE_MOVIE}/${id}/images`, computedOptions);
|
|
763
|
+
return await this.api.get(`${BASE_MOVIE}/${id}/images`, { query: computedOptions });
|
|
757
764
|
}
|
|
758
765
|
/**
|
|
759
766
|
* Retrieves keywords of a specific movie asynchronously.
|
|
@@ -770,7 +777,7 @@ var MoviesEndpoint = class extends BaseEndpoint {
|
|
|
770
777
|
* @returns {Promise<MovieLists>} A Promise that resolves with the lists containing the movie.
|
|
771
778
|
*/
|
|
772
779
|
async lists(id, options) {
|
|
773
|
-
return await this.api.get(`${BASE_MOVIE}/${id}/lists`, options);
|
|
780
|
+
return await this.api.get(`${BASE_MOVIE}/${id}/lists`, { query: options });
|
|
774
781
|
}
|
|
775
782
|
/**
|
|
776
783
|
* Retrieves recommendations for a specific movie asynchronously.
|
|
@@ -779,7 +786,7 @@ var MoviesEndpoint = class extends BaseEndpoint {
|
|
|
779
786
|
* @returns {Promise<Recommendations>} A Promise that resolves with the recommendations for the movie.
|
|
780
787
|
*/
|
|
781
788
|
async recommendations(id, options) {
|
|
782
|
-
return await this.api.get(`${BASE_MOVIE}/${id}/recommendations`, options);
|
|
789
|
+
return await this.api.get(`${BASE_MOVIE}/${id}/recommendations`, { query: options });
|
|
783
790
|
}
|
|
784
791
|
/**
|
|
785
792
|
* Retrieves release dates of a specific movie asynchronously.
|
|
@@ -796,7 +803,7 @@ var MoviesEndpoint = class extends BaseEndpoint {
|
|
|
796
803
|
* @returns {Promise<Reviews>} A Promise that resolves with the reviews for the movie.
|
|
797
804
|
*/
|
|
798
805
|
async reviews(id, options) {
|
|
799
|
-
return await this.api.get(`${BASE_MOVIE}/${id}/reviews`, options);
|
|
806
|
+
return await this.api.get(`${BASE_MOVIE}/${id}/reviews`, { query: options });
|
|
800
807
|
}
|
|
801
808
|
/**
|
|
802
809
|
* Retrieves similar movies for a specific movie asynchronously.
|
|
@@ -805,7 +812,7 @@ var MoviesEndpoint = class extends BaseEndpoint {
|
|
|
805
812
|
* @returns {Promise<SimilarMovies>} A Promise that resolves with the similar movies for the movie.
|
|
806
813
|
*/
|
|
807
814
|
async similar(id, options) {
|
|
808
|
-
return await this.api.get(`${BASE_MOVIE}/${id}/similar`, options);
|
|
815
|
+
return await this.api.get(`${BASE_MOVIE}/${id}/similar`, { query: options });
|
|
809
816
|
}
|
|
810
817
|
/**
|
|
811
818
|
* Retrieves translations of a specific movie asynchronously.
|
|
@@ -822,7 +829,7 @@ var MoviesEndpoint = class extends BaseEndpoint {
|
|
|
822
829
|
* @returns {Promise<Videos>} A Promise that resolves with the videos of the movie.
|
|
823
830
|
*/
|
|
824
831
|
async videos(id, options) {
|
|
825
|
-
return await this.api.get(`${BASE_MOVIE}/${id}/videos`, options);
|
|
832
|
+
return await this.api.get(`${BASE_MOVIE}/${id}/videos`, { query: options });
|
|
826
833
|
}
|
|
827
834
|
/**
|
|
828
835
|
* Retrieves watch providers of a specific movie asynchronously.
|
|
@@ -845,7 +852,7 @@ var MoviesEndpoint = class extends BaseEndpoint {
|
|
|
845
852
|
* @returns {Promise<MoviesPlayingNow>} A Promise that resolves with the movies playing now.
|
|
846
853
|
*/
|
|
847
854
|
async nowPlaying(options) {
|
|
848
|
-
return await this.api.get(`${BASE_MOVIE}/now_playing`, options);
|
|
855
|
+
return await this.api.get(`${BASE_MOVIE}/now_playing`, { query: options });
|
|
849
856
|
}
|
|
850
857
|
/**
|
|
851
858
|
* Retrieves popular movies asynchronously.
|
|
@@ -853,7 +860,7 @@ var MoviesEndpoint = class extends BaseEndpoint {
|
|
|
853
860
|
* @returns {Promise<PopularMovies>} A Promise that resolves with the popular movies.
|
|
854
861
|
*/
|
|
855
862
|
async popular(options) {
|
|
856
|
-
return await this.api.get(`${BASE_MOVIE}/popular`, options);
|
|
863
|
+
return await this.api.get(`${BASE_MOVIE}/popular`, { query: options });
|
|
857
864
|
}
|
|
858
865
|
/**
|
|
859
866
|
* Retrieves top rated movies asynchronously.
|
|
@@ -861,7 +868,7 @@ var MoviesEndpoint = class extends BaseEndpoint {
|
|
|
861
868
|
* @returns {Promise<TopRatedMovies>} A Promise that resolves with the top rated movies.
|
|
862
869
|
*/
|
|
863
870
|
async topRated(options) {
|
|
864
|
-
return await this.api.get(`${BASE_MOVIE}/top_rated`, options);
|
|
871
|
+
return await this.api.get(`${BASE_MOVIE}/top_rated`, { query: options });
|
|
865
872
|
}
|
|
866
873
|
/**
|
|
867
874
|
* Retrieves upcoming movies asynchronously.
|
|
@@ -869,7 +876,7 @@ var MoviesEndpoint = class extends BaseEndpoint {
|
|
|
869
876
|
* @returns {Promise<UpcomingMovies>} A Promise that resolves with the upcoming movies.
|
|
870
877
|
*/
|
|
871
878
|
async upcoming(options) {
|
|
872
|
-
return await this.api.get(`${BASE_MOVIE}/upcoming`, options);
|
|
879
|
+
return await this.api.get(`${BASE_MOVIE}/upcoming`, { query: options });
|
|
873
880
|
}
|
|
874
881
|
};
|
|
875
882
|
|
|
@@ -940,7 +947,7 @@ var PeopleEndpoint = class extends BaseEndpoint {
|
|
|
940
947
|
append_to_response: appendToResponse ? appendToResponse.join(",") : void 0,
|
|
941
948
|
language
|
|
942
949
|
};
|
|
943
|
-
return await this.api.get(`${BASE_PERSON}/${id}`, options);
|
|
950
|
+
return await this.api.get(`${BASE_PERSON}/${id}`, { query: options });
|
|
944
951
|
}
|
|
945
952
|
/**
|
|
946
953
|
* Retrieves changes made to a specific person asynchronously.
|
|
@@ -949,7 +956,7 @@ var PeopleEndpoint = class extends BaseEndpoint {
|
|
|
949
956
|
* @returns {Promise<Changes<PersonChangeValue>>} A Promise that resolves with the changes made to the person.
|
|
950
957
|
*/
|
|
951
958
|
async changes(id, options) {
|
|
952
|
-
return await this.api.get(`${BASE_PERSON}/${id}/changes`, options);
|
|
959
|
+
return await this.api.get(`${BASE_PERSON}/${id}/changes`, { query: options });
|
|
953
960
|
}
|
|
954
961
|
/**
|
|
955
962
|
* Retrieves movie credits of a specific person asynchronously.
|
|
@@ -958,7 +965,7 @@ var PeopleEndpoint = class extends BaseEndpoint {
|
|
|
958
965
|
* @returns {Promise<PersonMovieCredit>} A Promise that resolves with the movie credits of the person.
|
|
959
966
|
*/
|
|
960
967
|
async movieCredits(id, options) {
|
|
961
|
-
return await this.api.get(`${BASE_PERSON}/${id}/movie_credits`, options);
|
|
968
|
+
return await this.api.get(`${BASE_PERSON}/${id}/movie_credits`, { query: options });
|
|
962
969
|
}
|
|
963
970
|
/**
|
|
964
971
|
* Retrieves TV show credits of a specific person asynchronously.
|
|
@@ -967,7 +974,7 @@ var PeopleEndpoint = class extends BaseEndpoint {
|
|
|
967
974
|
* @returns {Promise<PersonTvShowCredit>} A Promise that resolves with the TV show credits of the person.
|
|
968
975
|
*/
|
|
969
976
|
async tvShowCredits(id, options) {
|
|
970
|
-
return await this.api.get(`${BASE_PERSON}/${id}/tv_credits`, options);
|
|
977
|
+
return await this.api.get(`${BASE_PERSON}/${id}/tv_credits`, { query: options });
|
|
971
978
|
}
|
|
972
979
|
/**
|
|
973
980
|
* Retrieves combined credits of a specific person asynchronously.
|
|
@@ -976,7 +983,7 @@ var PeopleEndpoint = class extends BaseEndpoint {
|
|
|
976
983
|
* @returns {Promise<PersonCombinedCredits>} A Promise that resolves with the combined credits of the person.
|
|
977
984
|
*/
|
|
978
985
|
async combinedCredits(id, options) {
|
|
979
|
-
return await this.api.get(`${BASE_PERSON}/${id}/combined_credits`, options);
|
|
986
|
+
return await this.api.get(`${BASE_PERSON}/${id}/combined_credits`, { query: options });
|
|
980
987
|
}
|
|
981
988
|
/**
|
|
982
989
|
* Retrieves external IDs of a specific person asynchronously.
|
|
@@ -1001,7 +1008,7 @@ var PeopleEndpoint = class extends BaseEndpoint {
|
|
|
1001
1008
|
* @returns {Promise<TaggedImages>} A Promise that resolves with the tagged images of the person.
|
|
1002
1009
|
*/
|
|
1003
1010
|
async taggedImages(id, options) {
|
|
1004
|
-
return await this.api.get(`${BASE_PERSON}/${id}/tagged_images`, options);
|
|
1011
|
+
return await this.api.get(`${BASE_PERSON}/${id}/tagged_images`, { query: options });
|
|
1005
1012
|
}
|
|
1006
1013
|
/**
|
|
1007
1014
|
* Retrieves translations of a specific person asynchronously.
|
|
@@ -1024,7 +1031,7 @@ var PeopleEndpoint = class extends BaseEndpoint {
|
|
|
1024
1031
|
* @returns {Promise<PopularPersons>} A Promise that resolves with the popular persons.
|
|
1025
1032
|
*/
|
|
1026
1033
|
async popular(options) {
|
|
1027
|
-
return await this.api.get(`${BASE_PERSON}/popular`, options);
|
|
1034
|
+
return await this.api.get(`${BASE_PERSON}/popular`, { query: options });
|
|
1028
1035
|
}
|
|
1029
1036
|
};
|
|
1030
1037
|
|
|
@@ -1073,7 +1080,7 @@ var SearchEndpoint = class extends BaseEndpoint {
|
|
|
1073
1080
|
* @returns {Promise<Search<Company>>} A Promise that resolves with the search results for companies.
|
|
1074
1081
|
*/
|
|
1075
1082
|
async companies(options) {
|
|
1076
|
-
return await this.api.get(`${BASE_SEARCH}/company`, options);
|
|
1083
|
+
return await this.api.get(`${BASE_SEARCH}/company`, { query: options });
|
|
1077
1084
|
}
|
|
1078
1085
|
/**
|
|
1079
1086
|
* Searches for collections asynchronously.
|
|
@@ -1081,7 +1088,7 @@ var SearchEndpoint = class extends BaseEndpoint {
|
|
|
1081
1088
|
* @returns {Promise<Search<Collection>>} A Promise that resolves with the search results for collections.
|
|
1082
1089
|
*/
|
|
1083
1090
|
async collections(options) {
|
|
1084
|
-
return await this.api.get(`${BASE_SEARCH}/collection`, options);
|
|
1091
|
+
return await this.api.get(`${BASE_SEARCH}/collection`, { query: options });
|
|
1085
1092
|
}
|
|
1086
1093
|
/**
|
|
1087
1094
|
* Searches for keywords asynchronously.
|
|
@@ -1089,7 +1096,7 @@ var SearchEndpoint = class extends BaseEndpoint {
|
|
|
1089
1096
|
* @returns {Promise<Search<{ id: string; name: string }>>} A Promise that resolves with the search results for keywords.
|
|
1090
1097
|
*/
|
|
1091
1098
|
async keywords(options) {
|
|
1092
|
-
return await this.api.get(`${BASE_SEARCH}/keyword`, options);
|
|
1099
|
+
return await this.api.get(`${BASE_SEARCH}/keyword`, { query: options });
|
|
1093
1100
|
}
|
|
1094
1101
|
/**
|
|
1095
1102
|
* Searches for movies asynchronously.
|
|
@@ -1097,7 +1104,7 @@ var SearchEndpoint = class extends BaseEndpoint {
|
|
|
1097
1104
|
* @returns {Promise<Search<Movie>>} A Promise that resolves with the search results for movies.
|
|
1098
1105
|
*/
|
|
1099
1106
|
async movies(options) {
|
|
1100
|
-
return await this.api.get(`${BASE_SEARCH}/movie`, options);
|
|
1107
|
+
return await this.api.get(`${BASE_SEARCH}/movie`, { query: options });
|
|
1101
1108
|
}
|
|
1102
1109
|
/**
|
|
1103
1110
|
* Searches for people asynchronously.
|
|
@@ -1105,7 +1112,7 @@ var SearchEndpoint = class extends BaseEndpoint {
|
|
|
1105
1112
|
* @returns {Promise<Search<Person>>} A Promise that resolves with the search results for people.
|
|
1106
1113
|
*/
|
|
1107
1114
|
async people(options) {
|
|
1108
|
-
return await this.api.get(`${BASE_SEARCH}/person`, options);
|
|
1115
|
+
return await this.api.get(`${BASE_SEARCH}/person`, { query: options });
|
|
1109
1116
|
}
|
|
1110
1117
|
/**
|
|
1111
1118
|
* Searches for TV shows asynchronously.
|
|
@@ -1113,7 +1120,7 @@ var SearchEndpoint = class extends BaseEndpoint {
|
|
|
1113
1120
|
* @returns {Promise<Search<TV>>} A Promise that resolves with the search results for TV shows.
|
|
1114
1121
|
*/
|
|
1115
1122
|
async tv(options) {
|
|
1116
|
-
return await this.api.get(`${BASE_SEARCH}/tv`, options);
|
|
1123
|
+
return await this.api.get(`${BASE_SEARCH}/tv`, { query: options });
|
|
1117
1124
|
}
|
|
1118
1125
|
/**
|
|
1119
1126
|
* Performs a multi-search asynchronously.
|
|
@@ -1121,7 +1128,7 @@ var SearchEndpoint = class extends BaseEndpoint {
|
|
|
1121
1128
|
* @returns {Promise<Search<MultiSearchResult>>} A Promise that resolves with the multi-search results.
|
|
1122
1129
|
*/
|
|
1123
1130
|
async multi(options) {
|
|
1124
|
-
return await this.api.get(`${BASE_SEARCH}/multi`, options);
|
|
1131
|
+
return await this.api.get(`${BASE_SEARCH}/multi`, { query: options });
|
|
1125
1132
|
}
|
|
1126
1133
|
};
|
|
1127
1134
|
|
|
@@ -1148,7 +1155,7 @@ var TrendingEndpoint = class extends BaseEndpoint {
|
|
|
1148
1155
|
* @template T - The type of media being searched for (e.g., 'movie', 'tv').
|
|
1149
1156
|
*/
|
|
1150
1157
|
async trending(mediaType, timeWindow, options) {
|
|
1151
|
-
return await this.api.get(`/trending/${mediaType}/${timeWindow}`, options);
|
|
1158
|
+
return await this.api.get(`/trending/${mediaType}/${timeWindow}`, { query: options });
|
|
1152
1159
|
}
|
|
1153
1160
|
};
|
|
1154
1161
|
|
|
@@ -1182,7 +1189,7 @@ var TvEpisodesEndpoint = class extends BaseEndpoint {
|
|
|
1182
1189
|
append_to_response: appendToResponse ? appendToResponse.join(",") : void 0,
|
|
1183
1190
|
...options
|
|
1184
1191
|
};
|
|
1185
|
-
return await this.api.get(`${BASE_EPISODE(episodeSelection)}`, combinedOptions);
|
|
1192
|
+
return await this.api.get(`${BASE_EPISODE(episodeSelection)}`, { query: combinedOptions });
|
|
1186
1193
|
}
|
|
1187
1194
|
/**
|
|
1188
1195
|
* Retrieves changes related to a specific TV episode asynchronously.
|
|
@@ -1191,7 +1198,7 @@ var TvEpisodesEndpoint = class extends BaseEndpoint {
|
|
|
1191
1198
|
* @returns {Promise<Changes<TvEpisodeChangeValue>>} A Promise that resolves with the changes related to the TV episode.
|
|
1192
1199
|
*/
|
|
1193
1200
|
async changes(episodeID, options) {
|
|
1194
|
-
return await this.api.get(`/tv/episode/${episodeID}/changes`, options);
|
|
1201
|
+
return await this.api.get(`/tv/episode/${episodeID}/changes`, { query: options });
|
|
1195
1202
|
}
|
|
1196
1203
|
/**
|
|
1197
1204
|
* Retrieves credits for a specific TV episode asynchronously.
|
|
@@ -1200,7 +1207,7 @@ var TvEpisodesEndpoint = class extends BaseEndpoint {
|
|
|
1200
1207
|
* @returns {Promise<TvEpisodeCredit>} A Promise that resolves with the credits for the TV episode.
|
|
1201
1208
|
*/
|
|
1202
1209
|
async credits(episodeSelection, options) {
|
|
1203
|
-
return await this.api.get(`${BASE_EPISODE(episodeSelection)}/credits`, options);
|
|
1210
|
+
return await this.api.get(`${BASE_EPISODE(episodeSelection)}/credits`, { query: options });
|
|
1204
1211
|
}
|
|
1205
1212
|
/**
|
|
1206
1213
|
* Retrieves external IDs for a specific TV episode asynchronously.
|
|
@@ -1221,7 +1228,7 @@ var TvEpisodesEndpoint = class extends BaseEndpoint {
|
|
|
1221
1228
|
include_image_language: options?.include_image_language?.join(","),
|
|
1222
1229
|
language: options?.language
|
|
1223
1230
|
};
|
|
1224
|
-
return await this.api.get(`${BASE_EPISODE(episodeSelection)}/images`, computedOptions);
|
|
1231
|
+
return await this.api.get(`${BASE_EPISODE(episodeSelection)}/images`, { query: computedOptions });
|
|
1225
1232
|
}
|
|
1226
1233
|
/**
|
|
1227
1234
|
* Retrieves translations for a specific TV episode asynchronously.
|
|
@@ -1242,7 +1249,7 @@ var TvEpisodesEndpoint = class extends BaseEndpoint {
|
|
|
1242
1249
|
include_video_language: options?.include_video_language?.join(","),
|
|
1243
1250
|
language: options?.language
|
|
1244
1251
|
};
|
|
1245
|
-
return await this.api.get(`${BASE_EPISODE(episodeSelection)}/videos`, computedOptions);
|
|
1252
|
+
return await this.api.get(`${BASE_EPISODE(episodeSelection)}/videos`, { query: computedOptions });
|
|
1246
1253
|
}
|
|
1247
1254
|
};
|
|
1248
1255
|
|
|
@@ -1276,7 +1283,7 @@ var TvSeasonsEndpoint = class extends BaseEndpoint {
|
|
|
1276
1283
|
append_to_response: appendToResponse ? appendToResponse.join(",") : void 0,
|
|
1277
1284
|
...options
|
|
1278
1285
|
};
|
|
1279
|
-
return await this.api.get(`${BASE_SEASON(seasonSelection)}`, combinedOptions);
|
|
1286
|
+
return await this.api.get(`${BASE_SEASON(seasonSelection)}`, { query: combinedOptions });
|
|
1280
1287
|
}
|
|
1281
1288
|
/**
|
|
1282
1289
|
* Retrieves aggregate credits for a specific TV season asynchronously.
|
|
@@ -1285,7 +1292,7 @@ var TvSeasonsEndpoint = class extends BaseEndpoint {
|
|
|
1285
1292
|
* @returns {Promise<AggregateCredits>} A Promise that resolves with the aggregate credits for the TV season.
|
|
1286
1293
|
*/
|
|
1287
1294
|
async aggregateCredits(seasonSelection, options) {
|
|
1288
|
-
return await this.api.get(`${BASE_SEASON(seasonSelection)}/aggregate_credits`, options);
|
|
1295
|
+
return await this.api.get(`${BASE_SEASON(seasonSelection)}/aggregate_credits`, { query: options });
|
|
1289
1296
|
}
|
|
1290
1297
|
/**
|
|
1291
1298
|
* Retrieves changes related to a specific TV season asynchronously.
|
|
@@ -1294,7 +1301,7 @@ var TvSeasonsEndpoint = class extends BaseEndpoint {
|
|
|
1294
1301
|
* @returns {Promise<Changes<TvSeasonChangeValue>>} A Promise that resolves with the changes related to the TV season.
|
|
1295
1302
|
*/
|
|
1296
1303
|
async changes(seasonId, options) {
|
|
1297
|
-
return await this.api.get(`/tv/season/${seasonId}/changes`, options);
|
|
1304
|
+
return await this.api.get(`/tv/season/${seasonId}/changes`, { query: options });
|
|
1298
1305
|
}
|
|
1299
1306
|
/**
|
|
1300
1307
|
* Retrieves credits for a specific TV season asynchronously.
|
|
@@ -1303,7 +1310,7 @@ var TvSeasonsEndpoint = class extends BaseEndpoint {
|
|
|
1303
1310
|
* @returns {Promise<Credits>} A Promise that resolves with the credits for the TV season.
|
|
1304
1311
|
*/
|
|
1305
1312
|
async credits(seasonSelection, options) {
|
|
1306
|
-
return await this.api.get(`${BASE_SEASON(seasonSelection)}/credits`, options);
|
|
1313
|
+
return await this.api.get(`${BASE_SEASON(seasonSelection)}/credits`, { query: options });
|
|
1307
1314
|
}
|
|
1308
1315
|
/**
|
|
1309
1316
|
* Retrieves external IDs for a specific TV season asynchronously.
|
|
@@ -1312,7 +1319,7 @@ var TvSeasonsEndpoint = class extends BaseEndpoint {
|
|
|
1312
1319
|
* @returns {Promise<ExternalIds>} A Promise that resolves with the external IDs for the TV season.
|
|
1313
1320
|
*/
|
|
1314
1321
|
async externalIds(seasonSelection, options) {
|
|
1315
|
-
return await this.api.get(`${BASE_SEASON(seasonSelection)}/external_ids`, options);
|
|
1322
|
+
return await this.api.get(`${BASE_SEASON(seasonSelection)}/external_ids`, { query: options });
|
|
1316
1323
|
}
|
|
1317
1324
|
/**
|
|
1318
1325
|
* Retrieves images for a specific TV season asynchronously.
|
|
@@ -1325,7 +1332,7 @@ var TvSeasonsEndpoint = class extends BaseEndpoint {
|
|
|
1325
1332
|
include_image_language: options?.include_image_language?.join(","),
|
|
1326
1333
|
language: options?.language
|
|
1327
1334
|
};
|
|
1328
|
-
return await this.api.get(`${BASE_SEASON(seasonSelection)}/images`, computedOptions);
|
|
1335
|
+
return await this.api.get(`${BASE_SEASON(seasonSelection)}/images`, { query: computedOptions });
|
|
1329
1336
|
}
|
|
1330
1337
|
/**
|
|
1331
1338
|
* Retrieves videos for a specific TV season asynchronously.
|
|
@@ -1338,7 +1345,7 @@ var TvSeasonsEndpoint = class extends BaseEndpoint {
|
|
|
1338
1345
|
include_video_language: options?.include_video_language?.join(","),
|
|
1339
1346
|
language: options?.language
|
|
1340
1347
|
};
|
|
1341
|
-
return await this.api.get(`${BASE_SEASON(seasonSelection)}/videos`, computedOptions);
|
|
1348
|
+
return await this.api.get(`${BASE_SEASON(seasonSelection)}/videos`, { query: computedOptions });
|
|
1342
1349
|
}
|
|
1343
1350
|
/**
|
|
1344
1351
|
* Retrieves translations for a specific TV season asynchronously.
|
|
@@ -1347,7 +1354,7 @@ var TvSeasonsEndpoint = class extends BaseEndpoint {
|
|
|
1347
1354
|
* @returns {Promise<Translations>} A Promise that resolves with the translations for the TV season.
|
|
1348
1355
|
*/
|
|
1349
1356
|
async translations(seasonSelection, options) {
|
|
1350
|
-
return await this.api.get(`${BASE_SEASON(seasonSelection)}/translations`, options);
|
|
1357
|
+
return await this.api.get(`${BASE_SEASON(seasonSelection)}/translations`, { query: options });
|
|
1351
1358
|
}
|
|
1352
1359
|
};
|
|
1353
1360
|
|
|
@@ -1379,7 +1386,7 @@ var TvShowsEndpoint = class extends BaseEndpoint {
|
|
|
1379
1386
|
append_to_response: appendToResponse ? appendToResponse.join(",") : void 0,
|
|
1380
1387
|
language
|
|
1381
1388
|
};
|
|
1382
|
-
return await this.api.get(`${BASE_TV}/${id}`, options);
|
|
1389
|
+
return await this.api.get(`${BASE_TV}/${id}`, { query: options });
|
|
1383
1390
|
}
|
|
1384
1391
|
/**
|
|
1385
1392
|
* Retrieves alternative titles of a specific TV show asynchronously.
|
|
@@ -1397,7 +1404,7 @@ var TvShowsEndpoint = class extends BaseEndpoint {
|
|
|
1397
1404
|
* A Promise that resolves with the changes for the TV show.
|
|
1398
1405
|
*/
|
|
1399
1406
|
async changes(id, options) {
|
|
1400
|
-
return await this.api.get(`${BASE_TV}/${id}/changes`, options);
|
|
1407
|
+
return await this.api.get(`${BASE_TV}/${id}/changes`, { query: options });
|
|
1401
1408
|
}
|
|
1402
1409
|
/**
|
|
1403
1410
|
* Retrieves content ratings for a specific TV show asynchronously.
|
|
@@ -1414,7 +1421,7 @@ var TvShowsEndpoint = class extends BaseEndpoint {
|
|
|
1414
1421
|
* @returns {Promise<AggregateCredits>} A Promise that resolves with the aggregate credits of the TV show.
|
|
1415
1422
|
*/
|
|
1416
1423
|
async aggregateCredits(id, options) {
|
|
1417
|
-
return await this.api.get(`${BASE_TV}/${id}/aggregate_credits`, options);
|
|
1424
|
+
return await this.api.get(`${BASE_TV}/${id}/aggregate_credits`, { query: options });
|
|
1418
1425
|
}
|
|
1419
1426
|
/**
|
|
1420
1427
|
* Retrieves credits for a specific TV show asynchronously.
|
|
@@ -1423,7 +1430,7 @@ var TvShowsEndpoint = class extends BaseEndpoint {
|
|
|
1423
1430
|
* @returns {Promise<Credits>} A Promise that resolves with the credits of the TV show.
|
|
1424
1431
|
*/
|
|
1425
1432
|
async credits(id, options) {
|
|
1426
|
-
return await this.api.get(`${BASE_TV}/${id}/credits`, options);
|
|
1433
|
+
return await this.api.get(`${BASE_TV}/${id}/credits`, { query: options });
|
|
1427
1434
|
}
|
|
1428
1435
|
/**
|
|
1429
1436
|
* Retrieves details of a specific season of a TV show asynchronously.
|
|
@@ -1461,7 +1468,7 @@ var TvShowsEndpoint = class extends BaseEndpoint {
|
|
|
1461
1468
|
include_image_language: options?.include_image_language?.join(","),
|
|
1462
1469
|
language: options?.language
|
|
1463
1470
|
};
|
|
1464
|
-
return await this.api.get(`${BASE_TV}/${id}/images`, computedOptions);
|
|
1471
|
+
return await this.api.get(`${BASE_TV}/${id}/images`, { query: computedOptions });
|
|
1465
1472
|
}
|
|
1466
1473
|
/**
|
|
1467
1474
|
* Retrieves keywords for a specific TV show asynchronously.
|
|
@@ -1478,7 +1485,7 @@ var TvShowsEndpoint = class extends BaseEndpoint {
|
|
|
1478
1485
|
* @returns {Promise<Recommendations>} A Promise that resolves with the recommendations for the TV show.
|
|
1479
1486
|
*/
|
|
1480
1487
|
async recommendations(id, options) {
|
|
1481
|
-
return await this.api.get(`${BASE_TV}/${id}/recommendations`, options);
|
|
1488
|
+
return await this.api.get(`${BASE_TV}/${id}/recommendations`, { query: options });
|
|
1482
1489
|
}
|
|
1483
1490
|
/**
|
|
1484
1491
|
* Retrieves reviews for a specific TV show asynchronously.
|
|
@@ -1487,7 +1494,7 @@ var TvShowsEndpoint = class extends BaseEndpoint {
|
|
|
1487
1494
|
* @returns {Promise<Reviews>} A Promise that resolves with the reviews of the TV show.
|
|
1488
1495
|
*/
|
|
1489
1496
|
async reviews(id, options) {
|
|
1490
|
-
return await this.api.get(`${BASE_TV}/${id}/reviews`, options);
|
|
1497
|
+
return await this.api.get(`${BASE_TV}/${id}/reviews`, { query: options });
|
|
1491
1498
|
}
|
|
1492
1499
|
/**
|
|
1493
1500
|
* Retrieves information about whether the TV show was screened theatrically asynchronously.
|
|
@@ -1504,7 +1511,7 @@ var TvShowsEndpoint = class extends BaseEndpoint {
|
|
|
1504
1511
|
* @returns {Promise<Similartv>} A Promise that resolves with the similar TV shows.
|
|
1505
1512
|
*/
|
|
1506
1513
|
async similar(id, options) {
|
|
1507
|
-
return await this.api.get(`${BASE_TV}/${id}/similar`, options);
|
|
1514
|
+
return await this.api.get(`${BASE_TV}/${id}/similar`, { query: options });
|
|
1508
1515
|
}
|
|
1509
1516
|
/**
|
|
1510
1517
|
* Retrieves translations for a specific TV show asynchronously.
|
|
@@ -1525,7 +1532,7 @@ var TvShowsEndpoint = class extends BaseEndpoint {
|
|
|
1525
1532
|
include_video_language: options?.include_video_language?.join(","),
|
|
1526
1533
|
language: options?.language
|
|
1527
1534
|
};
|
|
1528
|
-
return await this.api.get(`${BASE_TV}/${id}/videos`, computedOptions);
|
|
1535
|
+
return await this.api.get(`${BASE_TV}/${id}/videos`, { query: computedOptions });
|
|
1529
1536
|
}
|
|
1530
1537
|
/**
|
|
1531
1538
|
* Retrieves watch providers for a specific TV show asynchronously.
|
|
@@ -1549,7 +1556,7 @@ var TvShowsEndpoint = class extends BaseEndpoint {
|
|
|
1549
1556
|
* @returns {Promise<OnTheAir>} A Promise that resolves with TV shows currently on the air.
|
|
1550
1557
|
*/
|
|
1551
1558
|
async onTheAir(options) {
|
|
1552
|
-
return await this.api.get(`${BASE_TV}/on_the_air`, options);
|
|
1559
|
+
return await this.api.get(`${BASE_TV}/on_the_air`, { query: options });
|
|
1553
1560
|
}
|
|
1554
1561
|
/**
|
|
1555
1562
|
* Retrieves TV shows that are airing today asynchronously.
|
|
@@ -1557,7 +1564,7 @@ var TvShowsEndpoint = class extends BaseEndpoint {
|
|
|
1557
1564
|
* @returns {Promise<tvAiringToday>} A Promise that resolves with TV shows airing today.
|
|
1558
1565
|
*/
|
|
1559
1566
|
async airingToday(options) {
|
|
1560
|
-
return await this.api.get(`${BASE_TV}/airing_today`, options);
|
|
1567
|
+
return await this.api.get(`${BASE_TV}/airing_today`, { query: options });
|
|
1561
1568
|
}
|
|
1562
1569
|
/**
|
|
1563
1570
|
* Retrieves popular TV shows asynchronously.
|
|
@@ -1565,7 +1572,7 @@ var TvShowsEndpoint = class extends BaseEndpoint {
|
|
|
1565
1572
|
* @returns {Promise<Populartv>} A Promise that resolves with popular TV shows.
|
|
1566
1573
|
*/
|
|
1567
1574
|
async popular(options) {
|
|
1568
|
-
return await this.api.get(`${BASE_TV}/popular`, options);
|
|
1575
|
+
return await this.api.get(`${BASE_TV}/popular`, { query: options });
|
|
1569
1576
|
}
|
|
1570
1577
|
/**
|
|
1571
1578
|
* Retrieves top-rated TV shows asynchronously.
|
|
@@ -1573,7 +1580,7 @@ var TvShowsEndpoint = class extends BaseEndpoint {
|
|
|
1573
1580
|
* @returns {Promise<TopRatedtv>} A Promise that resolves with top-rated TV shows.
|
|
1574
1581
|
*/
|
|
1575
1582
|
async topRated(options) {
|
|
1576
|
-
return await this.api.get(`${BASE_TV}/top_rated`, options);
|
|
1583
|
+
return await this.api.get(`${BASE_TV}/top_rated`, { query: options });
|
|
1577
1584
|
}
|
|
1578
1585
|
};
|
|
1579
1586
|
|
|
@@ -1592,33 +1599,26 @@ var WatchProvidersEndpoint = class extends BaseEndpoint {
|
|
|
1592
1599
|
this.access_token = access_token;
|
|
1593
1600
|
}
|
|
1594
1601
|
/**
|
|
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.
|
|
1604
|
-
*/
|
|
1605
|
-
async regions() {
|
|
1606
|
-
return await this.api.get("/watch/providers/regions");
|
|
1607
|
-
}
|
|
1608
|
-
/**
|
|
1609
1602
|
* Retrieves a list of watch providers for movies.
|
|
1610
|
-
* @returns {Promise<
|
|
1603
|
+
* @returns {Promise<WatchProviderListResponse>} A Promise that resolves with the list of movie watch providers.
|
|
1611
1604
|
*/
|
|
1612
1605
|
async movie() {
|
|
1613
1606
|
return await this.api.get("/watch/providers/movie");
|
|
1614
1607
|
}
|
|
1615
1608
|
/**
|
|
1616
1609
|
* Retrieves a list of watch providers for TV shows.
|
|
1617
|
-
* @returns {Promise<
|
|
1610
|
+
* @returns {Promise<WatchProviderListResponse>} A Promise that resolves with the list of TV watch providers.
|
|
1618
1611
|
*/
|
|
1619
1612
|
async tv() {
|
|
1620
1613
|
return await this.api.get("/watch/providers/tv");
|
|
1621
1614
|
}
|
|
1615
|
+
/**
|
|
1616
|
+
* Retrieves a list of available regions for watch providers.
|
|
1617
|
+
* @returns {Promise<WatchProviderListResponse>} A Promise that resolves with the list of available regions.
|
|
1618
|
+
*/
|
|
1619
|
+
async regions() {
|
|
1620
|
+
return await this.api.get("/watch/providers/regions");
|
|
1621
|
+
}
|
|
1622
1622
|
};
|
|
1623
1623
|
|
|
1624
1624
|
//#endregion
|
|
@@ -1671,5 +1671,5 @@ var TMDB = class {
|
|
|
1671
1671
|
};
|
|
1672
1672
|
|
|
1673
1673
|
//#endregion
|
|
1674
|
-
export { API, BackdropSizes, BaseEndpoint, ChangeKeys, ImageFormats, ImageSizes, LogoSizes, PosterSizes, ProfileSizes, ReleaseDateType, StillSizes, TMDB, TMDB_IMAGE_BASE_URL, formImage, getFullImagePath, parseOptions };
|
|
1674
|
+
export { API, BackdropSizes, BaseEndpoint, ChangeKeys, ImageFormats, ImageSizes, LogoSizes, PosterSizes, ProfileSizes, ReleaseDateType, StillSizes, TMDB, TMDBError, TMDB_IMAGE_BASE_URL, formImage, getFullImagePath, parseOptions };
|
|
1675
1675
|
//# sourceMappingURL=index.mjs.map
|