@tdanks2000/tmdb-wrapper 1.1.0 → 1.1.2
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/LICENSE +21 -0
- package/dist/@types/endpoints/configuration.js +99 -0
- package/dist/@types/models/baseEndpoint.js +3 -3
- package/dist/endpoints/account.js +3 -13
- package/dist/endpoints/certification.js +4 -17
- package/dist/endpoints/changes.js +6 -21
- package/dist/endpoints/collections.js +11 -27
- package/dist/endpoints/companies.js +6 -21
- package/dist/endpoints/configuration.js +2 -13
- package/dist/endpoints/credits.js +2 -13
- package/dist/endpoints/discover.js +6 -18
- package/dist/endpoints/find.js +3 -13
- package/dist/endpoints/genre.js +4 -17
- package/dist/endpoints/keywords.js +6 -18
- package/dist/endpoints/movies.js +51 -99
- package/dist/endpoints/networks.js +6 -21
- package/dist/endpoints/people.js +30 -58
- package/dist/endpoints/review.js +3 -13
- package/dist/endpoints/search.js +15 -38
- package/dist/endpoints/trending.js +3 -13
- package/dist/endpoints/tvEpisodes.js +29 -48
- package/dist/endpoints/tvSeasons.js +31 -52
- package/dist/endpoints/tvShows.js +61 -116
- package/dist/endpoints/watchProviders.js +9 -26
- package/dist/index.js +22 -22
- package/dist/utils/api.js +49 -27
- package/dist/utils/getimagePath.js +13 -13
- package/package.json +61 -57
- package/dist/@types/endpoints/account.d.ts +0 -16
- package/dist/@types/endpoints/account.d.ts.map +0 -1
- package/dist/@types/endpoints/certification.d.ts +0 -19
- package/dist/@types/endpoints/certification.d.ts.map +0 -1
- package/dist/@types/endpoints/changes.d.ts +0 -26
- package/dist/@types/endpoints/changes.d.ts.map +0 -1
- package/dist/@types/endpoints/collection.d.ts +0 -21
- package/dist/@types/endpoints/collection.d.ts.map +0 -1
- package/dist/@types/endpoints/companies.d.ts +0 -29
- package/dist/@types/endpoints/companies.d.ts.map +0 -1
- package/dist/@types/endpoints/configuration.d.ts +0 -106
- package/dist/@types/endpoints/configuration.d.ts.map +0 -1
- package/dist/@types/endpoints/credits.d.ts +0 -135
- package/dist/@types/endpoints/credits.d.ts.map +0 -1
- package/dist/@types/endpoints/discover.d.ts +0 -68
- package/dist/@types/endpoints/discover.d.ts.map +0 -1
- package/dist/@types/endpoints/find.d.ts +0 -20
- package/dist/@types/endpoints/find.d.ts.map +0 -1
- package/dist/@types/endpoints/genre.d.ts +0 -7
- package/dist/@types/endpoints/genre.d.ts.map +0 -1
- package/dist/@types/endpoints/index.d.ts +0 -23
- package/dist/@types/endpoints/index.d.ts.map +0 -1
- package/dist/@types/endpoints/keywords.d.ts +0 -21
- package/dist/@types/endpoints/keywords.d.ts.map +0 -1
- package/dist/@types/endpoints/movies.d.ts +0 -150
- package/dist/@types/endpoints/movies.d.ts.map +0 -1
- package/dist/@types/endpoints/networks.d.ts +0 -14
- package/dist/@types/endpoints/networks.d.ts.map +0 -1
- package/dist/@types/endpoints/options.d.ts +0 -73
- package/dist/@types/endpoints/options.d.ts.map +0 -1
- package/dist/@types/endpoints/people.d.ts +0 -135
- package/dist/@types/endpoints/people.d.ts.map +0 -1
- package/dist/@types/endpoints/review.d.ts +0 -8
- package/dist/@types/endpoints/review.d.ts.map +0 -1
- package/dist/@types/endpoints/search.d.ts +0 -32
- package/dist/@types/endpoints/search.d.ts.map +0 -1
- package/dist/@types/endpoints/trending.d.ts +0 -12
- package/dist/@types/endpoints/trending.d.ts.map +0 -1
- package/dist/@types/endpoints/tvEpisode.d.ts +0 -65
- package/dist/@types/endpoints/tvEpisode.d.ts.map +0 -1
- package/dist/@types/endpoints/tvSeasons.d.ts +0 -31
- package/dist/@types/endpoints/tvSeasons.d.ts.map +0 -1
- package/dist/@types/endpoints/tvShows.d.ts +0 -260
- package/dist/@types/endpoints/tvShows.d.ts.map +0 -1
- package/dist/@types/endpoints/watchProviders.d.ts +0 -295
- package/dist/@types/endpoints/watchProviders.d.ts.map +0 -1
- package/dist/@types/index.d.ts +0 -4
- package/dist/@types/index.d.ts.map +0 -1
- package/dist/@types/models/baseEndpoint.d.ts +0 -7
- package/dist/@types/models/baseEndpoint.d.ts.map +0 -1
- package/dist/@types/models/index.d.ts +0 -2
- package/dist/@types/models/index.d.ts.map +0 -1
- package/dist/@types/types.d.ts +0 -174
- package/dist/@types/types.d.ts.map +0 -1
- package/dist/endpoints/account.d.ts +0 -17
- package/dist/endpoints/account.d.ts.map +0 -1
- package/dist/endpoints/certification.d.ts +0 -23
- package/dist/endpoints/certification.d.ts.map +0 -1
- package/dist/endpoints/changes.d.ts +0 -31
- package/dist/endpoints/changes.d.ts.map +0 -1
- package/dist/endpoints/collections.d.ts +0 -34
- package/dist/endpoints/collections.d.ts.map +0 -1
- package/dist/endpoints/companies.d.ts +0 -31
- package/dist/endpoints/companies.d.ts.map +0 -1
- package/dist/endpoints/configuration.d.ts +0 -18
- package/dist/endpoints/configuration.d.ts.map +0 -1
- package/dist/endpoints/credits.d.ts +0 -19
- package/dist/endpoints/credits.d.ts.map +0 -1
- package/dist/endpoints/discover.d.ts +0 -24
- package/dist/endpoints/discover.d.ts.map +0 -1
- package/dist/endpoints/find.d.ts +0 -19
- package/dist/endpoints/find.d.ts.map +0 -1
- package/dist/endpoints/genre.d.ts +0 -25
- package/dist/endpoints/genre.d.ts.map +0 -1
- package/dist/endpoints/index.d.ts +0 -22
- package/dist/endpoints/index.d.ts.map +0 -1
- package/dist/endpoints/keywords.d.ts +0 -25
- package/dist/endpoints/keywords.d.ts.map +0 -1
- package/dist/endpoints/movies.d.ts +0 -142
- package/dist/endpoints/movies.d.ts.map +0 -1
- package/dist/endpoints/networks.d.ts +0 -31
- package/dist/endpoints/networks.d.ts.map +0 -1
- package/dist/endpoints/people.d.ts +0 -84
- package/dist/endpoints/people.d.ts.map +0 -1
- package/dist/endpoints/review.d.ts +0 -18
- package/dist/endpoints/review.d.ts.map +0 -1
- package/dist/endpoints/search.d.ts +0 -58
- package/dist/endpoints/search.d.ts.map +0 -1
- package/dist/endpoints/trending.d.ts +0 -21
- package/dist/endpoints/trending.d.ts.map +0 -1
- package/dist/endpoints/tvEpisodes.d.ts +0 -61
- package/dist/endpoints/tvEpisodes.d.ts.map +0 -1
- package/dist/endpoints/tvSeasons.d.ts +0 -70
- package/dist/endpoints/tvSeasons.d.ts.map +0 -1
- package/dist/endpoints/tvShows.d.ts +0 -164
- package/dist/endpoints/tvShows.d.ts.map +0 -1
- package/dist/endpoints/watchProviders.d.ts +0 -33
- package/dist/endpoints/watchProviders.d.ts.map +0 -1
- package/dist/index.d.ts +0 -29
- package/dist/index.d.ts.map +0 -1
- package/dist/utils/api.d.ts +0 -7
- package/dist/utils/api.d.ts.map +0 -1
- package/dist/utils/getimagePath.d.ts +0 -32
- package/dist/utils/getimagePath.d.ts.map +0 -1
- package/dist/utils/index.d.ts +0 -3
- package/dist/utils/index.d.ts.map +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Tommy Danks
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -1,2 +1,101 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChangeKeys = exports.StillSizes = exports.ProfileSizes = exports.PosterSizes = exports.LogoSizes = exports.BackdropSizes = void 0;
|
|
4
|
+
var BackdropSizes;
|
|
5
|
+
(function (BackdropSizes) {
|
|
6
|
+
BackdropSizes["W300"] = "w300";
|
|
7
|
+
BackdropSizes["W500"] = "w500";
|
|
8
|
+
BackdropSizes["W780"] = "w780";
|
|
9
|
+
BackdropSizes["W1280"] = "w1280";
|
|
10
|
+
BackdropSizes["ORIGINAL"] = "original";
|
|
11
|
+
})(BackdropSizes || (exports.BackdropSizes = BackdropSizes = {}));
|
|
12
|
+
var LogoSizes;
|
|
13
|
+
(function (LogoSizes) {
|
|
14
|
+
LogoSizes["W45"] = "w45";
|
|
15
|
+
LogoSizes["W92"] = "w92";
|
|
16
|
+
LogoSizes["W154"] = "w154";
|
|
17
|
+
LogoSizes["W185"] = "w185";
|
|
18
|
+
LogoSizes["W300"] = "w300";
|
|
19
|
+
LogoSizes["W500"] = "w500";
|
|
20
|
+
LogoSizes["ORIGINAL"] = "original";
|
|
21
|
+
})(LogoSizes || (exports.LogoSizes = LogoSizes = {}));
|
|
22
|
+
var PosterSizes;
|
|
23
|
+
(function (PosterSizes) {
|
|
24
|
+
PosterSizes["W92"] = "w92";
|
|
25
|
+
PosterSizes["W154"] = "w154";
|
|
26
|
+
PosterSizes["W185"] = "w185";
|
|
27
|
+
PosterSizes["W300"] = "w300";
|
|
28
|
+
PosterSizes["W500"] = "w500";
|
|
29
|
+
PosterSizes["W780"] = "w780";
|
|
30
|
+
PosterSizes["ORIGINAL"] = "original";
|
|
31
|
+
})(PosterSizes || (exports.PosterSizes = PosterSizes = {}));
|
|
32
|
+
var ProfileSizes;
|
|
33
|
+
(function (ProfileSizes) {
|
|
34
|
+
ProfileSizes["W45"] = "w45";
|
|
35
|
+
ProfileSizes["W185"] = "w185";
|
|
36
|
+
ProfileSizes["W632"] = "w632";
|
|
37
|
+
ProfileSizes["ORIGINAL"] = "original";
|
|
38
|
+
})(ProfileSizes || (exports.ProfileSizes = ProfileSizes = {}));
|
|
39
|
+
var StillSizes;
|
|
40
|
+
(function (StillSizes) {
|
|
41
|
+
StillSizes["W92"] = "w92";
|
|
42
|
+
StillSizes["W185"] = "w185";
|
|
43
|
+
StillSizes["W300"] = "w300";
|
|
44
|
+
StillSizes["ORIGINAL"] = "original";
|
|
45
|
+
})(StillSizes || (exports.StillSizes = StillSizes = {}));
|
|
46
|
+
var ChangeKeys;
|
|
47
|
+
(function (ChangeKeys) {
|
|
48
|
+
ChangeKeys["ADULT"] = "adult";
|
|
49
|
+
ChangeKeys["AIR_DATE"] = "air_date";
|
|
50
|
+
ChangeKeys["ALSO_KNOWN_AS"] = "also_known_as";
|
|
51
|
+
ChangeKeys["ALTERNATIVE_TITLES"] = "alternative_titles";
|
|
52
|
+
ChangeKeys["BIOGRAPHY"] = "biography";
|
|
53
|
+
ChangeKeys["BIRTHDAY"] = "birthday";
|
|
54
|
+
ChangeKeys["BUDGET"] = "budget";
|
|
55
|
+
ChangeKeys["CAST"] = "cast";
|
|
56
|
+
ChangeKeys["CERTIFICATIONS"] = "certifications";
|
|
57
|
+
ChangeKeys["CHARACTER_NAMES"] = "character_names";
|
|
58
|
+
ChangeKeys["CREATED_BY"] = "created_by";
|
|
59
|
+
ChangeKeys["CREW"] = "crew";
|
|
60
|
+
ChangeKeys["DEATHDAY"] = "deathday";
|
|
61
|
+
ChangeKeys["EPISODE"] = "episode";
|
|
62
|
+
ChangeKeys["EPISODE_NUMBER"] = "episode_number";
|
|
63
|
+
ChangeKeys["EPISODE_RUN_TIME"] = "episode_run_time";
|
|
64
|
+
ChangeKeys["FREEBASE_ID"] = "freebase_id";
|
|
65
|
+
ChangeKeys["FREEBASE_MID"] = "freebase_mid";
|
|
66
|
+
ChangeKeys["GENERAL"] = "general";
|
|
67
|
+
ChangeKeys["GENRES"] = "genres";
|
|
68
|
+
ChangeKeys["GUEST_STARS"] = "guest_stars";
|
|
69
|
+
ChangeKeys["HOMEPAGE"] = "homepage";
|
|
70
|
+
ChangeKeys["IMAGES"] = "images";
|
|
71
|
+
ChangeKeys["IMDB_ID"] = "imdb_id";
|
|
72
|
+
ChangeKeys["LANGUAGES"] = "languages";
|
|
73
|
+
ChangeKeys["NAME"] = "name";
|
|
74
|
+
ChangeKeys["NETWORK"] = "network";
|
|
75
|
+
ChangeKeys["ORIGIN_COUNTRY"] = "origin_country";
|
|
76
|
+
ChangeKeys["ORIGINAL_NAME"] = "original_name";
|
|
77
|
+
ChangeKeys["ORIGINAL_TITLE"] = "original_title";
|
|
78
|
+
ChangeKeys["OVERVIEW"] = "overview";
|
|
79
|
+
ChangeKeys["PARTS"] = "parts";
|
|
80
|
+
ChangeKeys["PLACE_OF_BIRTH"] = "place_of_birth";
|
|
81
|
+
ChangeKeys["PLOT_KEYWORDS"] = "plot_keywords";
|
|
82
|
+
ChangeKeys["PRODUCTION_CODE"] = "production_code";
|
|
83
|
+
ChangeKeys["PRODUCTION_COMPANIES"] = "production_companies";
|
|
84
|
+
ChangeKeys["PRODUCTION_COUNTRIES"] = "production_countries";
|
|
85
|
+
ChangeKeys["RELEASES"] = "releases";
|
|
86
|
+
ChangeKeys["REVENUE"] = "revenue";
|
|
87
|
+
ChangeKeys["RUNTIME"] = "runtime";
|
|
88
|
+
ChangeKeys["SEASON"] = "season";
|
|
89
|
+
ChangeKeys["SEASON_NUMBER"] = "season_number";
|
|
90
|
+
ChangeKeys["SEASON_REGULAR"] = "season_regular";
|
|
91
|
+
ChangeKeys["SPOKEN_LANGUAGES"] = "spoken_languages";
|
|
92
|
+
ChangeKeys["STATUS"] = "status";
|
|
93
|
+
ChangeKeys["TAGLINE"] = "tagline";
|
|
94
|
+
ChangeKeys["TITLE"] = "title";
|
|
95
|
+
ChangeKeys["TRANSLATIONS"] = "translations";
|
|
96
|
+
ChangeKeys["TVDB_ID"] = "tvdb_id";
|
|
97
|
+
ChangeKeys["TVRAGE_ID"] = "tvrage_id";
|
|
98
|
+
ChangeKeys["TYPE"] = "type";
|
|
99
|
+
ChangeKeys["VIDEO"] = "video";
|
|
100
|
+
ChangeKeys["VIDEOS"] = "videos";
|
|
101
|
+
})(ChangeKeys || (exports.ChangeKeys = ChangeKeys = {}));
|
|
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.BaseEndpoint = void 0;
|
|
4
4
|
const utils_1 = require("../../utils");
|
|
5
5
|
class BaseEndpoint {
|
|
6
|
-
constructor(
|
|
7
|
-
this.
|
|
8
|
-
this.api = new utils_1.API(
|
|
6
|
+
constructor(auth) {
|
|
7
|
+
this.auth = auth;
|
|
8
|
+
this.api = new utils_1.API(auth);
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
exports.BaseEndpoint = BaseEndpoint;
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.AccountEndpoint = void 0;
|
|
13
4
|
const _types_1 = require("../@types");
|
|
@@ -21,15 +12,14 @@ class AccountEndpoint extends _types_1.BaseEndpoint {
|
|
|
21
12
|
*/
|
|
22
13
|
constructor(access_token) {
|
|
23
14
|
super(access_token);
|
|
15
|
+
this.access_token = access_token;
|
|
24
16
|
}
|
|
25
17
|
/**
|
|
26
18
|
* Retrieves account details asynchronously.
|
|
27
19
|
* @returns {Promise<AccountDetails>} A Promise that resolves with the account details.
|
|
28
20
|
*/
|
|
29
|
-
details() {
|
|
30
|
-
return
|
|
31
|
-
return yield this.api.get('/account');
|
|
32
|
-
});
|
|
21
|
+
async details() {
|
|
22
|
+
return await this.api.get("/account");
|
|
33
23
|
}
|
|
34
24
|
}
|
|
35
25
|
exports.AccountEndpoint = AccountEndpoint;
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.CertificationEndpoint = void 0;
|
|
13
4
|
const _types_1 = require("../@types");
|
|
@@ -27,19 +18,15 @@ class CertificationEndpoint extends _types_1.BaseEndpoint {
|
|
|
27
18
|
* Retrieves certifications for movies asynchronously.
|
|
28
19
|
* @returns {Promise<Certifications>} A Promise that resolves with the certifications for movies.
|
|
29
20
|
*/
|
|
30
|
-
movies() {
|
|
31
|
-
return
|
|
32
|
-
return yield this.api.get('/certification/movie/list');
|
|
33
|
-
});
|
|
21
|
+
async movies() {
|
|
22
|
+
return await this.api.get("/certification/movie/list");
|
|
34
23
|
}
|
|
35
24
|
/**
|
|
36
25
|
* Retrieves certifications for TV shows asynchronously.
|
|
37
26
|
* @returns {Promise<Certifications>} A Promise that resolves with the certifications for TV shows.
|
|
38
27
|
*/
|
|
39
|
-
tv() {
|
|
40
|
-
return
|
|
41
|
-
return yield this.api.get('/certification/tv/list');
|
|
42
|
-
});
|
|
28
|
+
async tv() {
|
|
29
|
+
return await this.api.get("/certification/tv/list");
|
|
43
30
|
}
|
|
44
31
|
}
|
|
45
32
|
exports.CertificationEndpoint = CertificationEndpoint;
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.ChangeEndpoint = void 0;
|
|
13
4
|
const _types_1 = require("../@types");
|
|
@@ -28,30 +19,24 @@ class ChangeEndpoint extends _types_1.BaseEndpoint {
|
|
|
28
19
|
* @param {ChangeOption} [options] - Optional parameters for filtering the changes.
|
|
29
20
|
* @returns {Promise<MediaChanges>} A Promise that resolves with the changes in movies.
|
|
30
21
|
*/
|
|
31
|
-
movies(options) {
|
|
32
|
-
return
|
|
33
|
-
return yield this.api.get('/movie/changes', options);
|
|
34
|
-
});
|
|
22
|
+
async movies(options) {
|
|
23
|
+
return await this.api.get("/movie/changes", options);
|
|
35
24
|
}
|
|
36
25
|
/**
|
|
37
26
|
* Retrieves changes in TV shows asynchronously.
|
|
38
27
|
* @param {ChangeOption} [options] - Optional parameters for filtering the changes.
|
|
39
28
|
* @returns {Promise<MediaChanges>} A Promise that resolves with the changes in TV shows.
|
|
40
29
|
*/
|
|
41
|
-
tv(options) {
|
|
42
|
-
return
|
|
43
|
-
return yield this.api.get('/tv/changes', options);
|
|
44
|
-
});
|
|
30
|
+
async tv(options) {
|
|
31
|
+
return await this.api.get("/tv/changes", options);
|
|
45
32
|
}
|
|
46
33
|
/**
|
|
47
34
|
* Retrieves changes related to persons asynchronously.
|
|
48
35
|
* @param {ChangeOption} [options] - Optional parameters for filtering the changes.
|
|
49
36
|
* @returns {Promise<MediaChanges>} A Promise that resolves with the changes related to persons.
|
|
50
37
|
*/
|
|
51
|
-
person(options) {
|
|
52
|
-
return
|
|
53
|
-
return yield this.api.get('/person/change', options);
|
|
54
|
-
});
|
|
38
|
+
async person(options) {
|
|
39
|
+
return await this.api.get("/person/change", options);
|
|
55
40
|
}
|
|
56
41
|
}
|
|
57
42
|
exports.ChangeEndpoint = ChangeEndpoint;
|
|
@@ -1,17 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.CollectionsEndpoint = void 0;
|
|
13
4
|
const _types_1 = require("../@types");
|
|
14
|
-
const BASE_COLLECTION =
|
|
5
|
+
const BASE_COLLECTION = "/collection";
|
|
15
6
|
/**
|
|
16
7
|
* Represents an endpoint for accessing collections and their details.
|
|
17
8
|
*/
|
|
@@ -30,10 +21,8 @@ class CollectionsEndpoint extends _types_1.BaseEndpoint {
|
|
|
30
21
|
* @param {LanguageOption} [options] - Optional parameters for specifying the language.
|
|
31
22
|
* @returns {Promise<DetailedCollection>} A Promise that resolves with the detailed information of the collection.
|
|
32
23
|
*/
|
|
33
|
-
details(id, options) {
|
|
34
|
-
return
|
|
35
|
-
return yield this.api.get(`${BASE_COLLECTION}/${id}`, options);
|
|
36
|
-
});
|
|
24
|
+
async details(id, options) {
|
|
25
|
+
return await this.api.get(`${BASE_COLLECTION}/${id}`, options);
|
|
37
26
|
}
|
|
38
27
|
/**
|
|
39
28
|
* Retrieves images associated with a specific collection asynchronously.
|
|
@@ -41,15 +30,12 @@ class CollectionsEndpoint extends _types_1.BaseEndpoint {
|
|
|
41
30
|
* @param {CollectionImageOptions} [options] - Optional parameters for specifying image options.
|
|
42
31
|
* @returns {Promise<ImageCollection>} A Promise that resolves with the collection images.
|
|
43
32
|
*/
|
|
44
|
-
images(id, options) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
};
|
|
51
|
-
return yield this.api.get(`${BASE_COLLECTION}/${id}/images`, computedOptions);
|
|
52
|
-
});
|
|
33
|
+
async images(id, options) {
|
|
34
|
+
const computedOptions = {
|
|
35
|
+
include_image_language: options?.include_image_language?.join(","),
|
|
36
|
+
language: options?.language,
|
|
37
|
+
};
|
|
38
|
+
return await this.api.get(`${BASE_COLLECTION}/${id}/images`, computedOptions);
|
|
53
39
|
}
|
|
54
40
|
/**
|
|
55
41
|
* Retrieves translations for a specific collection asynchronously.
|
|
@@ -57,10 +43,8 @@ class CollectionsEndpoint extends _types_1.BaseEndpoint {
|
|
|
57
43
|
* @param {LanguageOption} [options] - Optional parameters for specifying the language.
|
|
58
44
|
* @returns {Promise<Translations>} A Promise that resolves with the translations of the collection.
|
|
59
45
|
*/
|
|
60
|
-
translations(id, options) {
|
|
61
|
-
return
|
|
62
|
-
return yield this.api.get(`${BASE_COLLECTION}/${id}/translations`, options);
|
|
63
|
-
});
|
|
46
|
+
async translations(id, options) {
|
|
47
|
+
return await this.api.get(`${BASE_COLLECTION}/${id}/translations`, options);
|
|
64
48
|
}
|
|
65
49
|
}
|
|
66
50
|
exports.CollectionsEndpoint = CollectionsEndpoint;
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.CompaniesEndpoint = void 0;
|
|
13
4
|
const _types_1 = require("../@types");
|
|
@@ -28,30 +19,24 @@ class CompaniesEndpoint extends _types_1.BaseEndpoint {
|
|
|
28
19
|
* @param {number} id - The ID of the company.
|
|
29
20
|
* @returns {Promise<CompanyDetails>} A Promise that resolves with the detailed information of the company.
|
|
30
21
|
*/
|
|
31
|
-
details(id) {
|
|
32
|
-
return
|
|
33
|
-
return yield this.api.get(`/company/${id}`);
|
|
34
|
-
});
|
|
22
|
+
async details(id) {
|
|
23
|
+
return await this.api.get(`/company/${id}`);
|
|
35
24
|
}
|
|
36
25
|
/**
|
|
37
26
|
* Retrieves alternative names of a specific company asynchronously.
|
|
38
27
|
* @param {number} id - The ID of the company.
|
|
39
28
|
* @returns {Promise<AlternativeNames>} A Promise that resolves with the alternative names of the company.
|
|
40
29
|
*/
|
|
41
|
-
alternativeNames(id) {
|
|
42
|
-
return
|
|
43
|
-
return yield this.api.get(`/company/${id}/alternative_names`);
|
|
44
|
-
});
|
|
30
|
+
async alternativeNames(id) {
|
|
31
|
+
return await this.api.get(`/company/${id}/alternative_names`);
|
|
45
32
|
}
|
|
46
33
|
/**
|
|
47
34
|
* Retrieves images associated with a specific company asynchronously.
|
|
48
35
|
* @param {number} id - The ID of the company.
|
|
49
36
|
* @returns {Promise<CompanyImages>} A Promise that resolves with the images of the company.
|
|
50
37
|
*/
|
|
51
|
-
images(id) {
|
|
52
|
-
return
|
|
53
|
-
return yield this.api.get(`/company/${id}/images`);
|
|
54
|
-
});
|
|
38
|
+
async images(id) {
|
|
39
|
+
return await this.api.get(`/company/${id}/images`);
|
|
55
40
|
}
|
|
56
41
|
}
|
|
57
42
|
exports.CompaniesEndpoint = CompaniesEndpoint;
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.ConfigurationEndpoint = void 0;
|
|
13
4
|
const _types_1 = require("../@types");
|
|
@@ -27,10 +18,8 @@ class ConfigurationEndpoint extends _types_1.BaseEndpoint {
|
|
|
27
18
|
* Retrieves the current system configuration asynchronously.
|
|
28
19
|
* @returns {Promise<Configuration>} A Promise that resolves with the current system configuration.
|
|
29
20
|
*/
|
|
30
|
-
getCurrent() {
|
|
31
|
-
return
|
|
32
|
-
return yield this.api.get(`/configuration`);
|
|
33
|
-
});
|
|
21
|
+
async getCurrent() {
|
|
22
|
+
return await this.api.get(`/configuration`);
|
|
34
23
|
}
|
|
35
24
|
}
|
|
36
25
|
exports.ConfigurationEndpoint = ConfigurationEndpoint;
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.CreditsEndpoint = void 0;
|
|
13
4
|
const _types_1 = require("../@types");
|
|
@@ -28,10 +19,8 @@ class CreditsEndpoint extends _types_1.BaseEndpoint {
|
|
|
28
19
|
* @param {string} id - The ID of the credit.
|
|
29
20
|
* @returns {Promise<CreditResponse>} A Promise that resolves with the credit details.
|
|
30
21
|
*/
|
|
31
|
-
getById(id) {
|
|
32
|
-
return
|
|
33
|
-
return yield this.api.get(`/credit/${id}`);
|
|
34
|
-
});
|
|
22
|
+
async getById(id) {
|
|
23
|
+
return await this.api.get(`/credit/${id}`);
|
|
35
24
|
}
|
|
36
25
|
}
|
|
37
26
|
exports.CreditsEndpoint = CreditsEndpoint;
|
|
@@ -1,17 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.DiscoverEndpoint = void 0;
|
|
13
4
|
const _types_1 = require("../@types");
|
|
14
|
-
const BASE_DISCOVER =
|
|
5
|
+
const BASE_DISCOVER = "/discover";
|
|
15
6
|
/**
|
|
16
7
|
* Represents an endpoint for discovering movies and TV shows based on various criteria.
|
|
17
8
|
*/
|
|
@@ -22,26 +13,23 @@ class DiscoverEndpoint extends _types_1.BaseEndpoint {
|
|
|
22
13
|
*/
|
|
23
14
|
constructor(access_token) {
|
|
24
15
|
super(access_token);
|
|
16
|
+
this.access_token = access_token;
|
|
25
17
|
}
|
|
26
18
|
/**
|
|
27
19
|
* Retrieves a list of movies based on the provided query options asynchronously.
|
|
28
20
|
* @param {MovieQueryOptions} [options] - Optional parameters for refining the movie discovery.
|
|
29
21
|
* @returns {Promise<MovieDiscoverResult>} A Promise that resolves with the movie discovery results.
|
|
30
22
|
*/
|
|
31
|
-
movie(options) {
|
|
32
|
-
return
|
|
33
|
-
return yield this.api.get(`${BASE_DISCOVER}/movie`, options);
|
|
34
|
-
});
|
|
23
|
+
async movie(options) {
|
|
24
|
+
return await this.api.get(`${BASE_DISCOVER}/movie`, options);
|
|
35
25
|
}
|
|
36
26
|
/**
|
|
37
27
|
* Retrieves a list of TV shows based on the provided query options asynchronously.
|
|
38
28
|
* @param {TvShowQueryOptions} [options] - Optional parameters for refining the TV show discovery.
|
|
39
29
|
* @returns {Promise<TvShowDiscoverResult>} A Promise that resolves with the TV show discovery results.
|
|
40
30
|
*/
|
|
41
|
-
tvShow(options) {
|
|
42
|
-
return
|
|
43
|
-
return yield this.api.get(`${BASE_DISCOVER}/tv`, options);
|
|
44
|
-
});
|
|
31
|
+
async tvShow(options) {
|
|
32
|
+
return await this.api.get(`${BASE_DISCOVER}/tv`, options);
|
|
45
33
|
}
|
|
46
34
|
}
|
|
47
35
|
exports.DiscoverEndpoint = DiscoverEndpoint;
|
package/dist/endpoints/find.js
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.FindEndpoint = void 0;
|
|
13
4
|
const _types_1 = require("../@types");
|
|
@@ -21,6 +12,7 @@ class FindEndpoint extends _types_1.BaseEndpoint {
|
|
|
21
12
|
*/
|
|
22
13
|
constructor(access_token) {
|
|
23
14
|
super(access_token);
|
|
15
|
+
this.access_token = access_token;
|
|
24
16
|
}
|
|
25
17
|
/**
|
|
26
18
|
* Retrieves media by external ID asynchronously.
|
|
@@ -28,10 +20,8 @@ class FindEndpoint extends _types_1.BaseEndpoint {
|
|
|
28
20
|
* @param {ExternalIdOptions} options - Options for finding media by external ID.
|
|
29
21
|
* @returns {Promise<FindResult>} A Promise that resolves with the result of the find operation.
|
|
30
22
|
*/
|
|
31
|
-
byId(externalId, options) {
|
|
32
|
-
return
|
|
33
|
-
return yield this.api.get(`/find/${externalId}`, options);
|
|
34
|
-
});
|
|
23
|
+
async byId(externalId, options) {
|
|
24
|
+
return await this.api.get(`/find/${externalId}`, options);
|
|
35
25
|
}
|
|
36
26
|
}
|
|
37
27
|
exports.FindEndpoint = FindEndpoint;
|
package/dist/endpoints/genre.js
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.GenreEndpoint = void 0;
|
|
13
4
|
const _types_1 = require("../@types");
|
|
@@ -28,20 +19,16 @@ class GenreEndpoint extends _types_1.BaseEndpoint {
|
|
|
28
19
|
* @param {LanguageOption} [options] - Optional parameters for specifying the language.
|
|
29
20
|
* @returns {Promise<Genres>} A Promise that resolves with the genre information for movies.
|
|
30
21
|
*/
|
|
31
|
-
movies(options) {
|
|
32
|
-
return
|
|
33
|
-
return yield this.api.get('/genre/movie/list', options);
|
|
34
|
-
});
|
|
22
|
+
async movies(options) {
|
|
23
|
+
return await this.api.get("/genre/movie/list", options);
|
|
35
24
|
}
|
|
36
25
|
/**
|
|
37
26
|
* Retrieves genre information for TV shows asynchronously.
|
|
38
27
|
* @param {LanguageOption} [options] - Optional parameters for specifying the language.
|
|
39
28
|
* @returns {Promise<Genres>} A Promise that resolves with the genre information for TV shows.
|
|
40
29
|
*/
|
|
41
|
-
tv(options) {
|
|
42
|
-
return
|
|
43
|
-
return yield this.api.get('/genre/tv/list', options);
|
|
44
|
-
});
|
|
30
|
+
async tv(options) {
|
|
31
|
+
return await this.api.get("/genre/tv/list", options);
|
|
45
32
|
}
|
|
46
33
|
}
|
|
47
34
|
exports.GenreEndpoint = GenreEndpoint;
|
|
@@ -1,17 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.KeywordsEndpoint = void 0;
|
|
13
4
|
const _types_1 = require("../@types");
|
|
14
|
-
const BASE_KEYWORD =
|
|
5
|
+
const BASE_KEYWORD = "/keyword";
|
|
15
6
|
/**
|
|
16
7
|
* Represents an endpoint for accessing keyword details and related movies.
|
|
17
8
|
*/
|
|
@@ -22,16 +13,15 @@ class KeywordsEndpoint extends _types_1.BaseEndpoint {
|
|
|
22
13
|
*/
|
|
23
14
|
constructor(access_token) {
|
|
24
15
|
super(access_token);
|
|
16
|
+
this.access_token = access_token;
|
|
25
17
|
}
|
|
26
18
|
/**
|
|
27
19
|
* Retrieves details of a specific keyword asynchronously.
|
|
28
20
|
* @param {number} keywordId - The ID of the keyword.
|
|
29
21
|
* @returns {Promise<Keyword>} A Promise that resolves with the details of the keyword.
|
|
30
22
|
*/
|
|
31
|
-
details(keywordId) {
|
|
32
|
-
return
|
|
33
|
-
return yield this.api.get(`${BASE_KEYWORD}/${keywordId}`);
|
|
34
|
-
});
|
|
23
|
+
async details(keywordId) {
|
|
24
|
+
return await this.api.get(`${BASE_KEYWORD}/${keywordId}`);
|
|
35
25
|
}
|
|
36
26
|
/**
|
|
37
27
|
* Retrieves movies belonging to a specific keyword asynchronously.
|
|
@@ -39,10 +29,8 @@ class KeywordsEndpoint extends _types_1.BaseEndpoint {
|
|
|
39
29
|
* @param {KeywordsOptions} [options] - Optional parameters for refining the search.
|
|
40
30
|
* @returns {Promise<BelongingMovies>} A Promise that resolves with the movies belonging to the keyword.
|
|
41
31
|
*/
|
|
42
|
-
belongingMovies(keywordId, options) {
|
|
43
|
-
return
|
|
44
|
-
return yield this.api.get(`${BASE_KEYWORD}/${keywordId}/movies`, options);
|
|
45
|
-
});
|
|
32
|
+
async belongingMovies(keywordId, options) {
|
|
33
|
+
return await this.api.get(`${BASE_KEYWORD}/${keywordId}/movies`, options);
|
|
46
34
|
}
|
|
47
35
|
}
|
|
48
36
|
exports.KeywordsEndpoint = KeywordsEndpoint;
|