@lorenzopant/tmdb 1.17.0 → 1.17.2

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.
Files changed (141) hide show
  1. package/dist/index.d.ts +5087 -4
  2. package/dist/index.js +3721 -5
  3. package/package.json +12 -5
  4. package/dist/client.d.ts +0 -17
  5. package/dist/client.js +0 -114
  6. package/dist/endpoints/base.d.ts +0 -22
  7. package/dist/endpoints/base.js +0 -32
  8. package/dist/endpoints/certifications.d.ts +0 -20
  9. package/dist/endpoints/certifications.js +0 -24
  10. package/dist/endpoints/changes.d.ts +0 -40
  11. package/dist/endpoints/changes.js +0 -46
  12. package/dist/endpoints/collections.d.ts +0 -39
  13. package/dist/endpoints/collections.js +0 -52
  14. package/dist/endpoints/companies.d.ts +0 -37
  15. package/dist/endpoints/companies.js +0 -49
  16. package/dist/endpoints/configuration.d.ts +0 -72
  17. package/dist/endpoints/configuration.js +0 -83
  18. package/dist/endpoints/credits.d.ts +0 -16
  19. package/dist/endpoints/credits.js +0 -22
  20. package/dist/endpoints/discover.d.ts +0 -36
  21. package/dist/endpoints/discover.js +0 -61
  22. package/dist/endpoints/find.d.ts +0 -16
  23. package/dist/endpoints/find.js +0 -21
  24. package/dist/endpoints/genres.d.ts +0 -25
  25. package/dist/endpoints/genres.js +0 -28
  26. package/dist/endpoints/keywords.d.ts +0 -29
  27. package/dist/endpoints/keywords.js +0 -38
  28. package/dist/endpoints/movie_lists.d.ts +0 -53
  29. package/dist/endpoints/movie_lists.js +0 -65
  30. package/dist/endpoints/movies.d.ts +0 -202
  31. package/dist/endpoints/movies.js +0 -255
  32. package/dist/endpoints/networks.d.ts +0 -36
  33. package/dist/endpoints/networks.js +0 -46
  34. package/dist/endpoints/people.d.ts +0 -91
  35. package/dist/endpoints/people.js +0 -128
  36. package/dist/endpoints/people_lists.d.ts +0 -16
  37. package/dist/endpoints/people_lists.js +0 -16
  38. package/dist/endpoints/reviews.d.ts +0 -14
  39. package/dist/endpoints/reviews.js +0 -16
  40. package/dist/endpoints/search.d.ts +0 -88
  41. package/dist/endpoints/search.js +0 -102
  42. package/dist/endpoints/trending.d.ts +0 -36
  43. package/dist/endpoints/trending.js +0 -48
  44. package/dist/endpoints/tv_episode_groups.d.ts +0 -13
  45. package/dist/endpoints/tv_episode_groups.js +0 -16
  46. package/dist/endpoints/tv_episodes.d.ts +0 -110
  47. package/dist/endpoints/tv_episodes.js +0 -136
  48. package/dist/endpoints/tv_seasons.d.ts +0 -128
  49. package/dist/endpoints/tv_seasons.js +0 -164
  50. package/dist/endpoints/tv_series.d.ts +0 -244
  51. package/dist/endpoints/tv_series.js +0 -311
  52. package/dist/endpoints/tv_series_lists.d.ts +0 -51
  53. package/dist/endpoints/tv_series_lists.js +0 -63
  54. package/dist/endpoints/watch_providers.d.ts +0 -34
  55. package/dist/endpoints/watch_providers.js +0 -46
  56. package/dist/errors/messages.d.ts +0 -15
  57. package/dist/errors/messages.js +0 -47
  58. package/dist/errors/tmdb.d.ts +0 -45
  59. package/dist/errors/tmdb.js +0 -39
  60. package/dist/images/images.d.ts +0 -12
  61. package/dist/images/images.js +0 -26
  62. package/dist/routes.d.ts +0 -157
  63. package/dist/routes.js +0 -157
  64. package/dist/tmdb.d.ts +0 -61
  65. package/dist/tmdb.js +0 -94
  66. package/dist/types/collections.d.ts +0 -72
  67. package/dist/types/collections.js +0 -1
  68. package/dist/types/common/certifications.d.ts +0 -19
  69. package/dist/types/common/certifications.js +0 -1
  70. package/dist/types/common/changes.d.ts +0 -44
  71. package/dist/types/common/changes.js +0 -1
  72. package/dist/types/common/images.d.ts +0 -64
  73. package/dist/types/common/images.js +0 -1
  74. package/dist/types/common/index.d.ts +0 -6
  75. package/dist/types/common/index.js +0 -6
  76. package/dist/types/common/media.d.ts +0 -305
  77. package/dist/types/common/media.js +0 -1
  78. package/dist/types/common/pagination.d.ts +0 -6
  79. package/dist/types/common/pagination.js +0 -1
  80. package/dist/types/common/params.d.ts +0 -27
  81. package/dist/types/common/params.js +0 -1
  82. package/dist/types/companies.d.ts +0 -53
  83. package/dist/types/companies.js +0 -1
  84. package/dist/types/config/configuration.d.ts +0 -56
  85. package/dist/types/config/configuration.js +0 -1
  86. package/dist/types/config/countries.d.ts +0 -3
  87. package/dist/types/config/countries.js +0 -1257
  88. package/dist/types/config/images.d.ts +0 -49
  89. package/dist/types/config/images.js +0 -13
  90. package/dist/types/config/index.d.ts +0 -6
  91. package/dist/types/config/index.js +0 -6
  92. package/dist/types/config/languages.d.ts +0 -11
  93. package/dist/types/config/languages.js +0 -1
  94. package/dist/types/config/options.d.ts +0 -36
  95. package/dist/types/config/options.js +0 -1
  96. package/dist/types/config/timezones.d.ts +0 -751
  97. package/dist/types/config/timezones.js +0 -1149
  98. package/dist/types/credits.d.ts +0 -148
  99. package/dist/types/credits.js +0 -1
  100. package/dist/types/discover.d.ts +0 -130
  101. package/dist/types/discover.js +0 -27
  102. package/dist/types/enums.d.ts +0 -8
  103. package/dist/types/enums.js +0 -9
  104. package/dist/types/find.d.ts +0 -103
  105. package/dist/types/find.js +0 -1
  106. package/dist/types/index.d.ts +0 -21
  107. package/dist/types/index.js +0 -21
  108. package/dist/types/keywords.d.ts +0 -19
  109. package/dist/types/keywords.js +0 -1
  110. package/dist/types/movies.d.ts +0 -304
  111. package/dist/types/movies.js +0 -1
  112. package/dist/types/networks.d.ts +0 -45
  113. package/dist/types/networks.js +0 -1
  114. package/dist/types/people-lists.d.ts +0 -5
  115. package/dist/types/people-lists.js +0 -1
  116. package/dist/types/people.d.ts +0 -214
  117. package/dist/types/people.js +0 -1
  118. package/dist/types/reviews.d.ts +0 -22
  119. package/dist/types/reviews.js +0 -1
  120. package/dist/types/search.d.ts +0 -198
  121. package/dist/types/search.js +0 -1
  122. package/dist/types/trending.d.ts +0 -55
  123. package/dist/types/trending.js +0 -1
  124. package/dist/types/tv-episode-groups.d.ts +0 -63
  125. package/dist/types/tv-episode-groups.js +0 -13
  126. package/dist/types/tv-episodes.d.ts +0 -98
  127. package/dist/types/tv-episodes.js +0 -1
  128. package/dist/types/tv-seasons.d.ts +0 -133
  129. package/dist/types/tv-seasons.js +0 -1
  130. package/dist/types/tv-series.d.ts +0 -445
  131. package/dist/types/tv-series.js +0 -1
  132. package/dist/types/utility.d.ts +0 -16
  133. package/dist/types/utility.js +0 -10
  134. package/dist/types/watch-providers.d.ts +0 -34
  135. package/dist/types/watch-providers.js +0 -1
  136. package/dist/utils/index.d.ts +0 -2
  137. package/dist/utils/index.js +0 -2
  138. package/dist/utils/jwt.d.ts +0 -1
  139. package/dist/utils/jwt.js +0 -61
  140. package/dist/utils/logger.d.ts +0 -18
  141. package/dist/utils/logger.js +0 -40
@@ -1,83 +0,0 @@
1
- import { ENDPOINTS } from "../routes";
2
- import { TMDBAPIBase } from "./base";
3
- export class ConfigurationAPI extends TMDBAPIBase {
4
- /**
5
- * Details
6
- * GET - https://api.themoviedb.org/3/configuration
7
- *
8
- * Query the API configuration details.
9
- * The data returned here in the configuration endpoint is designed to provide some of
10
- * the required information you'll need as you integrate our API.
11
- * For example, you can get a list of valid image sizes and the valid image address.
12
- * @reference https://developer.themoviedb.org/reference/configuration-details
13
- */
14
- async details() {
15
- return this.client.request(ENDPOINTS.CONFIGURATION.DETAILS);
16
- }
17
- /**
18
- * Countries
19
- * GET - https://api.themoviedb.org/3/configuration/countries
20
- *
21
- * Get the list of countries (ISO 3166-1 tags) used throughout TMDB.
22
- * @param language Language (Defaults to en-US)
23
- * @reference https://developer.themoviedb.org/reference/configuration-countries
24
- */
25
- async countries(params) {
26
- return this.client.request(ENDPOINTS.CONFIGURATION.COUNTRIES, this.withLanguage(params));
27
- }
28
- /**
29
- * Jobs
30
- * GET - https://api.themoviedb.org/3/configuration/jobs
31
- *
32
- * Get the list of the jobs and departments used throughout TMDB.
33
- * @reference https://developer.themoviedb.org/reference/configuration-jobs
34
- */
35
- async jobs() {
36
- return this.client.request(ENDPOINTS.CONFIGURATION.JOBS);
37
- }
38
- /**
39
- * Languages
40
- * GET - https://api.themoviedb.org/3/configuration/languages
41
- *
42
- * Get the list of the languages (ISO 639-1 tags) used throughout TMDB.
43
- * @reference https://developer.themoviedb.org/reference/configuration-languages
44
- */
45
- async languages() {
46
- return this.client.request(ENDPOINTS.CONFIGURATION.LANGUAGES);
47
- }
48
- /**
49
- * Primary Translations
50
- * GET - https://api.themoviedb.org/3/configuration/primary_translations
51
- *
52
- * Get a list of the officially supported translations on TMDB.
53
- *
54
- * While it's technically possible to add a translation in any one of the languages we have added to TMDB
55
- * (we don't restrict content), the ones listed in this method are the ones
56
- * we also support for localizing the website with which means they are "primary" translations.
57
- *
58
- * These are all specified as IETF tags to identify the languages we use on TMDB. There is one exception which is image languages.
59
- * They are currently only designated by a ISO-639-1 tag.
60
- * This is a planned upgrade for the future.
61
- *
62
- * We're always open to adding more if you think one should be added.
63
- * You can ask about getting a new primary translation added by posting on the forums.
64
- *
65
- * One more thing to mention, these are the translations that map to our website translation project.
66
- * You can view and contribute to that project here.
67
- *
68
- * @reference https://developer.themoviedb.org/reference/configuration-primary-translations
69
- */
70
- async primary_translations() {
71
- return this.client.request(ENDPOINTS.CONFIGURATION.PRIMARY_TRANSLATIONS);
72
- }
73
- /**
74
- * Timezones
75
- * GET - https://api.themoviedb.org/3/configuration/timezones
76
- *
77
- * Get the list of timezones used throughout TMDB.
78
- * @reference https://developer.themoviedb.org/reference/configuration-timezones
79
- */
80
- async timezones() {
81
- return this.client.request(ENDPOINTS.CONFIGURATION.TIMEZONES);
82
- }
83
- }
@@ -1,16 +0,0 @@
1
- import { CreditDetails, CreditDetailsParams } from "../types/credits";
2
- import { TMDBAPIBase } from "./base";
3
- export declare class CreditsAPI extends TMDBAPIBase {
4
- private creditPath;
5
- /**
6
- * Details
7
- * GET - https://api.themoviedb.org/3/credit/{credit_id}
8
- *
9
- * Get the detailed information for a movie or TV credit.
10
- *
11
- * @param credit_id Unique identifier for the credit
12
- * @param language Language for the response
13
- * @reference https://developer.themoviedb.org/reference/credit-details
14
- */
15
- details(params: CreditDetailsParams): Promise<CreditDetails>;
16
- }
@@ -1,22 +0,0 @@
1
- import { ENDPOINTS } from "../routes";
2
- import { TMDBAPIBase } from "./base";
3
- export class CreditsAPI extends TMDBAPIBase {
4
- creditPath(credit_id) {
5
- return `${ENDPOINTS.CREDITS.DETAILS}/${credit_id}`;
6
- }
7
- /**
8
- * Details
9
- * GET - https://api.themoviedb.org/3/credit/{credit_id}
10
- *
11
- * Get the detailed information for a movie or TV credit.
12
- *
13
- * @param credit_id Unique identifier for the credit
14
- * @param language Language for the response
15
- * @reference https://developer.themoviedb.org/reference/credit-details
16
- */
17
- async details(params) {
18
- const endpoint = this.creditPath(params.credit_id);
19
- const requestParams = this.withLanguage(params) ?? params;
20
- return this.client.request(endpoint, requestParams);
21
- }
22
- }
@@ -1,36 +0,0 @@
1
- import { DiscoverMovieParams, DiscoverTVParams, DiscoverTVResultItem, MovieResultItem, PaginatedResponse } from "../types";
2
- import { TMDBAPIBase } from "./base";
3
- export declare class DiscoverAPI extends TMDBAPIBase {
4
- /**
5
- * TMDB discover filtering notes:
6
- *
7
- * - If `region` is provided on movie discover, TMDB uses the regional release date
8
- * instead of the primary release date. When `with_release_type` is also provided,
9
- * the returned release date follows the order of the specified release types.
10
- * - Filters that accept comma-separated or pipe-separated values are forwarded as-is:
11
- * commas mean AND, pipes mean OR.
12
- *
13
- * @reference https://developer.themoviedb.org/reference/discover-movie
14
- * @reference https://developer.themoviedb.org/reference/discover-tv
15
- */
16
- private withMovieDefaults;
17
- private withTVDefaults;
18
- /**
19
- * Movie
20
- * GET - https://api.themoviedb.org/3/discover/movie
21
- *
22
- * Discover movies by applying filters and sort options.
23
- *
24
- * @reference https://developer.themoviedb.org/reference/discover-movie
25
- */
26
- movie(params?: DiscoverMovieParams): Promise<PaginatedResponse<MovieResultItem>>;
27
- /**
28
- * TV
29
- * GET - https://api.themoviedb.org/3/discover/tv
30
- *
31
- * Discover TV series by applying filters and sort options.
32
- *
33
- * @reference https://developer.themoviedb.org/reference/discover-tv
34
- */
35
- tv(params?: DiscoverTVParams): Promise<PaginatedResponse<DiscoverTVResultItem>>;
36
- }
@@ -1,61 +0,0 @@
1
- import { ENDPOINTS } from "../routes";
2
- import { TMDBAPIBase } from "./base";
3
- export class DiscoverAPI extends TMDBAPIBase {
4
- /**
5
- * TMDB discover filtering notes:
6
- *
7
- * - If `region` is provided on movie discover, TMDB uses the regional release date
8
- * instead of the primary release date. When `with_release_type` is also provided,
9
- * the returned release date follows the order of the specified release types.
10
- * - Filters that accept comma-separated or pipe-separated values are forwarded as-is:
11
- * commas mean AND, pipes mean OR.
12
- *
13
- * @reference https://developer.themoviedb.org/reference/discover-movie
14
- * @reference https://developer.themoviedb.org/reference/discover-tv
15
- */
16
- withMovieDefaults(params) {
17
- if (!params && !this.defaultOptions.language && !this.defaultOptions.region)
18
- return undefined;
19
- const language = params?.language ?? this.defaultOptions.language;
20
- const region = params?.region ?? this.defaultOptions.region;
21
- return {
22
- ...params,
23
- language,
24
- region,
25
- };
26
- }
27
- withTVDefaults(params) {
28
- if (!params && !this.defaultOptions.language && !this.defaultOptions.timezone) {
29
- return undefined;
30
- }
31
- const language = params?.language ?? this.defaultOptions.language;
32
- const timezone = params?.timezone ?? this.defaultOptions.timezone;
33
- return {
34
- ...params,
35
- language,
36
- timezone,
37
- };
38
- }
39
- /**
40
- * Movie
41
- * GET - https://api.themoviedb.org/3/discover/movie
42
- *
43
- * Discover movies by applying filters and sort options.
44
- *
45
- * @reference https://developer.themoviedb.org/reference/discover-movie
46
- */
47
- async movie(params = {}) {
48
- return this.client.request(ENDPOINTS.DISCOVER.MOVIE, this.withMovieDefaults(params));
49
- }
50
- /**
51
- * TV
52
- * GET - https://api.themoviedb.org/3/discover/tv
53
- *
54
- * Discover TV series by applying filters and sort options.
55
- *
56
- * @reference https://developer.themoviedb.org/reference/discover-tv
57
- */
58
- async tv(params = {}) {
59
- return this.client.request(ENDPOINTS.DISCOVER.TV, this.withTVDefaults(params));
60
- }
61
- }
@@ -1,16 +0,0 @@
1
- import { FindByIDParams, FindResults } from "../types";
2
- import { TMDBAPIBase } from "./base";
3
- export declare class FindAPI extends TMDBAPIBase {
4
- /**
5
- * By ID
6
- * GET - https://api.themoviedb.org/3/find/{external_id}
7
- *
8
- * Find movies, TV series, seasons, episodes, or people by an external ID.
9
- *
10
- * @param external_id External identifier to look up
11
- * @param external_source Source namespace for the external ID
12
- * @param language Language for localized results
13
- * @reference https://developer.themoviedb.org/reference/find-by-id
14
- */
15
- by_id(params: FindByIDParams): Promise<FindResults>;
16
- }
@@ -1,21 +0,0 @@
1
- import { ENDPOINTS } from "../routes";
2
- import { TMDBAPIBase } from "./base";
3
- export class FindAPI extends TMDBAPIBase {
4
- /**
5
- * By ID
6
- * GET - https://api.themoviedb.org/3/find/{external_id}
7
- *
8
- * Find movies, TV series, seasons, episodes, or people by an external ID.
9
- *
10
- * @param external_id External identifier to look up
11
- * @param external_source Source namespace for the external ID
12
- * @param language Language for localized results
13
- * @reference https://developer.themoviedb.org/reference/find-by-id
14
- */
15
- async by_id(params) {
16
- const { external_id, ...rest } = params;
17
- const endpoint = `${ENDPOINTS.FIND}/${encodeURIComponent(external_id)}`;
18
- const requestParams = this.withLanguage(rest);
19
- return this.client.request(endpoint, requestParams);
20
- }
21
- }
@@ -1,25 +0,0 @@
1
- import { WithLanguage } from "../types";
2
- import { GenresResponse } from "../types/common/media";
3
- import { TMDBAPIBase } from "./base";
4
- export declare class GenresAPI extends TMDBAPIBase {
5
- /**
6
- * Movie List
7
- * GET - https://api.themoviedb.org/3/genre/movie/list
8
- *
9
- * Get the list of official genres for movies.
10
- * @param language The language to use for the response.
11
- * @returns A promise that resolves to the genres list.
12
- * @reference https://developer.themoviedb.org/reference/genre-movie-list
13
- */
14
- movie_list(params?: WithLanguage): Promise<GenresResponse>;
15
- /**
16
- * TV List
17
- * GET - https://api.themoviedb.org/3/genre/tv/list
18
- *
19
- * Get the list of official genres for TV shows.
20
- * @param language The language to use for the response.
21
- * @returns A promise that resolves to the genres list.
22
- * @reference https://developer.themoviedb.org/reference/genre-tv-list
23
- */
24
- tv_list(params?: WithLanguage): Promise<GenresResponse>;
25
- }
@@ -1,28 +0,0 @@
1
- import { ENDPOINTS } from "../routes";
2
- import { TMDBAPIBase } from "./base";
3
- export class GenresAPI extends TMDBAPIBase {
4
- /**
5
- * Movie List
6
- * GET - https://api.themoviedb.org/3/genre/movie/list
7
- *
8
- * Get the list of official genres for movies.
9
- * @param language The language to use for the response.
10
- * @returns A promise that resolves to the genres list.
11
- * @reference https://developer.themoviedb.org/reference/genre-movie-list
12
- */
13
- async movie_list(params) {
14
- return this.client.request(ENDPOINTS.GENRES.MOVIE_LIST, this.withLanguage(params));
15
- }
16
- /**
17
- * TV List
18
- * GET - https://api.themoviedb.org/3/genre/tv/list
19
- *
20
- * Get the list of official genres for TV shows.
21
- * @param language The language to use for the response.
22
- * @returns A promise that resolves to the genres list.
23
- * @reference https://developer.themoviedb.org/reference/genre-tv-list
24
- */
25
- async tv_list(params) {
26
- return this.client.request(ENDPOINTS.GENRES.TV_LIST, this.withLanguage(params));
27
- }
28
- }
@@ -1,29 +0,0 @@
1
- import { Keyword, KeywordDetailsParams, KeywordMoviesParams, MovieResultItem, PaginatedResponse } from "../types";
2
- import { TMDBAPIBase } from "./base";
3
- export declare class KeywordsAPI extends TMDBAPIBase {
4
- private keywordPath;
5
- /**
6
- * Details
7
- * GET - https://api.themoviedb.org/3/keyword/{keyword_id}
8
- *
9
- * Get the details of a keyword by ID.
10
- *
11
- * @param keyword_id Unique identifier for the keyword
12
- * @reference https://developer.themoviedb.org/reference/keyword-details
13
- */
14
- details(params: KeywordDetailsParams): Promise<Keyword>;
15
- /**
16
- * Movies
17
- * GET - https://api.themoviedb.org/3/keyword/{keyword_id}/movies
18
- *
19
- * Get the movies associated with a keyword.
20
- *
21
- * @deprecated TMDB marks this endpoint as deprecated. Use discover/movie with_keywords instead.
22
- * @param keyword_id Unique identifier for the keyword
23
- * @param language Language for localized results
24
- * @param page Page number for paginated results
25
- * @param include_adult Include adult titles in results
26
- * @reference https://developer.themoviedb.org/reference/keyword-movies
27
- */
28
- movies(params: KeywordMoviesParams): Promise<PaginatedResponse<MovieResultItem>>;
29
- }
@@ -1,38 +0,0 @@
1
- import { ENDPOINTS } from "../routes";
2
- import { TMDBAPIBase } from "./base";
3
- export class KeywordsAPI extends TMDBAPIBase {
4
- keywordPath(keyword_id) {
5
- return `${ENDPOINTS.KEYWORDS.DETAILS}/${keyword_id}`;
6
- }
7
- /**
8
- * Details
9
- * GET - https://api.themoviedb.org/3/keyword/{keyword_id}
10
- *
11
- * Get the details of a keyword by ID.
12
- *
13
- * @param keyword_id Unique identifier for the keyword
14
- * @reference https://developer.themoviedb.org/reference/keyword-details
15
- */
16
- async details(params) {
17
- const endpoint = this.keywordPath(params.keyword_id);
18
- return this.client.request(endpoint, params);
19
- }
20
- /**
21
- * Movies
22
- * GET - https://api.themoviedb.org/3/keyword/{keyword_id}/movies
23
- *
24
- * Get the movies associated with a keyword.
25
- *
26
- * @deprecated TMDB marks this endpoint as deprecated. Use discover/movie with_keywords instead.
27
- * @param keyword_id Unique identifier for the keyword
28
- * @param language Language for localized results
29
- * @param page Page number for paginated results
30
- * @param include_adult Include adult titles in results
31
- * @reference https://developer.themoviedb.org/reference/keyword-movies
32
- */
33
- async movies(params) {
34
- const endpoint = `${this.keywordPath(params.keyword_id)}${ENDPOINTS.KEYWORDS.MOVIES}`;
35
- const requestParams = this.withLanguage(params);
36
- return this.client.request(endpoint, requestParams);
37
- }
38
- }
@@ -1,53 +0,0 @@
1
- import { MovieResultItem, PaginatedResponse } from "../types";
2
- import { MovieListParams } from "../types/movies";
3
- import { TMDBAPIBase } from "./base";
4
- export declare class MovieListsAPI extends TMDBAPIBase {
5
- private withDefaults;
6
- /**
7
- * Fetch Movie List Wrapper
8
- * @param endpoint Endpoint to call
9
- * @param params Params for the request (language, page, region, etc)
10
- * @returns Specific to endpoint (MovieListResult)
11
- */
12
- private fetch_movie_list;
13
- /**
14
- * Now Playing
15
- * GET - https://api.themoviedb.org/3/movie/now_playing
16
- *
17
- * Get a list of movies that are currently in theatres.
18
- * @param language Language (Defaults to en-US or TMDB default)
19
- * @param page Page (Defaults to 1)
20
- * @param region ISO-3166-1 code
21
- */
22
- now_playing(params?: MovieListParams): Promise<PaginatedResponse<MovieResultItem>>;
23
- /**
24
- * Popular
25
- * GET - https://api.themoviedb.org/3/movie/popular
26
- *
27
- * Get a list of movies ordered by popularity.
28
- * @param language Language (Defaults to en-US or TMDB default)
29
- * @param page Page (Defaults to 1)
30
- * @param region ISO-3166-1 code
31
- */
32
- popular(params?: MovieListParams): Promise<PaginatedResponse<MovieResultItem>>;
33
- /**
34
- * Top Rated
35
- * GET - https://api.themoviedb.org/3/movie/top_rated
36
- *
37
- * Get a list of movies ordered by rating.
38
- * @param language Language (Defaults to en-US or TMDB default)
39
- * @param page Page (Defaults to 1)
40
- * @param region ISO-3166-1 code
41
- */
42
- top_rated(params?: MovieListParams): Promise<PaginatedResponse<MovieResultItem>>;
43
- /**
44
- * Upcoming
45
- * GET - https://api.themoviedb.org/3/movie/upcoming
46
- *
47
- * Get a list of movies that are being released soon.
48
- * @param language Language (Defaults to en-US or TMDB default)
49
- * @param page Page (Defaults to 1)
50
- * @param region ISO-3166-1 code
51
- */
52
- upcoming(params?: MovieListParams): Promise<PaginatedResponse<MovieResultItem>>;
53
- }
@@ -1,65 +0,0 @@
1
- import { ENDPOINTS } from "../routes";
2
- import { TMDBAPIBase } from "./base";
3
- export class MovieListsAPI extends TMDBAPIBase {
4
- withDefaults(params) {
5
- const { language = this.defaultOptions.language, region = this.defaultOptions.region, ...rest } = params;
6
- return { language, region, ...rest };
7
- }
8
- /**
9
- * Fetch Movie List Wrapper
10
- * @param endpoint Endpoint to call
11
- * @param params Params for the request (language, page, region, etc)
12
- * @returns Specific to endpoint (MovieListResult)
13
- */
14
- fetch_movie_list(endpoint, params = {}) {
15
- return this.client.request(ENDPOINTS.MOVIES.DETAILS + endpoint, this.withDefaults(params));
16
- }
17
- /**
18
- * Now Playing
19
- * GET - https://api.themoviedb.org/3/movie/now_playing
20
- *
21
- * Get a list of movies that are currently in theatres.
22
- * @param language Language (Defaults to en-US or TMDB default)
23
- * @param page Page (Defaults to 1)
24
- * @param region ISO-3166-1 code
25
- */
26
- async now_playing(params = {}) {
27
- return this.fetch_movie_list(ENDPOINTS.MOVIES.NOW_PLAYING, params);
28
- }
29
- /**
30
- * Popular
31
- * GET - https://api.themoviedb.org/3/movie/popular
32
- *
33
- * Get a list of movies ordered by popularity.
34
- * @param language Language (Defaults to en-US or TMDB default)
35
- * @param page Page (Defaults to 1)
36
- * @param region ISO-3166-1 code
37
- */
38
- async popular(params = {}) {
39
- return this.fetch_movie_list(ENDPOINTS.MOVIES.POPULAR, params);
40
- }
41
- /**
42
- * Top Rated
43
- * GET - https://api.themoviedb.org/3/movie/top_rated
44
- *
45
- * Get a list of movies ordered by rating.
46
- * @param language Language (Defaults to en-US or TMDB default)
47
- * @param page Page (Defaults to 1)
48
- * @param region ISO-3166-1 code
49
- */
50
- async top_rated(params = {}) {
51
- return this.fetch_movie_list(ENDPOINTS.MOVIES.TOP_RATED, params);
52
- }
53
- /**
54
- * Upcoming
55
- * GET - https://api.themoviedb.org/3/movie/upcoming
56
- *
57
- * Get a list of movies that are being released soon.
58
- * @param language Language (Defaults to en-US or TMDB default)
59
- * @param page Page (Defaults to 1)
60
- * @param region ISO-3166-1 code
61
- */
62
- async upcoming(params = {}) {
63
- return this.fetch_movie_list(ENDPOINTS.MOVIES.UPCOMING, params);
64
- }
65
- }