@tdanks2000/tmdb-wrapper 1.0.3 → 1.1.1
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/README.md +334 -148
- package/dist/endpoints/account.js +2 -13
- package/dist/endpoints/certification.js +4 -17
- package/dist/endpoints/changes.js +6 -21
- package/dist/endpoints/collections.js +10 -26
- 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 +4 -17
- package/dist/endpoints/find.js +2 -13
- package/dist/endpoints/genre.js +4 -17
- package/dist/endpoints/index.js +3 -0
- package/dist/endpoints/keywords.js +4 -17
- package/dist/endpoints/movies.js +48 -98
- package/dist/endpoints/networks.js +6 -21
- package/dist/endpoints/people.js +26 -57
- package/dist/endpoints/review.js +2 -13
- package/dist/endpoints/search.js +14 -37
- package/dist/endpoints/trending.js +2 -13
- package/dist/endpoints/tvEpisodes.js +26 -48
- package/dist/endpoints/tvSeasons.js +28 -52
- package/dist/endpoints/tvShows.js +58 -115
- package/dist/endpoints/watchProviders.js +46 -0
- package/dist/index.js +3 -0
- package/dist/utils/api.js +12 -23
- package/dist/utils/getimagePath.js +39 -8
- package/package.json +59 -41
- package/.github/workflows/npm-publish.yml +0 -33
- 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 -19
- 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/index.d.ts +0 -26
- 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 -12
- 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/src/@types/endpoints/account.ts +0 -17
- package/src/@types/endpoints/certification.ts +0 -19
- package/src/@types/endpoints/changes.ts +0 -29
- package/src/@types/endpoints/collection.ts +0 -23
- package/src/@types/endpoints/companies.ts +0 -33
- package/src/@types/endpoints/configuration.ts +0 -112
- package/src/@types/endpoints/credits.ts +0 -149
- package/src/@types/endpoints/discover.ts +0 -87
- package/src/@types/endpoints/find.ts +0 -28
- package/src/@types/endpoints/genre.ts +0 -3
- package/src/@types/endpoints/index.ts +0 -22
- package/src/@types/endpoints/keywords.ts +0 -24
- package/src/@types/endpoints/movies.ts +0 -169
- package/src/@types/endpoints/networks.ts +0 -15
- package/src/@types/endpoints/options.ts +0 -189
- package/src/@types/endpoints/people.ts +0 -151
- package/src/@types/endpoints/review.ts +0 -8
- package/src/@types/endpoints/search.ts +0 -39
- package/src/@types/endpoints/trending.ts +0 -20
- package/src/@types/endpoints/tvEpisode.ts +0 -72
- package/src/@types/endpoints/tvSeasons.ts +0 -37
- package/src/@types/endpoints/tvShows.ts +0 -284
- package/src/@types/endpoints/watchProviders.ts +0 -298
- package/src/@types/index.ts +0 -3
- package/src/@types/models/baseEndpoint.ts +0 -9
- package/src/@types/models/index.ts +0 -1
- package/src/@types/types.ts +0 -199
- package/src/endpoints/account.ts +0 -22
- package/src/endpoints/certification.ts +0 -30
- package/src/endpoints/changes.ts +0 -41
- package/src/endpoints/collections.ts +0 -57
- package/src/endpoints/companies.ts +0 -41
- package/src/endpoints/configuration.ts +0 -22
- package/src/endpoints/credits.ts +0 -23
- package/src/endpoints/discover.ts +0 -40
- package/src/endpoints/find.ts +0 -24
- package/src/endpoints/genre.ts +0 -32
- package/src/endpoints/index.ts +0 -18
- package/src/endpoints/keywords.ts +0 -35
- package/src/endpoints/movies.ts +0 -244
- package/src/endpoints/networks.ts +0 -41
- package/src/endpoints/people.ts +0 -147
- package/src/endpoints/review.ts +0 -23
- package/src/endpoints/search.ts +0 -93
- package/src/endpoints/trending.ts +0 -30
- package/src/endpoints/tvEpisodes.ts +0 -125
- package/src/endpoints/tvSeasons.ts +0 -138
- package/src/endpoints/tvShows.ts +0 -286
- package/src/index.ts +0 -66
- package/src/utils/api.ts +0 -31
- package/src/utils/getimagePath.ts +0 -16
- package/src/utils/index.ts +0 -2
- package/tsconfig.json +0 -101
package/dist/endpoints/people.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.PeopleEndpoint = void 0;
|
|
13
4
|
const _types_1 = require("../@types");
|
|
@@ -30,14 +21,12 @@ class PeopleEndpoint extends _types_1.BaseEndpoint {
|
|
|
30
21
|
* @param {string} [language] - Optional parameter for specifying the language.
|
|
31
22
|
* @returns {Promise<AppendToResponse<PersonDetails, AppendToResponsePersonKey[], 'person'>>} A Promise that resolves with the details of the person.
|
|
32
23
|
*/
|
|
33
|
-
details(id, appendToResponse, language) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
return yield this.api.get(`${BASE_PERSON}/${id}`, options);
|
|
40
|
-
});
|
|
24
|
+
async details(id, appendToResponse, language) {
|
|
25
|
+
const options = {
|
|
26
|
+
append_to_response: appendToResponse ? appendToResponse.join(',') : undefined,
|
|
27
|
+
language: language,
|
|
28
|
+
};
|
|
29
|
+
return await this.api.get(`${BASE_PERSON}/${id}`, options);
|
|
41
30
|
}
|
|
42
31
|
/**
|
|
43
32
|
* Retrieves changes made to a specific person asynchronously.
|
|
@@ -45,10 +34,8 @@ class PeopleEndpoint extends _types_1.BaseEndpoint {
|
|
|
45
34
|
* @param {ChangeOption} [options] - Optional parameters for filtering changes.
|
|
46
35
|
* @returns {Promise<Changes<PersonChangeValue>>} A Promise that resolves with the changes made to the person.
|
|
47
36
|
*/
|
|
48
|
-
changes(id, options) {
|
|
49
|
-
return
|
|
50
|
-
return yield this.api.get(`${BASE_PERSON}/${id}/changes`, options);
|
|
51
|
-
});
|
|
37
|
+
async changes(id, options) {
|
|
38
|
+
return await this.api.get(`${BASE_PERSON}/${id}/changes`, options);
|
|
52
39
|
}
|
|
53
40
|
/**
|
|
54
41
|
* Retrieves movie credits of a specific person asynchronously.
|
|
@@ -56,10 +43,8 @@ class PeopleEndpoint extends _types_1.BaseEndpoint {
|
|
|
56
43
|
* @param {LanguageOption} [options] - Optional parameters for specifying the language.
|
|
57
44
|
* @returns {Promise<PersonMovieCredit>} A Promise that resolves with the movie credits of the person.
|
|
58
45
|
*/
|
|
59
|
-
movieCredits(id, options) {
|
|
60
|
-
return
|
|
61
|
-
return yield this.api.get(`${BASE_PERSON}/${id}/movie_credits`, options);
|
|
62
|
-
});
|
|
46
|
+
async movieCredits(id, options) {
|
|
47
|
+
return await this.api.get(`${BASE_PERSON}/${id}/movie_credits`, options);
|
|
63
48
|
}
|
|
64
49
|
/**
|
|
65
50
|
* Retrieves TV show credits of a specific person asynchronously.
|
|
@@ -67,10 +52,8 @@ class PeopleEndpoint extends _types_1.BaseEndpoint {
|
|
|
67
52
|
* @param {LanguageOption} [options] - Optional parameters for specifying the language.
|
|
68
53
|
* @returns {Promise<PersonTvShowCredit>} A Promise that resolves with the TV show credits of the person.
|
|
69
54
|
*/
|
|
70
|
-
tvShowCredits(id, options) {
|
|
71
|
-
return
|
|
72
|
-
return yield this.api.get(`${BASE_PERSON}/${id}/tv_credits`, options);
|
|
73
|
-
});
|
|
55
|
+
async tvShowCredits(id, options) {
|
|
56
|
+
return await this.api.get(`${BASE_PERSON}/${id}/tv_credits`, options);
|
|
74
57
|
}
|
|
75
58
|
/**
|
|
76
59
|
* Retrieves combined credits of a specific person asynchronously.
|
|
@@ -78,30 +61,24 @@ class PeopleEndpoint extends _types_1.BaseEndpoint {
|
|
|
78
61
|
* @param {LanguageOption} [options] - Optional parameters for specifying the language.
|
|
79
62
|
* @returns {Promise<PersonCombinedCredits>} A Promise that resolves with the combined credits of the person.
|
|
80
63
|
*/
|
|
81
|
-
combinedCredits(id, options) {
|
|
82
|
-
return
|
|
83
|
-
return yield this.api.get(`${BASE_PERSON}/${id}/combined_credits`, options);
|
|
84
|
-
});
|
|
64
|
+
async combinedCredits(id, options) {
|
|
65
|
+
return await this.api.get(`${BASE_PERSON}/${id}/combined_credits`, options);
|
|
85
66
|
}
|
|
86
67
|
/**
|
|
87
68
|
* Retrieves external IDs of a specific person asynchronously.
|
|
88
69
|
* @param {number} id - The ID of the person.
|
|
89
70
|
* @returns {Promise<ExternalIds>} A Promise that resolves with the external IDs of the person.
|
|
90
71
|
*/
|
|
91
|
-
externalId(id) {
|
|
92
|
-
return
|
|
93
|
-
return yield this.api.get(`${BASE_PERSON}/${id}/external_ids`);
|
|
94
|
-
});
|
|
72
|
+
async externalId(id) {
|
|
73
|
+
return await this.api.get(`${BASE_PERSON}/${id}/external_ids`);
|
|
95
74
|
}
|
|
96
75
|
/**
|
|
97
76
|
* Retrieves images of a specific person asynchronously.
|
|
98
77
|
* @param {number} id - The ID of the person.
|
|
99
78
|
* @returns {Promise<PeopleImages>} A Promise that resolves with the images of the person.
|
|
100
79
|
*/
|
|
101
|
-
images(id) {
|
|
102
|
-
return
|
|
103
|
-
return yield this.api.get(`${BASE_PERSON}/${id}/images`);
|
|
104
|
-
});
|
|
80
|
+
async images(id) {
|
|
81
|
+
return await this.api.get(`${BASE_PERSON}/${id}/images`);
|
|
105
82
|
}
|
|
106
83
|
/**
|
|
107
84
|
* Retrieves tagged images of a specific person asynchronously.
|
|
@@ -109,39 +86,31 @@ class PeopleEndpoint extends _types_1.BaseEndpoint {
|
|
|
109
86
|
* @param {PageOption} [options] - Optional parameters for specifying pagination options.
|
|
110
87
|
* @returns {Promise<TaggedImages>} A Promise that resolves with the tagged images of the person.
|
|
111
88
|
*/
|
|
112
|
-
taggedImages(id, options) {
|
|
113
|
-
return
|
|
114
|
-
return yield this.api.get(`${BASE_PERSON}/${id}/tagged_images`, options);
|
|
115
|
-
});
|
|
89
|
+
async taggedImages(id, options) {
|
|
90
|
+
return await this.api.get(`${BASE_PERSON}/${id}/tagged_images`, options);
|
|
116
91
|
}
|
|
117
92
|
/**
|
|
118
93
|
* Retrieves translations of a specific person asynchronously.
|
|
119
94
|
* @param {number} id - The ID of the person.
|
|
120
95
|
* @returns {Promise<PersonTranslations>} A Promise that resolves with the translations of the person.
|
|
121
96
|
*/
|
|
122
|
-
translation(id) {
|
|
123
|
-
return
|
|
124
|
-
return yield this.api.get(`${BASE_PERSON}/${id}/translations`);
|
|
125
|
-
});
|
|
97
|
+
async translation(id) {
|
|
98
|
+
return await this.api.get(`${BASE_PERSON}/${id}/translations`);
|
|
126
99
|
}
|
|
127
100
|
/**
|
|
128
101
|
* Retrieves details of the latest person asynchronously.
|
|
129
102
|
* @returns {Promise<PersonDetails>} A Promise that resolves with the details of the latest person.
|
|
130
103
|
*/
|
|
131
|
-
latest() {
|
|
132
|
-
return
|
|
133
|
-
return yield this.api.get(`${BASE_PERSON}/latest`);
|
|
134
|
-
});
|
|
104
|
+
async latest() {
|
|
105
|
+
return await this.api.get(`${BASE_PERSON}/latest`);
|
|
135
106
|
}
|
|
136
107
|
/**
|
|
137
108
|
* Retrieves popular persons asynchronously.
|
|
138
109
|
* @param {LanguageOption & PageOption} [options] - Optional parameters for specifying language and pagination options.
|
|
139
110
|
* @returns {Promise<PopularPersons>} A Promise that resolves with the popular persons.
|
|
140
111
|
*/
|
|
141
|
-
popular(options) {
|
|
142
|
-
return
|
|
143
|
-
return yield this.api.get(`${BASE_PERSON}/popular`, options);
|
|
144
|
-
});
|
|
112
|
+
async popular(options) {
|
|
113
|
+
return await this.api.get(`${BASE_PERSON}/popular`, options);
|
|
145
114
|
}
|
|
146
115
|
}
|
|
147
116
|
exports.PeopleEndpoint = PeopleEndpoint;
|
package/dist/endpoints/review.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.ReviewEndpoint = void 0;
|
|
13
4
|
const _types_1 = require("../@types");
|
|
@@ -27,10 +18,8 @@ class ReviewEndpoint extends _types_1.BaseEndpoint {
|
|
|
27
18
|
* @param {string} id - The ID of the review.
|
|
28
19
|
* @returns {Promise<ReviewDetails>} A Promise that resolves with the details of the review.
|
|
29
20
|
*/
|
|
30
|
-
details(id) {
|
|
31
|
-
return
|
|
32
|
-
return yield this.api.get(`/review/${id}`);
|
|
33
|
-
});
|
|
21
|
+
async details(id) {
|
|
22
|
+
return await this.api.get(`/review/${id}`);
|
|
34
23
|
}
|
|
35
24
|
}
|
|
36
25
|
exports.ReviewEndpoint = ReviewEndpoint;
|
package/dist/endpoints/search.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.SearchEndpoint = void 0;
|
|
13
4
|
const _types_1 = require("../@types");
|
|
@@ -29,70 +20,56 @@ class SearchEndpoint extends _types_1.BaseEndpoint {
|
|
|
29
20
|
* @param {SearchOptions} options - The search options.
|
|
30
21
|
* @returns {Promise<Search<Company>>} A Promise that resolves with the search results for companies.
|
|
31
22
|
*/
|
|
32
|
-
companies(options) {
|
|
33
|
-
return
|
|
34
|
-
return yield this.api.get(`${BASE_SEARCH}/company`, options);
|
|
35
|
-
});
|
|
23
|
+
async companies(options) {
|
|
24
|
+
return await this.api.get(`${BASE_SEARCH}/company`, options);
|
|
36
25
|
}
|
|
37
26
|
/**
|
|
38
27
|
* Searches for collections asynchronously.
|
|
39
28
|
* @param {SearchOptions} options - The search options.
|
|
40
29
|
* @returns {Promise<Search<Collection>>} A Promise that resolves with the search results for collections.
|
|
41
30
|
*/
|
|
42
|
-
collections(options) {
|
|
43
|
-
return
|
|
44
|
-
return yield this.api.get(`${BASE_SEARCH}/collection`, options);
|
|
45
|
-
});
|
|
31
|
+
async collections(options) {
|
|
32
|
+
return await this.api.get(`${BASE_SEARCH}/collection`, options);
|
|
46
33
|
}
|
|
47
34
|
/**
|
|
48
35
|
* Searches for keywords asynchronously.
|
|
49
36
|
* @param {SearchOptions} options - The search options.
|
|
50
37
|
* @returns {Promise<Search<{ id: string; name: string }>>} A Promise that resolves with the search results for keywords.
|
|
51
38
|
*/
|
|
52
|
-
keywords(options) {
|
|
53
|
-
return
|
|
54
|
-
return yield this.api.get(`${BASE_SEARCH}/keyword`, options);
|
|
55
|
-
});
|
|
39
|
+
async keywords(options) {
|
|
40
|
+
return await this.api.get(`${BASE_SEARCH}/keyword`, options);
|
|
56
41
|
}
|
|
57
42
|
/**
|
|
58
43
|
* Searches for movies asynchronously.
|
|
59
44
|
* @param {MovieSearchOptions} options - The search options.
|
|
60
45
|
* @returns {Promise<Search<Movie>>} A Promise that resolves with the search results for movies.
|
|
61
46
|
*/
|
|
62
|
-
movies(options) {
|
|
63
|
-
return
|
|
64
|
-
return yield this.api.get(`${BASE_SEARCH}/movie`, options);
|
|
65
|
-
});
|
|
47
|
+
async movies(options) {
|
|
48
|
+
return await this.api.get(`${BASE_SEARCH}/movie`, options);
|
|
66
49
|
}
|
|
67
50
|
/**
|
|
68
51
|
* Searches for people asynchronously.
|
|
69
52
|
* @param {PeopleSearchOptions} options - The search options.
|
|
70
53
|
* @returns {Promise<Search<Person>>} A Promise that resolves with the search results for people.
|
|
71
54
|
*/
|
|
72
|
-
people(options) {
|
|
73
|
-
return
|
|
74
|
-
return yield this.api.get(`${BASE_SEARCH}/person`, options);
|
|
75
|
-
});
|
|
55
|
+
async people(options) {
|
|
56
|
+
return await this.api.get(`${BASE_SEARCH}/person`, options);
|
|
76
57
|
}
|
|
77
58
|
/**
|
|
78
59
|
* Searches for TV shows asynchronously.
|
|
79
60
|
* @param {TvSearchOptions} options - The search options.
|
|
80
61
|
* @returns {Promise<Search<TV>>} A Promise that resolves with the search results for TV shows.
|
|
81
62
|
*/
|
|
82
|
-
tv(options) {
|
|
83
|
-
return
|
|
84
|
-
return yield this.api.get(`${BASE_SEARCH}/tv`, options);
|
|
85
|
-
});
|
|
63
|
+
async tv(options) {
|
|
64
|
+
return await this.api.get(`${BASE_SEARCH}/tv`, options);
|
|
86
65
|
}
|
|
87
66
|
/**
|
|
88
67
|
* Performs a multi-search asynchronously.
|
|
89
68
|
* @param {MultiSearchOptions} options - The search options.
|
|
90
69
|
* @returns {Promise<Search<MultiSearchResult>>} A Promise that resolves with the multi-search results.
|
|
91
70
|
*/
|
|
92
|
-
multi(options) {
|
|
93
|
-
return
|
|
94
|
-
return yield this.api.get(`${BASE_SEARCH}/multi`, options);
|
|
95
|
-
});
|
|
71
|
+
async multi(options) {
|
|
72
|
+
return await this.api.get(`${BASE_SEARCH}/multi`, options);
|
|
96
73
|
}
|
|
97
74
|
}
|
|
98
75
|
exports.SearchEndpoint = SearchEndpoint;
|
|
@@ -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.TrendingEndpoint = void 0;
|
|
13
4
|
const _types_1 = require("../@types");
|
|
@@ -30,10 +21,8 @@ class TrendingEndpoint extends _types_1.BaseEndpoint {
|
|
|
30
21
|
* @returns {Promise<TrendingResults<T>>} A Promise that resolves with the trending results.
|
|
31
22
|
* @template T - The type of media being searched for (e.g., 'movie', 'tv').
|
|
32
23
|
*/
|
|
33
|
-
trending(mediaType, timeWindow, options) {
|
|
34
|
-
return
|
|
35
|
-
return yield this.api.get(`/trending/${mediaType}/${timeWindow}`, options);
|
|
36
|
-
});
|
|
24
|
+
async trending(mediaType, timeWindow, options) {
|
|
25
|
+
return await this.api.get(`/trending/${mediaType}/${timeWindow}`, options);
|
|
37
26
|
}
|
|
38
27
|
}
|
|
39
28
|
exports.TrendingEndpoint = TrendingEndpoint;
|
|
@@ -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.TvEpisodesEndpoint = void 0;
|
|
13
4
|
const _types_1 = require("../@types");
|
|
@@ -33,11 +24,12 @@ class TvEpisodesEndpoint extends _types_1.BaseEndpoint {
|
|
|
33
24
|
* @returns {Promise<AppendToResponse<Omit<Episode, 'show_id'>, AppendToResponseTvEpisodeKey[], 'tvEpisode'>>}
|
|
34
25
|
* A Promise that resolves with the details of the TV episode.
|
|
35
26
|
*/
|
|
36
|
-
details(episodeSelection, appendToResponse, options) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
27
|
+
async details(episodeSelection, appendToResponse, options) {
|
|
28
|
+
const combinedOptions = {
|
|
29
|
+
append_to_response: appendToResponse ? appendToResponse.join(',') : undefined,
|
|
30
|
+
...options,
|
|
31
|
+
};
|
|
32
|
+
return await this.api.get(`${BASE_EPISODE(episodeSelection)}`, combinedOptions);
|
|
41
33
|
}
|
|
42
34
|
/**
|
|
43
35
|
* Retrieves changes related to a specific TV episode asynchronously.
|
|
@@ -45,10 +37,8 @@ class TvEpisodesEndpoint extends _types_1.BaseEndpoint {
|
|
|
45
37
|
* @param {ChangeOption} [options] - Optional parameters for specifying changes.
|
|
46
38
|
* @returns {Promise<Changes<TvEpisodeChangeValue>>} A Promise that resolves with the changes related to the TV episode.
|
|
47
39
|
*/
|
|
48
|
-
changes(episodeID, options) {
|
|
49
|
-
return
|
|
50
|
-
return yield this.api.get(`/tv/episode/${episodeID}/changes`, options);
|
|
51
|
-
});
|
|
40
|
+
async changes(episodeID, options) {
|
|
41
|
+
return await this.api.get(`/tv/episode/${episodeID}/changes`, options);
|
|
52
42
|
}
|
|
53
43
|
/**
|
|
54
44
|
* Retrieves credits for a specific TV episode asynchronously.
|
|
@@ -56,20 +46,16 @@ class TvEpisodesEndpoint extends _types_1.BaseEndpoint {
|
|
|
56
46
|
* @param {LanguageOption} [options] - Optional parameters for specifying the language.
|
|
57
47
|
* @returns {Promise<TvEpisodeCredit>} A Promise that resolves with the credits for the TV episode.
|
|
58
48
|
*/
|
|
59
|
-
credits(episodeSelection, options) {
|
|
60
|
-
return
|
|
61
|
-
return yield this.api.get(`${BASE_EPISODE(episodeSelection)}/credits`, options);
|
|
62
|
-
});
|
|
49
|
+
async credits(episodeSelection, options) {
|
|
50
|
+
return await this.api.get(`${BASE_EPISODE(episodeSelection)}/credits`, options);
|
|
63
51
|
}
|
|
64
52
|
/**
|
|
65
53
|
* Retrieves external IDs for a specific TV episode asynchronously.
|
|
66
54
|
* @param {EpisodeSelection} episodeSelection - The selection criteria for the TV episode.
|
|
67
55
|
* @returns {Promise<ExternalIds>} A Promise that resolves with the external IDs for the TV episode.
|
|
68
56
|
*/
|
|
69
|
-
externalIds(episodeSelection) {
|
|
70
|
-
return
|
|
71
|
-
return yield this.api.get(`${BASE_EPISODE(episodeSelection)}/external_ids`);
|
|
72
|
-
});
|
|
57
|
+
async externalIds(episodeSelection) {
|
|
58
|
+
return await this.api.get(`${BASE_EPISODE(episodeSelection)}/external_ids`);
|
|
73
59
|
}
|
|
74
60
|
/**
|
|
75
61
|
* Retrieves images for a specific TV episode asynchronously.
|
|
@@ -77,25 +63,20 @@ class TvEpisodesEndpoint extends _types_1.BaseEndpoint {
|
|
|
77
63
|
* @param {TvEpisodeImageSearchOptions} [options] - Optional parameters for specifying image search options.
|
|
78
64
|
* @returns {Promise<Images>} A Promise that resolves with the images for the TV episode.
|
|
79
65
|
*/
|
|
80
|
-
images(episodeSelection, options) {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
};
|
|
87
|
-
return yield this.api.get(`${BASE_EPISODE(episodeSelection)}/images`, computedOptions);
|
|
88
|
-
});
|
|
66
|
+
async images(episodeSelection, options) {
|
|
67
|
+
const computedOptions = {
|
|
68
|
+
include_image_language: options?.include_image_language?.join(','),
|
|
69
|
+
language: options?.language,
|
|
70
|
+
};
|
|
71
|
+
return await this.api.get(`${BASE_EPISODE(episodeSelection)}/images`, computedOptions);
|
|
89
72
|
}
|
|
90
73
|
/**
|
|
91
74
|
* Retrieves translations for a specific TV episode asynchronously.
|
|
92
75
|
* @param {EpisodeSelection} episodeSelection - The selection criteria for the TV episode.
|
|
93
76
|
* @returns {Promise<TvEpisodeTranslations>} A Promise that resolves with the translations for the TV episode.
|
|
94
77
|
*/
|
|
95
|
-
translations(episodeSelection) {
|
|
96
|
-
return
|
|
97
|
-
return yield this.api.get(`${BASE_EPISODE(episodeSelection)}/translations`);
|
|
98
|
-
});
|
|
78
|
+
async translations(episodeSelection) {
|
|
79
|
+
return await this.api.get(`${BASE_EPISODE(episodeSelection)}/translations`);
|
|
99
80
|
}
|
|
100
81
|
/**
|
|
101
82
|
* Retrieves videos for a specific TV episode asynchronously.
|
|
@@ -103,15 +84,12 @@ class TvEpisodesEndpoint extends _types_1.BaseEndpoint {
|
|
|
103
84
|
* @param {TvEpisodeVideoSearchOptions} [options] - Optional parameters for specifying video search options.
|
|
104
85
|
* @returns {Promise<Videos>} A Promise that resolves with the videos for the TV episode.
|
|
105
86
|
*/
|
|
106
|
-
videos(episodeSelection, options) {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
};
|
|
113
|
-
return yield this.api.get(`${BASE_EPISODE(episodeSelection)}/videos`, computedOptions);
|
|
114
|
-
});
|
|
87
|
+
async videos(episodeSelection, options) {
|
|
88
|
+
const computedOptions = {
|
|
89
|
+
include_video_language: options?.include_video_language?.join(','),
|
|
90
|
+
language: options?.language,
|
|
91
|
+
};
|
|
92
|
+
return await this.api.get(`${BASE_EPISODE(episodeSelection)}/videos`, computedOptions);
|
|
115
93
|
}
|
|
116
94
|
}
|
|
117
95
|
exports.TvEpisodesEndpoint = TvEpisodesEndpoint;
|
|
@@ -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.TvSeasonsEndpoint = void 0;
|
|
13
4
|
const _types_1 = require("../@types");
|
|
@@ -33,11 +24,12 @@ class TvSeasonsEndpoint extends _types_1.BaseEndpoint {
|
|
|
33
24
|
* @returns {Promise<AppendToResponse<SeasonDetails, AppendToResponseTvSeasonKey[], 'tvSeason'>>}
|
|
34
25
|
* A Promise that resolves with the details of the TV season.
|
|
35
26
|
*/
|
|
36
|
-
details(seasonSelection, appendToResponse, options) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
27
|
+
async details(seasonSelection, appendToResponse, options) {
|
|
28
|
+
const combinedOptions = {
|
|
29
|
+
append_to_response: appendToResponse ? appendToResponse.join(',') : undefined,
|
|
30
|
+
...options,
|
|
31
|
+
};
|
|
32
|
+
return await this.api.get(`${BASE_SEASON(seasonSelection)}`, combinedOptions);
|
|
41
33
|
}
|
|
42
34
|
/**
|
|
43
35
|
* Retrieves aggregate credits for a specific TV season asynchronously.
|
|
@@ -45,10 +37,8 @@ class TvSeasonsEndpoint extends _types_1.BaseEndpoint {
|
|
|
45
37
|
* @param {LanguageOption} [options] - Optional parameters for specifying the language.
|
|
46
38
|
* @returns {Promise<AggregateCredits>} A Promise that resolves with the aggregate credits for the TV season.
|
|
47
39
|
*/
|
|
48
|
-
aggregateCredits(seasonSelection, options) {
|
|
49
|
-
return
|
|
50
|
-
return yield this.api.get(`${BASE_SEASON(seasonSelection)}/aggregate_credits`, options);
|
|
51
|
-
});
|
|
40
|
+
async aggregateCredits(seasonSelection, options) {
|
|
41
|
+
return await this.api.get(`${BASE_SEASON(seasonSelection)}/aggregate_credits`, options);
|
|
52
42
|
}
|
|
53
43
|
/**
|
|
54
44
|
* Retrieves changes related to a specific TV season asynchronously.
|
|
@@ -56,10 +46,8 @@ class TvSeasonsEndpoint extends _types_1.BaseEndpoint {
|
|
|
56
46
|
* @param {ChangeOption} [options] - Optional parameters for specifying changes.
|
|
57
47
|
* @returns {Promise<Changes<TvSeasonChangeValue>>} A Promise that resolves with the changes related to the TV season.
|
|
58
48
|
*/
|
|
59
|
-
changes(seasonId, options) {
|
|
60
|
-
return
|
|
61
|
-
return yield this.api.get(`/tv/season/${seasonId}/changes`, options);
|
|
62
|
-
});
|
|
49
|
+
async changes(seasonId, options) {
|
|
50
|
+
return await this.api.get(`/tv/season/${seasonId}/changes`, options);
|
|
63
51
|
}
|
|
64
52
|
/**
|
|
65
53
|
* Retrieves credits for a specific TV season asynchronously.
|
|
@@ -67,10 +55,8 @@ class TvSeasonsEndpoint extends _types_1.BaseEndpoint {
|
|
|
67
55
|
* @param {LanguageOption} [options] - Optional parameters for specifying the language.
|
|
68
56
|
* @returns {Promise<Credits>} A Promise that resolves with the credits for the TV season.
|
|
69
57
|
*/
|
|
70
|
-
credits(seasonSelection, options) {
|
|
71
|
-
return
|
|
72
|
-
return yield this.api.get(`${BASE_SEASON(seasonSelection)}/credits`, options);
|
|
73
|
-
});
|
|
58
|
+
async credits(seasonSelection, options) {
|
|
59
|
+
return await this.api.get(`${BASE_SEASON(seasonSelection)}/credits`, options);
|
|
74
60
|
}
|
|
75
61
|
/**
|
|
76
62
|
* Retrieves external IDs for a specific TV season asynchronously.
|
|
@@ -78,10 +64,8 @@ class TvSeasonsEndpoint extends _types_1.BaseEndpoint {
|
|
|
78
64
|
* @param {LanguageOption} [options] - Optional parameters for specifying the language.
|
|
79
65
|
* @returns {Promise<ExternalIds>} A Promise that resolves with the external IDs for the TV season.
|
|
80
66
|
*/
|
|
81
|
-
externalIds(seasonSelection, options) {
|
|
82
|
-
return
|
|
83
|
-
return yield this.api.get(`${BASE_SEASON(seasonSelection)}/external_ids`, options);
|
|
84
|
-
});
|
|
67
|
+
async externalIds(seasonSelection, options) {
|
|
68
|
+
return await this.api.get(`${BASE_SEASON(seasonSelection)}/external_ids`, options);
|
|
85
69
|
}
|
|
86
70
|
/**
|
|
87
71
|
* Retrieves images for a specific TV season asynchronously.
|
|
@@ -89,15 +73,12 @@ class TvSeasonsEndpoint extends _types_1.BaseEndpoint {
|
|
|
89
73
|
* @param {TvSeasonImageSearchOptions} [options] - Optional parameters for specifying image search options.
|
|
90
74
|
* @returns {Promise<Images>} A Promise that resolves with the images for the TV season.
|
|
91
75
|
*/
|
|
92
|
-
images(seasonSelection, options) {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
};
|
|
99
|
-
return yield this.api.get(`${BASE_SEASON(seasonSelection)}/images`, computedOptions);
|
|
100
|
-
});
|
|
76
|
+
async images(seasonSelection, options) {
|
|
77
|
+
const computedOptions = {
|
|
78
|
+
include_image_language: options?.include_image_language?.join(','),
|
|
79
|
+
language: options?.language,
|
|
80
|
+
};
|
|
81
|
+
return await this.api.get(`${BASE_SEASON(seasonSelection)}/images`, computedOptions);
|
|
101
82
|
}
|
|
102
83
|
/**
|
|
103
84
|
* Retrieves videos for a specific TV season asynchronously.
|
|
@@ -105,15 +86,12 @@ class TvSeasonsEndpoint extends _types_1.BaseEndpoint {
|
|
|
105
86
|
* @param {TvSeasonVideoSearchOptions} [options] - Optional parameters for specifying video search options.
|
|
106
87
|
* @returns {Promise<Videos>} A Promise that resolves with the videos for the TV season.
|
|
107
88
|
*/
|
|
108
|
-
videos(seasonSelection, options) {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
};
|
|
115
|
-
return yield this.api.get(`${BASE_SEASON(seasonSelection)}/videos`, computedOptions);
|
|
116
|
-
});
|
|
89
|
+
async videos(seasonSelection, options) {
|
|
90
|
+
const computedOptions = {
|
|
91
|
+
include_video_language: options?.include_video_language?.join(','),
|
|
92
|
+
language: options?.language,
|
|
93
|
+
};
|
|
94
|
+
return await this.api.get(`${BASE_SEASON(seasonSelection)}/videos`, computedOptions);
|
|
117
95
|
}
|
|
118
96
|
/**
|
|
119
97
|
* Retrieves translations for a specific TV season asynchronously.
|
|
@@ -121,10 +99,8 @@ class TvSeasonsEndpoint extends _types_1.BaseEndpoint {
|
|
|
121
99
|
* @param {LanguageOption} [options] - Optional parameters for specifying the language.
|
|
122
100
|
* @returns {Promise<Translations>} A Promise that resolves with the translations for the TV season.
|
|
123
101
|
*/
|
|
124
|
-
translations(seasonSelection, options) {
|
|
125
|
-
return
|
|
126
|
-
return yield this.api.get(`${BASE_SEASON(seasonSelection)}/translations`, options);
|
|
127
|
-
});
|
|
102
|
+
async translations(seasonSelection, options) {
|
|
103
|
+
return await this.api.get(`${BASE_SEASON(seasonSelection)}/translations`, options);
|
|
128
104
|
}
|
|
129
105
|
}
|
|
130
106
|
exports.TvSeasonsEndpoint = TvSeasonsEndpoint;
|