@lorenzopant/tmdb 1.21.0 → 1.21.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.
package/dist/index.d.mts CHANGED
@@ -2237,7 +2237,7 @@ type MovieDetails = {
2237
2237
  /**
2238
2238
  * Available endpoints that can be appended to movie details requests
2239
2239
  */
2240
- type MovieAppendToResponseNamespace = "alternative_titles" | "changes" | "credits" | "external_ids" | "images" | "keywords" | "recommendations" | "release_dates" | "reviews" | "similar" | "translations" | "videos";
2240
+ type MovieAppendToResponseNamespace = "alternative_titles" | "changes" | "credits" | "external_ids" | "images" | "keywords" | "recommendations" | "release_dates" | "reviews" | "similar" | "translations" | "videos" | "watch/providers";
2241
2241
  /**
2242
2242
  * Mapping of append-to-response keys to their return types
2243
2243
  */
@@ -2254,6 +2254,7 @@ type MovieAppendableMap = {
2254
2254
  similar: MovieSimilar;
2255
2255
  translations: MovieTranslations;
2256
2256
  videos: MovieVideos;
2257
+ "watch/providers": MovieWatchProviders;
2257
2258
  };
2258
2259
  /**
2259
2260
  * Movie details with additional appended data
@@ -2288,7 +2289,8 @@ type MovieCredits = {
2288
2289
  */
2289
2290
  type MovieExternalIDs = {
2290
2291
  /** Movie identifier in TMDB */id: number; /** IMDb identifier (e.g., "tt0133093"), null if not available */
2291
- imdb_id?: string; /** Facebook page identifier, null if not available */
2292
+ imdb_id?: string; /** Wikidata identifier (e.g., "Q190050"), null if not available */
2293
+ wikidata_id?: string; /** Facebook page identifier, null if not available */
2292
2294
  facebook_id?: string; /** Twitter/X handle, null if not available */
2293
2295
  twitter_id?: string; /** Instagram handle, null if not available */
2294
2296
  instagram_id?: string;
@@ -2359,6 +2361,12 @@ type MovieTranslationData = {
2359
2361
  * Collection of videos (trailers, teasers, clips) for a movie
2360
2362
  */
2361
2363
  type MovieVideos = VideoResults;
2364
+ /**
2365
+ * Watch provider availability for a movie across different countries
2366
+ */
2367
+ type MovieWatchProviders = {
2368
+ results: Record<CountryISO3166_1, WatchProvider>;
2369
+ };
2362
2370
  /**
2363
2371
  * Parameters for movie list endpoints (popular, top rated, now playing, upcoming).
2364
2372
  */
@@ -6171,4 +6179,4 @@ type PageInfo = {
6171
6179
  */
6172
6180
  declare function getPageInfo(response: PaginatedResponse<unknown>): PageInfo;
6173
6181
  //#endregion
6174
- export { AccountAPI, AccountAddFavoriteBody, AccountAddToWatchlistBody, AccountAvatar, AccountDetails, AccountDetailsParams, AccountListItem, AccountListsParams, AccountListsResponse, AccountMediaListParams, AccountMovieItem, AccountMovieListResponse, AccountMutationParams, AccountMutationResponse, AccountRatedEpisodeItem, AccountRatedEpisodesResponse, AccountRatedMovieItem, AccountRatedMoviesResponse, AccountRatedTVItem, AccountRatedTVResponse, AccountSortBy, AccountTVItem, AccountTVListResponse, AlternativeName, AlternativeNamesResult, AlternativeTitle, AuthCreateSessionBody, AuthCreateSessionResponse, AuthCreateSessionWithLoginBody, AuthDeleteSessionBody, AuthDeleteSessionResponse, AuthGuestSessionResponse, AuthRequestTokenResponse, AuthValidateKeyResponse, AuthenticationAPI, BACKDROP_SIZES, BackdropSize, Cast, CertificationItem, Certifications, CertificationsAPI, Change, ChangeItem, ChangeResultItem, Changes, ChangesAPI, Collection, CollectionBaseParam, CollectionDetailsParams, CollectionImages, CollectionImagesParams, CollectionItem, CollectionResultItem, CollectionTranslationData, CollectionTranslations, CollectionsAPI, CompaniesAPI, Company, CompanyAlternativeName, CompanyAlternativeNames, CompanyAlternativeNamesParams, CompanyBaseParam, CompanyDetailsParams, CompanyImages, CompanyImagesParams, CompanyResultItem, CompanySummary, ConfigurationAPI, ConfigurationCountriesParams, ConfigurationCountry, ConfigurationJob, ConfigurationLanguage, ConfigurationResponse, ConfigurationTimezone, ContentRating, CountryISO3166_1, Credit, CreditBaseParam, CreditDetails, CreditDetailsMedia, CreditDetailsMovieMedia, CreditDetailsParams, CreditDetailsPerson, CreditDetailsTVEpisode, CreditDetailsTVMedia, CreditDetailsTVSeason, CreditsAPI, Crew, DateRange, DefaultImageSizesConfig, DiscoverAPI, DiscoverFilterExpression, DiscoverMovieParams, DiscoverMovieSortBy, DiscoverTVParams, DiscoverTVResultItem, DiscoverTVSortBy, DiscoverTVStatus, DiscoverTVType, FetchAllPagesOptions, FileType, FindAPI, FindByIDParams, FindExternalSource, FindMovieResultItem, FindPersonResultItem, FindResults, FindTVEpisodeResultItem, FindTVResultItem, FindTVSeasonResultItem, Genre, GenresAPI, GenresResponse, GuestSessionRatedEpisodesResponse, GuestSessionRatedMoviesResponse, GuestSessionRatedParams, GuestSessionRatedTVResponse, GuestSessionsAPI, IMAGE_BASE_URL, IMAGE_SECURE_BASE_URL, ImageCollectionKey, ImageConfiguration, ImageItem, ImageLanguagePriorityConfig, ImageSize, ImageSizeTypes, ImagesConfig, ImagesResult, Keyword, KeywordBaseParam, KeywordDetailsParams, KeywordMoviesParams, KeywordResultItem, KeywordsAPI, KnownForItem, KnownForMovie, KnownForTV, LOGO_SIZES, Language, LanguageISO6391, ListClearParams, ListCreateBody, ListCreateParams, ListCreateResponse, ListDetails, ListDetailsParams, ListItem, ListItemStatusParams, ListItemStatusResponse, ListMovieBody, ListMutationParams, ListMutationResponse, ListsAPI, LiteralUnion, LogoSize, MediaType, MediaWatchProviders, MovieAlternativeTitles, MovieAlternativeTitlesParams, MovieAppendToResponseNamespace, MovieAppendableMap, MovieChanges, MovieChangesParams, MovieCollection, MovieCredits, MovieCreditsParams, MovieDetails, MovieDetailsParams, MovieDetailsWithAppends, MovieExternalIDs, MovieExternalIDsParams, MovieImages, MovieImagesParams, MovieKeywords, MovieKeywordsParams, MovieListParams, MovieListsAPI, MovieRecommendations, MovieRecommendationsParams, MovieReleaseDate, MovieReleaseDateResult, MovieReleaseDates, MovieReleaseDatesParams, MovieResultItem, MovieReviews, MovieReviewsParams, MovieSimilar, MovieSimilarParams, MovieTranslationData, MovieTranslations, MovieTranslationsParams, MovieVideos, MovieVideosParams, MovieWatchProvidersParams, MoviesAPI, MultiSearchResultItem, Network, NetworkBaseParams, NetworkImages, NetworkItem, NetworksAPI, OrganizationImage, POSTER_SIZES, PROFILE_SIZES, PageInfo, PaginatedResponse, PeopleAPI, PeopleListParams, PeopleListsAPI, PersonAppendToResponseNamespace, PersonAppendableMap, PersonBaseParam, PersonChanges, PersonChangesParams, PersonCombinedCastCredit, PersonCombinedCredits, PersonCombinedCrewCredit, PersonCreditsParams, PersonDetails, PersonDetailsParams, PersonDetailsWithAppends, PersonExternalIDs, PersonExternalIDsParams, PersonImages, PersonImagesParams, PersonMovieCastCredit, PersonMovieCredits, PersonMovieCrewCredit, PersonResultItem, PersonTVCastCredit, PersonTVCredits, PersonTVCrewCredit, PersonTaggedImage, PersonTaggedImageMedia, PersonTaggedImages, PersonTaggedImagesParams, PersonTranslationData, PersonTranslations, PersonTranslationsParams, PosterSize, Prettify, PrimaryTranslations, ProductionCompany, ProductionCountry, ProfileSize, RequestInterceptor, RequestInterceptorContext, ResponseErrorInterceptor, ResponseSuccessInterceptor, RetryOptions, Review, ReviewAuthorDetails, ReviewDetails, ReviewDetailsParams, ReviewsAPI, STILL_SIZES, SearchAPI, SearchCollectionsParams, SearchCompanyParams, SearchKeywordsParams, SearchMoviesParams, SearchMultiParams, SearchPersonParams, SearchTVSeriesParams, SpokenLanguage, StillSize, TMDB, TMDBCountries, TMDBError, TMDBLogger, TMDBLoggerEntry, TMDBLoggerFn, TMDBOptions, TMDBQueryParams, TMDBv4, TVAggregateCredits, TVAggregateCreditsCastItem, TVAggregateCreditsCrewItem, TVAggregateCreditsParams, TVAlternativeTitles, TVAppendToResponseNamespace, TVAppendableMap, TVBaseParam, TVChangeParams, TVContentRatings, TVCreditJob, TVCreditRole, TVCredits, TVCreditsParams, TVDetailsParams, TVDetailsWithAppends, TVEpisode, TVEpisodeAppendToResponseNamespace, TVEpisodeAppendableMap, TVEpisodeBaseParams, TVEpisodeCredits, TVEpisodeCreditsParams, TVEpisodeDetailsParams, TVEpisodeDetailsWithAppends, TVEpisodeExternalIDs, TVEpisodeGroupDetails, TVEpisodeGroupDetailsItem, TVEpisodeGroupEpisode, TVEpisodeGroupItem, TVEpisodeGroupParams, TVEpisodeGroupType, TVEpisodeGroups, TVEpisodeGroupsAPI, TVEpisodeId, TVEpisodeImages, TVEpisodeImagesParams, TVEpisodeItem, TVEpisodeTranslationData, TVEpisodeTranslations, TVEpisodeVideos, TVEpisodesAPI, TVExternalIDs, TVImageItem, TVImages, TVImagesParams, TVKeywords, TVRecommendations, TVRecommendationsParams, TVReviews, TVReviewsParams, TVScreenedTheatrically, TVScreeningItem, TVSeason, TVSeasonAggregateCredits, TVSeasonAggregateCreditsParams, TVSeasonAppendToResponseNamespace, TVSeasonAppendableMap, TVSeasonBaseParams, TVSeasonChanges, TVSeasonChangesParams, TVSeasonCredits, TVSeasonCreditsParams, TVSeasonDetailsParams, TVSeasonDetailsWithAppends, TVSeasonEpisode, TVSeasonExternalIDs, TVSeasonId, TVSeasonImages, TVSeasonImagesParams, TVSeasonItem, TVSeasonTranslationData, TVSeasonTranslations, TVSeasonVideos, TVSeasonVideosParams, TVSeasonWatchProvidersParams, TVSeasonsAPI, TVSeriesAPI, TVSeriesChanges, TVSeriesDetails, TVSeriesListItem, TVSeriesListParams, TVSeriesLists, TVSeriesListsAPI, TVSeriesListsParams, TVSeriesResultItem, TVSimilar, TVSimilarParams, TVTranslationData, TVTranslations, TVVideos, Timezone, Translation, TranslationResults, TrendingAPI, TrendingAllResult, TrendingMovieResult, TrendingParams, TrendingPersonResult, TrendingTVResult, TrendingTimeWindow, V4AccountAPI, V4AddListItemsBody, V4AddListItemsResponse, V4AuthAPI, V4AuthAccessTokenResponse, V4AuthCreateAccessTokenBody, V4AuthCreateRequestTokenBody, V4AuthDeleteAccessTokenBody, V4AuthDeleteAccessTokenResponse, V4AuthRequestTokenResponse, V4CreateListBody, V4CreateListResponse, V4DeleteListParams, V4ListDetails, V4ListDetailsParams, V4ListItemInput, V4ListItemResult, V4ListItemStatusParams, V4ListItemStatusResponse, V4ListMediaType, V4ListResult, V4ListStatusResponse, V4ListsAPI, V4RemoveListItemsBody, V4UpdateListBody, V4UpdateListItemsBody, V4UpdateListItemsResponse, VideoItem, VideoResults, WatchMonetizationType, WatchProvider, WatchProviderDisplayPriorities, WatchProviderItem, WatchProviderListItem, WatchProviderListParams, WatchProviderListResponse, WatchProviderRegionsParams, WatchProviderRegionsResponse, WatchProvidersAPI, WithLanguage, WithLanguagePage, WithPage, WithPageAndDateRange, WithParams, WithRegion, fetchAllPages, getPageInfo, hasBackdropPath, hasLogoPath, hasNextPage, hasPosterPath, hasPreviousPage, hasProfilePath, hasStillPath, isJwt, isKnownForMovie, isKnownForTV, isPlainObject, isRecord, paginate };
6182
+ export { AccountAPI, AccountAddFavoriteBody, AccountAddToWatchlistBody, AccountAvatar, AccountDetails, AccountDetailsParams, AccountListItem, AccountListsParams, AccountListsResponse, AccountMediaListParams, AccountMovieItem, AccountMovieListResponse, AccountMutationParams, AccountMutationResponse, AccountRatedEpisodeItem, AccountRatedEpisodesResponse, AccountRatedMovieItem, AccountRatedMoviesResponse, AccountRatedTVItem, AccountRatedTVResponse, AccountSortBy, AccountTVItem, AccountTVListResponse, AlternativeName, AlternativeNamesResult, AlternativeTitle, AuthCreateSessionBody, AuthCreateSessionResponse, AuthCreateSessionWithLoginBody, AuthDeleteSessionBody, AuthDeleteSessionResponse, AuthGuestSessionResponse, AuthRequestTokenResponse, AuthValidateKeyResponse, AuthenticationAPI, BACKDROP_SIZES, BackdropSize, Cast, CertificationItem, Certifications, CertificationsAPI, Change, ChangeItem, ChangeResultItem, Changes, ChangesAPI, Collection, CollectionBaseParam, CollectionDetailsParams, CollectionImages, CollectionImagesParams, CollectionItem, CollectionResultItem, CollectionTranslationData, CollectionTranslations, CollectionsAPI, CompaniesAPI, Company, CompanyAlternativeName, CompanyAlternativeNames, CompanyAlternativeNamesParams, CompanyBaseParam, CompanyDetailsParams, CompanyImages, CompanyImagesParams, CompanyResultItem, CompanySummary, ConfigurationAPI, ConfigurationCountriesParams, ConfigurationCountry, ConfigurationJob, ConfigurationLanguage, ConfigurationResponse, ConfigurationTimezone, ContentRating, CountryISO3166_1, Credit, CreditBaseParam, CreditDetails, CreditDetailsMedia, CreditDetailsMovieMedia, CreditDetailsParams, CreditDetailsPerson, CreditDetailsTVEpisode, CreditDetailsTVMedia, CreditDetailsTVSeason, CreditsAPI, Crew, DateRange, DefaultImageSizesConfig, DiscoverAPI, DiscoverFilterExpression, DiscoverMovieParams, DiscoverMovieSortBy, DiscoverTVParams, DiscoverTVResultItem, DiscoverTVSortBy, DiscoverTVStatus, DiscoverTVType, FetchAllPagesOptions, FileType, FindAPI, FindByIDParams, FindExternalSource, FindMovieResultItem, FindPersonResultItem, FindResults, FindTVEpisodeResultItem, FindTVResultItem, FindTVSeasonResultItem, Genre, GenresAPI, GenresResponse, GuestSessionRatedEpisodesResponse, GuestSessionRatedMoviesResponse, GuestSessionRatedParams, GuestSessionRatedTVResponse, GuestSessionsAPI, IMAGE_BASE_URL, IMAGE_SECURE_BASE_URL, ImageCollectionKey, ImageConfiguration, ImageItem, ImageLanguagePriorityConfig, ImageSize, ImageSizeTypes, ImagesConfig, ImagesResult, Keyword, KeywordBaseParam, KeywordDetailsParams, KeywordMoviesParams, KeywordResultItem, KeywordsAPI, KnownForItem, KnownForMovie, KnownForTV, LOGO_SIZES, Language, LanguageISO6391, ListClearParams, ListCreateBody, ListCreateParams, ListCreateResponse, ListDetails, ListDetailsParams, ListItem, ListItemStatusParams, ListItemStatusResponse, ListMovieBody, ListMutationParams, ListMutationResponse, ListsAPI, LiteralUnion, LogoSize, MediaType, MediaWatchProviders, MovieAlternativeTitles, MovieAlternativeTitlesParams, MovieAppendToResponseNamespace, MovieAppendableMap, MovieChanges, MovieChangesParams, MovieCollection, MovieCredits, MovieCreditsParams, MovieDetails, MovieDetailsParams, MovieDetailsWithAppends, MovieExternalIDs, MovieExternalIDsParams, MovieImages, MovieImagesParams, MovieKeywords, MovieKeywordsParams, MovieListParams, MovieListsAPI, MovieRecommendations, MovieRecommendationsParams, MovieReleaseDate, MovieReleaseDateResult, MovieReleaseDates, MovieReleaseDatesParams, MovieResultItem, MovieReviews, MovieReviewsParams, MovieSimilar, MovieSimilarParams, MovieTranslationData, MovieTranslations, MovieTranslationsParams, MovieVideos, MovieVideosParams, MovieWatchProviders, MovieWatchProvidersParams, MoviesAPI, MultiSearchResultItem, Network, NetworkBaseParams, NetworkImages, NetworkItem, NetworksAPI, OrganizationImage, POSTER_SIZES, PROFILE_SIZES, PageInfo, PaginatedResponse, PeopleAPI, PeopleListParams, PeopleListsAPI, PersonAppendToResponseNamespace, PersonAppendableMap, PersonBaseParam, PersonChanges, PersonChangesParams, PersonCombinedCastCredit, PersonCombinedCredits, PersonCombinedCrewCredit, PersonCreditsParams, PersonDetails, PersonDetailsParams, PersonDetailsWithAppends, PersonExternalIDs, PersonExternalIDsParams, PersonImages, PersonImagesParams, PersonMovieCastCredit, PersonMovieCredits, PersonMovieCrewCredit, PersonResultItem, PersonTVCastCredit, PersonTVCredits, PersonTVCrewCredit, PersonTaggedImage, PersonTaggedImageMedia, PersonTaggedImages, PersonTaggedImagesParams, PersonTranslationData, PersonTranslations, PersonTranslationsParams, PosterSize, Prettify, PrimaryTranslations, ProductionCompany, ProductionCountry, ProfileSize, RequestInterceptor, RequestInterceptorContext, ResponseErrorInterceptor, ResponseSuccessInterceptor, RetryOptions, Review, ReviewAuthorDetails, ReviewDetails, ReviewDetailsParams, ReviewsAPI, STILL_SIZES, SearchAPI, SearchCollectionsParams, SearchCompanyParams, SearchKeywordsParams, SearchMoviesParams, SearchMultiParams, SearchPersonParams, SearchTVSeriesParams, SpokenLanguage, StillSize, TMDB, TMDBCountries, TMDBError, TMDBLogger, TMDBLoggerEntry, TMDBLoggerFn, TMDBOptions, TMDBQueryParams, TMDBv4, TVAggregateCredits, TVAggregateCreditsCastItem, TVAggregateCreditsCrewItem, TVAggregateCreditsParams, TVAlternativeTitles, TVAppendToResponseNamespace, TVAppendableMap, TVBaseParam, TVChangeParams, TVContentRatings, TVCreditJob, TVCreditRole, TVCredits, TVCreditsParams, TVDetailsParams, TVDetailsWithAppends, TVEpisode, TVEpisodeAppendToResponseNamespace, TVEpisodeAppendableMap, TVEpisodeBaseParams, TVEpisodeCredits, TVEpisodeCreditsParams, TVEpisodeDetailsParams, TVEpisodeDetailsWithAppends, TVEpisodeExternalIDs, TVEpisodeGroupDetails, TVEpisodeGroupDetailsItem, TVEpisodeGroupEpisode, TVEpisodeGroupItem, TVEpisodeGroupParams, TVEpisodeGroupType, TVEpisodeGroups, TVEpisodeGroupsAPI, TVEpisodeId, TVEpisodeImages, TVEpisodeImagesParams, TVEpisodeItem, TVEpisodeTranslationData, TVEpisodeTranslations, TVEpisodeVideos, TVEpisodesAPI, TVExternalIDs, TVImageItem, TVImages, TVImagesParams, TVKeywords, TVRecommendations, TVRecommendationsParams, TVReviews, TVReviewsParams, TVScreenedTheatrically, TVScreeningItem, TVSeason, TVSeasonAggregateCredits, TVSeasonAggregateCreditsParams, TVSeasonAppendToResponseNamespace, TVSeasonAppendableMap, TVSeasonBaseParams, TVSeasonChanges, TVSeasonChangesParams, TVSeasonCredits, TVSeasonCreditsParams, TVSeasonDetailsParams, TVSeasonDetailsWithAppends, TVSeasonEpisode, TVSeasonExternalIDs, TVSeasonId, TVSeasonImages, TVSeasonImagesParams, TVSeasonItem, TVSeasonTranslationData, TVSeasonTranslations, TVSeasonVideos, TVSeasonVideosParams, TVSeasonWatchProvidersParams, TVSeasonsAPI, TVSeriesAPI, TVSeriesChanges, TVSeriesDetails, TVSeriesListItem, TVSeriesListParams, TVSeriesLists, TVSeriesListsAPI, TVSeriesListsParams, TVSeriesResultItem, TVSimilar, TVSimilarParams, TVTranslationData, TVTranslations, TVVideos, Timezone, Translation, TranslationResults, TrendingAPI, TrendingAllResult, TrendingMovieResult, TrendingParams, TrendingPersonResult, TrendingTVResult, TrendingTimeWindow, V4AccountAPI, V4AddListItemsBody, V4AddListItemsResponse, V4AuthAPI, V4AuthAccessTokenResponse, V4AuthCreateAccessTokenBody, V4AuthCreateRequestTokenBody, V4AuthDeleteAccessTokenBody, V4AuthDeleteAccessTokenResponse, V4AuthRequestTokenResponse, V4CreateListBody, V4CreateListResponse, V4DeleteListParams, V4ListDetails, V4ListDetailsParams, V4ListItemInput, V4ListItemResult, V4ListItemStatusParams, V4ListItemStatusResponse, V4ListMediaType, V4ListResult, V4ListStatusResponse, V4ListsAPI, V4RemoveListItemsBody, V4UpdateListBody, V4UpdateListItemsBody, V4UpdateListItemsResponse, VideoItem, VideoResults, WatchMonetizationType, WatchProvider, WatchProviderDisplayPriorities, WatchProviderItem, WatchProviderListItem, WatchProviderListParams, WatchProviderListResponse, WatchProviderRegionsParams, WatchProviderRegionsResponse, WatchProvidersAPI, WithLanguage, WithLanguagePage, WithPage, WithPageAndDateRange, WithParams, WithRegion, fetchAllPages, getPageInfo, hasBackdropPath, hasLogoPath, hasNextPage, hasPosterPath, hasPreviousPage, hasProfilePath, hasStillPath, isJwt, isKnownForMovie, isKnownForTV, isPlainObject, isRecord, paginate };
package/llms-full.txt ADDED
@@ -0,0 +1,316 @@
1
+ # @lorenzopant/tmdb
2
+
3
+ `@lorenzopant/tmdb` is a fully typed TypeScript SDK for The Movie Database (TMDB) API. It wraps TMDB v3 endpoints in a single `TMDB` client and exposes TMDB v4 auth/account/list APIs through `tmdb.v4` when the client is created with a JWT bearer token.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install @lorenzopant/tmdb
9
+ ```
10
+
11
+ ## Primary entrypoints
12
+
13
+ ```ts
14
+ import { TMDB, TMDBError } from "@lorenzopant/tmdb";
15
+ ```
16
+
17
+ Main public exports include:
18
+ - `TMDB`
19
+ - `TMDBv4`
20
+ - `TMDBError`
21
+ - Standalone endpoint classes such as `MoviesAPI`, `SearchAPI`, `GenresAPI`, `PeopleAPI`, `ListsAPI`, `AuthenticationAPI`, `V4AuthAPI`, `V4AccountAPI`, and `V4ListsAPI`
22
+ - Package types via the root entrypoint and `@lorenzopant/tmdb/types`
23
+ - Utility exports from `@lorenzopant/tmdb`, including pagination helpers and retry types
24
+
25
+ ## Quick start
26
+
27
+ ```ts
28
+ import { TMDB } from "@lorenzopant/tmdb";
29
+
30
+ const tmdb = new TMDB(process.env.TMDB_ACCESS_TOKEN!, {
31
+ language: "en-US",
32
+ region: "US",
33
+ });
34
+
35
+ const movie = await tmdb.movies.details({ movie_id: 550 });
36
+ console.log(movie.title);
37
+ ```
38
+
39
+ ## Constructor
40
+
41
+ ```ts
42
+ const tmdb = new TMDB(accessToken, options?);
43
+ ```
44
+
45
+ `accessToken` is required. Supported options include:
46
+ - `language`: default ISO 639-1 language for requests
47
+ - `region`: default ISO 3166-1 region
48
+ - `timezone`: default timezone for supported TV queries
49
+ - `images`: image URL behavior and image-language prioritization
50
+ - `logger`: `true` for built-in logging or a custom logger function
51
+ - `deduplication`: defaults to `true`
52
+ - `interceptors`: request and response hooks
53
+ - `rate_limit`: `true` or `{ max_requests, per_ms }`
54
+ - `retry`: `true` or a `RetryOptions` object
55
+ - `cache`: `true` or a cache options object
56
+
57
+ Important defaults and constraints:
58
+ - `deduplication` is on by default
59
+ - `cache`, `retry`, and `rate_limit` are off by default
60
+ - `tmdb.v4` requires a JWT bearer token and throws if the client was created with a non-JWT token
61
+ - `tmdb.cache` is only available when caching is enabled
62
+
63
+ ## Namespaces
64
+
65
+ The `TMDB` instance exposes modular namespaces that map closely to TMDB APIs:
66
+ - `movies`
67
+ - `movie_lists`
68
+ - `tv_series`
69
+ - `tv_lists`
70
+ - `tv_seasons`
71
+ - `tv_episodes`
72
+ - `tv_episode_groups`
73
+ - `search`
74
+ - `discover`
75
+ - `trending`
76
+ - `people`
77
+ - `people_lists`
78
+ - `collections`
79
+ - `companies`
80
+ - `networks`
81
+ - `genres`
82
+ - `keywords`
83
+ - `reviews`
84
+ - `credits`
85
+ - `configuration`
86
+ - `changes`
87
+ - `find`
88
+ - `watch_providers`
89
+ - `authentication`
90
+ - `account`
91
+ - `guest_sessions`
92
+ - `lists`
93
+ - `images`
94
+ - `v4`
95
+
96
+ The `tmdb.v4` namespace exposes:
97
+ - `tmdb.v4.auth`
98
+ - `tmdb.v4.account`
99
+ - `tmdb.v4.lists`
100
+
101
+ ## Common usage patterns
102
+
103
+ ### Fetch a movie
104
+
105
+ ```ts
106
+ const movie = await tmdb.movies.details({ movie_id: 550 });
107
+ console.log(movie.title);
108
+ ```
109
+
110
+ ### Search
111
+
112
+ ```ts
113
+ const results = await tmdb.search.movies({
114
+ query: "Inception",
115
+ page: 1,
116
+ language: "en-US",
117
+ });
118
+ ```
119
+
120
+ ### Discover
121
+
122
+ ```ts
123
+ const response = await tmdb.discover.movies({
124
+ with_genres: "28",
125
+ sort_by: "vote_average.desc",
126
+ "vote_count.gte": 1000,
127
+ });
128
+ ```
129
+
130
+ ### TV series and seasons
131
+
132
+ ```ts
133
+ const show = await tmdb.tv_series.details({ series_id: 1396 });
134
+ const season = await tmdb.tv_seasons.details({
135
+ series_id: 1396,
136
+ season_number: 1,
137
+ });
138
+ ```
139
+
140
+ ### Append related resources
141
+
142
+ ```ts
143
+ const movie = await tmdb.movies.details({
144
+ movie_id: 550,
145
+ append_to_response: ["credits", "videos"],
146
+ });
147
+
148
+ console.log(movie.credits.cast[0]?.name);
149
+ console.log(movie.videos.results[0]?.key);
150
+ ```
151
+
152
+ ### Build image URLs
153
+
154
+ ```ts
155
+ const movie = await tmdb.movies.details({ movie_id: 550 });
156
+
157
+ const posterUrl = tmdb.images.poster(movie.poster_path!, "w500");
158
+ const backdropUrl = tmdb.images.backdrop(movie.backdrop_path!, "w1280");
159
+ ```
160
+
161
+ ### Auto-enrich image paths in API responses
162
+
163
+ ```ts
164
+ const tmdb = new TMDB(token, {
165
+ images: {
166
+ autocomplete_paths: true,
167
+ default_image_sizes: { posters: "original" },
168
+ },
169
+ });
170
+ ```
171
+
172
+ ### Paginate through any paginated endpoint
173
+
174
+ ```ts
175
+ import { paginate, fetchAllPages, getPageInfo } from "@lorenzopant/tmdb";
176
+
177
+ for await (const page of paginate((p) => tmdb.search.movies({ query: "batman", page: p }))) {
178
+ console.log(getPageInfo(page));
179
+ }
180
+
181
+ const movies = await fetchAllPages((p) => tmdb.movie_lists.now_playing({ page: p }), {
182
+ maxPages: 3,
183
+ deduplicateBy: (movie) => movie.id,
184
+ });
185
+ ```
186
+
187
+ ### Retry transient failures
188
+
189
+ ```ts
190
+ const tmdb = new TMDB(token, { retry: true });
191
+ ```
192
+
193
+ Custom retry:
194
+
195
+ ```ts
196
+ import { TMDB, TMDBError } from "@lorenzopant/tmdb";
197
+
198
+ const tmdb = new TMDB(token, {
199
+ retry: {
200
+ max_retries: 5,
201
+ base_delay_ms: 200,
202
+ shouldRetry: (error, attempt) => {
203
+ if (error instanceof TMDBError) return error.http_status_code >= 500 || error.http_status_code === 429;
204
+ return attempt <= 2;
205
+ },
206
+ },
207
+ });
208
+ ```
209
+
210
+ ### Enable in-memory caching
211
+
212
+ ```ts
213
+ const tmdb = new TMDB(token, {
214
+ cache: {
215
+ ttl: 60_000,
216
+ max_size: 500,
217
+ },
218
+ });
219
+
220
+ tmdb.cache?.invalidate("/movie/now_playing");
221
+ tmdb.cache?.clear();
222
+ console.log(tmdb.cache?.size);
223
+ ```
224
+
225
+ ### Enable rate limiting
226
+
227
+ ```ts
228
+ const tmdb = new TMDB(token, {
229
+ rate_limit: { max_requests: 20, per_ms: 1_000 },
230
+ });
231
+ ```
232
+
233
+ ### Add interceptors
234
+
235
+ ```ts
236
+ const tmdb = new TMDB(token, {
237
+ interceptors: {
238
+ request: (ctx) => ({
239
+ ...ctx,
240
+ params: { ...ctx.params, include_adult: false },
241
+ }),
242
+ response: {
243
+ onError: (error) => {
244
+ console.error(error.message);
245
+ },
246
+ },
247
+ },
248
+ });
249
+ ```
250
+
251
+ ### Handle errors
252
+
253
+ ```ts
254
+ import { TMDB, TMDBError } from "@lorenzopant/tmdb";
255
+
256
+ try {
257
+ await tmdb.movies.details({ movie_id: 0 });
258
+ } catch (error) {
259
+ if (error instanceof TMDBError) {
260
+ console.error(error.message);
261
+ console.error(error.http_status_code);
262
+ console.error(error.tmdb_status_code);
263
+ }
264
+ }
265
+ ```
266
+
267
+ ## v4 usage
268
+
269
+ Use `tmdb.v4` only when the `TMDB` instance was created with a JWT bearer token.
270
+
271
+ ```ts
272
+ const { request_token } = await tmdb.v4.auth.create_request_token({
273
+ redirect_to: "https://yourapp.com/callback",
274
+ });
275
+
276
+ const { access_token, account_id } = await tmdb.v4.auth.create_access_token({
277
+ request_token,
278
+ });
279
+
280
+ const profile = await tmdb.v4.account.details(account_id);
281
+
282
+ const list = await tmdb.v4.lists.create({
283
+ name: "My list",
284
+ iso_639_1: "en",
285
+ });
286
+ ```
287
+
288
+ ## Package behavior summary
289
+
290
+ - Strong typing is a primary goal; endpoint params and responses are exported as TypeScript types
291
+ - The client groups endpoints by domain instead of exposing a generic low-level fetch wrapper
292
+ - Standalone endpoint classes are also exported if you do not want the full `TMDB` aggregator
293
+ - Image URL helpers are available even when you do not call an API endpoint
294
+ - Pagination helpers are exported separately and can wrap any paginated method
295
+ - Cache only applies to `GET` requests
296
+ - Response interceptors cannot suppress thrown `TMDBError` values
297
+
298
+ ## Best practices for AI agents and code generators
299
+
300
+ - Prefer `new TMDB(token, options)` unless there is a strong reason to instantiate standalone endpoint classes
301
+ - Use `tmdb.v4` only when you know the token is a JWT bearer token
302
+ - When showing examples, prefer real namespace names from the package such as `movie_lists`, `tv_series`, `tv_lists`, and `watch_providers`
303
+ - For bulk reads, consider `rate_limit`, `retry`, `cache`, and pagination helpers together
304
+ - For image URLs, use `tmdb.images.poster(...)`, `backdrop(...)`, `profile(...)`, `logo(...)`, or `still(...)`
305
+ - For localized data, set `language`, `region`, and `timezone` at the client level when appropriate
306
+
307
+ ## Documentation links
308
+
309
+ - Docs home: https://lorenzopant-tmdb-docs.vercel.app/docs
310
+ - Getting started: https://lorenzopant-tmdb-docs.vercel.app/docs/getting-started
311
+ - Authentication guide: https://lorenzopant-tmdb-docs.vercel.app/docs/getting-started/authentication
312
+ - Pagination guide: https://lorenzopant-tmdb-docs.vercel.app/docs/getting-started/pagination
313
+ - Options reference: https://lorenzopant-tmdb-docs.vercel.app/docs/getting-started/options
314
+ - API reference index: https://lorenzopant-tmdb-docs.vercel.app/docs/api-reference
315
+ - Types index: https://lorenzopant-tmdb-docs.vercel.app/docs/types
316
+ - Changelog: https://lorenzopant-tmdb-docs.vercel.app/docs/changelog
package/llms.txt ADDED
@@ -0,0 +1,63 @@
1
+ # @lorenzopant/tmdb
2
+
3
+ `@lorenzopant/tmdb` is a TypeScript-first SDK for The Movie Database (TMDB) API.
4
+
5
+ Use this package when you need:
6
+ - Fully typed TMDB API access from TypeScript
7
+ - A single `TMDB` client with modular namespaces like `movies`, `tv_series`, `search`, and `discover`
8
+ - Built-in helpers for images, pagination, caching, retry, rate limiting, and interceptors
9
+ - Access to TMDB v4 auth/account/list APIs through `tmdb.v4` when using a JWT bearer token
10
+
11
+ Install:
12
+ ```bash
13
+ npm install @lorenzopant/tmdb
14
+ ```
15
+
16
+ Basic usage:
17
+ ```ts
18
+ import { TMDB } from "@lorenzopant/tmdb";
19
+
20
+ const tmdb = new TMDB(process.env.TMDB_ACCESS_TOKEN!, {
21
+ language: "en-US",
22
+ region: "US",
23
+ });
24
+
25
+ const movie = await tmdb.movies.details({ movie_id: 550 });
26
+ console.log(movie.title);
27
+ ```
28
+
29
+ Main exports:
30
+ - `TMDB`
31
+ - `TMDBv4`
32
+ - `TMDBError`
33
+ - Standalone endpoint classes like `MoviesAPI`, `SearchAPI`, `PeopleAPI`, `ListsAPI`, and `V4ListsAPI`
34
+ - Utility exports including pagination helpers and `RetryOptions`
35
+ - All public request/response types via `@lorenzopant/tmdb` and `@lorenzopant/tmdb/types`
36
+
37
+ Core namespaces on `TMDB`:
38
+ - `movies`, `movie_lists`
39
+ - `tv_series`, `tv_lists`, `tv_seasons`, `tv_episodes`, `tv_episode_groups`
40
+ - `search`, `discover`, `trending`
41
+ - `people`, `people_lists`
42
+ - `collections`, `companies`, `networks`
43
+ - `genres`, `keywords`, `reviews`, `credits`
44
+ - `configuration`, `changes`, `find`, `watch_providers`
45
+ - `authentication`, `account`, `guest_sessions`, `lists`
46
+ - `images`
47
+ - `v4`
48
+
49
+ Important behavior:
50
+ - Constructor signature: `new TMDB(accessToken, options?)`
51
+ - `tmdb.v4` requires a JWT bearer token; it throws if the client was created with an API key
52
+ - `cache`, `rate_limit`, and `retry` are opt-in
53
+ - `deduplication` is enabled by default
54
+ - `tmdb.cache` is available only when caching is enabled
55
+
56
+ Useful docs:
57
+ - Docs home: https://lorenzopant-tmdb-docs.vercel.app/docs
58
+ - Getting started: https://lorenzopant-tmdb-docs.vercel.app/docs/getting-started
59
+ - API reference: https://lorenzopant-tmdb-docs.vercel.app/docs/api-reference
60
+ - Types: https://lorenzopant-tmdb-docs.vercel.app/docs/types
61
+ - Changelog: https://lorenzopant-tmdb-docs.vercel.app/docs/changelog
62
+
63
+ For fuller package guidance, examples, and AI-oriented reference, see `llms-full.txt`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lorenzopant/tmdb",
3
- "version": "1.21.0",
3
+ "version": "1.21.2",
4
4
  "description": "A completely type-safe The Movie Database (TMDB) API wrapper for typescript applications.",
5
5
  "keywords": [
6
6
  "api",
@@ -8,7 +8,7 @@
8
8
  "tmdb",
9
9
  "typescript"
10
10
  ],
11
- "homepage": "https://lorenzopant-tmdb-docs.vercel.app",
11
+ "homepage": "https://tmdb.lorenzopant.dev",
12
12
  "bugs": {
13
13
  "url": "https://github.com/lorenzopant/tmdb/issues"
14
14
  },
@@ -20,7 +20,9 @@
20
20
  },
21
21
  "files": [
22
22
  "dist",
23
- "README.md"
23
+ "README.md",
24
+ "llms.txt",
25
+ "llms-full.txt"
24
26
  ],
25
27
  "type": "module",
26
28
  "main": "dist/index.mjs",