initial commit
This commit is contained in:
41
src/tmdb.ts
Normal file
41
src/tmdb.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
import { Account } from "./endpoints/account";
|
||||
import {config} from "./config";
|
||||
import fetch from "node-fetch";
|
||||
|
||||
import {Certification} from "./endpoints/certification";
|
||||
import {Change} from "./endpoints/changes";
|
||||
|
||||
export class TMDB {
|
||||
private accessToken: string;
|
||||
|
||||
constructor(accessToken: string){
|
||||
this.accessToken = accessToken;
|
||||
}
|
||||
|
||||
get account(){
|
||||
return new Account(this.accessToken);
|
||||
}
|
||||
|
||||
get certifications(){
|
||||
return new Certification(this.accessToken);
|
||||
}
|
||||
|
||||
get changes(){
|
||||
return new Change(this.accessToken);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
const tmdb = new TMDB(config.accessToken!);
|
||||
|
||||
|
||||
(async () => {
|
||||
const changes = await tmdb.changes.movies()
|
||||
console.log(changes);
|
||||
})()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user