@tmdb-graphql-api/resolvers 0.1.0 → 0.1.1-unstable.0
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/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/production.analysis.txt +505 -412
- package/dist/types/cjs/constants.d.cts +3 -0
- package/dist/types/cjs/constants.d.cts.map +1 -1
- package/dist/types/cjs/helpers/buildArgsResolver.d.cts +9 -0
- package/dist/types/cjs/helpers/buildArgsResolver.d.cts.map +1 -0
- package/dist/types/cjs/helpers/buildNoObjArgsResolver.d.cts +9 -0
- package/dist/types/cjs/helpers/buildNoObjArgsResolver.d.cts.map +1 -0
- package/dist/types/cjs/helpers/buildObjArgsResolver.d.cts +9 -0
- package/dist/types/cjs/helpers/buildObjArgsResolver.d.cts.map +1 -0
- package/dist/types/cjs/helpers/buildObjResolver.d.cts +11 -0
- package/dist/types/cjs/helpers/buildObjResolver.d.cts.map +1 -0
- package/dist/types/cjs/helpers/getTvIdSeasonAndEpisode.d.cts +2 -2
- package/dist/types/cjs/helpers/getTvIdSeasonAndEpisode.d.cts.map +1 -1
- package/dist/types/cjs/main.d.cts.map +1 -1
- package/dist/types/cjs/queries/certifications.d.cts +429 -4
- package/dist/types/cjs/queries/certifications.d.cts.map +1 -1
- package/dist/types/cjs/queries/collection.d.cts +63 -3399
- package/dist/types/cjs/queries/collection.d.cts.map +1 -1
- package/dist/types/cjs/queries/collectionImages.d.cts +40 -13
- package/dist/types/cjs/queries/collectionImages.d.cts.map +1 -1
- package/dist/types/cjs/queries/collectionTranslations.d.cts +34 -17
- package/dist/types/cjs/queries/collectionTranslations.d.cts.map +1 -1
- package/dist/types/cjs/queries/company.d.cts +10 -13
- package/dist/types/cjs/queries/company.d.cts.map +1 -1
- package/dist/types/cjs/queries/companyAlternativeNames.d.cts +27 -9
- package/dist/types/cjs/queries/companyAlternativeNames.d.cts.map +1 -1
- package/dist/types/cjs/queries/companyLogos.d.cts +19 -13
- package/dist/types/cjs/queries/companyLogos.d.cts.map +1 -1
- package/dist/types/cjs/queries/configuration.d.cts +11 -14
- package/dist/types/cjs/queries/configuration.d.cts.map +1 -1
- package/dist/types/cjs/queries/configurationCountries.d.cts +16 -3
- package/dist/types/cjs/queries/configurationCountries.d.cts.map +1 -1
- package/dist/types/cjs/queries/configurationJobs.d.cts +15 -3
- package/dist/types/cjs/queries/configurationJobs.d.cts.map +1 -1
- package/dist/types/cjs/queries/configurationLanguages.d.cts +16 -3
- package/dist/types/cjs/queries/configurationLanguages.d.cts.map +1 -1
- package/dist/types/cjs/queries/configurationPrimaryTranslations.d.cts +12 -3
- package/dist/types/cjs/queries/configurationPrimaryTranslations.d.cts.map +1 -1
- package/dist/types/cjs/queries/configurationTimezones.d.cts +15 -3
- package/dist/types/cjs/queries/configurationTimezones.d.cts.map +1 -1
- package/dist/types/cjs/queries/credit.d.cts +46 -4193
- package/dist/types/cjs/queries/credit.d.cts.map +1 -1
- package/dist/types/cjs/queries/discoverMovies.d.cts +2 -4
- package/dist/types/cjs/queries/discoverMovies.d.cts.map +1 -1
- package/dist/types/cjs/queries/discoverTv.d.cts +2 -4
- package/dist/types/cjs/queries/discoverTv.d.cts.map +1 -1
- package/dist/types/cjs/queries/episode.d.cts +236 -94
- package/dist/types/cjs/queries/episode.d.cts.map +1 -1
- package/dist/types/cjs/queries/episodeCredits.d.cts +168 -32
- package/dist/types/cjs/queries/episodeCredits.d.cts.map +1 -1
- package/dist/types/cjs/queries/episodeExternalIds.d.cts +139 -15
- package/dist/types/cjs/queries/episodeExternalIds.d.cts.map +1 -1
- package/dist/types/cjs/queries/episodeStills.d.cts +140 -5
- package/dist/types/cjs/queries/episodeStills.d.cts.map +1 -1
- package/dist/types/cjs/queries/episodeTranslations.d.cts +141 -19
- package/dist/types/cjs/queries/episodeTranslations.d.cts.map +1 -1
- package/dist/types/cjs/queries/episodeVideos.d.cts +142 -14
- package/dist/types/cjs/queries/episodeVideos.d.cts.map +1 -1
- package/dist/types/cjs/queries/find.d.cts +10 -1801
- package/dist/types/cjs/queries/find.d.cts.map +1 -1
- package/dist/types/cjs/queries/genres.d.cts +6 -6
- package/dist/types/cjs/queries/genres.d.cts.map +1 -1
- package/dist/types/cjs/queries/keyword.d.cts +3 -6
- package/dist/types/cjs/queries/keyword.d.cts.map +1 -1
- package/dist/types/cjs/queries/movie.d.cts +35 -3588
- package/dist/types/cjs/queries/movie.d.cts.map +1 -1
- package/dist/types/cjs/queries/movieAlternativeTitles.d.cts +1736 -5
- package/dist/types/cjs/queries/movieAlternativeTitles.d.cts.map +1 -1
- package/dist/types/cjs/queries/movieCredits.d.cts +1757 -32
- package/dist/types/cjs/queries/movieCredits.d.cts.map +1 -1
- package/dist/types/cjs/queries/movieExternalIds.d.cts +1738 -15
- package/dist/types/cjs/queries/movieExternalIds.d.cts.map +1 -1
- package/dist/types/cjs/queries/movieImages.d.cts +1756 -5
- package/dist/types/cjs/queries/movieImages.d.cts.map +1 -1
- package/dist/types/cjs/queries/movieKeywords.d.cts +1735 -5
- package/dist/types/cjs/queries/movieKeywords.d.cts.map +1 -1
- package/dist/types/cjs/queries/movieRecommendations.d.cts +1729 -1849
- package/dist/types/cjs/queries/movieRecommendations.d.cts.map +1 -1
- package/dist/types/cjs/queries/movieReleaseDates.d.cts +1742 -12
- package/dist/types/cjs/queries/movieReleaseDates.d.cts.map +1 -1
- package/dist/types/cjs/queries/movieReviews.d.cts +1729 -1849
- package/dist/types/cjs/queries/movieReviews.d.cts.map +1 -1
- package/dist/types/cjs/queries/movieSimilarMovies.d.cts +1729 -1849
- package/dist/types/cjs/queries/movieSimilarMovies.d.cts.map +1 -1
- package/dist/types/cjs/queries/movieTranslations.d.cts +1744 -19
- package/dist/types/cjs/queries/movieTranslations.d.cts.map +1 -1
- package/dist/types/cjs/queries/movieVideos.d.cts +1742 -14
- package/dist/types/cjs/queries/movieVideos.d.cts.map +1 -1
- package/dist/types/cjs/queries/movieWatchProviders.d.cts +3205 -1373
- package/dist/types/cjs/queries/movieWatchProviders.d.cts.map +1 -1
- package/dist/types/cjs/queries/network.d.cts +15 -24
- package/dist/types/cjs/queries/network.d.cts.map +1 -1
- package/dist/types/cjs/queries/networkAlternativeNames.d.cts +11 -9
- package/dist/types/cjs/queries/networkAlternativeNames.d.cts.map +1 -1
- package/dist/types/cjs/queries/networkLogos.d.cts +17 -13
- package/dist/types/cjs/queries/networkLogos.d.cts.map +1 -1
- package/dist/types/cjs/queries/person.d.cts +13 -41
- package/dist/types/cjs/queries/person.d.cts.map +1 -1
- package/dist/types/cjs/queries/personCombinedCredits.d.cts +233 -5
- package/dist/types/cjs/queries/personCombinedCredits.d.cts.map +1 -1
- package/dist/types/cjs/queries/personExternalIds.d.cts +203 -5
- package/dist/types/cjs/queries/personExternalIds.d.cts.map +1 -1
- package/dist/types/cjs/queries/personMovieCredits.d.cts +231 -5
- package/dist/types/cjs/queries/personMovieCredits.d.cts.map +1 -1
- package/dist/types/cjs/queries/personProfiles.d.cts +200 -5
- package/dist/types/cjs/queries/personProfiles.d.cts.map +1 -1
- package/dist/types/cjs/queries/personTranslations.d.cts +201 -19
- package/dist/types/cjs/queries/personTranslations.d.cts.map +1 -1
- package/dist/types/cjs/queries/personTvCredits.d.cts +232 -5
- package/dist/types/cjs/queries/personTvCredits.d.cts.map +1 -1
- package/dist/types/cjs/queries/rated.d.cts +6 -8
- package/dist/types/cjs/queries/rated.d.cts.map +1 -1
- package/dist/types/cjs/queries/review.d.cts +38 -24
- package/dist/types/cjs/queries/review.d.cts.map +1 -1
- package/dist/types/cjs/queries/search.d.cts +6 -8
- package/dist/types/cjs/queries/search.d.cts.map +1 -1
- package/dist/types/cjs/queries/season.d.cts +233 -279
- package/dist/types/cjs/queries/season.d.cts.map +1 -1
- package/dist/types/cjs/queries/seasonCredits.d.cts +152 -32
- package/dist/types/cjs/queries/seasonCredits.d.cts.map +1 -1
- package/dist/types/cjs/queries/seasonEpisodeCount.d.cts.map +1 -1
- package/dist/types/cjs/queries/seasonExternalIds.d.cts +134 -5
- package/dist/types/cjs/queries/seasonExternalIds.d.cts.map +1 -1
- package/dist/types/cjs/queries/seasonPosters.d.cts +136 -5
- package/dist/types/cjs/queries/seasonPosters.d.cts.map +1 -1
- package/dist/types/cjs/queries/seasonTranslations.d.cts +137 -19
- package/dist/types/cjs/queries/seasonTranslations.d.cts.map +1 -1
- package/dist/types/cjs/queries/seasonVideos.d.cts +138 -14
- package/dist/types/cjs/queries/seasonVideos.d.cts.map +1 -1
- package/dist/types/cjs/queries/trending.d.cts +5 -7
- package/dist/types/cjs/queries/trending.d.cts.map +1 -1
- package/dist/types/cjs/queries/tv.d.cts +79 -10455
- package/dist/types/cjs/queries/tv.d.cts.map +1 -1
- package/dist/types/cjs/queries/tvAlternativeTitles.d.cts +1273 -10
- package/dist/types/cjs/queries/tvAlternativeTitles.d.cts.map +1 -1
- package/dist/types/cjs/queries/tvContentRatings.d.cts +1273 -8
- package/dist/types/cjs/queries/tvContentRatings.d.cts.map +1 -1
- package/dist/types/cjs/queries/tvCredits.d.cts +1294 -32
- package/dist/types/cjs/queries/tvCredits.d.cts.map +1 -1
- package/dist/types/cjs/queries/tvEpisodeGroups.d.cts +1281 -38
- package/dist/types/cjs/queries/tvEpisodeGroups.d.cts.map +1 -1
- package/dist/types/cjs/queries/tvExternalIds.d.cts +1280 -15
- package/dist/types/cjs/queries/tvExternalIds.d.cts.map +1 -1
- package/dist/types/cjs/queries/tvImages.d.cts +1294 -15
- package/dist/types/cjs/queries/tvImages.d.cts.map +1 -1
- package/dist/types/cjs/queries/tvKeywords.d.cts +1272 -8
- package/dist/types/cjs/queries/tvKeywords.d.cts.map +1 -1
- package/dist/types/cjs/queries/tvRecommendations.d.cts +1265 -5354
- package/dist/types/cjs/queries/tvRecommendations.d.cts.map +1 -1
- package/dist/types/cjs/queries/tvReviews.d.cts +1265 -5354
- package/dist/types/cjs/queries/tvReviews.d.cts.map +1 -1
- package/dist/types/cjs/queries/tvSimilarTvShows.d.cts +1265 -5354
- package/dist/types/cjs/queries/tvSimilarTvShows.d.cts.map +1 -1
- package/dist/types/cjs/queries/tvTranslations.d.cts +1280 -18
- package/dist/types/cjs/queries/tvTranslations.d.cts.map +1 -1
- package/dist/types/cjs/queries/tvVideos.d.cts +1280 -14
- package/dist/types/cjs/queries/tvVideos.d.cts.map +1 -1
- package/dist/types/cjs/queries/tvWatchProviders.d.cts +2174 -1371
- package/dist/types/cjs/queries/tvWatchProviders.d.cts.map +1 -1
- package/dist/types/cjs/queries/videoType.d.cts +2 -2
- package/dist/types/cjs/queries/videoType.d.cts.map +1 -1
- package/dist/types/cjs/types.d.cts +130 -295
- package/dist/types/cjs/types.d.cts.map +1 -1
- package/dist/types/esm/constants.d.ts +3 -0
- package/dist/types/esm/constants.d.ts.map +1 -1
- package/dist/types/esm/helpers/buildArgsResolver.d.ts +9 -0
- package/dist/types/esm/helpers/buildArgsResolver.d.ts.map +1 -0
- package/dist/types/esm/helpers/buildNoObjArgsResolver.d.ts +9 -0
- package/dist/types/esm/helpers/buildNoObjArgsResolver.d.ts.map +1 -0
- package/dist/types/esm/helpers/buildObjArgsResolver.d.ts +9 -0
- package/dist/types/esm/helpers/buildObjArgsResolver.d.ts.map +1 -0
- package/dist/types/esm/helpers/buildObjResolver.d.ts +11 -0
- package/dist/types/esm/helpers/buildObjResolver.d.ts.map +1 -0
- package/dist/types/esm/helpers/getTvIdSeasonAndEpisode.d.ts +2 -2
- package/dist/types/esm/helpers/getTvIdSeasonAndEpisode.d.ts.map +1 -1
- package/dist/types/esm/main.d.ts.map +1 -1
- package/dist/types/esm/queries/certifications.d.ts +429 -4
- package/dist/types/esm/queries/certifications.d.ts.map +1 -1
- package/dist/types/esm/queries/collection.d.ts +63 -3399
- package/dist/types/esm/queries/collection.d.ts.map +1 -1
- package/dist/types/esm/queries/collectionImages.d.ts +40 -13
- package/dist/types/esm/queries/collectionImages.d.ts.map +1 -1
- package/dist/types/esm/queries/collectionTranslations.d.ts +34 -17
- package/dist/types/esm/queries/collectionTranslations.d.ts.map +1 -1
- package/dist/types/esm/queries/company.d.ts +10 -13
- package/dist/types/esm/queries/company.d.ts.map +1 -1
- package/dist/types/esm/queries/companyAlternativeNames.d.ts +27 -9
- package/dist/types/esm/queries/companyAlternativeNames.d.ts.map +1 -1
- package/dist/types/esm/queries/companyLogos.d.ts +19 -13
- package/dist/types/esm/queries/companyLogos.d.ts.map +1 -1
- package/dist/types/esm/queries/configuration.d.ts +11 -14
- package/dist/types/esm/queries/configuration.d.ts.map +1 -1
- package/dist/types/esm/queries/configurationCountries.d.ts +16 -3
- package/dist/types/esm/queries/configurationCountries.d.ts.map +1 -1
- package/dist/types/esm/queries/configurationJobs.d.ts +15 -3
- package/dist/types/esm/queries/configurationJobs.d.ts.map +1 -1
- package/dist/types/esm/queries/configurationLanguages.d.ts +16 -3
- package/dist/types/esm/queries/configurationLanguages.d.ts.map +1 -1
- package/dist/types/esm/queries/configurationPrimaryTranslations.d.ts +12 -3
- package/dist/types/esm/queries/configurationPrimaryTranslations.d.ts.map +1 -1
- package/dist/types/esm/queries/configurationTimezones.d.ts +15 -3
- package/dist/types/esm/queries/configurationTimezones.d.ts.map +1 -1
- package/dist/types/esm/queries/credit.d.ts +46 -4193
- package/dist/types/esm/queries/credit.d.ts.map +1 -1
- package/dist/types/esm/queries/discoverMovies.d.ts +2 -4
- package/dist/types/esm/queries/discoverMovies.d.ts.map +1 -1
- package/dist/types/esm/queries/discoverTv.d.ts +2 -4
- package/dist/types/esm/queries/discoverTv.d.ts.map +1 -1
- package/dist/types/esm/queries/episode.d.ts +236 -94
- package/dist/types/esm/queries/episode.d.ts.map +1 -1
- package/dist/types/esm/queries/episodeCredits.d.ts +168 -32
- package/dist/types/esm/queries/episodeCredits.d.ts.map +1 -1
- package/dist/types/esm/queries/episodeExternalIds.d.ts +139 -15
- package/dist/types/esm/queries/episodeExternalIds.d.ts.map +1 -1
- package/dist/types/esm/queries/episodeStills.d.ts +140 -5
- package/dist/types/esm/queries/episodeStills.d.ts.map +1 -1
- package/dist/types/esm/queries/episodeTranslations.d.ts +141 -19
- package/dist/types/esm/queries/episodeTranslations.d.ts.map +1 -1
- package/dist/types/esm/queries/episodeVideos.d.ts +142 -14
- package/dist/types/esm/queries/episodeVideos.d.ts.map +1 -1
- package/dist/types/esm/queries/find.d.ts +10 -1801
- package/dist/types/esm/queries/find.d.ts.map +1 -1
- package/dist/types/esm/queries/genres.d.ts +6 -6
- package/dist/types/esm/queries/genres.d.ts.map +1 -1
- package/dist/types/esm/queries/keyword.d.ts +3 -6
- package/dist/types/esm/queries/keyword.d.ts.map +1 -1
- package/dist/types/esm/queries/movie.d.ts +35 -3588
- package/dist/types/esm/queries/movie.d.ts.map +1 -1
- package/dist/types/esm/queries/movieAlternativeTitles.d.ts +1736 -5
- package/dist/types/esm/queries/movieAlternativeTitles.d.ts.map +1 -1
- package/dist/types/esm/queries/movieCredits.d.ts +1757 -32
- package/dist/types/esm/queries/movieCredits.d.ts.map +1 -1
- package/dist/types/esm/queries/movieExternalIds.d.ts +1738 -15
- package/dist/types/esm/queries/movieExternalIds.d.ts.map +1 -1
- package/dist/types/esm/queries/movieImages.d.ts +1756 -5
- package/dist/types/esm/queries/movieImages.d.ts.map +1 -1
- package/dist/types/esm/queries/movieKeywords.d.ts +1735 -5
- package/dist/types/esm/queries/movieKeywords.d.ts.map +1 -1
- package/dist/types/esm/queries/movieRecommendations.d.ts +1729 -1849
- package/dist/types/esm/queries/movieRecommendations.d.ts.map +1 -1
- package/dist/types/esm/queries/movieReleaseDates.d.ts +1742 -12
- package/dist/types/esm/queries/movieReleaseDates.d.ts.map +1 -1
- package/dist/types/esm/queries/movieReviews.d.ts +1729 -1849
- package/dist/types/esm/queries/movieReviews.d.ts.map +1 -1
- package/dist/types/esm/queries/movieSimilarMovies.d.ts +1729 -1849
- package/dist/types/esm/queries/movieSimilarMovies.d.ts.map +1 -1
- package/dist/types/esm/queries/movieTranslations.d.ts +1744 -19
- package/dist/types/esm/queries/movieTranslations.d.ts.map +1 -1
- package/dist/types/esm/queries/movieVideos.d.ts +1742 -14
- package/dist/types/esm/queries/movieVideos.d.ts.map +1 -1
- package/dist/types/esm/queries/movieWatchProviders.d.ts +3205 -1373
- package/dist/types/esm/queries/movieWatchProviders.d.ts.map +1 -1
- package/dist/types/esm/queries/network.d.ts +15 -24
- package/dist/types/esm/queries/network.d.ts.map +1 -1
- package/dist/types/esm/queries/networkAlternativeNames.d.ts +11 -9
- package/dist/types/esm/queries/networkAlternativeNames.d.ts.map +1 -1
- package/dist/types/esm/queries/networkLogos.d.ts +17 -13
- package/dist/types/esm/queries/networkLogos.d.ts.map +1 -1
- package/dist/types/esm/queries/person.d.ts +13 -41
- package/dist/types/esm/queries/person.d.ts.map +1 -1
- package/dist/types/esm/queries/personCombinedCredits.d.ts +233 -5
- package/dist/types/esm/queries/personCombinedCredits.d.ts.map +1 -1
- package/dist/types/esm/queries/personExternalIds.d.ts +203 -5
- package/dist/types/esm/queries/personExternalIds.d.ts.map +1 -1
- package/dist/types/esm/queries/personMovieCredits.d.ts +231 -5
- package/dist/types/esm/queries/personMovieCredits.d.ts.map +1 -1
- package/dist/types/esm/queries/personProfiles.d.ts +200 -5
- package/dist/types/esm/queries/personProfiles.d.ts.map +1 -1
- package/dist/types/esm/queries/personTranslations.d.ts +201 -19
- package/dist/types/esm/queries/personTranslations.d.ts.map +1 -1
- package/dist/types/esm/queries/personTvCredits.d.ts +232 -5
- package/dist/types/esm/queries/personTvCredits.d.ts.map +1 -1
- package/dist/types/esm/queries/rated.d.ts +6 -8
- package/dist/types/esm/queries/rated.d.ts.map +1 -1
- package/dist/types/esm/queries/review.d.ts +38 -24
- package/dist/types/esm/queries/review.d.ts.map +1 -1
- package/dist/types/esm/queries/search.d.ts +6 -8
- package/dist/types/esm/queries/search.d.ts.map +1 -1
- package/dist/types/esm/queries/season.d.ts +233 -279
- package/dist/types/esm/queries/season.d.ts.map +1 -1
- package/dist/types/esm/queries/seasonCredits.d.ts +152 -32
- package/dist/types/esm/queries/seasonCredits.d.ts.map +1 -1
- package/dist/types/esm/queries/seasonEpisodeCount.d.ts.map +1 -1
- package/dist/types/esm/queries/seasonExternalIds.d.ts +134 -5
- package/dist/types/esm/queries/seasonExternalIds.d.ts.map +1 -1
- package/dist/types/esm/queries/seasonPosters.d.ts +136 -5
- package/dist/types/esm/queries/seasonPosters.d.ts.map +1 -1
- package/dist/types/esm/queries/seasonTranslations.d.ts +137 -19
- package/dist/types/esm/queries/seasonTranslations.d.ts.map +1 -1
- package/dist/types/esm/queries/seasonVideos.d.ts +138 -14
- package/dist/types/esm/queries/seasonVideos.d.ts.map +1 -1
- package/dist/types/esm/queries/trending.d.ts +5 -7
- package/dist/types/esm/queries/trending.d.ts.map +1 -1
- package/dist/types/esm/queries/tv.d.ts +79 -10455
- package/dist/types/esm/queries/tv.d.ts.map +1 -1
- package/dist/types/esm/queries/tvAlternativeTitles.d.ts +1273 -10
- package/dist/types/esm/queries/tvAlternativeTitles.d.ts.map +1 -1
- package/dist/types/esm/queries/tvContentRatings.d.ts +1273 -8
- package/dist/types/esm/queries/tvContentRatings.d.ts.map +1 -1
- package/dist/types/esm/queries/tvCredits.d.ts +1294 -32
- package/dist/types/esm/queries/tvCredits.d.ts.map +1 -1
- package/dist/types/esm/queries/tvEpisodeGroups.d.ts +1281 -38
- package/dist/types/esm/queries/tvEpisodeGroups.d.ts.map +1 -1
- package/dist/types/esm/queries/tvExternalIds.d.ts +1280 -15
- package/dist/types/esm/queries/tvExternalIds.d.ts.map +1 -1
- package/dist/types/esm/queries/tvImages.d.ts +1294 -15
- package/dist/types/esm/queries/tvImages.d.ts.map +1 -1
- package/dist/types/esm/queries/tvKeywords.d.ts +1272 -8
- package/dist/types/esm/queries/tvKeywords.d.ts.map +1 -1
- package/dist/types/esm/queries/tvRecommendations.d.ts +1265 -5354
- package/dist/types/esm/queries/tvRecommendations.d.ts.map +1 -1
- package/dist/types/esm/queries/tvReviews.d.ts +1265 -5354
- package/dist/types/esm/queries/tvReviews.d.ts.map +1 -1
- package/dist/types/esm/queries/tvSimilarTvShows.d.ts +1265 -5354
- package/dist/types/esm/queries/tvSimilarTvShows.d.ts.map +1 -1
- package/dist/types/esm/queries/tvTranslations.d.ts +1280 -18
- package/dist/types/esm/queries/tvTranslations.d.ts.map +1 -1
- package/dist/types/esm/queries/tvVideos.d.ts +1280 -14
- package/dist/types/esm/queries/tvVideos.d.ts.map +1 -1
- package/dist/types/esm/queries/tvWatchProviders.d.ts +2174 -1371
- package/dist/types/esm/queries/tvWatchProviders.d.ts.map +1 -1
- package/dist/types/esm/queries/videoType.d.ts +2 -2
- package/dist/types/esm/queries/videoType.d.ts.map +1 -1
- package/dist/types/esm/types.d.ts +130 -295
- package/dist/types/esm/types.d.ts.map +1 -1
- package/dist/types/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +11 -10
- package/src/__testUtils__/helpers/createMockLogger.ts +10 -0
- package/src/constants.ts +3 -0
- package/src/helpers/buildArgsResolver.ts +37 -0
- package/src/helpers/buildNoObjArgsResolver.ts +36 -0
- package/src/helpers/buildObjArgsResolver.ts +43 -0
- package/src/helpers/buildObjResolver.ts +48 -0
- package/src/helpers/getTvIdSeasonAndEpisode.ts +4 -4
- package/src/main.ts +5 -11
- package/src/queries/certifications.test.ts +13 -20
- package/src/queries/certifications.ts +21 -24
- package/src/queries/collection.test.ts +13 -16
- package/src/queries/collection.ts +20 -23
- package/src/queries/collectionImages.test.ts +16 -24
- package/src/queries/collectionImages.ts +16 -19
- package/src/queries/collectionTranslations.test.ts +29 -17
- package/src/queries/collectionTranslations.ts +19 -23
- package/src/queries/company.test.ts +13 -16
- package/src/queries/company.ts +20 -23
- package/src/queries/companyAlternativeNames.test.ts +34 -19
- package/src/queries/companyAlternativeNames.ts +19 -23
- package/src/queries/companyLogos.test.ts +29 -19
- package/src/queries/companyLogos.ts +13 -21
- package/src/queries/configuration.test.ts +12 -16
- package/src/queries/configuration.ts +11 -15
- package/src/queries/configurationCountries.test.ts +27 -17
- package/src/queries/configurationCountries.ts +19 -23
- package/src/queries/configurationJobs.test.ts +27 -17
- package/src/queries/configurationJobs.ts +19 -23
- package/src/queries/configurationLanguages.test.ts +27 -17
- package/src/queries/configurationLanguages.ts +19 -23
- package/src/queries/configurationPrimaryTranslations.test.ts +26 -17
- package/src/queries/configurationPrimaryTranslations.ts +14 -18
- package/src/queries/configurationTimezones.test.ts +27 -17
- package/src/queries/configurationTimezones.ts +19 -23
- package/src/queries/credit.test.ts +13 -16
- package/src/queries/credit.ts +12 -15
- package/src/queries/discoverMovies.test.ts +35 -81
- package/src/queries/discoverMovies.ts +21 -20
- package/src/queries/discoverTv.test.ts +29 -43
- package/src/queries/discoverTv.ts +16 -21
- package/src/queries/episode.test.ts +15 -16
- package/src/queries/episode.ts +34 -34
- package/src/queries/episodeCredits.test.ts +33 -55
- package/src/queries/episodeCredits.ts +29 -22
- package/src/queries/episodeExternalIds.test.ts +26 -28
- package/src/queries/episodeExternalIds.ts +35 -23
- package/src/queries/episodeStills.test.ts +26 -29
- package/src/queries/episodeStills.ts +32 -22
- package/src/queries/episodeTranslations.test.ts +24 -22
- package/src/queries/episodeTranslations.ts +29 -22
- package/src/queries/episodeVideos.test.ts +26 -29
- package/src/queries/episodeVideos.ts +29 -22
- package/src/queries/find.test.ts +13 -16
- package/src/queries/find.ts +25 -22
- package/src/queries/genres.test.ts +13 -22
- package/src/queries/genres.ts +13 -19
- package/src/queries/keyword.test.ts +13 -16
- package/src/queries/keyword.ts +12 -15
- package/src/queries/movie.test.ts +16 -20
- package/src/queries/movie.ts +20 -21
- package/src/queries/movieAlternativeTitles.test.ts +24 -30
- package/src/queries/movieAlternativeTitles.ts +34 -22
- package/src/queries/movieCredits.test.ts +27 -45
- package/src/queries/movieCredits.ts +24 -21
- package/src/queries/movieExternalIds.test.ts +22 -29
- package/src/queries/movieExternalIds.ts +26 -21
- package/src/queries/movieImages.test.ts +28 -46
- package/src/queries/movieImages.ts +26 -23
- package/src/queries/movieKeywords.test.ts +21 -26
- package/src/queries/movieKeywords.ts +24 -21
- package/src/queries/movieRecommendations.test.ts +27 -49
- package/src/queries/movieRecommendations.ts +27 -23
- package/src/queries/movieReleaseDates.test.ts +24 -28
- package/src/queries/movieReleaseDates.ts +25 -21
- package/src/queries/movieReviews.test.ts +32 -36
- package/src/queries/movieReviews.ts +28 -23
- package/src/queries/movieSimilarMovies.test.ts +25 -47
- package/src/queries/movieSimilarMovies.ts +28 -24
- package/src/queries/movieTranslations.test.ts +20 -25
- package/src/queries/movieTranslations.ts +24 -21
- package/src/queries/movieVideos.test.ts +22 -29
- package/src/queries/movieVideos.ts +24 -21
- package/src/queries/movieWatchProviders.test.ts +19 -27
- package/src/queries/movieWatchProviders.ts +26 -23
- package/src/queries/network.test.ts +13 -16
- package/src/queries/network.ts +20 -23
- package/src/queries/networkAlternativeNames.test.ts +16 -18
- package/src/queries/networkAlternativeNames.ts +19 -23
- package/src/queries/networkLogos.test.ts +14 -15
- package/src/queries/networkLogos.ts +13 -20
- package/src/queries/person.test.ts +16 -20
- package/src/queries/person.ts +20 -21
- package/src/queries/personCombinedCredits.test.ts +26 -26
- package/src/queries/personCombinedCredits.ts +27 -21
- package/src/queries/personExternalIds.test.ts +26 -26
- package/src/queries/personExternalIds.ts +27 -21
- package/src/queries/personMovieCredits.test.ts +26 -26
- package/src/queries/personMovieCredits.ts +27 -21
- package/src/queries/personProfiles.test.ts +22 -26
- package/src/queries/personProfiles.ts +25 -22
- package/src/queries/personTranslations.test.ts +22 -25
- package/src/queries/personTranslations.ts +24 -21
- package/src/queries/personTvCredits.test.ts +28 -28
- package/src/queries/personTvCredits.ts +26 -21
- package/src/queries/rated.test.ts +33 -69
- package/src/queries/rated.ts +31 -20
- package/src/queries/review.test.ts +13 -16
- package/src/queries/review.ts +27 -31
- package/src/queries/search.test.ts +53 -107
- package/src/queries/search.ts +42 -20
- package/src/queries/season.test.ts +15 -16
- package/src/queries/season.ts +32 -42
- package/src/queries/seasonCredits.test.ts +36 -45
- package/src/queries/seasonCredits.ts +27 -23
- package/src/queries/seasonEpisodeCount.ts +0 -4
- package/src/queries/seasonExternalIds.test.ts +25 -28
- package/src/queries/seasonExternalIds.ts +32 -22
- package/src/queries/seasonPosters.test.ts +25 -30
- package/src/queries/seasonPosters.ts +25 -22
- package/src/queries/seasonTranslations.test.ts +21 -27
- package/src/queries/seasonTranslations.ts +29 -22
- package/src/queries/seasonVideos.test.ts +23 -28
- package/src/queries/seasonVideos.ts +25 -22
- package/src/queries/trending.test.ts +28 -60
- package/src/queries/trending.ts +42 -20
- package/src/queries/tv.test.ts +16 -20
- package/src/queries/tv.ts +26 -34
- package/src/queries/tvAlternativeTitles.test.ts +25 -28
- package/src/queries/tvAlternativeTitles.ts +25 -22
- package/src/queries/tvContentRatings.test.ts +25 -28
- package/src/queries/tvContentRatings.ts +24 -22
- package/src/queries/tvCredits.test.ts +38 -44
- package/src/queries/tvCredits.ts +24 -21
- package/src/queries/tvEpisodeGroups.test.ts +25 -28
- package/src/queries/tvEpisodeGroups.ts +24 -21
- package/src/queries/tvExternalIds.test.ts +25 -28
- package/src/queries/tvExternalIds.ts +26 -21
- package/src/queries/tvImages.test.ts +36 -46
- package/src/queries/tvImages.ts +26 -23
- package/src/queries/tvKeywords.test.ts +24 -28
- package/src/queries/tvKeywords.ts +24 -21
- package/src/queries/tvRecommendations.test.ts +29 -49
- package/src/queries/tvRecommendations.ts +28 -22
- package/src/queries/tvReviews.test.ts +37 -48
- package/src/queries/tvReviews.ts +27 -23
- package/src/queries/tvSimilarTvShows.test.ts +37 -48
- package/src/queries/tvSimilarTvShows.ts +28 -24
- package/src/queries/tvTranslations.test.ts +24 -28
- package/src/queries/tvTranslations.ts +24 -21
- package/src/queries/tvVideos.test.ts +24 -28
- package/src/queries/tvVideos.ts +24 -21
- package/src/queries/tvWatchProviders.test.ts +24 -28
- package/src/queries/tvWatchProviders.ts +26 -23
- package/src/queries/videoType.ts +2 -2
- package/src/types.ts +228 -386
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tmdb-graphql-api/resolvers",
|
|
3
3
|
"description": "The TMDB GraphQL resolvers module.",
|
|
4
|
-
"version": "0.1.0",
|
|
4
|
+
"version": "0.1.1-unstable.0",
|
|
5
5
|
"author": "Dylan Aubrey",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://github.com/badbatch/themoviedb-graphql-api",
|
|
@@ -29,18 +29,19 @@
|
|
|
29
29
|
"access": "public"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@cachemap/core": "^5.
|
|
33
|
-
"@cachemap/map": "^5.0.
|
|
34
|
-
"@cachemap/reaper": "^5.
|
|
35
|
-
"@graphql-box/connection-resolver": "^5.
|
|
36
|
-
"@graphql-box/core": "^5.
|
|
32
|
+
"@cachemap/core": "^5.2.7",
|
|
33
|
+
"@cachemap/map": "^5.0.9",
|
|
34
|
+
"@cachemap/reaper": "^5.1.3",
|
|
35
|
+
"@graphql-box/connection-resolver": "^5.4.6",
|
|
36
|
+
"@graphql-box/core": "^5.4.2",
|
|
37
37
|
"cacheability": "^4.0.20",
|
|
38
38
|
"getta": "^1.0.6",
|
|
39
39
|
"js-base64": "^3.6.0",
|
|
40
40
|
"query-string": "^8.1.0",
|
|
41
|
-
"type-fest": "^4.
|
|
42
|
-
"
|
|
43
|
-
"@tmdb-graphql-api/
|
|
41
|
+
"type-fest": "^4.37.0",
|
|
42
|
+
"winston": "^3.17.0",
|
|
43
|
+
"@tmdb-graphql-api/rest-client": "0.0.10-unstable.0",
|
|
44
|
+
"@tmdb-graphql-api/schema": "0.1.1-unstable.0"
|
|
44
45
|
},
|
|
45
46
|
"peerDependencies": {
|
|
46
47
|
"@babel/runtime": "<8",
|
|
@@ -50,7 +51,7 @@
|
|
|
50
51
|
},
|
|
51
52
|
"devDependencies": {
|
|
52
53
|
"@babel/runtime": "^7.23.2",
|
|
53
|
-
"@graphql-box/helpers": "^5.
|
|
54
|
+
"@graphql-box/helpers": "^5.4.2",
|
|
54
55
|
"@jest/globals": "^29.7.0",
|
|
55
56
|
"@types/lodash-es": "^4.14.191",
|
|
56
57
|
"core-js": "^3.33.1",
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type jest } from '@jest/globals';
|
|
2
|
+
import type { LeveledLogMethod, Logger } from 'winston';
|
|
3
|
+
|
|
4
|
+
export const createMockLogger = (mockFn: typeof jest.fn): Logger => {
|
|
5
|
+
const mockLogger = {} as unknown as Logger;
|
|
6
|
+
mockLogger.child = mockFn().mockReturnValue(mockLogger) as (options: Record<string, unknown>) => Logger;
|
|
7
|
+
mockLogger.error = mockFn() as LeveledLogMethod;
|
|
8
|
+
mockLogger.info = mockFn() as LeveledLogMethod;
|
|
9
|
+
return mockLogger;
|
|
10
|
+
};
|
package/src/constants.ts
CHANGED
|
@@ -25,6 +25,7 @@ export const EXTERNAL_IDS = 'externalIds' as const;
|
|
|
25
25
|
export const FIND = 'find' as const;
|
|
26
26
|
|
|
27
27
|
export const GENRES = 'genres' as const;
|
|
28
|
+
export const GUEST_STARS = 'guestStars' as const;
|
|
28
29
|
|
|
29
30
|
export const IMAGES = 'images' as const;
|
|
30
31
|
|
|
@@ -50,6 +51,7 @@ export const PROFILES = 'profiles' as const;
|
|
|
50
51
|
export const RATED = 'rated' as const;
|
|
51
52
|
export const RECOMMENDATIONS = 'recommendations' as const;
|
|
52
53
|
export const RELEASE_DATES = 'releaseDates' as const;
|
|
54
|
+
export const RESULTS = 'results' as const;
|
|
53
55
|
export const REVIEW = 'review' as const;
|
|
54
56
|
export const REVIEWS = 'reviews' as const;
|
|
55
57
|
|
|
@@ -69,3 +71,4 @@ export const TV_CREDITS = 'tvCredits' as const;
|
|
|
69
71
|
export const VIDEOS = 'videos' as const;
|
|
70
72
|
|
|
71
73
|
export const WATCH_PROVIDERS = 'watchProviders' as const;
|
|
74
|
+
export const RAW_WATCH_PROVIDERS = 'watch/providers' as const;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { GraphQLError, type GraphQLResolveInfo } from 'graphql';
|
|
2
|
+
import { type Context } from '../types.ts';
|
|
3
|
+
|
|
4
|
+
export const buildArgsResolver =
|
|
5
|
+
<Args extends object, Data>(
|
|
6
|
+
field: string,
|
|
7
|
+
callback: (
|
|
8
|
+
args: Args,
|
|
9
|
+
ctx: Context,
|
|
10
|
+
info: GraphQLResolveInfo
|
|
11
|
+
) => Promise<{ data?: Data; errors?: Error[]; headers: Headers; source?: string }>
|
|
12
|
+
) =>
|
|
13
|
+
async (_obj: undefined, args: Args, ctx: Context, info: GraphQLResolveInfo) => {
|
|
14
|
+
const { logger, operationName, requestID, setCacheMetadata, tmdbGuestSessionId } = ctx;
|
|
15
|
+
const { fieldNodes } = info;
|
|
16
|
+
|
|
17
|
+
const childLogger = logger.child({
|
|
18
|
+
args,
|
|
19
|
+
field,
|
|
20
|
+
operationName,
|
|
21
|
+
requestID,
|
|
22
|
+
tmdbGuestSessionId,
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
childLogger.info(`Resolving ${field}`);
|
|
26
|
+
const { data, errors, headers, source = 'api' } = await callback(args, ctx, info);
|
|
27
|
+
|
|
28
|
+
if (errors?.length) {
|
|
29
|
+
const message = `Failed to resolve ${field}`;
|
|
30
|
+
childLogger.error(message, { errors });
|
|
31
|
+
throw new GraphQLError(message, { nodes: fieldNodes, originalError: errors[0] });
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
childLogger.info(`Successfully resolved ${field} from ${source}`);
|
|
35
|
+
setCacheMetadata(field, headers);
|
|
36
|
+
return data;
|
|
37
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { GraphQLError, type GraphQLResolveInfo } from 'graphql';
|
|
2
|
+
import type { Context } from '../types.ts';
|
|
3
|
+
|
|
4
|
+
export const buildNoObjArgsResolver =
|
|
5
|
+
<Obj, Data>(
|
|
6
|
+
parentFieldName: string,
|
|
7
|
+
callback: (
|
|
8
|
+
ctx: Context,
|
|
9
|
+
info: GraphQLResolveInfo
|
|
10
|
+
) => Promise<{ data?: Data; errors?: Error[]; headers: Headers; source?: string }>
|
|
11
|
+
) =>
|
|
12
|
+
async (obj: Obj | undefined, _args: undefined, ctx: Context, info: GraphQLResolveInfo) => {
|
|
13
|
+
const { logger, operationName, requestID, setCacheMetadata, tmdbGuestSessionId } = ctx;
|
|
14
|
+
const { fieldName, fieldNodes } = info;
|
|
15
|
+
const fieldPath = obj ? `${parentFieldName}.${fieldName}` : parentFieldName;
|
|
16
|
+
|
|
17
|
+
const childLogger = logger.child({
|
|
18
|
+
fieldPath,
|
|
19
|
+
operationName,
|
|
20
|
+
requestID,
|
|
21
|
+
tmdbGuestSessionId,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
childLogger.info(`Resolving ${fieldPath}`);
|
|
25
|
+
const { data, errors, headers } = await callback(ctx, info);
|
|
26
|
+
|
|
27
|
+
if (errors?.length) {
|
|
28
|
+
const message = `Failed to resolve ${fieldPath}`;
|
|
29
|
+
childLogger.error(message, { errors });
|
|
30
|
+
throw new GraphQLError(message, { nodes: fieldNodes, originalError: errors[0] });
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
childLogger.info(`Successfully resolved ${fieldPath} from api`);
|
|
34
|
+
setCacheMetadata(fieldPath, headers);
|
|
35
|
+
return data;
|
|
36
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { GraphQLError, type GraphQLResolveInfo } from 'graphql';
|
|
2
|
+
import { type Context } from '../types.ts';
|
|
3
|
+
|
|
4
|
+
export const buildObjArgsResolver =
|
|
5
|
+
<Obj extends object, Args extends object, Data>(
|
|
6
|
+
parentFieldName: string,
|
|
7
|
+
callback: (
|
|
8
|
+
obj: Obj | undefined,
|
|
9
|
+
args: Args,
|
|
10
|
+
ctx: Context,
|
|
11
|
+
info: GraphQLResolveInfo
|
|
12
|
+
) => Promise<{ data?: Data; errors?: Error[]; headers?: Headers; source?: string }>
|
|
13
|
+
) =>
|
|
14
|
+
async (obj: Obj | undefined, args: Args, ctx: Context, info: GraphQLResolveInfo) => {
|
|
15
|
+
const { logger, operationName, requestID, setCacheMetadata, tmdbGuestSessionId } = ctx;
|
|
16
|
+
const { fieldName, fieldNodes } = info;
|
|
17
|
+
const fieldPath = obj ? `${parentFieldName}.${fieldName}` : parentFieldName;
|
|
18
|
+
|
|
19
|
+
const childLogger = logger.child({
|
|
20
|
+
args,
|
|
21
|
+
fieldPath,
|
|
22
|
+
operationName,
|
|
23
|
+
requestID,
|
|
24
|
+
tmdbGuestSessionId,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
childLogger.info(`Resolving ${fieldPath}`);
|
|
28
|
+
const { data, errors, headers, source = 'api' } = await callback(obj, args, ctx, info);
|
|
29
|
+
|
|
30
|
+
if (errors?.length) {
|
|
31
|
+
const message = `Failed to resolve ${fieldPath}`;
|
|
32
|
+
childLogger.error(message, { errors });
|
|
33
|
+
throw new GraphQLError(message, { nodes: fieldNodes, originalError: errors[0] });
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
childLogger.info(`Successfully resolved ${fieldPath} from ${source}`);
|
|
37
|
+
|
|
38
|
+
if (headers) {
|
|
39
|
+
setCacheMetadata(fieldPath, headers);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return data;
|
|
43
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { GraphQLError, type GraphQLResolveInfo } from 'graphql';
|
|
2
|
+
import { type Context } from '../types.ts';
|
|
3
|
+
|
|
4
|
+
export const buildObjResolver =
|
|
5
|
+
<Obj extends { id: number | string }, Data>(
|
|
6
|
+
parentFieldName: string,
|
|
7
|
+
callback: (
|
|
8
|
+
obj: Obj,
|
|
9
|
+
ctx: Context,
|
|
10
|
+
info: GraphQLResolveInfo
|
|
11
|
+
) => Promise<{ data?: Data; errors?: Error[]; headers?: Headers; source?: string }>
|
|
12
|
+
) =>
|
|
13
|
+
async (obj: Obj | undefined, _args: undefined, ctx: Context, info: GraphQLResolveInfo) => {
|
|
14
|
+
const { logger, operationName, requestID, setCacheMetadata, tmdbGuestSessionId } = ctx;
|
|
15
|
+
const { fieldName, fieldNodes } = info;
|
|
16
|
+
const fieldPath = `${parentFieldName}.${fieldName}`;
|
|
17
|
+
|
|
18
|
+
const childLogger = logger.child({
|
|
19
|
+
fieldPath,
|
|
20
|
+
operationName,
|
|
21
|
+
parentFieldId: obj?.id,
|
|
22
|
+
requestID,
|
|
23
|
+
tmdbGuestSessionId,
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
if (!obj) {
|
|
27
|
+
const message = `Required ${parentFieldName} node missing`;
|
|
28
|
+
childLogger.error(message);
|
|
29
|
+
throw new GraphQLError(message, { nodes: fieldNodes });
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
childLogger.info(`Resolving ${fieldPath}`);
|
|
33
|
+
const { data, errors, headers, source = 'api' } = await callback(obj, ctx, info);
|
|
34
|
+
|
|
35
|
+
if (errors?.length) {
|
|
36
|
+
const message = `Failed to resolve ${fieldPath}`;
|
|
37
|
+
childLogger.error(message, { errors });
|
|
38
|
+
throw new GraphQLError(message, { nodes: fieldNodes, originalError: errors[0] });
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
childLogger.info(`Successfully resolved ${fieldPath} from ${source}`);
|
|
42
|
+
|
|
43
|
+
if (headers) {
|
|
44
|
+
setCacheMetadata(fieldPath, headers);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return data;
|
|
48
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type QueryEpisodeArgs, type QuerySeasonArgs } from '@tmdb-graphql-api/schema/types';
|
|
2
|
-
import { type
|
|
2
|
+
import { type EnrichedRawEpisode, type EnrichedRawSeason } from '../types.ts';
|
|
3
3
|
import { decodeId } from './decodeId.ts';
|
|
4
4
|
|
|
5
5
|
export const getTvIdSeasonAndEpisode = (
|
|
6
|
-
obj:
|
|
6
|
+
obj: EnrichedRawEpisode | EnrichedRawSeason | undefined,
|
|
7
7
|
args: QuerySeasonArgs | QueryEpisodeArgs
|
|
8
8
|
) => {
|
|
9
9
|
let id: string | number;
|
|
@@ -12,10 +12,10 @@ export const getTvIdSeasonAndEpisode = (
|
|
|
12
12
|
|
|
13
13
|
if (obj) {
|
|
14
14
|
id = obj.tv_show_id;
|
|
15
|
-
seasonNumber = obj.season_number;
|
|
15
|
+
seasonNumber = obj.season_number ?? 0;
|
|
16
16
|
episodeNumber = 'episode_number' in obj ? obj.episode_number : undefined;
|
|
17
17
|
} else {
|
|
18
|
-
const parsed = decodeId<{ episodeNumber?: number; id: string; seasonNumber: number }>(args.id
|
|
18
|
+
const parsed = decodeId<{ episodeNumber?: number; id: string; seasonNumber: number }>(args.id);
|
|
19
19
|
id = parsed.id;
|
|
20
20
|
seasonNumber = parsed.seasonNumber;
|
|
21
21
|
episodeNumber = parsed.episodeNumber;
|
package/src/main.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Certifications, type MediaType, type ScreenType } from '@tmdb-graphql-api/schema/types';
|
|
1
|
+
import { type Certifications, type MediaType, type ScreenType, type SearchType } from '@tmdb-graphql-api/schema/types';
|
|
2
2
|
import { makeFallbackFieldResolvers } from './helpers/makeFallbackFieldResolvers.ts';
|
|
3
3
|
import { resolveCertifications } from './queries/certifications.ts';
|
|
4
4
|
import { resolveCollection } from './queries/collection.ts';
|
|
@@ -74,13 +74,7 @@ import { resolveTvTranslations } from './queries/tvTranslations.ts';
|
|
|
74
74
|
import { resolveTvVideos } from './queries/tvVideos.ts';
|
|
75
75
|
import { resolveTvWatchProviders } from './queries/tvWatchProviders.ts';
|
|
76
76
|
import { resolveVideoType } from './queries/videoType.ts';
|
|
77
|
-
import {
|
|
78
|
-
type FieldResolver,
|
|
79
|
-
type RawMedia,
|
|
80
|
-
type RawRatedScreen,
|
|
81
|
-
type RawSearch,
|
|
82
|
-
type SearchMediaType,
|
|
83
|
-
} from './types.ts';
|
|
77
|
+
import { type FieldResolver, type RawMediaType, type RawMovie, type RawSearchType, type RawTv } from './types.ts';
|
|
84
78
|
|
|
85
79
|
export const resolvers: Record<string, Record<string, string | number | FieldResolver>> = {
|
|
86
80
|
Certifications: {
|
|
@@ -115,7 +109,7 @@ export const resolvers: Record<string, Record<string, string | number | FieldRes
|
|
|
115
109
|
},
|
|
116
110
|
Media: {
|
|
117
111
|
// eslint-disable-next-line camelcase
|
|
118
|
-
__resolveType: (obj:
|
|
112
|
+
__resolveType: (obj: RawMediaType & { media_type: Capitalize<Lowercase<MediaType>> }) => {
|
|
119
113
|
return obj.media_type;
|
|
120
114
|
},
|
|
121
115
|
},
|
|
@@ -192,13 +186,13 @@ export const resolvers: Record<string, Record<string, string | number | FieldRes
|
|
|
192
186
|
},
|
|
193
187
|
RatedScreen: {
|
|
194
188
|
// eslint-disable-next-line camelcase
|
|
195
|
-
__resolveType: (obj:
|
|
189
|
+
__resolveType: (obj: (RawMovie | RawTv) & { media_type: Capitalize<Lowercase<ScreenType>> }) => {
|
|
196
190
|
return obj.media_type;
|
|
197
191
|
},
|
|
198
192
|
},
|
|
199
193
|
Search: {
|
|
200
194
|
// eslint-disable-next-line camelcase
|
|
201
|
-
__resolveType: (obj:
|
|
195
|
+
__resolveType: (obj: RawSearchType & { media_type: Capitalize<Lowercase<SearchType>> }) => {
|
|
202
196
|
return obj.media_type;
|
|
203
197
|
},
|
|
204
198
|
},
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jest } from '@jest/globals';
|
|
2
|
-
import { CERTIFICATIONS_PATH
|
|
2
|
+
import { CERTIFICATIONS_PATH } from '@tmdb-graphql-api/rest-client';
|
|
3
3
|
import { ScreenType } from '@tmdb-graphql-api/schema/types';
|
|
4
4
|
import movieCertifications from '@tmdb-graphql-api/test-utils/responses/themoviedb/certifications/movie.json';
|
|
5
5
|
import tvCertifications from '@tmdb-graphql-api/test-utils/responses/themoviedb/certifications/tv.json';
|
|
6
6
|
import { mockFetch } from 'fetch-mocked';
|
|
7
|
-
import { type Getta, type ShortcutProperties } from 'getta';
|
|
8
7
|
import { type GraphQLResolveInfo } from 'graphql';
|
|
9
8
|
import { buildEndpoint } from '../__testUtils__/helpers/buildEndpoint.ts';
|
|
9
|
+
import { createMockLogger } from '../__testUtils__/helpers/createMockLogger.ts';
|
|
10
10
|
import { createRestClient } from '../__testUtils__/helpers/createRestClient.ts';
|
|
11
11
|
import { type Context } from '../types.ts';
|
|
12
12
|
import { resolveCertifications } from './certifications.ts';
|
|
@@ -14,16 +14,19 @@ import { resolveCertifications } from './certifications.ts';
|
|
|
14
14
|
const mockedFetch = mockFetch(jest.fn);
|
|
15
15
|
|
|
16
16
|
describe('resolveCertifications >', () => {
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
const context = {
|
|
18
|
+
logger: createMockLogger(jest.fn),
|
|
19
|
+
restClient: createRestClient(),
|
|
20
|
+
setCacheMetadata: jest.fn(),
|
|
21
|
+
tmdbGuestSessionId: 'mock-tmdbGuestSessionId',
|
|
22
|
+
} as unknown as Context;
|
|
19
23
|
|
|
20
|
-
|
|
21
|
-
restClient = createRestClient();
|
|
22
|
-
});
|
|
24
|
+
const info = {} as GraphQLResolveInfo;
|
|
23
25
|
|
|
24
26
|
afterEach(async () => {
|
|
25
27
|
mockedFetch.mockReset();
|
|
26
|
-
await restClient.cache?.clear();
|
|
28
|
+
await context.restClient.cache?.clear();
|
|
29
|
+
jest.clearAllMocks();
|
|
27
30
|
});
|
|
28
31
|
|
|
29
32
|
describe("when the screenType is 'MOVIE' >", () => {
|
|
@@ -35,12 +38,7 @@ describe('resolveCertifications >', () => {
|
|
|
35
38
|
|
|
36
39
|
it('should return the movie certifications', async () => {
|
|
37
40
|
await expect(
|
|
38
|
-
resolveCertifications(
|
|
39
|
-
undefined,
|
|
40
|
-
{ screenType: ScreenType.Movie },
|
|
41
|
-
{ restClient, setCacheMetadata, tmdbGuestSessionId: 'mock-tmdbGuestSessionId' } as unknown as Context,
|
|
42
|
-
{} as GraphQLResolveInfo
|
|
43
|
-
)
|
|
41
|
+
resolveCertifications(undefined, { screenType: ScreenType.Movie }, context, info)
|
|
44
42
|
).resolves.toMatchSnapshot();
|
|
45
43
|
});
|
|
46
44
|
});
|
|
@@ -54,12 +52,7 @@ describe('resolveCertifications >', () => {
|
|
|
54
52
|
|
|
55
53
|
it('should return the tv certifications', async () => {
|
|
56
54
|
await expect(
|
|
57
|
-
resolveCertifications(
|
|
58
|
-
undefined,
|
|
59
|
-
{ screenType: ScreenType.Tv },
|
|
60
|
-
{ restClient, setCacheMetadata, tmdbGuestSessionId: 'mock-tmdbGuestSessionId' } as unknown as Context,
|
|
61
|
-
{} as GraphQLResolveInfo
|
|
62
|
-
)
|
|
55
|
+
resolveCertifications(undefined, { screenType: ScreenType.Tv }, context, info)
|
|
63
56
|
).resolves.toMatchSnapshot();
|
|
64
57
|
});
|
|
65
58
|
});
|
|
@@ -1,28 +1,25 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { GraphQLError, type GraphQLResolveInfo } from 'graphql';
|
|
1
|
+
import { type QueryCertificationsArgs } from '@tmdb-graphql-api/schema/types';
|
|
3
2
|
import { CERTIFICATIONS } from '../constants.ts';
|
|
4
|
-
import {
|
|
3
|
+
import { buildArgsResolver } from '../helpers/buildArgsResolver.ts';
|
|
4
|
+
import { type RawCertifications } from '../types.ts';
|
|
5
5
|
|
|
6
|
-
export const resolveCertifications =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
) => {
|
|
12
|
-
const { data, errors } = await restClient.certifications<{ certifications: Certifications }>(
|
|
13
|
-
{
|
|
14
|
-
pathTemplateData: { type: screenType.toLowerCase() },
|
|
15
|
-
},
|
|
16
|
-
{ requestID, tmdbGuestSessionId }
|
|
17
|
-
);
|
|
6
|
+
export const resolveCertifications = buildArgsResolver<QueryCertificationsArgs, RawCertifications['certifications']>(
|
|
7
|
+
CERTIFICATIONS,
|
|
8
|
+
async (args, ctx) => {
|
|
9
|
+
const { screenType } = args;
|
|
10
|
+
const { requestID, restClient, tmdbGuestSessionId } = ctx;
|
|
18
11
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
12
|
+
const { data, errors } = await restClient.certifications<RawCertifications>(
|
|
13
|
+
{
|
|
14
|
+
pathTemplateData: { type: screenType.toLowerCase() },
|
|
15
|
+
},
|
|
16
|
+
{ requestID, tmdbGuestSessionId }
|
|
17
|
+
);
|
|
25
18
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
return {
|
|
20
|
+
data: data?.certifications,
|
|
21
|
+
errors,
|
|
22
|
+
headers: new Headers({ cacheControl: 'public, max-age=28800' }),
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jest } from '@jest/globals';
|
|
2
|
-
import { COLLECTION_PATH
|
|
2
|
+
import { COLLECTION_PATH } from '@tmdb-graphql-api/rest-client';
|
|
3
3
|
import collectionDetails from '@tmdb-graphql-api/test-utils/responses/themoviedb/collection/details.json';
|
|
4
4
|
import { mockFetch } from 'fetch-mocked';
|
|
5
|
-
import { type Getta, type ShortcutProperties } from 'getta';
|
|
6
5
|
import { type GraphQLResolveInfo } from 'graphql';
|
|
7
6
|
import { buildEndpoint } from '../__testUtils__/helpers/buildEndpoint.ts';
|
|
7
|
+
import { createMockLogger } from '../__testUtils__/helpers/createMockLogger.ts';
|
|
8
8
|
import { createRestClient } from '../__testUtils__/helpers/createRestClient.ts';
|
|
9
9
|
import { type Context } from '../types.ts';
|
|
10
10
|
import { resolveCollection } from './collection.ts';
|
|
@@ -12,13 +12,16 @@ import { resolveCollection } from './collection.ts';
|
|
|
12
12
|
const mockedFetch = mockFetch(jest.fn);
|
|
13
13
|
|
|
14
14
|
describe('resolveCollection >', () => {
|
|
15
|
-
let restClient: Getta & ShortcutProperties<ShortcutMethodNames>;
|
|
16
|
-
const setCacheMetadata = jest.fn();
|
|
17
15
|
const id = 10;
|
|
18
16
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
const context = {
|
|
18
|
+
logger: createMockLogger(jest.fn),
|
|
19
|
+
restClient: createRestClient(),
|
|
20
|
+
setCacheMetadata: jest.fn(),
|
|
21
|
+
tmdbGuestSessionId: 'mock-tmdbGuestSessionId',
|
|
22
|
+
} as unknown as Context;
|
|
23
|
+
|
|
24
|
+
const info = {} as GraphQLResolveInfo;
|
|
22
25
|
|
|
23
26
|
beforeEach(() => {
|
|
24
27
|
mockedFetch.mockGetOnce(buildEndpoint(COLLECTION_PATH, { id }), {
|
|
@@ -28,19 +31,13 @@ describe('resolveCollection >', () => {
|
|
|
28
31
|
|
|
29
32
|
afterEach(async () => {
|
|
30
33
|
mockedFetch.mockReset();
|
|
31
|
-
await restClient.cache?.clear();
|
|
34
|
+
await context.restClient.cache?.clear();
|
|
35
|
+
jest.clearAllMocks();
|
|
32
36
|
});
|
|
33
37
|
|
|
34
38
|
describe('when a collection id >', () => {
|
|
35
39
|
it('should return the collection details', async () => {
|
|
36
|
-
await expect(
|
|
37
|
-
resolveCollection(
|
|
38
|
-
undefined,
|
|
39
|
-
{ id },
|
|
40
|
-
{ restClient, setCacheMetadata, tmdbGuestSessionId: 'mock-tmdbGuestSessionId' } as unknown as Context,
|
|
41
|
-
{} as GraphQLResolveInfo
|
|
42
|
-
)
|
|
43
|
-
).resolves.toMatchSnapshot();
|
|
40
|
+
await expect(resolveCollection(undefined, { id: String(id) }, context, info)).resolves.toMatchSnapshot();
|
|
44
41
|
});
|
|
45
42
|
});
|
|
46
43
|
});
|
|
@@ -1,23 +1,26 @@
|
|
|
1
1
|
import { type QueryCollectionArgs } from '@tmdb-graphql-api/schema/types';
|
|
2
|
-
import { GraphQLError, type GraphQLResolveInfo } from 'graphql';
|
|
3
2
|
import { isUndefined, snakeCase } from 'lodash-es';
|
|
4
3
|
import { COLLECTION } from '../constants.ts';
|
|
5
|
-
import {
|
|
4
|
+
import { buildObjArgsResolver } from '../helpers/buildObjArgsResolver.ts';
|
|
5
|
+
import { type RawCollection } from '../types.ts';
|
|
6
6
|
|
|
7
|
-
export const resolveCollection =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
export const resolveCollection = buildObjArgsResolver<
|
|
8
|
+
RawCollection,
|
|
9
|
+
QueryCollectionArgs,
|
|
10
|
+
RawCollection | RawCollection[keyof RawCollection]
|
|
11
|
+
>(COLLECTION, async (obj, args, ctx, info) => {
|
|
12
|
+
const id = obj?.id ?? args.id;
|
|
13
|
+
const { requestID, restClient, tmdbGuestSessionId } = ctx;
|
|
14
|
+
const { fieldName } = info;
|
|
13
15
|
const typedFieldName = snakeCase(fieldName) as keyof RawCollection;
|
|
14
16
|
|
|
15
17
|
if (obj && !isUndefined(obj[typedFieldName])) {
|
|
16
|
-
return
|
|
18
|
+
return {
|
|
19
|
+
data: obj[typedFieldName],
|
|
20
|
+
source: 'parentNode',
|
|
21
|
+
};
|
|
17
22
|
}
|
|
18
23
|
|
|
19
|
-
const id = obj ? obj.id : args.id;
|
|
20
|
-
|
|
21
24
|
const { data, errors, headers } = await restClient.collection<RawCollection>(
|
|
22
25
|
{
|
|
23
26
|
pathTemplateData: { id },
|
|
@@ -25,15 +28,9 @@ export const resolveCollection = async (
|
|
|
25
28
|
{ requestID, tmdbGuestSessionId }
|
|
26
29
|
);
|
|
27
30
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return data![typedFieldName];
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
setCacheMetadata(COLLECTION, headers);
|
|
38
|
-
return data;
|
|
39
|
-
};
|
|
31
|
+
return {
|
|
32
|
+
data: obj ? data?.[typedFieldName] : data,
|
|
33
|
+
errors,
|
|
34
|
+
headers,
|
|
35
|
+
};
|
|
36
|
+
});
|
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import { jest } from '@jest/globals';
|
|
2
|
-
import { COLLECTION_PATH
|
|
2
|
+
import { COLLECTION_PATH } from '@tmdb-graphql-api/rest-client';
|
|
3
3
|
import collectionDetails from '@tmdb-graphql-api/test-utils/responses/themoviedb/collection/details.json';
|
|
4
4
|
import collectionImages from '@tmdb-graphql-api/test-utils/responses/themoviedb/collection/images.json';
|
|
5
5
|
import { mockFetch } from 'fetch-mocked';
|
|
6
|
-
import { type Getta, type ShortcutProperties } from 'getta';
|
|
7
6
|
import { buildEndpoint } from '../__testUtils__/helpers/buildEndpoint.ts';
|
|
8
7
|
import { buildResolveInfoArgument } from '../__testUtils__/helpers/buildResolveInfoArg.ts';
|
|
8
|
+
import { createMockLogger } from '../__testUtils__/helpers/createMockLogger.ts';
|
|
9
9
|
import { createRestClient } from '../__testUtils__/helpers/createRestClient.ts';
|
|
10
|
-
import {
|
|
10
|
+
import { BACKDROPS, COLLECTION, POSTERS } from '../constants.ts';
|
|
11
|
+
import { type Context } from '../types.ts';
|
|
11
12
|
import { resolveCollectionImages } from './collectionImages.ts';
|
|
12
13
|
|
|
13
14
|
const mockedFetch = mockFetch(jest.fn);
|
|
14
15
|
|
|
15
16
|
describe('resolveCollectionImages >', () => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
17
|
+
const context = {
|
|
18
|
+
logger: createMockLogger(jest.fn),
|
|
19
|
+
restClient: createRestClient(),
|
|
20
|
+
setCacheMetadata: jest.fn(),
|
|
21
|
+
tmdbGuestSessionId: 'mock-tmdbGuestSessionId',
|
|
22
|
+
} as unknown as Context;
|
|
22
23
|
|
|
23
24
|
beforeEach(() => {
|
|
24
25
|
mockedFetch.mockGetOnce(buildEndpoint(COLLECTION_PATH, { id: 10, type: 'images' }), {
|
|
@@ -28,7 +29,8 @@ describe('resolveCollectionImages >', () => {
|
|
|
28
29
|
|
|
29
30
|
afterEach(async () => {
|
|
30
31
|
mockedFetch.mockReset();
|
|
31
|
-
await restClient.cache?.clear();
|
|
32
|
+
await context.restClient.cache?.clear();
|
|
33
|
+
jest.clearAllMocks();
|
|
32
34
|
});
|
|
33
35
|
|
|
34
36
|
describe('when a query has specified backdrops >', () => {
|
|
@@ -45,16 +47,11 @@ describe('resolveCollectionImages >', () => {
|
|
|
45
47
|
}
|
|
46
48
|
}
|
|
47
49
|
`,
|
|
48
|
-
[
|
|
50
|
+
[COLLECTION, BACKDROPS]
|
|
49
51
|
);
|
|
50
52
|
|
|
51
53
|
await expect(
|
|
52
|
-
resolveCollectionImages(
|
|
53
|
-
collectionDetails as unknown as RawCollection,
|
|
54
|
-
undefined,
|
|
55
|
-
{ restClient, setCacheMetadata, tmdbGuestSessionId: 'mock-tmdbGuestSessionId' } as unknown as Context,
|
|
56
|
-
resolveInfo
|
|
57
|
-
)
|
|
54
|
+
resolveCollectionImages(collectionDetails, undefined, context, resolveInfo)
|
|
58
55
|
).resolves.toMatchSnapshot();
|
|
59
56
|
});
|
|
60
57
|
});
|
|
@@ -73,16 +70,11 @@ describe('resolveCollectionImages >', () => {
|
|
|
73
70
|
}
|
|
74
71
|
}
|
|
75
72
|
`,
|
|
76
|
-
[
|
|
73
|
+
[COLLECTION, POSTERS]
|
|
77
74
|
);
|
|
78
75
|
|
|
79
76
|
await expect(
|
|
80
|
-
resolveCollectionImages(
|
|
81
|
-
collectionDetails as unknown as RawCollection,
|
|
82
|
-
undefined,
|
|
83
|
-
{ restClient, setCacheMetadata, tmdbGuestSessionId: 'mock-tmdbGuestSessionId' } as unknown as Context,
|
|
84
|
-
resolveInfo
|
|
85
|
-
)
|
|
77
|
+
resolveCollectionImages(collectionDetails, undefined, context, resolveInfo)
|
|
86
78
|
).resolves.toMatchSnapshot();
|
|
87
79
|
});
|
|
88
80
|
});
|