Files
tmdb-ts/src/endpoints/changes.ts
Blake Joynes d800f56ee6 initial commit
2021-05-15 00:22:10 -04:00

36 lines
980 B
TypeScript

import querystring, {ParsedUrlQueryInput} from 'querystring';
import {Base} from "./base";
import {Changes} from "../types/changes";
export interface ChangeOptions extends ParsedUrlQueryInput {
end_date?: string;
start_date?: string;
page?: number;
}
export class Change extends Base{
constructor(protected readonly accessToken: string){
super(accessToken);
}
async movies(options?: ChangeOptions): Promise<Changes> {
const params = querystring.encode(options);
return await this.api.get<Changes>(`/movie/changes?${params}`);
}
async tvShows(options?: ChangeOptions): Promise<Changes> {
const params = querystring.stringify(options);
return await this.api.get<Changes>(`/tv/changes?${params}`);
}
async person(options?: ChangeOptions): Promise<Changes> {
const params = querystring.stringify(options);
return await this.api.get<Changes>(`/person/changes${params}`);
}
}