Moved interfaces as requested
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import {
|
import {
|
||||||
|
CollectionImageOptions,
|
||||||
DetailedCollection,
|
DetailedCollection,
|
||||||
ImageCollection,
|
ImageCollection,
|
||||||
LanguageOption,
|
LanguageOption,
|
||||||
@@ -8,13 +9,6 @@ import { BaseEndpoint } from './base';
|
|||||||
|
|
||||||
const BASE_COLLECTION = '/collection';
|
const BASE_COLLECTION = '/collection';
|
||||||
|
|
||||||
export interface CollectionImageSearchOptions extends LanguageOption {
|
|
||||||
/**
|
|
||||||
* a list of ISO-639-1 values to query
|
|
||||||
*/
|
|
||||||
include_image_language?: string[],
|
|
||||||
}
|
|
||||||
|
|
||||||
export class CollectionsEndpoint extends BaseEndpoint {
|
export class CollectionsEndpoint extends BaseEndpoint {
|
||||||
constructor(protected readonly accessToken: string) {
|
constructor(protected readonly accessToken: string) {
|
||||||
super(accessToken);
|
super(accessToken);
|
||||||
@@ -30,7 +24,7 @@ export class CollectionsEndpoint extends BaseEndpoint {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
async images(id: number, options?: CollectionImageSearchOptions): Promise<ImageCollection> {
|
async images(id: number, options?: CollectionImageOptions): Promise<ImageCollection> {
|
||||||
const computedOptions = {
|
const computedOptions = {
|
||||||
include_image_language: options?.include_image_language?.join(','),
|
include_image_language: options?.include_image_language?.join(','),
|
||||||
language: options?.language,
|
language: options?.language,
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ import {
|
|||||||
PageOption,
|
PageOption,
|
||||||
PopularTvShows,
|
PopularTvShows,
|
||||||
Recommendations,
|
Recommendations,
|
||||||
RegionOption,
|
|
||||||
Reviews,
|
Reviews,
|
||||||
ScreenedTheatrically,
|
ScreenedTheatrically,
|
||||||
SeasonDetails,
|
SeasonDetails,
|
||||||
@@ -26,6 +25,8 @@ import {
|
|||||||
TimezoneOption,
|
TimezoneOption,
|
||||||
TopRatedTvShows,
|
TopRatedTvShows,
|
||||||
Translations,
|
Translations,
|
||||||
|
TvShowImageOptions,
|
||||||
|
TvShowVideoOptions,
|
||||||
TvShowChangeValue,
|
TvShowChangeValue,
|
||||||
TvShowDetails,
|
TvShowDetails,
|
||||||
TvShowsAiringToday,
|
TvShowsAiringToday,
|
||||||
@@ -35,20 +36,6 @@ import {
|
|||||||
|
|
||||||
const BASE_TV = '/tv';
|
const BASE_TV = '/tv';
|
||||||
|
|
||||||
export interface TvImageSearchOptions extends LanguageOption {
|
|
||||||
/**
|
|
||||||
* a list of ISO-639-1 values to query
|
|
||||||
*/
|
|
||||||
include_image_language?: string[],
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface TvVideoSearchOptions extends LanguageOption {
|
|
||||||
/**
|
|
||||||
* a list of ISO-639-1 values to query
|
|
||||||
*/
|
|
||||||
include_video_language?: string[],
|
|
||||||
}
|
|
||||||
|
|
||||||
export class TvShowsEndpoint extends BaseEndpoint {
|
export class TvShowsEndpoint extends BaseEndpoint {
|
||||||
constructor(protected readonly accessToken: string) {
|
constructor(protected readonly accessToken: string) {
|
||||||
super(accessToken);
|
super(accessToken);
|
||||||
@@ -118,7 +105,7 @@ export class TvShowsEndpoint extends BaseEndpoint {
|
|||||||
return await this.api.get<ExternalIds>(`${BASE_TV}/${id}/external_ids`);
|
return await this.api.get<ExternalIds>(`${BASE_TV}/${id}/external_ids`);
|
||||||
}
|
}
|
||||||
|
|
||||||
async images(id: number, options?: TvImageSearchOptions): Promise<Images> {
|
async images(id: number, options?: TvShowImageOptions): Promise<Images> {
|
||||||
const computedOptions = {
|
const computedOptions = {
|
||||||
include_image_language: options?.include_image_language?.join(','),
|
include_image_language: options?.include_image_language?.join(','),
|
||||||
language: options?.language,
|
language: options?.language,
|
||||||
@@ -161,7 +148,7 @@ export class TvShowsEndpoint extends BaseEndpoint {
|
|||||||
return await this.api.get<Translations>(`${BASE_TV}/${id}/translations`);
|
return await this.api.get<Translations>(`${BASE_TV}/${id}/translations`);
|
||||||
}
|
}
|
||||||
|
|
||||||
async videos(id: number, options?: TvVideoSearchOptions): Promise<Videos> {
|
async videos(id: number, options?: TvShowVideoOptions): Promise<Videos> {
|
||||||
const computedOptions = {
|
const computedOptions = {
|
||||||
include_video_language: options?.include_video_language?.join(','),
|
include_video_language: options?.include_video_language?.join(','),
|
||||||
language: options?.language,
|
language: options?.language,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Movie } from '.';
|
import { LanguageOption, Movie } from '.';
|
||||||
|
|
||||||
export interface Collection {
|
export interface Collection {
|
||||||
id: number;
|
id: number;
|
||||||
@@ -14,3 +14,10 @@ export interface Collection {
|
|||||||
export interface DetailedCollection extends Collection {
|
export interface DetailedCollection extends Collection {
|
||||||
parts: Movie[];
|
parts: Movie[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface CollectionImageOptions extends LanguageOption {
|
||||||
|
/**
|
||||||
|
* a list of ISO-639-1 values to query
|
||||||
|
*/
|
||||||
|
include_image_language?: string[],
|
||||||
|
}
|
||||||
@@ -3,7 +3,7 @@ import {
|
|||||||
ProductionCompany,
|
ProductionCompany,
|
||||||
ProductionCountry,
|
ProductionCountry,
|
||||||
SpokenLanguage,
|
SpokenLanguage,
|
||||||
Episode,
|
LanguageOption,
|
||||||
} from './';
|
} from './';
|
||||||
|
|
||||||
export interface CreatedBy {
|
export interface CreatedBy {
|
||||||
@@ -274,3 +274,17 @@ export interface TvShowChangeValue {
|
|||||||
season_id: number;
|
season_id: number;
|
||||||
season_number: number;
|
season_number: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface TvShowImageOptions extends LanguageOption {
|
||||||
|
/**
|
||||||
|
* a list of ISO-639-1 values to query
|
||||||
|
*/
|
||||||
|
include_image_language?: string[],
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface TvShowVideoOptions extends LanguageOption {
|
||||||
|
/**
|
||||||
|
* a list of ISO-639-1 values to query
|
||||||
|
*/
|
||||||
|
include_video_language?: string[],
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user