applying format
This commit is contained in:
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "tmdb-ts",
|
"name": "tmdb-ts",
|
||||||
"version": "1.0.0",
|
"version": "1.4.0",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "tmdb-ts",
|
"name": "tmdb-ts",
|
||||||
"version": "1.0.0",
|
"version": "1.4.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"cross-fetch": "^3.1.4"
|
"cross-fetch": "^3.1.4"
|
||||||
|
|||||||
@@ -5,12 +5,11 @@
|
|||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"compile": "rm -rf dist && tsc -d && npm run copy-types",
|
"compile": "rm -rf dist && tsc -d",
|
||||||
"lint": "eslint --ext .ts src/",
|
"lint": "eslint --ext .ts src/",
|
||||||
"lint:fix": "eslint --ext .ts src/ --fix",
|
"lint:fix": "eslint --ext .ts src/ --fix",
|
||||||
"format": "npx prettier --write src",
|
"format": "npx prettier --write src",
|
||||||
"pre-commit": "npm run lint",
|
"pre-commit": "npm run lint"
|
||||||
"copy-types": "mkdir dist/types && cp src/types/*.d.ts dist/types"
|
|
||||||
},
|
},
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/blakejoy/tmdb-ts/issues",
|
"url": "https://github.com/blakejoy/tmdb-ts/issues",
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
import { CompanyDetails, AlternativeNames, CompanyImages } from './../types/companies';
|
import {
|
||||||
|
CompanyDetails,
|
||||||
|
AlternativeNames,
|
||||||
|
CompanyImages,
|
||||||
|
} from './../types/companies';
|
||||||
import { BaseEndpoint } from './base';
|
import { BaseEndpoint } from './base';
|
||||||
|
|
||||||
export class CompaniesEndpoint extends BaseEndpoint {
|
export class CompaniesEndpoint extends BaseEndpoint {
|
||||||
@@ -11,7 +15,9 @@ export class CompaniesEndpoint extends BaseEndpoint {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async alternativeNames(id: number): Promise<AlternativeNames> {
|
async alternativeNames(id: number): Promise<AlternativeNames> {
|
||||||
return await this.api.get<AlternativeNames>(`/company/${id}/alternative_names`);
|
return await this.api.get<AlternativeNames>(
|
||||||
|
`/company/${id}/alternative_names`
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
async images(id: number): Promise<CompanyImages> {
|
async images(id: number): Promise<CompanyImages> {
|
||||||
|
|||||||
@@ -16,4 +16,3 @@ 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';
|
||||||
|
|
||||||
|
|||||||
@@ -58,8 +58,14 @@ export class MoviesEndpoint extends BaseEndpoint {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
async changes(id: number, options?: ChangeOption): Promise<Changes<MovieChangeValue>> {
|
async changes(
|
||||||
return await this.api.get<Changes<MovieChangeValue>>(`${BASE_MOVIE}/${id}/changes`, options);
|
id: number,
|
||||||
|
options?: ChangeOption
|
||||||
|
): Promise<Changes<MovieChangeValue>> {
|
||||||
|
return await this.api.get<Changes<MovieChangeValue>>(
|
||||||
|
`${BASE_MOVIE}/${id}/changes`,
|
||||||
|
options
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
async credits(id: number): Promise<Credits> {
|
async credits(id: number): Promise<Credits> {
|
||||||
|
|||||||
@@ -59,8 +59,14 @@ export class TvShowsEndpoint extends BaseEndpoint {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
async changes(id: number, options?: ChangeOption): Promise<Changes<TvShowChangeValue>> {
|
async changes(
|
||||||
return await this.api.get<Changes<TvShowChangeValue>>(`${BASE_TV}/${id}/changes`, options);
|
id: number,
|
||||||
|
options?: ChangeOption
|
||||||
|
): Promise<Changes<TvShowChangeValue>> {
|
||||||
|
return await this.api.get<Changes<TvShowChangeValue>>(
|
||||||
|
`${BASE_TV}/${id}/changes`,
|
||||||
|
options
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
async contentRatings(id: number): Promise<ContentRatings> {
|
async contentRatings(id: number): Promise<ContentRatings> {
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ export class TMDB {
|
|||||||
return new CollectionsEndpoint(this.accessToken);
|
return new CollectionsEndpoint(this.accessToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
get tvSeasons() : TvSeasonsEndpoint {
|
get tvSeasons(): TvSeasonsEndpoint {
|
||||||
return new TvSeasonsEndpoint(this.accessToken);
|
return new TvSeasonsEndpoint(this.accessToken);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,6 @@ export interface Name {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface CompanyImages {
|
export interface CompanyImages {
|
||||||
id: number;
|
id: number;
|
||||||
logos: Image[];
|
logos: Image[];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -165,8 +165,8 @@ export type AppendToResponse<
|
|||||||
: Media extends 'tvShow'
|
: Media extends 'tvShow'
|
||||||
? TvShowChangeValue
|
? TvShowChangeValue
|
||||||
: Media extends 'tvSeason'
|
: Media extends 'tvSeason'
|
||||||
? TvSeasonChangeValue :
|
? TvSeasonChangeValue
|
||||||
TvEpisodeChangeValue
|
: TvEpisodeChangeValue
|
||||||
>;
|
>;
|
||||||
}
|
}
|
||||||
: object) &
|
: object) &
|
||||||
|
|||||||
Reference in New Issue
Block a user