@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
@@ -1 +0,0 @@
1
- {"version":3,"file":"tvShows.d.ts","sourceRoot":"","sources":["../../src/endpoints/tvShows.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,EACrB,YAAY,EACZ,YAAY,EACZ,OAAO,EACP,cAAc,EACd,OAAO,EACP,aAAa,EACb,WAAW,EACX,MAAM,EACN,QAAQ,EACR,cAAc,EACd,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,SAAS,EACT,eAAe,EACf,OAAO,EACP,oBAAoB,EACpB,aAAa,EACb,SAAS,EACT,cAAc,EACd,SAAS,EACT,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,MAAM,EACN,cAAc,EACd,MAAM,WAAW,CAAC;AAInB;;GAEG;AACH,qBAAa,eAAgB,SAAQ,YAAY;IAKpC,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,SAAS;IAJtD;;;OAGG;gBAC4B,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AAC,UAAU,CAAC;CAM1E"}
@@ -1,230 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TvShowsEndpoint = void 0;
4
- const _types_1 = require("../@types");
5
- const BASE_TV = "/tv";
6
- /**
7
- * Represents an endpoint for accessing TV show-related information.
8
- */
9
- class TvShowsEndpoint extends _types_1.BaseEndpoint {
10
- /**
11
- * Constructs a new TvShowsEndpoint instance.
12
- * @param {string} access_token - The access token used for authentication.
13
- */
14
- constructor(access_token) {
15
- super(access_token);
16
- this.access_token = access_token;
17
- }
18
- /**
19
- * Retrieves details of a specific TV show asynchronously.
20
- * @param {number} id - The ID of the TV show.
21
- * @param {AppendToResponseTvKey[]} [appendToResponse] - Additional data to append to the response.
22
- * @param {string} [language] - The language for the response.
23
- * @returns {Promise<AppendToResponse<TvShowDetails, AppendToResponseTvKey[], 'tvShow'>>}
24
- * A Promise that resolves with the details of the TV show.
25
- */
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);
34
- }
35
- /**
36
- * Retrieves alternative titles of a specific TV show asynchronously.
37
- * @param {number} id - The ID of the TV show.
38
- * @returns {Promise<AlternativeTitles>} A Promise that resolves with the alternative titles of the TV show.
39
- */
40
- async alternativeTitles(id) {
41
- return await this.api.get(`${BASE_TV}/${id}/alternative_titles`);
42
- }
43
- /**
44
- * Retrieves changes for a specific TV show asynchronously.
45
- * @param {number} id - The ID of the TV show.
46
- * @param {ChangeOption} [options] - Additional options for the request.
47
- * @returns {Promise<Changes<TvShowChangeValue>>}
48
- * A Promise that resolves with the changes for the TV show.
49
- */
50
- async changes(id, options) {
51
- return await this.api.get(`${BASE_TV}/${id}/changes`, options);
52
- }
53
- /**
54
- * Retrieves content ratings for a specific TV show asynchronously.
55
- * @param {number} id - The ID of the TV show.
56
- * @returns {Promise<ContentRatings>} A Promise that resolves with the content ratings of the TV show.
57
- */
58
- async contentRatings(id) {
59
- return await this.api.get(`${BASE_TV}/${id}/content_ratings`);
60
- }
61
- /**
62
- * Retrieves aggregate credits for a specific TV show asynchronously.
63
- * @param {number} id - The ID of the TV show.
64
- * @param {LanguageOption} [options] - Additional options for the request.
65
- * @returns {Promise<AggregateCredits>} A Promise that resolves with the aggregate credits of the TV show.
66
- */
67
- async aggregateCredits(id, options) {
68
- return await this.api.get(`${BASE_TV}/${id}/aggregate_credits`, options);
69
- }
70
- /**
71
- * Retrieves credits for a specific TV show asynchronously.
72
- * @param {number} id - The ID of the TV show.
73
- * @param {LanguageOption} [options] - Additional options for the request.
74
- * @returns {Promise<Credits>} A Promise that resolves with the credits of the TV show.
75
- */
76
- async credits(id, options) {
77
- return await this.api.get(`${BASE_TV}/${id}/credits`, options);
78
- }
79
- /**
80
- * Retrieves details of a specific season of a TV show asynchronously.
81
- * @param {number} tvId - The ID of the TV show.
82
- * @param {number} seasonNumber - The season number.
83
- * @returns {Promise<SeasonDetails>} A Promise that resolves with the details of the season.
84
- */
85
- async season(tvId, seasonNumber) {
86
- return await this.api.get(`${BASE_TV}/${tvId}/season/${seasonNumber}`);
87
- }
88
- /**
89
- * Retrieves episode groups for a specific TV show asynchronously.
90
- * @param {number} id - The ID of the TV show.
91
- * @returns {Promise<EpisodeGroups>} A Promise that resolves with the episode groups of the TV show.
92
- */
93
- async episodeGroups(id) {
94
- return await this.api.get(`${BASE_TV}/${id}/episode_groups`);
95
- }
96
- /**
97
- * Retrieves external IDs for a specific TV show asynchronously.
98
- * @param {number} id - The ID of the TV show.
99
- * @returns {Promise<ExternalIds>} A Promise that resolves with the external IDs of the TV show.
100
- */
101
- async externalIds(id) {
102
- return await this.api.get(`${BASE_TV}/${id}/external_ids`);
103
- }
104
- /**
105
- * Retrieves images for a specific TV show asynchronously.
106
- * @param {number} id - The ID of the TV show.
107
- * @param {TvShowImageOptions} [options] - Additional options for the request.
108
- * @returns {Promise<Images>} A Promise that resolves with the images of the TV show.
109
- */
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);
116
- }
117
- /**
118
- * Retrieves keywords for a specific TV show asynchronously.
119
- * @param {number} id - The ID of the TV show.
120
- * @returns {Promise<Keywords>} A Promise that resolves with the keywords of the TV show.
121
- */
122
- async keywords(id) {
123
- return await this.api.get(`${BASE_TV}/${id}/keywords`);
124
- }
125
- /**
126
- * Retrieves recommendations for a specific TV show asynchronously.
127
- * @param {number} id - The ID of the TV show.
128
- * @param {LanguageOption & PageOption} [options] - Additional options for the request.
129
- * @returns {Promise<Recommendations>} A Promise that resolves with the recommendations for the TV show.
130
- */
131
- async recommendations(id, options) {
132
- return await this.api.get(`${BASE_TV}/${id}/recommendations`, options);
133
- }
134
- /**
135
- * Retrieves reviews for a specific TV show asynchronously.
136
- * @param {number} id - The ID of the TV show.
137
- * @param {LanguageOption & PageOption} [options] - Additional options for the request.
138
- * @returns {Promise<Reviews>} A Promise that resolves with the reviews of the TV show.
139
- */
140
- async reviews(id, options) {
141
- return await this.api.get(`${BASE_TV}/${id}/reviews`, options);
142
- }
143
- /**
144
- * Retrieves information about whether the TV show was screened theatrically asynchronously.
145
- * @param {number} id - The ID of the TV show.
146
- * @returns {Promise<ScreenedTheatrically>} A Promise that resolves with information about theatrical screenings.
147
- */
148
- async screenedTheatrically(id) {
149
- return await this.api.get(`${BASE_TV}/${id}/screened_theatrically`);
150
- }
151
- /**
152
- * Retrieves similar TV shows for a specific TV show asynchronously.
153
- * @param {number} id - The ID of the TV show.
154
- * @param {LanguageOption & PageOption} [options] - Additional options for the request.
155
- * @returns {Promise<Similartv>} A Promise that resolves with the similar TV shows.
156
- */
157
- async similar(id, options) {
158
- return await this.api.get(`${BASE_TV}/${id}/similar`, options);
159
- }
160
- /**
161
- * Retrieves translations for a specific TV show asynchronously.
162
- * @param {number} id - The ID of the TV show.
163
- * @returns {Promise<Translations>} A Promise that resolves with the translations of the TV show.
164
- */
165
- async translations(id) {
166
- return await this.api.get(`${BASE_TV}/${id}/translations`);
167
- }
168
- /**
169
- * Retrieves videos for a specific TV show asynchronously.
170
- * @param {number} id - The ID of the TV show.
171
- * @param {TvShowVideoOptions} [options] - Additional options for the request.
172
- * @returns {Promise<Videos>} A Promise that resolves with the videos of the TV show.
173
- */
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);
180
- }
181
- /**
182
- * Retrieves watch providers for a specific TV show asynchronously.
183
- * Powered by JustWatch.
184
- * @param {number} id - The ID of the TV show.
185
- * @returns {Promise<WatchProviders>} A Promise that resolves with the watch providers of the TV show.
186
- */
187
- async watchProviders(id) {
188
- return await this.api.get(`${BASE_TV}/${id}/watch/providers`);
189
- }
190
- /**
191
- * Retrieves the latest TV show asynchronously.
192
- * @returns {Promise<Latesttv>} A Promise that resolves with the latest TV show.
193
- */
194
- async latest() {
195
- return await this.api.get(`${BASE_TV}/latest`);
196
- }
197
- /**
198
- * Retrieves TV shows that are currently on the air asynchronously.
199
- * @param {PageOption & LanguageOption & TimezoneOption} [options] - Additional options for the request.
200
- * @returns {Promise<OnTheAir>} A Promise that resolves with TV shows currently on the air.
201
- */
202
- async onTheAir(options) {
203
- return await this.api.get(`${BASE_TV}/on_the_air`, options);
204
- }
205
- /**
206
- * Retrieves TV shows that are airing today asynchronously.
207
- * @param {PageOption & LanguageOption & TimezoneOption} [options] - Additional options for the request.
208
- * @returns {Promise<tvAiringToday>} A Promise that resolves with TV shows airing today.
209
- */
210
- async airingToday(options) {
211
- return await this.api.get(`${BASE_TV}/airing_today`, options);
212
- }
213
- /**
214
- * Retrieves popular TV shows asynchronously.
215
- * @param {PageOption & LanguageOption} [options] - Additional options for the request.
216
- * @returns {Promise<Populartv>} A Promise that resolves with popular TV shows.
217
- */
218
- async popular(options) {
219
- return await this.api.get(`${BASE_TV}/popular`, options);
220
- }
221
- /**
222
- * Retrieves top-rated TV shows asynchronously.
223
- * @param {PageOption & LanguageOption} [options] - Additional options for the request.
224
- * @returns {Promise<TopRatedtv>} A Promise that resolves with top-rated TV shows.
225
- */
226
- async topRated(options) {
227
- return await this.api.get(`${BASE_TV}/top_rated`, options);
228
- }
229
- }
230
- exports.TvShowsEndpoint = TvShowsEndpoint;
@@ -1,33 +0,0 @@
1
- import { BaseEndpoint, TokenType, WatchProviders, WatchRegionsResponse } from "../@types";
2
- /**
3
- * Represents an endpoint for accessing watch provider information.
4
- */
5
- export declare class WatchProvidersEndpoint extends BaseEndpoint {
6
- protected readonly access_token: TokenType;
7
- /**
8
- * Constructs a new WatchProvidersEndpoint instance.
9
- * @param {string} access_token - The access token used for authentication.
10
- */
11
- constructor(access_token: TokenType);
12
- /**
13
- * Retrieves a list of all available watch providers (streaming services).
14
- * @returns {Promise<WatchProviders>} A Promise that resolves with the list of watch providers.
15
- */
16
- available(): Promise<WatchProviders>;
17
- /**
18
- * Retrieves a list of available regions for watch providers.
19
- * @returns {Promise<WatchRegionsResponse>} A Promise that resolves with the list of available regions.
20
- */
21
- regions(): Promise<WatchRegionsResponse>;
22
- /**
23
- * Retrieves a list of watch providers for movies.
24
- * @returns {Promise<WatchProviders>} A Promise that resolves with the list of movie watch providers.
25
- */
26
- movie(): Promise<WatchProviders>;
27
- /**
28
- * Retrieves a list of watch providers for TV shows.
29
- * @returns {Promise<WatchProviders>} A Promise that resolves with the list of TV watch providers.
30
- */
31
- tv(): Promise<WatchProviders>;
32
- }
33
- //# sourceMappingURL=watchProviders.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"watchProviders.d.ts","sourceRoot":"","sources":["../../src/endpoints/watchProviders.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,YAAY,EACZ,SAAS,EACT,cAAc,EACd,oBAAoB,EACpB,MAAM,WAAW,CAAC;AAEnB;;GAEG;AACH,qBAAa,sBAAuB,SAAQ,YAAY;IAK3C,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,SAAS;IAJtD;;;OAGG;gBAC4B,YAAY,EAAE,SAAS;IAItD;;;OAGG;IACG,SAAS,IAAI,OAAO,CAAC,cAAc,CAAC;IAI1C;;;OAGG;IACG,OAAO,IAAI,OAAO,CAAC,oBAAoB,CAAC;IAI9C;;;OAGG;IACG,KAAK,IAAI,OAAO,CAAC,cAAc,CAAC;IAItC;;;OAGG;IACG,EAAE,IAAI,OAAO,CAAC,cAAc,CAAC;CAGnC"}
@@ -1,46 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WatchProvidersEndpoint = void 0;
4
- const _types_1 = require("../@types");
5
- /**
6
- * Represents an endpoint for accessing watch provider information.
7
- */
8
- class WatchProvidersEndpoint extends _types_1.BaseEndpoint {
9
- /**
10
- * Constructs a new WatchProvidersEndpoint instance.
11
- * @param {string} access_token - The access token used for authentication.
12
- */
13
- constructor(access_token) {
14
- super(access_token);
15
- this.access_token = access_token;
16
- }
17
- /**
18
- * Retrieves a list of all available watch providers (streaming services).
19
- * @returns {Promise<WatchProviders>} A Promise that resolves with the list of watch providers.
20
- */
21
- async available() {
22
- return await this.api.get("/watch/providers/movie");
23
- }
24
- /**
25
- * Retrieves a list of available regions for watch providers.
26
- * @returns {Promise<WatchRegionsResponse>} A Promise that resolves with the list of available regions.
27
- */
28
- async regions() {
29
- return await this.api.get("/watch/providers/regions");
30
- }
31
- /**
32
- * Retrieves a list of watch providers for movies.
33
- * @returns {Promise<WatchProviders>} A Promise that resolves with the list of movie watch providers.
34
- */
35
- async movie() {
36
- return await this.api.get("/watch/providers/movie");
37
- }
38
- /**
39
- * Retrieves a list of watch providers for TV shows.
40
- * @returns {Promise<WatchProviders>} A Promise that resolves with the list of TV watch providers.
41
- */
42
- async tv() {
43
- return await this.api.get("/watch/providers/tv");
44
- }
45
- }
46
- exports.WatchProvidersEndpoint = WatchProvidersEndpoint;
package/dist/index.d.ts DELETED
@@ -1,30 +0,0 @@
1
- import { TokenType } from "./@types";
2
- import { AccountEndpoint, CertificationEndpoint, ChangeEndpoint, CollectionsEndpoint, CompaniesEndpoint, ConfigurationEndpoint, CreditsEndpoint, DiscoverEndpoint, FindEndpoint, GenreEndpoint, KeywordsEndpoint, MoviesEndpoint, NetworksEndpoint, PeopleEndpoint, ReviewEndpoint, SearchEndpoint, TrendingEndpoint, TvEpisodesEndpoint, TvSeasonsEndpoint, TvShowsEndpoint, WatchProvidersEndpoint } from "./endpoints";
3
- declare class TMDB {
4
- constructor(auth: TokenType);
5
- account: AccountEndpoint;
6
- certification: CertificationEndpoint;
7
- changes: ChangeEndpoint;
8
- collections: CollectionsEndpoint;
9
- companies: CompaniesEndpoint;
10
- configuration: ConfigurationEndpoint;
11
- credits: CreditsEndpoint;
12
- discover: DiscoverEndpoint;
13
- find: FindEndpoint;
14
- genre: GenreEndpoint;
15
- keywords: KeywordsEndpoint;
16
- movies: MoviesEndpoint;
17
- networks: NetworksEndpoint;
18
- people: PeopleEndpoint;
19
- review: ReviewEndpoint;
20
- search: SearchEndpoint;
21
- trending: TrendingEndpoint;
22
- tvEpisodes: TvEpisodesEndpoint;
23
- tvSeasons: TvSeasonsEndpoint;
24
- tvShows: TvShowsEndpoint;
25
- watchProviders: WatchProvidersEndpoint;
26
- }
27
- export * from "./@types";
28
- export * from "./utils";
29
- export { TMDB };
30
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EACN,eAAe,EACf,qBAAqB,EACrB,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,sBAAsB,EACtB,MAAM,aAAa,CAAC;AAErB,cAAM,IAAI;gBACG,IAAI,EAAE,SAAS;IAwB3B,OAAO,EAAE,eAAe,CAAC;IACzB,aAAa,EAAE,qBAAqB,CAAC;IACrC,OAAO,EAAE,cAAc,CAAC;IACxB,WAAW,EAAE,mBAAmB,CAAC;IACjC,SAAS,EAAE,iBAAiB,CAAC;IAC7B,aAAa,EAAE,qBAAqB,CAAC;IACrC,OAAO,EAAE,eAAe,CAAC;IACzB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,IAAI,EAAE,YAAY,CAAC;IACnB,KAAK,EAAE,aAAa,CAAC;IACrB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,MAAM,EAAE,cAAc,CAAC;IACvB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,MAAM,EAAE,cAAc,CAAC;IACvB,MAAM,EAAE,cAAc,CAAC;IACvB,MAAM,EAAE,cAAc,CAAC;IACvB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,UAAU,EAAE,kBAAkB,CAAC;IAC/B,SAAS,EAAE,iBAAiB,CAAC;IAC7B,OAAO,EAAE,eAAe,CAAC;IACzB,cAAc,EAAE,sBAAsB,CAAC;CACvC;AAED,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,IAAI,EAAE,CAAC"}
package/dist/index.js DELETED
@@ -1,46 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.TMDB = void 0;
18
- const endpoints_1 = require("./endpoints");
19
- class TMDB {
20
- constructor(auth) {
21
- this.account = new endpoints_1.AccountEndpoint(auth);
22
- this.certification = new endpoints_1.CertificationEndpoint(auth);
23
- this.changes = new endpoints_1.ChangeEndpoint(auth);
24
- this.collections = new endpoints_1.CollectionsEndpoint(auth);
25
- this.companies = new endpoints_1.CompaniesEndpoint(auth);
26
- this.configuration = new endpoints_1.ConfigurationEndpoint(auth);
27
- this.credits = new endpoints_1.CreditsEndpoint(auth);
28
- this.discover = new endpoints_1.DiscoverEndpoint(auth);
29
- this.find = new endpoints_1.FindEndpoint(auth);
30
- this.genre = new endpoints_1.GenreEndpoint(auth);
31
- this.keywords = new endpoints_1.KeywordsEndpoint(auth);
32
- this.movies = new endpoints_1.MoviesEndpoint(auth);
33
- this.networks = new endpoints_1.NetworksEndpoint(auth);
34
- this.people = new endpoints_1.PeopleEndpoint(auth);
35
- this.review = new endpoints_1.ReviewEndpoint(auth);
36
- this.search = new endpoints_1.SearchEndpoint(auth);
37
- this.trending = new endpoints_1.TrendingEndpoint(auth);
38
- this.tvEpisodes = new endpoints_1.TvEpisodesEndpoint(auth);
39
- this.tvSeasons = new endpoints_1.TvSeasonsEndpoint(auth);
40
- this.tvShows = new endpoints_1.TvShowsEndpoint(auth);
41
- this.watchProviders = new endpoints_1.WatchProvidersEndpoint(auth);
42
- }
43
- }
44
- exports.TMDB = TMDB;
45
- __exportStar(require("./@types"), exports);
46
- __exportStar(require("./utils"), exports);
@@ -1,14 +0,0 @@
1
- import { TokenType } from "../@types";
2
- export declare class API {
3
- private apiKey?;
4
- private accessToken?;
5
- constructor(auth: TokenType);
6
- /**
7
- * Generic GET:
8
- * @template T — response type
9
- * @template O — options (query params) type
10
- */
11
- get<T, O extends Record<string, unknown> = Record<string, unknown>>(path: string, options?: O): Promise<T>;
12
- }
13
- export declare const parseOptions: (options?: Record<string, unknown>) => string;
14
- //# sourceMappingURL=api.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/utils/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,SAAS,EAAE,MAAM,WAAW,CAAC;AAIrD,qBAAa,GAAG;IACf,OAAO,CAAC,MAAM,CAAC,CAAS;IACxB,OAAO,CAAC,WAAW,CAAC,CAAS;gBAEjB,IAAI,EAAE,SAAS;IAS3B;;;;OAIG;IACG,GAAG,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACvE,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,CAAC,GACT,OAAO,CAAC,CAAC,CAAC;CAyBb;AAED,eAAO,MAAM,YAAY,GAAI,UAAU,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,MAkBhE,CAAC"}
package/dist/utils/api.js DELETED
@@ -1,61 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseOptions = exports.API = void 0;
4
- const BASE_URL_V3 = "https://api.themoviedb.org/3";
5
- class API {
6
- constructor(auth) {
7
- if (typeof auth === "string") {
8
- this.accessToken = auth;
9
- }
10
- else {
11
- this.apiKey = auth.apiKey;
12
- this.accessToken = auth.accessToken;
13
- }
14
- }
15
- /**
16
- * Generic GET:
17
- * @template T — response type
18
- * @template O — options (query params) type
19
- */
20
- async get(path, options) {
21
- const rawOptions = {
22
- ...(options ?? {}),
23
- ...(this.apiKey ? { api_key: this.apiKey } : {}),
24
- };
25
- const params = (0, exports.parseOptions)(rawOptions);
26
- const response = await fetch(`${BASE_URL_V3}${path}?${params}`, {
27
- method: "GET",
28
- headers: {
29
- ...(this.accessToken
30
- ? { Authorization: `Bearer ${this.accessToken}` }
31
- : {}),
32
- "Content-Type": "application/json;charset=utf-8",
33
- },
34
- });
35
- if (!response.ok) {
36
- const error = (await response.json());
37
- return Promise.reject(error);
38
- }
39
- return (await response.json());
40
- }
41
- }
42
- exports.API = API;
43
- const parseOptions = (options) => {
44
- if (!options)
45
- return "";
46
- const entries = [];
47
- for (const [key, value] of Object.entries(options)) {
48
- if (value === undefined || value === null)
49
- continue;
50
- if (Array.isArray(value)) {
51
- for (const item of value) {
52
- entries.push([key, String(item)]);
53
- }
54
- }
55
- else {
56
- entries.push([key, String(value)]);
57
- }
58
- }
59
- return new URLSearchParams(entries).toString();
60
- };
61
- exports.parseOptions = parseOptions;
@@ -1,32 +0,0 @@
1
- /**
2
- * Utility method to construct full url for image
3
- * based on configuration
4
- *
5
- * https://developers.themoviedb.org/3/getting-started/images
6
- * @param {string} baseUrl base image url (e.g., 'https://image.tmdb.org/t/p/')
7
- * @param {string} fileSize file size (e.g., 'original', 'w500')
8
- * @param {string} imagePath raw image path
9
- * @param {string} format override image format (e.g., 'svg', 'png', 'jpg')
10
- * @returns {string} The complete image URL
11
- */
12
- export declare const getFullImagePath: (baseUrl: string, fileSize: string, imagePath: string, format?: string) => string;
13
- /**
14
- * Common image sizes available in TMDB
15
- */
16
- export declare const ImageSizes: {
17
- ORIGINAL: string;
18
- W500: string;
19
- W300: string;
20
- W185: string;
21
- W92: string;
22
- H632: string;
23
- };
24
- /**
25
- * Image formats supported by TMDB
26
- */
27
- export declare const ImageFormats: {
28
- JPG: string;
29
- PNG: string;
30
- SVG: string;
31
- };
32
- //# sourceMappingURL=getimagePath.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getimagePath.d.ts","sourceRoot":"","sources":["../../src/utils/getimagePath.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gBAAgB,GAC5B,SAAS,MAAM,EACf,UAAU,MAAM,EAChB,WAAW,MAAM,EACjB,SAAS,MAAM,KACb,MAeF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;;CAOtB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY;;;;CAIxB,CAAC"}
@@ -1,50 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ImageFormats = exports.ImageSizes = exports.getFullImagePath = void 0;
4
- /**
5
- * Utility method to construct full url for image
6
- * based on configuration
7
- *
8
- * https://developers.themoviedb.org/3/getting-started/images
9
- * @param {string} baseUrl base image url (e.g., 'https://image.tmdb.org/t/p/')
10
- * @param {string} fileSize file size (e.g., 'original', 'w500')
11
- * @param {string} imagePath raw image path
12
- * @param {string} format override image format (e.g., 'svg', 'png', 'jpg')
13
- * @returns {string} The complete image URL
14
- */
15
- const getFullImagePath = (baseUrl, fileSize, imagePath, format) => {
16
- if (!imagePath)
17
- return "";
18
- // Handle case where imagePath doesn't have an extension
19
- const hasExtension = imagePath.includes(".");
20
- if (hasExtension) {
21
- const imagePathArr = imagePath.split(".");
22
- const imageFormat = format || imagePathArr[1];
23
- return `${baseUrl}${fileSize}${imagePathArr[0]}.${imageFormat}`;
24
- }
25
- else {
26
- // If no extension in path, use provided format or default to jpg
27
- const imageFormat = format || "jpg";
28
- return `${baseUrl}${fileSize}${imagePath}.${imageFormat}`;
29
- }
30
- };
31
- exports.getFullImagePath = getFullImagePath;
32
- /**
33
- * Common image sizes available in TMDB
34
- */
35
- exports.ImageSizes = {
36
- ORIGINAL: "original",
37
- W500: "w500",
38
- W300: "w300",
39
- W185: "w185",
40
- W92: "w92",
41
- H632: "h632",
42
- };
43
- /**
44
- * Image formats supported by TMDB
45
- */
46
- exports.ImageFormats = {
47
- JPG: "jpg",
48
- PNG: "png",
49
- SVG: "svg",
50
- };
@@ -1,3 +0,0 @@
1
- export * from "./api";
2
- export * from "./getimagePath";
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,gBAAgB,CAAC"}
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./api"), exports);
18
- __exportStar(require("./getimagePath"), exports);