@tdanks2000/tmdb-wrapper 1.2.0 → 1.3.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 (167) hide show
  1. package/dist/index.cjs +1574 -0
  2. package/dist/index.d.cts +2812 -0
  3. package/dist/index.d.cts.map +1 -0
  4. package/dist/index.d.mts +2812 -0
  5. package/dist/index.d.mts.map +1 -0
  6. package/dist/index.mjs +1561 -0
  7. package/dist/index.mjs.map +1 -0
  8. package/package.json +70 -61
  9. package/dist/@types/endpoints/account.d.ts +0 -16
  10. package/dist/@types/endpoints/account.d.ts.map +0 -1
  11. package/dist/@types/endpoints/account.js +0 -2
  12. package/dist/@types/endpoints/certification.d.ts +0 -19
  13. package/dist/@types/endpoints/certification.d.ts.map +0 -1
  14. package/dist/@types/endpoints/certification.js +0 -2
  15. package/dist/@types/endpoints/changes.d.ts +0 -26
  16. package/dist/@types/endpoints/changes.d.ts.map +0 -1
  17. package/dist/@types/endpoints/changes.js +0 -2
  18. package/dist/@types/endpoints/collection.d.ts +0 -21
  19. package/dist/@types/endpoints/collection.d.ts.map +0 -1
  20. package/dist/@types/endpoints/collection.js +0 -2
  21. package/dist/@types/endpoints/companies.d.ts +0 -29
  22. package/dist/@types/endpoints/companies.d.ts.map +0 -1
  23. package/dist/@types/endpoints/companies.js +0 -2
  24. package/dist/@types/endpoints/configuration.d.ts +0 -106
  25. package/dist/@types/endpoints/configuration.d.ts.map +0 -1
  26. package/dist/@types/endpoints/configuration.js +0 -101
  27. package/dist/@types/endpoints/credits.d.ts +0 -135
  28. package/dist/@types/endpoints/credits.d.ts.map +0 -1
  29. package/dist/@types/endpoints/credits.js +0 -2
  30. package/dist/@types/endpoints/discover.d.ts +0 -68
  31. package/dist/@types/endpoints/discover.d.ts.map +0 -1
  32. package/dist/@types/endpoints/discover.js +0 -2
  33. package/dist/@types/endpoints/find.d.ts +0 -20
  34. package/dist/@types/endpoints/find.d.ts.map +0 -1
  35. package/dist/@types/endpoints/find.js +0 -2
  36. package/dist/@types/endpoints/genre.d.ts +0 -7
  37. package/dist/@types/endpoints/genre.d.ts.map +0 -1
  38. package/dist/@types/endpoints/genre.js +0 -2
  39. package/dist/@types/endpoints/index.d.ts +0 -23
  40. package/dist/@types/endpoints/index.d.ts.map +0 -1
  41. package/dist/@types/endpoints/index.js +0 -38
  42. package/dist/@types/endpoints/keywords.d.ts +0 -21
  43. package/dist/@types/endpoints/keywords.d.ts.map +0 -1
  44. package/dist/@types/endpoints/keywords.js +0 -2
  45. package/dist/@types/endpoints/movies.d.ts +0 -150
  46. package/dist/@types/endpoints/movies.d.ts.map +0 -1
  47. package/dist/@types/endpoints/movies.js +0 -12
  48. package/dist/@types/endpoints/networks.d.ts +0 -14
  49. package/dist/@types/endpoints/networks.d.ts.map +0 -1
  50. package/dist/@types/endpoints/networks.js +0 -2
  51. package/dist/@types/endpoints/options.d.ts +0 -71
  52. package/dist/@types/endpoints/options.d.ts.map +0 -1
  53. package/dist/@types/endpoints/options.js +0 -2
  54. package/dist/@types/endpoints/people.d.ts +0 -135
  55. package/dist/@types/endpoints/people.d.ts.map +0 -1
  56. package/dist/@types/endpoints/people.js +0 -2
  57. package/dist/@types/endpoints/review.d.ts +0 -8
  58. package/dist/@types/endpoints/review.d.ts.map +0 -1
  59. package/dist/@types/endpoints/review.js +0 -2
  60. package/dist/@types/endpoints/search.d.ts +0 -32
  61. package/dist/@types/endpoints/search.d.ts.map +0 -1
  62. package/dist/@types/endpoints/search.js +0 -2
  63. package/dist/@types/endpoints/trending.d.ts +0 -12
  64. package/dist/@types/endpoints/trending.d.ts.map +0 -1
  65. package/dist/@types/endpoints/trending.js +0 -2
  66. package/dist/@types/endpoints/tvEpisode.d.ts +0 -65
  67. package/dist/@types/endpoints/tvEpisode.d.ts.map +0 -1
  68. package/dist/@types/endpoints/tvEpisode.js +0 -2
  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/tvSeasons.js +0 -2
  72. package/dist/@types/endpoints/tvShows.d.ts +0 -260
  73. package/dist/@types/endpoints/tvShows.d.ts.map +0 -1
  74. package/dist/@types/endpoints/tvShows.js +0 -2
  75. package/dist/@types/endpoints/watchProviders.d.ts +0 -303
  76. package/dist/@types/endpoints/watchProviders.d.ts.map +0 -1
  77. package/dist/@types/endpoints/watchProviders.js +0 -2
  78. package/dist/@types/index.d.ts +0 -4
  79. package/dist/@types/index.d.ts.map +0 -1
  80. package/dist/@types/index.js +0 -19
  81. package/dist/@types/models/baseEndpoint.d.ts +0 -8
  82. package/dist/@types/models/baseEndpoint.d.ts.map +0 -1
  83. package/dist/@types/models/baseEndpoint.js +0 -11
  84. package/dist/@types/models/index.d.ts +0 -2
  85. package/dist/@types/models/index.d.ts.map +0 -1
  86. package/dist/@types/models/index.js +0 -17
  87. package/dist/@types/types.d.ts +0 -179
  88. package/dist/@types/types.d.ts.map +0 -1
  89. package/dist/@types/types.js +0 -2
  90. package/dist/endpoints/account.d.ts +0 -18
  91. package/dist/endpoints/account.d.ts.map +0 -1
  92. package/dist/endpoints/account.js +0 -25
  93. package/dist/endpoints/certification.d.ts +0 -23
  94. package/dist/endpoints/certification.d.ts.map +0 -1
  95. package/dist/endpoints/certification.js +0 -32
  96. package/dist/endpoints/changes.d.ts +0 -31
  97. package/dist/endpoints/changes.d.ts.map +0 -1
  98. package/dist/endpoints/changes.js +0 -42
  99. package/dist/endpoints/collections.d.ts +0 -34
  100. package/dist/endpoints/collections.d.ts.map +0 -1
  101. package/dist/endpoints/collections.js +0 -50
  102. package/dist/endpoints/companies.d.ts +0 -31
  103. package/dist/endpoints/companies.d.ts.map +0 -1
  104. package/dist/endpoints/companies.js +0 -42
  105. package/dist/endpoints/configuration.d.ts +0 -18
  106. package/dist/endpoints/configuration.d.ts.map +0 -1
  107. package/dist/endpoints/configuration.js +0 -25
  108. package/dist/endpoints/credits.d.ts +0 -19
  109. package/dist/endpoints/credits.d.ts.map +0 -1
  110. package/dist/endpoints/credits.js +0 -26
  111. package/dist/endpoints/discover.d.ts +0 -25
  112. package/dist/endpoints/discover.d.ts.map +0 -1
  113. package/dist/endpoints/discover.js +0 -35
  114. package/dist/endpoints/find.d.ts +0 -20
  115. package/dist/endpoints/find.d.ts.map +0 -1
  116. package/dist/endpoints/find.js +0 -27
  117. package/dist/endpoints/genre.d.ts +0 -25
  118. package/dist/endpoints/genre.d.ts.map +0 -1
  119. package/dist/endpoints/genre.js +0 -34
  120. package/dist/endpoints/index.d.ts +0 -22
  121. package/dist/endpoints/index.d.ts.map +0 -1
  122. package/dist/endpoints/index.js +0 -37
  123. package/dist/endpoints/keywords.d.ts +0 -26
  124. package/dist/endpoints/keywords.d.ts.map +0 -1
  125. package/dist/endpoints/keywords.js +0 -36
  126. package/dist/endpoints/movies.d.ts +0 -142
  127. package/dist/endpoints/movies.d.ts.map +0 -1
  128. package/dist/endpoints/movies.js +0 -198
  129. package/dist/endpoints/networks.d.ts +0 -31
  130. package/dist/endpoints/networks.d.ts.map +0 -1
  131. package/dist/endpoints/networks.js +0 -42
  132. package/dist/endpoints/people.d.ts +0 -85
  133. package/dist/endpoints/people.d.ts.map +0 -1
  134. package/dist/endpoints/people.js +0 -119
  135. package/dist/endpoints/review.d.ts +0 -19
  136. package/dist/endpoints/review.d.ts.map +0 -1
  137. package/dist/endpoints/review.js +0 -26
  138. package/dist/endpoints/search.d.ts +0 -58
  139. package/dist/endpoints/search.d.ts.map +0 -1
  140. package/dist/endpoints/search.js +0 -75
  141. package/dist/endpoints/trending.d.ts +0 -22
  142. package/dist/endpoints/trending.d.ts.map +0 -1
  143. package/dist/endpoints/trending.js +0 -29
  144. package/dist/endpoints/tvEpisodes.d.ts +0 -62
  145. package/dist/endpoints/tvEpisodes.d.ts.map +0 -1
  146. package/dist/endpoints/tvEpisodes.js +0 -98
  147. package/dist/endpoints/tvSeasons.d.ts +0 -71
  148. package/dist/endpoints/tvSeasons.d.ts.map +0 -1
  149. package/dist/endpoints/tvSeasons.js +0 -109
  150. package/dist/endpoints/tvShows.d.ts +0 -164
  151. package/dist/endpoints/tvShows.d.ts.map +0 -1
  152. package/dist/endpoints/tvShows.js +0 -230
  153. package/dist/endpoints/watchProviders.d.ts +0 -33
  154. package/dist/endpoints/watchProviders.d.ts.map +0 -1
  155. package/dist/endpoints/watchProviders.js +0 -46
  156. package/dist/index.d.ts +0 -30
  157. package/dist/index.d.ts.map +0 -1
  158. package/dist/index.js +0 -46
  159. package/dist/utils/api.d.ts +0 -14
  160. package/dist/utils/api.d.ts.map +0 -1
  161. package/dist/utils/api.js +0 -61
  162. package/dist/utils/getimagePath.d.ts +0 -32
  163. package/dist/utils/getimagePath.d.ts.map +0 -1
  164. package/dist/utils/getimagePath.js +0 -50
  165. package/dist/utils/index.d.ts +0 -3
  166. package/dist/utils/index.d.ts.map +0 -1
  167. package/dist/utils/index.js +0 -18
package/dist/index.mjs ADDED
@@ -0,0 +1,1561 @@
1
+ //#region src/@types/endpoints/configuration.ts
2
+ let BackdropSizes = /* @__PURE__ */ function(BackdropSizes$1) {
3
+ BackdropSizes$1["W300"] = "w300";
4
+ BackdropSizes$1["W500"] = "w500";
5
+ BackdropSizes$1["W780"] = "w780";
6
+ BackdropSizes$1["W1280"] = "w1280";
7
+ BackdropSizes$1["ORIGINAL"] = "original";
8
+ return BackdropSizes$1;
9
+ }({});
10
+ let LogoSizes = /* @__PURE__ */ function(LogoSizes$1) {
11
+ LogoSizes$1["W45"] = "w45";
12
+ LogoSizes$1["W92"] = "w92";
13
+ LogoSizes$1["W154"] = "w154";
14
+ LogoSizes$1["W185"] = "w185";
15
+ LogoSizes$1["W300"] = "w300";
16
+ LogoSizes$1["W500"] = "w500";
17
+ LogoSizes$1["ORIGINAL"] = "original";
18
+ return LogoSizes$1;
19
+ }({});
20
+ let PosterSizes = /* @__PURE__ */ function(PosterSizes$1) {
21
+ PosterSizes$1["W92"] = "w92";
22
+ PosterSizes$1["W154"] = "w154";
23
+ PosterSizes$1["W185"] = "w185";
24
+ PosterSizes$1["W300"] = "w300";
25
+ PosterSizes$1["W500"] = "w500";
26
+ PosterSizes$1["W780"] = "w780";
27
+ PosterSizes$1["ORIGINAL"] = "original";
28
+ return PosterSizes$1;
29
+ }({});
30
+ let ProfileSizes = /* @__PURE__ */ function(ProfileSizes$1) {
31
+ ProfileSizes$1["W45"] = "w45";
32
+ ProfileSizes$1["W185"] = "w185";
33
+ ProfileSizes$1["W632"] = "w632";
34
+ ProfileSizes$1["ORIGINAL"] = "original";
35
+ return ProfileSizes$1;
36
+ }({});
37
+ let StillSizes = /* @__PURE__ */ function(StillSizes$1) {
38
+ StillSizes$1["W92"] = "w92";
39
+ StillSizes$1["W185"] = "w185";
40
+ StillSizes$1["W300"] = "w300";
41
+ StillSizes$1["ORIGINAL"] = "original";
42
+ return StillSizes$1;
43
+ }({});
44
+ let ChangeKeys = /* @__PURE__ */ function(ChangeKeys$1) {
45
+ ChangeKeys$1["ADULT"] = "adult";
46
+ ChangeKeys$1["AIR_DATE"] = "air_date";
47
+ ChangeKeys$1["ALSO_KNOWN_AS"] = "also_known_as";
48
+ ChangeKeys$1["ALTERNATIVE_TITLES"] = "alternative_titles";
49
+ ChangeKeys$1["BIOGRAPHY"] = "biography";
50
+ ChangeKeys$1["BIRTHDAY"] = "birthday";
51
+ ChangeKeys$1["BUDGET"] = "budget";
52
+ ChangeKeys$1["CAST"] = "cast";
53
+ ChangeKeys$1["CERTIFICATIONS"] = "certifications";
54
+ ChangeKeys$1["CHARACTER_NAMES"] = "character_names";
55
+ ChangeKeys$1["CREATED_BY"] = "created_by";
56
+ ChangeKeys$1["CREW"] = "crew";
57
+ ChangeKeys$1["DEATHDAY"] = "deathday";
58
+ ChangeKeys$1["EPISODE"] = "episode";
59
+ ChangeKeys$1["EPISODE_NUMBER"] = "episode_number";
60
+ ChangeKeys$1["EPISODE_RUN_TIME"] = "episode_run_time";
61
+ ChangeKeys$1["FREEBASE_ID"] = "freebase_id";
62
+ ChangeKeys$1["FREEBASE_MID"] = "freebase_mid";
63
+ ChangeKeys$1["GENERAL"] = "general";
64
+ ChangeKeys$1["GENRES"] = "genres";
65
+ ChangeKeys$1["GUEST_STARS"] = "guest_stars";
66
+ ChangeKeys$1["HOMEPAGE"] = "homepage";
67
+ ChangeKeys$1["IMAGES"] = "images";
68
+ ChangeKeys$1["IMDB_ID"] = "imdb_id";
69
+ ChangeKeys$1["LANGUAGES"] = "languages";
70
+ ChangeKeys$1["NAME"] = "name";
71
+ ChangeKeys$1["NETWORK"] = "network";
72
+ ChangeKeys$1["ORIGIN_COUNTRY"] = "origin_country";
73
+ ChangeKeys$1["ORIGINAL_NAME"] = "original_name";
74
+ ChangeKeys$1["ORIGINAL_TITLE"] = "original_title";
75
+ ChangeKeys$1["OVERVIEW"] = "overview";
76
+ ChangeKeys$1["PARTS"] = "parts";
77
+ ChangeKeys$1["PLACE_OF_BIRTH"] = "place_of_birth";
78
+ ChangeKeys$1["PLOT_KEYWORDS"] = "plot_keywords";
79
+ ChangeKeys$1["PRODUCTION_CODE"] = "production_code";
80
+ ChangeKeys$1["PRODUCTION_COMPANIES"] = "production_companies";
81
+ ChangeKeys$1["PRODUCTION_COUNTRIES"] = "production_countries";
82
+ ChangeKeys$1["RELEASES"] = "releases";
83
+ ChangeKeys$1["REVENUE"] = "revenue";
84
+ ChangeKeys$1["RUNTIME"] = "runtime";
85
+ ChangeKeys$1["SEASON"] = "season";
86
+ ChangeKeys$1["SEASON_NUMBER"] = "season_number";
87
+ ChangeKeys$1["SEASON_REGULAR"] = "season_regular";
88
+ ChangeKeys$1["SPOKEN_LANGUAGES"] = "spoken_languages";
89
+ ChangeKeys$1["STATUS"] = "status";
90
+ ChangeKeys$1["TAGLINE"] = "tagline";
91
+ ChangeKeys$1["TITLE"] = "title";
92
+ ChangeKeys$1["TRANSLATIONS"] = "translations";
93
+ ChangeKeys$1["TVDB_ID"] = "tvdb_id";
94
+ ChangeKeys$1["TVRAGE_ID"] = "tvrage_id";
95
+ ChangeKeys$1["TYPE"] = "type";
96
+ ChangeKeys$1["VIDEO"] = "video";
97
+ ChangeKeys$1["VIDEOS"] = "videos";
98
+ return ChangeKeys$1;
99
+ }({});
100
+
101
+ //#endregion
102
+ //#region src/@types/endpoints/movies.ts
103
+ let ReleaseDateType = /* @__PURE__ */ function(ReleaseDateType$1) {
104
+ ReleaseDateType$1[ReleaseDateType$1["Premiere"] = 1] = "Premiere";
105
+ ReleaseDateType$1[ReleaseDateType$1["Theatrical (limited)"] = 2] = "Theatrical (limited)";
106
+ ReleaseDateType$1[ReleaseDateType$1["Theatrical"] = 3] = "Theatrical";
107
+ ReleaseDateType$1[ReleaseDateType$1["Digital"] = 4] = "Digital";
108
+ ReleaseDateType$1[ReleaseDateType$1["Physical"] = 5] = "Physical";
109
+ ReleaseDateType$1[ReleaseDateType$1["TV"] = 6] = "TV";
110
+ return ReleaseDateType$1;
111
+ }({});
112
+
113
+ //#endregion
114
+ //#region src/utils/api.ts
115
+ const BASE_URL_V3 = "https://api.themoviedb.org/3";
116
+ var API = class {
117
+ apiKey;
118
+ accessToken;
119
+ constructor(auth) {
120
+ if (typeof auth === "string") this.accessToken = auth;
121
+ else {
122
+ this.apiKey = auth.apiKey;
123
+ this.accessToken = auth.accessToken;
124
+ }
125
+ }
126
+ /**
127
+ * Generic GET:
128
+ * @template T — response type
129
+ * @template O — options (query params) type
130
+ */
131
+ async get(path, options) {
132
+ const rawOptions = {
133
+ ...options ?? {},
134
+ ...this.apiKey ? { api_key: this.apiKey } : {}
135
+ };
136
+ const params = parseOptions(rawOptions);
137
+ const response = await fetch(`${BASE_URL_V3}${path}?${params}`, {
138
+ method: "GET",
139
+ headers: {
140
+ ...this.accessToken ? { Authorization: `Bearer ${this.accessToken}` } : {},
141
+ "Content-Type": "application/json;charset=utf-8"
142
+ }
143
+ });
144
+ if (!response.ok) {
145
+ const error = await response.json();
146
+ return Promise.reject(error);
147
+ }
148
+ return await response.json();
149
+ }
150
+ };
151
+ const parseOptions = (options) => {
152
+ if (!options) return "";
153
+ const entries = [];
154
+ for (const [key, value] of Object.entries(options)) {
155
+ if (value === void 0 || value === null) continue;
156
+ if (Array.isArray(value)) for (const item of value) entries.push([key, String(item)]);
157
+ else entries.push([key, String(value)]);
158
+ }
159
+ return new URLSearchParams(entries).toString();
160
+ };
161
+
162
+ //#endregion
163
+ //#region src/utils/getimagePath.ts
164
+ /**
165
+ * Utility method to construct full url for image
166
+ * based on configuration
167
+ *
168
+ * https://developers.themoviedb.org/3/getting-started/images
169
+ * @param {string} baseUrl base image url (e.g., 'https://image.tmdb.org/t/p/')
170
+ * @param {string} fileSize file size (e.g., 'original', 'w500')
171
+ * @param {string} imagePath raw image path
172
+ * @param {string} format override image format (e.g., 'svg', 'png', 'jpg')
173
+ * @returns {string} The complete image URL
174
+ */
175
+ const getFullImagePath = (baseUrl, fileSize, imagePath, format) => {
176
+ if (!imagePath) return "";
177
+ const hasExtension = imagePath.includes(".");
178
+ if (hasExtension) {
179
+ const imagePathArr = imagePath.split(".");
180
+ const imageFormat$1 = format || imagePathArr[1];
181
+ return `${baseUrl}${fileSize}${imagePathArr[0]}.${imageFormat$1}`;
182
+ }
183
+ const imageFormat = format || "jpg";
184
+ return `${baseUrl}${fileSize}${imagePath}.${imageFormat}`;
185
+ };
186
+ /**
187
+ * Common image sizes available in TMDB
188
+ */
189
+ const ImageSizes = {
190
+ ORIGINAL: "original",
191
+ W500: "w500",
192
+ W300: "w300",
193
+ W185: "w185",
194
+ W92: "w92",
195
+ H632: "h632"
196
+ };
197
+ /**
198
+ * Image formats supported by TMDB
199
+ */
200
+ const ImageFormats = {
201
+ JPG: "jpg",
202
+ PNG: "png",
203
+ SVG: "svg"
204
+ };
205
+
206
+ //#endregion
207
+ //#region src/@types/models/baseEndpoint.ts
208
+ var BaseEndpoint = class {
209
+ api;
210
+ constructor(auth) {
211
+ this.auth = auth;
212
+ this.api = new API(auth);
213
+ }
214
+ };
215
+
216
+ //#endregion
217
+ //#region src/endpoints/account.ts
218
+ /**
219
+ * Represents an endpoint for retrieving account details.
220
+ */
221
+ var AccountEndpoint = class extends BaseEndpoint {
222
+ /**
223
+ * Constructs a new AccountEndpoint instance.
224
+ * @param {string} access_token - The access token used for authentication.
225
+ */
226
+ constructor(access_token) {
227
+ super(access_token);
228
+ this.access_token = access_token;
229
+ }
230
+ /**
231
+ * Retrieves account details asynchronously.
232
+ * @returns {Promise<AccountDetails>} A Promise that resolves with the account details.
233
+ */
234
+ async details() {
235
+ return await this.api.get("/account");
236
+ }
237
+ };
238
+
239
+ //#endregion
240
+ //#region src/endpoints/certification.ts
241
+ /**
242
+ * Represents an endpoint for retrieving certifications for movies and TV shows.
243
+ */
244
+ var CertificationEndpoint = class extends BaseEndpoint {
245
+ /**
246
+ * Constructs a new CertificationEndpoint instance.
247
+ * @param {string} access_token - The access token used for authentication.
248
+ */
249
+ constructor(access_token) {
250
+ super(access_token);
251
+ this.access_token = access_token;
252
+ }
253
+ /**
254
+ * Retrieves certifications for movies asynchronously.
255
+ * @returns {Promise<Certifications>} A Promise that resolves with the certifications for movies.
256
+ */
257
+ async movies() {
258
+ return await this.api.get("/certification/movie/list");
259
+ }
260
+ /**
261
+ * Retrieves certifications for TV shows asynchronously.
262
+ * @returns {Promise<Certifications>} A Promise that resolves with the certifications for TV shows.
263
+ */
264
+ async tv() {
265
+ return await this.api.get("/certification/tv/list");
266
+ }
267
+ };
268
+
269
+ //#endregion
270
+ //#region src/endpoints/changes.ts
271
+ /**
272
+ * Represents an endpoint for retrieving changes in movies, TV shows, and persons.
273
+ */
274
+ var ChangeEndpoint = class extends BaseEndpoint {
275
+ /**
276
+ * Constructs a new ChangeEndpoint instance.
277
+ * @param {string} access_token - The access token used for authentication.
278
+ */
279
+ constructor(access_token) {
280
+ super(access_token);
281
+ this.access_token = access_token;
282
+ }
283
+ /**
284
+ * Retrieves changes in movies asynchronously.
285
+ * @param {ChangeOption} [options] - Optional parameters for filtering the changes.
286
+ * @returns {Promise<MediaChanges>} A Promise that resolves with the changes in movies.
287
+ */
288
+ async movies(options) {
289
+ return await this.api.get("/movie/changes", options);
290
+ }
291
+ /**
292
+ * Retrieves changes in TV shows asynchronously.
293
+ * @param {ChangeOption} [options] - Optional parameters for filtering the changes.
294
+ * @returns {Promise<MediaChanges>} A Promise that resolves with the changes in TV shows.
295
+ */
296
+ async tv(options) {
297
+ return await this.api.get("/tv/changes", options);
298
+ }
299
+ /**
300
+ * Retrieves changes related to persons asynchronously.
301
+ * @param {ChangeOption} [options] - Optional parameters for filtering the changes.
302
+ * @returns {Promise<MediaChanges>} A Promise that resolves with the changes related to persons.
303
+ */
304
+ async person(options) {
305
+ return await this.api.get("/person/change", options);
306
+ }
307
+ };
308
+
309
+ //#endregion
310
+ //#region src/endpoints/collections.ts
311
+ const BASE_COLLECTION = "/collection";
312
+ /**
313
+ * Represents an endpoint for accessing collections and their details.
314
+ */
315
+ var CollectionsEndpoint = class extends BaseEndpoint {
316
+ /**
317
+ * Constructs a new CollectionsEndpoint instance.
318
+ * @param {string} access_token - The access token used for authentication.
319
+ */
320
+ constructor(access_token) {
321
+ super(access_token);
322
+ this.access_token = access_token;
323
+ }
324
+ /**
325
+ * Retrieves details of a specific collection asynchronously.
326
+ * @param {number} id - The ID of the collection.
327
+ * @param {LanguageOption} [options] - Optional parameters for specifying the language.
328
+ * @returns {Promise<DetailedCollection>} A Promise that resolves with the detailed information of the collection.
329
+ */
330
+ async details(id, options) {
331
+ return await this.api.get(`${BASE_COLLECTION}/${id}`, options);
332
+ }
333
+ /**
334
+ * Retrieves images associated with a specific collection asynchronously.
335
+ * @param {number} id - The ID of the collection.
336
+ * @param {CollectionImageOptions} [options] - Optional parameters for specifying image options.
337
+ * @returns {Promise<ImageCollection>} A Promise that resolves with the collection images.
338
+ */
339
+ async images(id, options) {
340
+ const computedOptions = {
341
+ include_image_language: options?.include_image_language?.join(","),
342
+ language: options?.language
343
+ };
344
+ return await this.api.get(`${BASE_COLLECTION}/${id}/images`, computedOptions);
345
+ }
346
+ /**
347
+ * Retrieves translations for a specific collection asynchronously.
348
+ * @param {number} id - The ID of the collection.
349
+ * @param {LanguageOption} [options] - Optional parameters for specifying the language.
350
+ * @returns {Promise<Translations>} A Promise that resolves with the translations of the collection.
351
+ */
352
+ async translations(id, options) {
353
+ return await this.api.get(`${BASE_COLLECTION}/${id}/translations`, options);
354
+ }
355
+ };
356
+
357
+ //#endregion
358
+ //#region src/endpoints/companies.ts
359
+ /**
360
+ * Represents an endpoint for accessing company details and related information.
361
+ */
362
+ var CompaniesEndpoint = class extends BaseEndpoint {
363
+ /**
364
+ * Constructs a new CompaniesEndpoint instance.
365
+ * @param {string} access_token - The access token used for authentication.
366
+ */
367
+ constructor(access_token) {
368
+ super(access_token);
369
+ this.access_token = access_token;
370
+ }
371
+ /**
372
+ * Retrieves details of a specific company asynchronously.
373
+ * @param {number} id - The ID of the company.
374
+ * @returns {Promise<CompanyDetails>} A Promise that resolves with the detailed information of the company.
375
+ */
376
+ async details(id) {
377
+ return await this.api.get(`/company/${id}`);
378
+ }
379
+ /**
380
+ * Retrieves alternative names of a specific company asynchronously.
381
+ * @param {number} id - The ID of the company.
382
+ * @returns {Promise<AlternativeNames>} A Promise that resolves with the alternative names of the company.
383
+ */
384
+ async alternativeNames(id) {
385
+ return await this.api.get(`/company/${id}/alternative_names`);
386
+ }
387
+ /**
388
+ * Retrieves images associated with a specific company asynchronously.
389
+ * @param {number} id - The ID of the company.
390
+ * @returns {Promise<CompanyImages>} A Promise that resolves with the images of the company.
391
+ */
392
+ async images(id) {
393
+ return await this.api.get(`/company/${id}/images`);
394
+ }
395
+ };
396
+
397
+ //#endregion
398
+ //#region src/endpoints/configuration.ts
399
+ /**
400
+ * Represents an endpoint for retrieving current system configuration.
401
+ */
402
+ var ConfigurationEndpoint = class extends BaseEndpoint {
403
+ /**
404
+ * Constructs a new ConfigurationEndpoint instance.
405
+ * @param {string} access_token - The access token used for authentication.
406
+ */
407
+ constructor(access_token) {
408
+ super(access_token);
409
+ this.access_token = access_token;
410
+ }
411
+ /**
412
+ * Retrieves the current system configuration asynchronously.
413
+ * @returns {Promise<Configuration>} A Promise that resolves with the current system configuration.
414
+ */
415
+ async getCurrent() {
416
+ return await this.api.get("/configuration");
417
+ }
418
+ };
419
+
420
+ //#endregion
421
+ //#region src/endpoints/credits.ts
422
+ /**
423
+ * Represents an endpoint for retrieving credit details.
424
+ */
425
+ var CreditsEndpoint = class extends BaseEndpoint {
426
+ /**
427
+ * Constructs a new CreditsEndpoint instance.
428
+ * @param {string} access_token - The access token used for authentication.
429
+ */
430
+ constructor(access_token) {
431
+ super(access_token);
432
+ this.access_token = access_token;
433
+ }
434
+ /**
435
+ * Retrieves credit details by ID asynchronously.
436
+ * @param {string} id - The ID of the credit.
437
+ * @returns {Promise<CreditResponse>} A Promise that resolves with the credit details.
438
+ */
439
+ async getById(id) {
440
+ return await this.api.get(`/credit/${id}`);
441
+ }
442
+ };
443
+
444
+ //#endregion
445
+ //#region src/endpoints/discover.ts
446
+ const BASE_DISCOVER = "/discover";
447
+ /**
448
+ * Represents an endpoint for discovering movies and TV shows based on various criteria.
449
+ */
450
+ var DiscoverEndpoint = class extends BaseEndpoint {
451
+ /**
452
+ * Constructs a new DiscoverEndpoint instance.
453
+ * @param {string} access_token - The access token used for authentication.
454
+ */
455
+ constructor(access_token) {
456
+ super(access_token);
457
+ this.access_token = access_token;
458
+ }
459
+ /**
460
+ * Retrieves a list of movies based on the provided query options asynchronously.
461
+ * @param {MovieQueryOptions} [options] - Optional parameters for refining the movie discovery.
462
+ * @returns {Promise<MovieDiscoverResult>} A Promise that resolves with the movie discovery results.
463
+ */
464
+ async movie(options) {
465
+ return await this.api.get(`${BASE_DISCOVER}/movie`, options);
466
+ }
467
+ /**
468
+ * Retrieves a list of TV shows based on the provided query options asynchronously.
469
+ * @param {TvShowQueryOptions} [options] - Optional parameters for refining the TV show discovery.
470
+ * @returns {Promise<TvShowDiscoverResult>} A Promise that resolves with the TV show discovery results.
471
+ */
472
+ async tvShow(options) {
473
+ return await this.api.get(`${BASE_DISCOVER}/tv`, options);
474
+ }
475
+ };
476
+
477
+ //#endregion
478
+ //#region src/endpoints/find.ts
479
+ /**
480
+ * Represents an endpoint for finding media by external ID.
481
+ */
482
+ var FindEndpoint = class extends BaseEndpoint {
483
+ /**
484
+ * Constructs a new FindEndpoint instance.
485
+ * @param {string} access_token - The access token used for authentication.
486
+ */
487
+ constructor(access_token) {
488
+ super(access_token);
489
+ this.access_token = access_token;
490
+ }
491
+ /**
492
+ * Retrieves media by external ID asynchronously.
493
+ * @param {string} externalId - The external ID of the media.
494
+ * @param {ExternalIdOptions} options - Options for finding media by external ID.
495
+ * @returns {Promise<FindResult>} A Promise that resolves with the result of the find operation.
496
+ */
497
+ async byId(externalId, options) {
498
+ return await this.api.get(`/find/${externalId}`, options);
499
+ }
500
+ };
501
+
502
+ //#endregion
503
+ //#region src/endpoints/genre.ts
504
+ /**
505
+ * Represents an endpoint for retrieving genre information for movies and TV shows.
506
+ */
507
+ var GenreEndpoint = class extends BaseEndpoint {
508
+ /**
509
+ * Constructs a new GenreEndpoint instance.
510
+ * @param {string} access_token - The access token used for authentication.
511
+ */
512
+ constructor(access_token) {
513
+ super(access_token);
514
+ this.access_token = access_token;
515
+ }
516
+ /**
517
+ * Retrieves genre information for movies asynchronously.
518
+ * @param {LanguageOption} [options] - Optional parameters for specifying the language.
519
+ * @returns {Promise<Genres>} A Promise that resolves with the genre information for movies.
520
+ */
521
+ async movies(options) {
522
+ return await this.api.get("/genre/movie/list", options);
523
+ }
524
+ /**
525
+ * Retrieves genre information for TV shows asynchronously.
526
+ * @param {LanguageOption} [options] - Optional parameters for specifying the language.
527
+ * @returns {Promise<Genres>} A Promise that resolves with the genre information for TV shows.
528
+ */
529
+ async tv(options) {
530
+ return await this.api.get("/genre/tv/list", options);
531
+ }
532
+ };
533
+
534
+ //#endregion
535
+ //#region src/endpoints/keywords.ts
536
+ const BASE_KEYWORD = "/keyword";
537
+ /**
538
+ * Represents an endpoint for accessing keyword details and related movies.
539
+ */
540
+ var KeywordsEndpoint = class extends BaseEndpoint {
541
+ /**
542
+ * Constructs a new KeywordsEndpoint instance.
543
+ * @param {string} access_token - The access token used for authentication.
544
+ */
545
+ constructor(access_token) {
546
+ super(access_token);
547
+ this.access_token = access_token;
548
+ }
549
+ /**
550
+ * Retrieves details of a specific keyword asynchronously.
551
+ * @param {number} keywordId - The ID of the keyword.
552
+ * @returns {Promise<Keyword>} A Promise that resolves with the details of the keyword.
553
+ */
554
+ async details(keywordId) {
555
+ return await this.api.get(`${BASE_KEYWORD}/${keywordId}`);
556
+ }
557
+ /**
558
+ * Retrieves movies belonging to a specific keyword asynchronously.
559
+ * @param {number} keywordId - The ID of the keyword.
560
+ * @param {KeywordsOptions} [options] - Optional parameters for refining the search.
561
+ * @returns {Promise<BelongingMovies>} A Promise that resolves with the movies belonging to the keyword.
562
+ */
563
+ async belongingMovies(keywordId, options) {
564
+ return await this.api.get(`${BASE_KEYWORD}/${keywordId}/movies`, options);
565
+ }
566
+ };
567
+
568
+ //#endregion
569
+ //#region src/endpoints/movies.ts
570
+ const BASE_MOVIE = "/movie";
571
+ /**
572
+ * Represents an endpoint for accessing movie-related information.
573
+ */
574
+ var MoviesEndpoint = class extends BaseEndpoint {
575
+ /**
576
+ * Constructs a new MoviesEndpoint instance.
577
+ * @param {string} access_token - The access token used for authentication.
578
+ */
579
+ constructor(access_token) {
580
+ super(access_token);
581
+ this.access_token = access_token;
582
+ }
583
+ /**
584
+ * Retrieves details of a specific movie asynchronously.
585
+ * @param {number} id - The ID of the movie.
586
+ * @param {AppendToResponseMovieKey[]} [appendToResponse] - Optional keys to append to the response.
587
+ * @param {string} [language] - Optional parameter for specifying the language.
588
+ * @returns {Promise<AppendToResponse<MovieDetails, AppendToResponseMovieKey[], 'movie'>>} A Promise that resolves with the details of the movie.
589
+ */
590
+ async details(id, appendToResponse, language) {
591
+ const options = {
592
+ append_to_response: appendToResponse ? appendToResponse.join(",") : void 0,
593
+ language
594
+ };
595
+ return await this.api.get(`${BASE_MOVIE}/${id}`, options);
596
+ }
597
+ /**
598
+ * Retrieves alternative titles of a specific movie asynchronously.
599
+ * @param {number} id - The ID of the movie.
600
+ * @returns {Promise<AlternativeTitles>} A Promise that resolves with the alternative titles of the movie.
601
+ */
602
+ async alternativeTitles(id) {
603
+ return await this.api.get(`${BASE_MOVIE}/${id}/alternative_titles`);
604
+ }
605
+ /**
606
+ * Retrieves changes made to a specific movie asynchronously.
607
+ * @param {number} id - The ID of the movie.
608
+ * @param {ChangeOption} [options] - Optional parameters for filtering changes.
609
+ * @returns {Promise<Changes<MovieChangeValue>>} A Promise that resolves with the changes made to the movie.
610
+ */
611
+ async changes(id, options) {
612
+ return await this.api.get(`${BASE_MOVIE}/${id}/changes`, options);
613
+ }
614
+ /**
615
+ * Retrieves credits of a specific movie asynchronously.
616
+ * @param {number} id - The ID of the movie.
617
+ * @param {LanguageOption} [options] - Optional parameters for specifying the language.
618
+ * @returns {Promise<Credits>} A Promise that resolves with the credits of the movie.
619
+ */
620
+ async credits(id, options) {
621
+ return await this.api.get(`${BASE_MOVIE}/${id}/credits`, options);
622
+ }
623
+ /**
624
+ * Retrieves external IDs of a specific movie asynchronously.
625
+ * @param {number} id - The ID of the movie.
626
+ * @returns {Promise<ExternalIds>} A Promise that resolves with the external IDs of the movie.
627
+ */
628
+ async externalIds(id) {
629
+ return await this.api.get(`${BASE_MOVIE}/${id}/external_ids`);
630
+ }
631
+ /**
632
+ * Retrieves images of a specific movie asynchronously.
633
+ * @param {number} id - The ID of the movie.
634
+ * @param {MoviesImageSearchOptions} [options] - Optional parameters for specifying image search options.
635
+ * @returns {Promise<Images>} A Promise that resolves with the images of the movie.
636
+ */
637
+ async images(id, options) {
638
+ const computedOptions = {
639
+ include_image_language: options?.include_image_language?.join(","),
640
+ language: options?.language
641
+ };
642
+ return await this.api.get(`${BASE_MOVIE}/${id}/images`, computedOptions);
643
+ }
644
+ /**
645
+ * Retrieves keywords of a specific movie asynchronously.
646
+ * @param {number} id - The ID of the movie.
647
+ * @returns {Promise<Keywords>} A Promise that resolves with the keywords of the movie.
648
+ */
649
+ async keywords(id) {
650
+ return await this.api.get(`${BASE_MOVIE}/${id}/keywords`);
651
+ }
652
+ /**
653
+ * Retrieves lists containing a specific movie asynchronously.
654
+ * @param {number} id - The ID of the movie.
655
+ * @param {LanguageOption & PageOption} [options] - Optional parameters for specifying language and pagination options.
656
+ * @returns {Promise<MovieLists>} A Promise that resolves with the lists containing the movie.
657
+ */
658
+ async lists(id, options) {
659
+ return await this.api.get(`${BASE_MOVIE}/${id}/lists`, options);
660
+ }
661
+ /**
662
+ * Retrieves recommendations for a specific movie asynchronously.
663
+ * @param {number} id - The ID of the movie.
664
+ * @param {LanguageOption & PageOption} [options] - Optional parameters for specifying language and pagination options.
665
+ * @returns {Promise<Recommendations>} A Promise that resolves with the recommendations for the movie.
666
+ */
667
+ async recommendations(id, options) {
668
+ return await this.api.get(`${BASE_MOVIE}/${id}/recommendations`, options);
669
+ }
670
+ /**
671
+ * Retrieves release dates of a specific movie asynchronously.
672
+ * @param {number} id - The ID of the movie.
673
+ * @returns {Promise<ReleaseDates>} A Promise that resolves with the release dates of the movie.
674
+ */
675
+ async releaseDates(id) {
676
+ return await this.api.get(`${BASE_MOVIE}/${id}/release_dates`);
677
+ }
678
+ /**
679
+ * Retrieves reviews for a specific movie asynchronously.
680
+ * @param {number} id - The ID of the movie.
681
+ * @param {LanguageOption & PageOption} [options] - Optional parameters for specifying language and pagination options.
682
+ * @returns {Promise<Reviews>} A Promise that resolves with the reviews for the movie.
683
+ */
684
+ async reviews(id, options) {
685
+ return await this.api.get(`${BASE_MOVIE}/${id}/reviews`, options);
686
+ }
687
+ /**
688
+ * Retrieves similar movies for a specific movie asynchronously.
689
+ * @param {number} id - The ID of the movie.
690
+ * @param {LanguageOption & PageOption} [options] - Optional parameters for specifying language and pagination options.
691
+ * @returns {Promise<SimilarMovies>} A Promise that resolves with the similar movies for the movie.
692
+ */
693
+ async similar(id, options) {
694
+ return await this.api.get(`${BASE_MOVIE}/${id}/similar`, options);
695
+ }
696
+ /**
697
+ * Retrieves translations of a specific movie asynchronously.
698
+ * @param {number} id - The ID of the movie.
699
+ * @returns {Promise<Translations>} A Promise that resolves with the translations of the movie.
700
+ */
701
+ async translations(id) {
702
+ return await this.api.get(`${BASE_MOVIE}/${id}/translations`);
703
+ }
704
+ /**
705
+ * Retrieves videos of a specific movie asynchronously.
706
+ * @param {number} id - The ID of the movie.
707
+ * @param {LanguageOption} [options] - Optional parameters for specifying the language.
708
+ * @returns {Promise<Videos>} A Promise that resolves with the videos of the movie.
709
+ */
710
+ async videos(id, options) {
711
+ return await this.api.get(`${BASE_MOVIE}/${id}/videos`, options);
712
+ }
713
+ /**
714
+ * Retrieves watch providers of a specific movie asynchronously.
715
+ * @param {number} id - The ID of the movie.
716
+ * @returns {Promise<WatchProviders>} A Promise that resolves with the watch providers of the movie.
717
+ */
718
+ async watchProviders(id) {
719
+ return await this.api.get(`${BASE_MOVIE}/${id}/watch/providers`);
720
+ }
721
+ /**
722
+ * Retrieves details of the latest movie asynchronously.
723
+ * @returns {Promise<LatestMovie>} A Promise that resolves with the details of the latest movie.
724
+ */
725
+ async latest() {
726
+ return await this.api.get(`${BASE_MOVIE}/latest`);
727
+ }
728
+ /**
729
+ * Retrieves movies playing now asynchronously.
730
+ * @param {PageOption & LanguageOption & RegionOption} [options] - Optional parameters for specifying language, region, and pagination options.
731
+ * @returns {Promise<MoviesPlayingNow>} A Promise that resolves with the movies playing now.
732
+ */
733
+ async nowPlaying(options) {
734
+ return await this.api.get(`${BASE_MOVIE}/now_playing`, options);
735
+ }
736
+ /**
737
+ * Retrieves popular movies asynchronously.
738
+ * @param {LanguageOption & PageOption} [options] - Optional parameters for specifying language and pagination options.
739
+ * @returns {Promise<PopularMovies>} A Promise that resolves with the popular movies.
740
+ */
741
+ async popular(options) {
742
+ return await this.api.get(`${BASE_MOVIE}/popular`, options);
743
+ }
744
+ /**
745
+ * Retrieves top rated movies asynchronously.
746
+ * @param {PageOption & LanguageOption & RegionOption} [options] - Optional parameters for specifying language, region, and pagination options.
747
+ * @returns {Promise<TopRatedMovies>} A Promise that resolves with the top rated movies.
748
+ */
749
+ async topRated(options) {
750
+ return await this.api.get(`${BASE_MOVIE}/top_rated`, options);
751
+ }
752
+ /**
753
+ * Retrieves upcoming movies asynchronously.
754
+ * @param {PageOption & LanguageOption & RegionOption} [options] - Optional parameters for specifying language, region, and pagination options.
755
+ * @returns {Promise<UpcomingMovies>} A Promise that resolves with the upcoming movies.
756
+ */
757
+ async upcoming(options) {
758
+ return await this.api.get(`${BASE_MOVIE}/upcoming`, options);
759
+ }
760
+ };
761
+
762
+ //#endregion
763
+ //#region src/endpoints/networks.ts
764
+ /**
765
+ * Represents an endpoint for accessing network details.
766
+ */
767
+ var NetworksEndpoint = class extends BaseEndpoint {
768
+ /**
769
+ * Constructs a new NetworksEndpoint instance.
770
+ * @param {string} access_token - The access token used for authentication.
771
+ */
772
+ constructor(access_token) {
773
+ super(access_token);
774
+ this.access_token = access_token;
775
+ }
776
+ /**
777
+ * Retrieves details of a specific network asynchronously.
778
+ * @param {number} id - The ID of the network.
779
+ * @returns {Promise<NetworkDetails>} A Promise that resolves with the details of the network.
780
+ */
781
+ async details(id) {
782
+ return await this.api.get(`/network/${id}`);
783
+ }
784
+ /**
785
+ * Retrieves alternative names of a specific network asynchronously.
786
+ * @param {number} id - The ID of the network.
787
+ * @returns {Promise<AlternativeNames>} A Promise that resolves with the alternative names of the network.
788
+ */
789
+ async alternativeNames(id) {
790
+ return await this.api.get(`/network/${id}/alternative_names`);
791
+ }
792
+ /**
793
+ * Retrieves images of a specific network asynchronously.
794
+ * @param {number} id - The ID of the network.
795
+ * @returns {Promise<NetworkImages>} A Promise that resolves with the images of the network.
796
+ */
797
+ async images(id) {
798
+ return await this.api.get(`/network/${id}/images`);
799
+ }
800
+ };
801
+
802
+ //#endregion
803
+ //#region src/endpoints/people.ts
804
+ const BASE_PERSON = "/person";
805
+ /**
806
+ * Represents an endpoint for accessing information about people.
807
+ */
808
+ var PeopleEndpoint = class extends BaseEndpoint {
809
+ /**
810
+ * Constructs a new PeopleEndpoint instance.
811
+ * @param {string} access_token - The access token used for authentication.
812
+ */
813
+ constructor(access_token) {
814
+ super(access_token);
815
+ this.access_token = access_token;
816
+ }
817
+ /**
818
+ * Retrieves details of a specific person asynchronously.
819
+ * @param {number} id - The ID of the person.
820
+ * @param {AppendToResponsePersonKey[]} [appendToResponse] - Optional keys to append to the response.
821
+ * @param {string} [language] - Optional parameter for specifying the language.
822
+ * @returns {Promise<AppendToResponse<PersonDetails, AppendToResponsePersonKey[], 'person'>>} A Promise that resolves with the details of the person.
823
+ */
824
+ async details(id, appendToResponse, language) {
825
+ const options = {
826
+ append_to_response: appendToResponse ? appendToResponse.join(",") : void 0,
827
+ language
828
+ };
829
+ return await this.api.get(`${BASE_PERSON}/${id}`, options);
830
+ }
831
+ /**
832
+ * Retrieves changes made to a specific person asynchronously.
833
+ * @param {number} id - The ID of the person.
834
+ * @param {ChangeOption} [options] - Optional parameters for filtering changes.
835
+ * @returns {Promise<Changes<PersonChangeValue>>} A Promise that resolves with the changes made to the person.
836
+ */
837
+ async changes(id, options) {
838
+ return await this.api.get(`${BASE_PERSON}/${id}/changes`, options);
839
+ }
840
+ /**
841
+ * Retrieves movie credits of a specific person asynchronously.
842
+ * @param {number} id - The ID of the person.
843
+ * @param {LanguageOption} [options] - Optional parameters for specifying the language.
844
+ * @returns {Promise<PersonMovieCredit>} A Promise that resolves with the movie credits of the person.
845
+ */
846
+ async movieCredits(id, options) {
847
+ return await this.api.get(`${BASE_PERSON}/${id}/movie_credits`, options);
848
+ }
849
+ /**
850
+ * Retrieves TV show credits of a specific person asynchronously.
851
+ * @param {number} id - The ID of the person.
852
+ * @param {LanguageOption} [options] - Optional parameters for specifying the language.
853
+ * @returns {Promise<PersonTvShowCredit>} A Promise that resolves with the TV show credits of the person.
854
+ */
855
+ async tvShowCredits(id, options) {
856
+ return await this.api.get(`${BASE_PERSON}/${id}/tv_credits`, options);
857
+ }
858
+ /**
859
+ * Retrieves combined credits of a specific person asynchronously.
860
+ * @param {number} id - The ID of the person.
861
+ * @param {LanguageOption} [options] - Optional parameters for specifying the language.
862
+ * @returns {Promise<PersonCombinedCredits>} A Promise that resolves with the combined credits of the person.
863
+ */
864
+ async combinedCredits(id, options) {
865
+ return await this.api.get(`${BASE_PERSON}/${id}/combined_credits`, options);
866
+ }
867
+ /**
868
+ * Retrieves external IDs of a specific person asynchronously.
869
+ * @param {number} id - The ID of the person.
870
+ * @returns {Promise<ExternalIds>} A Promise that resolves with the external IDs of the person.
871
+ */
872
+ async externalId(id) {
873
+ return await this.api.get(`${BASE_PERSON}/${id}/external_ids`);
874
+ }
875
+ /**
876
+ * Retrieves images of a specific person asynchronously.
877
+ * @param {number} id - The ID of the person.
878
+ * @returns {Promise<PeopleImages>} A Promise that resolves with the images of the person.
879
+ */
880
+ async images(id) {
881
+ return await this.api.get(`${BASE_PERSON}/${id}/images`);
882
+ }
883
+ /**
884
+ * Retrieves tagged images of a specific person asynchronously.
885
+ * @param {number} id - The ID of the person.
886
+ * @param {PageOption} [options] - Optional parameters for specifying pagination options.
887
+ * @returns {Promise<TaggedImages>} A Promise that resolves with the tagged images of the person.
888
+ */
889
+ async taggedImages(id, options) {
890
+ return await this.api.get(`${BASE_PERSON}/${id}/tagged_images`, options);
891
+ }
892
+ /**
893
+ * Retrieves translations of a specific person asynchronously.
894
+ * @param {number} id - The ID of the person.
895
+ * @returns {Promise<PersonTranslations>} A Promise that resolves with the translations of the person.
896
+ */
897
+ async translation(id) {
898
+ return await this.api.get(`${BASE_PERSON}/${id}/translations`);
899
+ }
900
+ /**
901
+ * Retrieves details of the latest person asynchronously.
902
+ * @returns {Promise<PersonDetails>} A Promise that resolves with the details of the latest person.
903
+ */
904
+ async latest() {
905
+ return await this.api.get(`${BASE_PERSON}/latest`);
906
+ }
907
+ /**
908
+ * Retrieves popular persons asynchronously.
909
+ * @param {LanguageOption & PageOption} [options] - Optional parameters for specifying language and pagination options.
910
+ * @returns {Promise<PopularPersons>} A Promise that resolves with the popular persons.
911
+ */
912
+ async popular(options) {
913
+ return await this.api.get(`${BASE_PERSON}/popular`, options);
914
+ }
915
+ };
916
+
917
+ //#endregion
918
+ //#region src/endpoints/review.ts
919
+ /**
920
+ * Represents an endpoint for accessing review details.
921
+ */
922
+ var ReviewEndpoint = class extends BaseEndpoint {
923
+ /**
924
+ * Constructs a new ReviewEndpoint instance.
925
+ * @param {string} access_token - The access token used for authentication.
926
+ */
927
+ constructor(access_token) {
928
+ super(access_token);
929
+ this.access_token = access_token;
930
+ }
931
+ /**
932
+ * Retrieves details of a specific review asynchronously.
933
+ * @param {string} id - The ID of the review.
934
+ * @returns {Promise<ReviewDetails>} A Promise that resolves with the details of the review.
935
+ */
936
+ async details(id) {
937
+ return await this.api.get(`/review/${id}`);
938
+ }
939
+ };
940
+
941
+ //#endregion
942
+ //#region src/endpoints/search.ts
943
+ const BASE_SEARCH = "/search";
944
+ /**
945
+ * Represents an endpoint for performing various search operations.
946
+ */
947
+ var SearchEndpoint = class extends BaseEndpoint {
948
+ /**
949
+ * Constructs a new SearchEndpoint instance.
950
+ * @param {string} access_token - The access token used for authentication.
951
+ */
952
+ constructor(access_token) {
953
+ super(access_token);
954
+ this.access_token = access_token;
955
+ }
956
+ /**
957
+ * Searches for companies asynchronously.
958
+ * @param {SearchOptions} options - The search options.
959
+ * @returns {Promise<Search<Company>>} A Promise that resolves with the search results for companies.
960
+ */
961
+ async companies(options) {
962
+ return await this.api.get(`${BASE_SEARCH}/company`, options);
963
+ }
964
+ /**
965
+ * Searches for collections asynchronously.
966
+ * @param {SearchOptions} options - The search options.
967
+ * @returns {Promise<Search<Collection>>} A Promise that resolves with the search results for collections.
968
+ */
969
+ async collections(options) {
970
+ return await this.api.get(`${BASE_SEARCH}/collection`, options);
971
+ }
972
+ /**
973
+ * Searches for keywords asynchronously.
974
+ * @param {SearchOptions} options - The search options.
975
+ * @returns {Promise<Search<{ id: string; name: string }>>} A Promise that resolves with the search results for keywords.
976
+ */
977
+ async keywords(options) {
978
+ return await this.api.get(`${BASE_SEARCH}/keyword`, options);
979
+ }
980
+ /**
981
+ * Searches for movies asynchronously.
982
+ * @param {MovieSearchOptions} options - The search options.
983
+ * @returns {Promise<Search<Movie>>} A Promise that resolves with the search results for movies.
984
+ */
985
+ async movies(options) {
986
+ return await this.api.get(`${BASE_SEARCH}/movie`, options);
987
+ }
988
+ /**
989
+ * Searches for people asynchronously.
990
+ * @param {PeopleSearchOptions} options - The search options.
991
+ * @returns {Promise<Search<Person>>} A Promise that resolves with the search results for people.
992
+ */
993
+ async people(options) {
994
+ return await this.api.get(`${BASE_SEARCH}/person`, options);
995
+ }
996
+ /**
997
+ * Searches for TV shows asynchronously.
998
+ * @param {TvSearchOptions} options - The search options.
999
+ * @returns {Promise<Search<TV>>} A Promise that resolves with the search results for TV shows.
1000
+ */
1001
+ async tv(options) {
1002
+ return await this.api.get(`${BASE_SEARCH}/tv`, options);
1003
+ }
1004
+ /**
1005
+ * Performs a multi-search asynchronously.
1006
+ * @param {MultiSearchOptions} options - The search options.
1007
+ * @returns {Promise<Search<MultiSearchResult>>} A Promise that resolves with the multi-search results.
1008
+ */
1009
+ async multi(options) {
1010
+ return await this.api.get(`${BASE_SEARCH}/multi`, options);
1011
+ }
1012
+ };
1013
+
1014
+ //#endregion
1015
+ //#region src/endpoints/trending.ts
1016
+ /**
1017
+ * Represents an endpoint for retrieving trending content.
1018
+ */
1019
+ var TrendingEndpoint = class extends BaseEndpoint {
1020
+ /**
1021
+ * Constructs a new TrendingEndpoint instance.
1022
+ * @param {string} access_token - The access token used for authentication.
1023
+ */
1024
+ constructor(access_token) {
1025
+ super(access_token);
1026
+ this.access_token = access_token;
1027
+ }
1028
+ /**
1029
+ * Retrieves trending content asynchronously based on media type and time window.
1030
+ * @param {TrendingMediaType} mediaType - The type of media (e.g., 'all', 'movie', 'tv').
1031
+ * @param {TimeWindow} timeWindow - The time window for trending content (e.g., 'day', 'week').
1032
+ * @param {LanguageOption & PageOption} [options] - Optional parameters for specifying the language and pagination.
1033
+ * @returns {Promise<TrendingResults<T>>} A Promise that resolves with the trending results.
1034
+ * @template T - The type of media being searched for (e.g., 'movie', 'tv').
1035
+ */
1036
+ async trending(mediaType, timeWindow, options) {
1037
+ return await this.api.get(`/trending/${mediaType}/${timeWindow}`, options);
1038
+ }
1039
+ };
1040
+
1041
+ //#endregion
1042
+ //#region src/endpoints/tvEpisodes.ts
1043
+ const BASE_EPISODE = (episodeSelection) => {
1044
+ return `/tv/${episodeSelection.tvShowID}/season/${episodeSelection.seasonNumber}/episode/${episodeSelection.episodeNumber}`;
1045
+ };
1046
+ /**
1047
+ * Represents an endpoint for accessing TV episode-related information.
1048
+ */
1049
+ var TvEpisodesEndpoint = class extends BaseEndpoint {
1050
+ /**
1051
+ * Constructs a new TvEpisodesEndpoint instance.
1052
+ * @param {string} access_token - The access token used for authentication.
1053
+ */
1054
+ constructor(access_token) {
1055
+ super(access_token);
1056
+ this.access_token = access_token;
1057
+ }
1058
+ /**
1059
+ * Retrieves details of a specific TV episode asynchronously.
1060
+ * @param {EpisodeSelection} episodeSelection - The selection criteria for the TV episode.
1061
+ * @param {AppendToResponseTvEpisodeKey[]} [appendToResponse] - Additional data to append to the response.
1062
+ * @param {LanguageOption} [options] - Optional parameters for specifying the language.
1063
+ * @returns {Promise<AppendToResponse<Omit<Episode, 'show_id'>, AppendToResponseTvEpisodeKey[], 'tvEpisode'>>}
1064
+ * A Promise that resolves with the details of the TV episode.
1065
+ */
1066
+ async details(episodeSelection, appendToResponse, options) {
1067
+ const combinedOptions = {
1068
+ append_to_response: appendToResponse ? appendToResponse.join(",") : void 0,
1069
+ ...options
1070
+ };
1071
+ return await this.api.get(`${BASE_EPISODE(episodeSelection)}`, combinedOptions);
1072
+ }
1073
+ /**
1074
+ * Retrieves changes related to a specific TV episode asynchronously.
1075
+ * @param {number} episodeID - The ID of the TV episode.
1076
+ * @param {ChangeOption} [options] - Optional parameters for specifying changes.
1077
+ * @returns {Promise<Changes<TvEpisodeChangeValue>>} A Promise that resolves with the changes related to the TV episode.
1078
+ */
1079
+ async changes(episodeID, options) {
1080
+ return await this.api.get(`/tv/episode/${episodeID}/changes`, options);
1081
+ }
1082
+ /**
1083
+ * Retrieves credits for a specific TV episode asynchronously.
1084
+ * @param {EpisodeSelection} episodeSelection - The selection criteria for the TV episode.
1085
+ * @param {LanguageOption} [options] - Optional parameters for specifying the language.
1086
+ * @returns {Promise<TvEpisodeCredit>} A Promise that resolves with the credits for the TV episode.
1087
+ */
1088
+ async credits(episodeSelection, options) {
1089
+ return await this.api.get(`${BASE_EPISODE(episodeSelection)}/credits`, options);
1090
+ }
1091
+ /**
1092
+ * Retrieves external IDs for a specific TV episode asynchronously.
1093
+ * @param {EpisodeSelection} episodeSelection - The selection criteria for the TV episode.
1094
+ * @returns {Promise<ExternalIds>} A Promise that resolves with the external IDs for the TV episode.
1095
+ */
1096
+ async externalIds(episodeSelection) {
1097
+ return await this.api.get(`${BASE_EPISODE(episodeSelection)}/external_ids`);
1098
+ }
1099
+ /**
1100
+ * Retrieves images for a specific TV episode asynchronously.
1101
+ * @param {EpisodeSelection} episodeSelection - The selection criteria for the TV episode.
1102
+ * @param {TvEpisodeImageSearchOptions} [options] - Optional parameters for specifying image search options.
1103
+ * @returns {Promise<Images>} A Promise that resolves with the images for the TV episode.
1104
+ */
1105
+ async images(episodeSelection, options) {
1106
+ const computedOptions = {
1107
+ include_image_language: options?.include_image_language?.join(","),
1108
+ language: options?.language
1109
+ };
1110
+ return await this.api.get(`${BASE_EPISODE(episodeSelection)}/images`, computedOptions);
1111
+ }
1112
+ /**
1113
+ * Retrieves translations for a specific TV episode asynchronously.
1114
+ * @param {EpisodeSelection} episodeSelection - The selection criteria for the TV episode.
1115
+ * @returns {Promise<TvEpisodeTranslations>} A Promise that resolves with the translations for the TV episode.
1116
+ */
1117
+ async translations(episodeSelection) {
1118
+ return await this.api.get(`${BASE_EPISODE(episodeSelection)}/translations`);
1119
+ }
1120
+ /**
1121
+ * Retrieves videos for a specific TV episode asynchronously.
1122
+ * @param {EpisodeSelection} episodeSelection - The selection criteria for the TV episode.
1123
+ * @param {TvEpisodeVideoSearchOptions} [options] - Optional parameters for specifying video search options.
1124
+ * @returns {Promise<Videos>} A Promise that resolves with the videos for the TV episode.
1125
+ */
1126
+ async videos(episodeSelection, options) {
1127
+ const computedOptions = {
1128
+ include_video_language: options?.include_video_language?.join(","),
1129
+ language: options?.language
1130
+ };
1131
+ return await this.api.get(`${BASE_EPISODE(episodeSelection)}/videos`, computedOptions);
1132
+ }
1133
+ };
1134
+
1135
+ //#endregion
1136
+ //#region src/endpoints/tvSeasons.ts
1137
+ const BASE_SEASON = (seasonSelection) => {
1138
+ return `/tv/${seasonSelection.tvShowID}/season/${seasonSelection.seasonNumber}`;
1139
+ };
1140
+ /**
1141
+ * Represents an endpoint for accessing TV season-related information.
1142
+ */
1143
+ var TvSeasonsEndpoint = class extends BaseEndpoint {
1144
+ /**
1145
+ * Constructs a new TvSeasonsEndpoint instance.
1146
+ * @param {string} access_token - The access token used for authentication.
1147
+ */
1148
+ constructor(access_token) {
1149
+ super(access_token);
1150
+ this.access_token = access_token;
1151
+ }
1152
+ /**
1153
+ * Retrieves details of a specific TV season asynchronously.
1154
+ * @param {SeasonSelection} seasonSelection - The selection criteria for the TV season.
1155
+ * @param {AppendToResponseTvSeasonKey[]} [appendToResponse] - Additional data to append to the response.
1156
+ * @param {LanguageOption} [options] - Optional parameters for specifying the language.
1157
+ * @returns {Promise<AppendToResponse<SeasonDetails, AppendToResponseTvSeasonKey[], 'tvSeason'>>}
1158
+ * A Promise that resolves with the details of the TV season.
1159
+ */
1160
+ async details(seasonSelection, appendToResponse, options) {
1161
+ const combinedOptions = {
1162
+ append_to_response: appendToResponse ? appendToResponse.join(",") : void 0,
1163
+ ...options
1164
+ };
1165
+ return await this.api.get(`${BASE_SEASON(seasonSelection)}`, combinedOptions);
1166
+ }
1167
+ /**
1168
+ * Retrieves aggregate credits for a specific TV season asynchronously.
1169
+ * @param {SeasonSelection} seasonSelection - The selection criteria for the TV season.
1170
+ * @param {LanguageOption} [options] - Optional parameters for specifying the language.
1171
+ * @returns {Promise<AggregateCredits>} A Promise that resolves with the aggregate credits for the TV season.
1172
+ */
1173
+ async aggregateCredits(seasonSelection, options) {
1174
+ return await this.api.get(`${BASE_SEASON(seasonSelection)}/aggregate_credits`, options);
1175
+ }
1176
+ /**
1177
+ * Retrieves changes related to a specific TV season asynchronously.
1178
+ * @param {number} seasonId - The ID of the TV season.
1179
+ * @param {ChangeOption} [options] - Optional parameters for specifying changes.
1180
+ * @returns {Promise<Changes<TvSeasonChangeValue>>} A Promise that resolves with the changes related to the TV season.
1181
+ */
1182
+ async changes(seasonId, options) {
1183
+ return await this.api.get(`/tv/season/${seasonId}/changes`, options);
1184
+ }
1185
+ /**
1186
+ * Retrieves credits for a specific TV season asynchronously.
1187
+ * @param {SeasonSelection} seasonSelection - The selection criteria for the TV season.
1188
+ * @param {LanguageOption} [options] - Optional parameters for specifying the language.
1189
+ * @returns {Promise<Credits>} A Promise that resolves with the credits for the TV season.
1190
+ */
1191
+ async credits(seasonSelection, options) {
1192
+ return await this.api.get(`${BASE_SEASON(seasonSelection)}/credits`, options);
1193
+ }
1194
+ /**
1195
+ * Retrieves external IDs for a specific TV season asynchronously.
1196
+ * @param {SeasonSelection} seasonSelection - The selection criteria for the TV season.
1197
+ * @param {LanguageOption} [options] - Optional parameters for specifying the language.
1198
+ * @returns {Promise<ExternalIds>} A Promise that resolves with the external IDs for the TV season.
1199
+ */
1200
+ async externalIds(seasonSelection, options) {
1201
+ return await this.api.get(`${BASE_SEASON(seasonSelection)}/external_ids`, options);
1202
+ }
1203
+ /**
1204
+ * Retrieves images for a specific TV season asynchronously.
1205
+ * @param {SeasonSelection} seasonSelection - The selection criteria for the TV season.
1206
+ * @param {TvSeasonImageSearchOptions} [options] - Optional parameters for specifying image search options.
1207
+ * @returns {Promise<Images>} A Promise that resolves with the images for the TV season.
1208
+ */
1209
+ async images(seasonSelection, options) {
1210
+ const computedOptions = {
1211
+ include_image_language: options?.include_image_language?.join(","),
1212
+ language: options?.language
1213
+ };
1214
+ return await this.api.get(`${BASE_SEASON(seasonSelection)}/images`, computedOptions);
1215
+ }
1216
+ /**
1217
+ * Retrieves videos for a specific TV season asynchronously.
1218
+ * @param {SeasonSelection} seasonSelection - The selection criteria for the TV season.
1219
+ * @param {TvSeasonVideoSearchOptions} [options] - Optional parameters for specifying video search options.
1220
+ * @returns {Promise<Videos>} A Promise that resolves with the videos for the TV season.
1221
+ */
1222
+ async videos(seasonSelection, options) {
1223
+ const computedOptions = {
1224
+ include_video_language: options?.include_video_language?.join(","),
1225
+ language: options?.language
1226
+ };
1227
+ return await this.api.get(`${BASE_SEASON(seasonSelection)}/videos`, computedOptions);
1228
+ }
1229
+ /**
1230
+ * Retrieves translations for a specific TV season asynchronously.
1231
+ * @param {SeasonSelection} seasonSelection - The selection criteria for the TV season.
1232
+ * @param {LanguageOption} [options] - Optional parameters for specifying the language.
1233
+ * @returns {Promise<Translations>} A Promise that resolves with the translations for the TV season.
1234
+ */
1235
+ async translations(seasonSelection, options) {
1236
+ return await this.api.get(`${BASE_SEASON(seasonSelection)}/translations`, options);
1237
+ }
1238
+ };
1239
+
1240
+ //#endregion
1241
+ //#region src/endpoints/tvShows.ts
1242
+ const BASE_TV = "/tv";
1243
+ /**
1244
+ * Represents an endpoint for accessing TV show-related information.
1245
+ */
1246
+ var TvShowsEndpoint = class extends BaseEndpoint {
1247
+ /**
1248
+ * Constructs a new TvShowsEndpoint instance.
1249
+ * @param {string} access_token - The access token used for authentication.
1250
+ */
1251
+ constructor(access_token) {
1252
+ super(access_token);
1253
+ this.access_token = access_token;
1254
+ }
1255
+ /**
1256
+ * Retrieves details of a specific TV show asynchronously.
1257
+ * @param {number} id - The ID of the TV show.
1258
+ * @param {AppendToResponseTvKey[]} [appendToResponse] - Additional data to append to the response.
1259
+ * @param {string} [language] - The language for the response.
1260
+ * @returns {Promise<AppendToResponse<TvShowDetails, AppendToResponseTvKey[], 'tvShow'>>}
1261
+ * A Promise that resolves with the details of the TV show.
1262
+ */
1263
+ async details(id, appendToResponse, language) {
1264
+ const options = {
1265
+ append_to_response: appendToResponse ? appendToResponse.join(",") : void 0,
1266
+ language
1267
+ };
1268
+ return await this.api.get(`${BASE_TV}/${id}`, options);
1269
+ }
1270
+ /**
1271
+ * Retrieves alternative titles of a specific TV show asynchronously.
1272
+ * @param {number} id - The ID of the TV show.
1273
+ * @returns {Promise<AlternativeTitles>} A Promise that resolves with the alternative titles of the TV show.
1274
+ */
1275
+ async alternativeTitles(id) {
1276
+ return await this.api.get(`${BASE_TV}/${id}/alternative_titles`);
1277
+ }
1278
+ /**
1279
+ * Retrieves changes for a specific TV show asynchronously.
1280
+ * @param {number} id - The ID of the TV show.
1281
+ * @param {ChangeOption} [options] - Additional options for the request.
1282
+ * @returns {Promise<Changes<TvShowChangeValue>>}
1283
+ * A Promise that resolves with the changes for the TV show.
1284
+ */
1285
+ async changes(id, options) {
1286
+ return await this.api.get(`${BASE_TV}/${id}/changes`, options);
1287
+ }
1288
+ /**
1289
+ * Retrieves content ratings for a specific TV show asynchronously.
1290
+ * @param {number} id - The ID of the TV show.
1291
+ * @returns {Promise<ContentRatings>} A Promise that resolves with the content ratings of the TV show.
1292
+ */
1293
+ async contentRatings(id) {
1294
+ return await this.api.get(`${BASE_TV}/${id}/content_ratings`);
1295
+ }
1296
+ /**
1297
+ * Retrieves aggregate credits for a specific TV show asynchronously.
1298
+ * @param {number} id - The ID of the TV show.
1299
+ * @param {LanguageOption} [options] - Additional options for the request.
1300
+ * @returns {Promise<AggregateCredits>} A Promise that resolves with the aggregate credits of the TV show.
1301
+ */
1302
+ async aggregateCredits(id, options) {
1303
+ return await this.api.get(`${BASE_TV}/${id}/aggregate_credits`, options);
1304
+ }
1305
+ /**
1306
+ * Retrieves credits for a specific TV show asynchronously.
1307
+ * @param {number} id - The ID of the TV show.
1308
+ * @param {LanguageOption} [options] - Additional options for the request.
1309
+ * @returns {Promise<Credits>} A Promise that resolves with the credits of the TV show.
1310
+ */
1311
+ async credits(id, options) {
1312
+ return await this.api.get(`${BASE_TV}/${id}/credits`, options);
1313
+ }
1314
+ /**
1315
+ * Retrieves details of a specific season of a TV show asynchronously.
1316
+ * @param {number} tvId - The ID of the TV show.
1317
+ * @param {number} seasonNumber - The season number.
1318
+ * @returns {Promise<SeasonDetails>} A Promise that resolves with the details of the season.
1319
+ */
1320
+ async season(tvId, seasonNumber) {
1321
+ return await this.api.get(`${BASE_TV}/${tvId}/season/${seasonNumber}`);
1322
+ }
1323
+ /**
1324
+ * Retrieves episode groups for a specific TV show asynchronously.
1325
+ * @param {number} id - The ID of the TV show.
1326
+ * @returns {Promise<EpisodeGroups>} A Promise that resolves with the episode groups of the TV show.
1327
+ */
1328
+ async episodeGroups(id) {
1329
+ return await this.api.get(`${BASE_TV}/${id}/episode_groups`);
1330
+ }
1331
+ /**
1332
+ * Retrieves external IDs for a specific TV show asynchronously.
1333
+ * @param {number} id - The ID of the TV show.
1334
+ * @returns {Promise<ExternalIds>} A Promise that resolves with the external IDs of the TV show.
1335
+ */
1336
+ async externalIds(id) {
1337
+ return await this.api.get(`${BASE_TV}/${id}/external_ids`);
1338
+ }
1339
+ /**
1340
+ * Retrieves images for a specific TV show asynchronously.
1341
+ * @param {number} id - The ID of the TV show.
1342
+ * @param {TvShowImageOptions} [options] - Additional options for the request.
1343
+ * @returns {Promise<Images>} A Promise that resolves with the images of the TV show.
1344
+ */
1345
+ async images(id, options) {
1346
+ const computedOptions = {
1347
+ include_image_language: options?.include_image_language?.join(","),
1348
+ language: options?.language
1349
+ };
1350
+ return await this.api.get(`${BASE_TV}/${id}/images`, computedOptions);
1351
+ }
1352
+ /**
1353
+ * Retrieves keywords for a specific TV show asynchronously.
1354
+ * @param {number} id - The ID of the TV show.
1355
+ * @returns {Promise<Keywords>} A Promise that resolves with the keywords of the TV show.
1356
+ */
1357
+ async keywords(id) {
1358
+ return await this.api.get(`${BASE_TV}/${id}/keywords`);
1359
+ }
1360
+ /**
1361
+ * Retrieves recommendations for a specific TV show asynchronously.
1362
+ * @param {number} id - The ID of the TV show.
1363
+ * @param {LanguageOption & PageOption} [options] - Additional options for the request.
1364
+ * @returns {Promise<Recommendations>} A Promise that resolves with the recommendations for the TV show.
1365
+ */
1366
+ async recommendations(id, options) {
1367
+ return await this.api.get(`${BASE_TV}/${id}/recommendations`, options);
1368
+ }
1369
+ /**
1370
+ * Retrieves reviews for a specific TV show asynchronously.
1371
+ * @param {number} id - The ID of the TV show.
1372
+ * @param {LanguageOption & PageOption} [options] - Additional options for the request.
1373
+ * @returns {Promise<Reviews>} A Promise that resolves with the reviews of the TV show.
1374
+ */
1375
+ async reviews(id, options) {
1376
+ return await this.api.get(`${BASE_TV}/${id}/reviews`, options);
1377
+ }
1378
+ /**
1379
+ * Retrieves information about whether the TV show was screened theatrically asynchronously.
1380
+ * @param {number} id - The ID of the TV show.
1381
+ * @returns {Promise<ScreenedTheatrically>} A Promise that resolves with information about theatrical screenings.
1382
+ */
1383
+ async screenedTheatrically(id) {
1384
+ return await this.api.get(`${BASE_TV}/${id}/screened_theatrically`);
1385
+ }
1386
+ /**
1387
+ * Retrieves similar TV shows for a specific TV show asynchronously.
1388
+ * @param {number} id - The ID of the TV show.
1389
+ * @param {LanguageOption & PageOption} [options] - Additional options for the request.
1390
+ * @returns {Promise<Similartv>} A Promise that resolves with the similar TV shows.
1391
+ */
1392
+ async similar(id, options) {
1393
+ return await this.api.get(`${BASE_TV}/${id}/similar`, options);
1394
+ }
1395
+ /**
1396
+ * Retrieves translations for a specific TV show asynchronously.
1397
+ * @param {number} id - The ID of the TV show.
1398
+ * @returns {Promise<Translations>} A Promise that resolves with the translations of the TV show.
1399
+ */
1400
+ async translations(id) {
1401
+ return await this.api.get(`${BASE_TV}/${id}/translations`);
1402
+ }
1403
+ /**
1404
+ * Retrieves videos for a specific TV show asynchronously.
1405
+ * @param {number} id - The ID of the TV show.
1406
+ * @param {TvShowVideoOptions} [options] - Additional options for the request.
1407
+ * @returns {Promise<Videos>} A Promise that resolves with the videos of the TV show.
1408
+ */
1409
+ async videos(id, options) {
1410
+ const computedOptions = {
1411
+ include_video_language: options?.include_video_language?.join(","),
1412
+ language: options?.language
1413
+ };
1414
+ return await this.api.get(`${BASE_TV}/${id}/videos`, computedOptions);
1415
+ }
1416
+ /**
1417
+ * Retrieves watch providers for a specific TV show asynchronously.
1418
+ * Powered by JustWatch.
1419
+ * @param {number} id - The ID of the TV show.
1420
+ * @returns {Promise<WatchProviders>} A Promise that resolves with the watch providers of the TV show.
1421
+ */
1422
+ async watchProviders(id) {
1423
+ return await this.api.get(`${BASE_TV}/${id}/watch/providers`);
1424
+ }
1425
+ /**
1426
+ * Retrieves the latest TV show asynchronously.
1427
+ * @returns {Promise<Latesttv>} A Promise that resolves with the latest TV show.
1428
+ */
1429
+ async latest() {
1430
+ return await this.api.get(`${BASE_TV}/latest`);
1431
+ }
1432
+ /**
1433
+ * Retrieves TV shows that are currently on the air asynchronously.
1434
+ * @param {PageOption & LanguageOption & TimezoneOption} [options] - Additional options for the request.
1435
+ * @returns {Promise<OnTheAir>} A Promise that resolves with TV shows currently on the air.
1436
+ */
1437
+ async onTheAir(options) {
1438
+ return await this.api.get(`${BASE_TV}/on_the_air`, options);
1439
+ }
1440
+ /**
1441
+ * Retrieves TV shows that are airing today asynchronously.
1442
+ * @param {PageOption & LanguageOption & TimezoneOption} [options] - Additional options for the request.
1443
+ * @returns {Promise<tvAiringToday>} A Promise that resolves with TV shows airing today.
1444
+ */
1445
+ async airingToday(options) {
1446
+ return await this.api.get(`${BASE_TV}/airing_today`, options);
1447
+ }
1448
+ /**
1449
+ * Retrieves popular TV shows asynchronously.
1450
+ * @param {PageOption & LanguageOption} [options] - Additional options for the request.
1451
+ * @returns {Promise<Populartv>} A Promise that resolves with popular TV shows.
1452
+ */
1453
+ async popular(options) {
1454
+ return await this.api.get(`${BASE_TV}/popular`, options);
1455
+ }
1456
+ /**
1457
+ * Retrieves top-rated TV shows asynchronously.
1458
+ * @param {PageOption & LanguageOption} [options] - Additional options for the request.
1459
+ * @returns {Promise<TopRatedtv>} A Promise that resolves with top-rated TV shows.
1460
+ */
1461
+ async topRated(options) {
1462
+ return await this.api.get(`${BASE_TV}/top_rated`, options);
1463
+ }
1464
+ };
1465
+
1466
+ //#endregion
1467
+ //#region src/endpoints/watchProviders.ts
1468
+ /**
1469
+ * Represents an endpoint for accessing watch provider information.
1470
+ */
1471
+ var WatchProvidersEndpoint = class extends BaseEndpoint {
1472
+ /**
1473
+ * Constructs a new WatchProvidersEndpoint instance.
1474
+ * @param {string} access_token - The access token used for authentication.
1475
+ */
1476
+ constructor(access_token) {
1477
+ super(access_token);
1478
+ this.access_token = access_token;
1479
+ }
1480
+ /**
1481
+ * Retrieves a list of all available watch providers (streaming services).
1482
+ * @returns {Promise<WatchProviders>} A Promise that resolves with the list of watch providers.
1483
+ */
1484
+ async available() {
1485
+ return await this.api.get("/watch/providers/movie");
1486
+ }
1487
+ /**
1488
+ * Retrieves a list of available regions for watch providers.
1489
+ * @returns {Promise<WatchRegionsResponse>} A Promise that resolves with the list of available regions.
1490
+ */
1491
+ async regions() {
1492
+ return await this.api.get("/watch/providers/regions");
1493
+ }
1494
+ /**
1495
+ * Retrieves a list of watch providers for movies.
1496
+ * @returns {Promise<WatchProviders>} A Promise that resolves with the list of movie watch providers.
1497
+ */
1498
+ async movie() {
1499
+ return await this.api.get("/watch/providers/movie");
1500
+ }
1501
+ /**
1502
+ * Retrieves a list of watch providers for TV shows.
1503
+ * @returns {Promise<WatchProviders>} A Promise that resolves with the list of TV watch providers.
1504
+ */
1505
+ async tv() {
1506
+ return await this.api.get("/watch/providers/tv");
1507
+ }
1508
+ };
1509
+
1510
+ //#endregion
1511
+ //#region src/index.ts
1512
+ var TMDB = class {
1513
+ constructor(auth) {
1514
+ this.account = new AccountEndpoint(auth);
1515
+ this.certification = new CertificationEndpoint(auth);
1516
+ this.changes = new ChangeEndpoint(auth);
1517
+ this.collections = new CollectionsEndpoint(auth);
1518
+ this.companies = new CompaniesEndpoint(auth);
1519
+ this.configuration = new ConfigurationEndpoint(auth);
1520
+ this.credits = new CreditsEndpoint(auth);
1521
+ this.discover = new DiscoverEndpoint(auth);
1522
+ this.find = new FindEndpoint(auth);
1523
+ this.genre = new GenreEndpoint(auth);
1524
+ this.keywords = new KeywordsEndpoint(auth);
1525
+ this.movies = new MoviesEndpoint(auth);
1526
+ this.networks = new NetworksEndpoint(auth);
1527
+ this.people = new PeopleEndpoint(auth);
1528
+ this.review = new ReviewEndpoint(auth);
1529
+ this.search = new SearchEndpoint(auth);
1530
+ this.trending = new TrendingEndpoint(auth);
1531
+ this.tvEpisodes = new TvEpisodesEndpoint(auth);
1532
+ this.tvSeasons = new TvSeasonsEndpoint(auth);
1533
+ this.tvShows = new TvShowsEndpoint(auth);
1534
+ this.watchProviders = new WatchProvidersEndpoint(auth);
1535
+ }
1536
+ account;
1537
+ certification;
1538
+ changes;
1539
+ collections;
1540
+ companies;
1541
+ configuration;
1542
+ credits;
1543
+ discover;
1544
+ find;
1545
+ genre;
1546
+ keywords;
1547
+ movies;
1548
+ networks;
1549
+ people;
1550
+ review;
1551
+ search;
1552
+ trending;
1553
+ tvEpisodes;
1554
+ tvSeasons;
1555
+ tvShows;
1556
+ watchProviders;
1557
+ };
1558
+
1559
+ //#endregion
1560
+ export { API, BackdropSizes, BaseEndpoint, ChangeKeys, ImageFormats, ImageSizes, LogoSizes, PosterSizes, ProfileSizes, ReleaseDateType, StillSizes, TMDB, getFullImagePath, parseOptions };
1561
+ //# sourceMappingURL=index.mjs.map