@tdanks2000/tmdb-wrapper 1.0.3 → 1.1.1

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 (185) hide show
  1. package/README.md +334 -148
  2. package/dist/endpoints/account.js +2 -13
  3. package/dist/endpoints/certification.js +4 -17
  4. package/dist/endpoints/changes.js +6 -21
  5. package/dist/endpoints/collections.js +10 -26
  6. package/dist/endpoints/companies.js +6 -21
  7. package/dist/endpoints/configuration.js +2 -13
  8. package/dist/endpoints/credits.js +2 -13
  9. package/dist/endpoints/discover.js +4 -17
  10. package/dist/endpoints/find.js +2 -13
  11. package/dist/endpoints/genre.js +4 -17
  12. package/dist/endpoints/index.js +3 -0
  13. package/dist/endpoints/keywords.js +4 -17
  14. package/dist/endpoints/movies.js +48 -98
  15. package/dist/endpoints/networks.js +6 -21
  16. package/dist/endpoints/people.js +26 -57
  17. package/dist/endpoints/review.js +2 -13
  18. package/dist/endpoints/search.js +14 -37
  19. package/dist/endpoints/trending.js +2 -13
  20. package/dist/endpoints/tvEpisodes.js +26 -48
  21. package/dist/endpoints/tvSeasons.js +28 -52
  22. package/dist/endpoints/tvShows.js +58 -115
  23. package/dist/endpoints/watchProviders.js +46 -0
  24. package/dist/index.js +3 -0
  25. package/dist/utils/api.js +12 -23
  26. package/dist/utils/getimagePath.js +39 -8
  27. package/package.json +59 -41
  28. package/.github/workflows/npm-publish.yml +0 -33
  29. package/dist/@types/endpoints/account.d.ts +0 -16
  30. package/dist/@types/endpoints/account.d.ts.map +0 -1
  31. package/dist/@types/endpoints/certification.d.ts +0 -19
  32. package/dist/@types/endpoints/certification.d.ts.map +0 -1
  33. package/dist/@types/endpoints/changes.d.ts +0 -26
  34. package/dist/@types/endpoints/changes.d.ts.map +0 -1
  35. package/dist/@types/endpoints/collection.d.ts +0 -21
  36. package/dist/@types/endpoints/collection.d.ts.map +0 -1
  37. package/dist/@types/endpoints/companies.d.ts +0 -29
  38. package/dist/@types/endpoints/companies.d.ts.map +0 -1
  39. package/dist/@types/endpoints/configuration.d.ts +0 -106
  40. package/dist/@types/endpoints/configuration.d.ts.map +0 -1
  41. package/dist/@types/endpoints/credits.d.ts +0 -135
  42. package/dist/@types/endpoints/credits.d.ts.map +0 -1
  43. package/dist/@types/endpoints/discover.d.ts +0 -68
  44. package/dist/@types/endpoints/discover.d.ts.map +0 -1
  45. package/dist/@types/endpoints/find.d.ts +0 -20
  46. package/dist/@types/endpoints/find.d.ts.map +0 -1
  47. package/dist/@types/endpoints/genre.d.ts +0 -7
  48. package/dist/@types/endpoints/genre.d.ts.map +0 -1
  49. package/dist/@types/endpoints/index.d.ts +0 -23
  50. package/dist/@types/endpoints/index.d.ts.map +0 -1
  51. package/dist/@types/endpoints/keywords.d.ts +0 -21
  52. package/dist/@types/endpoints/keywords.d.ts.map +0 -1
  53. package/dist/@types/endpoints/movies.d.ts +0 -150
  54. package/dist/@types/endpoints/movies.d.ts.map +0 -1
  55. package/dist/@types/endpoints/networks.d.ts +0 -14
  56. package/dist/@types/endpoints/networks.d.ts.map +0 -1
  57. package/dist/@types/endpoints/options.d.ts +0 -73
  58. package/dist/@types/endpoints/options.d.ts.map +0 -1
  59. package/dist/@types/endpoints/people.d.ts +0 -135
  60. package/dist/@types/endpoints/people.d.ts.map +0 -1
  61. package/dist/@types/endpoints/review.d.ts +0 -8
  62. package/dist/@types/endpoints/review.d.ts.map +0 -1
  63. package/dist/@types/endpoints/search.d.ts +0 -32
  64. package/dist/@types/endpoints/search.d.ts.map +0 -1
  65. package/dist/@types/endpoints/trending.d.ts +0 -12
  66. package/dist/@types/endpoints/trending.d.ts.map +0 -1
  67. package/dist/@types/endpoints/tvEpisode.d.ts +0 -65
  68. package/dist/@types/endpoints/tvEpisode.d.ts.map +0 -1
  69. package/dist/@types/endpoints/tvSeasons.d.ts +0 -31
  70. package/dist/@types/endpoints/tvSeasons.d.ts.map +0 -1
  71. package/dist/@types/endpoints/tvShows.d.ts +0 -260
  72. package/dist/@types/endpoints/tvShows.d.ts.map +0 -1
  73. package/dist/@types/endpoints/watchProviders.d.ts +0 -295
  74. package/dist/@types/endpoints/watchProviders.d.ts.map +0 -1
  75. package/dist/@types/index.d.ts +0 -4
  76. package/dist/@types/index.d.ts.map +0 -1
  77. package/dist/@types/models/baseEndpoint.d.ts +0 -7
  78. package/dist/@types/models/baseEndpoint.d.ts.map +0 -1
  79. package/dist/@types/models/index.d.ts +0 -2
  80. package/dist/@types/models/index.d.ts.map +0 -1
  81. package/dist/@types/types.d.ts +0 -174
  82. package/dist/@types/types.d.ts.map +0 -1
  83. package/dist/endpoints/account.d.ts +0 -17
  84. package/dist/endpoints/account.d.ts.map +0 -1
  85. package/dist/endpoints/certification.d.ts +0 -23
  86. package/dist/endpoints/certification.d.ts.map +0 -1
  87. package/dist/endpoints/changes.d.ts +0 -31
  88. package/dist/endpoints/changes.d.ts.map +0 -1
  89. package/dist/endpoints/collections.d.ts +0 -34
  90. package/dist/endpoints/collections.d.ts.map +0 -1
  91. package/dist/endpoints/companies.d.ts +0 -31
  92. package/dist/endpoints/companies.d.ts.map +0 -1
  93. package/dist/endpoints/configuration.d.ts +0 -18
  94. package/dist/endpoints/configuration.d.ts.map +0 -1
  95. package/dist/endpoints/credits.d.ts +0 -19
  96. package/dist/endpoints/credits.d.ts.map +0 -1
  97. package/dist/endpoints/discover.d.ts +0 -24
  98. package/dist/endpoints/discover.d.ts.map +0 -1
  99. package/dist/endpoints/find.d.ts +0 -19
  100. package/dist/endpoints/find.d.ts.map +0 -1
  101. package/dist/endpoints/genre.d.ts +0 -25
  102. package/dist/endpoints/genre.d.ts.map +0 -1
  103. package/dist/endpoints/index.d.ts +0 -19
  104. package/dist/endpoints/index.d.ts.map +0 -1
  105. package/dist/endpoints/keywords.d.ts +0 -25
  106. package/dist/endpoints/keywords.d.ts.map +0 -1
  107. package/dist/endpoints/movies.d.ts +0 -142
  108. package/dist/endpoints/movies.d.ts.map +0 -1
  109. package/dist/endpoints/networks.d.ts +0 -31
  110. package/dist/endpoints/networks.d.ts.map +0 -1
  111. package/dist/endpoints/people.d.ts +0 -84
  112. package/dist/endpoints/people.d.ts.map +0 -1
  113. package/dist/endpoints/review.d.ts +0 -18
  114. package/dist/endpoints/review.d.ts.map +0 -1
  115. package/dist/endpoints/search.d.ts +0 -58
  116. package/dist/endpoints/search.d.ts.map +0 -1
  117. package/dist/endpoints/trending.d.ts +0 -21
  118. package/dist/endpoints/trending.d.ts.map +0 -1
  119. package/dist/endpoints/tvEpisodes.d.ts +0 -61
  120. package/dist/endpoints/tvEpisodes.d.ts.map +0 -1
  121. package/dist/endpoints/tvSeasons.d.ts +0 -70
  122. package/dist/endpoints/tvSeasons.d.ts.map +0 -1
  123. package/dist/endpoints/tvShows.d.ts +0 -164
  124. package/dist/endpoints/tvShows.d.ts.map +0 -1
  125. package/dist/index.d.ts +0 -26
  126. package/dist/index.d.ts.map +0 -1
  127. package/dist/utils/api.d.ts +0 -7
  128. package/dist/utils/api.d.ts.map +0 -1
  129. package/dist/utils/getimagePath.d.ts +0 -12
  130. package/dist/utils/getimagePath.d.ts.map +0 -1
  131. package/dist/utils/index.d.ts +0 -3
  132. package/dist/utils/index.d.ts.map +0 -1
  133. package/src/@types/endpoints/account.ts +0 -17
  134. package/src/@types/endpoints/certification.ts +0 -19
  135. package/src/@types/endpoints/changes.ts +0 -29
  136. package/src/@types/endpoints/collection.ts +0 -23
  137. package/src/@types/endpoints/companies.ts +0 -33
  138. package/src/@types/endpoints/configuration.ts +0 -112
  139. package/src/@types/endpoints/credits.ts +0 -149
  140. package/src/@types/endpoints/discover.ts +0 -87
  141. package/src/@types/endpoints/find.ts +0 -28
  142. package/src/@types/endpoints/genre.ts +0 -3
  143. package/src/@types/endpoints/index.ts +0 -22
  144. package/src/@types/endpoints/keywords.ts +0 -24
  145. package/src/@types/endpoints/movies.ts +0 -169
  146. package/src/@types/endpoints/networks.ts +0 -15
  147. package/src/@types/endpoints/options.ts +0 -189
  148. package/src/@types/endpoints/people.ts +0 -151
  149. package/src/@types/endpoints/review.ts +0 -8
  150. package/src/@types/endpoints/search.ts +0 -39
  151. package/src/@types/endpoints/trending.ts +0 -20
  152. package/src/@types/endpoints/tvEpisode.ts +0 -72
  153. package/src/@types/endpoints/tvSeasons.ts +0 -37
  154. package/src/@types/endpoints/tvShows.ts +0 -284
  155. package/src/@types/endpoints/watchProviders.ts +0 -298
  156. package/src/@types/index.ts +0 -3
  157. package/src/@types/models/baseEndpoint.ts +0 -9
  158. package/src/@types/models/index.ts +0 -1
  159. package/src/@types/types.ts +0 -199
  160. package/src/endpoints/account.ts +0 -22
  161. package/src/endpoints/certification.ts +0 -30
  162. package/src/endpoints/changes.ts +0 -41
  163. package/src/endpoints/collections.ts +0 -57
  164. package/src/endpoints/companies.ts +0 -41
  165. package/src/endpoints/configuration.ts +0 -22
  166. package/src/endpoints/credits.ts +0 -23
  167. package/src/endpoints/discover.ts +0 -40
  168. package/src/endpoints/find.ts +0 -24
  169. package/src/endpoints/genre.ts +0 -32
  170. package/src/endpoints/index.ts +0 -18
  171. package/src/endpoints/keywords.ts +0 -35
  172. package/src/endpoints/movies.ts +0 -244
  173. package/src/endpoints/networks.ts +0 -41
  174. package/src/endpoints/people.ts +0 -147
  175. package/src/endpoints/review.ts +0 -23
  176. package/src/endpoints/search.ts +0 -93
  177. package/src/endpoints/trending.ts +0 -30
  178. package/src/endpoints/tvEpisodes.ts +0 -125
  179. package/src/endpoints/tvSeasons.ts +0 -138
  180. package/src/endpoints/tvShows.ts +0 -286
  181. package/src/index.ts +0 -66
  182. package/src/utils/api.ts +0 -31
  183. package/src/utils/getimagePath.ts +0 -16
  184. package/src/utils/index.ts +0 -2
  185. package/tsconfig.json +0 -101
@@ -1,22 +0,0 @@
1
- import { BaseEndpoint, Configuration } from '../@types';
2
-
3
- /**
4
- * Represents an endpoint for retrieving current system configuration.
5
- */
6
- export class ConfigurationEndpoint extends BaseEndpoint {
7
- /**
8
- * Constructs a new ConfigurationEndpoint instance.
9
- * @param {string} access_token - The access token used for authentication.
10
- */
11
- constructor(protected readonly access_token: string) {
12
- super(access_token);
13
- }
14
-
15
- /**
16
- * Retrieves the current system configuration asynchronously.
17
- * @returns {Promise<Configuration>} A Promise that resolves with the current system configuration.
18
- */
19
- async getCurrent(): Promise<Configuration> {
20
- return await this.api.get<Configuration>(`/configuration`);
21
- }
22
- }
@@ -1,23 +0,0 @@
1
- import { BaseEndpoint, CreditResponse } from '../@types';
2
-
3
- /**
4
- * Represents an endpoint for retrieving credit details.
5
- */
6
- export class CreditsEndpoint extends BaseEndpoint {
7
- /**
8
- * Constructs a new CreditsEndpoint instance.
9
- * @param {string} access_token - The access token used for authentication.
10
- */
11
- constructor(protected readonly access_token: string) {
12
- super(access_token);
13
- }
14
-
15
- /**
16
- * Retrieves credit details by ID asynchronously.
17
- * @param {string} id - The ID of the credit.
18
- * @returns {Promise<CreditResponse>} A Promise that resolves with the credit details.
19
- */
20
- async getById(id: string): Promise<CreditResponse> {
21
- return await this.api.get<CreditResponse>(`/credit/${id}`);
22
- }
23
- }
@@ -1,40 +0,0 @@
1
- import {
2
- BaseEndpoint,
3
- MovieDiscoverResult,
4
- MovieQueryOptions,
5
- TvShowDiscoverResult,
6
- TvShowQueryOptions,
7
- } from '../@types';
8
-
9
- const BASE_DISCOVER = '/discover';
10
-
11
- /**
12
- * Represents an endpoint for discovering movies and TV shows based on various criteria.
13
- */
14
- export class DiscoverEndpoint extends BaseEndpoint {
15
- /**
16
- * Constructs a new DiscoverEndpoint instance.
17
- * @param {string} access_token - The access token used for authentication.
18
- */
19
- constructor(access_token: string) {
20
- super(access_token);
21
- }
22
-
23
- /**
24
- * Retrieves a list of movies based on the provided query options asynchronously.
25
- * @param {MovieQueryOptions} [options] - Optional parameters for refining the movie discovery.
26
- * @returns {Promise<MovieDiscoverResult>} A Promise that resolves with the movie discovery results.
27
- */
28
- async movie(options?: MovieQueryOptions): Promise<MovieDiscoverResult> {
29
- return await this.api.get<MovieDiscoverResult>(`${BASE_DISCOVER}/movie`, options);
30
- }
31
-
32
- /**
33
- * Retrieves a list of TV shows based on the provided query options asynchronously.
34
- * @param {TvShowQueryOptions} [options] - Optional parameters for refining the TV show discovery.
35
- * @returns {Promise<TvShowDiscoverResult>} A Promise that resolves with the TV show discovery results.
36
- */
37
- async tvShow(options?: TvShowQueryOptions): Promise<TvShowDiscoverResult> {
38
- return await this.api.get<TvShowDiscoverResult>(`${BASE_DISCOVER}/tv`, options);
39
- }
40
- }
@@ -1,24 +0,0 @@
1
- import { BaseEndpoint, ExternalIdOptions, FindResult } from '../@types';
2
-
3
- /**
4
- * Represents an endpoint for finding media by external ID.
5
- */
6
- export class FindEndpoint extends BaseEndpoint {
7
- /**
8
- * Constructs a new FindEndpoint instance.
9
- * @param {string} access_token - The access token used for authentication.
10
- */
11
- constructor(access_token: string) {
12
- super(access_token);
13
- }
14
-
15
- /**
16
- * Retrieves media by external ID asynchronously.
17
- * @param {string} externalId - The external ID of the media.
18
- * @param {ExternalIdOptions} options - Options for finding media by external ID.
19
- * @returns {Promise<FindResult>} A Promise that resolves with the result of the find operation.
20
- */
21
- async byId(externalId: string, options: ExternalIdOptions): Promise<FindResult> {
22
- return await this.api.get<FindResult>(`/find/${externalId}`, options);
23
- }
24
- }
@@ -1,32 +0,0 @@
1
- import { BaseEndpoint, Genres, LanguageOption } from '../@types';
2
-
3
- /**
4
- * Represents an endpoint for retrieving genre information for movies and TV shows.
5
- */
6
- export class GenreEndpoint extends BaseEndpoint {
7
- /**
8
- * Constructs a new GenreEndpoint instance.
9
- * @param {string} access_token - The access token used for authentication.
10
- */
11
- constructor(protected readonly access_token: string) {
12
- super(access_token);
13
- }
14
-
15
- /**
16
- * Retrieves genre information for movies asynchronously.
17
- * @param {LanguageOption} [options] - Optional parameters for specifying the language.
18
- * @returns {Promise<Genres>} A Promise that resolves with the genre information for movies.
19
- */
20
- async movies(options?: LanguageOption): Promise<Genres> {
21
- return await this.api.get<Genres>('/genre/movie/list', options);
22
- }
23
-
24
- /**
25
- * Retrieves genre information for TV shows asynchronously.
26
- * @param {LanguageOption} [options] - Optional parameters for specifying the language.
27
- * @returns {Promise<Genres>} A Promise that resolves with the genre information for TV shows.
28
- */
29
- async tv(options?: LanguageOption): Promise<Genres> {
30
- return await this.api.get<Genres>('/genre/tv/list', options);
31
- }
32
- }
@@ -1,18 +0,0 @@
1
- export * from './account';
2
- export * from './certification';
3
- export * from './changes';
4
- export * from './collections';
5
- export * from './configuration';
6
- export * from './credits';
7
- export * from './discover';
8
- export * from './find';
9
- export * from './genre';
10
- export * from './keywords';
11
- export * from './movies';
12
- export * from './people';
13
- export * from './review';
14
- export * from './search';
15
- export * from './trending';
16
- export * from './tvEpisodes';
17
- export * from './tvSeasons';
18
- export * from './tvShows';
@@ -1,35 +0,0 @@
1
- import { BaseEndpoint, BelongingMovies, Keyword, KeywordsOptions } from '../@types';
2
-
3
- const BASE_KEYWORD = '/keyword';
4
-
5
- /**
6
- * Represents an endpoint for accessing keyword details and related movies.
7
- */
8
- export class KeywordsEndpoint extends BaseEndpoint {
9
- /**
10
- * Constructs a new KeywordsEndpoint instance.
11
- * @param {string} access_token - The access token used for authentication.
12
- */
13
- constructor(access_token: string) {
14
- super(access_token);
15
- }
16
-
17
- /**
18
- * Retrieves details of a specific keyword asynchronously.
19
- * @param {number} keywordId - The ID of the keyword.
20
- * @returns {Promise<Keyword>} A Promise that resolves with the details of the keyword.
21
- */
22
- async details(keywordId: number): Promise<Keyword> {
23
- return await this.api.get<Keyword>(`${BASE_KEYWORD}/${keywordId}`);
24
- }
25
-
26
- /**
27
- * Retrieves movies belonging to a specific keyword asynchronously.
28
- * @param {number} keywordId - The ID of the keyword.
29
- * @param {KeywordsOptions} [options] - Optional parameters for refining the search.
30
- * @returns {Promise<BelongingMovies>} A Promise that resolves with the movies belonging to the keyword.
31
- */
32
- async belongingMovies(keywordId: number, options?: KeywordsOptions): Promise<BelongingMovies> {
33
- return await this.api.get<BelongingMovies>(`${BASE_KEYWORD}/${keywordId}/movies`, options);
34
- }
35
- }
@@ -1,244 +0,0 @@
1
- import {
2
- AlternativeTitles,
3
- AppendToResponse,
4
- AppendToResponseMovieKey,
5
- BaseEndpoint,
6
- ChangeOption,
7
- Changes,
8
- Credits,
9
- ExternalIds,
10
- Images,
11
- Keywords,
12
- LanguageOption,
13
- LatestMovie,
14
- MovieChangeValue,
15
- MovieDetails,
16
- MovieLists,
17
- MoviesImageSearchOptions,
18
- MoviesPlayingNow,
19
- PageOption,
20
- PopularMovies,
21
- Recommendations,
22
- RegionOption,
23
- ReleaseDates,
24
- Reviews,
25
- SimilarMovies,
26
- TopRatedMovies,
27
- Translations,
28
- UpcomingMovies,
29
- Videos,
30
- WatchProviders,
31
- } from '../@types';
32
-
33
- const BASE_MOVIE = '/movie';
34
-
35
- /**
36
- * Represents an endpoint for accessing movie-related information.
37
- */
38
- export class MoviesEndpoint extends BaseEndpoint {
39
- /**
40
- * Constructs a new MoviesEndpoint instance.
41
- * @param {string} access_token - The access token used for authentication.
42
- */
43
- constructor(protected readonly access_token: string) {
44
- super(access_token);
45
- }
46
-
47
- /**
48
- * Retrieves details of a specific movie asynchronously.
49
- * @param {number} id - The ID of the movie.
50
- * @param {AppendToResponseMovieKey[]} [appendToResponse] - Optional keys to append to the response.
51
- * @param {string} [language] - Optional parameter for specifying the language.
52
- * @returns {Promise<AppendToResponse<MovieDetails, AppendToResponseMovieKey[], 'movie'>>} A Promise that resolves with the details of the movie.
53
- */
54
- async details<T extends AppendToResponseMovieKey[] | undefined>(id: number, appendToResponse?: T, language?: string) {
55
- const options = {
56
- append_to_response: appendToResponse ? appendToResponse.join(',') : undefined,
57
- language: language,
58
- };
59
-
60
- return await this.api.get<AppendToResponse<MovieDetails, T, 'movie'>>(`${BASE_MOVIE}/${id}`, options);
61
- }
62
-
63
- /**
64
- * Retrieves alternative titles of a specific movie asynchronously.
65
- * @param {number} id - The ID of the movie.
66
- * @returns {Promise<AlternativeTitles>} A Promise that resolves with the alternative titles of the movie.
67
- */
68
- async alternativeTitles(id: number): Promise<AlternativeTitles> {
69
- return await this.api.get<AlternativeTitles>(`${BASE_MOVIE}/${id}/alternative_titles`);
70
- }
71
-
72
- /**
73
- * Retrieves changes made to a specific movie asynchronously.
74
- * @param {number} id - The ID of the movie.
75
- * @param {ChangeOption} [options] - Optional parameters for filtering changes.
76
- * @returns {Promise<Changes<MovieChangeValue>>} A Promise that resolves with the changes made to the movie.
77
- */
78
- async changes(id: number, options?: ChangeOption): Promise<Changes<MovieChangeValue>> {
79
- return await this.api.get<Changes<MovieChangeValue>>(`${BASE_MOVIE}/${id}/changes`, options);
80
- }
81
-
82
- /**
83
- * Retrieves credits of a specific movie asynchronously.
84
- * @param {number} id - The ID of the movie.
85
- * @param {LanguageOption} [options] - Optional parameters for specifying the language.
86
- * @returns {Promise<Credits>} A Promise that resolves with the credits of the movie.
87
- */
88
- async credits(id: number, options?: LanguageOption): Promise<Credits> {
89
- return await this.api.get<Credits>(`${BASE_MOVIE}/${id}/credits`, options);
90
- }
91
-
92
- /**
93
- * Retrieves external IDs of a specific movie asynchronously.
94
- * @param {number} id - The ID of the movie.
95
- * @returns {Promise<ExternalIds>} A Promise that resolves with the external IDs of the movie.
96
- */
97
- async externalIds(id: number): Promise<ExternalIds> {
98
- return await this.api.get<ExternalIds>(`${BASE_MOVIE}/${id}/external_ids`);
99
- }
100
-
101
- /**
102
- * Retrieves images of a specific movie asynchronously.
103
- * @param {number} id - The ID of the movie.
104
- * @param {MoviesImageSearchOptions} [options] - Optional parameters for specifying image search options.
105
- * @returns {Promise<Images>} A Promise that resolves with the images of the movie.
106
- */
107
- async images(id: number, options?: MoviesImageSearchOptions): Promise<Images> {
108
- const computedOptions = {
109
- include_image_language: options?.include_image_language?.join(','),
110
- language: options?.language,
111
- };
112
- return await this.api.get<Images>(`${BASE_MOVIE}/${id}/images`, computedOptions);
113
- }
114
-
115
- /**
116
- * Retrieves keywords of a specific movie asynchronously.
117
- * @param {number} id - The ID of the movie.
118
- * @returns {Promise<Keywords>} A Promise that resolves with the keywords of the movie.
119
- */
120
- async keywords(id: number): Promise<Keywords> {
121
- return await this.api.get<Keywords>(`${BASE_MOVIE}/${id}/keywords`);
122
- }
123
-
124
- /**
125
- * Retrieves lists containing a specific movie asynchronously.
126
- * @param {number} id - The ID of the movie.
127
- * @param {LanguageOption & PageOption} [options] - Optional parameters for specifying language and pagination options.
128
- * @returns {Promise<MovieLists>} A Promise that resolves with the lists containing the movie.
129
- */
130
- async lists(id: number, options?: LanguageOption & PageOption): Promise<MovieLists> {
131
- return await this.api.get<MovieLists>(`${BASE_MOVIE}/${id}/lists`, options);
132
- }
133
-
134
- /**
135
- * Retrieves recommendations for a specific movie asynchronously.
136
- * @param {number} id - The ID of the movie.
137
- * @param {LanguageOption & PageOption} [options] - Optional parameters for specifying language and pagination options.
138
- * @returns {Promise<Recommendations>} A Promise that resolves with the recommendations for the movie.
139
- */
140
- async recommendations(id: number, options?: LanguageOption & PageOption): Promise<Recommendations> {
141
- return await this.api.get<Recommendations>(`${BASE_MOVIE}/${id}/recommendations`, options);
142
- }
143
-
144
- /**
145
- * Retrieves release dates of a specific movie asynchronously.
146
- * @param {number} id - The ID of the movie.
147
- * @returns {Promise<ReleaseDates>} A Promise that resolves with the release dates of the movie.
148
- */
149
- async releaseDates(id: number): Promise<ReleaseDates> {
150
- return await this.api.get<ReleaseDates>(`${BASE_MOVIE}/${id}/release_dates`);
151
- }
152
-
153
- /**
154
- * Retrieves reviews for a specific movie asynchronously.
155
- * @param {number} id - The ID of the movie.
156
- * @param {LanguageOption & PageOption} [options] - Optional parameters for specifying language and pagination options.
157
- * @returns {Promise<Reviews>} A Promise that resolves with the reviews for the movie.
158
- */
159
- async reviews(id: number, options?: LanguageOption & PageOption): Promise<Reviews> {
160
- return await this.api.get<Reviews>(`${BASE_MOVIE}/${id}/reviews`, options);
161
- }
162
-
163
- /**
164
- * Retrieves similar movies for a specific movie asynchronously.
165
- * @param {number} id - The ID of the movie.
166
- * @param {LanguageOption & PageOption} [options] - Optional parameters for specifying language and pagination options.
167
- * @returns {Promise<SimilarMovies>} A Promise that resolves with the similar movies for the movie.
168
- */
169
- async similar(id: number, options?: LanguageOption & PageOption): Promise<SimilarMovies> {
170
- return await this.api.get<SimilarMovies>(`${BASE_MOVIE}/${id}/similar`, options);
171
- }
172
-
173
- /**
174
- * Retrieves translations of a specific movie asynchronously.
175
- * @param {number} id - The ID of the movie.
176
- * @returns {Promise<Translations>} A Promise that resolves with the translations of the movie.
177
- */
178
- async translations(id: number): Promise<Translations> {
179
- return await this.api.get<Translations>(`${BASE_MOVIE}/${id}/translations`);
180
- }
181
-
182
- /**
183
- * Retrieves videos of a specific movie asynchronously.
184
- * @param {number} id - The ID of the movie.
185
- * @param {LanguageOption} [options] - Optional parameters for specifying the language.
186
- * @returns {Promise<Videos>} A Promise that resolves with the videos of the movie.
187
- */
188
- async videos(id: number, options?: LanguageOption): Promise<Videos> {
189
- return await this.api.get<Videos>(`${BASE_MOVIE}/${id}/videos`, options);
190
- }
191
-
192
- /**
193
- * Retrieves watch providers of a specific movie asynchronously.
194
- * @param {number} id - The ID of the movie.
195
- * @returns {Promise<WatchProviders>} A Promise that resolves with the watch providers of the movie.
196
- */
197
- async watchProviders(id: number): Promise<WatchProviders> {
198
- return await this.api.get<WatchProviders>(`${BASE_MOVIE}/${id}/watch/providers`);
199
- }
200
-
201
- /**
202
- * Retrieves details of the latest movie asynchronously.
203
- * @returns {Promise<LatestMovie>} A Promise that resolves with the details of the latest movie.
204
- */
205
- async latest(): Promise<LatestMovie> {
206
- return await this.api.get<LatestMovie>(`${BASE_MOVIE}/latest`);
207
- }
208
-
209
- /**
210
- * Retrieves movies playing now asynchronously.
211
- * @param {PageOption & LanguageOption & RegionOption} [options] - Optional parameters for specifying language, region, and pagination options.
212
- * @returns {Promise<MoviesPlayingNow>} A Promise that resolves with the movies playing now.
213
- */
214
- async nowPlaying(options?: PageOption & LanguageOption & RegionOption): Promise<MoviesPlayingNow> {
215
- return await this.api.get<MoviesPlayingNow>(`${BASE_MOVIE}/now_playing`, options);
216
- }
217
-
218
- /**
219
- * Retrieves popular movies asynchronously.
220
- * @param {LanguageOption & PageOption} [options] - Optional parameters for specifying language and pagination options.
221
- * @returns {Promise<PopularMovies>} A Promise that resolves with the popular movies.
222
- */
223
- async popular(options?: LanguageOption & PageOption): Promise<PopularMovies> {
224
- return await this.api.get<PopularMovies>(`${BASE_MOVIE}/popular`, options);
225
- }
226
-
227
- /**
228
- * Retrieves top rated movies asynchronously.
229
- * @param {PageOption & LanguageOption & RegionOption} [options] - Optional parameters for specifying language, region, and pagination options.
230
- * @returns {Promise<TopRatedMovies>} A Promise that resolves with the top rated movies.
231
- */
232
- async topRated(options?: PageOption & LanguageOption & RegionOption): Promise<TopRatedMovies> {
233
- return await this.api.get<TopRatedMovies>(`${BASE_MOVIE}/top_rated`, options);
234
- }
235
-
236
- /**
237
- * Retrieves upcoming movies asynchronously.
238
- * @param {PageOption & LanguageOption & RegionOption} [options] - Optional parameters for specifying language, region, and pagination options.
239
- * @returns {Promise<UpcomingMovies>} A Promise that resolves with the upcoming movies.
240
- */
241
- async upcoming(options?: PageOption & LanguageOption & RegionOption): Promise<UpcomingMovies> {
242
- return await this.api.get<UpcomingMovies>(`${BASE_MOVIE}/upcoming`, options);
243
- }
244
- }
@@ -1,41 +0,0 @@
1
- import { AlternativeNames, BaseEndpoint, NetworkDetails, NetworkImages } from '../@types';
2
-
3
- /**
4
- * Represents an endpoint for accessing network details.
5
- */
6
- export class NetworksEndpoint extends BaseEndpoint {
7
- /**
8
- * Constructs a new NetworksEndpoint instance.
9
- * @param {string} access_token - The access token used for authentication.
10
- */
11
- constructor(protected readonly access_token: string) {
12
- super(access_token);
13
- }
14
-
15
- /**
16
- * Retrieves details of a specific network asynchronously.
17
- * @param {number} id - The ID of the network.
18
- * @returns {Promise<NetworkDetails>} A Promise that resolves with the details of the network.
19
- */
20
- async details(id: number): Promise<NetworkDetails> {
21
- return await this.api.get<NetworkDetails>(`/network/${id}`);
22
- }
23
-
24
- /**
25
- * Retrieves alternative names of a specific network asynchronously.
26
- * @param {number} id - The ID of the network.
27
- * @returns {Promise<AlternativeNames>} A Promise that resolves with the alternative names of the network.
28
- */
29
- async alternativeNames(id: number): Promise<AlternativeNames> {
30
- return await this.api.get<AlternativeNames>(`/network/${id}/alternative_names`);
31
- }
32
-
33
- /**
34
- * Retrieves images of a specific network asynchronously.
35
- * @param {number} id - The ID of the network.
36
- * @returns {Promise<NetworkImages>} A Promise that resolves with the images of the network.
37
- */
38
- async images(id: number): Promise<NetworkImages> {
39
- return await this.api.get<NetworkImages>(`/network/${id}/images`);
40
- }
41
- }
@@ -1,147 +0,0 @@
1
- import {
2
- AppendToResponse,
3
- AppendToResponsePersonKey,
4
- BaseEndpoint,
5
- ChangeOption,
6
- Changes,
7
- ExternalIds,
8
- LanguageOption,
9
- PageOption,
10
- PeopleImages,
11
- PersonChangeValue,
12
- PersonCombinedCredits,
13
- PersonDetails,
14
- PersonMovieCredit,
15
- PersonTranslations,
16
- PersonTvShowCredit,
17
- PopularPersons,
18
- TaggedImages,
19
- } from '../@types';
20
-
21
- const BASE_PERSON = '/person';
22
-
23
- /**
24
- * Represents an endpoint for accessing information about people.
25
- */
26
- export class PeopleEndpoint extends BaseEndpoint {
27
- /**
28
- * Constructs a new PeopleEndpoint instance.
29
- * @param {string} access_token - The access token used for authentication.
30
- */
31
- constructor(access_token: string) {
32
- super(access_token);
33
- }
34
-
35
- /**
36
- * Retrieves details of a specific person asynchronously.
37
- * @param {number} id - The ID of the person.
38
- * @param {AppendToResponsePersonKey[]} [appendToResponse] - Optional keys to append to the response.
39
- * @param {string} [language] - Optional parameter for specifying the language.
40
- * @returns {Promise<AppendToResponse<PersonDetails, AppendToResponsePersonKey[], 'person'>>} A Promise that resolves with the details of the person.
41
- */
42
- async details<T extends AppendToResponsePersonKey[] | undefined>(
43
- id: number,
44
- appendToResponse?: T,
45
- language?: string,
46
- ) {
47
- const options = {
48
- append_to_response: appendToResponse ? appendToResponse.join(',') : undefined,
49
- language: language,
50
- };
51
- return await this.api.get<AppendToResponse<PersonDetails, T, 'person'>>(`${BASE_PERSON}/${id}`, options);
52
- }
53
-
54
- /**
55
- * Retrieves changes made to a specific person asynchronously.
56
- * @param {number} id - The ID of the person.
57
- * @param {ChangeOption} [options] - Optional parameters for filtering changes.
58
- * @returns {Promise<Changes<PersonChangeValue>>} A Promise that resolves with the changes made to the person.
59
- */
60
- async changes(id: number, options?: ChangeOption): Promise<Changes<PersonChangeValue>> {
61
- return await this.api.get<Changes<PersonChangeValue>>(`${BASE_PERSON}/${id}/changes`, options);
62
- }
63
-
64
- /**
65
- * Retrieves movie credits of a specific person asynchronously.
66
- * @param {number} id - The ID of the person.
67
- * @param {LanguageOption} [options] - Optional parameters for specifying the language.
68
- * @returns {Promise<PersonMovieCredit>} A Promise that resolves with the movie credits of the person.
69
- */
70
- async movieCredits(id: number, options?: LanguageOption): Promise<PersonMovieCredit> {
71
- return await this.api.get<PersonMovieCredit>(`${BASE_PERSON}/${id}/movie_credits`, options);
72
- }
73
-
74
- /**
75
- * Retrieves TV show credits of a specific person asynchronously.
76
- * @param {number} id - The ID of the person.
77
- * @param {LanguageOption} [options] - Optional parameters for specifying the language.
78
- * @returns {Promise<PersonTvShowCredit>} A Promise that resolves with the TV show credits of the person.
79
- */
80
- async tvShowCredits(id: number, options?: LanguageOption): Promise<PersonTvShowCredit> {
81
- return await this.api.get<PersonTvShowCredit>(`${BASE_PERSON}/${id}/tv_credits`, options);
82
- }
83
-
84
- /**
85
- * Retrieves combined credits of a specific person asynchronously.
86
- * @param {number} id - The ID of the person.
87
- * @param {LanguageOption} [options] - Optional parameters for specifying the language.
88
- * @returns {Promise<PersonCombinedCredits>} A Promise that resolves with the combined credits of the person.
89
- */
90
- async combinedCredits(id: number, options?: LanguageOption): Promise<PersonCombinedCredits> {
91
- return await this.api.get<PersonCombinedCredits>(`${BASE_PERSON}/${id}/combined_credits`, options);
92
- }
93
-
94
- /**
95
- * Retrieves external IDs of a specific person asynchronously.
96
- * @param {number} id - The ID of the person.
97
- * @returns {Promise<ExternalIds>} A Promise that resolves with the external IDs of the person.
98
- */
99
- async externalId(id: number): Promise<ExternalIds> {
100
- return await this.api.get<ExternalIds>(`${BASE_PERSON}/${id}/external_ids`);
101
- }
102
-
103
- /**
104
- * Retrieves images of a specific person asynchronously.
105
- * @param {number} id - The ID of the person.
106
- * @returns {Promise<PeopleImages>} A Promise that resolves with the images of the person.
107
- */
108
- async images(id: number): Promise<PeopleImages> {
109
- return await this.api.get<PeopleImages>(`${BASE_PERSON}/${id}/images`);
110
- }
111
-
112
- /**
113
- * Retrieves tagged images of a specific person asynchronously.
114
- * @param {number} id - The ID of the person.
115
- * @param {PageOption} [options] - Optional parameters for specifying pagination options.
116
- * @returns {Promise<TaggedImages>} A Promise that resolves with the tagged images of the person.
117
- */
118
- async taggedImages(id: number, options?: PageOption): Promise<TaggedImages> {
119
- return await this.api.get<TaggedImages>(`${BASE_PERSON}/${id}/tagged_images`, options);
120
- }
121
-
122
- /**
123
- * Retrieves translations of a specific person asynchronously.
124
- * @param {number} id - The ID of the person.
125
- * @returns {Promise<PersonTranslations>} A Promise that resolves with the translations of the person.
126
- */
127
- async translation(id: number): Promise<PersonTranslations> {
128
- return await this.api.get<PersonTranslations>(`${BASE_PERSON}/${id}/translations`);
129
- }
130
-
131
- /**
132
- * Retrieves details of the latest person asynchronously.
133
- * @returns {Promise<PersonDetails>} A Promise that resolves with the details of the latest person.
134
- */
135
- async latest(): Promise<PersonDetails> {
136
- return await this.api.get<PersonDetails>(`${BASE_PERSON}/latest`);
137
- }
138
-
139
- /**
140
- * Retrieves popular persons asynchronously.
141
- * @param {LanguageOption & PageOption} [options] - Optional parameters for specifying language and pagination options.
142
- * @returns {Promise<PopularPersons>} A Promise that resolves with the popular persons.
143
- */
144
- async popular(options?: LanguageOption & PageOption): Promise<PopularPersons> {
145
- return await this.api.get<PopularPersons>(`${BASE_PERSON}/popular`, options);
146
- }
147
- }
@@ -1,23 +0,0 @@
1
- import { BaseEndpoint, ReviewDetails } from '../@types';
2
-
3
- /**
4
- * Represents an endpoint for accessing review details.
5
- */
6
- export class ReviewEndpoint extends BaseEndpoint {
7
- /**
8
- * Constructs a new ReviewEndpoint instance.
9
- * @param {string} access_token - The access token used for authentication.
10
- */
11
- constructor(access_token: string) {
12
- super(access_token);
13
- }
14
-
15
- /**
16
- * Retrieves details of a specific review asynchronously.
17
- * @param {string} id - The ID of the review.
18
- * @returns {Promise<ReviewDetails>} A Promise that resolves with the details of the review.
19
- */
20
- async details(id: string): Promise<ReviewDetails> {
21
- return await this.api.get<ReviewDetails>(`/review/${id}`);
22
- }
23
- }