@lorenzopant/tmdb 1.4.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/client.d.ts +2 -2
- package/dist/client.js +2 -2
- package/dist/endpoints/collections.d.ts +40 -0
- package/dist/endpoints/collections.d.ts.map +1 -0
- package/dist/endpoints/collections.js +52 -0
- 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 +69 -0
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +69 -0
- package/dist/tmdb.d.ts +4 -0
- package/dist/tmdb.d.ts.map +1 -1
- package/dist/tmdb.js +6 -0
- package/dist/types/common/media.d.ts +8 -4
- package/dist/types/common/media.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -0
- package/dist/types/movies/movie.d.ts +2 -2
- package/dist/types/movies/movie.d.ts.map +1 -1
- package/dist/types/other/collections.d.ts +91 -0
- package/dist/types/other/collections.d.ts.map +1 -0
- package/dist/types/other/collections.js +1 -0
- 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 +3 -0
- package/dist/types/other/index.d.ts.map +1 -0
- package/dist/types/other/index.js +2 -0
- package/dist/types/utility.d.ts +2 -0
- package/dist/types/utility.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ export declare class ApiClient {
|
|
|
5
5
|
request<T>(endpoint: string, params?: Record<string, unknown | undefined>): Promise<T>;
|
|
6
6
|
/**
|
|
7
7
|
* Recursively converts null values to undefined in API responses.
|
|
8
|
-
* This allows
|
|
9
|
-
*
|
|
8
|
+
* This allows optional properties to model fields that TMDB returns as nullable.
|
|
9
|
+
* Response types for nullable fields should account for possible undefined values.
|
|
10
10
|
*/
|
|
11
11
|
private sanitizeNulls;
|
|
12
12
|
private handleError;
|
package/dist/client.js
CHANGED
|
@@ -25,8 +25,8 @@ export class ApiClient {
|
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
27
|
* Recursively converts null values to undefined in API responses.
|
|
28
|
-
* This allows
|
|
29
|
-
*
|
|
28
|
+
* This allows optional properties to model fields that TMDB returns as nullable.
|
|
29
|
+
* Response types for nullable fields should account for possible undefined values.
|
|
30
30
|
*/
|
|
31
31
|
sanitizeNulls(value) {
|
|
32
32
|
// Only convert null to undefined, keep undefined as-is
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { CollectionBaseParam, Collection, CollectionDetailsParams, CollectionImages, CollectionImagesParams, CollectionTranslations } from "../types/other/collections";
|
|
2
|
+
import { TMDBAPIBase } from "./base";
|
|
3
|
+
export declare class CollectionsAPI extends TMDBAPIBase {
|
|
4
|
+
private collectionPath;
|
|
5
|
+
/**
|
|
6
|
+
* Details
|
|
7
|
+
* GET - https://api.themoviedb.org/3/collection/{collection_id}
|
|
8
|
+
*
|
|
9
|
+
* Get collection details by ID.
|
|
10
|
+
*
|
|
11
|
+
* @param collection_id Unique identifier for the collection
|
|
12
|
+
* @param language Language for the response
|
|
13
|
+
* @reference https://developer.themoviedb.org/reference/collection-details
|
|
14
|
+
*/
|
|
15
|
+
details(params: CollectionDetailsParams): Promise<Collection>;
|
|
16
|
+
/**
|
|
17
|
+
* Images
|
|
18
|
+
* GET - https://api.themoviedb.org/3/collection/{collection_id}/images
|
|
19
|
+
*
|
|
20
|
+
* Get the images that belong to a collection.
|
|
21
|
+
* This method will return the backdrops and posters that have been added to a collection.
|
|
22
|
+
*
|
|
23
|
+
* @param collection_id Unique identifier for the collection
|
|
24
|
+
* @param language Language for the response
|
|
25
|
+
* @param include_image_language Additional language for images
|
|
26
|
+
* @reference https://developer.themoviedb.org/reference/collection-images
|
|
27
|
+
*/
|
|
28
|
+
images(params: CollectionImagesParams): Promise<CollectionImages>;
|
|
29
|
+
/**
|
|
30
|
+
* Translations
|
|
31
|
+
* GET - https://api.themoviedb.org/3/collection/{collection_id}/translations
|
|
32
|
+
*
|
|
33
|
+
* Get collection translations by ID.
|
|
34
|
+
*
|
|
35
|
+
* @param collection_id Unique identifier for the collection
|
|
36
|
+
* @reference https://developer.themoviedb.org/reference/collection-translations
|
|
37
|
+
*/
|
|
38
|
+
translations(params: CollectionBaseParam): Promise<CollectionTranslations>;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=collections.d.ts.map
|
|
@@ -0,0 +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,4BAA4B,CAAC;AACpC,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"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ENDPOINTS } from "../routes";
|
|
2
|
+
import { TMDBAPIBase } from "./base";
|
|
3
|
+
export class CollectionsAPI extends TMDBAPIBase {
|
|
4
|
+
collectionPath(collection_id) {
|
|
5
|
+
return `${ENDPOINTS.COLLECTIONS.DETAILS}/${collection_id}`;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Details
|
|
9
|
+
* GET - https://api.themoviedb.org/3/collection/{collection_id}
|
|
10
|
+
*
|
|
11
|
+
* Get collection details by ID.
|
|
12
|
+
*
|
|
13
|
+
* @param collection_id Unique identifier for the collection
|
|
14
|
+
* @param language Language for the response
|
|
15
|
+
* @reference https://developer.themoviedb.org/reference/collection-details
|
|
16
|
+
*/
|
|
17
|
+
async details(params) {
|
|
18
|
+
const { language = this.defaultOptions.language, ...rest } = params;
|
|
19
|
+
const endpoint = this.collectionPath(params.collection_id);
|
|
20
|
+
return this.client.request(endpoint, { language, ...rest });
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Images
|
|
24
|
+
* GET - https://api.themoviedb.org/3/collection/{collection_id}/images
|
|
25
|
+
*
|
|
26
|
+
* Get the images that belong to a collection.
|
|
27
|
+
* This method will return the backdrops and posters that have been added to a collection.
|
|
28
|
+
*
|
|
29
|
+
* @param collection_id Unique identifier for the collection
|
|
30
|
+
* @param language Language for the response
|
|
31
|
+
* @param include_image_language Additional language for images
|
|
32
|
+
* @reference https://developer.themoviedb.org/reference/collection-images
|
|
33
|
+
*/
|
|
34
|
+
async images(params) {
|
|
35
|
+
const endpoint = `${this.collectionPath(params.collection_id)}${ENDPOINTS.COLLECTIONS.IMAGES}`;
|
|
36
|
+
const requestParams = this.withLanguage(params) ?? params;
|
|
37
|
+
return this.client.request(endpoint, requestParams);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Translations
|
|
41
|
+
* GET - https://api.themoviedb.org/3/collection/{collection_id}/translations
|
|
42
|
+
*
|
|
43
|
+
* Get collection translations by ID.
|
|
44
|
+
*
|
|
45
|
+
* @param collection_id Unique identifier for the collection
|
|
46
|
+
* @reference https://developer.themoviedb.org/reference/collection-translations
|
|
47
|
+
*/
|
|
48
|
+
async translations(params) {
|
|
49
|
+
const endpoint = `${this.collectionPath(params.collection_id)}${ENDPOINTS.COLLECTIONS.TRANSLATIONS}`;
|
|
50
|
+
return this.client.request(endpoint, params);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -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":"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"}
|
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
|
}
|