@kenzuya/tmdb-ts 2.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs ADDED
@@ -0,0 +1,1039 @@
1
+ var __create = Object.create;
2
+ var __getProtoOf = Object.getPrototypeOf;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __toESM = (mod, isNodeMode, target) => {
8
+ target = mod != null ? __create(__getProtoOf(mod)) : {};
9
+ const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
10
+ for (let key of __getOwnPropNames(mod))
11
+ if (!__hasOwnProp.call(to, key))
12
+ __defProp(to, key, {
13
+ get: () => mod[key],
14
+ enumerable: true
15
+ });
16
+ return to;
17
+ };
18
+ var __moduleCache = /* @__PURE__ */ new WeakMap;
19
+ var __toCommonJS = (from) => {
20
+ var entry = __moduleCache.get(from), desc;
21
+ if (entry)
22
+ return entry;
23
+ entry = __defProp({}, "__esModule", { value: true });
24
+ if (from && typeof from === "object" || typeof from === "function")
25
+ __getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
26
+ get: () => from[key],
27
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
28
+ }));
29
+ __moduleCache.set(from, entry);
30
+ return entry;
31
+ };
32
+ var __export = (target, all) => {
33
+ for (var name in all)
34
+ __defProp(target, name, {
35
+ get: all[name],
36
+ enumerable: true,
37
+ configurable: true,
38
+ set: (newValue) => all[name] = () => newValue
39
+ });
40
+ };
41
+
42
+ // src/index.ts
43
+ var exports_src = {};
44
+ __export(exports_src, {
45
+ parseOptions: () => parseOptions,
46
+ getFullImagePath: () => getFullImagePath,
47
+ TMDB: () => TMDB,
48
+ StillSize: () => StillSize,
49
+ ReleaseDateType: () => ReleaseDateType,
50
+ ProfileSize: () => ProfileSize,
51
+ PosterSize: () => PosterSize,
52
+ MediaSize: () => MediaSize,
53
+ LogoSize: () => LogoSize,
54
+ CountryCodes: () => CountryCodes,
55
+ ChangeKey: () => ChangeKey,
56
+ BackdropSize: () => BackdropSize,
57
+ AvailableLanguages: () => AvailableLanguages
58
+ });
59
+ module.exports = __toCommonJS(exports_src);
60
+
61
+ // src/api.ts
62
+ var import_cross_fetch = __toESM(require("cross-fetch"));
63
+
64
+ // src/common/constants.ts
65
+ var BASE_URL_V3 = "https://api.themoviedb.org/3";
66
+
67
+ // src/utils/getImagePath.ts
68
+ var getFullImagePath = (baseUrl, fileSize, imagePath, svg = false) => {
69
+ const imagePathArr = imagePath.split(".");
70
+ const imageFormat = svg ? "svg" : imagePathArr[1];
71
+ return `${baseUrl}${fileSize}${imagePathArr[0]}.${imageFormat}`;
72
+ };
73
+ // src/utils/parseOptions.ts
74
+ function parseOptions(options) {
75
+ return options ? new URLSearchParams(Object.entries(options).filter(([, v]) => v)).toString() : "";
76
+ }
77
+ // src/api.ts
78
+ class Api {
79
+ accessToken;
80
+ constructor(accessToken) {
81
+ this.accessToken = accessToken;
82
+ this.accessToken = accessToken;
83
+ }
84
+ async get(path, options) {
85
+ const params = parseOptions(options);
86
+ const response = await import_cross_fetch.default(`${BASE_URL_V3}${path}?${params}`, {
87
+ method: "GET",
88
+ headers: {
89
+ Authorization: `Bearer ${this.accessToken}`,
90
+ "Content-Type": "application/json;charset=utf-8"
91
+ }
92
+ });
93
+ if (!response.ok) {
94
+ return Promise.reject(await response.json());
95
+ }
96
+ return await response.json();
97
+ }
98
+ }
99
+
100
+ // src/endpoints/base.ts
101
+ class BaseEndpoint {
102
+ accessToken;
103
+ api;
104
+ constructor(accessToken) {
105
+ this.accessToken = accessToken;
106
+ this.api = new Api(accessToken);
107
+ }
108
+ }
109
+
110
+ // src/endpoints/account.ts
111
+ class AccountEndpoint extends BaseEndpoint {
112
+ async details() {
113
+ return await this.api.get("/account");
114
+ }
115
+ }
116
+ // src/endpoints/certification.ts
117
+ class CertificationEndpoint extends BaseEndpoint {
118
+ accessToken;
119
+ constructor(accessToken) {
120
+ super(accessToken);
121
+ this.accessToken = accessToken;
122
+ }
123
+ async movies() {
124
+ return await this.api.get("/certification/movie/list");
125
+ }
126
+ async tvShows() {
127
+ return await this.api.get("/certification/tv/list");
128
+ }
129
+ }
130
+ // src/endpoints/changes.ts
131
+ class ChangeEndpoint extends BaseEndpoint {
132
+ accessToken;
133
+ constructor(accessToken) {
134
+ super(accessToken);
135
+ this.accessToken = accessToken;
136
+ }
137
+ async movies(options) {
138
+ return await this.api.get("/movie/changes", options);
139
+ }
140
+ async tvShows(options) {
141
+ return await this.api.get("/tv/changes", options);
142
+ }
143
+ async person(options) {
144
+ return await this.api.get("/person/changes", options);
145
+ }
146
+ }
147
+ // src/endpoints/credits.ts
148
+ class CreditsEndpoint extends BaseEndpoint {
149
+ accessToken;
150
+ constructor(accessToken) {
151
+ super(accessToken);
152
+ this.accessToken = accessToken;
153
+ }
154
+ async getById(id) {
155
+ return await this.api.get(`/credit/${id}`);
156
+ }
157
+ }
158
+ // src/endpoints/search.ts
159
+ var BASE_SEARCH = "/search";
160
+
161
+ class SearchEndpoint extends BaseEndpoint {
162
+ accessToken;
163
+ constructor(accessToken) {
164
+ super(accessToken);
165
+ this.accessToken = accessToken;
166
+ }
167
+ async companies(options) {
168
+ return await this.api.get(`${BASE_SEARCH}/company`, options);
169
+ }
170
+ async collections(options) {
171
+ return await this.api.get(`${BASE_SEARCH}/collection`, options);
172
+ }
173
+ async keywords(options) {
174
+ return await this.api.get(`${BASE_SEARCH}/keyword`, options);
175
+ }
176
+ async movies(options) {
177
+ return await this.api.get(`${BASE_SEARCH}/movie`, options);
178
+ }
179
+ async people(options) {
180
+ return await this.api.get(`${BASE_SEARCH}/person`, options);
181
+ }
182
+ async tvShows(options) {
183
+ return await this.api.get(`${BASE_SEARCH}/tv`, options);
184
+ }
185
+ async multi(options) {
186
+ return await this.api.get(`${BASE_SEARCH}/multi`, options);
187
+ }
188
+ }
189
+ // src/endpoints/genre.ts
190
+ class GenreEndpoint extends BaseEndpoint {
191
+ accessToken;
192
+ constructor(accessToken) {
193
+ super(accessToken);
194
+ this.accessToken = accessToken;
195
+ }
196
+ async movies(options) {
197
+ return await this.api.get("/genre/movie/list", options);
198
+ }
199
+ async tvShows(options) {
200
+ return await this.api.get("/genre/tv/list", options);
201
+ }
202
+ }
203
+ // src/endpoints/movies.ts
204
+ var BASE_MOVIE = "/movie";
205
+
206
+ class MoviesEndpoint extends BaseEndpoint {
207
+ accessToken;
208
+ constructor(accessToken) {
209
+ super(accessToken);
210
+ this.accessToken = accessToken;
211
+ }
212
+ async details(id, appendToResponse, language) {
213
+ const options = {
214
+ append_to_response: appendToResponse ? appendToResponse.join(",") : undefined,
215
+ language
216
+ };
217
+ return await this.api.get(`${BASE_MOVIE}/${id}`, options);
218
+ }
219
+ async alternativeTitles(id) {
220
+ return await this.api.get(`${BASE_MOVIE}/${id}/alternative_titles`);
221
+ }
222
+ async changes(id, options) {
223
+ return await this.api.get(`${BASE_MOVIE}/${id}/changes`, options);
224
+ }
225
+ async credits(id, options) {
226
+ return await this.api.get(`${BASE_MOVIE}/${id}/credits`, options);
227
+ }
228
+ async externalIds(id) {
229
+ return await this.api.get(`${BASE_MOVIE}/${id}/external_ids`);
230
+ }
231
+ async images(id, options) {
232
+ const computedOptions = {
233
+ include_image_language: options?.include_image_language?.join(","),
234
+ language: options?.language
235
+ };
236
+ return await this.api.get(`${BASE_MOVIE}/${id}/images`, computedOptions);
237
+ }
238
+ async keywords(id) {
239
+ return await this.api.get(`${BASE_MOVIE}/${id}/keywords`);
240
+ }
241
+ async lists(id, options) {
242
+ return await this.api.get(`${BASE_MOVIE}/${id}/lists`, options);
243
+ }
244
+ async recommendations(id, options) {
245
+ return await this.api.get(`${BASE_MOVIE}/${id}/recommendations`, options);
246
+ }
247
+ async releaseDates(id) {
248
+ return await this.api.get(`${BASE_MOVIE}/${id}/release_dates`);
249
+ }
250
+ async reviews(id, options) {
251
+ return await this.api.get(`${BASE_MOVIE}/${id}/reviews`, options);
252
+ }
253
+ async similar(id, options) {
254
+ return await this.api.get(`${BASE_MOVIE}/${id}/similar`, options);
255
+ }
256
+ async translations(id) {
257
+ return await this.api.get(`${BASE_MOVIE}/${id}/translations`);
258
+ }
259
+ async videos(id, options) {
260
+ return await this.api.get(`${BASE_MOVIE}/${id}/videos`, options);
261
+ }
262
+ async watchProviders(id) {
263
+ return await this.api.get(`${BASE_MOVIE}/${id}/watch/providers`);
264
+ }
265
+ async latest() {
266
+ return await this.api.get(`${BASE_MOVIE}/latest`);
267
+ }
268
+ async nowPlaying(options) {
269
+ return await this.api.get(`${BASE_MOVIE}/now_playing`, options);
270
+ }
271
+ async popular(options) {
272
+ return await this.api.get(`${BASE_MOVIE}/popular`, options);
273
+ }
274
+ async topRated(options) {
275
+ return await this.api.get(`${BASE_MOVIE}/top_rated`, options);
276
+ }
277
+ async upcoming(options) {
278
+ return await this.api.get(`${BASE_MOVIE}/upcoming`, options);
279
+ }
280
+ }
281
+ // src/endpoints/configuration.ts
282
+ class ConfigurationEndpoint extends BaseEndpoint {
283
+ accessToken;
284
+ constructor(accessToken) {
285
+ super(accessToken);
286
+ this.accessToken = accessToken;
287
+ }
288
+ async getApiConfiguration() {
289
+ return await this.api.get("/configuration");
290
+ }
291
+ async getCountries() {
292
+ return await this.api.get("/configuration/countries");
293
+ }
294
+ async getLanguages() {
295
+ return await this.api.get("/configuration/languages");
296
+ }
297
+ async getJobs() {
298
+ return await this.api.get("/configuration/jobs");
299
+ }
300
+ async getPrimaryTranslations() {
301
+ return await this.api.get("/configuration/primary_translations");
302
+ }
303
+ async getTimezones() {
304
+ return await this.api.get("/configuration/timezones");
305
+ }
306
+ }
307
+ // src/endpoints/tv-shows.ts
308
+ var BASE_TV = "/tv";
309
+
310
+ class TvShowsEndpoint extends BaseEndpoint {
311
+ accessToken;
312
+ constructor(accessToken) {
313
+ super(accessToken);
314
+ this.accessToken = accessToken;
315
+ }
316
+ async details(id, appendToResponse, language) {
317
+ const options = {
318
+ append_to_response: appendToResponse ? appendToResponse.join(",") : undefined,
319
+ language
320
+ };
321
+ return await this.api.get(`${BASE_TV}/${id}`, options);
322
+ }
323
+ async alternativeTitles(id) {
324
+ return await this.api.get(`${BASE_TV}/${id}/alternative_titles`);
325
+ }
326
+ async changes(id, options) {
327
+ return await this.api.get(`${BASE_TV}/${id}/changes`, options);
328
+ }
329
+ async contentRatings(id) {
330
+ return await this.api.get(`${BASE_TV}/${id}/content_ratings`);
331
+ }
332
+ async aggregateCredits(id, options) {
333
+ return await this.api.get(`${BASE_TV}/${id}/aggregate_credits`, options);
334
+ }
335
+ async credits(id, options) {
336
+ return await this.api.get(`${BASE_TV}/${id}/credits`, options);
337
+ }
338
+ async season(tvId, seasonNumber) {
339
+ return await this.api.get(`${BASE_TV}/${tvId}/season/${seasonNumber}`);
340
+ }
341
+ async episodeGroups(id) {
342
+ return await this.api.get(`${BASE_TV}/${id}/episode_groups`);
343
+ }
344
+ async externalIds(id) {
345
+ return await this.api.get(`${BASE_TV}/${id}/external_ids`);
346
+ }
347
+ async images(id, options) {
348
+ const computedOptions = {
349
+ include_image_language: options?.include_image_language?.join(","),
350
+ language: options?.language
351
+ };
352
+ return await this.api.get(`${BASE_TV}/${id}/images`, computedOptions);
353
+ }
354
+ async keywords(id) {
355
+ return await this.api.get(`${BASE_TV}/${id}/keywords`);
356
+ }
357
+ async recommendations(id, options) {
358
+ return await this.api.get(`${BASE_TV}/${id}/recommendations`, options);
359
+ }
360
+ async reviews(id, options) {
361
+ return await this.api.get(`${BASE_TV}/${id}/reviews`, options);
362
+ }
363
+ async screenedTheatrically(id) {
364
+ return await this.api.get(`${BASE_TV}/${id}/screened_theatrically`);
365
+ }
366
+ async similar(id, options) {
367
+ return await this.api.get(`${BASE_TV}/${id}/similar`, options);
368
+ }
369
+ async translations(id) {
370
+ return await this.api.get(`${BASE_TV}/${id}/translations`);
371
+ }
372
+ async videos(id, options) {
373
+ const computedOptions = {
374
+ include_video_language: options?.include_video_language?.join(","),
375
+ language: options?.language
376
+ };
377
+ return await this.api.get(`${BASE_TV}/${id}/videos`, computedOptions);
378
+ }
379
+ async watchProviders(id) {
380
+ return await this.api.get(`${BASE_TV}/${id}/watch/providers`);
381
+ }
382
+ async latest() {
383
+ return await this.api.get(`${BASE_TV}/latest`);
384
+ }
385
+ async onTheAir(options) {
386
+ return await this.api.get(`${BASE_TV}/on_the_air`, options);
387
+ }
388
+ async airingToday(options) {
389
+ return await this.api.get(`${BASE_TV}/airing_today`, options);
390
+ }
391
+ async popular(options) {
392
+ return await this.api.get(`${BASE_TV}/popular`, options);
393
+ }
394
+ async topRated(options) {
395
+ return await this.api.get(`${BASE_TV}/top_rated`, options);
396
+ }
397
+ }
398
+ // src/endpoints/discover.ts
399
+ var BASE_DISCOVER = "/discover";
400
+
401
+ class DiscoverEndpoint extends BaseEndpoint {
402
+ async movie(options) {
403
+ return await this.api.get(`${BASE_DISCOVER}/movie`, options);
404
+ }
405
+ async tvShow(options) {
406
+ return await this.api.get(`${BASE_DISCOVER}/tv`, options);
407
+ }
408
+ }
409
+ // src/endpoints/people.ts
410
+ var BASE_PERSON = "/person";
411
+
412
+ class PeopleEndpoint extends BaseEndpoint {
413
+ async details(id, appendToResponse, language) {
414
+ const options = {
415
+ append_to_response: appendToResponse ? appendToResponse.join(",") : undefined,
416
+ language
417
+ };
418
+ return await this.api.get(`${BASE_PERSON}/${id}`, options);
419
+ }
420
+ async changes(id, options) {
421
+ return await this.api.get(`${BASE_PERSON}/${id}/changes`, options);
422
+ }
423
+ async movieCredits(id, options) {
424
+ return await this.api.get(`${BASE_PERSON}/${id}/movie_credits`, options);
425
+ }
426
+ async tvShowCredits(id, options) {
427
+ return await this.api.get(`${BASE_PERSON}/${id}/tv_credits`, options);
428
+ }
429
+ async combinedCredits(id, options) {
430
+ return await this.api.get(`${BASE_PERSON}/${id}/combined_credits`, options);
431
+ }
432
+ async externalId(id) {
433
+ return await this.api.get(`${BASE_PERSON}/${id}/external_ids`);
434
+ }
435
+ async images(id) {
436
+ return await this.api.get(`${BASE_PERSON}/${id}/images`);
437
+ }
438
+ async taggedImages(id, options) {
439
+ return await this.api.get(`${BASE_PERSON}/${id}/tagged_images`, options);
440
+ }
441
+ async translation(id) {
442
+ return await this.api.get(`${BASE_PERSON}/${id}/translations`);
443
+ }
444
+ async latest() {
445
+ return await this.api.get(`${BASE_PERSON}/latest`);
446
+ }
447
+ async popular(options) {
448
+ return await this.api.get(`${BASE_PERSON}/popular`, options);
449
+ }
450
+ }
451
+ // src/endpoints/review.ts
452
+ class ReviewEndpoint extends BaseEndpoint {
453
+ async details(id) {
454
+ return await this.api.get(`/review/${id}`);
455
+ }
456
+ }
457
+ // src/endpoints/trending.ts
458
+ class TrendingEndpoint extends BaseEndpoint {
459
+ async trending(mediaType, timeWindow, options) {
460
+ return await this.api.get(`/trending/${mediaType}/${timeWindow}`, options);
461
+ }
462
+ }
463
+ // src/endpoints/find.ts
464
+ class FindEndpoint extends BaseEndpoint {
465
+ async byExternalId(id, options) {
466
+ return await this.api.get(`/find/${id}`, options);
467
+ }
468
+ }
469
+ // src/endpoints/keywords.ts
470
+ var BASE_Keyword = "/keyword";
471
+
472
+ class KeywordsEndpoint extends BaseEndpoint {
473
+ async details(keywordId) {
474
+ return await this.api.get(`${BASE_Keyword}/${keywordId}`);
475
+ }
476
+ async belongingMovies(keywordId, options) {
477
+ return await this.api.get(`${BASE_Keyword}/${keywordId}/movies`, options);
478
+ }
479
+ }
480
+ // src/endpoints/collections.ts
481
+ var BASE_COLLECTION = "/collection";
482
+
483
+ class CollectionsEndpoint extends BaseEndpoint {
484
+ accessToken;
485
+ constructor(accessToken) {
486
+ super(accessToken);
487
+ this.accessToken = accessToken;
488
+ }
489
+ async details(id, options) {
490
+ return await this.api.get(`${BASE_COLLECTION}/${id}`, options);
491
+ }
492
+ async images(id, options) {
493
+ const computedOptions = {
494
+ include_image_language: options?.include_image_language?.join(","),
495
+ language: options?.language
496
+ };
497
+ return await this.api.get(`${BASE_COLLECTION}/${id}/images`, computedOptions);
498
+ }
499
+ async translations(id, options) {
500
+ return await this.api.get(`${BASE_COLLECTION}/${id}/translations`, options);
501
+ }
502
+ }
503
+ // src/endpoints/tv-seasons.ts
504
+ var BASE_SEASON = (seasonSelection) => {
505
+ return `/tv/${seasonSelection.tvShowID}/season/${seasonSelection.seasonNumber}`;
506
+ };
507
+
508
+ class TvSeasonsEndpoint extends BaseEndpoint {
509
+ async details(seasonSelection, appendToResponse, options) {
510
+ const combinedOptions = {
511
+ append_to_response: appendToResponse ? appendToResponse.join(",") : undefined,
512
+ ...options
513
+ };
514
+ return await this.api.get(`${BASE_SEASON(seasonSelection)}`, combinedOptions);
515
+ }
516
+ async aggregateCredits(seasonSelection, options) {
517
+ return await this.api.get(`${BASE_SEASON(seasonSelection)}/aggregate_credits`, options);
518
+ }
519
+ async changes(seasonId, options) {
520
+ return await this.api.get(`/tv/season/${seasonId}/changes`, options);
521
+ }
522
+ async credits(seasonSelection, options) {
523
+ return await this.api.get(`${BASE_SEASON(seasonSelection)}/credits`, options);
524
+ }
525
+ async externalIds(seasonSelection, options) {
526
+ return await this.api.get(`${BASE_SEASON(seasonSelection)}/external_ids`, options);
527
+ }
528
+ async images(seasonSelection, options) {
529
+ const computedOptions = {
530
+ include_image_language: options?.include_image_language?.join(","),
531
+ language: options?.language
532
+ };
533
+ return await this.api.get(`${BASE_SEASON(seasonSelection)}/images`, computedOptions);
534
+ }
535
+ async videos(seasonSelection, options) {
536
+ const computedOptions = {
537
+ include_video_language: options?.include_video_language?.join(","),
538
+ language: options?.language
539
+ };
540
+ return await this.api.get(`${BASE_SEASON(seasonSelection)}/videos`, computedOptions);
541
+ }
542
+ async translations(seasonSelection, options) {
543
+ return await this.api.get(`${BASE_SEASON(seasonSelection)}/translations`, options);
544
+ }
545
+ }
546
+ // src/endpoints/tv-episode.ts
547
+ var BASE_EPISODE = (episodeSelection) => {
548
+ return `/tv/${episodeSelection.tvShowID}/season/${episodeSelection.seasonNumber}/episode/${episodeSelection.episodeNumber}`;
549
+ };
550
+
551
+ class TvEpisodesEndpoint extends BaseEndpoint {
552
+ async details(episodeSelection, appendToResponse, options) {
553
+ const combinedOptions = {
554
+ append_to_response: appendToResponse ? appendToResponse.join(",") : undefined,
555
+ ...options
556
+ };
557
+ return await this.api.get(`${BASE_EPISODE(episodeSelection)}`, combinedOptions);
558
+ }
559
+ async changes(episodeID, options) {
560
+ return await this.api.get(`/tv/episode/${episodeID}/changes`, options);
561
+ }
562
+ async credits(episodeSelection, options) {
563
+ return await this.api.get(`${BASE_EPISODE(episodeSelection)}/credits`, options);
564
+ }
565
+ async externalIds(episodeSelection) {
566
+ return await this.api.get(`${BASE_EPISODE(episodeSelection)}/external_ids`);
567
+ }
568
+ async images(episodeSelection, options) {
569
+ const computedOptions = {
570
+ include_image_language: options?.include_image_language?.join(","),
571
+ language: options?.language
572
+ };
573
+ return await this.api.get(`${BASE_EPISODE(episodeSelection)}/images`, computedOptions);
574
+ }
575
+ async translations(episodeSelection) {
576
+ return await this.api.get(`${BASE_EPISODE(episodeSelection)}/translations`);
577
+ }
578
+ async videos(episodeSelection, options) {
579
+ const computedOptions = {
580
+ include_video_language: options?.include_video_language?.join(","),
581
+ language: options?.language
582
+ };
583
+ return await this.api.get(`${BASE_EPISODE(episodeSelection)}/videos`, computedOptions);
584
+ }
585
+ }
586
+ // src/endpoints/watch-providers.ts
587
+ class WatchProvidersEndpoint extends BaseEndpoint {
588
+ accessToken;
589
+ constructor(accessToken) {
590
+ super(accessToken);
591
+ this.accessToken = accessToken;
592
+ }
593
+ async getRegions(options) {
594
+ return await this.api.get("/watch/providers/regions", options);
595
+ }
596
+ async getMovieProviders(options) {
597
+ return await this.api.get("/watch/providers/movie", options);
598
+ }
599
+ async getTvProviders(options) {
600
+ return await this.api.get("/watch/providers/tv", options);
601
+ }
602
+ }
603
+ // src/endpoints/companies.ts
604
+ class CompaniesEndpoint extends BaseEndpoint {
605
+ accessToken;
606
+ constructor(accessToken) {
607
+ super(accessToken);
608
+ this.accessToken = accessToken;
609
+ }
610
+ async details(id) {
611
+ return await this.api.get(`/company/${id}`);
612
+ }
613
+ async alternativeNames(id) {
614
+ return await this.api.get(`/company/${id}/alternative_names`);
615
+ }
616
+ async images(id) {
617
+ return await this.api.get(`/company/${id}/images`);
618
+ }
619
+ }
620
+
621
+ // src/endpoints/networks.ts
622
+ class NetworksEndpoint extends BaseEndpoint {
623
+ accessToken;
624
+ constructor(accessToken) {
625
+ super(accessToken);
626
+ this.accessToken = accessToken;
627
+ }
628
+ async details(id) {
629
+ return await this.api.get(`/network/${id}`);
630
+ }
631
+ async alternativeNames(id) {
632
+ return await this.api.get(`/network/${id}/alternative_names`);
633
+ }
634
+ async images(id) {
635
+ return await this.api.get(`/network/${id}/images`);
636
+ }
637
+ }
638
+
639
+ // src/tmdb.ts
640
+ class TMDB {
641
+ accessToken;
642
+ constructor(accessToken) {
643
+ this.accessToken = accessToken;
644
+ }
645
+ get account() {
646
+ return new AccountEndpoint(this.accessToken);
647
+ }
648
+ get configuration() {
649
+ return new ConfigurationEndpoint(this.accessToken);
650
+ }
651
+ get certifications() {
652
+ return new CertificationEndpoint(this.accessToken);
653
+ }
654
+ get changes() {
655
+ return new ChangeEndpoint(this.accessToken);
656
+ }
657
+ get credits() {
658
+ return new CreditsEndpoint(this.accessToken);
659
+ }
660
+ get companies() {
661
+ return new CompaniesEndpoint(this.accessToken);
662
+ }
663
+ get networks() {
664
+ return new NetworksEndpoint(this.accessToken);
665
+ }
666
+ get search() {
667
+ return new SearchEndpoint(this.accessToken);
668
+ }
669
+ get genres() {
670
+ return new GenreEndpoint(this.accessToken);
671
+ }
672
+ get movies() {
673
+ return new MoviesEndpoint(this.accessToken);
674
+ }
675
+ get tvShows() {
676
+ return new TvShowsEndpoint(this.accessToken);
677
+ }
678
+ get tvEpisode() {
679
+ return new TvEpisodesEndpoint(this.accessToken);
680
+ }
681
+ get discover() {
682
+ return new DiscoverEndpoint(this.accessToken);
683
+ }
684
+ get people() {
685
+ return new PeopleEndpoint(this.accessToken);
686
+ }
687
+ get review() {
688
+ return new ReviewEndpoint(this.accessToken);
689
+ }
690
+ get trending() {
691
+ return new TrendingEndpoint(this.accessToken);
692
+ }
693
+ get find() {
694
+ return new FindEndpoint(this.accessToken);
695
+ }
696
+ get keywords() {
697
+ return new KeywordsEndpoint(this.accessToken);
698
+ }
699
+ get collections() {
700
+ return new CollectionsEndpoint(this.accessToken);
701
+ }
702
+ get tvSeasons() {
703
+ return new TvSeasonsEndpoint(this.accessToken);
704
+ }
705
+ get watchProviders() {
706
+ return new WatchProvidersEndpoint(this.accessToken);
707
+ }
708
+ }
709
+
710
+ // src/types/options.ts
711
+ var AvailableLanguages = [
712
+ "af-ZA",
713
+ "ar-AE",
714
+ "ar-BH",
715
+ "ar-EG",
716
+ "ar-IQ",
717
+ "ar-JO",
718
+ "ar-LY",
719
+ "ar-MA",
720
+ "ar-QA",
721
+ "ar-SA",
722
+ "ar-TD",
723
+ "ar-YE",
724
+ "be-BY",
725
+ "bg-BG",
726
+ "bn-BD",
727
+ "br-FR",
728
+ "ca-AD",
729
+ "ca-ES",
730
+ "ch-GU",
731
+ "cs-CZ",
732
+ "cy-GB",
733
+ "da-DK",
734
+ "de-AT",
735
+ "de-CH",
736
+ "de-DE",
737
+ "el-CY",
738
+ "el-GR",
739
+ "en-AG",
740
+ "en-AU",
741
+ "en-BB",
742
+ "en-BZ",
743
+ "en-CA",
744
+ "en-CM",
745
+ "en-GB",
746
+ "en-GG",
747
+ "en-GH",
748
+ "en-GI",
749
+ "en-GY",
750
+ "en-IE",
751
+ "en-JM",
752
+ "en-KE",
753
+ "en-LC",
754
+ "en-MW",
755
+ "en-NZ",
756
+ "en-PG",
757
+ "en-TC",
758
+ "en-US",
759
+ "en-ZM",
760
+ "en-ZW",
761
+ "eo-EO",
762
+ "es-AR",
763
+ "es-CL",
764
+ "es-DO",
765
+ "es-EC",
766
+ "es-ES",
767
+ "es-GQ",
768
+ "es-GT",
769
+ "es-HN",
770
+ "es-MX",
771
+ "es-NI",
772
+ "es-PA",
773
+ "es-PE",
774
+ "es-PY",
775
+ "es-SV",
776
+ "es-UY",
777
+ "et-EE",
778
+ "eu-ES",
779
+ "fa-IR",
780
+ "fi-FI",
781
+ "fr-BF",
782
+ "fr-CA",
783
+ "fr-CD",
784
+ "fr-CI",
785
+ "fr-FR",
786
+ "fr-GF",
787
+ "fr-GP",
788
+ "fr-MC",
789
+ "fr-ML",
790
+ "fr-MU",
791
+ "fr-PF",
792
+ "ga-IE",
793
+ "gd-GB",
794
+ "gl-ES",
795
+ "he-IL",
796
+ "hi-IN",
797
+ "hr-HR",
798
+ "hu-HU",
799
+ "id-ID",
800
+ "it-IT",
801
+ "it-VA",
802
+ "ja-JP",
803
+ "ka-GE",
804
+ "kk-KZ",
805
+ "kn-IN",
806
+ "ko-KR",
807
+ "ky-KG",
808
+ "lt-LT",
809
+ "lv-LV",
810
+ "ml-IN",
811
+ "mr-IN",
812
+ "ms-MY",
813
+ "ms-SG",
814
+ "nb-NO",
815
+ "nl-BE",
816
+ "nl-NL",
817
+ "no-NO",
818
+ "pa-IN",
819
+ "pl-PL",
820
+ "pt-AO",
821
+ "pt-BR",
822
+ "pt-MZ",
823
+ "pt-PT",
824
+ "ro-MD",
825
+ "ro-RO",
826
+ "ru-RU",
827
+ "si-LK",
828
+ "sk-SK",
829
+ "sl-SI",
830
+ "sq-AL",
831
+ "sq-XK",
832
+ "sr-ME",
833
+ "sr-RS",
834
+ "sv-SE",
835
+ "sw-TZ",
836
+ "ta-IN",
837
+ "te-IN",
838
+ "th-TH",
839
+ "tl-PH",
840
+ "tr-TR",
841
+ "uk-UA",
842
+ "ur-PK",
843
+ "vi-VN",
844
+ "zh-CN",
845
+ "zh-HK",
846
+ "zh-SG",
847
+ "zh-TW",
848
+ "zu-ZA"
849
+ ];
850
+ // src/types/configuration.ts
851
+ var MediaSize = {
852
+ W45: "w45",
853
+ W92: "w92",
854
+ W154: "w154",
855
+ W185: "w185",
856
+ W300: "w300",
857
+ W342: "w342",
858
+ W500: "w500",
859
+ W632: "w632",
860
+ W780: "w780",
861
+ W1280: "w1280",
862
+ ORIGINAL: "original"
863
+ };
864
+ var BackdropSize = {
865
+ W45: "w45",
866
+ W92: "w92",
867
+ W154: "w154",
868
+ W185: "w185",
869
+ W300: "w300",
870
+ W500: "w500",
871
+ W780: "w780",
872
+ W1280: "w1280",
873
+ ORIGINAL: "original"
874
+ };
875
+ var LogoSize = {
876
+ W45: "w45",
877
+ W92: "w92",
878
+ W154: "w154",
879
+ W185: "w185",
880
+ W300: "w300",
881
+ W500: "w500",
882
+ ORIGINAL: "original"
883
+ };
884
+ var PosterSize = {
885
+ W92: "w92",
886
+ W154: "w154",
887
+ W185: "w185",
888
+ W300: "w300",
889
+ W342: "w342",
890
+ W500: "w500",
891
+ W780: "w780",
892
+ ORIGINAL: "original"
893
+ };
894
+ var ProfileSize = {
895
+ W45: "w45",
896
+ W185: "w185",
897
+ W632: "w632",
898
+ ORIGINAL: "original"
899
+ };
900
+ var StillSize = {
901
+ W92: "w92",
902
+ W185: "w185",
903
+ W300: "w300",
904
+ ORIGINAL: "original"
905
+ };
906
+ var ChangeKey = {
907
+ ADULT: "adult",
908
+ AIR_DATE: "air_date",
909
+ ALSO_KNOWN_AS: "also_known_as",
910
+ ALTERNATIVE_TITLES: "alternative_titles",
911
+ BIOGRAPHY: "biography",
912
+ BIRTHDAY: "birthday",
913
+ BUDGET: "budget",
914
+ CAST: "cast",
915
+ CERTIFICATIONS: "certifications",
916
+ CHARACTER_NAMES: "character_names",
917
+ CREATED_BY: "created_by",
918
+ CREW: "crew",
919
+ DEATHDAY: "deathday",
920
+ EPISODE: "episode",
921
+ EPISODE_NUMBER: "episode_number",
922
+ EPISODE_RUN_TIME: "episode_run_time",
923
+ FREEBASE_ID: "freebase_id",
924
+ FREEBASE_MID: "freebase_mid",
925
+ GENERAL: "general",
926
+ GENRES: "genres",
927
+ GUEST_STARS: "guest_stars",
928
+ HOMEPAGE: "homepage",
929
+ IMAGES: "images",
930
+ IMDB_ID: "imdb_id",
931
+ LANGUAGES: "languages",
932
+ NAME: "name",
933
+ NETWORK: "network",
934
+ ORIGIN_COUNTRY: "origin_country",
935
+ ORIGINAL_NAME: "original_name",
936
+ ORIGINAL_TITLE: "original_title",
937
+ OVERVIEW: "overview",
938
+ PARTS: "parts",
939
+ PLACE_OF_BIRTH: "place_of_birth",
940
+ PLOT_KEYWORDS: "plot_keywords",
941
+ PRODUCTION_CODE: "production_code",
942
+ PRODUCTION_COMPANIES: "production_companies",
943
+ PRODUCTION_COUNTRIES: "production_countries",
944
+ RELEASES: "releases",
945
+ REVENUE: "revenue",
946
+ RUNTIME: "runtime",
947
+ SEASON: "season",
948
+ SEASON_NUMBER: "season_number",
949
+ SEASON_REGULAR: "season_regular",
950
+ SPOKEN_LANGUAGES: "spoken_languages",
951
+ STATUS: "status",
952
+ TAGLINE: "tagline",
953
+ TITLE: "title",
954
+ TRANSLATIONS: "translations",
955
+ TVDB_ID: "tvdb_id",
956
+ TVRAGE_ID: "tvrage_id",
957
+ TYPE: "type",
958
+ VIDEO: "video",
959
+ VIDEOS: "videos"
960
+ };
961
+ // src/types/movies.ts
962
+ var ReleaseDateType;
963
+ ((ReleaseDateType2) => {
964
+ ReleaseDateType2[ReleaseDateType2["Premiere"] = 1] = "Premiere";
965
+ ReleaseDateType2[ReleaseDateType2["Theatrical (limited)"] = 2] = "Theatrical (limited)";
966
+ ReleaseDateType2[ReleaseDateType2["Theatrical"] = 3] = "Theatrical";
967
+ ReleaseDateType2[ReleaseDateType2["Digital"] = 4] = "Digital";
968
+ ReleaseDateType2[ReleaseDateType2["Physical"] = 5] = "Physical";
969
+ ReleaseDateType2[ReleaseDateType2["TV"] = 6] = "TV";
970
+ })(ReleaseDateType ||= {});
971
+
972
+ // src/types/index.ts
973
+ var CountryCodes = [
974
+ "AE",
975
+ "AR",
976
+ "AT",
977
+ "AU",
978
+ "BE",
979
+ "BG",
980
+ "BO",
981
+ "BR",
982
+ "CA",
983
+ "CH",
984
+ "CL",
985
+ "CO",
986
+ "CR",
987
+ "CV",
988
+ "CZ",
989
+ "DE",
990
+ "DK",
991
+ "EC",
992
+ "EE",
993
+ "EG",
994
+ "ES",
995
+ "FI",
996
+ "FR",
997
+ "GB",
998
+ "GH",
999
+ "GR",
1000
+ "GT",
1001
+ "HK",
1002
+ "HN",
1003
+ "HU",
1004
+ "ID",
1005
+ "IE",
1006
+ "IL",
1007
+ "IN",
1008
+ "IT",
1009
+ "JP",
1010
+ "LT",
1011
+ "LV",
1012
+ "MU",
1013
+ "MX",
1014
+ "MY",
1015
+ "MZ",
1016
+ "NL",
1017
+ "NO",
1018
+ "NZ",
1019
+ "PE",
1020
+ "PH",
1021
+ "PL",
1022
+ "PT",
1023
+ "PY",
1024
+ "RU",
1025
+ "SA",
1026
+ "SE",
1027
+ "SG",
1028
+ "SI",
1029
+ "SK",
1030
+ "TH",
1031
+ "TR",
1032
+ "TW",
1033
+ "UG",
1034
+ "US",
1035
+ "VE",
1036
+ "ZA"
1037
+ ];
1038
+
1039
+ //# debugId=710DDB1422E7DE4564756E2164756E21