updates types and add watch providers
This commit is contained in:
5
.github/workflows/npm-publish.yml
vendored
5
.github/workflows/npm-publish.yml
vendored
@@ -14,7 +14,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
node-version: 20
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npm test
|
- run: npm test
|
||||||
|
|
||||||
@@ -25,9 +25,10 @@ jobs:
|
|||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
node-version: 20
|
||||||
registry-url: https://registry.npmjs.org/
|
registry-url: https://registry.npmjs.org/
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
|
- run: npm run compile
|
||||||
- run: npm publish
|
- run: npm publish
|
||||||
env:
|
env:
|
||||||
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
|
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
|
||||||
|
|||||||
855
package-lock.json
generated
855
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -34,7 +34,6 @@
|
|||||||
"@types/node": "^20.14.2",
|
"@types/node": "^20.14.2",
|
||||||
"@types/node-fetch": "^3.0.3",
|
"@types/node-fetch": "^3.0.3",
|
||||||
"dotenv": "^16.4.5",
|
"dotenv": "^16.4.5",
|
||||||
"eslint": "^9.4.0",
|
|
||||||
"eslint-config-prettier": "^9.1.0",
|
"eslint-config-prettier": "^9.1.0",
|
||||||
"eslint-plugin-prettier": "^5.1.3",
|
"eslint-plugin-prettier": "^5.1.3",
|
||||||
"globals": "^15.4.0",
|
"globals": "^15.4.0",
|
||||||
@@ -45,7 +44,8 @@
|
|||||||
"typescript-eslint": "^7.12.0"
|
"typescript-eslint": "^7.12.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"cross-fetch": "^4.0.0"
|
"cross-fetch": "^4.0.0",
|
||||||
|
"query-string": "^9.0.0"
|
||||||
},
|
},
|
||||||
"husky": {
|
"husky": {
|
||||||
"hooks": {
|
"hooks": {
|
||||||
|
|||||||
@@ -15,6 +15,6 @@ export class ChangeEndpoint extends BaseEndpoint {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async person(options?: ChangeOption): Promise<MediaChanges> {
|
async person(options?: ChangeOption): Promise<MediaChanges> {
|
||||||
return await this.api.get<MediaChanges>(`/person/change`, options);
|
return await this.api.get<MediaChanges>(`/person/changes`, options);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import {
|
import {
|
||||||
|
CollectionDetails,
|
||||||
CollectionImageOptions,
|
CollectionImageOptions,
|
||||||
DetailedCollection,
|
|
||||||
ImageCollection,
|
ImageCollection,
|
||||||
LanguageOption,
|
LanguageOption,
|
||||||
Translations,
|
Translations,
|
||||||
@@ -17,8 +17,8 @@ export class CollectionsEndpoint extends BaseEndpoint {
|
|||||||
async details(
|
async details(
|
||||||
id: number,
|
id: number,
|
||||||
options?: LanguageOption
|
options?: LanguageOption
|
||||||
): Promise<DetailedCollection> {
|
): Promise<CollectionDetails> {
|
||||||
return await this.api.get<DetailedCollection>(
|
return await this.api.get<CollectionDetails>(
|
||||||
`${BASE_COLLECTION}/${id}`,
|
`${BASE_COLLECTION}/${id}`,
|
||||||
options
|
options
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,12 +1,44 @@
|
|||||||
import { BaseEndpoint } from './base';
|
import { BaseEndpoint } from './base';
|
||||||
import { Configuration } from '../types/configuration';
|
import {
|
||||||
|
Configuration,
|
||||||
|
CountryConfiguration,
|
||||||
|
JobConfiguration,
|
||||||
|
LanguageConfiguration,
|
||||||
|
TimezoneConfiguration,
|
||||||
|
} from '../types/configuration';
|
||||||
|
|
||||||
export class ConfigurationEndpoint extends BaseEndpoint {
|
export class ConfigurationEndpoint extends BaseEndpoint {
|
||||||
constructor(protected readonly accessToken: string) {
|
constructor(protected readonly accessToken: string) {
|
||||||
super(accessToken);
|
super(accessToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getCurrent(): Promise<Configuration> {
|
async getApiConfiguration(): Promise<Configuration> {
|
||||||
return await this.api.get<Configuration>(`/configuration`);
|
return await this.api.get<Configuration>(`/configuration`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async getCountries(): Promise<CountryConfiguration[]> {
|
||||||
|
return await this.api.get<CountryConfiguration[]>(
|
||||||
|
`/configuration/countries`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
async getLanguages(): Promise<LanguageConfiguration[]> {
|
||||||
|
return await this.api.get<LanguageConfiguration[]>(
|
||||||
|
`/configuration/languages`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
async getJobs(): Promise<JobConfiguration[]> {
|
||||||
|
return await this.api.get<JobConfiguration[]>(`/configuration/jobs`);
|
||||||
|
}
|
||||||
|
|
||||||
|
async getPrimaryTranslations(): Promise<string[]> {
|
||||||
|
return await this.api.get<string[]>(`/configuration/primary_translations`);
|
||||||
|
}
|
||||||
|
|
||||||
|
async getTimezones(): Promise<TimezoneConfiguration[]> {
|
||||||
|
return await this.api.get<TimezoneConfiguration[]>(
|
||||||
|
`/configuration/timezones`
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,68 +1,13 @@
|
|||||||
import {
|
import {
|
||||||
MovieDiscoverResult,
|
MovieDiscoverResult,
|
||||||
SortOption,
|
MovieQueryOptions,
|
||||||
TvShowDiscoverResult,
|
TvShowDiscoverResult,
|
||||||
|
TvShowQueryOptions,
|
||||||
} from '../types';
|
} from '../types';
|
||||||
import { BaseEndpoint } from './base';
|
import { BaseEndpoint } from './base';
|
||||||
|
|
||||||
const BASE_DISCOVER = '/discover';
|
const BASE_DISCOVER = '/discover';
|
||||||
|
|
||||||
interface DiscoverQueryOptions {
|
|
||||||
language?: string;
|
|
||||||
sort_by?: SortOption;
|
|
||||||
page?: number;
|
|
||||||
'vote_average.gte'?: number;
|
|
||||||
'vote_count.gte'?: number;
|
|
||||||
'vote_count.lte'?: number;
|
|
||||||
'vote_average.lte'?: number;
|
|
||||||
with_watch_providers?: string;
|
|
||||||
watch_region?: string;
|
|
||||||
without_companies?: string;
|
|
||||||
with_watch_monetization_types?: 'flatrate' | 'free' | 'ads' | 'rent' | 'buy';
|
|
||||||
'with_runtime.gte'?: number;
|
|
||||||
'with_runtime.lte'?: number;
|
|
||||||
with_genres?: string;
|
|
||||||
without_genres?: string;
|
|
||||||
with_original_language?: string;
|
|
||||||
without_keywords?: string;
|
|
||||||
with_keywords?: string;
|
|
||||||
with_companies?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface MovieQueryOptions extends DiscoverQueryOptions {
|
|
||||||
region?: string;
|
|
||||||
certification_country?: string;
|
|
||||||
certification?: string;
|
|
||||||
'certification.lte'?: string;
|
|
||||||
'certification.gte'?: string;
|
|
||||||
include_adult?: boolean;
|
|
||||||
include_video?: boolean;
|
|
||||||
primary_release_year?: number;
|
|
||||||
'primary_release_date.gte'?: string;
|
|
||||||
'primary_release_date.lte'?: string;
|
|
||||||
'release_date.gte'?: string;
|
|
||||||
'release_date.lte'?: string;
|
|
||||||
with_release_type?: string;
|
|
||||||
year?: number;
|
|
||||||
with_cast?: string;
|
|
||||||
with_crew?: string;
|
|
||||||
with_people?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface TvShowQueryOptions extends DiscoverQueryOptions {
|
|
||||||
'air_date.gte'?: string;
|
|
||||||
'air_date.lte'?: string;
|
|
||||||
'first_air_date.gte'?: string;
|
|
||||||
'first_air_date.lte'?: string;
|
|
||||||
first_air_date_year?: number;
|
|
||||||
timezone?: string;
|
|
||||||
with_networks?: string;
|
|
||||||
include_null_first_air_dates?: boolean;
|
|
||||||
screened_theatrically?: boolean;
|
|
||||||
with_status?: string;
|
|
||||||
with_type?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export class DiscoverEndpoint extends BaseEndpoint {
|
export class DiscoverEndpoint extends BaseEndpoint {
|
||||||
constructor(accessToken: string) {
|
constructor(accessToken: string) {
|
||||||
super(accessToken);
|
super(accessToken);
|
||||||
|
|||||||
@@ -6,10 +6,10 @@ export class FindEndpoint extends BaseEndpoint {
|
|||||||
super(accessToken);
|
super(accessToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
async byId(
|
async byExternalId(
|
||||||
externalId: string,
|
id: string,
|
||||||
options: ExternalIdOptions
|
options: ExternalIdOptions
|
||||||
): Promise<FindResult> {
|
): Promise<FindResult> {
|
||||||
return await this.api.get<FindResult>(`/find/${externalId}`, options);
|
return await this.api.get<FindResult>(`/find/${id}`, options);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,3 +16,4 @@ export * from './keywords';
|
|||||||
export * from './collections';
|
export * from './collections';
|
||||||
export * from './tv-seasons';
|
export * from './tv-seasons';
|
||||||
export * from './tv-episode';
|
export * from './tv-episode';
|
||||||
|
export * from './watch-providers';
|
||||||
|
|||||||
@@ -12,6 +12,10 @@ export class KeywordsEndpoint extends BaseEndpoint {
|
|||||||
return await this.api.get<Keyword>(`${BASE_Keyword}/${keywordId}`);
|
return await this.api.get<Keyword>(`${BASE_Keyword}/${keywordId}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @deprecated
|
||||||
|
*/
|
||||||
async belongingMovies(
|
async belongingMovies(
|
||||||
keywordId: number,
|
keywordId: number,
|
||||||
options?: KeywordsOptions
|
options?: KeywordsOptions
|
||||||
|
|||||||
@@ -90,6 +90,9 @@ export class PeopleEndpoint extends BaseEndpoint {
|
|||||||
return await this.api.get<PeopleImages>(`${BASE_PERSON}/${id}/images`);
|
return await this.api.get<PeopleImages>(`${BASE_PERSON}/${id}/images`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated
|
||||||
|
*/
|
||||||
async taggedImages(id: number, options?: PageOption): Promise<TaggedImages> {
|
async taggedImages(id: number, options?: PageOption): Promise<TaggedImages> {
|
||||||
return await this.api.get<TaggedImages>(
|
return await this.api.get<TaggedImages>(
|
||||||
`${BASE_PERSON}/${id}/tagged_images`,
|
`${BASE_PERSON}/${id}/tagged_images`,
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
import { BaseEndpoint } from './base';
|
||||||
|
import {
|
||||||
|
LanguageOption,
|
||||||
|
RegionResult,
|
||||||
|
WatchProviderResult,
|
||||||
|
WatchRegionOption,
|
||||||
|
} from '../types';
|
||||||
|
|
||||||
|
type ProviderOptions = WatchRegionOption & LanguageOption;
|
||||||
|
|
||||||
|
export class WatchProvidersEndpoint extends BaseEndpoint {
|
||||||
|
constructor(protected readonly accessToken: string) {
|
||||||
|
super(accessToken);
|
||||||
|
}
|
||||||
|
|
||||||
|
async getRegions(options?: LanguageOption): Promise<RegionResult> {
|
||||||
|
return await this.api.get<RegionResult>(
|
||||||
|
`/watch/providers/regions`,
|
||||||
|
options
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
async getMovieProviders(
|
||||||
|
options?: ProviderOptions
|
||||||
|
): Promise<WatchProviderResult> {
|
||||||
|
return await this.api.get<WatchProviderResult>(
|
||||||
|
`/watch/providers/movie`,
|
||||||
|
options
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
async getTvProviders(
|
||||||
|
options?: ProviderOptions
|
||||||
|
): Promise<WatchProviderResult> {
|
||||||
|
return await this.api.get<WatchProviderResult>(
|
||||||
|
`/watch/providers/tv`,
|
||||||
|
options
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import {
|
|||||||
CollectionsEndpoint,
|
CollectionsEndpoint,
|
||||||
TvSeasonsEndpoint,
|
TvSeasonsEndpoint,
|
||||||
TvEpisodesEndpoint,
|
TvEpisodesEndpoint,
|
||||||
|
WatchProvidersEndpoint,
|
||||||
} from './endpoints';
|
} from './endpoints';
|
||||||
import { CompaniesEndpoint } from './endpoints/companies';
|
import { CompaniesEndpoint } from './endpoints/companies';
|
||||||
import { NetworksEndpoint } from './endpoints/networks';
|
import { NetworksEndpoint } from './endpoints/networks';
|
||||||
@@ -107,4 +108,8 @@ export class TMDB {
|
|||||||
get tvSeasons(): TvSeasonsEndpoint {
|
get tvSeasons(): TvSeasonsEndpoint {
|
||||||
return new TvSeasonsEndpoint(this.accessToken);
|
return new TvSeasonsEndpoint(this.accessToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get watchProviders(): WatchProvidersEndpoint {
|
||||||
|
return new WatchProvidersEndpoint(this.accessToken);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,14 +6,56 @@ export interface Certification {
|
|||||||
|
|
||||||
export interface Certifications {
|
export interface Certifications {
|
||||||
certifications: {
|
certifications: {
|
||||||
US: Certification[];
|
AR: Certification[];
|
||||||
CA: Certification[];
|
AT: Certification[];
|
||||||
DE: Certification[];
|
|
||||||
GB: Certification[];
|
|
||||||
AU: Certification[];
|
AU: Certification[];
|
||||||
|
BG: Certification[];
|
||||||
BR: Certification[];
|
BR: Certification[];
|
||||||
|
CA: Certification[];
|
||||||
|
'CA-QC': Certification[];
|
||||||
|
CH: Certification[];
|
||||||
|
CL: Certification[];
|
||||||
|
CZ: Certification[];
|
||||||
|
DE: Certification[];
|
||||||
|
DK: Certification[];
|
||||||
|
ES: Certification[];
|
||||||
|
FI: Certification[];
|
||||||
FR: Certification[];
|
FR: Certification[];
|
||||||
NZ: Certification[];
|
GB: Certification[];
|
||||||
|
GR: Certification[];
|
||||||
|
HK: Certification[];
|
||||||
|
HU: Certification[];
|
||||||
|
ID: Certification[];
|
||||||
|
IE: Certification[];
|
||||||
|
IL: Certification[];
|
||||||
IN: Certification[];
|
IN: Certification[];
|
||||||
|
IT: Certification[];
|
||||||
|
JP: Certification[];
|
||||||
|
KR: Certification[];
|
||||||
|
LT: Certification[];
|
||||||
|
LU: Certification[];
|
||||||
|
LV: Certification[];
|
||||||
|
MO: Certification[];
|
||||||
|
MX: Certification[];
|
||||||
|
MY: Certification[];
|
||||||
|
NL: Certification[];
|
||||||
|
NO: Certification[];
|
||||||
|
NZ: Certification[];
|
||||||
|
PH: Certification[];
|
||||||
|
PL: Certification[];
|
||||||
|
PR: Certification[];
|
||||||
|
PT: Certification[];
|
||||||
|
RO: Certification[];
|
||||||
|
RU: Certification[];
|
||||||
|
SE: Certification[];
|
||||||
|
SG: Certification[];
|
||||||
|
SK: Certification[];
|
||||||
|
TH: Certification[];
|
||||||
|
TR: Certification[];
|
||||||
|
TW: Certification[];
|
||||||
|
UA: Certification[];
|
||||||
|
US: Certification[];
|
||||||
|
VI: Certification[];
|
||||||
|
ZA: Certification[];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
export interface MediaChange {
|
export interface MediaChange {
|
||||||
id: number;
|
id: number;
|
||||||
adult: boolean | undefined;
|
adult?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface MediaChanges {
|
export interface MediaChanges {
|
||||||
|
|||||||
@@ -2,16 +2,13 @@ import { LanguageOption, Movie } from '.';
|
|||||||
|
|
||||||
export interface Collection {
|
export interface Collection {
|
||||||
id: number;
|
id: number;
|
||||||
backdrop_path: string;
|
|
||||||
name: string;
|
name: string;
|
||||||
poster_path: string;
|
|
||||||
adult: boolean;
|
|
||||||
original_language: string;
|
|
||||||
original_name: string;
|
|
||||||
overview: string;
|
overview: string;
|
||||||
|
poster_path: string;
|
||||||
|
backdrop_path: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DetailedCollection extends Collection {
|
export interface CollectionDetails extends Collection {
|
||||||
parts: Movie[];
|
parts: Movie[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ export interface CompanyDetails {
|
|||||||
logo_path: string;
|
logo_path: string;
|
||||||
name: string;
|
name: string;
|
||||||
origin_country: string;
|
origin_country: string;
|
||||||
parent_company: ParentCompany;
|
parent_company?: ParentCompany;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ParentCompany {
|
export interface ParentCompany {
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import { CountryCode } from '../types';
|
||||||
|
|
||||||
export interface ImageConfiguration {
|
export interface ImageConfiguration {
|
||||||
base_url: string;
|
base_url: string;
|
||||||
secure_base_url: string;
|
secure_base_url: string;
|
||||||
@@ -13,101 +15,153 @@ export interface Configuration {
|
|||||||
change_keys: ChangeKeys[];
|
change_keys: ChangeKeys[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum BackdropSizes {
|
export interface CountryConfiguration {
|
||||||
W300 = 'w300',
|
iso_3166_1: CountryCode;
|
||||||
W500 = 'w500',
|
english_name: string;
|
||||||
W780 = 'w780',
|
native_name: string;
|
||||||
W1280 = 'w1280',
|
|
||||||
ORIGINAL = 'original',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum LogoSizes {
|
export interface LanguageConfiguration {
|
||||||
W45 = 'w45',
|
iso_639_1: string;
|
||||||
W92 = 'w92',
|
english_name: string;
|
||||||
W154 = 'w154',
|
name: string;
|
||||||
W185 = 'w185',
|
|
||||||
W300 = 'w300',
|
|
||||||
W500 = 'w500',
|
|
||||||
ORIGINAL = 'original',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum PosterSizes {
|
export interface JobConfiguration {
|
||||||
W92 = 'w92',
|
department: string;
|
||||||
W154 = 'w154',
|
jobs: string[];
|
||||||
W185 = 'w185',
|
|
||||||
W300 = 'w300',
|
|
||||||
W342 = 'w342',
|
|
||||||
W500 = 'w500',
|
|
||||||
W780 = 'w780',
|
|
||||||
ORIGINAL = 'original',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum ProfileSizes {
|
export interface TimezoneConfiguration {
|
||||||
W45 = 'w45',
|
iso_3166_1: CountryCode;
|
||||||
W185 = 'w185',
|
zones: string[];
|
||||||
W632 = 'w632',
|
|
||||||
ORIGINAL = 'original',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum StillSizes {
|
export const MediaSize = {
|
||||||
W92 = 'w92',
|
W45: 'w45',
|
||||||
W185 = 'w185',
|
W92: 'w92',
|
||||||
W300 = 'w300',
|
W154: 'w154',
|
||||||
ORIGINAL = 'original',
|
W185: 'w185',
|
||||||
}
|
W300: 'w300',
|
||||||
|
W342: 'w342',
|
||||||
|
W500: 'w500',
|
||||||
|
W632: 'w632',
|
||||||
|
W780: 'w780',
|
||||||
|
W1280: 'w1280',
|
||||||
|
ORIGINAL: 'original',
|
||||||
|
} as const;
|
||||||
|
|
||||||
export enum ChangeKeys {
|
export const BackdropSize = {
|
||||||
ADULT = 'adult',
|
W45: 'w45',
|
||||||
AIR_DATE = 'air_date',
|
W92: 'w92',
|
||||||
ALSO_KNOWN_AS = 'also_known_as',
|
W154: 'w154',
|
||||||
ALTERNATIVE_TITLES = 'alternative_titles',
|
W185: 'w185',
|
||||||
BIOGRAPHY = 'biography',
|
W300: 'w300',
|
||||||
BIRTHDAY = 'birthday',
|
W500: 'w500',
|
||||||
BUDGET = 'budget',
|
W780: 'w780',
|
||||||
CAST = 'cast',
|
W1280: 'w1280',
|
||||||
CERTIFICATIONS = 'certifications',
|
ORIGINAL: 'original',
|
||||||
CHARACTER_NAMES = 'character_names',
|
} as const;
|
||||||
CREATED_BY = 'created_by',
|
|
||||||
CREW = 'crew',
|
type BackdropSizes = (typeof BackdropSize)[keyof typeof BackdropSize];
|
||||||
DEATHDAY = 'deathday',
|
|
||||||
EPISODE = 'episode',
|
export const LogoSize = {
|
||||||
EPISODE_NUMBER = 'episode_number',
|
W45: 'w45',
|
||||||
EPISODE_RUN_TIME = 'episode_run_time',
|
W92: 'w92',
|
||||||
FREEBASE_ID = 'freebase_id',
|
W154: 'w154',
|
||||||
FREEBASE_MID = 'freebase_mid',
|
W185: 'w185',
|
||||||
GENERAL = 'general',
|
W300: 'w300',
|
||||||
GENRES = 'genres',
|
W500: 'w500',
|
||||||
GUEST_STARS = 'guest_stars',
|
ORIGINAL: 'original',
|
||||||
HOMEPAGE = 'homepage',
|
} as const;
|
||||||
IMAGES = 'images',
|
|
||||||
IMDB_ID = 'imdb_id',
|
type LogoSizes = (typeof LogoSize)[keyof typeof LogoSize];
|
||||||
LANGUAGES = 'languages',
|
|
||||||
NAME = 'name',
|
export const PosterSize = {
|
||||||
NETWORK = 'network',
|
W92: 'w92',
|
||||||
ORIGIN_COUNTRY = 'origin_country',
|
W154: 'w154',
|
||||||
ORIGINAL_NAME = 'original_name',
|
W185: 'w185',
|
||||||
ORIGINAL_TITLE = 'original_title',
|
W300: 'w300',
|
||||||
OVERVIEW = 'overview',
|
W342: 'w342',
|
||||||
PARTS = 'parts',
|
W500: 'w500',
|
||||||
PLACE_OF_BIRTH = 'place_of_birth',
|
W780: 'w780',
|
||||||
PLOT_KEYWORDS = 'plot_keywords',
|
ORIGINAL: 'original',
|
||||||
PRODUCTION_CODE = 'production_code',
|
} as const;
|
||||||
PRODUCTION_COMPANIES = 'production_companies',
|
|
||||||
PRODUCTION_COUNTRIES = 'production_countries',
|
type PosterSizes = (typeof PosterSize)[keyof typeof PosterSize];
|
||||||
RELEASES = 'releases',
|
|
||||||
REVENUE = 'revenue',
|
export const ProfileSize = {
|
||||||
RUNTIME = 'runtime',
|
W45: 'w45',
|
||||||
SEASON = 'season',
|
W185: 'w185',
|
||||||
SEASON_NUMBER = 'season_number',
|
W632: 'w632',
|
||||||
SEASON_REGULAR = 'season_regular',
|
ORIGINAL: 'original',
|
||||||
SPOKEN_LANGUAGES = 'spoken_languages',
|
} as const;
|
||||||
STATUS = 'status',
|
|
||||||
TAGLINE = 'tagline',
|
type ProfileSizes = (typeof ProfileSize)[keyof typeof ProfileSize];
|
||||||
TITLE = 'title',
|
|
||||||
TRANSLATIONS = 'translations',
|
export const StillSize = {
|
||||||
TVDB_ID = 'tvdb_id',
|
W92: 'w92',
|
||||||
TVRAGE_ID = 'tvrage_id',
|
W185: 'w185',
|
||||||
TYPE = 'type',
|
W300: 'w300',
|
||||||
VIDEO = 'video',
|
ORIGINAL: 'original',
|
||||||
VIDEOS = 'videos',
|
} as const;
|
||||||
}
|
|
||||||
|
type StillSizes = (typeof StillSize)[keyof typeof StillSize];
|
||||||
|
|
||||||
|
export const ChangeKey = {
|
||||||
|
ADULT: 'adult',
|
||||||
|
AIR_DATE: 'air_date',
|
||||||
|
ALSO_KNOWN_AS: 'also_known_as',
|
||||||
|
ALTERNATIVE_TITLES: 'alternative_titles',
|
||||||
|
BIOGRAPHY: 'biography',
|
||||||
|
BIRTHDAY: 'birthday',
|
||||||
|
BUDGET: 'budget',
|
||||||
|
CAST: 'cast',
|
||||||
|
CERTIFICATIONS: 'certifications',
|
||||||
|
CHARACTER_NAMES: 'character_names',
|
||||||
|
CREATED_BY: 'created_by',
|
||||||
|
CREW: 'crew',
|
||||||
|
DEATHDAY: 'deathday',
|
||||||
|
EPISODE: 'episode',
|
||||||
|
EPISODE_NUMBER: 'episode_number',
|
||||||
|
EPISODE_RUN_TIME: 'episode_run_time',
|
||||||
|
FREEBASE_ID: 'freebase_id',
|
||||||
|
FREEBASE_MID: 'freebase_mid',
|
||||||
|
GENERAL: 'general',
|
||||||
|
GENRES: 'genres',
|
||||||
|
GUEST_STARS: 'guest_stars',
|
||||||
|
HOMEPAGE: 'homepage',
|
||||||
|
IMAGES: 'images',
|
||||||
|
IMDB_ID: 'imdb_id',
|
||||||
|
LANGUAGES: 'languages',
|
||||||
|
NAME: 'name',
|
||||||
|
NETWORK: 'network',
|
||||||
|
ORIGIN_COUNTRY: 'origin_country',
|
||||||
|
ORIGINAL_NAME: 'original_name',
|
||||||
|
ORIGINAL_TITLE: 'original_title',
|
||||||
|
OVERVIEW: 'overview',
|
||||||
|
PARTS: 'parts',
|
||||||
|
PLACE_OF_BIRTH: 'place_of_birth',
|
||||||
|
PLOT_KEYWORDS: 'plot_keywords',
|
||||||
|
PRODUCTION_CODE: 'production_code',
|
||||||
|
PRODUCTION_COMPANIES: 'production_companies',
|
||||||
|
PRODUCTION_COUNTRIES: 'production_countries',
|
||||||
|
RELEASES: 'releases',
|
||||||
|
REVENUE: 'revenue',
|
||||||
|
RUNTIME: 'runtime',
|
||||||
|
SEASON: 'season',
|
||||||
|
SEASON_NUMBER: 'season_number',
|
||||||
|
SEASON_REGULAR: 'season_regular',
|
||||||
|
SPOKEN_LANGUAGES: 'spoken_languages',
|
||||||
|
STATUS: 'status',
|
||||||
|
TAGLINE: 'tagline',
|
||||||
|
TITLE: 'title',
|
||||||
|
TRANSLATIONS: 'translations',
|
||||||
|
TVDB_ID: 'tvdb_id',
|
||||||
|
TVRAGE_ID: 'tvrage_id',
|
||||||
|
TYPE: 'type',
|
||||||
|
VIDEO: 'video',
|
||||||
|
VIDEOS: 'videos',
|
||||||
|
} as const;
|
||||||
|
|
||||||
|
type ChangeKeys = (typeof ChangeKey)[keyof typeof ChangeKey];
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Image, Person } from './';
|
import { CountryCode, Image, Person } from './';
|
||||||
|
|
||||||
export interface CreditSeason {
|
export interface CreditSeason {
|
||||||
air_date?: string;
|
air_date?: string;
|
||||||
@@ -7,7 +7,7 @@ export interface CreditSeason {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface Media {
|
export interface Media {
|
||||||
i?: number;
|
id?: number;
|
||||||
name?: string;
|
name?: string;
|
||||||
first_air_date?: string;
|
first_air_date?: string;
|
||||||
vote_count?: number;
|
vote_count?: number;
|
||||||
@@ -15,6 +15,8 @@ export interface Media {
|
|||||||
vote_average?: number;
|
vote_average?: number;
|
||||||
backdrop_path?: string;
|
backdrop_path?: string;
|
||||||
genre_ids?: number[];
|
genre_ids?: number[];
|
||||||
|
media_type: string;
|
||||||
|
adult: boolean;
|
||||||
original_name?: string;
|
original_name?: string;
|
||||||
origin_country?: string[];
|
origin_country?: string[];
|
||||||
poster_path?: string;
|
poster_path?: string;
|
||||||
@@ -36,7 +38,7 @@ export interface CreditResponse {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface Title {
|
export interface Title {
|
||||||
iso_3166_1: string;
|
iso_3166_1: CountryCode;
|
||||||
title: string;
|
title: string;
|
||||||
type: string;
|
type: string;
|
||||||
}
|
}
|
||||||
@@ -89,7 +91,7 @@ export interface ImageCollection {
|
|||||||
export interface Video {
|
export interface Video {
|
||||||
id: string;
|
id: string;
|
||||||
iso_639_1: string;
|
iso_639_1: string;
|
||||||
iso_3166_1: string;
|
iso_3166_1: CountryCode;
|
||||||
key: string;
|
key: string;
|
||||||
name: string;
|
name: string;
|
||||||
site: string;
|
site: string;
|
||||||
|
|||||||
@@ -1,6 +1,67 @@
|
|||||||
import { Movie, TV } from '.';
|
import { Movie, TV } from '.';
|
||||||
|
|
||||||
|
export type MonetizationType = 'flatrate' | 'free' | 'ads' | 'rent' | 'buy';
|
||||||
|
|
||||||
|
export interface DiscoverQueryOptions {
|
||||||
|
language?: string;
|
||||||
|
sort_by?: SortOption;
|
||||||
|
page?: number;
|
||||||
|
'vote_average.gte'?: number;
|
||||||
|
'vote_count.gte'?: number;
|
||||||
|
'vote_count.lte'?: number;
|
||||||
|
'vote_average.lte'?: number;
|
||||||
|
with_watch_providers?: string;
|
||||||
|
watch_region?: string;
|
||||||
|
without_companies?: string;
|
||||||
|
with_watch_monetization_types?: MonetizationType;
|
||||||
|
'with_runtime.gte'?: number;
|
||||||
|
'with_runtime.lte'?: number;
|
||||||
|
with_genres?: string;
|
||||||
|
without_genres?: string;
|
||||||
|
with_original_language?: string;
|
||||||
|
without_keywords?: string;
|
||||||
|
with_keywords?: string;
|
||||||
|
with_companies?: string;
|
||||||
|
include_adult?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MovieQueryOptions extends DiscoverQueryOptions {
|
||||||
|
region?: string;
|
||||||
|
certification_country?: string;
|
||||||
|
certification?: string;
|
||||||
|
'certification.lte'?: string;
|
||||||
|
'certification.gte'?: string;
|
||||||
|
include_adult?: boolean;
|
||||||
|
include_video?: boolean;
|
||||||
|
primary_release_year?: number;
|
||||||
|
'primary_release_date.gte'?: string;
|
||||||
|
'primary_release_date.lte'?: string;
|
||||||
|
'release_date.gte'?: string;
|
||||||
|
'release_date.lte'?: string;
|
||||||
|
with_release_type?: string;
|
||||||
|
year?: number;
|
||||||
|
with_cast?: string;
|
||||||
|
with_crew?: string;
|
||||||
|
with_people?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface TvShowQueryOptions extends DiscoverQueryOptions {
|
||||||
|
'air_date.gte'?: string;
|
||||||
|
'air_date.lte'?: string;
|
||||||
|
'first_air_date.gte'?: string;
|
||||||
|
'first_air_date.lte'?: string;
|
||||||
|
first_air_date_year?: number;
|
||||||
|
timezone?: string;
|
||||||
|
with_networks?: string;
|
||||||
|
include_null_first_air_dates?: boolean;
|
||||||
|
screened_theatrically?: boolean;
|
||||||
|
with_status?: string;
|
||||||
|
with_type?: string;
|
||||||
|
}
|
||||||
|
|
||||||
export type SortOption =
|
export type SortOption =
|
||||||
|
| 'first_air_date.asc'
|
||||||
|
| 'first_air_date.desc'
|
||||||
| 'popularity.asc'
|
| 'popularity.asc'
|
||||||
| 'popularity.desc'
|
| 'popularity.desc'
|
||||||
| 'release_date.asc'
|
| 'release_date.asc'
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ export type KnownFor = MovieWithMediaType | TVWithMediaType;
|
|||||||
export interface Person {
|
export interface Person {
|
||||||
id: number;
|
id: number;
|
||||||
name: string;
|
name: string;
|
||||||
|
original_name: string;
|
||||||
known_for: KnownFor[];
|
known_for: KnownFor[];
|
||||||
profile_path: string;
|
profile_path: string;
|
||||||
adult: boolean;
|
adult: boolean;
|
||||||
@@ -81,6 +82,7 @@ export interface Company {
|
|||||||
|
|
||||||
export interface TV {
|
export interface TV {
|
||||||
id: number;
|
id: number;
|
||||||
|
adult: boolean;
|
||||||
name: string;
|
name: string;
|
||||||
first_air_date: string;
|
first_air_date: string;
|
||||||
backdrop_path: string;
|
backdrop_path: string;
|
||||||
@@ -109,6 +111,13 @@ export interface ExternalIds {
|
|||||||
facebook_id: string;
|
facebook_id: string;
|
||||||
instagram_id: string;
|
instagram_id: string;
|
||||||
twitter_id: string;
|
twitter_id: string;
|
||||||
|
tvdb_id?: number;
|
||||||
|
freebase_mid?: string;
|
||||||
|
freebase_id?: string;
|
||||||
|
tvrage_id?: number;
|
||||||
|
wikidata_id: string;
|
||||||
|
tiktok_id?: string;
|
||||||
|
youtube_id?: string;
|
||||||
id: number;
|
id: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,7 +129,7 @@ export interface ProductionCompany {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface ProductionCountry {
|
export interface ProductionCountry {
|
||||||
iso_3166_1: string;
|
iso_3166_1: CountryCode;
|
||||||
name: string;
|
name: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -137,7 +146,7 @@ export interface ContentRatings {
|
|||||||
|
|
||||||
export interface ContentRatingsResult {
|
export interface ContentRatingsResult {
|
||||||
descriptor: unknown[];
|
descriptor: unknown[];
|
||||||
iso_3166_1: string;
|
iso_3166_1: CountryCode;
|
||||||
rating: string;
|
rating: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,9 +178,9 @@ export interface Review {
|
|||||||
author: string;
|
author: string;
|
||||||
author_details: AuthorDetails;
|
author_details: AuthorDetails;
|
||||||
content: string;
|
content: string;
|
||||||
created_at: Date;
|
created_at: string;
|
||||||
id: string;
|
id: string;
|
||||||
updated_at: Date;
|
updated_at: string;
|
||||||
url: string;
|
url: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -190,7 +199,7 @@ export interface TranslationData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface Translation {
|
export interface Translation {
|
||||||
iso_3166_1: string;
|
iso_3166_1: CountryCode;
|
||||||
iso_639_1: string;
|
iso_639_1: string;
|
||||||
name: string;
|
name: string;
|
||||||
english_name: string;
|
english_name: string;
|
||||||
@@ -218,3 +227,71 @@ export interface Images {
|
|||||||
logos: Image[];
|
logos: Image[];
|
||||||
posters: Image[];
|
posters: Image[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const CountryCodes = [
|
||||||
|
'AE',
|
||||||
|
'AR',
|
||||||
|
'AT',
|
||||||
|
'AU',
|
||||||
|
'BE',
|
||||||
|
'BG',
|
||||||
|
'BO',
|
||||||
|
'BR',
|
||||||
|
'CA',
|
||||||
|
'CH',
|
||||||
|
'CL',
|
||||||
|
'CO',
|
||||||
|
'CR',
|
||||||
|
'CV',
|
||||||
|
'CZ',
|
||||||
|
'DE',
|
||||||
|
'DK',
|
||||||
|
'EC',
|
||||||
|
'EE',
|
||||||
|
'EG',
|
||||||
|
'ES',
|
||||||
|
'FI',
|
||||||
|
'FR',
|
||||||
|
'GB',
|
||||||
|
'GH',
|
||||||
|
'GR',
|
||||||
|
'GT',
|
||||||
|
'HK',
|
||||||
|
'HN',
|
||||||
|
'HU',
|
||||||
|
'ID',
|
||||||
|
'IE',
|
||||||
|
'IL',
|
||||||
|
'IN',
|
||||||
|
'IT',
|
||||||
|
'JP',
|
||||||
|
'LT',
|
||||||
|
'LV',
|
||||||
|
'MU',
|
||||||
|
'MX',
|
||||||
|
'MY',
|
||||||
|
'MZ',
|
||||||
|
'NL',
|
||||||
|
'NO',
|
||||||
|
'NZ',
|
||||||
|
'PE',
|
||||||
|
'PH',
|
||||||
|
'PL',
|
||||||
|
'PT',
|
||||||
|
'PY',
|
||||||
|
'RU',
|
||||||
|
'SA',
|
||||||
|
'SE',
|
||||||
|
'SG',
|
||||||
|
'SI',
|
||||||
|
'SK',
|
||||||
|
'TH',
|
||||||
|
'TR',
|
||||||
|
'TW',
|
||||||
|
'UG',
|
||||||
|
'US',
|
||||||
|
'VE',
|
||||||
|
'ZA',
|
||||||
|
] as const;
|
||||||
|
|
||||||
|
export type CountryCode = (typeof CountryCodes)[number];
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import {
|
import {
|
||||||
|
CountryCode,
|
||||||
Genre,
|
Genre,
|
||||||
Movie,
|
Movie,
|
||||||
ProductionCompany,
|
ProductionCompany,
|
||||||
@@ -52,14 +53,15 @@ export enum ReleaseDateType {
|
|||||||
|
|
||||||
export interface ReleaseDate {
|
export interface ReleaseDate {
|
||||||
certification: string;
|
certification: string;
|
||||||
|
descriptors: string[];
|
||||||
iso_639_1: string;
|
iso_639_1: string;
|
||||||
release_date: Date;
|
release_date: string;
|
||||||
type: ReleaseDateType;
|
type: ReleaseDateType;
|
||||||
note: string;
|
note: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ReleaseDateResult {
|
export interface ReleaseDateResult {
|
||||||
iso_3166_1: string;
|
iso_3166_1: CountryCode;
|
||||||
release_dates: ReleaseDate[];
|
release_dates: ReleaseDate[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,10 +30,157 @@ import {
|
|||||||
TvEpisodeCredit,
|
TvEpisodeCredit,
|
||||||
TvEpisodeTranslations,
|
TvEpisodeTranslations,
|
||||||
TvSeasonChangeValue,
|
TvSeasonChangeValue,
|
||||||
|
CountryCode,
|
||||||
} from '.';
|
} from '.';
|
||||||
|
|
||||||
|
export const AvailableLanguages = [
|
||||||
|
'af-ZA',
|
||||||
|
'ar-AE',
|
||||||
|
'ar-BH',
|
||||||
|
'ar-EG',
|
||||||
|
'ar-IQ',
|
||||||
|
'ar-JO',
|
||||||
|
'ar-LY',
|
||||||
|
'ar-MA',
|
||||||
|
'ar-QA',
|
||||||
|
'ar-SA',
|
||||||
|
'ar-TD',
|
||||||
|
'ar-YE',
|
||||||
|
'be-BY',
|
||||||
|
'bg-BG',
|
||||||
|
'bn-BD',
|
||||||
|
'br-FR',
|
||||||
|
'ca-AD',
|
||||||
|
'ca-ES',
|
||||||
|
'ch-GU',
|
||||||
|
'cs-CZ',
|
||||||
|
'cy-GB',
|
||||||
|
'da-DK',
|
||||||
|
'de-AT',
|
||||||
|
'de-CH',
|
||||||
|
'de-DE',
|
||||||
|
'el-CY',
|
||||||
|
'el-GR',
|
||||||
|
'en-AG',
|
||||||
|
'en-AU',
|
||||||
|
'en-BB',
|
||||||
|
'en-BZ',
|
||||||
|
'en-CA',
|
||||||
|
'en-CM',
|
||||||
|
'en-GB',
|
||||||
|
'en-GG',
|
||||||
|
'en-GH',
|
||||||
|
'en-GI',
|
||||||
|
'en-GY',
|
||||||
|
'en-IE',
|
||||||
|
'en-JM',
|
||||||
|
'en-KE',
|
||||||
|
'en-LC',
|
||||||
|
'en-MW',
|
||||||
|
'en-NZ',
|
||||||
|
'en-PG',
|
||||||
|
'en-TC',
|
||||||
|
'en-US',
|
||||||
|
'en-ZM',
|
||||||
|
'en-ZW',
|
||||||
|
'eo-EO',
|
||||||
|
'es-AR',
|
||||||
|
'es-CL',
|
||||||
|
'es-DO',
|
||||||
|
'es-EC',
|
||||||
|
'es-ES',
|
||||||
|
'es-GQ',
|
||||||
|
'es-GT',
|
||||||
|
'es-HN',
|
||||||
|
'es-MX',
|
||||||
|
'es-NI',
|
||||||
|
'es-PA',
|
||||||
|
'es-PE',
|
||||||
|
'es-PY',
|
||||||
|
'es-SV',
|
||||||
|
'es-UY',
|
||||||
|
'et-EE',
|
||||||
|
'eu-ES',
|
||||||
|
'fa-IR',
|
||||||
|
'fi-FI',
|
||||||
|
'fr-BF',
|
||||||
|
'fr-CA',
|
||||||
|
'fr-CD',
|
||||||
|
'fr-CI',
|
||||||
|
'fr-FR',
|
||||||
|
'fr-GF',
|
||||||
|
'fr-GP',
|
||||||
|
'fr-MC',
|
||||||
|
'fr-ML',
|
||||||
|
'fr-MU',
|
||||||
|
'fr-PF',
|
||||||
|
'ga-IE',
|
||||||
|
'gd-GB',
|
||||||
|
'gl-ES',
|
||||||
|
'he-IL',
|
||||||
|
'hi-IN',
|
||||||
|
'hr-HR',
|
||||||
|
'hu-HU',
|
||||||
|
'id-ID',
|
||||||
|
'it-IT',
|
||||||
|
'it-VA',
|
||||||
|
'ja-JP',
|
||||||
|
'ka-GE',
|
||||||
|
'kk-KZ',
|
||||||
|
'kn-IN',
|
||||||
|
'ko-KR',
|
||||||
|
'ky-KG',
|
||||||
|
'lt-LT',
|
||||||
|
'lv-LV',
|
||||||
|
'ml-IN',
|
||||||
|
'mr-IN',
|
||||||
|
'ms-MY',
|
||||||
|
'ms-SG',
|
||||||
|
'nb-NO',
|
||||||
|
'nl-BE',
|
||||||
|
'nl-NL',
|
||||||
|
'no-NO',
|
||||||
|
'pa-IN',
|
||||||
|
'pl-PL',
|
||||||
|
'pt-AO',
|
||||||
|
'pt-BR',
|
||||||
|
'pt-MZ',
|
||||||
|
'pt-PT',
|
||||||
|
'ro-MD',
|
||||||
|
'ro-RO',
|
||||||
|
'ru-RU',
|
||||||
|
'si-LK',
|
||||||
|
'sk-SK',
|
||||||
|
'sl-SI',
|
||||||
|
'sq-AL',
|
||||||
|
'sq-XK',
|
||||||
|
'sr-ME',
|
||||||
|
'sr-RS',
|
||||||
|
'sv-SE',
|
||||||
|
'sw-TZ',
|
||||||
|
'ta-IN',
|
||||||
|
'te-IN',
|
||||||
|
'th-TH',
|
||||||
|
'tl-PH',
|
||||||
|
'tr-TR',
|
||||||
|
'uk-UA',
|
||||||
|
'ur-PK',
|
||||||
|
'vi-VN',
|
||||||
|
'zh-CN',
|
||||||
|
'zh-HK',
|
||||||
|
'zh-SG',
|
||||||
|
'zh-TW',
|
||||||
|
'zu-ZA',
|
||||||
|
] as const;
|
||||||
|
|
||||||
|
export type AvailableLanguage = (typeof AvailableLanguages)[number];
|
||||||
|
|
||||||
export interface LanguageOption {
|
export interface LanguageOption {
|
||||||
language?: string;
|
language?: AvailableLanguage;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface WatchRegionOption {
|
||||||
|
watch_region?: CountryCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface RegionOption {
|
export interface RegionOption {
|
||||||
@@ -49,8 +196,8 @@ export interface PageOption {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface ChangeOption extends PageOption {
|
export interface ChangeOption extends PageOption {
|
||||||
start_date?: Date;
|
start_date?: string;
|
||||||
end_date?: Date;
|
end_date?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type AppendToResponseMovieKey =
|
export type AppendToResponseMovieKey =
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Image, Movie, Person, TV } from '.';
|
import { CountryCode, Image, Movie, Person, TV } from '.';
|
||||||
|
|
||||||
interface Cast {
|
interface Cast {
|
||||||
character: string;
|
character: string;
|
||||||
@@ -140,7 +140,7 @@ export interface TaggedImages {
|
|||||||
export interface PersonTranslations {
|
export interface PersonTranslations {
|
||||||
id: number;
|
id: number;
|
||||||
translations: {
|
translations: {
|
||||||
iso_3166_1: string;
|
iso_3166_1: CountryCode;
|
||||||
iso_639_1: string;
|
iso_639_1: string;
|
||||||
name: string;
|
name: string;
|
||||||
english_name: string;
|
english_name: string;
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
import { CountryCode } from '../types';
|
||||||
|
|
||||||
|
export interface Region {
|
||||||
|
iso_3166_1: CountryCode;
|
||||||
|
english_name: string;
|
||||||
|
native_name: string;
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Credits, Crew } from '.';
|
import { CountryCode, Credits, Crew } from '.';
|
||||||
|
|
||||||
export interface EpisodeSelection {
|
export interface EpisodeSelection {
|
||||||
tvShowID: number;
|
tvShowID: number;
|
||||||
@@ -44,7 +44,7 @@ export interface TvEpisodeCredit extends Credits {
|
|||||||
export interface TvEpisodeTranslations {
|
export interface TvEpisodeTranslations {
|
||||||
id: number;
|
id: number;
|
||||||
translations: {
|
translations: {
|
||||||
iso_3166_1: string;
|
iso_3166_1: CountryCode;
|
||||||
iso_639_1: string;
|
iso_639_1: string;
|
||||||
name: string;
|
name: string;
|
||||||
english_name: string;
|
english_name: string;
|
||||||
|
|||||||
@@ -1,3 +1,22 @@
|
|||||||
|
import { Region } from './regions';
|
||||||
|
import { CountryCode } from '../types';
|
||||||
|
|
||||||
|
export interface WatchProvider {
|
||||||
|
display_priorities: { [K in CountryCode]: number };
|
||||||
|
display_priority: number;
|
||||||
|
logo_path: string;
|
||||||
|
provider_id: number;
|
||||||
|
provider_name: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface RegionResult {
|
||||||
|
results: Array<Region>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface WatchProviderResult {
|
||||||
|
results: Array<WatchProvider>;
|
||||||
|
}
|
||||||
|
|
||||||
export interface Flatrate {
|
export interface Flatrate {
|
||||||
display_priority: number;
|
display_priority: number;
|
||||||
logo_path: string;
|
logo_path: string;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export const getFullImagePath = (
|
|||||||
baseUrl: string,
|
baseUrl: string,
|
||||||
fileSize: string,
|
fileSize: string,
|
||||||
imagePath: string,
|
imagePath: string,
|
||||||
svg = false
|
svg: boolean = false
|
||||||
): string => {
|
): string => {
|
||||||
const imagePathArr = imagePath.split('.');
|
const imagePathArr = imagePath.split('.');
|
||||||
const imageFormat = svg ? 'svg' : imagePathArr[1];
|
const imageFormat = svg ? 'svg' : imagePathArr[1];
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "ES2022" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */,
|
"target": "esnext" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */,
|
||||||
"module": "CommonJS" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */,
|
"module": "CommonJS" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */,
|
||||||
"moduleResolution": "node16",
|
"moduleResolution": "node",
|
||||||
"sourceMap": true /* Generates corresponding '.map' file. */,
|
"sourceMap": true /* Generates corresponding '.map' file. */,
|
||||||
"outDir": "dist" /* Redirect output structure to the directory. */,
|
"outDir": "dist" /* Redirect output structure to the directory. */,
|
||||||
"strict": true /* Enable all strict type-checking options. */,
|
"strict": true /* Enable all strict type-checking options. */,
|
||||||
|
|||||||
Reference in New Issue
Block a user