@lorenzopant/tmdb 1.13.0 → 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -1
- package/dist/client.d.ts +5 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +47 -8
- package/dist/endpoints/base.d.ts +1 -0
- package/dist/endpoints/base.d.ts.map +1 -1
- package/dist/endpoints/base.js +3 -1
- package/dist/endpoints/collections.d.ts +1 -1
- package/dist/endpoints/collections.d.ts.map +1 -1
- package/dist/endpoints/companies.d.ts +1 -1
- package/dist/endpoints/companies.d.ts.map +1 -1
- package/dist/endpoints/credits.d.ts +1 -1
- package/dist/endpoints/credits.d.ts.map +1 -1
- package/dist/endpoints/movies.d.ts +4 -10
- package/dist/endpoints/movies.d.ts.map +1 -1
- package/dist/endpoints/movies.js +2 -7
- package/dist/endpoints/networks.d.ts +2 -1
- package/dist/endpoints/networks.d.ts.map +1 -1
- package/dist/endpoints/search.d.ts +1 -6
- package/dist/endpoints/search.d.ts.map +1 -1
- package/dist/endpoints/tv_episode_groups.d.ts +1 -1
- package/dist/endpoints/tv_episode_groups.d.ts.map +1 -1
- package/dist/endpoints/tv_episodes.d.ts +1 -8
- package/dist/endpoints/tv_episodes.d.ts.map +1 -1
- package/dist/endpoints/tv_seasons.d.ts +129 -0
- package/dist/endpoints/tv_seasons.d.ts.map +1 -0
- package/dist/endpoints/tv_seasons.js +164 -0
- package/dist/endpoints/tv_series.d.ts +1 -8
- package/dist/endpoints/tv_series.d.ts.map +1 -1
- package/dist/endpoints/tv_series_lists.d.ts +3 -7
- package/dist/endpoints/tv_series_lists.d.ts.map +1 -1
- package/dist/endpoints/tv_series_lists.js +2 -7
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/routes.d.ts +8 -0
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +8 -0
- package/dist/tmdb.d.ts +2 -0
- package/dist/tmdb.d.ts.map +1 -1
- package/dist/tmdb.js +4 -1
- package/dist/types/{other/collections.d.ts → collections.d.ts} +4 -4
- package/dist/types/collections.d.ts.map +1 -0
- package/dist/types/common/media.d.ts +1 -1
- package/dist/types/{other/companies.d.ts → companies.d.ts} +4 -4
- package/dist/types/companies.d.ts.map +1 -0
- package/dist/types/config/options.d.ts +7 -0
- package/dist/types/config/options.d.ts.map +1 -1
- package/dist/types/{other/credits.d.ts → credits.d.ts} +2 -2
- package/dist/types/credits.d.ts.map +1 -0
- package/dist/types/discover.d.ts +131 -0
- package/dist/types/discover.d.ts.map +1 -0
- package/dist/types/{other/find.d.ts → find.d.ts} +3 -3
- package/dist/types/find.d.ts.map +1 -0
- package/dist/types/index.d.ts +11 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +11 -3
- package/dist/types/{other/keywords.d.ts → keywords.d.ts} +1 -1
- package/dist/types/keywords.d.ts.map +1 -0
- package/dist/types/movies.d.ts +305 -0
- package/dist/types/movies.d.ts.map +1 -0
- package/dist/types/{other/networks.d.ts → networks.d.ts} +2 -2
- package/dist/types/networks.d.ts.map +1 -0
- package/dist/types/search.d.ts +167 -0
- package/dist/types/search.d.ts.map +1 -0
- package/dist/types/{other/tv_episode_groups.d.ts → tv-episode-groups.d.ts} +2 -2
- package/dist/types/tv-episode-groups.d.ts.map +1 -0
- package/dist/types/{tv-episodes/tv_episodes.d.ts → tv-episodes.d.ts} +44 -7
- package/dist/types/tv-episodes.d.ts.map +1 -0
- package/dist/types/tv-seasons.d.ts +132 -0
- package/dist/types/tv-seasons.d.ts.map +1 -0
- package/dist/types/tv-series.d.ts +446 -0
- package/dist/types/tv-series.d.ts.map +1 -0
- package/dist/types/{other/watch_providers.d.ts → watch-providers.d.ts} +5 -5
- package/dist/types/watch-providers.d.ts.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/logger.d.ts +19 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +41 -0
- package/package.json +1 -1
- package/dist/types/discover/index.d.ts +0 -4
- package/dist/types/discover/index.d.ts.map +0 -1
- package/dist/types/discover/index.js +0 -3
- package/dist/types/discover/movie.d.ts +0 -6
- package/dist/types/discover/movie.d.ts.map +0 -1
- package/dist/types/discover/params.d.ts +0 -81
- package/dist/types/discover/params.d.ts.map +0 -1
- package/dist/types/discover/tv.d.ts +0 -50
- package/dist/types/discover/tv.d.ts.map +0 -1
- package/dist/types/movies/alternative_titles.d.ts +0 -11
- package/dist/types/movies/alternative_titles.d.ts.map +0 -1
- package/dist/types/movies/changes.d.ts +0 -3
- package/dist/types/movies/changes.d.ts.map +0 -1
- package/dist/types/movies/credits.d.ts +0 -13
- package/dist/types/movies/credits.d.ts.map +0 -1
- package/dist/types/movies/external_ids.d.ts +0 -16
- package/dist/types/movies/external_ids.d.ts.map +0 -1
- package/dist/types/movies/images.d.ts +0 -6
- package/dist/types/movies/images.d.ts.map +0 -1
- package/dist/types/movies/index.d.ts +0 -15
- package/dist/types/movies/index.d.ts.map +0 -1
- package/dist/types/movies/index.js +0 -14
- package/dist/types/movies/keywords.d.ts +0 -11
- package/dist/types/movies/keywords.d.ts.map +0 -1
- package/dist/types/movies/movie.d.ts +0 -106
- package/dist/types/movies/movie.d.ts.map +0 -1
- package/dist/types/movies/movie.js +0 -1
- package/dist/types/movies/params.d.ts +0 -94
- package/dist/types/movies/params.d.ts.map +0 -1
- package/dist/types/movies/params.js +0 -1
- package/dist/types/movies/recommendations.d.ts +0 -7
- package/dist/types/movies/recommendations.d.ts.map +0 -1
- package/dist/types/movies/recommendations.js +0 -1
- package/dist/types/movies/release_dates.d.ts +0 -37
- package/dist/types/movies/release_dates.d.ts.map +0 -1
- package/dist/types/movies/release_dates.js +0 -1
- package/dist/types/movies/reviews.d.ts +0 -6
- package/dist/types/movies/reviews.d.ts.map +0 -1
- package/dist/types/movies/reviews.js +0 -1
- package/dist/types/movies/similar.d.ts +0 -7
- package/dist/types/movies/similar.d.ts.map +0 -1
- package/dist/types/movies/similar.js +0 -1
- package/dist/types/movies/translations.d.ts +0 -21
- package/dist/types/movies/translations.d.ts.map +0 -1
- package/dist/types/movies/translations.js +0 -1
- package/dist/types/movies/videos.d.ts +0 -6
- package/dist/types/movies/videos.d.ts.map +0 -1
- package/dist/types/movies/videos.js +0 -1
- package/dist/types/other/collections.d.ts.map +0 -1
- package/dist/types/other/companies.d.ts.map +0 -1
- package/dist/types/other/credits.d.ts.map +0 -1
- package/dist/types/other/credits.js +0 -1
- package/dist/types/other/find.d.ts.map +0 -1
- package/dist/types/other/index.d.ts +0 -9
- package/dist/types/other/index.d.ts.map +0 -1
- package/dist/types/other/index.js +0 -8
- package/dist/types/other/keywords.d.ts.map +0 -1
- package/dist/types/other/keywords.js +0 -1
- package/dist/types/other/networks.d.ts.map +0 -1
- package/dist/types/other/tv_episode_groups.d.ts.map +0 -1
- package/dist/types/other/watch_providers.d.ts.map +0 -1
- package/dist/types/other/watch_providers.js +0 -1
- package/dist/types/search/collection.d.ts +0 -22
- package/dist/types/search/collection.d.ts.map +0 -1
- package/dist/types/search/collection.js +0 -1
- package/dist/types/search/company.d.ts +0 -15
- package/dist/types/search/company.d.ts.map +0 -1
- package/dist/types/search/company.js +0 -1
- package/dist/types/search/index.d.ts +0 -7
- package/dist/types/search/index.d.ts.map +0 -1
- package/dist/types/search/index.js +0 -6
- package/dist/types/search/keyword.d.ts +0 -6
- package/dist/types/search/keyword.d.ts.map +0 -1
- package/dist/types/search/keyword.js +0 -1
- package/dist/types/search/movie.d.ts +0 -34
- package/dist/types/search/movie.d.ts.map +0 -1
- package/dist/types/search/movie.js +0 -1
- package/dist/types/search/multi.d.ts +0 -1
- package/dist/types/search/multi.d.ts.map +0 -1
- package/dist/types/search/multi.js +0 -1
- package/dist/types/search/params.d.ts +0 -37
- package/dist/types/search/params.d.ts.map +0 -1
- package/dist/types/search/params.js +0 -1
- package/dist/types/search/person.d.ts +0 -13
- package/dist/types/search/person.d.ts.map +0 -1
- package/dist/types/search/person.js +0 -1
- package/dist/types/search/tv.d.ts +0 -39
- package/dist/types/search/tv.d.ts.map +0 -1
- package/dist/types/search/tv.js +0 -1
- package/dist/types/tv/aggregate_credits.d.ts +0 -58
- package/dist/types/tv/aggregate_credits.d.ts.map +0 -1
- package/dist/types/tv/aggregate_credits.js +0 -1
- package/dist/types/tv/alternative_titles.d.ts +0 -11
- package/dist/types/tv/alternative_titles.d.ts.map +0 -1
- package/dist/types/tv/alternative_titles.js +0 -1
- package/dist/types/tv/changes.d.ts +0 -3
- package/dist/types/tv/changes.d.ts.map +0 -1
- package/dist/types/tv/changes.js +0 -1
- package/dist/types/tv/content_ratings.d.ts +0 -5
- package/dist/types/tv/content_ratings.d.ts.map +0 -1
- package/dist/types/tv/content_ratings.js +0 -1
- package/dist/types/tv/credits.d.ts +0 -15
- package/dist/types/tv/credits.d.ts.map +0 -1
- package/dist/types/tv/credits.js +0 -1
- package/dist/types/tv/episode_groups.d.ts +0 -30
- package/dist/types/tv/episode_groups.d.ts.map +0 -1
- package/dist/types/tv/episode_groups.js +0 -1
- package/dist/types/tv/episodes.d.ts +0 -27
- package/dist/types/tv/episodes.d.ts.map +0 -1
- package/dist/types/tv/episodes.js +0 -1
- package/dist/types/tv/external_ids.d.ts +0 -26
- package/dist/types/tv/external_ids.d.ts.map +0 -1
- package/dist/types/tv/external_ids.js +0 -1
- package/dist/types/tv/images.d.ts +0 -15
- package/dist/types/tv/images.d.ts.map +0 -1
- package/dist/types/tv/images.js +0 -1
- package/dist/types/tv/index.d.ts +0 -21
- package/dist/types/tv/index.d.ts.map +0 -1
- package/dist/types/tv/index.js +0 -20
- package/dist/types/tv/keywords.d.ts +0 -11
- package/dist/types/tv/keywords.d.ts.map +0 -1
- package/dist/types/tv/keywords.js +0 -1
- package/dist/types/tv/lists.d.ts +0 -32
- package/dist/types/tv/lists.d.ts.map +0 -1
- package/dist/types/tv/lists.js +0 -1
- package/dist/types/tv/params.d.ts +0 -74
- package/dist/types/tv/params.d.ts.map +0 -1
- package/dist/types/tv/params.js +0 -1
- package/dist/types/tv/recommendations.d.ts +0 -5
- package/dist/types/tv/recommendations.d.ts.map +0 -1
- package/dist/types/tv/recommendations.js +0 -1
- package/dist/types/tv/reviews.d.ts +0 -6
- package/dist/types/tv/reviews.d.ts.map +0 -1
- package/dist/types/tv/reviews.js +0 -1
- package/dist/types/tv/screened_theatrically.d.ts +0 -21
- package/dist/types/tv/screened_theatrically.d.ts.map +0 -1
- package/dist/types/tv/screened_theatrically.js +0 -1
- package/dist/types/tv/seasons.d.ts +0 -17
- package/dist/types/tv/seasons.d.ts.map +0 -1
- package/dist/types/tv/seasons.js +0 -1
- package/dist/types/tv/similar.d.ts +0 -5
- package/dist/types/tv/similar.d.ts.map +0 -1
- package/dist/types/tv/similar.js +0 -1
- package/dist/types/tv/translations.d.ts +0 -20
- package/dist/types/tv/translations.d.ts.map +0 -1
- package/dist/types/tv/translations.js +0 -1
- package/dist/types/tv/tv_series.d.ts +0 -104
- package/dist/types/tv/tv_series.d.ts.map +0 -1
- package/dist/types/tv/tv_series.js +0 -1
- package/dist/types/tv/videos.d.ts +0 -9
- package/dist/types/tv/videos.d.ts.map +0 -1
- package/dist/types/tv/videos.js +0 -1
- package/dist/types/tv-episodes/credits.d.ts +0 -8
- package/dist/types/tv-episodes/credits.d.ts.map +0 -1
- package/dist/types/tv-episodes/credits.js +0 -1
- package/dist/types/tv-episodes/external_ids.d.ts +0 -3
- package/dist/types/tv-episodes/external_ids.d.ts.map +0 -1
- package/dist/types/tv-episodes/external_ids.js +0 -1
- package/dist/types/tv-episodes/images.d.ts +0 -3
- package/dist/types/tv-episodes/images.d.ts.map +0 -1
- package/dist/types/tv-episodes/images.js +0 -1
- package/dist/types/tv-episodes/index.d.ts +0 -4
- package/dist/types/tv-episodes/index.d.ts.map +0 -1
- package/dist/types/tv-episodes/index.js +0 -3
- package/dist/types/tv-episodes/params.d.ts +0 -30
- package/dist/types/tv-episodes/params.d.ts.map +0 -1
- package/dist/types/tv-episodes/params.js +0 -1
- package/dist/types/tv-episodes/translations.d.ts +0 -7
- package/dist/types/tv-episodes/translations.d.ts.map +0 -1
- package/dist/types/tv-episodes/translations.js +0 -1
- package/dist/types/tv-episodes/tv_episodes.d.ts.map +0 -1
- package/dist/types/tv-episodes/tv_episodes.js +0 -1
- package/dist/types/tv-episodes/videos.d.ts +0 -3
- package/dist/types/tv-episodes/videos.d.ts.map +0 -1
- package/dist/types/tv-episodes/videos.js +0 -1
- package/dist/types/tv-seasons/params.d.ts +0 -15
- package/dist/types/tv-seasons/params.d.ts.map +0 -1
- package/dist/types/tv-seasons/params.js +0 -1
- package/dist/types/tv-seasons/tv-season.d.ts +0 -1
- package/dist/types/tv-seasons/tv-season.d.ts.map +0 -1
- package/dist/types/tv-seasons/tv-season.js +0 -1
- /package/dist/types/{other/collections.js → collections.js} +0 -0
- /package/dist/types/{other/companies.js → companies.js} +0 -0
- /package/dist/types/{movies/credits.js → credits.js} +0 -0
- /package/dist/types/{discover/tv.js → discover.js} +0 -0
- /package/dist/types/{other/find.js → find.js} +0 -0
- /package/dist/types/{movies/keywords.js → keywords.js} +0 -0
- /package/dist/types/{discover/movie.js → movies.js} +0 -0
- /package/dist/types/{other/networks.js → networks.js} +0 -0
- /package/dist/types/{discover/params.js → search.js} +0 -0
- /package/dist/types/{other/tv_episode_groups.js → tv-episode-groups.js} +0 -0
- /package/dist/types/{movies/alternative_titles.js → tv-episodes.js} +0 -0
- /package/dist/types/{movies/changes.js → tv-seasons.js} +0 -0
- /package/dist/types/{movies/external_ids.js → tv-series.js} +0 -0
- /package/dist/types/{movies/images.js → watch-providers.js} +0 -0
package/README.md
CHANGED
|
@@ -61,10 +61,29 @@ The main client class. **Each API method supports all the parameters supported b
|
|
|
61
61
|
#### Constructor
|
|
62
62
|
|
|
63
63
|
```typescript
|
|
64
|
-
const tmdb = new TMDB(accessToken: string);
|
|
64
|
+
const tmdb = new TMDB(accessToken: string, options?: TMDBOptions);
|
|
65
65
|
```
|
|
66
66
|
|
|
67
67
|
- `accessToken`: **required**. Your TMDB API v4 access token.
|
|
68
|
+
- `options.logger`: Enable debug logging for all network requests.
|
|
69
|
+
|
|
70
|
+
Example:
|
|
71
|
+
|
|
72
|
+
```typescript
|
|
73
|
+
const tmdb = new TMDB("your_access_token", { logger: true });
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Custom logger:
|
|
77
|
+
|
|
78
|
+
```typescript
|
|
79
|
+
const tmdb = new TMDB("your_access_token", {
|
|
80
|
+
logger: (entry) => {
|
|
81
|
+
if (entry.type === "response") {
|
|
82
|
+
console.log("TMDB:", entry.endpoint, entry.status, entry.durationMs);
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
```
|
|
68
87
|
|
|
69
88
|
---
|
|
70
89
|
|
package/dist/client.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
import { TMDBLoggerFn } from "./utils/logger";
|
|
1
2
|
export declare class ApiClient {
|
|
2
3
|
private accessToken;
|
|
3
4
|
private baseUrl;
|
|
4
|
-
|
|
5
|
+
private logger?;
|
|
6
|
+
constructor(accessToken: string, options?: {
|
|
7
|
+
logger?: boolean | TMDBLoggerFn;
|
|
8
|
+
});
|
|
5
9
|
request<T>(endpoint: string, params?: Record<string, unknown | undefined>): Promise<T>;
|
|
6
10
|
/**
|
|
7
11
|
* Recursively converts null values to undefined in API responses.
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE1D,qBAAa,SAAS;IACrB,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,OAAO,CAA0C;IACzD,OAAO,CAAC,MAAM,CAAC,CAAa;gBAEhB,WAAW,EAAE,MAAM,EAAE,OAAO,GAAE;QAAE,MAAM,CAAC,EAAE,OAAO,GAAG,YAAY,CAAA;KAAO;IAK5E,OAAO,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,SAAS,CAAM,GAAG,OAAO,CAAC,CAAC,CAAC;IAgDhG;;;;OAIG;IACH,OAAO,CAAC,aAAa;YA2BP,WAAW;CA6BzB"}
|
package/dist/client.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { TMDBError } from "./errors/tmdb";
|
|
2
|
+
import { TMDBLogger } from "./utils/logger";
|
|
2
3
|
export class ApiClient {
|
|
3
4
|
accessToken;
|
|
4
5
|
baseUrl = "https://api.themoviedb.org/3";
|
|
5
|
-
|
|
6
|
+
logger;
|
|
7
|
+
constructor(accessToken, options = {}) {
|
|
6
8
|
this.accessToken = accessToken;
|
|
9
|
+
this.logger = TMDBLogger.from(options.logger);
|
|
7
10
|
}
|
|
8
11
|
async request(endpoint, params = {}) {
|
|
9
12
|
const url = new URL(`${this.baseUrl}${endpoint}`);
|
|
@@ -12,14 +15,41 @@ export class ApiClient {
|
|
|
12
15
|
continue;
|
|
13
16
|
url.searchParams.append(key, String(value));
|
|
14
17
|
}
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
const startedAt = Date.now();
|
|
19
|
+
this.logger?.log({
|
|
20
|
+
type: "request",
|
|
21
|
+
method: "GET",
|
|
22
|
+
endpoint,
|
|
20
23
|
});
|
|
24
|
+
let res;
|
|
25
|
+
try {
|
|
26
|
+
res = await fetch(url.toString(), {
|
|
27
|
+
headers: {
|
|
28
|
+
Authorization: `Bearer ${this.accessToken}`,
|
|
29
|
+
"Content-Type": "application/json;charset=utf-8",
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
this.logger?.log({
|
|
35
|
+
type: "error",
|
|
36
|
+
method: "GET",
|
|
37
|
+
endpoint,
|
|
38
|
+
errorMessage: error instanceof Error ? error.message : String(error),
|
|
39
|
+
durationMs: Date.now() - startedAt,
|
|
40
|
+
});
|
|
41
|
+
throw error;
|
|
42
|
+
}
|
|
21
43
|
if (!res.ok)
|
|
22
|
-
await this.handleError(res);
|
|
44
|
+
await this.handleError(res, endpoint);
|
|
45
|
+
this.logger?.log({
|
|
46
|
+
type: "response",
|
|
47
|
+
method: "GET",
|
|
48
|
+
endpoint,
|
|
49
|
+
status: res.status,
|
|
50
|
+
statusText: res.statusText,
|
|
51
|
+
durationMs: Date.now() - startedAt,
|
|
52
|
+
});
|
|
23
53
|
const data = await res.json();
|
|
24
54
|
return this.sanitizeNulls(data);
|
|
25
55
|
}
|
|
@@ -50,7 +80,7 @@ export class ApiClient {
|
|
|
50
80
|
}
|
|
51
81
|
return sanitized;
|
|
52
82
|
}
|
|
53
|
-
async handleError(res) {
|
|
83
|
+
async handleError(res, endpoint) {
|
|
54
84
|
let errorMessage = res.statusText;
|
|
55
85
|
let tmdbStatusCode = -1;
|
|
56
86
|
try {
|
|
@@ -65,6 +95,15 @@ export class ApiClient {
|
|
|
65
95
|
console.error(`Unknown error: ${error}`);
|
|
66
96
|
// If response is not JSON, fallback to HTTP status text
|
|
67
97
|
}
|
|
98
|
+
this.logger?.log({
|
|
99
|
+
type: "error",
|
|
100
|
+
method: "GET",
|
|
101
|
+
endpoint,
|
|
102
|
+
status: res.status,
|
|
103
|
+
statusText: res.statusText,
|
|
104
|
+
tmdbStatusCode,
|
|
105
|
+
errorMessage,
|
|
106
|
+
});
|
|
68
107
|
const error = new TMDBError(errorMessage, res.status, tmdbStatusCode);
|
|
69
108
|
throw error;
|
|
70
109
|
}
|
package/dist/endpoints/base.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export declare abstract class TMDBAPIBase {
|
|
|
8
8
|
/**
|
|
9
9
|
* Merges the endpoint's params with TMDB-wide defaults (language, region).
|
|
10
10
|
* Works only for param types that include optional `language` and `region` fields.
|
|
11
|
+
* Only request-safe defaults are merged — config-only options (logger, images, etc.) are excluded.
|
|
11
12
|
*/
|
|
12
13
|
protected applyDefaults<T extends object>(params?: T): T | undefined;
|
|
13
14
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/endpoints/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,8BAAsB,WAAW;IAChC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC;IAC5B,SAAS,CAAC,cAAc,EAAE,WAAW,CAAC;gBAE1B,MAAM,EAAE,SAAS,EAAE,cAAc,GAAE,WAAgB;IAK/D
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/endpoints/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,8BAAsB,WAAW;IAChC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC;IAC5B,SAAS,CAAC,cAAc,EAAE,WAAW,CAAC;gBAE1B,MAAM,EAAE,SAAS,EAAE,cAAc,GAAE,WAAgB;IAK/D;;;;OAIG;IACH,SAAS,CAAC,aAAa,CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS;IAKpE;;;OAGG;IACH,SAAS,CAAC,YAAY,CAAC,CAAC,SAAS;QAAE,QAAQ,CAAC,EAAE,QAAQ,CAAA;KAAE,EAAE,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS;CAOpF"}
|
package/dist/endpoints/base.js
CHANGED
|
@@ -8,9 +8,11 @@ export class TMDBAPIBase {
|
|
|
8
8
|
/**
|
|
9
9
|
* Merges the endpoint's params with TMDB-wide defaults (language, region).
|
|
10
10
|
* Works only for param types that include optional `language` and `region` fields.
|
|
11
|
+
* Only request-safe defaults are merged — config-only options (logger, images, etc.) are excluded.
|
|
11
12
|
*/
|
|
12
13
|
applyDefaults(params) {
|
|
13
|
-
|
|
14
|
+
const { language, region } = this.defaultOptions;
|
|
15
|
+
return { ...(language !== undefined && { language }), ...(region !== undefined && { region }), ...params };
|
|
14
16
|
}
|
|
15
17
|
/**
|
|
16
18
|
* Ensures params contains a language: prefer explicit param, fallback to defaultOptions.language.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CollectionBaseParam, Collection, CollectionDetailsParams, CollectionImages, CollectionImagesParams, CollectionTranslations } from "../types/
|
|
1
|
+
import { CollectionBaseParam, Collection, CollectionDetailsParams, CollectionImages, CollectionImagesParams, CollectionTranslations } from "../types/collections";
|
|
2
2
|
import { TMDBAPIBase } from "./base";
|
|
3
3
|
export declare class CollectionsAPI extends TMDBAPIBase {
|
|
4
4
|
private collectionPath;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collections.d.ts","sourceRoot":"","sources":["../../src/endpoints/collections.ts"],"names":[],"mappings":"AACA,OAAO,EACN,mBAAmB,EACnB,UAAU,EACV,uBAAuB,EACvB,gBAAgB,EAChB,sBAAsB,EACtB,sBAAsB,EACtB,MAAM,
|
|
1
|
+
{"version":3,"file":"collections.d.ts","sourceRoot":"","sources":["../../src/endpoints/collections.ts"],"names":[],"mappings":"AACA,OAAO,EACN,mBAAmB,EACnB,UAAU,EACV,uBAAuB,EACvB,gBAAgB,EAChB,sBAAsB,EACtB,sBAAsB,EACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,qBAAa,cAAe,SAAQ,WAAW;IAC9C,OAAO,CAAC,cAAc;IAItB;;;;;;;;;OASG;IACG,OAAO,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,UAAU,CAAC;IAMnE;;;;;;;;;;;OAWG;IACG,MAAM,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAMvE;;;;;;;;OAQG;IACG,YAAY,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,sBAAsB,CAAC;CAIhF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Company, CompanyAlternativeNames, CompanyAlternativeNamesParams, CompanyImages, CompanyImagesParams, CompanyDetailsParams } from "../types/
|
|
1
|
+
import { Company, CompanyAlternativeNames, CompanyAlternativeNamesParams, CompanyImages, CompanyImagesParams, CompanyDetailsParams } from "../types/companies";
|
|
2
2
|
import { TMDBAPIBase } from "./base";
|
|
3
3
|
export declare class CompaniesAPI extends TMDBAPIBase {
|
|
4
4
|
private companyPath;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"companies.d.ts","sourceRoot":"","sources":["../../src/endpoints/companies.ts"],"names":[],"mappings":"AACA,OAAO,EACN,OAAO,EACP,uBAAuB,EACvB,6BAA6B,EAC7B,aAAa,EACb,mBAAmB,EACnB,oBAAoB,EACpB,MAAM,
|
|
1
|
+
{"version":3,"file":"companies.d.ts","sourceRoot":"","sources":["../../src/endpoints/companies.ts"],"names":[],"mappings":"AACA,OAAO,EACN,OAAO,EACP,uBAAuB,EACvB,6BAA6B,EAC7B,aAAa,EACb,mBAAmB,EACnB,oBAAoB,EACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,qBAAa,YAAa,SAAQ,WAAW;IAC5C,OAAO,CAAC,WAAW;IAInB;;;;;;;;OAQG;IACG,OAAO,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,OAAO,CAAC;IAK7D;;;;;;;;OAQG;IACG,iBAAiB,CAAC,MAAM,EAAE,6BAA6B,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAKhG;;;;;;;;;;OAUG;IACG,MAAM,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,aAAa,CAAC;CAKjE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credits.d.ts","sourceRoot":"","sources":["../../src/endpoints/credits.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"credits.d.ts","sourceRoot":"","sources":["../../src/endpoints/credits.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,qBAAa,UAAW,SAAQ,WAAW;IAC1C,OAAO,CAAC,UAAU;IAIlB;;;;;;;;;OASG;IACG,OAAO,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,aAAa,CAAC;CAKlE"}
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import { MovieChanges } from "../types/movies/changes";
|
|
6
|
-
import { MovieAlternativeTitlesParams, MovieChangesParams, MovieCreditsParams, MovieDetailsParams, MovieExternalIDsParams, MovieImagesParams, MovieKeywordsParams, MovieRecommendationsParams, MovieReleaseDatesParams, MovieReviewsParams, MovieSimilarParams, MovieTranslationsParams, MovieVideosParams, MovieWatchProvidersParams } from "../types/movies/params";
|
|
7
|
-
export declare class MoviesAPI {
|
|
8
|
-
private client;
|
|
9
|
-
private defaultOptions;
|
|
10
|
-
constructor(client: ApiClient, options?: TMDBOptions);
|
|
1
|
+
import { MediaWatchProviders, MovieAlternativeTitlesParams, MovieChangesParams, MovieCreditsParams, MovieDetailsParams, MovieExternalIDsParams, MovieImagesParams, MovieKeywordsParams, MovieRecommendationsParams, MovieReleaseDatesParams, MovieReviewsParams, MovieSimilarParams, MovieTranslationsParams, MovieVideosParams, MovieWatchProvidersParams } from "../types";
|
|
2
|
+
import { MovieAlternativeTitles, MovieAppendToResponseNamespace, MovieChanges, MovieCredits, MovieDetails, MovieDetailsWithAppends, MovieExternalIDs, MovieImages, MovieKeywords, MovieRecommendations, MovieReleaseDates, MovieReviews, MovieSimilar, MovieTranslations, MovieVideos } from "../types/movies";
|
|
3
|
+
import { TMDBAPIBase } from "./base";
|
|
4
|
+
export declare class MoviesAPI extends TMDBAPIBase {
|
|
11
5
|
private moviePath;
|
|
12
6
|
private movieSubPath;
|
|
13
7
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"movies.d.ts","sourceRoot":"","sources":["../../src/endpoints/movies.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"movies.d.ts","sourceRoot":"","sources":["../../src/endpoints/movies.ts"],"names":[],"mappings":"AACA,OAAO,EACN,mBAAmB,EACnB,4BAA4B,EAC5B,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,mBAAmB,EACnB,0BAA0B,EAC1B,uBAAuB,EACvB,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB,EACvB,iBAAiB,EACjB,yBAAyB,EACzB,MAAM,UAAU,CAAC;AAClB,OAAO,EACN,sBAAsB,EACtB,8BAA8B,EAC9B,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,uBAAuB,EACvB,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,oBAAoB,EACpB,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,qBAAa,SAAU,SAAQ,WAAW;IACzC,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,YAAY;IAIpB;;;;;;;;;;OAUG;IACG,OAAO,CAAC,CAAC,SAAS,SAAS,8BAA8B,EAAE,GAAG,EAAE,EACrE,MAAM,EAAE,kBAAkB,GAAG;QAAE,kBAAkB,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;KAAE,GACjE,OAAO,CAAC,CAAC,SAAS,EAAE,GAAG,YAAY,GAAG,uBAAuB,CAAC,CAAC,CAAC,CAAC;IAMpE;;;;;;;;;OASG;IACG,kBAAkB,CAAC,MAAM,EAAE,4BAA4B,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAK/F;;;;;;;;;OASG;IACG,OAAO,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,YAAY,CAAC;IAMhE;;;;;;;;;;OAUG;IACG,YAAY,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAK7E;;;;;;;;;OASG;IACG,QAAQ,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,aAAa,CAAC;IAKnE;;;;;;;;;;;;;OAaG;IACG,OAAO,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,YAAY,CAAC;IAKhE;;;;;;;;;;;;;;OAcG;IACG,MAAM,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,WAAW,CAAC;IAM7D;;;;;;;;OAQG;IACG,MAAM,IAAI,OAAO,CAAC,YAAY,CAAC;IAKrC;;;;;;;;;;;OAWG;IACG,eAAe,CAAC,MAAM,EAAE,0BAA0B,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAMxF;;;;;;;;;;;;;;;OAeG;IACG,aAAa,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAKhF;;;;;;;;;;OAUG;IACG,OAAO,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,YAAY,CAAC;IAMhE;;;;;;;;;;;;OAYG;IACG,OAAO,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,YAAY,CAAC;IAMhE;;;;;;;;;;OAUG;IACG,YAAY,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAK/E;;;;;;;;OAQG;IACG,MAAM,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,WAAW,CAAC;IAM7D;;;;;;;;;;;;;;;OAeG;IACG,eAAe,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAItF"}
|
package/dist/endpoints/movies.js
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { ENDPOINTS } from "../routes";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
defaultOptions;
|
|
5
|
-
constructor(client, options = {}) {
|
|
6
|
-
this.client = client;
|
|
7
|
-
this.defaultOptions = options;
|
|
8
|
-
}
|
|
2
|
+
import { TMDBAPIBase } from "./base";
|
|
3
|
+
export class MoviesAPI extends TMDBAPIBase {
|
|
9
4
|
moviePath(movie_id) {
|
|
10
5
|
return `${ENDPOINTS.MOVIES.DETAILS}/${movie_id}`;
|
|
11
6
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { AlternativeNamesResult
|
|
1
|
+
import { AlternativeNamesResult } from "../types";
|
|
2
|
+
import { Network, NetworkBaseParams, NetworkImages } from "../types/networks";
|
|
2
3
|
import { TMDBAPIBase } from "./base";
|
|
3
4
|
export declare class NetworksAPI extends TMDBAPIBase {
|
|
4
5
|
private networkPath;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"networks.d.ts","sourceRoot":"","sources":["../../src/endpoints/networks.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"networks.d.ts","sourceRoot":"","sources":["../../src/endpoints/networks.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,qBAAa,WAAY,SAAQ,WAAW;IAC3C,OAAO,CAAC,WAAW;IAInB;;;;;;;;OAQG;IACG,OAAO,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC;IAK1D;;;;;;;;OAQG;IACG,iBAAiB,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAKnF;;;;;;;;OAQG;IACG,MAAM,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,aAAa,CAAC;CAI/D"}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import { MovieResultItem, PaginatedResponse } from "../types";
|
|
2
|
-
import { SearchCollectionsParams, SearchCompanyParams, SearchKeywordsParams, SearchMoviesParams, SearchPersonParams } from "../types/search/params";
|
|
3
|
-
import { CollectionResultItem } from "../types/search/collection";
|
|
4
|
-
import { CompanyResultItem } from "../types/search/company";
|
|
5
|
-
import { KeywordResultItem } from "../types/search/keyword";
|
|
1
|
+
import { CollectionResultItem, CompanyResultItem, KeywordResultItem, MovieResultItem, PaginatedResponse, PersonResultItem, SearchCollectionsParams, SearchCompanyParams, SearchKeywordsParams, SearchMoviesParams, SearchPersonParams } from "../types";
|
|
6
2
|
import { TMDBAPIBase } from "./base";
|
|
7
|
-
import { PersonResultItem } from "../types/search/person";
|
|
8
3
|
export declare class SearchAPI extends TMDBAPIBase {
|
|
9
4
|
/**
|
|
10
5
|
* Search Collection
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/endpoints/search.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/endpoints/search.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,qBAAa,SAAU,SAAQ,WAAW;IACzC;;;;;;;;;;;OAWG;IACG,WAAW,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,iBAAiB,CAAC,oBAAoB,CAAC,CAAC;IAIpG;;;;;;;;;;;;;OAaG;IACG,MAAM,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC,eAAe,CAAC,CAAC;IAIrF;;;;;;;;OAQG;IACG,OAAO,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IAIzF;;;;;;;;OAQG;IACG,OAAO,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IAI1F;;;;;;;;OAQG;IACG,MAAM,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;CAGtF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TVEpisodeGroupDetails, TVEpisodeGroupParams } from "../types/
|
|
1
|
+
import { TVEpisodeGroupDetails, TVEpisodeGroupParams } from "../types/tv-episode-groups";
|
|
2
2
|
import { TMDBAPIBase } from "./base";
|
|
3
3
|
export declare class TVEpisodeGroupsAPI extends TMDBAPIBase {
|
|
4
4
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tv_episode_groups.d.ts","sourceRoot":"","sources":["../../src/endpoints/tv_episode_groups.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"tv_episode_groups.d.ts","sourceRoot":"","sources":["../../src/endpoints/tv_episode_groups.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AACzF,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,qBAAa,kBAAmB,SAAQ,WAAW;IAClD;;;;;;;OAOG;IACG,OAAO,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAI3E"}
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
import { Changes } from "../types";
|
|
2
|
-
import { TVEpisodeCredits } from "../types/tv-episodes";
|
|
3
|
-
import { TVEpisodeExternalIDs } from "../types/tv-episodes/external_ids";
|
|
4
|
-
import { TVEpisodeImages } from "../types/tv-episodes/images";
|
|
5
|
-
import { TVEpisodeBaseParams, TVEpisodeCreditsParams, TVEpisodeDetailsParams, TVEpisodeId, TVEpisodeImagesParams } from "../types/tv-episodes/params";
|
|
6
|
-
import { TVEpisodeTranslations } from "../types/tv-episodes/translations";
|
|
7
|
-
import { TVEpisode, TVEpisodeAppendToResponseNamespace, TVEpisodeDetailsWithAppends } from "../types/tv-episodes/tv_episodes";
|
|
8
|
-
import { TVEpisodeVideos } from "../types/tv-episodes/videos";
|
|
1
|
+
import { Changes, TVEpisode, TVEpisodeAppendToResponseNamespace, TVEpisodeBaseParams, TVEpisodeCredits, TVEpisodeCreditsParams, TVEpisodeDetailsParams, TVEpisodeDetailsWithAppends, TVEpisodeExternalIDs, TVEpisodeId, TVEpisodeImages, TVEpisodeImagesParams, TVEpisodeTranslations, TVEpisodeVideos } from "../types";
|
|
9
2
|
import { TMDBAPIBase } from "./base";
|
|
10
3
|
export declare class TVEpisodesAPI extends TMDBAPIBase {
|
|
11
4
|
private episodePath;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tv_episodes.d.ts","sourceRoot":"","sources":["../../src/endpoints/tv_episodes.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"tv_episodes.d.ts","sourceRoot":"","sources":["../../src/endpoints/tv_episodes.ts"],"names":[],"mappings":"AACA,OAAO,EACN,OAAO,EACP,SAAS,EACT,kCAAkC,EAClC,mBAAmB,EACnB,gBAAgB,EAChB,sBAAsB,EACtB,sBAAsB,EACtB,2BAA2B,EAC3B,oBAAoB,EACpB,WAAW,EACX,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACrB,eAAe,EACf,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,qBAAa,aAAc,SAAQ,WAAW;IAC7C,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,cAAc;IAItB;;;;;;;;;;;;OAYG;IACG,OAAO,CAAC,CAAC,SAAS,SAAS,kCAAkC,EAAE,GAAG,EAAE,EACzE,MAAM,EAAE,sBAAsB,GAAG;QAAE,kBAAkB,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;KAAE,GACrE,OAAO,CAAC,CAAC,SAAS,EAAE,GAAG,SAAS,GAAG,2BAA2B,CAAC,CAAC,CAAC,CAAC;IAMrE;;;;;;;;;;;;;;;;;;OAkBG;IACG,OAAO,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC;IAKpD;;;;;;;;;;OAUG;IACG,OAAO,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAMxE;;;;;;;;;;OAUG;IACG,YAAY,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAK9E;;;;;;;;;;;;;;;;OAgBG;IACG,MAAM,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,eAAe,CAAC;IAMrE;;;;;;;;;;;;OAYG;IACG,YAAY,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAK/E;;;;;;;;;;OAUG;IACG,MAAM,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,eAAe,CAAC;CAInE"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { Changes, MediaWatchProviders, TVSeasonAggregateCredits, TVSeasonAggregateCreditsParams, TVSeasonAppendToResponseNamespace, TVSeasonBaseParams, TVSeasonChangesParams, TVSeasonCredits, TVSeasonCreditsParams, TVSeasonDetailsParams, TVSeasonDetailsWithAppends, TVSeasonExternalIDs, TVSeasonImages, TVSeasonImagesParams, TVSeasonTranslations, TVSeasonVideos, TVSeasonVideosParams, TVSeasonWatchProvidersParams, TVSeason } from "../types";
|
|
2
|
+
import { TMDBAPIBase } from "./base";
|
|
3
|
+
export declare class TVSeasonsAPI extends TMDBAPIBase {
|
|
4
|
+
private seasonPath;
|
|
5
|
+
private seasonSubPath;
|
|
6
|
+
/**
|
|
7
|
+
* Details
|
|
8
|
+
* GET - https://api.themoviedb.org/3/tv/{series_id}/season/{season_number}
|
|
9
|
+
*
|
|
10
|
+
* Query the details of a TV season.
|
|
11
|
+
* @param series_id The ID of the TV series.
|
|
12
|
+
* @param season_number The season number within the TV show.
|
|
13
|
+
* @param append_to_response A comma-separated list of the fields to include in the response.
|
|
14
|
+
* @param language The language to use for the response.
|
|
15
|
+
* @returns A promise that resolves to the TV season details.
|
|
16
|
+
* @reference https://developer.themoviedb.org/reference/tv-season-details
|
|
17
|
+
*/
|
|
18
|
+
details<T extends readonly TVSeasonAppendToResponseNamespace[] = []>(params: Omit<TVSeasonDetailsParams, "append_to_response"> & {
|
|
19
|
+
append_to_response?: T;
|
|
20
|
+
}): Promise<T extends [] ? TVSeason : TVSeasonDetailsWithAppends<T>>;
|
|
21
|
+
/**
|
|
22
|
+
* Aggregate Credits
|
|
23
|
+
* GET - https://api.themoviedb.org/3/tv/{series_id}/season/{season_number}/aggregate_credits
|
|
24
|
+
*
|
|
25
|
+
* Get the aggregate credits for a TV season.
|
|
26
|
+
* This returns the full cast and crew across all episodes of the season.
|
|
27
|
+
* @param series_id The ID of the TV series.
|
|
28
|
+
* @param season_number The season number within the TV show.
|
|
29
|
+
* @param language The language to use for the response.
|
|
30
|
+
* @returns A promise that resolves to the TV season aggregate credits.
|
|
31
|
+
* @reference https://developer.themoviedb.org/reference/tv-season-aggregate-credits
|
|
32
|
+
*/
|
|
33
|
+
aggregate_credits(params: TVSeasonAggregateCreditsParams): Promise<TVSeasonAggregateCredits>;
|
|
34
|
+
/**
|
|
35
|
+
* Changes
|
|
36
|
+
* GET - https://api.themoviedb.org/3/tv/season/{season_id}/changes
|
|
37
|
+
*
|
|
38
|
+
* Get the changes for a TV season by season ID. By default only the last 24 hours are returned.
|
|
39
|
+
* You can query up to 14 days in a single query by using the start_date and end_date query parameters.
|
|
40
|
+
* @param season_id The ID of the TV season.
|
|
41
|
+
* @param start_date Filter changes by start date (ISO 8601 format, e.g. "2024-01-01").
|
|
42
|
+
* @param end_date Filter changes by end date (ISO 8601 format, e.g. "2024-01-14").
|
|
43
|
+
* @param page The page of results to return.
|
|
44
|
+
* @returns A promise that resolves to the TV season changes history.
|
|
45
|
+
* @reference https://developer.themoviedb.org/reference/tv-season-changes-by-id
|
|
46
|
+
*/
|
|
47
|
+
changes(params: TVSeasonChangesParams): Promise<Changes>;
|
|
48
|
+
/**
|
|
49
|
+
* Credits
|
|
50
|
+
* GET - https://api.themoviedb.org/3/tv/{series_id}/season/{season_number}/credits
|
|
51
|
+
*
|
|
52
|
+
* Get the credits for a TV season.
|
|
53
|
+
* @param series_id The ID of the TV series.
|
|
54
|
+
* @param season_number The season number within the TV show.
|
|
55
|
+
* @param language The language to use for the response.
|
|
56
|
+
* @returns A promise that resolves to the TV season credits.
|
|
57
|
+
* @reference https://developer.themoviedb.org/reference/tv-season-credits
|
|
58
|
+
*/
|
|
59
|
+
credits(params: TVSeasonCreditsParams): Promise<TVSeasonCredits>;
|
|
60
|
+
/**
|
|
61
|
+
* External IDs
|
|
62
|
+
* GET - https://api.themoviedb.org/3/tv/{series_id}/season/{season_number}/external_ids
|
|
63
|
+
*
|
|
64
|
+
* Get a list of external IDs that have been added to a TV season.
|
|
65
|
+
* @param series_id The ID of the TV series.
|
|
66
|
+
* @param season_number The season number within the TV show.
|
|
67
|
+
* @returns A promise that resolves to the TV season external IDs.
|
|
68
|
+
* @reference https://developer.themoviedb.org/reference/tv-season-external-ids
|
|
69
|
+
*/
|
|
70
|
+
external_ids(params: TVSeasonBaseParams): Promise<TVSeasonExternalIDs>;
|
|
71
|
+
/**
|
|
72
|
+
* Images
|
|
73
|
+
* GET - https://api.themoviedb.org/3/tv/{series_id}/season/{season_number}/images
|
|
74
|
+
*
|
|
75
|
+
* Get the images that belong to a TV season. Returns season posters.
|
|
76
|
+
*
|
|
77
|
+
* NOTE: If you have a language specified, it will act as a filter on the returned items.
|
|
78
|
+
* You can use the include_image_language param to query additional languages.
|
|
79
|
+
*
|
|
80
|
+
* @param series_id The ID of the TV series.
|
|
81
|
+
* @param season_number The season number within the TV show.
|
|
82
|
+
* @param language The language code to filter images by language.
|
|
83
|
+
* @param include_image_language A comma-separated list of language codes to include images for.
|
|
84
|
+
* @returns A promise that resolves to the TV season images.
|
|
85
|
+
* @reference https://developer.themoviedb.org/reference/tv-season-images
|
|
86
|
+
*/
|
|
87
|
+
images(params: TVSeasonImagesParams): Promise<TVSeasonImages>;
|
|
88
|
+
/**
|
|
89
|
+
* Translations
|
|
90
|
+
* GET - https://api.themoviedb.org/3/tv/{series_id}/season/{season_number}/translations
|
|
91
|
+
*
|
|
92
|
+
* Get the translations that have been added to a TV season.
|
|
93
|
+
* Take a read through our language documentation for more information about languages on TMDB.
|
|
94
|
+
* https://developer.themoviedb.org/docs/languages
|
|
95
|
+
* @param series_id The ID of the TV series.
|
|
96
|
+
* @param season_number The season number within the TV show.
|
|
97
|
+
* @returns A promise that resolves to the TV season translations.
|
|
98
|
+
* @reference https://developer.themoviedb.org/reference/tv-season-translations
|
|
99
|
+
*/
|
|
100
|
+
translations(params: TVSeasonBaseParams): Promise<TVSeasonTranslations>;
|
|
101
|
+
/**
|
|
102
|
+
* Videos
|
|
103
|
+
* GET - https://api.themoviedb.org/3/tv/{series_id}/season/{season_number}/videos
|
|
104
|
+
*
|
|
105
|
+
* Get the videos that belong to a TV season.
|
|
106
|
+
* @param series_id The ID of the TV series.
|
|
107
|
+
* @param season_number The season number within the TV show.
|
|
108
|
+
* @param language The language to use for the response.
|
|
109
|
+
* @param include_video_language A comma-separated list of language codes to include videos for.
|
|
110
|
+
* @returns A promise that resolves to the TV season videos.
|
|
111
|
+
* @reference https://developer.themoviedb.org/reference/tv-season-videos
|
|
112
|
+
*/
|
|
113
|
+
videos(params: TVSeasonVideosParams): Promise<TVSeasonVideos>;
|
|
114
|
+
/**
|
|
115
|
+
* Watch Providers
|
|
116
|
+
* GET - https://api.themoviedb.org/3/tv/{series_id}/season/{season_number}/watch/providers
|
|
117
|
+
*
|
|
118
|
+
* Get the watch providers for a specific TV season.
|
|
119
|
+
* Powered by our partnership with JustWatch, you can query which streaming services
|
|
120
|
+
* have the season available.
|
|
121
|
+
* @param series_id The ID of the TV series.
|
|
122
|
+
* @param season_number The season number within the TV show.
|
|
123
|
+
* @param language The language to use for the response.
|
|
124
|
+
* @returns A promise that resolves to the TV season watch providers.
|
|
125
|
+
* @reference https://developer.themoviedb.org/reference/tv-season-watch-providers
|
|
126
|
+
*/
|
|
127
|
+
watch_providers(params: TVSeasonWatchProvidersParams): Promise<MediaWatchProviders>;
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=tv_seasons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tv_seasons.d.ts","sourceRoot":"","sources":["../../src/endpoints/tv_seasons.ts"],"names":[],"mappings":"AACA,OAAO,EACN,OAAO,EACP,mBAAmB,EACnB,wBAAwB,EACxB,8BAA8B,EAC9B,iCAAiC,EACjC,kBAAkB,EAClB,qBAAqB,EACrB,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACrB,0BAA0B,EAC1B,mBAAmB,EACnB,cAAc,EACd,oBAAoB,EACpB,oBAAoB,EACpB,cAAc,EACd,oBAAoB,EACpB,4BAA4B,EAC5B,QAAQ,EACR,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,qBAAa,YAAa,SAAQ,WAAW;IAC5C,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,aAAa;IAIrB;;;;;;;;;;;OAWG;IACG,OAAO,CAAC,CAAC,SAAS,SAAS,iCAAiC,EAAE,GAAG,EAAE,EACxE,MAAM,EAAE,IAAI,CAAC,qBAAqB,EAAE,oBAAoB,CAAC,GAAG;QAAE,kBAAkB,CAAC,EAAE,CAAC,CAAA;KAAE,GACpF,OAAO,CAAC,CAAC,SAAS,EAAE,GAAG,QAAQ,GAAG,0BAA0B,CAAC,CAAC,CAAC,CAAC;IAMnE;;;;;;;;;;;OAWG;IACG,iBAAiB,CAAC,MAAM,EAAE,8BAA8B,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAMlG;;;;;;;;;;;;OAYG;IACG,OAAO,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,OAAO,CAAC;IAM9D;;;;;;;;;;OAUG;IACG,OAAO,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,eAAe,CAAC;IAMtE;;;;;;;;;OASG;IACG,YAAY,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAK5E;;;;;;;;;;;;;;;OAeG;IACG,MAAM,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,cAAc,CAAC;IAMnE;;;;;;;;;;;OAWG;IACG,YAAY,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAK7E;;;;;;;;;;;OAWG;IACG,MAAM,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,cAAc,CAAC;IAMnE;;;;;;;;;;;;OAYG;IACG,eAAe,CAAC,MAAM,EAAE,4BAA4B,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAKzF"}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { ENDPOINTS } from "../routes";
|
|
2
|
+
import { TMDBAPIBase } from "./base";
|
|
3
|
+
export class TVSeasonsAPI extends TMDBAPIBase {
|
|
4
|
+
seasonPath(params) {
|
|
5
|
+
return `${ENDPOINTS.TV_SERIES.DETAILS}/${params.series_id}${ENDPOINTS.TV_SEASONS.DETAILS}/${params.season_number}`;
|
|
6
|
+
}
|
|
7
|
+
seasonSubPath(params, route) {
|
|
8
|
+
return `${this.seasonPath(params)}${route}`;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Details
|
|
12
|
+
* GET - https://api.themoviedb.org/3/tv/{series_id}/season/{season_number}
|
|
13
|
+
*
|
|
14
|
+
* Query the details of a TV season.
|
|
15
|
+
* @param series_id The ID of the TV series.
|
|
16
|
+
* @param season_number The season number within the TV show.
|
|
17
|
+
* @param append_to_response A comma-separated list of the fields to include in the response.
|
|
18
|
+
* @param language The language to use for the response.
|
|
19
|
+
* @returns A promise that resolves to the TV season details.
|
|
20
|
+
* @reference https://developer.themoviedb.org/reference/tv-season-details
|
|
21
|
+
*/
|
|
22
|
+
async details(params) {
|
|
23
|
+
const { language = this.defaultOptions.language, append_to_response, ...rest } = params;
|
|
24
|
+
const endpoint = this.seasonPath(rest);
|
|
25
|
+
return this.client.request(endpoint, { language, append_to_response });
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Aggregate Credits
|
|
29
|
+
* GET - https://api.themoviedb.org/3/tv/{series_id}/season/{season_number}/aggregate_credits
|
|
30
|
+
*
|
|
31
|
+
* Get the aggregate credits for a TV season.
|
|
32
|
+
* This returns the full cast and crew across all episodes of the season.
|
|
33
|
+
* @param series_id The ID of the TV series.
|
|
34
|
+
* @param season_number The season number within the TV show.
|
|
35
|
+
* @param language The language to use for the response.
|
|
36
|
+
* @returns A promise that resolves to the TV season aggregate credits.
|
|
37
|
+
* @reference https://developer.themoviedb.org/reference/tv-season-aggregate-credits
|
|
38
|
+
*/
|
|
39
|
+
async aggregate_credits(params) {
|
|
40
|
+
const { language = this.defaultOptions.language, ...rest } = params;
|
|
41
|
+
const endpoint = this.seasonSubPath(rest, ENDPOINTS.TV_SEASONS.AGGREGATE_CREDITS);
|
|
42
|
+
return this.client.request(endpoint, { language });
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Changes
|
|
46
|
+
* GET - https://api.themoviedb.org/3/tv/season/{season_id}/changes
|
|
47
|
+
*
|
|
48
|
+
* Get the changes for a TV season by season ID. By default only the last 24 hours are returned.
|
|
49
|
+
* You can query up to 14 days in a single query by using the start_date and end_date query parameters.
|
|
50
|
+
* @param season_id The ID of the TV season.
|
|
51
|
+
* @param start_date Filter changes by start date (ISO 8601 format, e.g. "2024-01-01").
|
|
52
|
+
* @param end_date Filter changes by end date (ISO 8601 format, e.g. "2024-01-14").
|
|
53
|
+
* @param page The page of results to return.
|
|
54
|
+
* @returns A promise that resolves to the TV season changes history.
|
|
55
|
+
* @reference https://developer.themoviedb.org/reference/tv-season-changes-by-id
|
|
56
|
+
*/
|
|
57
|
+
async changes(params) {
|
|
58
|
+
const { season_id, ...rest } = params;
|
|
59
|
+
const endpoint = `${ENDPOINTS.TV_SERIES.DETAILS}${ENDPOINTS.TV_SEASONS.DETAILS}/${season_id}${ENDPOINTS.TV_SEASONS.CHANGES}`;
|
|
60
|
+
return this.client.request(endpoint, { ...rest });
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Credits
|
|
64
|
+
* GET - https://api.themoviedb.org/3/tv/{series_id}/season/{season_number}/credits
|
|
65
|
+
*
|
|
66
|
+
* Get the credits for a TV season.
|
|
67
|
+
* @param series_id The ID of the TV series.
|
|
68
|
+
* @param season_number The season number within the TV show.
|
|
69
|
+
* @param language The language to use for the response.
|
|
70
|
+
* @returns A promise that resolves to the TV season credits.
|
|
71
|
+
* @reference https://developer.themoviedb.org/reference/tv-season-credits
|
|
72
|
+
*/
|
|
73
|
+
async credits(params) {
|
|
74
|
+
const { language = this.defaultOptions.language, ...rest } = params;
|
|
75
|
+
const endpoint = this.seasonSubPath(rest, ENDPOINTS.TV_SEASONS.CREDITS);
|
|
76
|
+
return this.client.request(endpoint, { language });
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* External IDs
|
|
80
|
+
* GET - https://api.themoviedb.org/3/tv/{series_id}/season/{season_number}/external_ids
|
|
81
|
+
*
|
|
82
|
+
* Get a list of external IDs that have been added to a TV season.
|
|
83
|
+
* @param series_id The ID of the TV series.
|
|
84
|
+
* @param season_number The season number within the TV show.
|
|
85
|
+
* @returns A promise that resolves to the TV season external IDs.
|
|
86
|
+
* @reference https://developer.themoviedb.org/reference/tv-season-external-ids
|
|
87
|
+
*/
|
|
88
|
+
async external_ids(params) {
|
|
89
|
+
const endpoint = this.seasonSubPath(params, ENDPOINTS.TV_SEASONS.EXTERNAL_IDS);
|
|
90
|
+
return this.client.request(endpoint);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Images
|
|
94
|
+
* GET - https://api.themoviedb.org/3/tv/{series_id}/season/{season_number}/images
|
|
95
|
+
*
|
|
96
|
+
* Get the images that belong to a TV season. Returns season posters.
|
|
97
|
+
*
|
|
98
|
+
* NOTE: If you have a language specified, it will act as a filter on the returned items.
|
|
99
|
+
* You can use the include_image_language param to query additional languages.
|
|
100
|
+
*
|
|
101
|
+
* @param series_id The ID of the TV series.
|
|
102
|
+
* @param season_number The season number within the TV show.
|
|
103
|
+
* @param language The language code to filter images by language.
|
|
104
|
+
* @param include_image_language A comma-separated list of language codes to include images for.
|
|
105
|
+
* @returns A promise that resolves to the TV season images.
|
|
106
|
+
* @reference https://developer.themoviedb.org/reference/tv-season-images
|
|
107
|
+
*/
|
|
108
|
+
async images(params) {
|
|
109
|
+
const { language = this.defaultOptions.language, include_image_language, ...rest } = params;
|
|
110
|
+
const endpoint = this.seasonSubPath(rest, ENDPOINTS.TV_SEASONS.IMAGES);
|
|
111
|
+
return this.client.request(endpoint, { language, include_image_language });
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Translations
|
|
115
|
+
* GET - https://api.themoviedb.org/3/tv/{series_id}/season/{season_number}/translations
|
|
116
|
+
*
|
|
117
|
+
* Get the translations that have been added to a TV season.
|
|
118
|
+
* Take a read through our language documentation for more information about languages on TMDB.
|
|
119
|
+
* https://developer.themoviedb.org/docs/languages
|
|
120
|
+
* @param series_id The ID of the TV series.
|
|
121
|
+
* @param season_number The season number within the TV show.
|
|
122
|
+
* @returns A promise that resolves to the TV season translations.
|
|
123
|
+
* @reference https://developer.themoviedb.org/reference/tv-season-translations
|
|
124
|
+
*/
|
|
125
|
+
async translations(params) {
|
|
126
|
+
const endpoint = this.seasonSubPath(params, ENDPOINTS.TV_SEASONS.TRANSLATIONS);
|
|
127
|
+
return this.client.request(endpoint);
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Videos
|
|
131
|
+
* GET - https://api.themoviedb.org/3/tv/{series_id}/season/{season_number}/videos
|
|
132
|
+
*
|
|
133
|
+
* Get the videos that belong to a TV season.
|
|
134
|
+
* @param series_id The ID of the TV series.
|
|
135
|
+
* @param season_number The season number within the TV show.
|
|
136
|
+
* @param language The language to use for the response.
|
|
137
|
+
* @param include_video_language A comma-separated list of language codes to include videos for.
|
|
138
|
+
* @returns A promise that resolves to the TV season videos.
|
|
139
|
+
* @reference https://developer.themoviedb.org/reference/tv-season-videos
|
|
140
|
+
*/
|
|
141
|
+
async videos(params) {
|
|
142
|
+
const { language = this.defaultOptions.language, include_video_language, ...rest } = params;
|
|
143
|
+
const endpoint = this.seasonSubPath(rest, ENDPOINTS.TV_SEASONS.VIDEOS);
|
|
144
|
+
return this.client.request(endpoint, { language, include_video_language });
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Watch Providers
|
|
148
|
+
* GET - https://api.themoviedb.org/3/tv/{series_id}/season/{season_number}/watch/providers
|
|
149
|
+
*
|
|
150
|
+
* Get the watch providers for a specific TV season.
|
|
151
|
+
* Powered by our partnership with JustWatch, you can query which streaming services
|
|
152
|
+
* have the season available.
|
|
153
|
+
* @param series_id The ID of the TV series.
|
|
154
|
+
* @param season_number The season number within the TV show.
|
|
155
|
+
* @param language The language to use for the response.
|
|
156
|
+
* @returns A promise that resolves to the TV season watch providers.
|
|
157
|
+
* @reference https://developer.themoviedb.org/reference/tv-season-watch-providers
|
|
158
|
+
*/
|
|
159
|
+
async watch_providers(params) {
|
|
160
|
+
const { language = this.defaultOptions.language, ...rest } = params;
|
|
161
|
+
const endpoint = this.seasonSubPath(rest, ENDPOINTS.TV_SEASONS.WATCH_PROVIDERS);
|
|
162
|
+
return this.client.request(endpoint, { language });
|
|
163
|
+
}
|
|
164
|
+
}
|