@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,298 +0,0 @@
1
- export interface Flatrate {
2
- display_priority: number;
3
- logo_path: string;
4
- provider_id: number;
5
- provider_name: string;
6
- }
7
-
8
- export interface Rent {
9
- display_priority: number;
10
- logo_path: string;
11
- provider_id: number;
12
- provider_name: string;
13
- }
14
-
15
- export interface Buy {
16
- display_priority: number;
17
- logo_path: string;
18
- provider_id: number;
19
- provider_name: string;
20
- }
21
-
22
- export interface WatchLocale {
23
- AR: {
24
- link: string;
25
- flatrate: Flatrate[];
26
- rent: Rent[];
27
- buy: Buy[];
28
- };
29
- AT: {
30
- link: string;
31
- rent: Rent[];
32
- buy: Buy[];
33
- };
34
- AU: {
35
- link: string;
36
- flatrate: Flatrate[];
37
- rent: Rent[];
38
- buy: Buy[];
39
- };
40
- BE: {
41
- link: string;
42
- buy: Buy[];
43
- flatrate: Flatrate[];
44
- rent: Rent[];
45
- };
46
- BR: {
47
- link: string;
48
- rent: Rent[];
49
- buy: Buy[];
50
- flatrate: Flatrate[];
51
- };
52
- CA: {
53
- link: string;
54
- rent: Rent[];
55
- flatrate: Flatrate[];
56
- buy: Buy[];
57
- };
58
- CH: {
59
- link: string;
60
- rent: Rent[];
61
- buy: Buy[];
62
- flatrate: Flatrate[];
63
- };
64
- CL: {
65
- link: string;
66
- flatrate: Flatrate[];
67
- buy: Buy[];
68
- rent: Rent[];
69
- };
70
- CO: {
71
- link: string;
72
- flatrate: Flatrate[];
73
- rent: Rent[];
74
- buy: Buy[];
75
- };
76
- CZ: {
77
- link: string;
78
- buy: Buy[];
79
- flatrate: Flatrate[];
80
- rent: Rent[];
81
- };
82
- DE: {
83
- link: string;
84
- rent: Rent[];
85
- buy: Buy[];
86
- };
87
- DK: {
88
- link: string;
89
- rent: Rent[];
90
- buy: Buy[];
91
- flatrate: Flatrate[];
92
- };
93
- EC: {
94
- link: string;
95
- flatrate: Flatrate[];
96
- buy: Buy[];
97
- rent: Rent[];
98
- };
99
- EE: {
100
- link: string;
101
- flatrate: Flatrate[];
102
- buy: Buy[];
103
- rent: Rent[];
104
- };
105
- ES: {
106
- link: string;
107
- rent: Rent[];
108
- flatrate: Flatrate[];
109
- buy: Buy[];
110
- };
111
- FI: {
112
- link: string;
113
- buy: Buy[];
114
- flatrate: Flatrate[];
115
- rent: Rent[];
116
- };
117
- FR: {
118
- link: string;
119
- flatrate: Flatrate[];
120
- buy: Buy[];
121
- rent: Rent[];
122
- };
123
- GB: {
124
- link: string;
125
- rent: Rent[];
126
- flatrate: Flatrate[];
127
- buy: Buy[];
128
- };
129
- GR: {
130
- link: string;
131
- flatrate: Flatrate[];
132
- rent: Rent[];
133
- buy: Buy[];
134
- };
135
- HU: {
136
- link: string;
137
- rent: Rent[];
138
- buy: Buy[];
139
- flatrate: Flatrate[];
140
- };
141
- ID: {
142
- link: string;
143
- flatrate: Flatrate[];
144
- rent: Rent[];
145
- buy: Buy[];
146
- };
147
- IE: {
148
- link: string;
149
- rent: Rent[];
150
- flatrate: Flatrate[];
151
- buy: Buy[];
152
- };
153
- IN: {
154
- link: string;
155
- buy: Buy[];
156
- flatrate: Flatrate[];
157
- rent: Rent[];
158
- };
159
- IT: {
160
- link: string;
161
- buy: Buy[];
162
- flatrate: Flatrate[];
163
- rent: Rent[];
164
- };
165
- JP: {
166
- link: string;
167
- rent: Rent[];
168
- flatrate: Flatrate[];
169
- buy: Buy[];
170
- };
171
- KR: {
172
- link: string;
173
- buy: Buy[];
174
- rent: Rent[];
175
- flatrate: Flatrate[];
176
- };
177
- LT: {
178
- link: string;
179
- buy: Buy[];
180
- flatrate: Flatrate[];
181
- };
182
- LV: {
183
- link: string;
184
- buy: Buy[];
185
- flatrate: Flatrate[];
186
- };
187
- MX: {
188
- link: string;
189
- flatrate: Flatrate[];
190
- rent: Rent[];
191
- buy: Buy[];
192
- };
193
- MY: {
194
- link: string;
195
- rent: Rent[];
196
- flatrate: Flatrate[];
197
- buy: Buy[];
198
- };
199
- NL: {
200
- link: string;
201
- flatrate: Flatrate[];
202
- buy: Buy[];
203
- rent: Rent[];
204
- };
205
- NO: {
206
- link: string;
207
- buy: Buy[];
208
- rent: Rent[];
209
- flatrate: Flatrate[];
210
- };
211
- NZ: {
212
- link: string;
213
- buy: Buy[];
214
- rent: Rent[];
215
- flatrate: Flatrate[];
216
- };
217
- PE: {
218
- link: string;
219
- flatrate: Flatrate[];
220
- rent: Rent[];
221
- buy: Buy[];
222
- };
223
- PH: {
224
- link: string;
225
- rent: Rent[];
226
- buy: Buy[];
227
- flatrate: Flatrate[];
228
- };
229
- PL: {
230
- link: string;
231
- rent: Rent[];
232
- flatrate: Flatrate[];
233
- buy: Buy[];
234
- };
235
- PT: {
236
- link: string;
237
- rent: Rent[];
238
- flatrate: Flatrate[];
239
- buy: Buy[];
240
- };
241
- RO: {
242
- link: string;
243
- flatrate: Flatrate[];
244
- };
245
- RU: {
246
- link: string;
247
- rent: Rent[];
248
- flatrate: Flatrate[];
249
- buy: Buy[];
250
- };
251
- SE: {
252
- link: string;
253
- rent: Rent[];
254
- flatrate: Flatrate[];
255
- buy: Buy[];
256
- };
257
- SG: {
258
- link: string;
259
- flatrate: Flatrate[];
260
- buy: Buy[];
261
- rent: Rent[];
262
- };
263
- TH: {
264
- link: string;
265
- flatrate: Flatrate[];
266
- rent: Rent[];
267
- buy: Buy[];
268
- };
269
- TR: {
270
- link: string;
271
- buy: Buy[];
272
- rent: Rent[];
273
- flatrate: Flatrate[];
274
- };
275
- US: {
276
- link: string;
277
- rent: Rent[];
278
- buy: Buy[];
279
- flatrate: Flatrate[];
280
- };
281
- VE: {
282
- link: string;
283
- flatrate: Flatrate[];
284
- rent: Rent[];
285
- buy: Buy[];
286
- };
287
- ZA: {
288
- link: string;
289
- rent: Rent[];
290
- buy: Buy[];
291
- flatrate: Flatrate[];
292
- };
293
- }
294
-
295
- export interface WatchProviders {
296
- id: number;
297
- results: WatchLocale;
298
- }
@@ -1,3 +0,0 @@
1
- export * from './endpoints';
2
- export * from './models';
3
- export * from './types';
@@ -1,9 +0,0 @@
1
- import { API } from '../../utils';
2
-
3
- export class BaseEndpoint {
4
- protected api: API;
5
-
6
- constructor(protected readonly access_token: string) {
7
- this.api = new API(access_token);
8
- }
9
- }
@@ -1 +0,0 @@
1
- export * from './baseEndpoint';
@@ -1,199 +0,0 @@
1
- export interface ErrorResponse {
2
- status_code: number;
3
- status_message: string;
4
- success: boolean;
5
- }
6
-
7
- export type MediaType = 'movie' | 'tv' | 'person';
8
-
9
- export interface AuthorDetails {
10
- name: string;
11
- username: string;
12
- avatar_path: string;
13
- rating?: number;
14
- }
15
-
16
- export type KnownFor = MovieWithMediaType | TVWithMediaType;
17
-
18
- export interface Person {
19
- id: number;
20
- name: string;
21
- known_for: KnownFor[];
22
- profile_path: string;
23
- adult: boolean;
24
- known_for_department: string;
25
- gender: number;
26
- popularity: number;
27
- }
28
-
29
- export interface PersonWithMediaType extends Person {
30
- media_type: 'person';
31
- }
32
-
33
- export interface Movie {
34
- id: number;
35
- poster_path: string;
36
- adult: boolean;
37
- overview: string;
38
- release_date: string;
39
- genre_ids: number[];
40
- original_title: string;
41
- original_language: string;
42
- title: string;
43
- backdrop_path: string;
44
- popularity: number;
45
- vote_count: number;
46
- video: boolean;
47
- vote_average: number;
48
- }
49
-
50
- export interface MovieWithMediaType extends Movie {
51
- media_type: 'movie';
52
- }
53
-
54
- export interface Company {
55
- id: number;
56
- logo_path: string;
57
- name: string;
58
- origin_country: string;
59
- }
60
-
61
- export interface TV {
62
- id: number;
63
- name: string;
64
- first_air_date: string;
65
- backdrop_path: string;
66
- genre_ids: number[];
67
- origin_country: string[];
68
- original_language: string;
69
- original_name: string;
70
- overview: string;
71
- poster_path: string;
72
- popularity: number;
73
- vote_count: number;
74
- vote_average: number;
75
- }
76
-
77
- export interface TVWithMediaType extends TV {
78
- media_type: 'tv';
79
- }
80
-
81
- export interface Genre {
82
- id: number;
83
- name: string;
84
- }
85
-
86
- export interface ExternalIds {
87
- imdb_id: string;
88
- facebook_id: string;
89
- instagram_id: string;
90
- twitter_id: string;
91
- id: number;
92
- }
93
-
94
- export interface ProductionCompany {
95
- id: number;
96
- logo_path: string;
97
- name: string;
98
- origin_country: string;
99
- }
100
-
101
- export interface ProductionCountry {
102
- iso_3166_1: string;
103
- name: string;
104
- }
105
-
106
- export interface SpokenLanguage {
107
- english_name: string;
108
- iso_639_1: string;
109
- name: string;
110
- }
111
-
112
- export interface ContentRatings {
113
- results: ContentRatingsResult[];
114
- id: number;
115
- }
116
-
117
- export interface ContentRatingsResult {
118
- descriptor: unknown[];
119
- iso_3166_1: string;
120
- rating: string;
121
- }
122
-
123
- export interface Recommendation {
124
- adult: boolean;
125
- backdrop_path?: string;
126
- genre_ids: number[];
127
- id: number;
128
- original_language: string;
129
- original_title: string;
130
- overview: string;
131
- release_date: string;
132
- poster_path?: string;
133
- popularity: number;
134
- title: string;
135
- video: boolean;
136
- vote_average: number;
137
- vote_count: number;
138
- }
139
-
140
- export interface Recommendations {
141
- page: number;
142
- results: Recommendation[];
143
- total_pages: number;
144
- total_results: number;
145
- }
146
-
147
- export interface Review {
148
- author: string;
149
- author_details: AuthorDetails;
150
- content: string;
151
- created_at: Date;
152
- id: string;
153
- updated_at: Date;
154
- url: string;
155
- }
156
-
157
- export interface Reviews {
158
- id: number;
159
- page: number;
160
- results: Review[];
161
- total_pages: number;
162
- total_results: number;
163
- }
164
-
165
- export interface TranslationData {
166
- title: string;
167
- overview: string;
168
- homepage: string;
169
- }
170
-
171
- export interface Translation {
172
- iso_3166_1: string;
173
- iso_639_1: string;
174
- name: string;
175
- english_name: string;
176
- data: TranslationData;
177
- }
178
-
179
- export interface Translations {
180
- id: number;
181
- translations: Translation[];
182
- }
183
-
184
- export interface Image {
185
- aspect_ratio: number;
186
- file_path: string;
187
- height: number;
188
- iso_639_1: string;
189
- vote_average: number;
190
- vote_count: number;
191
- width: number;
192
- }
193
-
194
- export interface Images {
195
- id: number;
196
- backdrops: Image[];
197
- logos: Image[];
198
- posters: Image[];
199
- }
@@ -1,22 +0,0 @@
1
- import { AccountDetails, BaseEndpoint } from '../@types';
2
-
3
- /**
4
- * Represents an endpoint for retrieving account details.
5
- */
6
- export class AccountEndpoint extends BaseEndpoint {
7
- /**
8
- * Constructs a new AccountEndpoint 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 account details asynchronously.
17
- * @returns {Promise<AccountDetails>} A Promise that resolves with the account details.
18
- */
19
- async details(): Promise<AccountDetails> {
20
- return await this.api.get('/account');
21
- }
22
- }
@@ -1,30 +0,0 @@
1
- import { BaseEndpoint, Certifications } from '../@types';
2
-
3
- /**
4
- * Represents an endpoint for retrieving certifications for movies and TV shows.
5
- */
6
- export class CertificationEndpoint extends BaseEndpoint {
7
- /**
8
- * Constructs a new CertificationEndpoint 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 certifications for movies asynchronously.
17
- * @returns {Promise<Certifications>} A Promise that resolves with the certifications for movies.
18
- */
19
- async movies(): Promise<Certifications> {
20
- return await this.api.get<Certifications>('/certification/movie/list');
21
- }
22
-
23
- /**
24
- * Retrieves certifications for TV shows asynchronously.
25
- * @returns {Promise<Certifications>} A Promise that resolves with the certifications for TV shows.
26
- */
27
- async tv(): Promise<Certifications> {
28
- return await this.api.get<Certifications>('/certification/tv/list');
29
- }
30
- }
@@ -1,41 +0,0 @@
1
- import { BaseEndpoint, ChangeOption, MediaChanges } from '../@types';
2
-
3
- /**
4
- * Represents an endpoint for retrieving changes in movies, TV shows, and persons.
5
- */
6
- export class ChangeEndpoint extends BaseEndpoint {
7
- /**
8
- * Constructs a new ChangeEndpoint 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 changes in movies asynchronously.
17
- * @param {ChangeOption} [options] - Optional parameters for filtering the changes.
18
- * @returns {Promise<MediaChanges>} A Promise that resolves with the changes in movies.
19
- */
20
- async movies(options?: ChangeOption): Promise<MediaChanges> {
21
- return await this.api.get<MediaChanges>('/movie/changes', options);
22
- }
23
-
24
- /**
25
- * Retrieves changes in TV shows asynchronously.
26
- * @param {ChangeOption} [options] - Optional parameters for filtering the changes.
27
- * @returns {Promise<MediaChanges>} A Promise that resolves with the changes in TV shows.
28
- */
29
- async tv(options?: ChangeOption): Promise<MediaChanges> {
30
- return await this.api.get<MediaChanges>('/tv/changes', options);
31
- }
32
-
33
- /**
34
- * Retrieves changes related to persons asynchronously.
35
- * @param {ChangeOption} [options] - Optional parameters for filtering the changes.
36
- * @returns {Promise<MediaChanges>} A Promise that resolves with the changes related to persons.
37
- */
38
- async person(options?: ChangeOption): Promise<MediaChanges> {
39
- return await this.api.get<MediaChanges>('/person/change', options);
40
- }
41
- }
@@ -1,57 +0,0 @@
1
- import {
2
- BaseEndpoint,
3
- CollectionImageOptions,
4
- DetailedCollection,
5
- ImageCollection,
6
- LanguageOption,
7
- Translations,
8
- } from '../@types';
9
-
10
- const BASE_COLLECTION = '/collection';
11
-
12
- /**
13
- * Represents an endpoint for accessing collections and their details.
14
- */
15
- export class CollectionsEndpoint extends BaseEndpoint {
16
- /**
17
- * Constructs a new CollectionsEndpoint instance.
18
- * @param {string} access_token - The access token used for authentication.
19
- */
20
- constructor(protected readonly access_token: string) {
21
- super(access_token);
22
- }
23
-
24
- /**
25
- * Retrieves details of a specific collection asynchronously.
26
- * @param {number} id - The ID of the collection.
27
- * @param {LanguageOption} [options] - Optional parameters for specifying the language.
28
- * @returns {Promise<DetailedCollection>} A Promise that resolves with the detailed information of the collection.
29
- */
30
- async details(id: number, options?: LanguageOption): Promise<DetailedCollection> {
31
- return await this.api.get<DetailedCollection>(`${BASE_COLLECTION}/${id}`, options);
32
- }
33
-
34
- /**
35
- * Retrieves images associated with a specific collection asynchronously.
36
- * @param {number} id - The ID of the collection.
37
- * @param {CollectionImageOptions} [options] - Optional parameters for specifying image options.
38
- * @returns {Promise<ImageCollection>} A Promise that resolves with the collection images.
39
- */
40
- async images(id: number, options?: CollectionImageOptions): Promise<ImageCollection> {
41
- const computedOptions = {
42
- include_image_language: options?.include_image_language?.join(','),
43
- language: options?.language,
44
- };
45
- return await this.api.get<ImageCollection>(`${BASE_COLLECTION}/${id}/images`, computedOptions);
46
- }
47
-
48
- /**
49
- * Retrieves translations for a specific collection asynchronously.
50
- * @param {number} id - The ID of the collection.
51
- * @param {LanguageOption} [options] - Optional parameters for specifying the language.
52
- * @returns {Promise<Translations>} A Promise that resolves with the translations of the collection.
53
- */
54
- async translations(id: number, options?: LanguageOption): Promise<Translations> {
55
- return await this.api.get<Translations>(`${BASE_COLLECTION}/${id}/translations`, options);
56
- }
57
- }
@@ -1,41 +0,0 @@
1
- import { AlternativeNames, BaseEndpoint, CompanyDetails, CompanyImages } from '../@types';
2
-
3
- /**
4
- * Represents an endpoint for accessing company details and related information.
5
- */
6
- export class CompaniesEndpoint extends BaseEndpoint {
7
- /**
8
- * Constructs a new CompaniesEndpoint 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 company asynchronously.
17
- * @param {number} id - The ID of the company.
18
- * @returns {Promise<CompanyDetails>} A Promise that resolves with the detailed information of the company.
19
- */
20
- async details(id: number): Promise<CompanyDetails> {
21
- return await this.api.get<CompanyDetails>(`/company/${id}`);
22
- }
23
-
24
- /**
25
- * Retrieves alternative names of a specific company asynchronously.
26
- * @param {number} id - The ID of the company.
27
- * @returns {Promise<AlternativeNames>} A Promise that resolves with the alternative names of the company.
28
- */
29
- async alternativeNames(id: number): Promise<AlternativeNames> {
30
- return await this.api.get<AlternativeNames>(`/company/${id}/alternative_names`);
31
- }
32
-
33
- /**
34
- * Retrieves images associated with a specific company asynchronously.
35
- * @param {number} id - The ID of the company.
36
- * @returns {Promise<CompanyImages>} A Promise that resolves with the images of the company.
37
- */
38
- async images(id: number): Promise<CompanyImages> {
39
- return await this.api.get<CompanyImages>(`/company/${id}/images`);
40
- }
41
- }