From a009a2e4b7dd0c7b03544d293e9b32ac667a6b5d Mon Sep 17 00:00:00 2001 From: Blake Joynes Date: Mon, 31 May 2021 23:14:33 -0400 Subject: [PATCH] added tv show endpoints --- package.json | 2 +- src/endpoints/changes.ts | 7 +- src/endpoints/index.ts | 1 + src/endpoints/movies.ts | 41 ++- src/endpoints/tv-shows.ts | 134 +++++++ src/tmdb.ts | 5 + src/types/changes.ts | 7 + src/types/credits.ts | 99 +++++ src/types/index.ts | 102 ++++++ src/types/movie.ts | 346 ------------------ src/types/movies.ts | 157 ++++++++ src/types/tv-shows.ts | 275 ++++++++++++++ ...atch-providers.d.ts => watch-providers.ts} | 0 13 files changed, 807 insertions(+), 369 deletions(-) create mode 100644 src/endpoints/tv-shows.ts delete mode 100644 src/types/movie.ts create mode 100644 src/types/movies.ts create mode 100644 src/types/tv-shows.ts rename src/types/{watch-providers.d.ts => watch-providers.ts} (100%) diff --git a/package.json b/package.json index 998aa9d..7bb9a91 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tmdb-ts", - "version": "0.0.7", + "version": "0.0.8", "description": "TMDB v3 library wrapper", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/endpoints/changes.ts b/src/endpoints/changes.ts index e752c6f..0cdd6f6 100644 --- a/src/endpoints/changes.ts +++ b/src/endpoints/changes.ts @@ -1,12 +1,7 @@ import querystring, { ParsedUrlQueryInput } from 'querystring'; import { BaseEndpoint } from './base'; -import { Changes } from '../types/changes'; +import { ChangeOptions, Changes } from '../types/changes'; -export interface ChangeOptions extends ParsedUrlQueryInput { - end_date?: string; - start_date?: string; - page?: number; -} export class ChangeEndpoint extends BaseEndpoint { constructor(protected readonly accessToken: string) { diff --git a/src/endpoints/index.ts b/src/endpoints/index.ts index 04d76d8..e613363 100644 --- a/src/endpoints/index.ts +++ b/src/endpoints/index.ts @@ -8,3 +8,4 @@ export * from './search'; export * from './genre'; export * from './movies'; export * from './configuration'; +export * from './tv-shows'; diff --git a/src/endpoints/movies.ts b/src/endpoints/movies.ts index b7374c3..92a2f7c 100644 --- a/src/endpoints/movies.ts +++ b/src/endpoints/movies.ts @@ -1,17 +1,26 @@ import { BaseEndpoint } from './base'; import { AlternativeTitles, + ChangeOptions, Credits, + ExternalIds, Images, - Keywords, LatestMovie, MovieChanges, - MovieDetails, MovieLists, MovieRecommendations, MovieReviews, MoviesPlayingNow, MovieTranslations, PopularMovies, + Keywords, + LatestMovie, + MovieChanges, + MovieDetails, + MovieLists, + MoviesPlayingNow, + PopularMovies, + Recommendations, ReleaseDates, - SimilarMovies, TopRatedMovies, UpcomingMovies, + Reviews, + SimilarMovies, + TopRatedMovies, Translations, + UpcomingMovies, Videos, -} from '../types/movie'; -import { ExternalIds } from '../types'; -import { WatchProviders } from '../types/watch-providers'; -import { ChangeOptions } from './changes'; + WatchProviders, +} from '../types'; import querystring from 'querystring'; const BASE_MOVIE = '/movie'; @@ -55,18 +64,18 @@ export class MoviesEndpoint extends BaseEndpoint{ return await this.api.get(`${BASE_MOVIE}/${id}/lists?${params}`); } - async recommendations(id: number, options?: {page?: number}): Promise{ + async recommendations(id: number, options?: {page?: number}): Promise{ const params = querystring.encode(options); - return await this.api.get(`${BASE_MOVIE}/${id}/recommendations?${params}`); + return await this.api.get(`${BASE_MOVIE}/${id}/recommendations?${params}`); } async releaseDates(id: number): Promise{ return await this.api.get(`${BASE_MOVIE}/${id}/release_dates`); } - async reviews(id: number, options?: {page?: number}): Promise{ + async reviews(id: number, options?: {page?: number}): Promise{ const params = querystring.encode(options); - return await this.api.get(`${BASE_MOVIE}/${id}/reviews?${params}`); + return await this.api.get(`${BASE_MOVIE}/${id}/reviews?${params}`); } async similar(id: number, options?: {page?: number}): Promise{ @@ -74,8 +83,8 @@ export class MoviesEndpoint extends BaseEndpoint{ return await this.api.get(`${BASE_MOVIE}/${id}/similar?${params}`); } - async translations(id: number): Promise{ - return await this.api.get(`${BASE_MOVIE}/${id}/translations`); + async translations(id: number): Promise{ + return await this.api.get(`${BASE_MOVIE}/${id}/translations`); } async videos(id: number): Promise{ @@ -94,7 +103,7 @@ export class MoviesEndpoint extends BaseEndpoint{ return await this.api.get(`${BASE_MOVIE}/latest`); } - async nowPlaying(options?: {page?: number, region?: string}): Promise{ + async nowPlaying(options?: {page?: number, region?: string, language?: string}): Promise{ const params = querystring.encode(options); return await this.api.get(`${BASE_MOVIE}/now_playing?${params}`); } @@ -104,12 +113,12 @@ export class MoviesEndpoint extends BaseEndpoint{ return await this.api.get(`${BASE_MOVIE}/popular?${params}`); } - async topRated(options?: {page?: number, region?: string}): Promise{ + async topRated(options?: {page?: number, region?: string, language?: string}): Promise{ const params = querystring.encode(options); return await this.api.get(`${BASE_MOVIE}/top_rated?${params}`); } - async upcoming(options?: {page?: number, region?: string}): Promise{ + async upcoming(options?: {page?: number, region?: string, language?: string}): Promise{ const params = querystring.encode(options); return await this.api.get(`${BASE_MOVIE}/upcoming?${params}`); } diff --git a/src/endpoints/tv-shows.ts b/src/endpoints/tv-shows.ts new file mode 100644 index 0000000..78654c0 --- /dev/null +++ b/src/endpoints/tv-shows.ts @@ -0,0 +1,134 @@ +import { BaseEndpoint } from './base'; +import { + AlternativeTitles, + ChangeOptions, + ContentRatings, + Credits, + EpisodeGroups, + ExternalIds, + Images, + Keywords, + LatestTvShows, + OnTheAir, + PopularTvShows, + Recommendations, + Reviews, + ScreenedTheatrically, + SimilarTvShows, + TopRatedTvShows, + Translations, + TvShowChanges, + TvShowDetails, + TvShowsAiringToday, + Videos, + WatchProviders, +} from '../types'; +import querystring from 'querystring'; + +const BASE_TV = '/tv'; + +export class TvShowsEndpoint extends BaseEndpoint{ + constructor(protected readonly accessToken: string) { + super(accessToken); + } + + async details(id: number): Promise{ + return await this.api.get(`${BASE_TV}/${id}`); + } + + async alternativeTitles(id: number): Promise{ + return await this.api.get(`${BASE_TV}/${id}/alternative_titles`); + } + + async changes(id: number, options?: ChangeOptions): Promise{ + const params = querystring.encode(options); + return await this.api.get(`${BASE_TV}/${id}/changes?${params}`); + } + + async contentRatings(id: number): Promise{ + return await this.api.get(`${BASE_TV}/${id}/content_ratings`); + } + + async credits(id: number): Promise{ + return await this.api.get(`${BASE_TV}/${id}/credits`); + } + + + async episodeGroups(id: number): Promise{ + return await this.api.get(`${BASE_TV}/${id}/episode_groups`); + } + + async externalIds(id: number): Promise{ + return await this.api.get(`${BASE_TV}/${id}/external_ids`); + } + + async images(id: number): Promise{ + return await this.api.get(`${BASE_TV}/${id}/images`); + } + + async keywords(id: number): Promise{ + return await this.api.get(`${BASE_TV}/${id}/keywords`); + } + + async recommendations(id: number, options?: {page?: number}): Promise{ + const params = querystring.encode(options); + return await this.api.get(`${BASE_TV}/${id}/recommendations?${params}`); + } + + async reviews(id: number, options?: {page?: number}): Promise{ + const params = querystring.encode(options); + return await this.api.get(`${BASE_TV}/${id}/reviews?${params}`); + } + + async screenedTheatrically(id: number, options?: {page?: number}): Promise{ + const params = querystring.encode(options); + return await this.api.get(`${BASE_TV}/${id}/screened_theatrically`); + } + + async similar(id: number, options?: {page?: number}): Promise{ + const params = querystring.encode(options); + return await this.api.get(`${BASE_TV}/${id}/similar?${params}`); + } + + async translations(id: number): Promise{ + return await this.api.get(`${BASE_TV}/${id}/translations`); + } + + async videos(id: number): Promise{ + return await this.api.get(`${BASE_TV}/${id}/videos`); + } + + /** + * Powered by JustWatch + * @param id + */ + async watchProviders(id: number): Promise{ + return await this.api.get(`${BASE_TV}/${id}/watch/providers`); + } + + async latest(): Promise{ + return await this.api.get(`${BASE_TV}/latest`); + } + + async onTheAir(): Promise{ + return await this.api.get(`${BASE_TV}/on_the_air`); + } + + async airingToday(options?: {page?: number, region?: string, language?: string}): Promise{ + const params = querystring.encode(options); + return await this.api.get(`${BASE_TV}/airing_today?${params}`); + } + + async popular(options?: {page?: number}): Promise{ + const params = querystring.encode(options); + return await this.api.get(`${BASE_TV}/popular?${params}`); + } + + async topRated(options?: {page?: number, region?: string, language?: string}): Promise{ + const params = querystring.encode(options); + return await this.api.get(`${BASE_TV}/top_rated?${params}`); + } + +} + + diff --git a/src/tmdb.ts b/src/tmdb.ts index cb51150..8e5283a 100644 --- a/src/tmdb.ts +++ b/src/tmdb.ts @@ -6,6 +6,7 @@ import { GenreEndpoint, MoviesEndpoint, SearchEndpoint, + TvShowsEndpoint, ConfigurationEndpoint, } from './endpoints'; @@ -47,4 +48,8 @@ export default class TMDB { get movies(): MoviesEndpoint{ return new MoviesEndpoint(this.accessToken); } + + get tvShows(): TvShowsEndpoint{ + return new TvShowsEndpoint(this.accessToken); + } } diff --git a/src/types/changes.ts b/src/types/changes.ts index c5f59dd..04489ea 100644 --- a/src/types/changes.ts +++ b/src/types/changes.ts @@ -1,3 +1,5 @@ +import { ParsedUrlQueryInput } from 'querystring'; + export interface Change { id: number; adult: boolean | undefined; @@ -10,3 +12,8 @@ export interface Changes{ total_results: number; } +export interface ChangeOptions extends ParsedUrlQueryInput { + end_date?: string; + start_date?: string; + page?: number; +} diff --git a/src/types/credits.ts b/src/types/credits.ts index b0da2ce..ec35fd7 100644 --- a/src/types/credits.ts +++ b/src/types/credits.ts @@ -36,3 +36,102 @@ export interface CreditResponse { person?: Person; } +export interface Title { + iso_3166_1: string; + title: string; + type: string; +} + +export interface AlternativeTitles { + id: number; + titles: Title[]; +} + +export interface Cast { + adult: boolean; + gender: number; + id: number; + known_for_department: string; + name: string; + original_name: string; + popularity: number; + profile_path: string; + cast_id: number; + character: string; + credit_id: string; + order: number; +} + +export interface Crew { + adult: boolean; + gender: number; + id: number; + known_for_department: string; + name: string; + original_name: string; + popularity: number; + profile_path: string; + credit_id: string; + department: string; + job: string; +} + +export interface Credits { + id: number; + cast: Cast[]; + crew: Crew[]; +} + + +export interface Backdrop { + aspect_ratio: number; + file_path: string; + height: number; + iso_639_1?: any; + vote_average: number; + vote_count: number; + width: number; +} + +export interface Poster { + aspect_ratio: number; + file_path: string; + height: number; + iso_639_1: string; + vote_average: number; + vote_count: number; + width: number; +} + +export interface Images { + id: number; + backdrops: Backdrop[]; + posters: Poster[]; +} + + +export interface Video { + id: string; + iso_639_1: string; + iso_3166_1: string; + key: string; + name: string; + site: string; + size: number; + type: string; +} + +export interface Videos { + id: number; + results: Video[]; +} + +export interface Keywords { + id: number; + keywords: Array<{ + id: number; + name: string; + }> + +} + diff --git a/src/types/index.ts b/src/types/index.ts index fdcebbf..e932cd4 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -1,7 +1,17 @@ export * from './certification'; export * from './credits'; export * from './changes'; +export * from './movies'; +export * from './search'; +export * from './tv-shows'; +export * from './watch-providers'; +export interface AuthorDetails { + name: string; + username: string; + avatar_path: string; + rating?: number; +} export interface KnownFor { id: number; @@ -93,3 +103,95 @@ export interface ExternalIds { twitter_id: string; id: number; } + +export interface ProductionCompany { + id: number; + logo_path: string; + name: string; + origin_country: string; +} + +export interface ProductionCountry { + iso_3166_1: string; + name: string; +} + +export interface SpokenLanguage { + english_name: string; + iso_639_1: string; + name: string; +} + +export interface ContentRatings{ + results: ContentRatingsResult[]; + id: number; +} + +export interface ContentRatingsResult { + iso_3166_1: string; + rating: string; +} + + +export interface Recommendation { + adult: boolean; + backdrop_path?: any; + genre_ids: number[]; + id: number; + original_language: string; + original_title: string; + overview: string; + release_date: string; + poster_path?: any; + popularity: number; + title: string; + video: boolean; + vote_average: number; + vote_count: number; +} + + +export interface Recommendations { + page: number; + results: Recommendation[]; + total_pages: number; + total_results: number; +} + +export interface Review { + author: string; + author_details: AuthorDetails; + content: string; + created_at: Date; + id: string; + updated_at: Date; + url: string; +} + +export interface Reviews { + id: number; + page: number; + results: Review[]; + total_pages: number; + total_results: number; +} + + +export interface TranslationData { + title: string; + overview: string; + homepage: string; +} + +export interface Translation { + iso_3166_1: string; + iso_639_1: string; + name: string; + english_name: string; + data: TranslationData; +} + +export interface Translations { + id: number; + translations: Translation[]; +} diff --git a/src/types/movie.ts b/src/types/movie.ts deleted file mode 100644 index da54111..0000000 --- a/src/types/movie.ts +++ /dev/null @@ -1,346 +0,0 @@ -import { Genre, Movie } from './index'; - -export interface ProductionCompany { - id: number; - logo_path: string; - name: string; - origin_country: string; -} - -export interface ProductionCountry { - iso_3166_1: string; - name: string; -} - -export interface SpokenLanguage { - iso_639_1: string; - name: string; -} - -export interface MovieDetails { - adult: boolean; - backdrop_path: string; - belongs_to_collection?: any; - budget: number; - genres: Genre[]; - homepage: string; - id: number; - imdb_id: string; - original_language: string; - original_title: string; - overview: string; - popularity: number; - poster_path?: any; - production_companies: ProductionCompany[]; - production_countries: ProductionCountry[]; - release_date: string; - revenue: number; - runtime: number; - spoken_languages: SpokenLanguage[]; - status: string; - tagline: string; - title: string; - video: boolean; - vote_average: number; - vote_count: number; -} - - -export interface Title { - iso_3166_1: string; - title: string; - type: string; -} - -export interface AlternativeTitles { - id: number; - titles: Title[]; -} - -export interface Cast { - adult: boolean; - gender: number; - id: number; - known_for_department: string; - name: string; - original_name: string; - popularity: number; - profile_path: string; - cast_id: number; - character: string; - credit_id: string; - order: number; -} - -export interface Crew { - adult: boolean; - gender: number; - id: number; - known_for_department: string; - name: string; - original_name: string; - popularity: number; - profile_path: string; - credit_id: string; - department: string; - job: string; -} - -export interface Credits { - id: number; - cast: Cast[]; - crew: Crew[]; -} - - -export interface Backdrop { - aspect_ratio: number; - file_path: string; - height: number; - iso_639_1?: any; - vote_average: number; - vote_count: number; - width: number; -} - -export interface Poster { - aspect_ratio: number; - file_path: string; - height: number; - iso_639_1: string; - vote_average: number; - vote_count: number; - width: number; -} - -export interface Images { - id: number; - backdrops: Backdrop[]; - posters: Poster[]; -} - - -export interface Video { - id: string; - iso_639_1: string; - iso_3166_1: string; - key: string; - name: string; - site: string; - size: number; - type: string; -} - -export interface Videos { - id: number; - results: Video[]; -} - -export interface Keywords { - id: number; - keywords: Array<{ - id: number; - name: string; - }> - -} - -export interface ReleaseDate { - certification: string; - iso_639_1: string; - release_date: Date; - type: number; - note: string; -} - -export interface ReleaseDateResult { - iso_3166_1: string; - release_dates: ReleaseDate[]; -} - -export interface ReleaseDates { - id: number; - results: ReleaseDateResult[]; -} - - -export interface SimilarMovies { - page: number; - results: Movie[]; - total_pages: number; - total_results: number; -} - - -export interface AuthorDetails { - name: string; - username: string; - avatar_path: string; - rating?: number; -} - -export interface Review { - author: string; - author_details: AuthorDetails; - content: string; - created_at: Date; - id: string; - updated_at: Date; - url: string; -} - -export interface MovieReviews { - id: number; - page: number; - results: Review[]; - total_pages: number; - total_results: number; -} - - -export interface TranslationData { - title: string; - overview: string; - homepage: string; -} - -export interface Translation { - iso_3166_1: string; - iso_639_1: string; - name: string; - english_name: string; - data: TranslationData; -} - -export interface MovieTranslations { - id: number; - translations: Translation[]; -} - - -export interface MovieList { - description: string; - favorite_count: number; - id: number; - item_count: number; - iso_639_1: string; - list_type: string; - name: string; - poster_path: string; -} - -export interface MovieLists { - id: number; - page: number; - results: MovieList[]; - total_pages: number; - total_results: number; -} - - -export interface MovieChangeItem { - id: string; - action: string; - time: string; - iso_639_1: string; - value: string; - original_value: string; -} - -export interface MovieChange { - key: string; - items: MovieChangeItem[]; -} - -export interface MovieChanges { - changes: MovieChange[]; -} - - -export interface MovieRecommendation { - adult: boolean; - backdrop_path?: any; - genre_ids: number[]; - id: number; - original_language: string; - original_title: string; - overview: string; - release_date: string; - poster_path?: any; - popularity: number; - title: string; - video: boolean; - vote_average: number; - vote_count: number; -} - -export interface MovieRecommendations { - page: number; - results: MovieRecommendation[]; - total_pages: number; - total_results: number; -} - - -export interface LatestMovie { - adult: boolean; - backdrop_path?: any; - belongs_to_collection?: any; - budget: number; - genres: Genre[]; - homepage: string; - id: number; - imdb_id: string; - original_language: string; - original_title: string; - overview: string; - popularity: number; - poster_path: string; - production_companies: any[]; - production_countries: any[]; - release_date: string; - revenue: number; - runtime: number; - spoken_languages: any[]; - status: string; - tagline: string; - title: string; - video: boolean; - vote_average: number; - vote_count: number; -} - - -export interface Dates { - maximum: string; - minimum: string; -} - -export interface MoviesPlayingNow { - page: number; - results: Movie[]; - dates: Dates; - total_pages: number; - total_results: number; -} - -export interface PopularMovies { - page: number; - results: Movie[]; - total_results: number; - total_pages: number; -} - -export interface TopRatedMovies { - page: number; - results: Movie[]; - total_results: number; - total_pages: number; -} - -export interface UpcomingMovies { - page: number; - results: Movie[]; - total_results: number; - total_pages: number; -} diff --git a/src/types/movies.ts b/src/types/movies.ts new file mode 100644 index 0000000..34b8ca9 --- /dev/null +++ b/src/types/movies.ts @@ -0,0 +1,157 @@ +import { Genre, Movie, ProductionCompany, ProductionCountry, SpokenLanguage } from './'; + +export interface MovieDetails { + adult: boolean; + backdrop_path: string; + belongs_to_collection?: any; + budget: number; + genres: Genre[]; + homepage: string; + id: number; + imdb_id: string; + original_language: string; + original_title: string; + overview: string; + popularity: number; + poster_path?: any; + production_companies: ProductionCompany[]; + production_countries: ProductionCountry[]; + release_date: string; + revenue: number; + runtime: number; + spoken_languages: SpokenLanguage[]; + status: string; + tagline: string; + title: string; + video: boolean; + vote_average: number; + vote_count: number; +} + + +export interface ReleaseDate { + certification: string; + iso_639_1: string; + release_date: Date; + type: number; + note: string; +} + +export interface ReleaseDateResult { + iso_3166_1: string; + release_dates: ReleaseDate[]; +} + +export interface ReleaseDates { + id: number; + results: ReleaseDateResult[]; +} + + +export interface SimilarMovies { + page: number; + results: Movie[]; + total_pages: number; + total_results: number; +} + +export interface MovieList { + description: string; + favorite_count: number; + id: number; + item_count: number; + iso_639_1: string; + list_type: string; + name: string; + poster_path: string; +} + +export interface MovieLists { + id: number; + page: number; + results: MovieList[]; + total_pages: number; + total_results: number; +} + + +export interface MovieChangeItem { + id: string; + action: string; + time: string; + iso_639_1: string; + value: string; + original_value: string; +} + +export interface MovieChange { + key: string; + items: MovieChangeItem[]; +} + +export interface MovieChanges { + changes: MovieChange[]; +} + +export interface LatestMovie { + adult: boolean; + backdrop_path?: any; + belongs_to_collection?: any; + budget: number; + genres: Genre[]; + homepage: string; + id: number; + imdb_id: string; + original_language: string; + original_title: string; + overview: string; + popularity: number; + poster_path: string; + production_companies: any[]; + production_countries: any[]; + release_date: string; + revenue: number; + runtime: number; + spoken_languages: any[]; + status: string; + tagline: string; + title: string; + video: boolean; + vote_average: number; + vote_count: number; +} + + +export interface Dates { + maximum: string; + minimum: string; +} + +export interface MoviesPlayingNow { + page: number; + results: Movie[]; + dates: Dates; + total_pages: number; + total_results: number; +} + +export interface PopularMovies { + page: number; + results: Movie[]; + total_results: number; + total_pages: number; +} + +export interface TopRatedMovies { + page: number; + results: Movie[]; + total_results: number; + total_pages: number; +} + +export interface UpcomingMovies { + page: number; + results: Movie[]; + total_results: number; + total_pages: number; +} diff --git a/src/types/tv-shows.ts b/src/types/tv-shows.ts new file mode 100644 index 0000000..071b554 --- /dev/null +++ b/src/types/tv-shows.ts @@ -0,0 +1,275 @@ +import { Genre, ProductionCompany, ProductionCountry, SpokenLanguage } from './'; + +export interface CreatedBy { + id: number; + credit_id: string; + name: string; + gender: number; + profile_path: string; +} + +export interface LastEpisodeToAir { + air_date: string; + episode_number: number; + id: number; + name: string; + overview: string; + production_code: string; + season_number: number; + still_path: string; + vote_average: number; + vote_count: number; +} + +export interface Network { + name: string; + id: number; + logo_path: string; + origin_country: string; +} + +export interface Season { + air_date: string; + episode_count: number; + id: number; + name: string; + overview: string; + poster_path: string; + season_number: number; +} + +export interface TvShowDetails { + backdrop_path: string; + created_by: CreatedBy[]; + episode_run_time: number[]; + first_air_date: string; + genres: Genre[]; + homepage: string; + id: number; + in_production: boolean; + languages: string[]; + last_air_date: string; + last_episode_to_air: LastEpisodeToAir; + name: string; + next_episode_to_air?: any; + networks: Network[]; + number_of_episodes: number; + number_of_seasons: number; + origin_country: string[]; + original_language: string; + original_name: string; + overview: string; + popularity: number; + poster_path: string; + production_companies: ProductionCompany[]; + production_countries: ProductionCountry[]; + seasons: Season[]; + spoken_languages: SpokenLanguage[]; + status: string; + tagline: string; + type: string; + vote_average: number; + vote_count: number; +} + +export interface TvShowItem { + id: string; + action: string; + time: string; + value: any; + iso_639_1: string; + original_value: any; +} + +export interface TvShowChange { + key: string; + items: TvShowItem[]; +} + +export interface TvShowChanges { + changes: TvShowChange[]; +} + +export interface Network { + id: number; + logo_path: string; + name: string; + origin_country: string; +} + +export interface EpisodeGroup { + description: string; + episode_count: number; + group_count: number; + id: string; + name: string; + network: Network; + type: number; +} + +export interface EpisodeGroups { + results: EpisodeGroup[]; + id: number; +} + +export interface ScreenedTheatricallyResult { + id: number; + episode_number: number; + season_number: number; +} + +export interface ScreenedTheatrically { + id: number; + results: ScreenedTheatricallyResult[]; +} + + +export interface SimilarTvShow { + backdrop_path: string; + first_air_date: string; + genre_ids: number[]; + id: number; + original_language: string; + original_name: string; + overview: string; + origin_country: string[]; + poster_path: string; + popularity: number; + name: string; + vote_average: number; + vote_count: number; +} + +export interface SimilarTvShows { + page: number; + results: SimilarTvShow[]; + total_pages: number; + total_results: number; +} + +export interface LatestTvShows { + backdrop_path?: any; + created_by: any[]; + episode_run_time: number[]; + first_air_date: string; + genres: Genre[]; + homepage: string; + id: number; + in_production: boolean; + languages: string[]; + last_air_date: string; + name: string; + networks: Network[]; + number_of_episodes: number; + number_of_seasons: number; + origin_country: string[]; + original_language: string; + original_name: string; + overview?: any; + popularity: number; + poster_path?: any; + production_companies: any[]; + seasons: Season[]; + status: string; + type: string; + vote_average: number; + vote_count: number; +} + + +export interface OnTheAirResult { + poster_path: string; + popularity: number; + id: number; + backdrop_path: string; + vote_average: number; + overview: string; + first_air_date: string; + origin_country: string[]; + genre_ids: number[]; + original_language: string; + vote_count: number; + name: string; + original_name: string; +} + +export interface OnTheAir { + page: number; + results: OnTheAirResult[]; + total_results: number; + total_pages: number; +} + + +export interface AiringTodayResult { + poster_path: string; + popularity: number; + id: number; + backdrop_path: string; + vote_average: number; + overview: string; + first_air_date: string; + origin_country: string[]; + genre_ids: number[]; + original_language: string; + vote_count: number; + name: string; + original_name: string; +} + +export interface TvShowsAiringToday { + page: number; + results: AiringTodayResult[]; + total_results: number; + total_pages: number; +} + + +export interface PopularTvShowResult { + poster_path: string; + popularity: number; + id: number; + backdrop_path: string; + vote_average: number; + overview: string; + first_air_date: string; + origin_country: string[]; + genre_ids: number[]; + original_language: string; + vote_count: number; + name: string; + original_name: string; +} + +export interface PopularTvShows { + page: number; + results: PopularTvShowResult[]; + total_results: number; + total_pages: number; +} + + +export interface TopRatedTvShowResult { + poster_path: string; + popularity: number; + id: number; + backdrop_path: string; + vote_average: number; + overview: string; + first_air_date: string; + origin_country: string[]; + genre_ids: number[]; + original_language: string; + vote_count: number; + name: string; + original_name: string; +} + +export interface TopRatedTvShows { + page: number; + results: TopRatedTvShowResult[]; + total_results: number; + total_pages: number; +} + + diff --git a/src/types/watch-providers.d.ts b/src/types/watch-providers.ts similarity index 100% rename from src/types/watch-providers.d.ts rename to src/types/watch-providers.ts