@tdanks2000/tmdb-wrapper 1.0.3 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (185) hide show
  1. package/README.md +334 -148
  2. package/dist/endpoints/account.js +2 -13
  3. package/dist/endpoints/certification.js +4 -17
  4. package/dist/endpoints/changes.js +6 -21
  5. package/dist/endpoints/collections.js +10 -26
  6. package/dist/endpoints/companies.js +6 -21
  7. package/dist/endpoints/configuration.js +2 -13
  8. package/dist/endpoints/credits.js +2 -13
  9. package/dist/endpoints/discover.js +4 -17
  10. package/dist/endpoints/find.js +2 -13
  11. package/dist/endpoints/genre.js +4 -17
  12. package/dist/endpoints/index.js +3 -0
  13. package/dist/endpoints/keywords.js +4 -17
  14. package/dist/endpoints/movies.js +48 -98
  15. package/dist/endpoints/networks.js +6 -21
  16. package/dist/endpoints/people.js +26 -57
  17. package/dist/endpoints/review.js +2 -13
  18. package/dist/endpoints/search.js +14 -37
  19. package/dist/endpoints/trending.js +2 -13
  20. package/dist/endpoints/tvEpisodes.js +26 -48
  21. package/dist/endpoints/tvSeasons.js +28 -52
  22. package/dist/endpoints/tvShows.js +58 -115
  23. package/dist/endpoints/watchProviders.js +46 -0
  24. package/dist/index.js +3 -0
  25. package/dist/utils/api.js +12 -23
  26. package/dist/utils/getimagePath.js +39 -8
  27. package/package.json +59 -41
  28. package/.github/workflows/npm-publish.yml +0 -33
  29. package/dist/@types/endpoints/account.d.ts +0 -16
  30. package/dist/@types/endpoints/account.d.ts.map +0 -1
  31. package/dist/@types/endpoints/certification.d.ts +0 -19
  32. package/dist/@types/endpoints/certification.d.ts.map +0 -1
  33. package/dist/@types/endpoints/changes.d.ts +0 -26
  34. package/dist/@types/endpoints/changes.d.ts.map +0 -1
  35. package/dist/@types/endpoints/collection.d.ts +0 -21
  36. package/dist/@types/endpoints/collection.d.ts.map +0 -1
  37. package/dist/@types/endpoints/companies.d.ts +0 -29
  38. package/dist/@types/endpoints/companies.d.ts.map +0 -1
  39. package/dist/@types/endpoints/configuration.d.ts +0 -106
  40. package/dist/@types/endpoints/configuration.d.ts.map +0 -1
  41. package/dist/@types/endpoints/credits.d.ts +0 -135
  42. package/dist/@types/endpoints/credits.d.ts.map +0 -1
  43. package/dist/@types/endpoints/discover.d.ts +0 -68
  44. package/dist/@types/endpoints/discover.d.ts.map +0 -1
  45. package/dist/@types/endpoints/find.d.ts +0 -20
  46. package/dist/@types/endpoints/find.d.ts.map +0 -1
  47. package/dist/@types/endpoints/genre.d.ts +0 -7
  48. package/dist/@types/endpoints/genre.d.ts.map +0 -1
  49. package/dist/@types/endpoints/index.d.ts +0 -23
  50. package/dist/@types/endpoints/index.d.ts.map +0 -1
  51. package/dist/@types/endpoints/keywords.d.ts +0 -21
  52. package/dist/@types/endpoints/keywords.d.ts.map +0 -1
  53. package/dist/@types/endpoints/movies.d.ts +0 -150
  54. package/dist/@types/endpoints/movies.d.ts.map +0 -1
  55. package/dist/@types/endpoints/networks.d.ts +0 -14
  56. package/dist/@types/endpoints/networks.d.ts.map +0 -1
  57. package/dist/@types/endpoints/options.d.ts +0 -73
  58. package/dist/@types/endpoints/options.d.ts.map +0 -1
  59. package/dist/@types/endpoints/people.d.ts +0 -135
  60. package/dist/@types/endpoints/people.d.ts.map +0 -1
  61. package/dist/@types/endpoints/review.d.ts +0 -8
  62. package/dist/@types/endpoints/review.d.ts.map +0 -1
  63. package/dist/@types/endpoints/search.d.ts +0 -32
  64. package/dist/@types/endpoints/search.d.ts.map +0 -1
  65. package/dist/@types/endpoints/trending.d.ts +0 -12
  66. package/dist/@types/endpoints/trending.d.ts.map +0 -1
  67. package/dist/@types/endpoints/tvEpisode.d.ts +0 -65
  68. package/dist/@types/endpoints/tvEpisode.d.ts.map +0 -1
  69. package/dist/@types/endpoints/tvSeasons.d.ts +0 -31
  70. package/dist/@types/endpoints/tvSeasons.d.ts.map +0 -1
  71. package/dist/@types/endpoints/tvShows.d.ts +0 -260
  72. package/dist/@types/endpoints/tvShows.d.ts.map +0 -1
  73. package/dist/@types/endpoints/watchProviders.d.ts +0 -295
  74. package/dist/@types/endpoints/watchProviders.d.ts.map +0 -1
  75. package/dist/@types/index.d.ts +0 -4
  76. package/dist/@types/index.d.ts.map +0 -1
  77. package/dist/@types/models/baseEndpoint.d.ts +0 -7
  78. package/dist/@types/models/baseEndpoint.d.ts.map +0 -1
  79. package/dist/@types/models/index.d.ts +0 -2
  80. package/dist/@types/models/index.d.ts.map +0 -1
  81. package/dist/@types/types.d.ts +0 -174
  82. package/dist/@types/types.d.ts.map +0 -1
  83. package/dist/endpoints/account.d.ts +0 -17
  84. package/dist/endpoints/account.d.ts.map +0 -1
  85. package/dist/endpoints/certification.d.ts +0 -23
  86. package/dist/endpoints/certification.d.ts.map +0 -1
  87. package/dist/endpoints/changes.d.ts +0 -31
  88. package/dist/endpoints/changes.d.ts.map +0 -1
  89. package/dist/endpoints/collections.d.ts +0 -34
  90. package/dist/endpoints/collections.d.ts.map +0 -1
  91. package/dist/endpoints/companies.d.ts +0 -31
  92. package/dist/endpoints/companies.d.ts.map +0 -1
  93. package/dist/endpoints/configuration.d.ts +0 -18
  94. package/dist/endpoints/configuration.d.ts.map +0 -1
  95. package/dist/endpoints/credits.d.ts +0 -19
  96. package/dist/endpoints/credits.d.ts.map +0 -1
  97. package/dist/endpoints/discover.d.ts +0 -24
  98. package/dist/endpoints/discover.d.ts.map +0 -1
  99. package/dist/endpoints/find.d.ts +0 -19
  100. package/dist/endpoints/find.d.ts.map +0 -1
  101. package/dist/endpoints/genre.d.ts +0 -25
  102. package/dist/endpoints/genre.d.ts.map +0 -1
  103. package/dist/endpoints/index.d.ts +0 -19
  104. package/dist/endpoints/index.d.ts.map +0 -1
  105. package/dist/endpoints/keywords.d.ts +0 -25
  106. package/dist/endpoints/keywords.d.ts.map +0 -1
  107. package/dist/endpoints/movies.d.ts +0 -142
  108. package/dist/endpoints/movies.d.ts.map +0 -1
  109. package/dist/endpoints/networks.d.ts +0 -31
  110. package/dist/endpoints/networks.d.ts.map +0 -1
  111. package/dist/endpoints/people.d.ts +0 -84
  112. package/dist/endpoints/people.d.ts.map +0 -1
  113. package/dist/endpoints/review.d.ts +0 -18
  114. package/dist/endpoints/review.d.ts.map +0 -1
  115. package/dist/endpoints/search.d.ts +0 -58
  116. package/dist/endpoints/search.d.ts.map +0 -1
  117. package/dist/endpoints/trending.d.ts +0 -21
  118. package/dist/endpoints/trending.d.ts.map +0 -1
  119. package/dist/endpoints/tvEpisodes.d.ts +0 -61
  120. package/dist/endpoints/tvEpisodes.d.ts.map +0 -1
  121. package/dist/endpoints/tvSeasons.d.ts +0 -70
  122. package/dist/endpoints/tvSeasons.d.ts.map +0 -1
  123. package/dist/endpoints/tvShows.d.ts +0 -164
  124. package/dist/endpoints/tvShows.d.ts.map +0 -1
  125. package/dist/index.d.ts +0 -26
  126. package/dist/index.d.ts.map +0 -1
  127. package/dist/utils/api.d.ts +0 -7
  128. package/dist/utils/api.d.ts.map +0 -1
  129. package/dist/utils/getimagePath.d.ts +0 -12
  130. package/dist/utils/getimagePath.d.ts.map +0 -1
  131. package/dist/utils/index.d.ts +0 -3
  132. package/dist/utils/index.d.ts.map +0 -1
  133. package/src/@types/endpoints/account.ts +0 -17
  134. package/src/@types/endpoints/certification.ts +0 -19
  135. package/src/@types/endpoints/changes.ts +0 -29
  136. package/src/@types/endpoints/collection.ts +0 -23
  137. package/src/@types/endpoints/companies.ts +0 -33
  138. package/src/@types/endpoints/configuration.ts +0 -112
  139. package/src/@types/endpoints/credits.ts +0 -149
  140. package/src/@types/endpoints/discover.ts +0 -87
  141. package/src/@types/endpoints/find.ts +0 -28
  142. package/src/@types/endpoints/genre.ts +0 -3
  143. package/src/@types/endpoints/index.ts +0 -22
  144. package/src/@types/endpoints/keywords.ts +0 -24
  145. package/src/@types/endpoints/movies.ts +0 -169
  146. package/src/@types/endpoints/networks.ts +0 -15
  147. package/src/@types/endpoints/options.ts +0 -189
  148. package/src/@types/endpoints/people.ts +0 -151
  149. package/src/@types/endpoints/review.ts +0 -8
  150. package/src/@types/endpoints/search.ts +0 -39
  151. package/src/@types/endpoints/trending.ts +0 -20
  152. package/src/@types/endpoints/tvEpisode.ts +0 -72
  153. package/src/@types/endpoints/tvSeasons.ts +0 -37
  154. package/src/@types/endpoints/tvShows.ts +0 -284
  155. package/src/@types/endpoints/watchProviders.ts +0 -298
  156. package/src/@types/index.ts +0 -3
  157. package/src/@types/models/baseEndpoint.ts +0 -9
  158. package/src/@types/models/index.ts +0 -1
  159. package/src/@types/types.ts +0 -199
  160. package/src/endpoints/account.ts +0 -22
  161. package/src/endpoints/certification.ts +0 -30
  162. package/src/endpoints/changes.ts +0 -41
  163. package/src/endpoints/collections.ts +0 -57
  164. package/src/endpoints/companies.ts +0 -41
  165. package/src/endpoints/configuration.ts +0 -22
  166. package/src/endpoints/credits.ts +0 -23
  167. package/src/endpoints/discover.ts +0 -40
  168. package/src/endpoints/find.ts +0 -24
  169. package/src/endpoints/genre.ts +0 -32
  170. package/src/endpoints/index.ts +0 -18
  171. package/src/endpoints/keywords.ts +0 -35
  172. package/src/endpoints/movies.ts +0 -244
  173. package/src/endpoints/networks.ts +0 -41
  174. package/src/endpoints/people.ts +0 -147
  175. package/src/endpoints/review.ts +0 -23
  176. package/src/endpoints/search.ts +0 -93
  177. package/src/endpoints/trending.ts +0 -30
  178. package/src/endpoints/tvEpisodes.ts +0 -125
  179. package/src/endpoints/tvSeasons.ts +0 -138
  180. package/src/endpoints/tvShows.ts +0 -286
  181. package/src/index.ts +0 -66
  182. package/src/utils/api.ts +0 -31
  183. package/src/utils/getimagePath.ts +0 -16
  184. package/src/utils/index.ts +0 -2
  185. package/tsconfig.json +0 -101
package/README.md CHANGED
@@ -1,148 +1,334 @@
1
- <h1 align="center">
2
- TMDB Api Wrapper
3
- </h1>
4
-
5
- <p align="center">
6
- <a href="https://www.npmjs.com/package/@tdanks2000/tmdb-wrapper">
7
- <img alt="NPM Version" src="https://img.shields.io/npm/v/%40tdanks2000%2Ftmdb-wrapper">
8
- </a>
9
- <a href="https://github.com/tdanks2000/tmdb-wrapper/blob/master/LICENSE">
10
- <img src="https://img.shields.io/npm/l/@tdanks2000/tmdb-wrapper" alt="GitHub">
11
- </a>
12
- </p>
13
-
14
- <br />
15
-
16
- The TMDB Api Wrapper simplifies the process of making API requests to The Movie Database (TMDb), a comprehensive database for movies and TV shows. It encapsulates functionality related to various API endpoints, such as account, certifications, changes, collections, configuration, credits, discover, find, genres, keywords, movies, people, reviews, search, trending, TV episodes, TV seasons, and TV shows. With this wrapper, developers can quickly integrate TMDB functionality into their TypeScript projects.
17
-
18
- ## Table of Contents
19
-
20
- - [Installation](#installation)
21
- - [Usage](#usage)
22
- - [Authentication](#authentication)
23
- - [Functionality](#functionality)
24
- - [Contributing](#contributing)
25
- - [License](#license)
26
-
27
- ## Installation
28
-
29
- To install the TMDB TypeScript Wrapper, follow these steps:
30
-
31
- 1. Run the following command in your project directory:
32
-
33
- ```typescript
34
- // npm
35
- npm install @tdanks2000/tmdb-wrapper
36
- // yarn
37
- yarn add @tdanks2000/tmdb-wrapper
38
- // pnpm
39
- pnpm i @tdanks2000/tmdb-wrapper
40
- // bun
41
- bun add @tdanks2000/tmdb-wrapper
42
- ```
43
-
44
- ## Usage
45
-
46
- To use the TMDB TypeScript API Wrapper in your TypeScript project, import the necessary classes and functions:
47
-
48
- ```typescript
49
- import { TMDB } from '@tdanks2000/tmdb-wrapper';
50
- ```
51
-
52
- Then, create an instance of the TMDB class, optionally providing an access token. Access tokens can be obtained from [TMDb API Settings](https://www.themoviedb.org/settings/api) under read access token.
53
-
54
- ```typescript
55
- const tmdb = new TMDB('YOUR_ACCESS_TOKEN');
56
- ```
57
-
58
- You can now use the `tmdb` object to access various functionalities of the TMDB API. See the next section for details on available functionality.
59
-
60
- ## Functionality
61
-
62
- The TMDB Api Wrapper provides the following functionality:
63
-
64
- ### Account
65
-
66
- - Manage account details and settings.
67
-
68
- ### Certifications
69
-
70
- - Retrieve certification information for movies.
71
-
72
- ### Changes
73
-
74
- - Get information about changes to the database.
75
-
76
- ### Collections
77
-
78
- - Access information about movie collections.
79
-
80
- ### Configuration
81
-
82
- - Retrieve configuration information for the API.
83
-
84
- ### Credits
85
-
86
- - Get credits information for movies and TV shows.
87
-
88
- ### Discover
89
-
90
- - Discover movies and TV shows based on various criteria.
91
-
92
- ### Find
93
-
94
- - Find movies and TV shows by external IDs.
95
-
96
- ### Genres
97
-
98
- - Retrieve information about movie and TV show genres.
99
-
100
- ### Keywords
101
-
102
- - Access information about movie keywords.
103
-
104
- ### Movies
105
-
106
- - Access information about movies.
107
-
108
- ### People
109
-
110
- - Retrieve information about people involved in movies and TV shows.
111
-
112
- ### Reviews
113
-
114
- - Get reviews for movies and TV shows.
115
-
116
- ### Search
117
-
118
- - Search for movies, TV shows, and people.
119
-
120
- ### Trending
121
-
122
- - Get trending movies and TV shows.
123
-
124
- ### TV Episodes
125
-
126
- - Access information about TV show episodes.
127
-
128
- ### TV Seasons
129
-
130
- - Access information about TV show seasons.
131
-
132
- ### TV Shows
133
-
134
- - Access information about TV shows.
135
-
136
- ## Contributing
137
-
138
- Contributions are welcome! For bug reports, feature requests, or any other questions, please open an issue on the [GitHub repository](https://github.com/tdanks2000/tmdb-wrapper).
139
-
140
- ## License
141
-
142
- This project is licensed under the MIT License - see the [LICENSE](https://github.com/tdanks2000/tmdb-wrapper/blob/main/LICENSE) file for details.
143
-
144
- <br/>
145
-
146
- # ❤️
147
-
148
- Reminder that <strong><i>you are great, you are enough, and your presence is valued.</i></strong> If you are struggling with your mental health, please reach out to someone you love and consult a professional. You are not alone.
1
+ <h1 align="center">
2
+ TMDB Api Wrapper
3
+ </h1>
4
+
5
+ <p align="center">
6
+ <a href="https://www.npmjs.com/package/@tdanks2000/tmdb-wrapper"><img alt="npm version" src="https://img.shields.io/npm/v/@tdanks2000/tmdb-wrapper"></a>
7
+ <a href="https://github.com/tdanks2000/tmdb-wrapper/blob/master/LICENSE"><img alt="license" src="https://img.shields.io/npm/l/@tdanks2000/tmdb-wrapper"></a>
8
+ <a href="https://github.com/tdanks2000/tmdb-wrapper"><img alt="GitHub stars" src="https://img.shields.io/github/stars/tdanks2000/tmdb-wrapper?style=social"></a>
9
+ </p>
10
+
11
+ <br />
12
+
13
+ <p align="center">
14
+ <b>A powerful and easy-to-use TypeScript wrapper for The Movie Database (TMDb) API</b>
15
+ </p>
16
+
17
+ The TMDB Api Wrapper simplifies the process of making API requests to The Movie Database (TMDb), a comprehensive database for movies and TV shows. It encapsulates functionality related to various API endpoints, such as account, certifications, changes, collections, configuration, credits, discover, find, genres, keywords, movies, people, reviews, search, trending, TV episodes, TV seasons, TV shows, companies, networks, and watch providers. With this wrapper, developers can quickly integrate TMDB functionality into their TypeScript projects.
18
+
19
+ ## Table of Contents
20
+
21
+ - [Installation](#installation)
22
+ - [Usage](#usage)
23
+ - [Authentication](#authentication)
24
+ - [Functionality](#functionality)
25
+ - [Movies](#movies)
26
+ - [TV Shows](#tv-shows)
27
+ - [People](#people)
28
+ - [Companies](#companies)
29
+ - [Networks](#networks)
30
+ - [Watch Providers](#watch-providers)
31
+ - [Other Endpoints](#other-endpoints)
32
+ - [Image Handling](#image-handling)
33
+ - [Examples](#examples)
34
+ - [Troubleshooting](#troubleshooting)
35
+ - [API Reference](#api-reference)
36
+ - [Contributing](#contributing)
37
+ - [License](#license)
38
+
39
+ ## Installation
40
+
41
+ To install the TMDB TypeScript Wrapper, follow these steps:
42
+
43
+ 1. Run the following command in your project directory:
44
+
45
+ ```typescript
46
+ // npm
47
+ npm install @tdanks2000/tmdb-wrapper
48
+ // yarn
49
+ yarn add @tdanks2000/tmdb-wrapper
50
+ // pnpm
51
+ pnpm i @tdanks2000/tmdb-wrapper
52
+ // bun
53
+ bun add @tdanks2000/tmdb-wrapper
54
+ ```
55
+
56
+ ## Usage
57
+
58
+ To use the TMDB TypeScript API Wrapper in your TypeScript project, import the necessary classes and functions:
59
+
60
+ ```typescript
61
+ import { TMDB } from '@tdanks2000/tmdb-wrapper';
62
+ ```
63
+
64
+ Then, create an instance of the TMDB class, optionally providing an access token. Access tokens can be obtained from [TMDb API Settings](https://www.themoviedb.org/settings/api) under read access token.
65
+
66
+ ```typescript
67
+ const tmdb = new TMDB('YOUR_ACCESS_TOKEN');
68
+ ```
69
+
70
+ You can now use the `tmdb` object to access various functionalities of the TMDB API. The wrapper provides access to all major TMDB API endpoints including Movies, TV Shows, People, Companies, Networks, and Watch Providers.
71
+
72
+ ## Authentication
73
+
74
+ To use the TMDB API, you need to obtain an API key from [TMDb API Settings](https://www.themoviedb.org/settings/api). The wrapper supports both API key authentication and read access token authentication.
75
+
76
+ ```typescript
77
+ // Using API key
78
+ const tmdb = new TMDB({ apiKey: 'YOUR_API_KEY' });
79
+
80
+ // Using read access token (recommended)
81
+ const tmdb = new TMDB('YOUR_ACCESS_TOKEN');
82
+ ```
83
+
84
+ ## Functionality
85
+
86
+ The TMDB Api Wrapper provides access to the following endpoints:
87
+
88
+ ### Movies
89
+
90
+ Access comprehensive information about movies, including details, credits, reviews, and more.
91
+
92
+ ```typescript
93
+ // Get popular movies
94
+ const popularMovies = await tmdb.movies.getPopular();
95
+
96
+ // Get movie details
97
+ const movieDetails = await tmdb.movies.getDetails(550); // Fight Club
98
+
99
+ // Get movie credits
100
+ const movieCredits = await tmdb.movies.getCredits(550);
101
+ ```
102
+
103
+ ### TV Shows
104
+
105
+ Retrieve information about TV shows, seasons, and episodes.
106
+
107
+ ```typescript
108
+ // Get popular TV shows
109
+ const popularShows = await tmdb.tvShows.getPopular();
110
+
111
+ // Get TV show details
112
+ const showDetails = await tmdb.tvShows.getDetails(1396); // Breaking Bad
113
+
114
+ // Get season details
115
+ const seasonDetails = await tmdb.tvSeasons.getDetails(1396, 1);
116
+
117
+ // Get episode details
118
+ const episodeDetails = await tmdb.tvEpisodes.getDetails(1396, 1, 1);
119
+ ```
120
+
121
+ ### People
122
+
123
+ Access information about actors, directors, and other people involved in movies and TV shows.
124
+
125
+ ```typescript
126
+ // Get popular people
127
+ const popularPeople = await tmdb.people.getPopular();
128
+
129
+ // Get person details
130
+ const personDetails = await tmdb.people.getDetails(287); // Brad Pitt
131
+
132
+ // Get person movie credits
133
+ const personMovieCredits = await tmdb.people.getMovieCredits(287);
134
+ ```
135
+
136
+ ### Companies
137
+
138
+ Retrieve information about production companies.
139
+
140
+ ```typescript
141
+ // Get company details
142
+ const companyDetails = await tmdb.companies.getDetails(1); // Lucasfilm
143
+
144
+ // Get company movies
145
+ const companyMovies = await tmdb.companies.getMovies(1);
146
+ ```
147
+
148
+ ### Networks
149
+
150
+ Access information about TV networks.
151
+
152
+ ```typescript
153
+ // Get network details
154
+ const networkDetails = await tmdb.networks.getDetails(213); // Netflix
155
+
156
+ // Get alternative names
157
+ const alternativeNames = await tmdb.networks.getAlternativeNames(213);
158
+ ```
159
+
160
+ ### Watch Providers
161
+
162
+ Retrieve information about streaming platforms and availability.
163
+
164
+ ```typescript
165
+ // Get available regions
166
+ const regions = await tmdb.watchProviders.getAvailableRegions();
167
+
168
+ // Get movie providers
169
+ const movieProviders = await tmdb.watchProviders.getMovieProviders();
170
+
171
+ // Get TV providers
172
+ const tvProviders = await tmdb.watchProviders.getTvProviders();
173
+ ```
174
+
175
+ ### Other Endpoints
176
+
177
+ The wrapper also provides access to these additional endpoints:
178
+
179
+ - **Account**: Manage account details and settings
180
+ - **Certifications**: Retrieve certification information for movies and TV shows
181
+ - **Changes**: Get information about changes to the database
182
+ - **Collections**: Access information about movie collections
183
+ - **Configuration**: Retrieve configuration information for the API
184
+ - **Credits**: Get credits information for movies and TV shows
185
+ - **Discover**: Discover movies and TV shows based on various criteria
186
+ - **Find**: Find movies and TV shows by external IDs
187
+ - **Genres**: Retrieve information about movie and TV show genres
188
+ - **Keywords**: Access information about movie keywords
189
+ - **Reviews**: Get reviews for movies and TV shows
190
+ - **Search**: Search for movies, TV shows, and people
191
+ - **Trending**: Get trending movies and TV shows
192
+
193
+ ## Image Handling
194
+
195
+ The wrapper provides enhanced utilities for handling TMDB images:
196
+
197
+ ```typescript
198
+ import { getFullImagePath, ImageSizes, ImageFormats } from '@tdanks2000/tmdb-wrapper';
199
+
200
+ // Example usage for movie poster
201
+ const posterUrl = getFullImagePath(
202
+ 'https://image.tmdb.org/t/p/',
203
+ ImageSizes.W500,
204
+ '/wwemzKWzjKYJFfCeiB57q3r4Bcm',
205
+ ImageFormats.JPG
206
+ );
207
+ // Results in: https://image.tmdb.org/t/p/w500/wwemzKWzjKYJFfCeiB57q3r4Bcm.jpg
208
+
209
+ // Example usage for profile image
210
+ const profileUrl = getFullImagePath(
211
+ 'https://image.tmdb.org/t/p/',
212
+ ImageSizes.W185,
213
+ '/5XBzD5WuTyVQZeS4VI25z2moMeY.jpg',
214
+ ImageFormats.JPG
215
+ );
216
+ // Results in: https://image.tmdb.org/t/p/w185/5XBzD5WuTyVQZeS4VI25z2moMeY.jpg
217
+ ```
218
+
219
+ The utility supports all TMDB image sizes and formats:
220
+
221
+ - **Sizes**: W45, W92, W154, W185, W300, W342, W500, W780, W1280, Original
222
+ - **Formats**: JPG, PNG, SVG
223
+
224
+ ## Examples
225
+
226
+ ### Searching for Content
227
+
228
+ ```typescript
229
+ // Search for movies
230
+ const movieResults = await tmdb.search.searchMovies('Inception');
231
+
232
+ // Search for TV shows
233
+ const tvResults = await tmdb.search.searchTvShows('Breaking Bad');
234
+
235
+ // Search for people
236
+ const peopleResults = await tmdb.search.searchPeople('Brad Pitt');
237
+
238
+ // Multi-search (movies, TV shows, and people)
239
+ const multiResults = await tmdb.search.searchMulti('Marvel');
240
+ ```
241
+
242
+ ### Getting Trending Content
243
+
244
+ ```typescript
245
+ // Get trending movies (day)
246
+ const trendingMoviesDay = await tmdb.trending.getTrendingMovies('day');
247
+
248
+ // Get trending TV shows (week)
249
+ const trendingTvWeek = await tmdb.trending.getTrendingTvShows('week');
250
+
251
+ // Get trending people (day)
252
+ const trendingPeopleDay = await tmdb.trending.getTrendingPeople('day');
253
+
254
+ // Get all trending content (week)
255
+ const trendingAllWeek = await tmdb.trending.getTrendingAll('week');
256
+ ```
257
+
258
+ ### Using Discover
259
+
260
+ ```typescript
261
+ // Discover movies by genre
262
+ const actionMovies = await tmdb.discover.discoverMovies({
263
+ with_genres: '28', // Action genre ID
264
+ sort_by: 'popularity.desc'
265
+ });
266
+
267
+ // Discover TV shows by network
268
+ const netflixShows = await tmdb.discover.discoverTvShows({
269
+ with_networks: '213', // Netflix network ID
270
+ sort_by: 'vote_average.desc'
271
+ });
272
+ ```
273
+
274
+ ## Troubleshooting
275
+
276
+ ### Rate Limiting
277
+
278
+ TMDb API has rate limiting in place. If you encounter rate limiting issues, consider implementing a delay between requests or using a caching mechanism.
279
+
280
+ ```typescript
281
+ // Example of implementing a delay between requests
282
+ const delay = (ms: number) => new Promise(resolve => setTimeout(resolve, ms));
283
+
284
+ async function fetchWithDelay() {
285
+ const result1 = await tmdb.movies.getPopular();
286
+ await delay(250); // Wait 250ms between requests
287
+ const result2 = await tmdb.tvShows.getPopular();
288
+ return { movies: result1, tvShows: result2 };
289
+ }
290
+ ```
291
+
292
+ ### Authentication Issues
293
+
294
+ If you're experiencing authentication issues, ensure your API key or access token is valid and correctly formatted.
295
+
296
+ ```typescript
297
+ // Check if your token is valid
298
+ try {
299
+ const accountDetails = await tmdb.account.getDetails();
300
+ console.log('Authentication successful:', accountDetails);
301
+ } catch (error) {
302
+ console.error('Authentication failed:', error);
303
+ }
304
+ ```
305
+
306
+ ## API Reference
307
+
308
+ For a complete list of available methods and parameters, please refer to the [TMDB API Documentation](https://developers.themoviedb.org/3/getting-started/introduction).
309
+
310
+ This wrapper aims to provide a 1:1 mapping to the official TMDB API, with TypeScript types for improved developer experience.
311
+
312
+ ## Contributing
313
+
314
+ Contributions are welcome! For bug reports, feature requests, or any other questions, please open an issue on the [GitHub repository](https://github.com/tdanks2000/tmdb-wrapper).
315
+
316
+ 1. Fork the repository
317
+ 2. Create your feature branch (`git checkout -b feature/amazing-feature`)
318
+ 3. Commit your changes (`git commit -m 'Add some amazing feature'`)
319
+ 4. Push to the branch (`git push origin feature/amazing-feature`)
320
+ 5. Open a Pull Request
321
+
322
+ ## License
323
+
324
+ This project is licensed under the MIT License - see the [LICENSE](https://github.com/tdanks2000/tmdb-wrapper/blob/main/LICENSE) file for details.
325
+
326
+ <br/>
327
+
328
+ # ❤️
329
+
330
+ <p align="center">
331
+ <a target="_blank" href="https://tdanks.com/mental-health/quote">
332
+ ❤️ Reminder that <strong><i>you are great, you are enough, and your presence is valued.</i></strong> If you are struggling with your mental health, please reach out to someone you love and consult a professional. You are not alone. ❤️
333
+ </a>
334
+ </p>
@@ -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.AccountEndpoint = void 0;
13
4
  const _types_1 = require("../@types");
@@ -26,10 +17,8 @@ class AccountEndpoint extends _types_1.BaseEndpoint {
26
17
  * Retrieves account details asynchronously.
27
18
  * @returns {Promise<AccountDetails>} A Promise that resolves with the account details.
28
19
  */
29
- details() {
30
- return __awaiter(this, void 0, void 0, function* () {
31
- return yield this.api.get('/account');
32
- });
20
+ async details() {
21
+ return await this.api.get('/account');
33
22
  }
34
23
  }
35
24
  exports.AccountEndpoint = AccountEndpoint;
@@ -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.CertificationEndpoint = void 0;
13
4
  const _types_1 = require("../@types");
@@ -27,19 +18,15 @@ class CertificationEndpoint extends _types_1.BaseEndpoint {
27
18
  * Retrieves certifications for movies asynchronously.
28
19
  * @returns {Promise<Certifications>} A Promise that resolves with the certifications for movies.
29
20
  */
30
- movies() {
31
- return __awaiter(this, void 0, void 0, function* () {
32
- return yield this.api.get('/certification/movie/list');
33
- });
21
+ async movies() {
22
+ return await this.api.get('/certification/movie/list');
34
23
  }
35
24
  /**
36
25
  * Retrieves certifications for TV shows asynchronously.
37
26
  * @returns {Promise<Certifications>} A Promise that resolves with the certifications for TV shows.
38
27
  */
39
- tv() {
40
- return __awaiter(this, void 0, void 0, function* () {
41
- return yield this.api.get('/certification/tv/list');
42
- });
28
+ async tv() {
29
+ return await this.api.get('/certification/tv/list');
43
30
  }
44
31
  }
45
32
  exports.CertificationEndpoint = CertificationEndpoint;
@@ -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.ChangeEndpoint = void 0;
13
4
  const _types_1 = require("../@types");
@@ -28,30 +19,24 @@ class ChangeEndpoint extends _types_1.BaseEndpoint {
28
19
  * @param {ChangeOption} [options] - Optional parameters for filtering the changes.
29
20
  * @returns {Promise<MediaChanges>} A Promise that resolves with the changes in movies.
30
21
  */
31
- movies(options) {
32
- return __awaiter(this, void 0, void 0, function* () {
33
- return yield this.api.get('/movie/changes', options);
34
- });
22
+ async movies(options) {
23
+ return await this.api.get('/movie/changes', options);
35
24
  }
36
25
  /**
37
26
  * Retrieves changes in TV shows asynchronously.
38
27
  * @param {ChangeOption} [options] - Optional parameters for filtering the changes.
39
28
  * @returns {Promise<MediaChanges>} A Promise that resolves with the changes in TV shows.
40
29
  */
41
- tv(options) {
42
- return __awaiter(this, void 0, void 0, function* () {
43
- return yield this.api.get('/tv/changes', options);
44
- });
30
+ async tv(options) {
31
+ return await this.api.get('/tv/changes', options);
45
32
  }
46
33
  /**
47
34
  * Retrieves changes related to persons asynchronously.
48
35
  * @param {ChangeOption} [options] - Optional parameters for filtering the changes.
49
36
  * @returns {Promise<MediaChanges>} A Promise that resolves with the changes related to persons.
50
37
  */
51
- person(options) {
52
- return __awaiter(this, void 0, void 0, function* () {
53
- return yield this.api.get('/person/change', options);
54
- });
38
+ async person(options) {
39
+ return await this.api.get('/person/change', options);
55
40
  }
56
41
  }
57
42
  exports.ChangeEndpoint = ChangeEndpoint;
@@ -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.CollectionsEndpoint = void 0;
13
4
  const _types_1 = require("../@types");
@@ -30,10 +21,8 @@ class CollectionsEndpoint extends _types_1.BaseEndpoint {
30
21
  * @param {LanguageOption} [options] - Optional parameters for specifying the language.
31
22
  * @returns {Promise<DetailedCollection>} A Promise that resolves with the detailed information of the collection.
32
23
  */
33
- details(id, options) {
34
- return __awaiter(this, void 0, void 0, function* () {
35
- return yield this.api.get(`${BASE_COLLECTION}/${id}`, options);
36
- });
24
+ async details(id, options) {
25
+ return await this.api.get(`${BASE_COLLECTION}/${id}`, options);
37
26
  }
38
27
  /**
39
28
  * Retrieves images associated with a specific collection asynchronously.
@@ -41,15 +30,12 @@ class CollectionsEndpoint extends _types_1.BaseEndpoint {
41
30
  * @param {CollectionImageOptions} [options] - Optional parameters for specifying image options.
42
31
  * @returns {Promise<ImageCollection>} A Promise that resolves with the collection images.
43
32
  */
44
- images(id, options) {
45
- var _a;
46
- return __awaiter(this, void 0, void 0, function* () {
47
- const computedOptions = {
48
- include_image_language: (_a = options === null || options === void 0 ? void 0 : options.include_image_language) === null || _a === void 0 ? void 0 : _a.join(','),
49
- language: options === null || options === void 0 ? void 0 : options.language,
50
- };
51
- return yield this.api.get(`${BASE_COLLECTION}/${id}/images`, computedOptions);
52
- });
33
+ async images(id, options) {
34
+ const computedOptions = {
35
+ include_image_language: options?.include_image_language?.join(','),
36
+ language: options?.language,
37
+ };
38
+ return await this.api.get(`${BASE_COLLECTION}/${id}/images`, computedOptions);
53
39
  }
54
40
  /**
55
41
  * Retrieves translations for a specific collection asynchronously.
@@ -57,10 +43,8 @@ class CollectionsEndpoint extends _types_1.BaseEndpoint {
57
43
  * @param {LanguageOption} [options] - Optional parameters for specifying the language.
58
44
  * @returns {Promise<Translations>} A Promise that resolves with the translations of the collection.
59
45
  */
60
- translations(id, options) {
61
- return __awaiter(this, void 0, void 0, function* () {
62
- return yield this.api.get(`${BASE_COLLECTION}/${id}/translations`, options);
63
- });
46
+ async translations(id, options) {
47
+ return await this.api.get(`${BASE_COLLECTION}/${id}/translations`, options);
64
48
  }
65
49
  }
66
50
  exports.CollectionsEndpoint = CollectionsEndpoint;