@tdanks2000/tmdb-wrapper 1.1.0 → 1.1.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 (134) hide show
  1. package/LICENSE +21 -0
  2. package/dist/@types/endpoints/configuration.js +99 -0
  3. package/dist/@types/models/baseEndpoint.js +3 -3
  4. package/dist/endpoints/account.js +3 -13
  5. package/dist/endpoints/certification.js +4 -17
  6. package/dist/endpoints/changes.js +6 -21
  7. package/dist/endpoints/collections.js +11 -27
  8. package/dist/endpoints/companies.js +6 -21
  9. package/dist/endpoints/configuration.js +2 -13
  10. package/dist/endpoints/credits.js +2 -13
  11. package/dist/endpoints/discover.js +6 -18
  12. package/dist/endpoints/find.js +3 -13
  13. package/dist/endpoints/genre.js +4 -17
  14. package/dist/endpoints/keywords.js +6 -18
  15. package/dist/endpoints/movies.js +51 -99
  16. package/dist/endpoints/networks.js +6 -21
  17. package/dist/endpoints/people.js +30 -58
  18. package/dist/endpoints/review.js +3 -13
  19. package/dist/endpoints/search.js +15 -38
  20. package/dist/endpoints/trending.js +3 -13
  21. package/dist/endpoints/tvEpisodes.js +29 -48
  22. package/dist/endpoints/tvSeasons.js +31 -52
  23. package/dist/endpoints/tvShows.js +61 -116
  24. package/dist/endpoints/watchProviders.js +9 -26
  25. package/dist/index.js +22 -22
  26. package/dist/utils/api.js +49 -27
  27. package/dist/utils/getimagePath.js +13 -13
  28. package/package.json +61 -57
  29. package/dist/@types/endpoints/account.d.ts +0 -16
  30. package/dist/@types/endpoints/account.d.ts.map +0 -1
  31. package/dist/@types/endpoints/certification.d.ts +0 -19
  32. package/dist/@types/endpoints/certification.d.ts.map +0 -1
  33. package/dist/@types/endpoints/changes.d.ts +0 -26
  34. package/dist/@types/endpoints/changes.d.ts.map +0 -1
  35. package/dist/@types/endpoints/collection.d.ts +0 -21
  36. package/dist/@types/endpoints/collection.d.ts.map +0 -1
  37. package/dist/@types/endpoints/companies.d.ts +0 -29
  38. package/dist/@types/endpoints/companies.d.ts.map +0 -1
  39. package/dist/@types/endpoints/configuration.d.ts +0 -106
  40. package/dist/@types/endpoints/configuration.d.ts.map +0 -1
  41. package/dist/@types/endpoints/credits.d.ts +0 -135
  42. package/dist/@types/endpoints/credits.d.ts.map +0 -1
  43. package/dist/@types/endpoints/discover.d.ts +0 -68
  44. package/dist/@types/endpoints/discover.d.ts.map +0 -1
  45. package/dist/@types/endpoints/find.d.ts +0 -20
  46. package/dist/@types/endpoints/find.d.ts.map +0 -1
  47. package/dist/@types/endpoints/genre.d.ts +0 -7
  48. package/dist/@types/endpoints/genre.d.ts.map +0 -1
  49. package/dist/@types/endpoints/index.d.ts +0 -23
  50. package/dist/@types/endpoints/index.d.ts.map +0 -1
  51. package/dist/@types/endpoints/keywords.d.ts +0 -21
  52. package/dist/@types/endpoints/keywords.d.ts.map +0 -1
  53. package/dist/@types/endpoints/movies.d.ts +0 -150
  54. package/dist/@types/endpoints/movies.d.ts.map +0 -1
  55. package/dist/@types/endpoints/networks.d.ts +0 -14
  56. package/dist/@types/endpoints/networks.d.ts.map +0 -1
  57. package/dist/@types/endpoints/options.d.ts +0 -73
  58. package/dist/@types/endpoints/options.d.ts.map +0 -1
  59. package/dist/@types/endpoints/people.d.ts +0 -135
  60. package/dist/@types/endpoints/people.d.ts.map +0 -1
  61. package/dist/@types/endpoints/review.d.ts +0 -8
  62. package/dist/@types/endpoints/review.d.ts.map +0 -1
  63. package/dist/@types/endpoints/search.d.ts +0 -32
  64. package/dist/@types/endpoints/search.d.ts.map +0 -1
  65. package/dist/@types/endpoints/trending.d.ts +0 -12
  66. package/dist/@types/endpoints/trending.d.ts.map +0 -1
  67. package/dist/@types/endpoints/tvEpisode.d.ts +0 -65
  68. package/dist/@types/endpoints/tvEpisode.d.ts.map +0 -1
  69. package/dist/@types/endpoints/tvSeasons.d.ts +0 -31
  70. package/dist/@types/endpoints/tvSeasons.d.ts.map +0 -1
  71. package/dist/@types/endpoints/tvShows.d.ts +0 -260
  72. package/dist/@types/endpoints/tvShows.d.ts.map +0 -1
  73. package/dist/@types/endpoints/watchProviders.d.ts +0 -295
  74. package/dist/@types/endpoints/watchProviders.d.ts.map +0 -1
  75. package/dist/@types/index.d.ts +0 -4
  76. package/dist/@types/index.d.ts.map +0 -1
  77. package/dist/@types/models/baseEndpoint.d.ts +0 -7
  78. package/dist/@types/models/baseEndpoint.d.ts.map +0 -1
  79. package/dist/@types/models/index.d.ts +0 -2
  80. package/dist/@types/models/index.d.ts.map +0 -1
  81. package/dist/@types/types.d.ts +0 -174
  82. package/dist/@types/types.d.ts.map +0 -1
  83. package/dist/endpoints/account.d.ts +0 -17
  84. package/dist/endpoints/account.d.ts.map +0 -1
  85. package/dist/endpoints/certification.d.ts +0 -23
  86. package/dist/endpoints/certification.d.ts.map +0 -1
  87. package/dist/endpoints/changes.d.ts +0 -31
  88. package/dist/endpoints/changes.d.ts.map +0 -1
  89. package/dist/endpoints/collections.d.ts +0 -34
  90. package/dist/endpoints/collections.d.ts.map +0 -1
  91. package/dist/endpoints/companies.d.ts +0 -31
  92. package/dist/endpoints/companies.d.ts.map +0 -1
  93. package/dist/endpoints/configuration.d.ts +0 -18
  94. package/dist/endpoints/configuration.d.ts.map +0 -1
  95. package/dist/endpoints/credits.d.ts +0 -19
  96. package/dist/endpoints/credits.d.ts.map +0 -1
  97. package/dist/endpoints/discover.d.ts +0 -24
  98. package/dist/endpoints/discover.d.ts.map +0 -1
  99. package/dist/endpoints/find.d.ts +0 -19
  100. package/dist/endpoints/find.d.ts.map +0 -1
  101. package/dist/endpoints/genre.d.ts +0 -25
  102. package/dist/endpoints/genre.d.ts.map +0 -1
  103. package/dist/endpoints/index.d.ts +0 -22
  104. package/dist/endpoints/index.d.ts.map +0 -1
  105. package/dist/endpoints/keywords.d.ts +0 -25
  106. package/dist/endpoints/keywords.d.ts.map +0 -1
  107. package/dist/endpoints/movies.d.ts +0 -142
  108. package/dist/endpoints/movies.d.ts.map +0 -1
  109. package/dist/endpoints/networks.d.ts +0 -31
  110. package/dist/endpoints/networks.d.ts.map +0 -1
  111. package/dist/endpoints/people.d.ts +0 -84
  112. package/dist/endpoints/people.d.ts.map +0 -1
  113. package/dist/endpoints/review.d.ts +0 -18
  114. package/dist/endpoints/review.d.ts.map +0 -1
  115. package/dist/endpoints/search.d.ts +0 -58
  116. package/dist/endpoints/search.d.ts.map +0 -1
  117. package/dist/endpoints/trending.d.ts +0 -21
  118. package/dist/endpoints/trending.d.ts.map +0 -1
  119. package/dist/endpoints/tvEpisodes.d.ts +0 -61
  120. package/dist/endpoints/tvEpisodes.d.ts.map +0 -1
  121. package/dist/endpoints/tvSeasons.d.ts +0 -70
  122. package/dist/endpoints/tvSeasons.d.ts.map +0 -1
  123. package/dist/endpoints/tvShows.d.ts +0 -164
  124. package/dist/endpoints/tvShows.d.ts.map +0 -1
  125. package/dist/endpoints/watchProviders.d.ts +0 -33
  126. package/dist/endpoints/watchProviders.d.ts.map +0 -1
  127. package/dist/index.d.ts +0 -29
  128. package/dist/index.d.ts.map +0 -1
  129. package/dist/utils/api.d.ts +0 -7
  130. package/dist/utils/api.d.ts.map +0 -1
  131. package/dist/utils/getimagePath.d.ts +0 -32
  132. package/dist/utils/getimagePath.d.ts.map +0 -1
  133. package/dist/utils/index.d.ts +0 -3
  134. package/dist/utils/index.d.ts.map +0 -1
@@ -1,13 +1,4 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.TrendingEndpoint = void 0;
13
4
  const _types_1 = require("../@types");
@@ -21,6 +12,7 @@ class TrendingEndpoint extends _types_1.BaseEndpoint {
21
12
  */
22
13
  constructor(access_token) {
23
14
  super(access_token);
15
+ this.access_token = access_token;
24
16
  }
25
17
  /**
26
18
  * Retrieves trending content asynchronously based on media type and time window.
@@ -30,10 +22,8 @@ class TrendingEndpoint extends _types_1.BaseEndpoint {
30
22
  * @returns {Promise<TrendingResults<T>>} A Promise that resolves with the trending results.
31
23
  * @template T - The type of media being searched for (e.g., 'movie', 'tv').
32
24
  */
33
- trending(mediaType, timeWindow, options) {
34
- return __awaiter(this, void 0, void 0, function* () {
35
- return yield this.api.get(`/trending/${mediaType}/${timeWindow}`, options);
36
- });
25
+ async trending(mediaType, timeWindow, options) {
26
+ return await this.api.get(`/trending/${mediaType}/${timeWindow}`, options);
37
27
  }
38
28
  }
39
29
  exports.TrendingEndpoint = TrendingEndpoint;
@@ -1,13 +1,4 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.TvEpisodesEndpoint = void 0;
13
4
  const _types_1 = require("../@types");
@@ -24,6 +15,7 @@ class TvEpisodesEndpoint extends _types_1.BaseEndpoint {
24
15
  */
25
16
  constructor(access_token) {
26
17
  super(access_token);
18
+ this.access_token = access_token;
27
19
  }
28
20
  /**
29
21
  * Retrieves details of a specific TV episode asynchronously.
@@ -33,11 +25,14 @@ class TvEpisodesEndpoint extends _types_1.BaseEndpoint {
33
25
  * @returns {Promise<AppendToResponse<Omit<Episode, 'show_id'>, AppendToResponseTvEpisodeKey[], 'tvEpisode'>>}
34
26
  * A Promise that resolves with the details of the TV episode.
35
27
  */
36
- details(episodeSelection, appendToResponse, options) {
37
- return __awaiter(this, void 0, void 0, function* () {
38
- const combinedOptions = Object.assign({ append_to_response: appendToResponse ? appendToResponse.join(',') : undefined }, options);
39
- return yield this.api.get(`${BASE_EPISODE(episodeSelection)}`, combinedOptions);
40
- });
28
+ async details(episodeSelection, appendToResponse, options) {
29
+ const combinedOptions = {
30
+ append_to_response: appendToResponse
31
+ ? appendToResponse.join(",")
32
+ : undefined,
33
+ ...options,
34
+ };
35
+ return await this.api.get(`${BASE_EPISODE(episodeSelection)}`, combinedOptions);
41
36
  }
42
37
  /**
43
38
  * Retrieves changes related to a specific TV episode asynchronously.
@@ -45,10 +40,8 @@ class TvEpisodesEndpoint extends _types_1.BaseEndpoint {
45
40
  * @param {ChangeOption} [options] - Optional parameters for specifying changes.
46
41
  * @returns {Promise<Changes<TvEpisodeChangeValue>>} A Promise that resolves with the changes related to the TV episode.
47
42
  */
48
- changes(episodeID, options) {
49
- return __awaiter(this, void 0, void 0, function* () {
50
- return yield this.api.get(`/tv/episode/${episodeID}/changes`, options);
51
- });
43
+ async changes(episodeID, options) {
44
+ return await this.api.get(`/tv/episode/${episodeID}/changes`, options);
52
45
  }
53
46
  /**
54
47
  * Retrieves credits for a specific TV episode asynchronously.
@@ -56,20 +49,16 @@ class TvEpisodesEndpoint extends _types_1.BaseEndpoint {
56
49
  * @param {LanguageOption} [options] - Optional parameters for specifying the language.
57
50
  * @returns {Promise<TvEpisodeCredit>} A Promise that resolves with the credits for the TV episode.
58
51
  */
59
- credits(episodeSelection, options) {
60
- return __awaiter(this, void 0, void 0, function* () {
61
- return yield this.api.get(`${BASE_EPISODE(episodeSelection)}/credits`, options);
62
- });
52
+ async credits(episodeSelection, options) {
53
+ return await this.api.get(`${BASE_EPISODE(episodeSelection)}/credits`, options);
63
54
  }
64
55
  /**
65
56
  * Retrieves external IDs for a specific TV episode asynchronously.
66
57
  * @param {EpisodeSelection} episodeSelection - The selection criteria for the TV episode.
67
58
  * @returns {Promise<ExternalIds>} A Promise that resolves with the external IDs for the TV episode.
68
59
  */
69
- externalIds(episodeSelection) {
70
- return __awaiter(this, void 0, void 0, function* () {
71
- return yield this.api.get(`${BASE_EPISODE(episodeSelection)}/external_ids`);
72
- });
60
+ async externalIds(episodeSelection) {
61
+ return await this.api.get(`${BASE_EPISODE(episodeSelection)}/external_ids`);
73
62
  }
74
63
  /**
75
64
  * Retrieves images for a specific TV episode asynchronously.
@@ -77,25 +66,20 @@ class TvEpisodesEndpoint extends _types_1.BaseEndpoint {
77
66
  * @param {TvEpisodeImageSearchOptions} [options] - Optional parameters for specifying image search options.
78
67
  * @returns {Promise<Images>} A Promise that resolves with the images for the TV episode.
79
68
  */
80
- images(episodeSelection, options) {
81
- return __awaiter(this, void 0, void 0, function* () {
82
- var _a;
83
- const computedOptions = {
84
- include_image_language: (_a = options === null || options === void 0 ? void 0 : options.include_image_language) === null || _a === void 0 ? void 0 : _a.join(','),
85
- language: options === null || options === void 0 ? void 0 : options.language,
86
- };
87
- return yield this.api.get(`${BASE_EPISODE(episodeSelection)}/images`, computedOptions);
88
- });
69
+ async images(episodeSelection, options) {
70
+ const computedOptions = {
71
+ include_image_language: options?.include_image_language?.join(","),
72
+ language: options?.language,
73
+ };
74
+ return await this.api.get(`${BASE_EPISODE(episodeSelection)}/images`, computedOptions);
89
75
  }
90
76
  /**
91
77
  * Retrieves translations for a specific TV episode asynchronously.
92
78
  * @param {EpisodeSelection} episodeSelection - The selection criteria for the TV episode.
93
79
  * @returns {Promise<TvEpisodeTranslations>} A Promise that resolves with the translations for the TV episode.
94
80
  */
95
- translations(episodeSelection) {
96
- return __awaiter(this, void 0, void 0, function* () {
97
- return yield this.api.get(`${BASE_EPISODE(episodeSelection)}/translations`);
98
- });
81
+ async translations(episodeSelection) {
82
+ return await this.api.get(`${BASE_EPISODE(episodeSelection)}/translations`);
99
83
  }
100
84
  /**
101
85
  * Retrieves videos for a specific TV episode asynchronously.
@@ -103,15 +87,12 @@ class TvEpisodesEndpoint extends _types_1.BaseEndpoint {
103
87
  * @param {TvEpisodeVideoSearchOptions} [options] - Optional parameters for specifying video search options.
104
88
  * @returns {Promise<Videos>} A Promise that resolves with the videos for the TV episode.
105
89
  */
106
- videos(episodeSelection, options) {
107
- return __awaiter(this, void 0, void 0, function* () {
108
- var _a;
109
- const computedOptions = {
110
- include_video_language: (_a = options === null || options === void 0 ? void 0 : options.include_video_language) === null || _a === void 0 ? void 0 : _a.join(','),
111
- language: options === null || options === void 0 ? void 0 : options.language,
112
- };
113
- return yield this.api.get(`${BASE_EPISODE(episodeSelection)}/videos`, computedOptions);
114
- });
90
+ async videos(episodeSelection, options) {
91
+ const computedOptions = {
92
+ include_video_language: options?.include_video_language?.join(","),
93
+ language: options?.language,
94
+ };
95
+ return await this.api.get(`${BASE_EPISODE(episodeSelection)}/videos`, computedOptions);
115
96
  }
116
97
  }
117
98
  exports.TvEpisodesEndpoint = TvEpisodesEndpoint;
@@ -1,13 +1,4 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.TvSeasonsEndpoint = void 0;
13
4
  const _types_1 = require("../@types");
@@ -24,6 +15,7 @@ class TvSeasonsEndpoint extends _types_1.BaseEndpoint {
24
15
  */
25
16
  constructor(access_token) {
26
17
  super(access_token);
18
+ this.access_token = access_token;
27
19
  }
28
20
  /**
29
21
  * Retrieves details of a specific TV season asynchronously.
@@ -33,11 +25,14 @@ class TvSeasonsEndpoint extends _types_1.BaseEndpoint {
33
25
  * @returns {Promise<AppendToResponse<SeasonDetails, AppendToResponseTvSeasonKey[], 'tvSeason'>>}
34
26
  * A Promise that resolves with the details of the TV season.
35
27
  */
36
- details(seasonSelection, appendToResponse, options) {
37
- return __awaiter(this, void 0, void 0, function* () {
38
- const combinedOptions = Object.assign({ append_to_response: appendToResponse ? appendToResponse.join(',') : undefined }, options);
39
- return yield this.api.get(`${BASE_SEASON(seasonSelection)}`, combinedOptions);
40
- });
28
+ async details(seasonSelection, appendToResponse, options) {
29
+ const combinedOptions = {
30
+ append_to_response: appendToResponse
31
+ ? appendToResponse.join(",")
32
+ : undefined,
33
+ ...options,
34
+ };
35
+ return await this.api.get(`${BASE_SEASON(seasonSelection)}`, combinedOptions);
41
36
  }
42
37
  /**
43
38
  * Retrieves aggregate credits for a specific TV season asynchronously.
@@ -45,10 +40,8 @@ class TvSeasonsEndpoint extends _types_1.BaseEndpoint {
45
40
  * @param {LanguageOption} [options] - Optional parameters for specifying the language.
46
41
  * @returns {Promise<AggregateCredits>} A Promise that resolves with the aggregate credits for the TV season.
47
42
  */
48
- aggregateCredits(seasonSelection, options) {
49
- return __awaiter(this, void 0, void 0, function* () {
50
- return yield this.api.get(`${BASE_SEASON(seasonSelection)}/aggregate_credits`, options);
51
- });
43
+ async aggregateCredits(seasonSelection, options) {
44
+ return await this.api.get(`${BASE_SEASON(seasonSelection)}/aggregate_credits`, options);
52
45
  }
53
46
  /**
54
47
  * Retrieves changes related to a specific TV season asynchronously.
@@ -56,10 +49,8 @@ class TvSeasonsEndpoint extends _types_1.BaseEndpoint {
56
49
  * @param {ChangeOption} [options] - Optional parameters for specifying changes.
57
50
  * @returns {Promise<Changes<TvSeasonChangeValue>>} A Promise that resolves with the changes related to the TV season.
58
51
  */
59
- changes(seasonId, options) {
60
- return __awaiter(this, void 0, void 0, function* () {
61
- return yield this.api.get(`/tv/season/${seasonId}/changes`, options);
62
- });
52
+ async changes(seasonId, options) {
53
+ return await this.api.get(`/tv/season/${seasonId}/changes`, options);
63
54
  }
64
55
  /**
65
56
  * Retrieves credits for a specific TV season asynchronously.
@@ -67,10 +58,8 @@ class TvSeasonsEndpoint extends _types_1.BaseEndpoint {
67
58
  * @param {LanguageOption} [options] - Optional parameters for specifying the language.
68
59
  * @returns {Promise<Credits>} A Promise that resolves with the credits for the TV season.
69
60
  */
70
- credits(seasonSelection, options) {
71
- return __awaiter(this, void 0, void 0, function* () {
72
- return yield this.api.get(`${BASE_SEASON(seasonSelection)}/credits`, options);
73
- });
61
+ async credits(seasonSelection, options) {
62
+ return await this.api.get(`${BASE_SEASON(seasonSelection)}/credits`, options);
74
63
  }
75
64
  /**
76
65
  * Retrieves external IDs for a specific TV season asynchronously.
@@ -78,10 +67,8 @@ class TvSeasonsEndpoint extends _types_1.BaseEndpoint {
78
67
  * @param {LanguageOption} [options] - Optional parameters for specifying the language.
79
68
  * @returns {Promise<ExternalIds>} A Promise that resolves with the external IDs for the TV season.
80
69
  */
81
- externalIds(seasonSelection, options) {
82
- return __awaiter(this, void 0, void 0, function* () {
83
- return yield this.api.get(`${BASE_SEASON(seasonSelection)}/external_ids`, options);
84
- });
70
+ async externalIds(seasonSelection, options) {
71
+ return await this.api.get(`${BASE_SEASON(seasonSelection)}/external_ids`, options);
85
72
  }
86
73
  /**
87
74
  * Retrieves images for a specific TV season asynchronously.
@@ -89,15 +76,12 @@ class TvSeasonsEndpoint extends _types_1.BaseEndpoint {
89
76
  * @param {TvSeasonImageSearchOptions} [options] - Optional parameters for specifying image search options.
90
77
  * @returns {Promise<Images>} A Promise that resolves with the images for the TV season.
91
78
  */
92
- images(seasonSelection, options) {
93
- return __awaiter(this, void 0, void 0, function* () {
94
- var _a;
95
- const computedOptions = {
96
- include_image_language: (_a = options === null || options === void 0 ? void 0 : options.include_image_language) === null || _a === void 0 ? void 0 : _a.join(','),
97
- language: options === null || options === void 0 ? void 0 : options.language,
98
- };
99
- return yield this.api.get(`${BASE_SEASON(seasonSelection)}/images`, computedOptions);
100
- });
79
+ async images(seasonSelection, options) {
80
+ const computedOptions = {
81
+ include_image_language: options?.include_image_language?.join(","),
82
+ language: options?.language,
83
+ };
84
+ return await this.api.get(`${BASE_SEASON(seasonSelection)}/images`, computedOptions);
101
85
  }
102
86
  /**
103
87
  * Retrieves videos for a specific TV season asynchronously.
@@ -105,15 +89,12 @@ class TvSeasonsEndpoint extends _types_1.BaseEndpoint {
105
89
  * @param {TvSeasonVideoSearchOptions} [options] - Optional parameters for specifying video search options.
106
90
  * @returns {Promise<Videos>} A Promise that resolves with the videos for the TV season.
107
91
  */
108
- videos(seasonSelection, options) {
109
- return __awaiter(this, void 0, void 0, function* () {
110
- var _a;
111
- const computedOptions = {
112
- include_video_language: (_a = options === null || options === void 0 ? void 0 : options.include_video_language) === null || _a === void 0 ? void 0 : _a.join(','),
113
- language: options === null || options === void 0 ? void 0 : options.language,
114
- };
115
- return yield this.api.get(`${BASE_SEASON(seasonSelection)}/videos`, computedOptions);
116
- });
92
+ async videos(seasonSelection, options) {
93
+ const computedOptions = {
94
+ include_video_language: options?.include_video_language?.join(","),
95
+ language: options?.language,
96
+ };
97
+ return await this.api.get(`${BASE_SEASON(seasonSelection)}/videos`, computedOptions);
117
98
  }
118
99
  /**
119
100
  * Retrieves translations for a specific TV season asynchronously.
@@ -121,10 +102,8 @@ class TvSeasonsEndpoint extends _types_1.BaseEndpoint {
121
102
  * @param {LanguageOption} [options] - Optional parameters for specifying the language.
122
103
  * @returns {Promise<Translations>} A Promise that resolves with the translations for the TV season.
123
104
  */
124
- translations(seasonSelection, options) {
125
- return __awaiter(this, void 0, void 0, function* () {
126
- return yield this.api.get(`${BASE_SEASON(seasonSelection)}/translations`, options);
127
- });
105
+ async translations(seasonSelection, options) {
106
+ return await this.api.get(`${BASE_SEASON(seasonSelection)}/translations`, options);
128
107
  }
129
108
  }
130
109
  exports.TvSeasonsEndpoint = TvSeasonsEndpoint;
@@ -1,17 +1,8 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.TvShowsEndpoint = void 0;
13
4
  const _types_1 = require("../@types");
14
- const BASE_TV = '/tv';
5
+ const BASE_TV = "/tv";
15
6
  /**
16
7
  * Represents an endpoint for accessing TV show-related information.
17
8
  */
@@ -32,24 +23,22 @@ class TvShowsEndpoint extends _types_1.BaseEndpoint {
32
23
  * @returns {Promise<AppendToResponse<TvShowDetails, AppendToResponseTvKey[], 'tvShow'>>}
33
24
  * A Promise that resolves with the details of the TV show.
34
25
  */
35
- details(id, appendToResponse, language) {
36
- return __awaiter(this, void 0, void 0, function* () {
37
- const options = {
38
- append_to_response: appendToResponse ? appendToResponse.join(',') : undefined,
39
- language: language,
40
- };
41
- return yield this.api.get(`${BASE_TV}/${id}`, options);
42
- });
26
+ async details(id, appendToResponse, language) {
27
+ const options = {
28
+ append_to_response: appendToResponse
29
+ ? appendToResponse.join(",")
30
+ : undefined,
31
+ language: language,
32
+ };
33
+ return await this.api.get(`${BASE_TV}/${id}`, options);
43
34
  }
44
35
  /**
45
36
  * Retrieves alternative titles of a specific TV show asynchronously.
46
37
  * @param {number} id - The ID of the TV show.
47
38
  * @returns {Promise<AlternativeTitles>} A Promise that resolves with the alternative titles of the TV show.
48
39
  */
49
- alternativeTitles(id) {
50
- return __awaiter(this, void 0, void 0, function* () {
51
- return yield this.api.get(`${BASE_TV}/${id}/alternative_titles`);
52
- });
40
+ async alternativeTitles(id) {
41
+ return await this.api.get(`${BASE_TV}/${id}/alternative_titles`);
53
42
  }
54
43
  /**
55
44
  * Retrieves changes for a specific TV show asynchronously.
@@ -58,20 +47,16 @@ class TvShowsEndpoint extends _types_1.BaseEndpoint {
58
47
  * @returns {Promise<Changes<TvShowChangeValue>>}
59
48
  * A Promise that resolves with the changes for the TV show.
60
49
  */
61
- changes(id, options) {
62
- return __awaiter(this, void 0, void 0, function* () {
63
- return yield this.api.get(`${BASE_TV}/${id}/changes`, options);
64
- });
50
+ async changes(id, options) {
51
+ return await this.api.get(`${BASE_TV}/${id}/changes`, options);
65
52
  }
66
53
  /**
67
54
  * Retrieves content ratings for a specific TV show asynchronously.
68
55
  * @param {number} id - The ID of the TV show.
69
56
  * @returns {Promise<ContentRatings>} A Promise that resolves with the content ratings of the TV show.
70
57
  */
71
- contentRatings(id) {
72
- return __awaiter(this, void 0, void 0, function* () {
73
- return yield this.api.get(`${BASE_TV}/${id}/content_ratings`);
74
- });
58
+ async contentRatings(id) {
59
+ return await this.api.get(`${BASE_TV}/${id}/content_ratings`);
75
60
  }
76
61
  /**
77
62
  * Retrieves aggregate credits for a specific TV show asynchronously.
@@ -79,10 +64,8 @@ class TvShowsEndpoint extends _types_1.BaseEndpoint {
79
64
  * @param {LanguageOption} [options] - Additional options for the request.
80
65
  * @returns {Promise<AggregateCredits>} A Promise that resolves with the aggregate credits of the TV show.
81
66
  */
82
- aggregateCredits(id, options) {
83
- return __awaiter(this, void 0, void 0, function* () {
84
- return yield this.api.get(`${BASE_TV}/${id}/aggregate_credits`, options);
85
- });
67
+ async aggregateCredits(id, options) {
68
+ return await this.api.get(`${BASE_TV}/${id}/aggregate_credits`, options);
86
69
  }
87
70
  /**
88
71
  * Retrieves credits for a specific TV show asynchronously.
@@ -90,10 +73,8 @@ class TvShowsEndpoint extends _types_1.BaseEndpoint {
90
73
  * @param {LanguageOption} [options] - Additional options for the request.
91
74
  * @returns {Promise<Credits>} A Promise that resolves with the credits of the TV show.
92
75
  */
93
- credits(id, options) {
94
- return __awaiter(this, void 0, void 0, function* () {
95
- return yield this.api.get(`${BASE_TV}/${id}/credits`, options);
96
- });
76
+ async credits(id, options) {
77
+ return await this.api.get(`${BASE_TV}/${id}/credits`, options);
97
78
  }
98
79
  /**
99
80
  * Retrieves details of a specific season of a TV show asynchronously.
@@ -101,30 +82,24 @@ class TvShowsEndpoint extends _types_1.BaseEndpoint {
101
82
  * @param {number} seasonNumber - The season number.
102
83
  * @returns {Promise<SeasonDetails>} A Promise that resolves with the details of the season.
103
84
  */
104
- season(tvId, seasonNumber) {
105
- return __awaiter(this, void 0, void 0, function* () {
106
- return yield this.api.get(`${BASE_TV}/${tvId}/season/${seasonNumber}`);
107
- });
85
+ async season(tvId, seasonNumber) {
86
+ return await this.api.get(`${BASE_TV}/${tvId}/season/${seasonNumber}`);
108
87
  }
109
88
  /**
110
89
  * Retrieves episode groups for a specific TV show asynchronously.
111
90
  * @param {number} id - The ID of the TV show.
112
91
  * @returns {Promise<EpisodeGroups>} A Promise that resolves with the episode groups of the TV show.
113
92
  */
114
- episodeGroups(id) {
115
- return __awaiter(this, void 0, void 0, function* () {
116
- return yield this.api.get(`${BASE_TV}/${id}/episode_groups`);
117
- });
93
+ async episodeGroups(id) {
94
+ return await this.api.get(`${BASE_TV}/${id}/episode_groups`);
118
95
  }
119
96
  /**
120
97
  * Retrieves external IDs for a specific TV show asynchronously.
121
98
  * @param {number} id - The ID of the TV show.
122
99
  * @returns {Promise<ExternalIds>} A Promise that resolves with the external IDs of the TV show.
123
100
  */
124
- externalIds(id) {
125
- return __awaiter(this, void 0, void 0, function* () {
126
- return yield this.api.get(`${BASE_TV}/${id}/external_ids`);
127
- });
101
+ async externalIds(id) {
102
+ return await this.api.get(`${BASE_TV}/${id}/external_ids`);
128
103
  }
129
104
  /**
130
105
  * Retrieves images for a specific TV show asynchronously.
@@ -132,25 +107,20 @@ class TvShowsEndpoint extends _types_1.BaseEndpoint {
132
107
  * @param {TvShowImageOptions} [options] - Additional options for the request.
133
108
  * @returns {Promise<Images>} A Promise that resolves with the images of the TV show.
134
109
  */
135
- images(id, options) {
136
- return __awaiter(this, void 0, void 0, function* () {
137
- var _a;
138
- const computedOptions = {
139
- include_image_language: (_a = options === null || options === void 0 ? void 0 : options.include_image_language) === null || _a === void 0 ? void 0 : _a.join(','),
140
- language: options === null || options === void 0 ? void 0 : options.language,
141
- };
142
- return yield this.api.get(`${BASE_TV}/${id}/images`, computedOptions);
143
- });
110
+ async images(id, options) {
111
+ const computedOptions = {
112
+ include_image_language: options?.include_image_language?.join(","),
113
+ language: options?.language,
114
+ };
115
+ return await this.api.get(`${BASE_TV}/${id}/images`, computedOptions);
144
116
  }
145
117
  /**
146
118
  * Retrieves keywords for a specific TV show asynchronously.
147
119
  * @param {number} id - The ID of the TV show.
148
120
  * @returns {Promise<Keywords>} A Promise that resolves with the keywords of the TV show.
149
121
  */
150
- keywords(id) {
151
- return __awaiter(this, void 0, void 0, function* () {
152
- return yield this.api.get(`${BASE_TV}/${id}/keywords`);
153
- });
122
+ async keywords(id) {
123
+ return await this.api.get(`${BASE_TV}/${id}/keywords`);
154
124
  }
155
125
  /**
156
126
  * Retrieves recommendations for a specific TV show asynchronously.
@@ -158,10 +128,8 @@ class TvShowsEndpoint extends _types_1.BaseEndpoint {
158
128
  * @param {LanguageOption & PageOption} [options] - Additional options for the request.
159
129
  * @returns {Promise<Recommendations>} A Promise that resolves with the recommendations for the TV show.
160
130
  */
161
- recommendations(id, options) {
162
- return __awaiter(this, void 0, void 0, function* () {
163
- return yield this.api.get(`${BASE_TV}/${id}/recommendations`, options);
164
- });
131
+ async recommendations(id, options) {
132
+ return await this.api.get(`${BASE_TV}/${id}/recommendations`, options);
165
133
  }
166
134
  /**
167
135
  * Retrieves reviews for a specific TV show asynchronously.
@@ -169,20 +137,16 @@ class TvShowsEndpoint extends _types_1.BaseEndpoint {
169
137
  * @param {LanguageOption & PageOption} [options] - Additional options for the request.
170
138
  * @returns {Promise<Reviews>} A Promise that resolves with the reviews of the TV show.
171
139
  */
172
- reviews(id, options) {
173
- return __awaiter(this, void 0, void 0, function* () {
174
- return yield this.api.get(`${BASE_TV}/${id}/reviews`, options);
175
- });
140
+ async reviews(id, options) {
141
+ return await this.api.get(`${BASE_TV}/${id}/reviews`, options);
176
142
  }
177
143
  /**
178
144
  * Retrieves information about whether the TV show was screened theatrically asynchronously.
179
145
  * @param {number} id - The ID of the TV show.
180
146
  * @returns {Promise<ScreenedTheatrically>} A Promise that resolves with information about theatrical screenings.
181
147
  */
182
- screenedTheatrically(id) {
183
- return __awaiter(this, void 0, void 0, function* () {
184
- return yield this.api.get(`${BASE_TV}/${id}/screened_theatrically`);
185
- });
148
+ async screenedTheatrically(id) {
149
+ return await this.api.get(`${BASE_TV}/${id}/screened_theatrically`);
186
150
  }
187
151
  /**
188
152
  * Retrieves similar TV shows for a specific TV show asynchronously.
@@ -190,20 +154,16 @@ class TvShowsEndpoint extends _types_1.BaseEndpoint {
190
154
  * @param {LanguageOption & PageOption} [options] - Additional options for the request.
191
155
  * @returns {Promise<Similartv>} A Promise that resolves with the similar TV shows.
192
156
  */
193
- similar(id, options) {
194
- return __awaiter(this, void 0, void 0, function* () {
195
- return yield this.api.get(`${BASE_TV}/${id}/similar`, options);
196
- });
157
+ async similar(id, options) {
158
+ return await this.api.get(`${BASE_TV}/${id}/similar`, options);
197
159
  }
198
160
  /**
199
161
  * Retrieves translations for a specific TV show asynchronously.
200
162
  * @param {number} id - The ID of the TV show.
201
163
  * @returns {Promise<Translations>} A Promise that resolves with the translations of the TV show.
202
164
  */
203
- translations(id) {
204
- return __awaiter(this, void 0, void 0, function* () {
205
- return yield this.api.get(`${BASE_TV}/${id}/translations`);
206
- });
165
+ async translations(id) {
166
+ return await this.api.get(`${BASE_TV}/${id}/translations`);
207
167
  }
208
168
  /**
209
169
  * Retrieves videos for a specific TV show asynchronously.
@@ -211,15 +171,12 @@ class TvShowsEndpoint extends _types_1.BaseEndpoint {
211
171
  * @param {TvShowVideoOptions} [options] - Additional options for the request.
212
172
  * @returns {Promise<Videos>} A Promise that resolves with the videos of the TV show.
213
173
  */
214
- videos(id, options) {
215
- return __awaiter(this, void 0, void 0, function* () {
216
- var _a;
217
- const computedOptions = {
218
- include_video_language: (_a = options === null || options === void 0 ? void 0 : options.include_video_language) === null || _a === void 0 ? void 0 : _a.join(','),
219
- language: options === null || options === void 0 ? void 0 : options.language,
220
- };
221
- return yield this.api.get(`${BASE_TV}/${id}/videos`, computedOptions);
222
- });
174
+ async videos(id, options) {
175
+ const computedOptions = {
176
+ include_video_language: options?.include_video_language?.join(","),
177
+ language: options?.language,
178
+ };
179
+ return await this.api.get(`${BASE_TV}/${id}/videos`, computedOptions);
223
180
  }
224
181
  /**
225
182
  * Retrieves watch providers for a specific TV show asynchronously.
@@ -227,59 +184,47 @@ class TvShowsEndpoint extends _types_1.BaseEndpoint {
227
184
  * @param {number} id - The ID of the TV show.
228
185
  * @returns {Promise<WatchProviders>} A Promise that resolves with the watch providers of the TV show.
229
186
  */
230
- watchProviders(id) {
231
- return __awaiter(this, void 0, void 0, function* () {
232
- return yield this.api.get(`${BASE_TV}/${id}/watch/providers`);
233
- });
187
+ async watchProviders(id) {
188
+ return await this.api.get(`${BASE_TV}/${id}/watch/providers`);
234
189
  }
235
190
  /**
236
191
  * Retrieves the latest TV show asynchronously.
237
192
  * @returns {Promise<Latesttv>} A Promise that resolves with the latest TV show.
238
193
  */
239
- latest() {
240
- return __awaiter(this, void 0, void 0, function* () {
241
- return yield this.api.get(`${BASE_TV}/latest`);
242
- });
194
+ async latest() {
195
+ return await this.api.get(`${BASE_TV}/latest`);
243
196
  }
244
197
  /**
245
198
  * Retrieves TV shows that are currently on the air asynchronously.
246
199
  * @param {PageOption & LanguageOption & TimezoneOption} [options] - Additional options for the request.
247
200
  * @returns {Promise<OnTheAir>} A Promise that resolves with TV shows currently on the air.
248
201
  */
249
- onTheAir(options) {
250
- return __awaiter(this, void 0, void 0, function* () {
251
- return yield this.api.get(`${BASE_TV}/on_the_air`, options);
252
- });
202
+ async onTheAir(options) {
203
+ return await this.api.get(`${BASE_TV}/on_the_air`, options);
253
204
  }
254
205
  /**
255
206
  * Retrieves TV shows that are airing today asynchronously.
256
207
  * @param {PageOption & LanguageOption & TimezoneOption} [options] - Additional options for the request.
257
208
  * @returns {Promise<tvAiringToday>} A Promise that resolves with TV shows airing today.
258
209
  */
259
- airingToday(options) {
260
- return __awaiter(this, void 0, void 0, function* () {
261
- return yield this.api.get(`${BASE_TV}/airing_today`, options);
262
- });
210
+ async airingToday(options) {
211
+ return await this.api.get(`${BASE_TV}/airing_today`, options);
263
212
  }
264
213
  /**
265
214
  * Retrieves popular TV shows asynchronously.
266
215
  * @param {PageOption & LanguageOption} [options] - Additional options for the request.
267
216
  * @returns {Promise<Populartv>} A Promise that resolves with popular TV shows.
268
217
  */
269
- popular(options) {
270
- return __awaiter(this, void 0, void 0, function* () {
271
- return yield this.api.get(`${BASE_TV}/popular`, options);
272
- });
218
+ async popular(options) {
219
+ return await this.api.get(`${BASE_TV}/popular`, options);
273
220
  }
274
221
  /**
275
222
  * Retrieves top-rated TV shows asynchronously.
276
223
  * @param {PageOption & LanguageOption} [options] - Additional options for the request.
277
224
  * @returns {Promise<TopRatedtv>} A Promise that resolves with top-rated TV shows.
278
225
  */
279
- topRated(options) {
280
- return __awaiter(this, void 0, void 0, function* () {
281
- return yield this.api.get(`${BASE_TV}/top_rated`, options);
282
- });
226
+ async topRated(options) {
227
+ return await this.api.get(`${BASE_TV}/top_rated`, options);
283
228
  }
284
229
  }
285
230
  exports.TvShowsEndpoint = TvShowsEndpoint;