tmdb-api-js
Advanced tools
Comparing version
@@ -9,3 +9,3 @@ // Generated by dts-bundle-generator v9.5.1 | ||
export interface TvClient extends ClientInterface { | ||
getShowDetails: (showId: number) => Promise<any>; | ||
getTVDetails: (showId: number) => Promise<any>; | ||
} | ||
@@ -20,6 +20,7 @@ export interface TMDBClientInterface { | ||
constructor(apiKey: string, baseUrl?: string, language?: string); | ||
get<T>(path: string): Promise<any>; | ||
} | ||
declare class TvClient$1 extends Client implements TvClient { | ||
constructor(apiKey: string, baseUrl?: string, language?: string); | ||
getShowDetails(showId: number): Promise<any>; | ||
getTVDetails(showId: number): Promise<any>; | ||
} | ||
@@ -26,0 +27,0 @@ declare class TMDBClient extends Client implements TMDBClientInterface { |
@@ -15,2 +15,11 @@ // src/constants.ts | ||
} | ||
async get(path) { | ||
const response = await fetch(`${this.baseUrl}/${path}?language=${this.language}`, { | ||
headers: { | ||
Authorization: `Bearer ${this.apiKey}`, | ||
"Content-Type": "application/json" | ||
} | ||
}); | ||
return response.json(); | ||
} | ||
} | ||
@@ -24,10 +33,4 @@ var client_default = Client; | ||
} | ||
async getShowDetails(showId) { | ||
const response = await fetch(`${this.baseUrl}/tv/${showId}?language=${this.language}`, { | ||
headers: { | ||
Authorization: `Bearer ${this.apiKey}`, | ||
"Content-Type": "application/json;charset=utf-8" | ||
} | ||
}); | ||
return response.json(); | ||
async getTVDetails(showId) { | ||
return this.get(`tv/${showId}`); | ||
} | ||
@@ -34,0 +37,0 @@ } |
{ | ||
"name": "tmdb-api-js", | ||
"type": "module", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"main": "./dist/index.cjs", | ||
@@ -6,0 +6,0 @@ "module": "./dist/index.js", |
Sorry, the diff of this file is not supported yet
5656
2.04%153
4.79%