jorrinkievit / tmdb-js Goto Github PK
View Code? Open in Web Editor NEWA typesafe API wrapper for the TheMovieDatabase API for Node and the Web
A typesafe API wrapper for the TheMovieDatabase API for Node and the Web
Referencing to https://developer.themoviedb.org/reference/collection-details, CollectionsGetDetailsPart
's release_date property should be a string
It would be kind of cool if append_to_response would be typesafe. I came out with the "solution" below (a cast), that is not actually a solution because for example, MoviesGetVideosResponse and MoviesGetImagesResponse are types that have id as one of the properties but, when you append videos or images, you don't get the id and also, MoviesGetImagesResponse doesn't have logos property.
api.v3.movies.getDetails(12, {append_to_response: "videos,images"}).then(movie => {
movie.videos; // <- Property 'videos' does not exist on type 'MoviesGetDetailsResponse'.
(movie as MoviesGetDetailsResponse & {videos: MoviesGetVideosResponse}).videos
movie.images; // <- Property 'images' does not exist on type 'MoviesGetDetailsResponse'.
(movie as MoviesGetDetailsResponse & {images: MoviesGetImagesResponse}).images
})
A solution would at least be to provide an interface specifically for append_to_response responses that you can use to cast, in the case, movie variable.
But at the end it's really a nice api, good job!
This endpoint
tmdb.v3.trending.getTrending
got "mediaType" and "timeWindow" but language is missing
https://www.npmjs.com/package/tmdb-js-node?activeTab=code it's empty (also web version)
For example, tv show's getDetails is not append to response typed
getDetails: <T extends TVAppendToResponse[]>(tvId: number, params?: TVGetDetailsParams<T>) => Promise<TVGetDetailsResponse>;
but movie's one is
getDetails: <T extends MoviesAppendToResponse[]>(movieId: number, params?: MoviesGetDetailsParams<T>) => Promise<GetDetailsResponse<T>>;
when I get a movie details
tmdb.v3.movies.getDetails
the property "belongs_to_collection" is null
Here we can see that the episode has the runtime but in the api there is no such property
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.