tmdb-ts 0.1.5 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.js +2 -2
- package/dist/api.js.map +1 -1
- package/dist/endpoints/changes.js +4 -7
- package/dist/endpoints/changes.js.map +1 -1
- package/dist/endpoints/collections.d.ts +9 -0
- package/dist/endpoints/collections.js +26 -0
- package/dist/endpoints/collections.js.map +1 -0
- package/dist/endpoints/discover.d.ts +61 -0
- package/dist/endpoints/discover.js +21 -0
- package/dist/endpoints/discover.js.map +1 -0
- package/dist/endpoints/find.d.ts +6 -0
- package/dist/endpoints/find.js +16 -0
- package/dist/endpoints/find.js.map +1 -0
- package/dist/endpoints/index.d.ts +7 -0
- package/dist/endpoints/index.js +12 -1
- package/dist/endpoints/index.js.map +1 -1
- package/dist/endpoints/keywords.d.ts +7 -0
- package/dist/endpoints/keywords.js +20 -0
- package/dist/endpoints/keywords.js.map +1 -0
- package/dist/endpoints/movies.d.ts +9 -31
- package/dist/endpoints/movies.js +10 -13
- package/dist/endpoints/movies.js.map +1 -1
- package/dist/endpoints/people.d.ts +19 -0
- package/dist/endpoints/people.js +49 -0
- package/dist/endpoints/people.js.map +1 -0
- package/dist/endpoints/review.d.ts +6 -0
- package/dist/endpoints/review.js +14 -0
- package/dist/endpoints/review.js.map +1 -0
- package/dist/endpoints/search.d.ts +1 -3
- package/dist/endpoints/search.js +7 -10
- package/dist/endpoints/search.js.map +1 -1
- package/dist/endpoints/trending.d.ts +6 -0
- package/dist/endpoints/trending.js +14 -0
- package/dist/endpoints/trending.js.map +1 -0
- package/dist/endpoints/tv-shows.d.ts +8 -23
- package/dist/endpoints/tv-shows.js +11 -11
- package/dist/endpoints/tv-shows.js.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/tmdb.d.ts +8 -1
- package/dist/tmdb.js +21 -0
- package/dist/tmdb.js.map +1 -1
- package/dist/types/changes.d.ts +1 -3
- package/dist/types/collections.d.ts +14 -0
- package/dist/types/collections.js +3 -0
- package/dist/types/collections.js.map +1 -0
- package/dist/types/credits.d.ts +4 -29
- package/dist/types/discover.d.ts +14 -0
- package/dist/types/discover.js +3 -0
- package/dist/types/discover.js.map +1 -0
- package/dist/types/find.d.ts +19 -0
- package/dist/types/find.js +3 -0
- package/dist/types/find.js.map +1 -0
- package/dist/types/index.d.ts +17 -8
- package/dist/types/index.js +13 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/keywords.d.ts +19 -0
- package/dist/types/keywords.js +3 -0
- package/dist/types/keywords.js.map +1 -0
- package/dist/types/options.d.ts +9 -0
- package/dist/types/options.js +3 -0
- package/dist/types/options.js.map +1 -0
- package/dist/types/people.d.ts +148 -0
- package/dist/types/people.js +3 -0
- package/dist/types/people.js.map +1 -0
- package/dist/types/review.d.ts +7 -0
- package/dist/types/review.js +3 -0
- package/dist/types/review.js.map +1 -0
- package/dist/types/trending.d.ts +13 -0
- package/dist/types/trending.js +3 -0
- package/dist/types/trending.js.map +1 -0
- package/dist/types/tv-shows.d.ts +39 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +6 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/parseOptions.d.ts +3 -0
- package/dist/utils/parseOptions.js +10 -0
- package/dist/utils/parseOptions.js.map +1 -0
- package/package.json +1 -1
package/dist/api.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
6
|
+
const cross_fetch_1 = __importDefault(require("cross-fetch"));
|
|
7
7
|
const BASE_URL_V3 = 'https://api.themoviedb.org/3';
|
|
8
8
|
class Api {
|
|
9
9
|
constructor(accessToken) {
|
|
@@ -11,7 +11,7 @@ class Api {
|
|
|
11
11
|
this.accessToken = accessToken;
|
|
12
12
|
}
|
|
13
13
|
async get(path) {
|
|
14
|
-
const response = await
|
|
14
|
+
const response = await (0, cross_fetch_1.default)(`${BASE_URL_V3}${path}`, {
|
|
15
15
|
method: 'GET',
|
|
16
16
|
headers: {
|
|
17
17
|
Authorization: `Bearer ${this.accessToken}`,
|
package/dist/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":";;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":";;;;;AAAA,8DAAgC;AAEhC,MAAM,WAAW,GAAG,8BAA8B,CAAC;AAEnD,MAAqB,GAAG;IACtB,YAAoB,WAAmB;QAAnB,gBAAW,GAAX,WAAW,CAAQ;QACrC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;IAED,KAAK,CAAC,GAAG,CAAI,IAAY;QACvB,MAAM,QAAQ,GAAG,MAAM,IAAA,qBAAK,EAAC,GAAG,WAAW,GAAG,IAAI,EAAE,EAAE;YACpD,MAAM,EAAE,KAAK;YACb,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,IAAI,CAAC,WAAW,EAAE;gBAC3C,cAAc,EAAE,gCAAgC;aACjD;SACF,CAAC,CAAC;QACH,OAAO,MAAM,QAAQ,CAAC,IAAI,EAAO,CAAC;IACpC,CAAC;CACF;AAfD,sBAeC"}
|
|
@@ -1,26 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.ChangeEndpoint = void 0;
|
|
7
|
-
const querystring_1 = __importDefault(require("querystring"));
|
|
8
4
|
const base_1 = require("./base");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
9
6
|
class ChangeEndpoint extends base_1.BaseEndpoint {
|
|
10
7
|
constructor(accessToken) {
|
|
11
8
|
super(accessToken);
|
|
12
9
|
this.accessToken = accessToken;
|
|
13
10
|
}
|
|
14
11
|
async movies(options) {
|
|
15
|
-
const params =
|
|
12
|
+
const params = (0, utils_1.parseOptions)(options);
|
|
16
13
|
return await this.api.get(`/movie/changes?${params}`);
|
|
17
14
|
}
|
|
18
15
|
async tvShows(options) {
|
|
19
|
-
const params =
|
|
16
|
+
const params = (0, utils_1.parseOptions)(options);
|
|
20
17
|
return await this.api.get(`/tv/changes?${params}`);
|
|
21
18
|
}
|
|
22
19
|
async person(options) {
|
|
23
|
-
const params =
|
|
20
|
+
const params = (0, utils_1.parseOptions)(options);
|
|
24
21
|
return await this.api.get(`/person/changes${params}`);
|
|
25
22
|
}
|
|
26
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changes.js","sourceRoot":"","sources":["../../src/endpoints/changes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"changes.js","sourceRoot":"","sources":["../../src/endpoints/changes.ts"],"names":[],"mappings":";;;AAAA,iCAAsC;AAEtC,oCAAwC;AAGxC,MAAa,cAAe,SAAQ,mBAAY;IAC9C,YAA+B,WAAmB;QAChD,KAAK,CAAC,WAAW,CAAC,CAAC;QADU,gBAAW,GAAX,WAAW,CAAQ;IAElD,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,OAAuB;QAClC,MAAM,MAAM,GAAG,IAAA,oBAAY,EAAC,OAAO,CAAC,CAAC;QACrC,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAU,kBAAkB,MAAM,EAAE,CAAC,CAAC;IACjE,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,OAAuB;QACnC,MAAM,MAAM,GAAG,IAAA,oBAAY,EAAC,OAAO,CAAC,CAAC;QACrC,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAU,eAAe,MAAM,EAAE,CAAC,CAAC;IAC9D,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,OAAuB;QAClC,MAAM,MAAM,GAAG,IAAA,oBAAY,EAAC,OAAO,CAAC,CAAC;QACrC,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAU,kBAAkB,MAAM,EAAE,CAAC,CAAC;IACjE,CAAC;CACF;AAnBD,wCAmBC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DetailedCollection, ImageCollection, LanguageOption, Translations } from '../types';
|
|
2
|
+
import { BaseEndpoint } from './base';
|
|
3
|
+
export declare class CollectionsEndpoint extends BaseEndpoint {
|
|
4
|
+
protected readonly accessToken: string;
|
|
5
|
+
constructor(accessToken: string);
|
|
6
|
+
details(id: number, options?: LanguageOption): Promise<DetailedCollection>;
|
|
7
|
+
images(id: number, options?: LanguageOption): Promise<ImageCollection>;
|
|
8
|
+
translations(id: number, options?: LanguageOption): Promise<Translations>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CollectionsEndpoint = void 0;
|
|
4
|
+
const utils_1 = require("../utils");
|
|
5
|
+
const base_1 = require("./base");
|
|
6
|
+
const BASE_COLLECTION = '/collection';
|
|
7
|
+
class CollectionsEndpoint extends base_1.BaseEndpoint {
|
|
8
|
+
constructor(accessToken) {
|
|
9
|
+
super(accessToken);
|
|
10
|
+
this.accessToken = accessToken;
|
|
11
|
+
}
|
|
12
|
+
async details(id, options) {
|
|
13
|
+
const params = (0, utils_1.parseOptions)(options);
|
|
14
|
+
return await this.api.get(`${BASE_COLLECTION}/${id}?${params}`);
|
|
15
|
+
}
|
|
16
|
+
async images(id, options) {
|
|
17
|
+
const params = (0, utils_1.parseOptions)(options);
|
|
18
|
+
return await this.api.get(`${BASE_COLLECTION}/${id}/images?${params}`);
|
|
19
|
+
}
|
|
20
|
+
async translations(id, options) {
|
|
21
|
+
const params = (0, utils_1.parseOptions)(options);
|
|
22
|
+
return await this.api.get(`${BASE_COLLECTION}/${id}/translations?${params}`);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.CollectionsEndpoint = CollectionsEndpoint;
|
|
26
|
+
//# sourceMappingURL=collections.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collections.js","sourceRoot":"","sources":["../../src/endpoints/collections.ts"],"names":[],"mappings":";;;AACA,oCAAwC;AACxC,iCAAuC;AAEvC,MAAM,eAAe,GAAG,aAAa,CAAC;AAEtC,MAAa,mBAAoB,SAAQ,mBAAY;IACnD,YAA+B,WAAmB;QAChD,KAAK,CAAC,WAAW,CAAC,CAAC;QADU,gBAAW,GAAX,WAAW,CAAQ;IAElD,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,EAAU,EAAE,OAAyB;QACjD,MAAM,MAAM,GAAG,IAAA,oBAAY,EAAC,OAAO,CAAC,CAAC;QACrC,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAqB,GAAG,eAAe,IAAI,EAAE,IAAI,MAAM,EAAE,CAAC,CAAC;IACtF,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAU,EAAE,OAAyB;QAChD,MAAM,MAAM,GAAG,IAAA,oBAAY,EAAC,OAAO,CAAC,CAAC;QACrC,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAkB,GAAG,eAAe,IAAI,EAAE,WAAW,MAAM,EAAE,CAAC,CAAC;IAC1F,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,EAAU,EAAE,OAAyB;QACtD,MAAM,MAAM,GAAG,IAAA,oBAAY,EAAC,OAAO,CAAC,CAAC;QACrC,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAe,GAAG,eAAe,IAAI,EAAE,iBAAiB,MAAM,EAAE,CAAC,CAAC;IAC7F,CAAC;CACF;AAnBD,kDAmBC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { MovieDiscoverResult, SortOption, TvShowDiscoverResult } from '../types';
|
|
2
|
+
import { BaseEndpoint } from './base';
|
|
3
|
+
interface DiscoverQueryOptions {
|
|
4
|
+
language?: string;
|
|
5
|
+
sort_by?: SortOption;
|
|
6
|
+
page?: number;
|
|
7
|
+
'vote_average.gte'?: number;
|
|
8
|
+
'vote_count.gte'?: number;
|
|
9
|
+
'vote_count.lte'?: number;
|
|
10
|
+
'vote_average.lte'?: number;
|
|
11
|
+
with_watch_providers?: string;
|
|
12
|
+
watch_region?: string;
|
|
13
|
+
without_companies?: string;
|
|
14
|
+
with_watch_monetization_types?: 'flatrate' | 'free' | 'ads' | 'rent' | 'buy';
|
|
15
|
+
'with_runtime.gte'?: number;
|
|
16
|
+
'with_runtime.lte'?: number;
|
|
17
|
+
with_genres?: string;
|
|
18
|
+
without_genres?: string;
|
|
19
|
+
with_original_language?: string;
|
|
20
|
+
without_keywords?: string;
|
|
21
|
+
with_keywords?: string;
|
|
22
|
+
with_companies?: string;
|
|
23
|
+
}
|
|
24
|
+
interface MovieQueryOptions extends DiscoverQueryOptions {
|
|
25
|
+
region?: string;
|
|
26
|
+
certification_country?: string;
|
|
27
|
+
certification?: string;
|
|
28
|
+
'certification.lte'?: string;
|
|
29
|
+
'certification.gte'?: string;
|
|
30
|
+
include_adult?: boolean;
|
|
31
|
+
include_video?: boolean;
|
|
32
|
+
primary_release_year?: number;
|
|
33
|
+
'primary_release_date.gte'?: string;
|
|
34
|
+
'primary_release_date.lte'?: string;
|
|
35
|
+
'release_date.gte'?: string;
|
|
36
|
+
'release_date.lte'?: string;
|
|
37
|
+
with_release_type?: string;
|
|
38
|
+
year?: number;
|
|
39
|
+
with_cast?: string;
|
|
40
|
+
with_crew?: string;
|
|
41
|
+
with_people?: string;
|
|
42
|
+
}
|
|
43
|
+
interface TvShowQueryOptions extends DiscoverQueryOptions {
|
|
44
|
+
'air_date.gte'?: string;
|
|
45
|
+
'air_date.lte'?: string;
|
|
46
|
+
'first_air_date.gte'?: string;
|
|
47
|
+
'first_air_date.lte'?: string;
|
|
48
|
+
first_air_date_year?: number;
|
|
49
|
+
timezone?: string;
|
|
50
|
+
with_networks?: string;
|
|
51
|
+
include_null_first_air_dates?: boolean;
|
|
52
|
+
screened_theatrically?: boolean;
|
|
53
|
+
with_status?: string;
|
|
54
|
+
with_type?: string;
|
|
55
|
+
}
|
|
56
|
+
export declare class DiscoverEndpoint extends BaseEndpoint {
|
|
57
|
+
constructor(accessToken: string);
|
|
58
|
+
movie(options?: MovieQueryOptions): Promise<MovieDiscoverResult>;
|
|
59
|
+
tvShow(options?: TvShowQueryOptions): Promise<TvShowDiscoverResult>;
|
|
60
|
+
}
|
|
61
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DiscoverEndpoint = void 0;
|
|
4
|
+
const utils_1 = require("../utils");
|
|
5
|
+
const base_1 = require("./base");
|
|
6
|
+
const BASE_DISCOVER = '/discover';
|
|
7
|
+
class DiscoverEndpoint extends base_1.BaseEndpoint {
|
|
8
|
+
constructor(accessToken) {
|
|
9
|
+
super(accessToken);
|
|
10
|
+
}
|
|
11
|
+
async movie(options) {
|
|
12
|
+
const params = (0, utils_1.parseOptions)(options);
|
|
13
|
+
return await this.api.get(`${BASE_DISCOVER}/movie?${params}`);
|
|
14
|
+
}
|
|
15
|
+
async tvShow(options) {
|
|
16
|
+
const params = (0, utils_1.parseOptions)(options);
|
|
17
|
+
return await this.api.get(`${BASE_DISCOVER}/tv?${params}`);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.DiscoverEndpoint = DiscoverEndpoint;
|
|
21
|
+
//# sourceMappingURL=discover.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discover.js","sourceRoot":"","sources":["../../src/endpoints/discover.ts"],"names":[],"mappings":";;;AACA,oCAAwC;AACxC,iCAAsC;AAEtC,MAAM,aAAa,GAAG,WAAW,CAAC;AA0DlC,MAAa,gBAAiB,SAAQ,mBAAY;IAChD,YAAY,WAAmB;QAC7B,KAAK,CAAC,WAAW,CAAC,CAAC;IACrB,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,OAA2B;QACrC,MAAM,MAAM,GAAG,IAAA,oBAAY,EAAC,OAAO,CAAC,CAAC;QACrC,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAsB,GAAG,aAAa,UAAU,MAAM,EAAE,CAAC,CAAC;IACrF,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,OAA4B;QACvC,MAAM,MAAM,GAAG,IAAA,oBAAY,EAAC,OAAO,CAAC,CAAC;QACrC,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAuB,GAAG,aAAa,OAAO,MAAM,EAAE,CAAC,CAAC;IACnF,CAAC;CACF;AAdD,4CAcC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BaseEndpoint } from './base';
|
|
2
|
+
import { ExternalIdOptions, FindResult } from '../types';
|
|
3
|
+
export declare class FindEndpoint extends BaseEndpoint {
|
|
4
|
+
constructor(accessToken: string);
|
|
5
|
+
byId(externalId: string, options: ExternalIdOptions): Promise<FindResult>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FindEndpoint = void 0;
|
|
4
|
+
const base_1 = require("./base");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
class FindEndpoint extends base_1.BaseEndpoint {
|
|
7
|
+
constructor(accessToken) {
|
|
8
|
+
super(accessToken);
|
|
9
|
+
}
|
|
10
|
+
async byId(externalId, options) {
|
|
11
|
+
const params = (0, utils_1.parseOptions)(options);
|
|
12
|
+
return await this.api.get(`/find/${externalId}?${params}`);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.FindEndpoint = FindEndpoint;
|
|
16
|
+
//# sourceMappingURL=find.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find.js","sourceRoot":"","sources":["../../src/endpoints/find.ts"],"names":[],"mappings":";;;AAAA,iCAAsC;AAEtC,oCAAwC;AAExC,MAAa,YAAa,SAAQ,mBAAY;IAC5C,YAAY,WAAmB;QAC7B,KAAK,CAAC,WAAW,CAAC,CAAC;IACrB,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,UAAkB,EAAE,OAA0B;QACvD,MAAM,MAAM,GAAG,IAAA,oBAAY,EAAC,OAAO,CAAC,CAAC;QACrC,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAa,SAAS,UAAU,IAAI,MAAM,EAAE,CAAC,CAAC;IACzE,CAAC;CACF;AATD,oCASC"}
|
|
@@ -7,3 +7,10 @@ export * from './genre';
|
|
|
7
7
|
export * from './movies';
|
|
8
8
|
export * from './configuration';
|
|
9
9
|
export * from './tv-shows';
|
|
10
|
+
export * from './discover';
|
|
11
|
+
export * from './people';
|
|
12
|
+
export * from './review';
|
|
13
|
+
export * from './trending';
|
|
14
|
+
export * from './find';
|
|
15
|
+
export * from './keywords';
|
|
16
|
+
export * from './collections';
|
package/dist/endpoints/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -19,4 +23,11 @@ __exportStar(require("./genre"), exports);
|
|
|
19
23
|
__exportStar(require("./movies"), exports);
|
|
20
24
|
__exportStar(require("./configuration"), exports);
|
|
21
25
|
__exportStar(require("./tv-shows"), exports);
|
|
26
|
+
__exportStar(require("./discover"), exports);
|
|
27
|
+
__exportStar(require("./people"), exports);
|
|
28
|
+
__exportStar(require("./review"), exports);
|
|
29
|
+
__exportStar(require("./trending"), exports);
|
|
30
|
+
__exportStar(require("./find"), exports);
|
|
31
|
+
__exportStar(require("./keywords"), exports);
|
|
32
|
+
__exportStar(require("./collections"), exports);
|
|
22
33
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/endpoints/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/endpoints/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAEA,4CAA0B;AAC1B,kDAAgC;AAChC,4CAA0B;AAC1B,4CAA0B;AAC1B,2CAAyB;AACzB,0CAAwB;AACxB,2CAAyB;AACzB,kDAAgC;AAChC,6CAA2B;AAC3B,6CAA2B;AAC3B,2CAAyB;AACzB,2CAAyB;AACzB,6CAA2B;AAC3B,yCAAuB;AACvB,6CAA2B;AAC3B,gDAA8B"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BaseEndpoint } from './base';
|
|
2
|
+
import { BelongingMovies, Keyword, KeywordsOptions } from '../types';
|
|
3
|
+
export declare class KeywordsEndpoint extends BaseEndpoint {
|
|
4
|
+
constructor(accessToken: string);
|
|
5
|
+
details(keywordId: number): Promise<Keyword>;
|
|
6
|
+
belongingMovies(keywordId: number, options?: KeywordsOptions): Promise<BelongingMovies>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KeywordsEndpoint = void 0;
|
|
4
|
+
const base_1 = require("./base");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
const BASE_Keyword = '/keyword';
|
|
7
|
+
class KeywordsEndpoint extends base_1.BaseEndpoint {
|
|
8
|
+
constructor(accessToken) {
|
|
9
|
+
super(accessToken);
|
|
10
|
+
}
|
|
11
|
+
async details(keywordId) {
|
|
12
|
+
return await this.api.get(`${BASE_Keyword}/${keywordId}`);
|
|
13
|
+
}
|
|
14
|
+
async belongingMovies(keywordId, options) {
|
|
15
|
+
const params = (0, utils_1.parseOptions)(options);
|
|
16
|
+
return await this.api.get(`${BASE_Keyword}/${keywordId}/movies?${params}`);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.KeywordsEndpoint = KeywordsEndpoint;
|
|
20
|
+
//# sourceMappingURL=keywords.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keywords.js","sourceRoot":"","sources":["../../src/endpoints/keywords.ts"],"names":[],"mappings":";;;AAAA,iCAAsC;AAEtC,oCAAwC;AAExC,MAAM,YAAY,GAAG,UAAU,CAAC;AAEhC,MAAa,gBAAiB,SAAQ,mBAAY;IAChD,YAAY,WAAmB;QAC7B,KAAK,CAAC,WAAW,CAAC,CAAC;IACrB,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,SAAkB;QAC9B,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAU,GAAG,YAAY,IAAI,SAAS,EAAE,CAAC,CAAC;IACrE,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,SAAkB,EAAE,OAAyB;QACjE,MAAM,MAAM,GAAG,IAAA,oBAAY,EAAC,OAAO,CAAC,CAAC;QACrC,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAkB,GAAG,YAAY,IAAI,SAAS,WAAW,MAAM,EAAE,CAAC,CAAC;IAC9F,CAAC;CACF;AAbD,4CAaC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseEndpoint } from './base';
|
|
2
|
-
import { AlternativeTitles, ChangeOptions, Credits, ExternalIds, Images, Keywords, LatestMovie, MovieChanges, MovieDetails, MovieLists, MoviesPlayingNow, PopularMovies, Recommendations, ReleaseDates, Reviews, SimilarMovies, TopRatedMovies, Translations, UpcomingMovies, Videos, WatchProviders } from '../types';
|
|
2
|
+
import { AlternativeTitles, ChangeOptions, Credits, ExternalIds, Images, Keywords, LanguageOption, LatestMovie, MovieChanges, MovieDetails, MovieLists, MoviesPlayingNow, PageOption, PopularMovies, Recommendations, RegionOption, ReleaseDates, Reviews, SimilarMovies, TopRatedMovies, Translations, UpcomingMovies, Videos, WatchProviders } from '../types';
|
|
3
3
|
export declare class MoviesEndpoint extends BaseEndpoint {
|
|
4
4
|
protected readonly accessToken: string;
|
|
5
5
|
constructor(accessToken: string);
|
|
@@ -10,19 +10,11 @@ export declare class MoviesEndpoint extends BaseEndpoint {
|
|
|
10
10
|
externalIds(id: number): Promise<ExternalIds>;
|
|
11
11
|
images(id: number): Promise<Images>;
|
|
12
12
|
keywords(id: number): Promise<Keywords>;
|
|
13
|
-
lists(id: number, options?:
|
|
14
|
-
|
|
15
|
-
}): Promise<MovieLists>;
|
|
16
|
-
recommendations(id: number, options?: {
|
|
17
|
-
page?: number;
|
|
18
|
-
}): Promise<Recommendations>;
|
|
13
|
+
lists(id: number, options?: LanguageOption | PageOption): Promise<MovieLists>;
|
|
14
|
+
recommendations(id: number, options?: PageOption): Promise<Recommendations>;
|
|
19
15
|
releaseDates(id: number): Promise<ReleaseDates>;
|
|
20
|
-
reviews(id: number, options?:
|
|
21
|
-
|
|
22
|
-
}): Promise<Reviews>;
|
|
23
|
-
similar(id: number, options?: {
|
|
24
|
-
page?: number;
|
|
25
|
-
}): Promise<SimilarMovies>;
|
|
16
|
+
reviews(id: number, options?: PageOption): Promise<Reviews>;
|
|
17
|
+
similar(id: number, options?: PageOption): Promise<SimilarMovies>;
|
|
26
18
|
translations(id: number): Promise<Translations>;
|
|
27
19
|
videos(id: number): Promise<Videos>;
|
|
28
20
|
/**
|
|
@@ -31,22 +23,8 @@ export declare class MoviesEndpoint extends BaseEndpoint {
|
|
|
31
23
|
*/
|
|
32
24
|
watchProviders(id: number): Promise<WatchProviders>;
|
|
33
25
|
latest(): Promise<LatestMovie>;
|
|
34
|
-
nowPlaying(options?:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}): Promise<MoviesPlayingNow>;
|
|
39
|
-
popular(options?: {
|
|
40
|
-
page?: number;
|
|
41
|
-
}): Promise<PopularMovies>;
|
|
42
|
-
topRated(options?: {
|
|
43
|
-
page?: number;
|
|
44
|
-
region?: string;
|
|
45
|
-
language?: string;
|
|
46
|
-
}): Promise<TopRatedMovies>;
|
|
47
|
-
upcoming(options?: {
|
|
48
|
-
page?: number;
|
|
49
|
-
region?: string;
|
|
50
|
-
language?: string;
|
|
51
|
-
}): Promise<UpcomingMovies>;
|
|
26
|
+
nowPlaying(options?: PageOption & LanguageOption & RegionOption): Promise<MoviesPlayingNow>;
|
|
27
|
+
popular(options?: PageOption): Promise<PopularMovies>;
|
|
28
|
+
topRated(options?: PageOption & LanguageOption & RegionOption): Promise<TopRatedMovies>;
|
|
29
|
+
upcoming(options?: PageOption & LanguageOption & RegionOption): Promise<UpcomingMovies>;
|
|
52
30
|
}
|
package/dist/endpoints/movies.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.MoviesEndpoint = void 0;
|
|
7
4
|
const base_1 = require("./base");
|
|
8
|
-
const
|
|
5
|
+
const utils_1 = require("../utils");
|
|
9
6
|
const BASE_MOVIE = '/movie';
|
|
10
7
|
class MoviesEndpoint extends base_1.BaseEndpoint {
|
|
11
8
|
constructor(accessToken) {
|
|
@@ -19,7 +16,7 @@ class MoviesEndpoint extends base_1.BaseEndpoint {
|
|
|
19
16
|
return await this.api.get(`${BASE_MOVIE}/${id}/alternative_titles`);
|
|
20
17
|
}
|
|
21
18
|
async changes(id, options) {
|
|
22
|
-
const params =
|
|
19
|
+
const params = (0, utils_1.parseOptions)(options);
|
|
23
20
|
return await this.api.get(`${BASE_MOVIE}/${id}/changes?${params}`);
|
|
24
21
|
}
|
|
25
22
|
async credits(id) {
|
|
@@ -35,22 +32,22 @@ class MoviesEndpoint extends base_1.BaseEndpoint {
|
|
|
35
32
|
return await this.api.get(`${BASE_MOVIE}/${id}/keywords`);
|
|
36
33
|
}
|
|
37
34
|
async lists(id, options) {
|
|
38
|
-
const params =
|
|
35
|
+
const params = (0, utils_1.parseOptions)(options);
|
|
39
36
|
return await this.api.get(`${BASE_MOVIE}/${id}/lists?${params}`);
|
|
40
37
|
}
|
|
41
38
|
async recommendations(id, options) {
|
|
42
|
-
const params =
|
|
39
|
+
const params = (0, utils_1.parseOptions)(options);
|
|
43
40
|
return await this.api.get(`${BASE_MOVIE}/${id}/recommendations?${params}`);
|
|
44
41
|
}
|
|
45
42
|
async releaseDates(id) {
|
|
46
43
|
return await this.api.get(`${BASE_MOVIE}/${id}/release_dates`);
|
|
47
44
|
}
|
|
48
45
|
async reviews(id, options) {
|
|
49
|
-
const params =
|
|
46
|
+
const params = (0, utils_1.parseOptions)(options);
|
|
50
47
|
return await this.api.get(`${BASE_MOVIE}/${id}/reviews?${params}`);
|
|
51
48
|
}
|
|
52
49
|
async similar(id, options) {
|
|
53
|
-
const params =
|
|
50
|
+
const params = (0, utils_1.parseOptions)(options);
|
|
54
51
|
return await this.api.get(`${BASE_MOVIE}/${id}/similar?${params}`);
|
|
55
52
|
}
|
|
56
53
|
async translations(id) {
|
|
@@ -70,19 +67,19 @@ class MoviesEndpoint extends base_1.BaseEndpoint {
|
|
|
70
67
|
return await this.api.get(`${BASE_MOVIE}/latest`);
|
|
71
68
|
}
|
|
72
69
|
async nowPlaying(options) {
|
|
73
|
-
const params =
|
|
70
|
+
const params = (0, utils_1.parseOptions)(options);
|
|
74
71
|
return await this.api.get(`${BASE_MOVIE}/now_playing?${params}`);
|
|
75
72
|
}
|
|
76
73
|
async popular(options) {
|
|
77
|
-
const params =
|
|
74
|
+
const params = (0, utils_1.parseOptions)(options);
|
|
78
75
|
return await this.api.get(`${BASE_MOVIE}/popular?${params}`);
|
|
79
76
|
}
|
|
80
77
|
async topRated(options) {
|
|
81
|
-
const params =
|
|
78
|
+
const params = (0, utils_1.parseOptions)(options);
|
|
82
79
|
return await this.api.get(`${BASE_MOVIE}/top_rated?${params}`);
|
|
83
80
|
}
|
|
84
81
|
async upcoming(options) {
|
|
85
|
-
const params =
|
|
82
|
+
const params = (0, utils_1.parseOptions)(options);
|
|
86
83
|
return await this.api.get(`${BASE_MOVIE}/upcoming?${params}`);
|
|
87
84
|
}
|
|
88
85
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"movies.js","sourceRoot":"","sources":["../../src/endpoints/movies.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"movies.js","sourceRoot":"","sources":["../../src/endpoints/movies.ts"],"names":[],"mappings":";;;AAAA,iCAAsC;AA0BtC,oCAAwC;AAExC,MAAM,UAAU,GAAG,QAAQ,CAAC;AAE5B,MAAa,cAAe,SAAQ,mBAAY;IAC9C,YAA+B,WAAmB;QAChD,KAAK,CAAC,WAAW,CAAC,CAAC;QADU,gBAAW,GAAX,WAAW,CAAQ;IAElD,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,EAAU;QACtB,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAe,GAAG,UAAU,IAAI,EAAE,EAAE,CAAC,CAAC;IACjE,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,EAAU;QAChC,OAAO,MAAM,IAAI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,IAAI,CAAC,GAAG,CAAC,GAAG,CAAc,GAAG,UAAU,SAAS,CAAC,CAAC;IACjE,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,OAAoD;QACnE,MAAM,MAAM,GAAG,IAAA,oBAAY,EAAC,OAAO,CAAC,CAAC;QACrC,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAmB,GAAG,UAAU,gBAAgB,MAAM,EAAE,CAAC,CAAC;IACrF,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,OAAoB;QAChC,MAAM,MAAM,GAAG,IAAA,oBAAY,EAAC,OAAO,CAAC,CAAC;QACrC,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAgB,GAAG,UAAU,YAAY,MAAM,EAAE,CAAC,CAAC;IAC9E,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,OAAoD;QACjE,MAAM,MAAM,GAAG,IAAA,oBAAY,EAAC,OAAO,CAAC,CAAC;QACrC,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAiB,GAAG,UAAU,cAAc,MAAM,EAAE,CAAC,CAAC;IACjF,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,OAAoD;QACjE,MAAM,MAAM,GAAG,IAAA,oBAAY,EAAC,OAAO,CAAC,CAAC;QACrC,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAiB,GAAG,UAAU,aAAa,MAAM,EAAE,CAAC,CAAC;IAChF,CAAC;CACF;AAjGD,wCAiGC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ChangeOptions, ExternalIds, Image, PageOption, PeopleTranslations, PersonChanges, PersonCombinedCredits, PersonDetail, PersonMovieCredit, PersonTvShowCredit, PopularPersons, TaggedImages } from '../types';
|
|
2
|
+
import { BaseEndpoint } from './base';
|
|
3
|
+
export declare class PeopleEndpoint extends BaseEndpoint {
|
|
4
|
+
constructor(accessToken: string);
|
|
5
|
+
details(id: number): Promise<PersonDetail>;
|
|
6
|
+
changes(id: number, options?: ChangeOptions): Promise<PersonChanges>;
|
|
7
|
+
movieCredits(id: number): Promise<PersonMovieCredit>;
|
|
8
|
+
tvShowCredits(id: number): Promise<PersonTvShowCredit>;
|
|
9
|
+
combinedCredits(id: number): Promise<PersonCombinedCredits>;
|
|
10
|
+
externalId(id: number): Promise<ExternalIds>;
|
|
11
|
+
images(id: number): Promise<{
|
|
12
|
+
id: number;
|
|
13
|
+
profiles: Image[];
|
|
14
|
+
}>;
|
|
15
|
+
taggedImages(id: number, options?: PageOption): Promise<TaggedImages>;
|
|
16
|
+
translation(id: number): Promise<PeopleTranslations>;
|
|
17
|
+
latest(): Promise<PersonDetail>;
|
|
18
|
+
popular(options?: PageOption): Promise<PopularPersons>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PeopleEndpoint = void 0;
|
|
4
|
+
const utils_1 = require("../utils");
|
|
5
|
+
const base_1 = require("./base");
|
|
6
|
+
const BASE_PERSON = '/person';
|
|
7
|
+
class PeopleEndpoint extends base_1.BaseEndpoint {
|
|
8
|
+
constructor(accessToken) {
|
|
9
|
+
super(accessToken);
|
|
10
|
+
}
|
|
11
|
+
async details(id) {
|
|
12
|
+
return await this.api.get(`${BASE_PERSON}/${id}`);
|
|
13
|
+
}
|
|
14
|
+
async changes(id, options) {
|
|
15
|
+
const params = (0, utils_1.parseOptions)(options);
|
|
16
|
+
return await this.api.get(`${BASE_PERSON}/${id}/changes?${params}`);
|
|
17
|
+
}
|
|
18
|
+
async movieCredits(id) {
|
|
19
|
+
return await this.api.get(`${BASE_PERSON}/${id}/movie_credits`);
|
|
20
|
+
}
|
|
21
|
+
async tvShowCredits(id) {
|
|
22
|
+
return await this.api.get(`${BASE_PERSON}/${id}/tv_credits`);
|
|
23
|
+
}
|
|
24
|
+
async combinedCredits(id) {
|
|
25
|
+
return await this.api.get(`${BASE_PERSON}/${id}/combined_credits`);
|
|
26
|
+
}
|
|
27
|
+
async externalId(id) {
|
|
28
|
+
return await this.api.get(`${BASE_PERSON}/${id}/external_ids`);
|
|
29
|
+
}
|
|
30
|
+
async images(id) {
|
|
31
|
+
return await this.api.get(`${BASE_PERSON}/${id}/images`);
|
|
32
|
+
}
|
|
33
|
+
async taggedImages(id, options) {
|
|
34
|
+
const params = (0, utils_1.parseOptions)(options);
|
|
35
|
+
return await this.api.get(`${BASE_PERSON}/${id}/tagged_images?${params}`);
|
|
36
|
+
}
|
|
37
|
+
async translation(id) {
|
|
38
|
+
return await this.api.get(`${BASE_PERSON}/${id}/translations`);
|
|
39
|
+
}
|
|
40
|
+
async latest() {
|
|
41
|
+
return await this.api.get(`${BASE_PERSON}/latest`);
|
|
42
|
+
}
|
|
43
|
+
async popular(options) {
|
|
44
|
+
const params = (0, utils_1.parseOptions)(options);
|
|
45
|
+
return await this.api.get(`${BASE_PERSON}/popular?${params}`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.PeopleEndpoint = PeopleEndpoint;
|
|
49
|
+
//# sourceMappingURL=people.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"people.js","sourceRoot":"","sources":["../../src/endpoints/people.ts"],"names":[],"mappings":";;;AAcA,oCAAwC;AACxC,iCAAsC;AAEtC,MAAM,WAAW,GAAG,SAAS,CAAC;AAE9B,MAAa,cAAe,SAAQ,mBAAY;IAC/C,YAAY,WAAmB;QAC9B,KAAK,CAAC,WAAW,CAAC,CAAC;IACpB,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,EAAU;QACvB,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAe,GAAG,WAAW,IAAI,EAAE,EAAE,CAAC,CAAC;IACjE,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,EAAU,EAAE,OAAwB;QACjD,MAAM,MAAM,GAAG,IAAA,oBAAY,EAAC,OAAO,CAAC,CAAC;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;IAED,KAAK,CAAC,MAAM;QACX,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAe,GAAG,WAAW,SAAS,CAAC,CAAC;IAClE,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,OAAoB;QACjC,MAAM,MAAM,GAAG,IAAA,oBAAY,EAAC,OAAO,CAAC,CAAC;QACrC,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAiB,GAAG,WAAW,YAAY,MAAM,EAAE,CAAC,CAAC;IAC/E,CAAC;CACD;AAnDD,wCAmDC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReviewEndpoint = void 0;
|
|
4
|
+
const base_1 = require("./base");
|
|
5
|
+
class ReviewEndpoint extends base_1.BaseEndpoint {
|
|
6
|
+
constructor(accessToken) {
|
|
7
|
+
super(accessToken);
|
|
8
|
+
}
|
|
9
|
+
async details(id) {
|
|
10
|
+
return await this.api.get(`/review/${id}`);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.ReviewEndpoint = ReviewEndpoint;
|
|
14
|
+
//# sourceMappingURL=review.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review.js","sourceRoot":"","sources":["../../src/endpoints/review.ts"],"names":[],"mappings":";;;AACA,iCAAsC;AAEtC,MAAa,cAAe,SAAQ,mBAAY;IAC9C,YAAY,WAAmB;QAC7B,KAAK,CAAC,WAAW,CAAC,CAAC;IACrB,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,EAAU;QACtB,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAgB,WAAW,EAAE,EAAE,CAAC,CAAC;IAC5D,CAAC;CACF;AARD,wCAQC"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { BaseEndpoint } from './base';
|
|
3
|
-
import { ParsedUrlQueryInput } from 'querystring';
|
|
4
2
|
import { Search } from '../types/search';
|
|
5
3
|
import { Collection, Company, Movie, Person, TV } from '../types';
|
|
6
|
-
export interface SearchOptions
|
|
4
|
+
export interface SearchOptions {
|
|
7
5
|
query: string;
|
|
8
6
|
page?: number;
|
|
9
7
|
}
|
package/dist/endpoints/search.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.SearchEndpoint = void 0;
|
|
7
4
|
const base_1 = require("./base");
|
|
8
|
-
const
|
|
5
|
+
const utils_1 = require("../utils");
|
|
9
6
|
const BASE_SEARCH = '/search';
|
|
10
7
|
class SearchEndpoint extends base_1.BaseEndpoint {
|
|
11
8
|
constructor(accessToken) {
|
|
@@ -13,28 +10,28 @@ class SearchEndpoint extends base_1.BaseEndpoint {
|
|
|
13
10
|
this.accessToken = accessToken;
|
|
14
11
|
}
|
|
15
12
|
async companies(options) {
|
|
16
|
-
const params =
|
|
13
|
+
const params = (0, utils_1.parseOptions)(options);
|
|
17
14
|
return await this.api.get(`${BASE_SEARCH}/company?${params}`);
|
|
18
15
|
}
|
|
19
16
|
async collections(options) {
|
|
20
|
-
const params =
|
|
17
|
+
const params = (0, utils_1.parseOptions)(options);
|
|
21
18
|
return await this.api.get(`${BASE_SEARCH}/collection?${params}`);
|
|
22
19
|
}
|
|
23
20
|
async keywords(options) {
|
|
24
|
-
const params =
|
|
21
|
+
const params = (0, utils_1.parseOptions)(options);
|
|
25
22
|
return await this.api.get(`${BASE_SEARCH}/keyword?${params}`);
|
|
26
23
|
}
|
|
27
24
|
async movies(options) {
|
|
28
|
-
const params =
|
|
25
|
+
const params = (0, utils_1.parseOptions)(options);
|
|
29
26
|
return await this.api.get(`${BASE_SEARCH}/movie?${params}`);
|
|
30
27
|
}
|
|
31
28
|
async people(options) {
|
|
32
|
-
const params =
|
|
29
|
+
const params = (0, utils_1.parseOptions)(options);
|
|
33
30
|
return await this.api.get(`${BASE_SEARCH}/person?${params}`);
|
|
34
31
|
}
|
|
35
32
|
// TODO: Multi search
|
|
36
33
|
async tvShows(options) {
|
|
37
|
-
const params =
|
|
34
|
+
const params = (0, utils_1.parseOptions)(options);
|
|
38
35
|
return await this.api.get(`${BASE_SEARCH}/tv?${params}`);
|
|
39
36
|
}
|
|
40
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/endpoints/search.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/endpoints/search.ts"],"names":[],"mappings":";;;AAAA,iCAAsC;AAGtC,oCAAwC;AAExC,MAAM,WAAW,GAAG,SAAS,CAAC;AAsB9B,MAAa,cAAe,SAAQ,mBAAY;IAC9C,YAA+B,WAAmB;QAChD,KAAK,CAAC,WAAW,CAAC,CAAC;QADU,gBAAW,GAAX,WAAW,CAAQ;IAElD,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,OAAsB;QACpC,MAAM,MAAM,GAAG,IAAA,oBAAY,EAAC,OAAO,CAAC,CAAC;QACrC,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAkB,GAAG,WAAW,YAAY,MAAM,EAAE,CAAC,CAAC;IACjF,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,OAAsB;QACtC,MAAM,MAAM,GAAG,IAAA,oBAAY,EAAC,OAAO,CAAC,CAAC;QACrC,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAqB,GAAG,WAAW,eAAe,MAAM,EAAE,CAAC,CAAC;IACvF,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,OAAsB;QACnC,MAAM,MAAM,GAAG,IAAA,oBAAY,EAAC,OAAO,CAAC,CAAC;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