@lorenzopant/tmdb 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/endpoints/companies.d.ts +38 -0
- package/dist/endpoints/companies.d.ts.map +1 -0
- package/dist/endpoints/companies.js +49 -0
- package/dist/endpoints/genres.d.ts +0 -4
- package/dist/endpoints/genres.d.ts.map +1 -1
- package/dist/endpoints/genres.js +3 -6
- package/dist/endpoints/movie_lists.d.ts +0 -6
- package/dist/endpoints/movie_lists.d.ts.map +1 -1
- package/dist/endpoints/movie_lists.js +6 -13
- package/dist/endpoints/movies.d.ts +2 -17
- package/dist/endpoints/movies.d.ts.map +1 -1
- package/dist/endpoints/movies.js +22 -37
- package/dist/endpoints/search.d.ts +0 -9
- package/dist/endpoints/search.d.ts.map +1 -1
- package/dist/endpoints/search.js +6 -19
- package/dist/endpoints/tv_series.d.ts +2 -21
- package/dist/endpoints/tv_series.d.ts.map +1 -1
- package/dist/endpoints/tv_series.js +26 -40
- package/dist/endpoints/tv_series_lists.d.ts +0 -6
- package/dist/endpoints/tv_series_lists.d.ts.map +1 -1
- package/dist/endpoints/tv_series_lists.js +6 -13
- package/dist/routes.d.ts +64 -0
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +64 -0
- package/dist/tmdb.d.ts +2 -0
- package/dist/tmdb.d.ts.map +1 -1
- package/dist/tmdb.js +3 -0
- package/dist/types/common/media.d.ts +5 -1
- package/dist/types/common/media.d.ts.map +1 -1
- package/dist/types/other/companies.d.ts +81 -0
- package/dist/types/other/companies.d.ts.map +1 -0
- package/dist/types/other/companies.js +1 -0
- package/dist/types/other/index.d.ts +1 -0
- package/dist/types/other/index.d.ts.map +1 -1
- package/dist/types/other/index.js +1 -0
- package/dist/types/utility.d.ts +2 -0
- package/dist/types/utility.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Company, CompanyAlternativeNames, CompanyAlternativeNamesParams, CompanyImages, CompanyImagesParams, CompanyDetailsParams } from "../types/other/companies";
|
|
2
|
+
import { TMDBAPIBase } from "./base";
|
|
3
|
+
export declare class CompaniesAPI extends TMDBAPIBase {
|
|
4
|
+
private companyPath;
|
|
5
|
+
/**
|
|
6
|
+
* Details
|
|
7
|
+
* GET - https://api.themoviedb.org/3/company/{company_id}
|
|
8
|
+
*
|
|
9
|
+
* Get the company details by ID.
|
|
10
|
+
*
|
|
11
|
+
* @param company_id Unique identifier for the company
|
|
12
|
+
* @reference https://developer.themoviedb.org/reference/company-details
|
|
13
|
+
*/
|
|
14
|
+
details(params: CompanyDetailsParams): Promise<Company>;
|
|
15
|
+
/**
|
|
16
|
+
* Alternative names
|
|
17
|
+
* GET - https://api.themoviedb.org/3/company/{company_id}/alternative_names
|
|
18
|
+
*
|
|
19
|
+
* Get the list of alternative names for a company.
|
|
20
|
+
*
|
|
21
|
+
* @param company_id Unique identifier for the company
|
|
22
|
+
* @reference https://developer.themoviedb.org/reference/company-alternative-names
|
|
23
|
+
*/
|
|
24
|
+
alternativeNames(params: CompanyAlternativeNamesParams): Promise<CompanyAlternativeNames>;
|
|
25
|
+
/**
|
|
26
|
+
* Images
|
|
27
|
+
* GET - https://api.themoviedb.org/3/company/{company_id}/images
|
|
28
|
+
*
|
|
29
|
+
* Get the logos for a company by ID.
|
|
30
|
+
*
|
|
31
|
+
* @param company_id Unique identifier for the company
|
|
32
|
+
* @param language Language for the response
|
|
33
|
+
* @param include_image_language Additional language for images
|
|
34
|
+
* @reference https://developer.themoviedb.org/reference/company-images
|
|
35
|
+
*/
|
|
36
|
+
images(params: CompanyImagesParams): Promise<CompanyImages>;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=companies.d.ts.map
|
|
@@ -0,0 +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,0BAA0B,CAAC;AAClC,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,gBAAgB,CAAC,MAAM,EAAE,6BAA6B,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAK/F;;;;;;;;;;OAUG;IACG,MAAM,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,aAAa,CAAC;CAKjE"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ENDPOINTS } from "../routes";
|
|
2
|
+
import { TMDBAPIBase } from "./base";
|
|
3
|
+
export class CompaniesAPI extends TMDBAPIBase {
|
|
4
|
+
companyPath(company_id) {
|
|
5
|
+
return `${ENDPOINTS.COMPANIES.DETAILS}/${company_id}`;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Details
|
|
9
|
+
* GET - https://api.themoviedb.org/3/company/{company_id}
|
|
10
|
+
*
|
|
11
|
+
* Get the company details by ID.
|
|
12
|
+
*
|
|
13
|
+
* @param company_id Unique identifier for the company
|
|
14
|
+
* @reference https://developer.themoviedb.org/reference/company-details
|
|
15
|
+
*/
|
|
16
|
+
async details(params) {
|
|
17
|
+
const endpoint = this.companyPath(params.company_id);
|
|
18
|
+
return this.client.request(endpoint, params);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Alternative names
|
|
22
|
+
* GET - https://api.themoviedb.org/3/company/{company_id}/alternative_names
|
|
23
|
+
*
|
|
24
|
+
* Get the list of alternative names for a company.
|
|
25
|
+
*
|
|
26
|
+
* @param company_id Unique identifier for the company
|
|
27
|
+
* @reference https://developer.themoviedb.org/reference/company-alternative-names
|
|
28
|
+
*/
|
|
29
|
+
async alternativeNames(params) {
|
|
30
|
+
const endpoint = `${this.companyPath(params.company_id)}${ENDPOINTS.COMPANIES.ALTERNATIVE_NAMES}`;
|
|
31
|
+
return this.client.request(endpoint, params);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Images
|
|
35
|
+
* GET - https://api.themoviedb.org/3/company/{company_id}/images
|
|
36
|
+
*
|
|
37
|
+
* Get the logos for a company by ID.
|
|
38
|
+
*
|
|
39
|
+
* @param company_id Unique identifier for the company
|
|
40
|
+
* @param language Language for the response
|
|
41
|
+
* @param include_image_language Additional language for images
|
|
42
|
+
* @reference https://developer.themoviedb.org/reference/company-images
|
|
43
|
+
*/
|
|
44
|
+
async images(params) {
|
|
45
|
+
const endpoint = `${this.companyPath(params.company_id)}${ENDPOINTS.COMPANIES.IMAGES}`;
|
|
46
|
+
const requestParams = this.withLanguage(params) ?? params;
|
|
47
|
+
return this.client.request(endpoint, requestParams);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { WithLanguage } from "../types";
|
|
2
2
|
import { GenresResponse } from "../types/common/media";
|
|
3
3
|
import { TMDBAPIBase } from "./base";
|
|
4
|
-
export declare const GENRES_ENDPOINTS: {
|
|
5
|
-
MOVIE_LIST: string;
|
|
6
|
-
TV_LIST: string;
|
|
7
|
-
};
|
|
8
4
|
export declare class GenresAPI extends TMDBAPIBase {
|
|
9
5
|
/**
|
|
10
6
|
* Movie List
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"genres.d.ts","sourceRoot":"","sources":["../../src/endpoints/genres.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"genres.d.ts","sourceRoot":"","sources":["../../src/endpoints/genres.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,qBAAa,SAAU,SAAQ,WAAW;IACzC;;;;;;;;OAQG;IACG,UAAU,CAAC,MAAM,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC;IAIhE;;;;;;;;OAQG;IACG,OAAO,CAAC,MAAM,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC;CAG7D"}
|
package/dist/endpoints/genres.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
+
import { ENDPOINTS } from "../routes";
|
|
1
2
|
import { TMDBAPIBase } from "./base";
|
|
2
|
-
export const GENRES_ENDPOINTS = {
|
|
3
|
-
MOVIE_LIST: "/genre/movie/list",
|
|
4
|
-
TV_LIST: "/genre/tv/list",
|
|
5
|
-
};
|
|
6
3
|
export class GenresAPI extends TMDBAPIBase {
|
|
7
4
|
/**
|
|
8
5
|
* Movie List
|
|
@@ -14,7 +11,7 @@ export class GenresAPI extends TMDBAPIBase {
|
|
|
14
11
|
* @reference https://developer.themoviedb.org/reference/genre-movie-list
|
|
15
12
|
*/
|
|
16
13
|
async movie_list(params) {
|
|
17
|
-
return this.client.request(
|
|
14
|
+
return this.client.request(ENDPOINTS.GENRES.MOVIE_LIST, this.withLanguage(params));
|
|
18
15
|
}
|
|
19
16
|
/**
|
|
20
17
|
* TV List
|
|
@@ -26,6 +23,6 @@ export class GenresAPI extends TMDBAPIBase {
|
|
|
26
23
|
* @reference https://developer.themoviedb.org/reference/genre-tv-list
|
|
27
24
|
*/
|
|
28
25
|
async tv_list(params) {
|
|
29
|
-
return this.client.request(
|
|
26
|
+
return this.client.request(ENDPOINTS.GENRES.TV_LIST, this.withLanguage(params));
|
|
30
27
|
}
|
|
31
28
|
}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import { MovieResultItem, PaginatedResponse } from "../types";
|
|
2
2
|
import { MovieListParams } from "../types/movies";
|
|
3
3
|
import { TMDBAPIBase } from "./base";
|
|
4
|
-
export declare enum MovieListEndpoints {
|
|
5
|
-
NOW_PLAYING = "/now_playing",
|
|
6
|
-
POPULAR = "/popular",
|
|
7
|
-
TOP_RATED = "/top_rated",
|
|
8
|
-
UPCOMING = "/upcoming"
|
|
9
|
-
}
|
|
10
4
|
export declare class MovieListsAPI extends TMDBAPIBase {
|
|
11
5
|
private withDefaults;
|
|
12
6
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"movie_lists.d.ts","sourceRoot":"","sources":["../../src/endpoints/movie_lists.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"movie_lists.d.ts","sourceRoot":"","sources":["../../src/endpoints/movie_lists.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE9D,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,qBAAa,aAAc,SAAQ,WAAW;IAC7C,OAAO,CAAC,YAAY;IAKpB;;;;;OAKG;IACH,OAAO,CAAC,gBAAgB;IAIxB;;;;;;;;OAQG;IACG,WAAW,CAAC,MAAM,GAAE,eAAoB,GAAG,OAAO,CAAC,iBAAiB,CAAC,eAAe,CAAC,CAAC;IAI5F;;;;;;;;OAQG;IACG,OAAO,CAAC,MAAM,GAAE,eAAoB,GAAG,OAAO,CAAC,iBAAiB,CAAC,eAAe,CAAC,CAAC;IAIxF;;;;;;;;OAQG;IACG,SAAS,CAAC,MAAM,GAAE,eAAoB,GAAG,OAAO,CAAC,iBAAiB,CAAC,eAAe,CAAC,CAAC;IAI1F;;;;;;;;OAQG;IACG,QAAQ,CAAC,MAAM,GAAE,eAAoB,GAAG,OAAO,CAAC,iBAAiB,CAAC,eAAe,CAAC,CAAC;CAGzF"}
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
+
import { ENDPOINTS } from "../routes";
|
|
1
2
|
import { TMDBAPIBase } from "./base";
|
|
2
|
-
import { MOVIE_ENDPOINTS } from "./movies";
|
|
3
|
-
export var MovieListEndpoints;
|
|
4
|
-
(function (MovieListEndpoints) {
|
|
5
|
-
MovieListEndpoints["NOW_PLAYING"] = "/now_playing";
|
|
6
|
-
MovieListEndpoints["POPULAR"] = "/popular";
|
|
7
|
-
MovieListEndpoints["TOP_RATED"] = "/top_rated";
|
|
8
|
-
MovieListEndpoints["UPCOMING"] = "/upcoming";
|
|
9
|
-
})(MovieListEndpoints || (MovieListEndpoints = {}));
|
|
10
3
|
export class MovieListsAPI extends TMDBAPIBase {
|
|
11
4
|
withDefaults(params) {
|
|
12
5
|
const { language = this.defaultOptions.language, region = this.defaultOptions.region, ...rest } = params;
|
|
@@ -19,7 +12,7 @@ export class MovieListsAPI extends TMDBAPIBase {
|
|
|
19
12
|
* @returns Specific to endpoint (MovieListResult)
|
|
20
13
|
*/
|
|
21
14
|
fetch_movie_list(endpoint, params = {}) {
|
|
22
|
-
return this.client.request(
|
|
15
|
+
return this.client.request(ENDPOINTS.MOVIES.DETAILS + endpoint, this.withDefaults(params));
|
|
23
16
|
}
|
|
24
17
|
/**
|
|
25
18
|
* Now Playing
|
|
@@ -31,7 +24,7 @@ export class MovieListsAPI extends TMDBAPIBase {
|
|
|
31
24
|
* @param region ISO-3166-1 code
|
|
32
25
|
*/
|
|
33
26
|
async now_playing(params = {}) {
|
|
34
|
-
return this.fetch_movie_list(
|
|
27
|
+
return this.fetch_movie_list(ENDPOINTS.MOVIES.NOW_PLAYING, params);
|
|
35
28
|
}
|
|
36
29
|
/**
|
|
37
30
|
* Popular
|
|
@@ -43,7 +36,7 @@ export class MovieListsAPI extends TMDBAPIBase {
|
|
|
43
36
|
* @param region ISO-3166-1 code
|
|
44
37
|
*/
|
|
45
38
|
async popular(params = {}) {
|
|
46
|
-
return this.fetch_movie_list(
|
|
39
|
+
return this.fetch_movie_list(ENDPOINTS.MOVIES.POPULAR, params);
|
|
47
40
|
}
|
|
48
41
|
/**
|
|
49
42
|
* Top Rated
|
|
@@ -55,7 +48,7 @@ export class MovieListsAPI extends TMDBAPIBase {
|
|
|
55
48
|
* @param region ISO-3166-1 code
|
|
56
49
|
*/
|
|
57
50
|
async top_rated(params = {}) {
|
|
58
|
-
return this.fetch_movie_list(
|
|
51
|
+
return this.fetch_movie_list(ENDPOINTS.MOVIES.TOP_RATED, params);
|
|
59
52
|
}
|
|
60
53
|
/**
|
|
61
54
|
* Upcoming
|
|
@@ -67,6 +60,6 @@ export class MovieListsAPI extends TMDBAPIBase {
|
|
|
67
60
|
* @param region ISO-3166-1 code
|
|
68
61
|
*/
|
|
69
62
|
async upcoming(params = {}) {
|
|
70
|
-
return this.fetch_movie_list(
|
|
63
|
+
return this.fetch_movie_list(ENDPOINTS.MOVIES.UPCOMING, params);
|
|
71
64
|
}
|
|
72
65
|
}
|
|
@@ -4,27 +4,12 @@ import { TMDBOptions } from "../types/config";
|
|
|
4
4
|
import { MovieAlternativeTitles, MovieAppendToResponseNamespace, MovieCredits, MovieDetails, MovieDetailsWithAppends, MovieExternalIDs, MovieImages, MovieKeywords, MovieRecommendations, MovieReleaseDates, MovieReviews, MovieSimilar, MovieTranslations, MovieVideos } from "../types/movies";
|
|
5
5
|
import { MovieChanges } from "../types/movies/changes";
|
|
6
6
|
import { MovieAlternativeTitlesParams, MovieChangesParams, MovieCreditsParams, MovieDetailsParams, MovieExternalIDsParams, MovieImagesParams, MovieKeywordsParams, MovieRecommendationsParams, MovieReleaseDatesParams, MovieReviewsParams, MovieSimilarParams, MovieTranslationsParams, MovieVideosParams, MovieWatchProvidersParams } from "../types/movies/params";
|
|
7
|
-
export declare const MOVIE_ENDPOINTS: {
|
|
8
|
-
MOVIE: string;
|
|
9
|
-
ALTERNATIVE_TITLES: string;
|
|
10
|
-
CREDITS: string;
|
|
11
|
-
EXTERNAL_IDS: string;
|
|
12
|
-
KEYWORDS: string;
|
|
13
|
-
CHANGES: string;
|
|
14
|
-
IMAGES: string;
|
|
15
|
-
LATEST: string;
|
|
16
|
-
RECOMMENDATIONS: string;
|
|
17
|
-
RELEASE_DATES: string;
|
|
18
|
-
SIMILAR: string;
|
|
19
|
-
TRANSLATIONS: string;
|
|
20
|
-
VIDEOS: string;
|
|
21
|
-
WATCH_PROVIDERS: string;
|
|
22
|
-
REVIEWS: string;
|
|
23
|
-
};
|
|
24
7
|
export declare class MoviesAPI {
|
|
25
8
|
private client;
|
|
26
9
|
private defaultOptions;
|
|
27
10
|
constructor(client: ApiClient, options?: TMDBOptions);
|
|
11
|
+
private moviePath;
|
|
12
|
+
private movieSubPath;
|
|
28
13
|
/**
|
|
29
14
|
* Details
|
|
30
15
|
* GET - https://api.themoviedb.org/3/movie/{movie_id}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"movies.d.ts","sourceRoot":"","sources":["../../src/endpoints/movies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"movies.d.ts","sourceRoot":"","sources":["../../src/endpoints/movies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EACN,sBAAsB,EACtB,8BAA8B,EAC9B,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,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EACN,4BAA4B,EAC5B,kBAAkB,EAClB,kBAAkB,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,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,25 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
MOVIE: "/movie",
|
|
3
|
-
ALTERNATIVE_TITLES: "/alternative_titles",
|
|
4
|
-
CREDITS: "/credits",
|
|
5
|
-
EXTERNAL_IDS: "/external_ids",
|
|
6
|
-
KEYWORDS: "/keywords",
|
|
7
|
-
CHANGES: "/changes",
|
|
8
|
-
IMAGES: "/images",
|
|
9
|
-
LATEST: "/latest",
|
|
10
|
-
RECOMMENDATIONS: "/recommendations",
|
|
11
|
-
RELEASE_DATES: "/release_dates",
|
|
12
|
-
SIMILAR: "/similar",
|
|
13
|
-
TRANSLATIONS: "/translations",
|
|
14
|
-
VIDEOS: "/videos",
|
|
15
|
-
WATCH_PROVIDERS: "/watch/providers",
|
|
16
|
-
REVIEWS: "/reviews",
|
|
17
|
-
// Missing:
|
|
18
|
-
// ACCOUNT_STATES
|
|
19
|
-
// LISTS
|
|
20
|
-
// ADD RATING
|
|
21
|
-
// DELETE RATING
|
|
22
|
-
};
|
|
1
|
+
import { ENDPOINTS } from "../routes";
|
|
23
2
|
export class MoviesAPI {
|
|
24
3
|
client;
|
|
25
4
|
defaultOptions;
|
|
@@ -27,6 +6,12 @@ export class MoviesAPI {
|
|
|
27
6
|
this.client = client;
|
|
28
7
|
this.defaultOptions = options;
|
|
29
8
|
}
|
|
9
|
+
moviePath(movie_id) {
|
|
10
|
+
return `${ENDPOINTS.MOVIES.DETAILS}/${movie_id}`;
|
|
11
|
+
}
|
|
12
|
+
movieSubPath(movie_id, route) {
|
|
13
|
+
return `${this.moviePath(movie_id)}${route}`;
|
|
14
|
+
}
|
|
30
15
|
/**
|
|
31
16
|
* Details
|
|
32
17
|
* GET - https://api.themoviedb.org/3/movie/{movie_id}
|
|
@@ -40,7 +25,7 @@ export class MoviesAPI {
|
|
|
40
25
|
*/
|
|
41
26
|
async details(params) {
|
|
42
27
|
const { language = this.defaultOptions.language, ...rest } = params;
|
|
43
|
-
const endpoint =
|
|
28
|
+
const endpoint = this.moviePath(params.movie_id);
|
|
44
29
|
return this.client.request(endpoint, { language, ...rest });
|
|
45
30
|
}
|
|
46
31
|
/**
|
|
@@ -54,7 +39,7 @@ export class MoviesAPI {
|
|
|
54
39
|
* @reference https://developer.themoviedb.org/reference/movie-alternative-titles
|
|
55
40
|
*/
|
|
56
41
|
async alternative_titles(params) {
|
|
57
|
-
const endpoint =
|
|
42
|
+
const endpoint = this.movieSubPath(params.movie_id, ENDPOINTS.MOVIES.ALTERNATIVE_TITLES);
|
|
58
43
|
return this.client.request(endpoint, params);
|
|
59
44
|
}
|
|
60
45
|
/**
|
|
@@ -68,7 +53,7 @@ export class MoviesAPI {
|
|
|
68
53
|
* @reference https://developer.themoviedb.org/reference/movie-credits
|
|
69
54
|
*/
|
|
70
55
|
async credits(params) {
|
|
71
|
-
const endpoint =
|
|
56
|
+
const endpoint = this.movieSubPath(params.movie_id, ENDPOINTS.MOVIES.CREDITS);
|
|
72
57
|
const { language = this.defaultOptions.language, ...rest } = params;
|
|
73
58
|
return this.client.request(endpoint, { language, ...rest });
|
|
74
59
|
}
|
|
@@ -84,7 +69,7 @@ export class MoviesAPI {
|
|
|
84
69
|
* @reference https://developer.themoviedb.org/reference/movie-external-ids
|
|
85
70
|
*/
|
|
86
71
|
async external_ids(params) {
|
|
87
|
-
const endpoint =
|
|
72
|
+
const endpoint = this.movieSubPath(params.movie_id, ENDPOINTS.MOVIES.EXTERNAL_IDS);
|
|
88
73
|
return this.client.request(endpoint);
|
|
89
74
|
}
|
|
90
75
|
/**
|
|
@@ -98,7 +83,7 @@ export class MoviesAPI {
|
|
|
98
83
|
* @reference https://developer.themoviedb.org/reference/movie-keywords
|
|
99
84
|
*/
|
|
100
85
|
async keywords(params) {
|
|
101
|
-
const endpoint =
|
|
86
|
+
const endpoint = this.movieSubPath(params.movie_id, ENDPOINTS.MOVIES.KEYWORDS);
|
|
102
87
|
return this.client.request(endpoint);
|
|
103
88
|
}
|
|
104
89
|
/**
|
|
@@ -116,7 +101,7 @@ export class MoviesAPI {
|
|
|
116
101
|
* @reference https://developer.themoviedb.org/reference/movie-changes
|
|
117
102
|
*/
|
|
118
103
|
async changes(params) {
|
|
119
|
-
const endpoint =
|
|
104
|
+
const endpoint = this.movieSubPath(params.movie_id, ENDPOINTS.MOVIES.CHANGES);
|
|
120
105
|
return this.client.request(endpoint, params);
|
|
121
106
|
}
|
|
122
107
|
/**
|
|
@@ -136,7 +121,7 @@ export class MoviesAPI {
|
|
|
136
121
|
*/
|
|
137
122
|
async images(params) {
|
|
138
123
|
const { language = this.defaultOptions.language, ...rest } = params;
|
|
139
|
-
const endpoint =
|
|
124
|
+
const endpoint = this.movieSubPath(params.movie_id, ENDPOINTS.MOVIES.IMAGES);
|
|
140
125
|
return this.client.request(endpoint, { language, ...rest });
|
|
141
126
|
}
|
|
142
127
|
/**
|
|
@@ -149,7 +134,7 @@ export class MoviesAPI {
|
|
|
149
134
|
* @reference https://developer.themoviedb.org/reference/movie-latest-id
|
|
150
135
|
*/
|
|
151
136
|
async latest() {
|
|
152
|
-
const endpoint = `${
|
|
137
|
+
const endpoint = `${ENDPOINTS.MOVIES.DETAILS}${ENDPOINTS.MOVIES.LATEST}`;
|
|
153
138
|
return this.client.request(endpoint);
|
|
154
139
|
}
|
|
155
140
|
/**
|
|
@@ -166,7 +151,7 @@ export class MoviesAPI {
|
|
|
166
151
|
*/
|
|
167
152
|
async recommendations(params) {
|
|
168
153
|
const { language = this.defaultOptions.language, ...rest } = params;
|
|
169
|
-
const endpoint =
|
|
154
|
+
const endpoint = this.movieSubPath(params.movie_id, ENDPOINTS.MOVIES.RECOMMENDATIONS);
|
|
170
155
|
return this.client.request(endpoint, { language, ...rest });
|
|
171
156
|
}
|
|
172
157
|
/**
|
|
@@ -186,7 +171,7 @@ export class MoviesAPI {
|
|
|
186
171
|
* @reference https://developer.themoviedb.org/reference/movie-release-dates
|
|
187
172
|
*/
|
|
188
173
|
async release_dates(params) {
|
|
189
|
-
const endpoint =
|
|
174
|
+
const endpoint = this.movieSubPath(params.movie_id, ENDPOINTS.MOVIES.RELEASE_DATES);
|
|
190
175
|
return this.client.request(endpoint);
|
|
191
176
|
}
|
|
192
177
|
/**
|
|
@@ -202,7 +187,7 @@ export class MoviesAPI {
|
|
|
202
187
|
*/
|
|
203
188
|
async reviews(params) {
|
|
204
189
|
const { language = this.defaultOptions.language, ...rest } = params;
|
|
205
|
-
const endpoint =
|
|
190
|
+
const endpoint = this.movieSubPath(params.movie_id, ENDPOINTS.MOVIES.REVIEWS);
|
|
206
191
|
return this.client.request(endpoint, { language, ...rest });
|
|
207
192
|
}
|
|
208
193
|
/**
|
|
@@ -220,7 +205,7 @@ export class MoviesAPI {
|
|
|
220
205
|
*/
|
|
221
206
|
async similar(params) {
|
|
222
207
|
const { language = this.defaultOptions.language, ...rest } = params;
|
|
223
|
-
const endpoint =
|
|
208
|
+
const endpoint = this.movieSubPath(params.movie_id, ENDPOINTS.MOVIES.SIMILAR);
|
|
224
209
|
return this.client.request(endpoint, { language, ...rest });
|
|
225
210
|
}
|
|
226
211
|
/**
|
|
@@ -235,7 +220,7 @@ export class MoviesAPI {
|
|
|
235
220
|
* @reference https://developer.themoviedb.org/reference/movie-translations
|
|
236
221
|
*/
|
|
237
222
|
async translations(params) {
|
|
238
|
-
const endpoint =
|
|
223
|
+
const endpoint = this.movieSubPath(params.movie_id, ENDPOINTS.MOVIES.TRANSLATIONS);
|
|
239
224
|
return this.client.request(endpoint);
|
|
240
225
|
}
|
|
241
226
|
/**
|
|
@@ -249,7 +234,7 @@ export class MoviesAPI {
|
|
|
249
234
|
*/
|
|
250
235
|
async videos(params) {
|
|
251
236
|
const { language = this.defaultOptions.language, ...rest } = params;
|
|
252
|
-
const endpoint =
|
|
237
|
+
const endpoint = this.movieSubPath(params.movie_id, ENDPOINTS.MOVIES.VIDEOS);
|
|
253
238
|
return this.client.request(endpoint, { language, ...rest });
|
|
254
239
|
}
|
|
255
240
|
/**
|
|
@@ -269,7 +254,7 @@ export class MoviesAPI {
|
|
|
269
254
|
* @reference https://developer.themoviedb.org/reference/movie-videos
|
|
270
255
|
*/
|
|
271
256
|
async watch_providers(params) {
|
|
272
|
-
const endpoint =
|
|
257
|
+
const endpoint = this.movieSubPath(params.movie_id, ENDPOINTS.MOVIES.WATCH_PROVIDERS);
|
|
273
258
|
return this.client.request(endpoint);
|
|
274
259
|
}
|
|
275
260
|
}
|
|
@@ -5,15 +5,6 @@ import { CompanyResultItem } from "../types/search/company";
|
|
|
5
5
|
import { KeywordResultItem } from "../types/search/keyword";
|
|
6
6
|
import { TMDBAPIBase } from "./base";
|
|
7
7
|
import { PersonResultItem } from "../types/search/person";
|
|
8
|
-
export declare const SEARCH_ENDPOINTS: {
|
|
9
|
-
MOVIE: string;
|
|
10
|
-
COLLECTION: string;
|
|
11
|
-
COMPANY: string;
|
|
12
|
-
KEYWORD: string;
|
|
13
|
-
MULTI: string;
|
|
14
|
-
PERSON: string;
|
|
15
|
-
TV: string;
|
|
16
|
-
};
|
|
17
8
|
export declare class SearchAPI extends TMDBAPIBase {
|
|
18
9
|
/**
|
|
19
10
|
* Search Collection
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/endpoints/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/endpoints/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE9D,OAAO,EACN,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,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"}
|
package/dist/endpoints/search.js
CHANGED
|
@@ -1,13 +1,5 @@
|
|
|
1
|
+
import { ENDPOINTS } from "../routes";
|
|
1
2
|
import { TMDBAPIBase } from "./base";
|
|
2
|
-
export const SEARCH_ENDPOINTS = {
|
|
3
|
-
MOVIE: "/search/movie",
|
|
4
|
-
COLLECTION: "/search/collection",
|
|
5
|
-
COMPANY: "/search/company",
|
|
6
|
-
KEYWORD: "/search/keyword",
|
|
7
|
-
MULTI: "/search/multi",
|
|
8
|
-
PERSON: "/search/person",
|
|
9
|
-
TV: "/search/tv",
|
|
10
|
-
};
|
|
11
3
|
export class SearchAPI extends TMDBAPIBase {
|
|
12
4
|
/**
|
|
13
5
|
* Search Collection
|
|
@@ -22,8 +14,7 @@ export class SearchAPI extends TMDBAPIBase {
|
|
|
22
14
|
* @reference https://developer.themoviedb.org/reference/search-collection
|
|
23
15
|
*/
|
|
24
16
|
async collections(params) {
|
|
25
|
-
|
|
26
|
-
return this.client.request(endpoint, this.applyDefaults(params));
|
|
17
|
+
return this.client.request(ENDPOINTS.SEARCH.COLLECTION, this.applyDefaults(params));
|
|
27
18
|
}
|
|
28
19
|
/**
|
|
29
20
|
* Search Movies
|
|
@@ -40,8 +31,7 @@ export class SearchAPI extends TMDBAPIBase {
|
|
|
40
31
|
* @reference https://developer.themoviedb.org/reference/search-movie
|
|
41
32
|
*/
|
|
42
33
|
async movies(params) {
|
|
43
|
-
|
|
44
|
-
return this.client.request(endpoint, this.applyDefaults(params));
|
|
34
|
+
return this.client.request(ENDPOINTS.SEARCH.MOVIE, this.applyDefaults(params));
|
|
45
35
|
}
|
|
46
36
|
/**
|
|
47
37
|
* Search Company
|
|
@@ -53,8 +43,7 @@ export class SearchAPI extends TMDBAPIBase {
|
|
|
53
43
|
* @reference https://developer.themoviedb.org/reference/search-company
|
|
54
44
|
*/
|
|
55
45
|
async company(params) {
|
|
56
|
-
|
|
57
|
-
return this.client.request(endpoint, this.applyDefaults(params));
|
|
46
|
+
return this.client.request(ENDPOINTS.SEARCH.COMPANY, this.applyDefaults(params));
|
|
58
47
|
}
|
|
59
48
|
/**
|
|
60
49
|
* Search Keyword
|
|
@@ -66,8 +55,7 @@ export class SearchAPI extends TMDBAPIBase {
|
|
|
66
55
|
* @reference https://developer.themoviedb.org/reference/search-keyword
|
|
67
56
|
*/
|
|
68
57
|
async keyword(params) {
|
|
69
|
-
|
|
70
|
-
return this.client.request(endpoint, this.applyDefaults(params));
|
|
58
|
+
return this.client.request(ENDPOINTS.SEARCH.KEYWORD, this.applyDefaults(params));
|
|
71
59
|
}
|
|
72
60
|
/**
|
|
73
61
|
* Search Person
|
|
@@ -79,7 +67,6 @@ export class SearchAPI extends TMDBAPIBase {
|
|
|
79
67
|
* @reference https://developer.themoviedb.org/reference/search-person
|
|
80
68
|
*/
|
|
81
69
|
async person(params) {
|
|
82
|
-
|
|
83
|
-
return this.client.request(endpoint, this.applyDefaults(params));
|
|
70
|
+
return this.client.request(ENDPOINTS.SEARCH.PERSON, this.applyDefaults(params));
|
|
84
71
|
}
|
|
85
72
|
}
|
|
@@ -8,28 +8,9 @@ import { TVReviews } from "../types/tv/reviews";
|
|
|
8
8
|
import { TVScreenedTheatrically } from "../types/tv/screened_theatrically";
|
|
9
9
|
import { TVAppendToResponseNamespace, TVSeriesDetails, TVDetailsWithAppends } from "../types/tv/tv_series";
|
|
10
10
|
import { TMDBAPIBase } from "./base";
|
|
11
|
-
export declare const TV_SERIES_ENDPOINTS: {
|
|
12
|
-
TV: string;
|
|
13
|
-
TV_AGGREGATE_CREDITS: string;
|
|
14
|
-
TV_ALTERNATIVE_TITLES: string;
|
|
15
|
-
TV_CHANGES: string;
|
|
16
|
-
TV_CONTENT_RATINGS: string;
|
|
17
|
-
TV_CREDITS: string;
|
|
18
|
-
TV_EPISODE_GROUPS: string;
|
|
19
|
-
TV_EXTERNAL_IDS: string;
|
|
20
|
-
TV_IMAGES: string;
|
|
21
|
-
TV_KEYWORDS: string;
|
|
22
|
-
TV_LATEST: string;
|
|
23
|
-
TV_LISTS: string;
|
|
24
|
-
TV_RECOMMENDATIONS: string;
|
|
25
|
-
TV_REVIEWS: string;
|
|
26
|
-
TV_SCREENED_THEATRICALLY: string;
|
|
27
|
-
TV_SIMILAR: string;
|
|
28
|
-
TV_TRANSLATIONS: string;
|
|
29
|
-
TV_VIDEOS: string;
|
|
30
|
-
TV_WATCH_PROVIDERS: string;
|
|
31
|
-
};
|
|
32
11
|
export declare class TVSeriesAPI extends TMDBAPIBase {
|
|
12
|
+
private seriesPath;
|
|
13
|
+
private seriesSubPath;
|
|
33
14
|
/**
|
|
34
15
|
* Details
|
|
35
16
|
* GET - https://api.themoviedb.org/3/tv/{series_id}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tv_series.d.ts","sourceRoot":"","sources":["../../src/endpoints/tv_series.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"tv_series.d.ts","sourceRoot":"","sources":["../../src/endpoints/tv_series.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C,OAAO,EACN,wBAAwB,EACxB,mBAAmB,EACnB,WAAW,EACX,cAAc,EACd,SAAS,EACT,eAAe,EACf,eAAe,EACf,aAAa,EACb,QAAQ,EACR,cAAc,EACd,UAAU,EACV,iBAAiB,EACjB,uBAAuB,EACvB,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,SAAS,EACT,eAAe,EACf,cAAc,EACd,QAAQ,EACR,MA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 +1,12 @@
|
|
|
1
|
+
import { ENDPOINTS } from "../routes";
|
|
1
2
|
import { TMDBAPIBase } from "./base";
|
|
2
|
-
export const TV_SERIES_ENDPOINTS = {
|
|
3
|
-
TV: "/tv",
|
|
4
|
-
TV_AGGREGATE_CREDITS: "/aggregate_credits",
|
|
5
|
-
TV_ALTERNATIVE_TITLES: "/alternative_titles",
|
|
6
|
-
TV_CHANGES: "/changes",
|
|
7
|
-
TV_CONTENT_RATINGS: "/content_ratings",
|
|
8
|
-
TV_CREDITS: "/credits",
|
|
9
|
-
TV_EPISODE_GROUPS: "/episode_groups",
|
|
10
|
-
TV_EXTERNAL_IDS: "/external_ids",
|
|
11
|
-
TV_IMAGES: "/images",
|
|
12
|
-
TV_KEYWORDS: "/keywords",
|
|
13
|
-
TV_LATEST: "/latest",
|
|
14
|
-
TV_LISTS: "/lists",
|
|
15
|
-
TV_RECOMMENDATIONS: "/recommendations",
|
|
16
|
-
TV_REVIEWS: "/reviews",
|
|
17
|
-
TV_SCREENED_THEATRICALLY: "/screened_theatrically",
|
|
18
|
-
TV_SIMILAR: "/similar",
|
|
19
|
-
TV_TRANSLATIONS: "/translations",
|
|
20
|
-
TV_VIDEOS: "/videos",
|
|
21
|
-
TV_WATCH_PROVIDERS: "/watch/providers",
|
|
22
|
-
};
|
|
23
3
|
export class TVSeriesAPI extends TMDBAPIBase {
|
|
4
|
+
seriesPath(series_id) {
|
|
5
|
+
return `${ENDPOINTS.TV_SERIES.DETAILS}/${series_id}`;
|
|
6
|
+
}
|
|
7
|
+
seriesSubPath(series_id, route) {
|
|
8
|
+
return `${this.seriesPath(series_id)}${route}`;
|
|
9
|
+
}
|
|
24
10
|
/**
|
|
25
11
|
* Details
|
|
26
12
|
* GET - https://api.themoviedb.org/3/tv/{series_id}
|
|
@@ -34,7 +20,7 @@ export class TVSeriesAPI extends TMDBAPIBase {
|
|
|
34
20
|
*/
|
|
35
21
|
async details(params) {
|
|
36
22
|
const { language = this.defaultOptions.language, ...rest } = params;
|
|
37
|
-
const endpoint =
|
|
23
|
+
const endpoint = this.seriesPath(params.series_id);
|
|
38
24
|
return this.client.request(endpoint, { language, ...rest });
|
|
39
25
|
}
|
|
40
26
|
/**
|
|
@@ -52,7 +38,7 @@ export class TVSeriesAPI extends TMDBAPIBase {
|
|
|
52
38
|
*/
|
|
53
39
|
async aggregate_credits(params) {
|
|
54
40
|
const { language = this.defaultOptions.language, ...rest } = params;
|
|
55
|
-
const endpoint =
|
|
41
|
+
const endpoint = this.seriesSubPath(params.series_id, ENDPOINTS.TV_SERIES.AGGREGATE_CREDITS);
|
|
56
42
|
return this.client.request(endpoint, { language, ...rest });
|
|
57
43
|
}
|
|
58
44
|
/**
|
|
@@ -65,7 +51,7 @@ export class TVSeriesAPI extends TMDBAPIBase {
|
|
|
65
51
|
* @reference https://developer.themoviedb.org/reference/tv-series-alternative-titles
|
|
66
52
|
*/
|
|
67
53
|
async alternative_titles(params) {
|
|
68
|
-
const endpoint =
|
|
54
|
+
const endpoint = this.seriesSubPath(params.series_id, ENDPOINTS.TV_SERIES.ALTERNATIVE_TITLES);
|
|
69
55
|
return this.client.request(endpoint);
|
|
70
56
|
}
|
|
71
57
|
/**
|
|
@@ -86,7 +72,7 @@ export class TVSeriesAPI extends TMDBAPIBase {
|
|
|
86
72
|
* @reference https://developer.themoviedb.org/reference/tv-series-changes
|
|
87
73
|
*/
|
|
88
74
|
async changes(params) {
|
|
89
|
-
const endpoint =
|
|
75
|
+
const endpoint = this.seriesSubPath(params.series_id, ENDPOINTS.TV_SERIES.CHANGES);
|
|
90
76
|
return this.client.request(endpoint, { ...params });
|
|
91
77
|
}
|
|
92
78
|
/**
|
|
@@ -99,7 +85,7 @@ export class TVSeriesAPI extends TMDBAPIBase {
|
|
|
99
85
|
* @reference https://developer.themoviedb.org/reference/tv-series-content-ratings
|
|
100
86
|
*/
|
|
101
87
|
async content_ratings(params) {
|
|
102
|
-
const endpoint =
|
|
88
|
+
const endpoint = this.seriesSubPath(params.series_id, ENDPOINTS.TV_SERIES.CONTENT_RATINGS);
|
|
103
89
|
return this.client.request(endpoint);
|
|
104
90
|
}
|
|
105
91
|
/**
|
|
@@ -117,7 +103,7 @@ export class TVSeriesAPI extends TMDBAPIBase {
|
|
|
117
103
|
* @reference https://developer.themoviedb.org/reference/tv-series-credits
|
|
118
104
|
*/
|
|
119
105
|
async credits(params) {
|
|
120
|
-
const endpoint =
|
|
106
|
+
const endpoint = this.seriesSubPath(params.series_id, ENDPOINTS.TV_SERIES.CREDITS);
|
|
121
107
|
const { language = this.defaultOptions.language, ...rest } = params;
|
|
122
108
|
return this.client.request(endpoint, { language, ...rest });
|
|
123
109
|
}
|
|
@@ -132,7 +118,7 @@ export class TVSeriesAPI extends TMDBAPIBase {
|
|
|
132
118
|
* @reference https://developer.themoviedb.org/reference/tv-series-episode-groups
|
|
133
119
|
*/
|
|
134
120
|
async episode_groups(params) {
|
|
135
|
-
const endpoint =
|
|
121
|
+
const endpoint = this.seriesSubPath(params.series_id, ENDPOINTS.TV_SERIES.EPISODE_GROUPS);
|
|
136
122
|
return this.client.request(endpoint);
|
|
137
123
|
}
|
|
138
124
|
/**
|
|
@@ -145,7 +131,7 @@ export class TVSeriesAPI extends TMDBAPIBase {
|
|
|
145
131
|
* @reference https://developer.themoviedb.org/reference/tv-series-external-ids
|
|
146
132
|
*/
|
|
147
133
|
async external_ids(params) {
|
|
148
|
-
const endpoint =
|
|
134
|
+
const endpoint = this.seriesSubPath(params.series_id, ENDPOINTS.TV_SERIES.EXTERNAL_IDS);
|
|
149
135
|
return this.client.request(endpoint);
|
|
150
136
|
}
|
|
151
137
|
/**
|
|
@@ -165,7 +151,7 @@ export class TVSeriesAPI extends TMDBAPIBase {
|
|
|
165
151
|
*/
|
|
166
152
|
async images(params) {
|
|
167
153
|
const { language = this.defaultOptions.language, ...rest } = params;
|
|
168
|
-
const endpoint =
|
|
154
|
+
const endpoint = this.seriesSubPath(params.series_id, ENDPOINTS.TV_SERIES.IMAGES);
|
|
169
155
|
return this.client.request(endpoint, { language, ...rest });
|
|
170
156
|
}
|
|
171
157
|
/**
|
|
@@ -178,7 +164,7 @@ export class TVSeriesAPI extends TMDBAPIBase {
|
|
|
178
164
|
* @reference https://developer.themoviedb.org/reference/tv-series-keywords
|
|
179
165
|
*/
|
|
180
166
|
async keywords(params) {
|
|
181
|
-
const endpoint =
|
|
167
|
+
const endpoint = this.seriesSubPath(params.series_id, ENDPOINTS.TV_SERIES.KEYWORDS);
|
|
182
168
|
return this.client.request(endpoint);
|
|
183
169
|
}
|
|
184
170
|
/**
|
|
@@ -191,7 +177,7 @@ export class TVSeriesAPI extends TMDBAPIBase {
|
|
|
191
177
|
* @reference https://developer.themoviedb.org/reference/tv-series-latest-id
|
|
192
178
|
*/
|
|
193
179
|
async latest() {
|
|
194
|
-
const endpoint = `${
|
|
180
|
+
const endpoint = `${ENDPOINTS.TV_SERIES.DETAILS}${ENDPOINTS.TV_SERIES.LATEST}`;
|
|
195
181
|
return this.client.request(endpoint);
|
|
196
182
|
}
|
|
197
183
|
/**
|
|
@@ -206,7 +192,7 @@ export class TVSeriesAPI extends TMDBAPIBase {
|
|
|
206
192
|
* @reference https://developer.themoviedb.org/reference/lists-copy (TODO: Check this url for updates, it's like this on TMDB docs (??))
|
|
207
193
|
*/
|
|
208
194
|
async lists(params) {
|
|
209
|
-
const endpoint =
|
|
195
|
+
const endpoint = this.seriesSubPath(params.series_id, ENDPOINTS.TV_SERIES.LISTS);
|
|
210
196
|
const { language = this.defaultOptions.language, ...rest } = params;
|
|
211
197
|
return this.client.request(endpoint, { language, ...rest });
|
|
212
198
|
}
|
|
@@ -222,7 +208,7 @@ export class TVSeriesAPI extends TMDBAPIBase {
|
|
|
222
208
|
* @reference https://developer.themoviedb.org/reference/tv-series-recommendations
|
|
223
209
|
*/
|
|
224
210
|
async recommendations(params) {
|
|
225
|
-
const endpoint =
|
|
211
|
+
const endpoint = this.seriesSubPath(params.series_id, ENDPOINTS.TV_SERIES.RECOMMENDATIONS);
|
|
226
212
|
const { language = this.defaultOptions.language, ...rest } = params;
|
|
227
213
|
return this.client.request(endpoint, { language, ...rest });
|
|
228
214
|
}
|
|
@@ -238,7 +224,7 @@ export class TVSeriesAPI extends TMDBAPIBase {
|
|
|
238
224
|
* @reference https://developer.themoviedb.org/reference/tv-series-recommendations
|
|
239
225
|
*/
|
|
240
226
|
async reviews(params) {
|
|
241
|
-
const endpoint =
|
|
227
|
+
const endpoint = this.seriesSubPath(params.series_id, ENDPOINTS.TV_SERIES.REVIEWS);
|
|
242
228
|
const { language = this.defaultOptions.language, ...rest } = params;
|
|
243
229
|
return this.client.request(endpoint, { language, ...rest });
|
|
244
230
|
}
|
|
@@ -252,7 +238,7 @@ export class TVSeriesAPI extends TMDBAPIBase {
|
|
|
252
238
|
* @reference https://developer.themoviedb.org/reference/tv-series-screened-theatrically
|
|
253
239
|
*/
|
|
254
240
|
async screened_theatrically(params) {
|
|
255
|
-
const endpoint =
|
|
241
|
+
const endpoint = this.seriesSubPath(params.series_id, ENDPOINTS.TV_SERIES.SCREENED_THEATRICALLY);
|
|
256
242
|
return this.client.request(endpoint);
|
|
257
243
|
}
|
|
258
244
|
/**
|
|
@@ -267,7 +253,7 @@ export class TVSeriesAPI extends TMDBAPIBase {
|
|
|
267
253
|
* @reference https://developer.themoviedb.org/reference/tv-series-similar
|
|
268
254
|
*/
|
|
269
255
|
async similar(params) {
|
|
270
|
-
const endpoint =
|
|
256
|
+
const endpoint = this.seriesSubPath(params.series_id, ENDPOINTS.TV_SERIES.SIMILAR);
|
|
271
257
|
const { language = this.defaultOptions.language, ...rest } = params;
|
|
272
258
|
return this.client.request(endpoint, { language, ...rest });
|
|
273
259
|
}
|
|
@@ -283,7 +269,7 @@ export class TVSeriesAPI extends TMDBAPIBase {
|
|
|
283
269
|
* @reference https://developer.themoviedb.org/reference/tv-series-translations
|
|
284
270
|
*/
|
|
285
271
|
async translations(params) {
|
|
286
|
-
const endpoint =
|
|
272
|
+
const endpoint = this.seriesSubPath(params.series_id, ENDPOINTS.TV_SERIES.TRANSLATIONS);
|
|
287
273
|
return this.client.request(endpoint);
|
|
288
274
|
}
|
|
289
275
|
/**
|
|
@@ -296,7 +282,7 @@ export class TVSeriesAPI extends TMDBAPIBase {
|
|
|
296
282
|
* @reference https://developer.themoviedb.org/reference/tv-series-videos
|
|
297
283
|
*/
|
|
298
284
|
async videos(params) {
|
|
299
|
-
const endpoint =
|
|
285
|
+
const endpoint = this.seriesSubPath(params.series_id, ENDPOINTS.TV_SERIES.VIDEOS);
|
|
300
286
|
return this.client.request(endpoint);
|
|
301
287
|
}
|
|
302
288
|
/**
|
|
@@ -318,7 +304,7 @@ export class TVSeriesAPI extends TMDBAPIBase {
|
|
|
318
304
|
* @reference https://developer.themoviedb.org/reference/tv-series-watch-providers
|
|
319
305
|
*/
|
|
320
306
|
async watch_providers(params) {
|
|
321
|
-
const endpoint =
|
|
307
|
+
const endpoint = this.seriesSubPath(params.series_id, ENDPOINTS.TV_SERIES.WATCH_PROVIDERS);
|
|
322
308
|
return this.client.request(endpoint);
|
|
323
309
|
}
|
|
324
310
|
}
|
|
@@ -2,12 +2,6 @@ import { ApiClient } from "../client";
|
|
|
2
2
|
import { PaginatedResponse, TVSeriesResultItem } from "../types";
|
|
3
3
|
import { TMDBOptions } from "../types/config";
|
|
4
4
|
import { TVSeriesListParams } from "../types/tv";
|
|
5
|
-
export declare enum TVSeriesListEndpoints {
|
|
6
|
-
AIRING_TODAY = "/airing_today",
|
|
7
|
-
ON_THE_AIR = "/on_the_air",
|
|
8
|
-
TOP_RATED = "/top_rated",
|
|
9
|
-
POPULAR = "/popular"
|
|
10
|
-
}
|
|
11
5
|
export declare class TVSeriesListsAPI {
|
|
12
6
|
private client;
|
|
13
7
|
private defaultOptions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tv_series_lists.d.ts","sourceRoot":"","sources":["../../src/endpoints/tv_series_lists.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"tv_series_lists.d.ts","sourceRoot":"","sources":["../../src/endpoints/tv_series_lists.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAEjE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,qBAAa,gBAAgB;IAC5B,OAAO,CAAC,MAAM,CAAY;IAC1B,OAAO,CAAC,cAAc,CAAc;gBAExB,MAAM,EAAE,SAAS,EAAE,cAAc,GAAE,WAAgB;IAK/D,OAAO,CAAC,YAAY;IAKpB;;;;;OAKG;IACH,OAAO,CAAC,oBAAoB;IAI5B;;;;;;;;OAQG;IACG,YAAY,CAAC,MAAM,GAAE,kBAAuB,GAAG,OAAO,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,CAAC;IAInG;;;;;;;;OAQG;IACG,UAAU,CAAC,MAAM,GAAE,kBAAuB,GAAG,OAAO,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,CAAC;IAIjG;;;;;;;OAOG;IACG,OAAO,CAAC,MAAM,GAAE,kBAAuB,GAAG,OAAO,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,CAAC;IAI9F;;;;;;;OAOG;IACG,SAAS,CAAC,MAAM,GAAE,kBAAuB,GAAG,OAAO,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,CAAC;CAGhG"}
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export var TVSeriesListEndpoints;
|
|
3
|
-
(function (TVSeriesListEndpoints) {
|
|
4
|
-
TVSeriesListEndpoints["AIRING_TODAY"] = "/airing_today";
|
|
5
|
-
TVSeriesListEndpoints["ON_THE_AIR"] = "/on_the_air";
|
|
6
|
-
TVSeriesListEndpoints["TOP_RATED"] = "/top_rated";
|
|
7
|
-
TVSeriesListEndpoints["POPULAR"] = "/popular";
|
|
8
|
-
})(TVSeriesListEndpoints || (TVSeriesListEndpoints = {}));
|
|
1
|
+
import { ENDPOINTS } from "../routes";
|
|
9
2
|
export class TVSeriesListsAPI {
|
|
10
3
|
client;
|
|
11
4
|
defaultOptions;
|
|
@@ -24,7 +17,7 @@ export class TVSeriesListsAPI {
|
|
|
24
17
|
* @returns PaginatedResponse of TVSeriesResultItem
|
|
25
18
|
*/
|
|
26
19
|
fetch_tv_series_list(endpoint, params = {}) {
|
|
27
|
-
return this.client.request(
|
|
20
|
+
return this.client.request(ENDPOINTS.TV_SERIES.DETAILS + endpoint, this.withDefaults(params));
|
|
28
21
|
}
|
|
29
22
|
/**
|
|
30
23
|
* Airing Today
|
|
@@ -36,7 +29,7 @@ export class TVSeriesListsAPI {
|
|
|
36
29
|
* @param timezone Timezone for the "today"
|
|
37
30
|
*/
|
|
38
31
|
async airing_today(params = {}) {
|
|
39
|
-
return this.fetch_tv_series_list(
|
|
32
|
+
return this.fetch_tv_series_list(ENDPOINTS.TV_SERIES.AIRING_TODAY, params);
|
|
40
33
|
}
|
|
41
34
|
/**
|
|
42
35
|
* On The Air
|
|
@@ -48,7 +41,7 @@ export class TVSeriesListsAPI {
|
|
|
48
41
|
* @param timezone Timezone for the "today"
|
|
49
42
|
*/
|
|
50
43
|
async on_the_air(params = {}) {
|
|
51
|
-
return this.fetch_tv_series_list(
|
|
44
|
+
return this.fetch_tv_series_list(ENDPOINTS.TV_SERIES.ON_THE_AIR, params);
|
|
52
45
|
}
|
|
53
46
|
/**
|
|
54
47
|
* Popular
|
|
@@ -59,7 +52,7 @@ export class TVSeriesListsAPI {
|
|
|
59
52
|
* @param page Page (Defaults to 1)
|
|
60
53
|
*/
|
|
61
54
|
async popular(params = {}) {
|
|
62
|
-
return this.fetch_tv_series_list(
|
|
55
|
+
return this.fetch_tv_series_list(ENDPOINTS.TV_SERIES.POPULAR, params);
|
|
63
56
|
}
|
|
64
57
|
/**
|
|
65
58
|
* Top Rated
|
|
@@ -70,6 +63,6 @@ export class TVSeriesListsAPI {
|
|
|
70
63
|
* @param page Page (Defaults to 1)
|
|
71
64
|
*/
|
|
72
65
|
async top_rated(params = {}) {
|
|
73
|
-
return this.fetch_tv_series_list(
|
|
66
|
+
return this.fetch_tv_series_list(ENDPOINTS.TV_SERIES.TOP_RATED, params);
|
|
74
67
|
}
|
|
75
68
|
}
|
package/dist/routes.d.ts
CHANGED
|
@@ -16,10 +16,74 @@ export declare const ENDPOINTS: {
|
|
|
16
16
|
PEOPLE_LIST: string;
|
|
17
17
|
TV_LIST: string;
|
|
18
18
|
};
|
|
19
|
+
COMPANIES: {
|
|
20
|
+
DETAILS: string;
|
|
21
|
+
ALTERNATIVE_NAMES: string;
|
|
22
|
+
IMAGES: string;
|
|
23
|
+
};
|
|
19
24
|
COLLECTIONS: {
|
|
20
25
|
DETAILS: string;
|
|
21
26
|
IMAGES: string;
|
|
22
27
|
TRANSLATIONS: string;
|
|
23
28
|
};
|
|
29
|
+
GENRES: {
|
|
30
|
+
MOVIE_LIST: string;
|
|
31
|
+
TV_LIST: string;
|
|
32
|
+
};
|
|
33
|
+
MOVIES: {
|
|
34
|
+
DETAILS: string;
|
|
35
|
+
ALTERNATIVE_TITLES: string;
|
|
36
|
+
CREDITS: string;
|
|
37
|
+
EXTERNAL_IDS: string;
|
|
38
|
+
KEYWORDS: string;
|
|
39
|
+
CHANGES: string;
|
|
40
|
+
IMAGES: string;
|
|
41
|
+
LATEST: string;
|
|
42
|
+
NOW_PLAYING: string;
|
|
43
|
+
POPULAR: string;
|
|
44
|
+
RECOMMENDATIONS: string;
|
|
45
|
+
RELEASE_DATES: string;
|
|
46
|
+
REVIEWS: string;
|
|
47
|
+
SIMILAR: string;
|
|
48
|
+
TOP_RATED: string;
|
|
49
|
+
TRANSLATIONS: string;
|
|
50
|
+
UPCOMING: string;
|
|
51
|
+
VIDEOS: string;
|
|
52
|
+
WATCH_PROVIDERS: string;
|
|
53
|
+
};
|
|
54
|
+
SEARCH: {
|
|
55
|
+
MOVIE: string;
|
|
56
|
+
COLLECTION: string;
|
|
57
|
+
COMPANY: string;
|
|
58
|
+
KEYWORD: string;
|
|
59
|
+
MULTI: string;
|
|
60
|
+
PERSON: string;
|
|
61
|
+
TV: string;
|
|
62
|
+
};
|
|
63
|
+
TV_SERIES: {
|
|
64
|
+
DETAILS: string;
|
|
65
|
+
AGGREGATE_CREDITS: string;
|
|
66
|
+
AIRING_TODAY: string;
|
|
67
|
+
ALTERNATIVE_TITLES: string;
|
|
68
|
+
CHANGES: string;
|
|
69
|
+
CONTENT_RATINGS: string;
|
|
70
|
+
CREDITS: string;
|
|
71
|
+
EPISODE_GROUPS: string;
|
|
72
|
+
EXTERNAL_IDS: string;
|
|
73
|
+
IMAGES: string;
|
|
74
|
+
KEYWORDS: string;
|
|
75
|
+
LATEST: string;
|
|
76
|
+
LISTS: string;
|
|
77
|
+
ON_THE_AIR: string;
|
|
78
|
+
POPULAR: string;
|
|
79
|
+
RECOMMENDATIONS: string;
|
|
80
|
+
REVIEWS: string;
|
|
81
|
+
SCREENED_THEATRICALLY: string;
|
|
82
|
+
SIMILAR: string;
|
|
83
|
+
TOP_RATED: string;
|
|
84
|
+
TRANSLATIONS: string;
|
|
85
|
+
VIDEOS: string;
|
|
86
|
+
WATCH_PROVIDERS: string;
|
|
87
|
+
};
|
|
24
88
|
};
|
|
25
89
|
//# sourceMappingURL=routes.d.ts.map
|
package/dist/routes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuFrB,CAAC"}
|
package/dist/routes.js
CHANGED
|
@@ -16,9 +16,73 @@ export const ENDPOINTS = {
|
|
|
16
16
|
PEOPLE_LIST: "/person/changes",
|
|
17
17
|
TV_LIST: "/tv/changes",
|
|
18
18
|
},
|
|
19
|
+
COMPANIES: {
|
|
20
|
+
DETAILS: "/company",
|
|
21
|
+
ALTERNATIVE_NAMES: "/alternative_names",
|
|
22
|
+
IMAGES: "/images",
|
|
23
|
+
},
|
|
19
24
|
COLLECTIONS: {
|
|
20
25
|
DETAILS: "/collection",
|
|
21
26
|
IMAGES: "/images",
|
|
22
27
|
TRANSLATIONS: "/translations",
|
|
23
28
|
},
|
|
29
|
+
GENRES: {
|
|
30
|
+
MOVIE_LIST: "/genre/movie/list",
|
|
31
|
+
TV_LIST: "/genre/tv/list",
|
|
32
|
+
},
|
|
33
|
+
MOVIES: {
|
|
34
|
+
DETAILS: "/movie",
|
|
35
|
+
ALTERNATIVE_TITLES: "/alternative_titles",
|
|
36
|
+
CREDITS: "/credits",
|
|
37
|
+
EXTERNAL_IDS: "/external_ids",
|
|
38
|
+
KEYWORDS: "/keywords",
|
|
39
|
+
CHANGES: "/changes",
|
|
40
|
+
IMAGES: "/images",
|
|
41
|
+
LATEST: "/latest",
|
|
42
|
+
NOW_PLAYING: "/now_playing",
|
|
43
|
+
POPULAR: "/popular",
|
|
44
|
+
RECOMMENDATIONS: "/recommendations",
|
|
45
|
+
RELEASE_DATES: "/release_dates",
|
|
46
|
+
REVIEWS: "/reviews",
|
|
47
|
+
SIMILAR: "/similar",
|
|
48
|
+
TOP_RATED: "/top_rated",
|
|
49
|
+
TRANSLATIONS: "/translations",
|
|
50
|
+
UPCOMING: "/upcoming",
|
|
51
|
+
VIDEOS: "/videos",
|
|
52
|
+
WATCH_PROVIDERS: "/watch/providers",
|
|
53
|
+
},
|
|
54
|
+
SEARCH: {
|
|
55
|
+
MOVIE: "/search/movie",
|
|
56
|
+
COLLECTION: "/search/collection",
|
|
57
|
+
COMPANY: "/search/company",
|
|
58
|
+
KEYWORD: "/search/keyword",
|
|
59
|
+
MULTI: "/search/multi",
|
|
60
|
+
PERSON: "/search/person",
|
|
61
|
+
TV: "/search/tv",
|
|
62
|
+
},
|
|
63
|
+
TV_SERIES: {
|
|
64
|
+
DETAILS: "/tv",
|
|
65
|
+
AGGREGATE_CREDITS: "/aggregate_credits",
|
|
66
|
+
AIRING_TODAY: "/airing_today",
|
|
67
|
+
ALTERNATIVE_TITLES: "/alternative_titles",
|
|
68
|
+
CHANGES: "/changes",
|
|
69
|
+
CONTENT_RATINGS: "/content_ratings",
|
|
70
|
+
CREDITS: "/credits",
|
|
71
|
+
EPISODE_GROUPS: "/episode_groups",
|
|
72
|
+
EXTERNAL_IDS: "/external_ids",
|
|
73
|
+
IMAGES: "/images",
|
|
74
|
+
KEYWORDS: "/keywords",
|
|
75
|
+
LATEST: "/latest",
|
|
76
|
+
LISTS: "/lists",
|
|
77
|
+
ON_THE_AIR: "/on_the_air",
|
|
78
|
+
POPULAR: "/popular",
|
|
79
|
+
RECOMMENDATIONS: "/recommendations",
|
|
80
|
+
REVIEWS: "/reviews",
|
|
81
|
+
SCREENED_THEATRICALLY: "/screened_theatrically",
|
|
82
|
+
SIMILAR: "/similar",
|
|
83
|
+
TOP_RATED: "/top_rated",
|
|
84
|
+
TRANSLATIONS: "/translations",
|
|
85
|
+
VIDEOS: "/videos",
|
|
86
|
+
WATCH_PROVIDERS: "/watch/providers",
|
|
87
|
+
},
|
|
24
88
|
};
|
package/dist/tmdb.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CertificationsAPI } from "./endpoints/certifications";
|
|
2
2
|
import { ChangesAPI } from "./endpoints/changes";
|
|
3
|
+
import { CompaniesAPI } from "./endpoints/companies";
|
|
3
4
|
import { CollectionsAPI } from "./endpoints/collections";
|
|
4
5
|
import { ConfigurationAPI } from "./endpoints/configuration";
|
|
5
6
|
import { GenresAPI } from "./endpoints/genres";
|
|
@@ -23,6 +24,7 @@ export declare class TMDB {
|
|
|
23
24
|
tv_series: TVSeriesAPI;
|
|
24
25
|
certifications: CertificationsAPI;
|
|
25
26
|
changes: ChangesAPI;
|
|
27
|
+
companies: CompaniesAPI;
|
|
26
28
|
collections: CollectionsAPI;
|
|
27
29
|
/**
|
|
28
30
|
* Creates a new TMDB instance.
|
package/dist/tmdb.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tmdb.d.ts","sourceRoot":"","sources":["../src/tmdb.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,qBAAa,IAAI;IAChB,OAAO,CAAC,MAAM,CAAY;IAC1B,OAAO,CAAC,OAAO,CAAc;IACtB,MAAM,EAAE,SAAS,CAAC;IAClB,WAAW,EAAE,aAAa,CAAC;IA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AAa,CAAC;IAC3B,MAAM,EAAE,SAAS,CAAC;IAClB,MAAM,EAAE,QAAQ,CAAC;IACjB,aAAa,EAAE,gBAAgB,CAAC;IAChC,MAAM,EAAE,SAAS,CAAC;IAClB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,SAAS,EAAE,WAAW,CAAC;IACvB,cAAc,EAAE,iBAAiB,CAAC;IAClC,OAAO,EAAE,UAAU,CAAC;IACpB,SAAS,EAAE,YAAY,CAAC;IACxB,WAAW,EAAE,cAAc,CAAC;IAGnC;;;;OAIG;gBACS,WAAW,EAAE,MAAM,EAAE,OAAO,GAAE,WAAgB;CAiB1D"}
|
package/dist/tmdb.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { ApiClient } from "./client";
|
|
3
3
|
import { CertificationsAPI } from "./endpoints/certifications";
|
|
4
4
|
import { ChangesAPI } from "./endpoints/changes";
|
|
5
|
+
import { CompaniesAPI } from "./endpoints/companies";
|
|
5
6
|
import { CollectionsAPI } from "./endpoints/collections";
|
|
6
7
|
import { ConfigurationAPI } from "./endpoints/configuration";
|
|
7
8
|
import { GenresAPI } from "./endpoints/genres";
|
|
@@ -25,6 +26,7 @@ export class TMDB {
|
|
|
25
26
|
tv_series;
|
|
26
27
|
certifications;
|
|
27
28
|
changes;
|
|
29
|
+
companies;
|
|
28
30
|
collections;
|
|
29
31
|
// etc...
|
|
30
32
|
/**
|
|
@@ -47,6 +49,7 @@ export class TMDB {
|
|
|
47
49
|
this.tv_series = new TVSeriesAPI(this.client, this.options);
|
|
48
50
|
this.certifications = new CertificationsAPI(this.client, this.options);
|
|
49
51
|
this.changes = new ChangesAPI(this.client, this.options);
|
|
52
|
+
this.companies = new CompaniesAPI(this.client, this.options);
|
|
50
53
|
this.collections = new CollectionsAPI(this.client, this.options);
|
|
51
54
|
}
|
|
52
55
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CountryISO3166_1 } from "../config/countries";
|
|
2
|
+
import type { LiteralUnion } from "../utility";
|
|
2
3
|
/**
|
|
3
4
|
* Represents a genre of a movie or TV show.
|
|
4
5
|
*/
|
|
@@ -127,7 +128,7 @@ export type ImageItem = {
|
|
|
127
128
|
/** Image height in pixels */
|
|
128
129
|
height: number;
|
|
129
130
|
/** ISO 639-1 language code if image contains text, null otherwise */
|
|
130
|
-
iso_639_1
|
|
131
|
+
iso_639_1?: string | null;
|
|
131
132
|
/** Relative path to the image file (append to base URL) */
|
|
132
133
|
file_path: string;
|
|
133
134
|
/** Average user rating for this image */
|
|
@@ -186,7 +187,10 @@ export type KnownForTV = BaseKnownForItem & {
|
|
|
186
187
|
* Union type for items in the known_for array (can be either movie or TV show)
|
|
187
188
|
*/
|
|
188
189
|
export type KnownForItem = KnownForMovie | KnownForTV;
|
|
190
|
+
/** Available media types on TMDB */
|
|
189
191
|
export type MediaType = "movie" | "tv";
|
|
192
|
+
/** Available file type on svg (for images) */
|
|
193
|
+
export type FileType = LiteralUnion<".png" | ".svg">;
|
|
190
194
|
/**
|
|
191
195
|
* Content rating information for a TV show or movie
|
|
192
196
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../../../src/types/common/media.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../../../src/types/common/media.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C;;GAEG;AACH,MAAM,MAAM,KAAK,GAAG;IAEnB,EAAE,EAAE,MAAM,CAAC;IAEX,IAAI,EAAE,MAAM,CAAC;CACb,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC5B,8CAA8C;IAC9C,MAAM,EAAE,KAAK,EAAE,CAAC;CAChB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,OAAO,EAAE,MAAM,CAAC,gBAAgB,EAAE,aAAa,CAAC,CAAC;CACjD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC3B,sCAAsC;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,kDAAkD;IAClD,QAAQ,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC/B,uBAAuB;IACvB,IAAI,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC3B,yBAAyB;IACzB,GAAG,CAAC,EAAE,iBAAiB,EAAE,CAAC;CAC1B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC/B,kCAAkC;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,iCAAiC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,4DAA4D;IAC5D,aAAa,EAAE,MAAM,CAAC;IACtB,+DAA+D;IAC/D,gBAAgB,EAAE,MAAM,CAAC;CACzB,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { FileType, ImageItem, WithLanguage } from "../common";
|
|
2
|
+
import { CountryISO3166_1 } from "../config/countries";
|
|
3
|
+
import { Language, LanguageISO6391 } from "../config/languages";
|
|
4
|
+
/**
|
|
5
|
+
* Minimal company data reused across company-related responses.
|
|
6
|
+
*/
|
|
7
|
+
export type CompanySummary = {
|
|
8
|
+
/** Unique company identifier */
|
|
9
|
+
id: number;
|
|
10
|
+
/** Relative path to the company logo */
|
|
11
|
+
logo_path?: string | null;
|
|
12
|
+
/** Company display name */
|
|
13
|
+
name: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Detailed company information returned by `/company/{company_id}`.
|
|
17
|
+
*/
|
|
18
|
+
export type Company = CompanySummary & {
|
|
19
|
+
/** ISO 3166-1 country code of origin */
|
|
20
|
+
origin_country: CountryISO3166_1;
|
|
21
|
+
/** Company description or biography */
|
|
22
|
+
description: string;
|
|
23
|
+
/** Company headquarters location */
|
|
24
|
+
headquarters: string;
|
|
25
|
+
/** Official company homepage */
|
|
26
|
+
homepage: string | null;
|
|
27
|
+
/** Parent company, if TMDB links one */
|
|
28
|
+
parent_company?: CompanySummary | null;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* A single alternative company name entry.
|
|
32
|
+
*/
|
|
33
|
+
export type CompanyAlternativeName = {
|
|
34
|
+
/** Alternative company name */
|
|
35
|
+
name: string;
|
|
36
|
+
/** Optional classification for the name */
|
|
37
|
+
type: string;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Alternative names response for a company.
|
|
41
|
+
*/
|
|
42
|
+
export type CompanyAlternativeNames = {
|
|
43
|
+
/** Unique company identifier */
|
|
44
|
+
id: number;
|
|
45
|
+
/** List of alternative names associated with the company */
|
|
46
|
+
results: CompanyAlternativeName[];
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Company logo images returned by `/company/{company_id}/images`.
|
|
50
|
+
*/
|
|
51
|
+
export type CompanyImages = {
|
|
52
|
+
/** Unique company identifier */
|
|
53
|
+
id: number;
|
|
54
|
+
/** Logos available for the company */
|
|
55
|
+
logos: CompanyImage[];
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Represents a single company logo (slightly different from ImageItem)
|
|
59
|
+
*
|
|
60
|
+
* Note on FileType from TMDB:
|
|
61
|
+
* There are two image formats that are supported for companies, PNG's and SVG's.
|
|
62
|
+
* You can see which type the original file is by looking at the file_type field.
|
|
63
|
+
* We prefer SVG's as they are resolution independent and as such, the width and height are only
|
|
64
|
+
* there to reflect the original asset that was uploaded.
|
|
65
|
+
* An SVG can be scaled properly beyond those dimensions if you call them as a PNG.
|
|
66
|
+
*/
|
|
67
|
+
export type CompanyImage = Omit<ImageItem, "iso_639_1"> & {
|
|
68
|
+
id: string;
|
|
69
|
+
file_type: FileType;
|
|
70
|
+
};
|
|
71
|
+
/** Base param used by all company queries */
|
|
72
|
+
export type CompanyBaseParam = {
|
|
73
|
+
/** Uniquely identifies a company in TMDB. */
|
|
74
|
+
company_id: number;
|
|
75
|
+
};
|
|
76
|
+
export type CompanyDetailsParams = CompanyBaseParam;
|
|
77
|
+
export type CompanyAlternativeNamesParams = CompanyBaseParam;
|
|
78
|
+
export type CompanyImagesParams = CompanyBaseParam & {
|
|
79
|
+
include_image_language?: Language | LanguageISO6391;
|
|
80
|
+
} & WithLanguage;
|
|
81
|
+
//# sourceMappingURL=companies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"companies.d.ts","sourceRoot":"","sources":["../../../src/types/other/companies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEhE;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC5B,gCAAgC;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,wCAAwC;IACxC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAC;CACb,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,cAAc,GAAG;IACtC,wCAAwC;IACxC,cAAc,EAAE,gBAAgB,CAAC;IACjC,uCAAuC;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,oCAAoC;IACpC,YAAY,EAAE,MAAM,CAAC;IACrB,gCAAgC;IAChC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,wCAAwC;IACxC,cAAc,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;CACvC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACpC,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;CACb,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACrC,gCAAgC;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,4DAA4D;IAC5D,OAAO,EAAE,sBAAsB,EAAE,CAAC;CAClC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC3B,gCAAgC;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,sCAAsC;IACtC,KAAK,EAAE,YAAY,EAAE,CAAC;CACtB,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,GAAG;IACzD,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,QAAQ,CAAC;CACpB,CAAC;AAEF,6CAA6C;AAC7C,MAAM,MAAM,gBAAgB,GAAG;IAC9B,6CAA6C;IAC7C,UAAU,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,CAAC;AACpD,MAAM,MAAM,6BAA6B,GAAG,gBAAgB,CAAC;AAC7D,MAAM,MAAM,mBAAmB,GAAG,gBAAgB,GAAG;IACpD,sBAAsB,CAAC,EAAE,QAAQ,GAAG,eAAe,CAAC;CACpD,GAAG,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/other/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/other/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC"}
|
package/dist/types/utility.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ import { KnownForItem, KnownForMovie, KnownForTV } from "./common";
|
|
|
6
6
|
export type Prettify<T> = T extends object ? (T extends infer O ? {
|
|
7
7
|
[K in keyof O]: Prettify<O[K]>;
|
|
8
8
|
} : never) : T;
|
|
9
|
+
/** Keep literal suggestions but allow any string */
|
|
10
|
+
export type LiteralUnion<T extends string> = T | (string & {});
|
|
9
11
|
/**
|
|
10
12
|
* Type guard checks for KnowForItems (tv or movie)
|
|
11
13
|
* @returns
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utility.d.ts","sourceRoot":"","sources":["../../src/types/utility.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEnE;;;GAGG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GAAG,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;AAElH;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,IAAI,aAAa,CAEzE;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,IAAI,UAAU,CAEnE"}
|
|
1
|
+
{"version":3,"file":"utility.d.ts","sourceRoot":"","sources":["../../src/types/utility.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEnE;;;GAGG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GAAG,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;AAElH,oDAAoD;AACpD,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,MAAM,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAE/D;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,IAAI,aAAa,CAEzE;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,IAAI,UAAU,CAEnE"}
|
package/package.json
CHANGED