@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/dist/endpoints/movies.js
CHANGED
|
@@ -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.MoviesEndpoint = void 0;
|
|
13
4
|
const _types_1 = require("../@types");
|
|
14
|
-
const BASE_MOVIE =
|
|
5
|
+
const BASE_MOVIE = "/movie";
|
|
15
6
|
/**
|
|
16
7
|
* Represents an endpoint for accessing movie-related information.
|
|
17
8
|
*/
|
|
@@ -31,24 +22,22 @@ class MoviesEndpoint extends _types_1.BaseEndpoint {
|
|
|
31
22
|
* @param {string} [language] - Optional parameter for specifying the language.
|
|
32
23
|
* @returns {Promise<AppendToResponse<MovieDetails, AppendToResponseMovieKey[], 'movie'>>} A Promise that resolves with the details of the movie.
|
|
33
24
|
*/
|
|
34
|
-
details(id, appendToResponse, language) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
});
|
|
25
|
+
async details(id, appendToResponse, language) {
|
|
26
|
+
const options = {
|
|
27
|
+
append_to_response: appendToResponse
|
|
28
|
+
? appendToResponse.join(",")
|
|
29
|
+
: undefined,
|
|
30
|
+
language: language,
|
|
31
|
+
};
|
|
32
|
+
return await this.api.get(`${BASE_MOVIE}/${id}`, options);
|
|
42
33
|
}
|
|
43
34
|
/**
|
|
44
35
|
* Retrieves alternative titles of a specific movie asynchronously.
|
|
45
36
|
* @param {number} id - The ID of the movie.
|
|
46
37
|
* @returns {Promise<AlternativeTitles>} A Promise that resolves with the alternative titles of the movie.
|
|
47
38
|
*/
|
|
48
|
-
alternativeTitles(id) {
|
|
49
|
-
return
|
|
50
|
-
return yield this.api.get(`${BASE_MOVIE}/${id}/alternative_titles`);
|
|
51
|
-
});
|
|
39
|
+
async alternativeTitles(id) {
|
|
40
|
+
return await this.api.get(`${BASE_MOVIE}/${id}/alternative_titles`);
|
|
52
41
|
}
|
|
53
42
|
/**
|
|
54
43
|
* Retrieves changes made to a specific movie asynchronously.
|
|
@@ -56,10 +45,8 @@ class MoviesEndpoint extends _types_1.BaseEndpoint {
|
|
|
56
45
|
* @param {ChangeOption} [options] - Optional parameters for filtering changes.
|
|
57
46
|
* @returns {Promise<Changes<MovieChangeValue>>} A Promise that resolves with the changes made to the movie.
|
|
58
47
|
*/
|
|
59
|
-
changes(id, options) {
|
|
60
|
-
return
|
|
61
|
-
return yield this.api.get(`${BASE_MOVIE}/${id}/changes`, options);
|
|
62
|
-
});
|
|
48
|
+
async changes(id, options) {
|
|
49
|
+
return await this.api.get(`${BASE_MOVIE}/${id}/changes`, options);
|
|
63
50
|
}
|
|
64
51
|
/**
|
|
65
52
|
* Retrieves credits of a specific movie asynchronously.
|
|
@@ -67,20 +54,16 @@ class MoviesEndpoint extends _types_1.BaseEndpoint {
|
|
|
67
54
|
* @param {LanguageOption} [options] - Optional parameters for specifying the language.
|
|
68
55
|
* @returns {Promise<Credits>} A Promise that resolves with the credits of the movie.
|
|
69
56
|
*/
|
|
70
|
-
credits(id, options) {
|
|
71
|
-
return
|
|
72
|
-
return yield this.api.get(`${BASE_MOVIE}/${id}/credits`, options);
|
|
73
|
-
});
|
|
57
|
+
async credits(id, options) {
|
|
58
|
+
return await this.api.get(`${BASE_MOVIE}/${id}/credits`, options);
|
|
74
59
|
}
|
|
75
60
|
/**
|
|
76
61
|
* Retrieves external IDs of a specific movie asynchronously.
|
|
77
62
|
* @param {number} id - The ID of the movie.
|
|
78
63
|
* @returns {Promise<ExternalIds>} A Promise that resolves with the external IDs of the movie.
|
|
79
64
|
*/
|
|
80
|
-
externalIds(id) {
|
|
81
|
-
return
|
|
82
|
-
return yield this.api.get(`${BASE_MOVIE}/${id}/external_ids`);
|
|
83
|
-
});
|
|
65
|
+
async externalIds(id) {
|
|
66
|
+
return await this.api.get(`${BASE_MOVIE}/${id}/external_ids`);
|
|
84
67
|
}
|
|
85
68
|
/**
|
|
86
69
|
* Retrieves images of a specific movie asynchronously.
|
|
@@ -88,25 +71,20 @@ class MoviesEndpoint extends _types_1.BaseEndpoint {
|
|
|
88
71
|
* @param {MoviesImageSearchOptions} [options] - Optional parameters for specifying image search options.
|
|
89
72
|
* @returns {Promise<Images>} A Promise that resolves with the images of the movie.
|
|
90
73
|
*/
|
|
91
|
-
images(id, options) {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
};
|
|
98
|
-
return yield this.api.get(`${BASE_MOVIE}/${id}/images`, computedOptions);
|
|
99
|
-
});
|
|
74
|
+
async images(id, options) {
|
|
75
|
+
const computedOptions = {
|
|
76
|
+
include_image_language: options?.include_image_language?.join(","),
|
|
77
|
+
language: options?.language,
|
|
78
|
+
};
|
|
79
|
+
return await this.api.get(`${BASE_MOVIE}/${id}/images`, computedOptions);
|
|
100
80
|
}
|
|
101
81
|
/**
|
|
102
82
|
* Retrieves keywords of a specific movie asynchronously.
|
|
103
83
|
* @param {number} id - The ID of the movie.
|
|
104
84
|
* @returns {Promise<Keywords>} A Promise that resolves with the keywords of the movie.
|
|
105
85
|
*/
|
|
106
|
-
keywords(id) {
|
|
107
|
-
return
|
|
108
|
-
return yield this.api.get(`${BASE_MOVIE}/${id}/keywords`);
|
|
109
|
-
});
|
|
86
|
+
async keywords(id) {
|
|
87
|
+
return await this.api.get(`${BASE_MOVIE}/${id}/keywords`);
|
|
110
88
|
}
|
|
111
89
|
/**
|
|
112
90
|
* Retrieves lists containing a specific movie asynchronously.
|
|
@@ -114,10 +92,8 @@ class MoviesEndpoint extends _types_1.BaseEndpoint {
|
|
|
114
92
|
* @param {LanguageOption & PageOption} [options] - Optional parameters for specifying language and pagination options.
|
|
115
93
|
* @returns {Promise<MovieLists>} A Promise that resolves with the lists containing the movie.
|
|
116
94
|
*/
|
|
117
|
-
lists(id, options) {
|
|
118
|
-
return
|
|
119
|
-
return yield this.api.get(`${BASE_MOVIE}/${id}/lists`, options);
|
|
120
|
-
});
|
|
95
|
+
async lists(id, options) {
|
|
96
|
+
return await this.api.get(`${BASE_MOVIE}/${id}/lists`, options);
|
|
121
97
|
}
|
|
122
98
|
/**
|
|
123
99
|
* Retrieves recommendations for a specific movie asynchronously.
|
|
@@ -125,20 +101,16 @@ class MoviesEndpoint extends _types_1.BaseEndpoint {
|
|
|
125
101
|
* @param {LanguageOption & PageOption} [options] - Optional parameters for specifying language and pagination options.
|
|
126
102
|
* @returns {Promise<Recommendations>} A Promise that resolves with the recommendations for the movie.
|
|
127
103
|
*/
|
|
128
|
-
recommendations(id, options) {
|
|
129
|
-
return
|
|
130
|
-
return yield this.api.get(`${BASE_MOVIE}/${id}/recommendations`, options);
|
|
131
|
-
});
|
|
104
|
+
async recommendations(id, options) {
|
|
105
|
+
return await this.api.get(`${BASE_MOVIE}/${id}/recommendations`, options);
|
|
132
106
|
}
|
|
133
107
|
/**
|
|
134
108
|
* Retrieves release dates of a specific movie asynchronously.
|
|
135
109
|
* @param {number} id - The ID of the movie.
|
|
136
110
|
* @returns {Promise<ReleaseDates>} A Promise that resolves with the release dates of the movie.
|
|
137
111
|
*/
|
|
138
|
-
releaseDates(id) {
|
|
139
|
-
return
|
|
140
|
-
return yield this.api.get(`${BASE_MOVIE}/${id}/release_dates`);
|
|
141
|
-
});
|
|
112
|
+
async releaseDates(id) {
|
|
113
|
+
return await this.api.get(`${BASE_MOVIE}/${id}/release_dates`);
|
|
142
114
|
}
|
|
143
115
|
/**
|
|
144
116
|
* Retrieves reviews for a specific movie asynchronously.
|
|
@@ -146,10 +118,8 @@ class MoviesEndpoint extends _types_1.BaseEndpoint {
|
|
|
146
118
|
* @param {LanguageOption & PageOption} [options] - Optional parameters for specifying language and pagination options.
|
|
147
119
|
* @returns {Promise<Reviews>} A Promise that resolves with the reviews for the movie.
|
|
148
120
|
*/
|
|
149
|
-
reviews(id, options) {
|
|
150
|
-
return
|
|
151
|
-
return yield this.api.get(`${BASE_MOVIE}/${id}/reviews`, options);
|
|
152
|
-
});
|
|
121
|
+
async reviews(id, options) {
|
|
122
|
+
return await this.api.get(`${BASE_MOVIE}/${id}/reviews`, options);
|
|
153
123
|
}
|
|
154
124
|
/**
|
|
155
125
|
* Retrieves similar movies for a specific movie asynchronously.
|
|
@@ -157,20 +127,16 @@ class MoviesEndpoint extends _types_1.BaseEndpoint {
|
|
|
157
127
|
* @param {LanguageOption & PageOption} [options] - Optional parameters for specifying language and pagination options.
|
|
158
128
|
* @returns {Promise<SimilarMovies>} A Promise that resolves with the similar movies for the movie.
|
|
159
129
|
*/
|
|
160
|
-
similar(id, options) {
|
|
161
|
-
return
|
|
162
|
-
return yield this.api.get(`${BASE_MOVIE}/${id}/similar`, options);
|
|
163
|
-
});
|
|
130
|
+
async similar(id, options) {
|
|
131
|
+
return await this.api.get(`${BASE_MOVIE}/${id}/similar`, options);
|
|
164
132
|
}
|
|
165
133
|
/**
|
|
166
134
|
* Retrieves translations of a specific movie asynchronously.
|
|
167
135
|
* @param {number} id - The ID of the movie.
|
|
168
136
|
* @returns {Promise<Translations>} A Promise that resolves with the translations of the movie.
|
|
169
137
|
*/
|
|
170
|
-
translations(id) {
|
|
171
|
-
return
|
|
172
|
-
return yield this.api.get(`${BASE_MOVIE}/${id}/translations`);
|
|
173
|
-
});
|
|
138
|
+
async translations(id) {
|
|
139
|
+
return await this.api.get(`${BASE_MOVIE}/${id}/translations`);
|
|
174
140
|
}
|
|
175
141
|
/**
|
|
176
142
|
* Retrieves videos of a specific movie asynchronously.
|
|
@@ -178,69 +144,55 @@ class MoviesEndpoint extends _types_1.BaseEndpoint {
|
|
|
178
144
|
* @param {LanguageOption} [options] - Optional parameters for specifying the language.
|
|
179
145
|
* @returns {Promise<Videos>} A Promise that resolves with the videos of the movie.
|
|
180
146
|
*/
|
|
181
|
-
videos(id, options) {
|
|
182
|
-
return
|
|
183
|
-
return yield this.api.get(`${BASE_MOVIE}/${id}/videos`, options);
|
|
184
|
-
});
|
|
147
|
+
async videos(id, options) {
|
|
148
|
+
return await this.api.get(`${BASE_MOVIE}/${id}/videos`, options);
|
|
185
149
|
}
|
|
186
150
|
/**
|
|
187
151
|
* Retrieves watch providers of a specific movie asynchronously.
|
|
188
152
|
* @param {number} id - The ID of the movie.
|
|
189
153
|
* @returns {Promise<WatchProviders>} A Promise that resolves with the watch providers of the movie.
|
|
190
154
|
*/
|
|
191
|
-
watchProviders(id) {
|
|
192
|
-
return
|
|
193
|
-
return yield this.api.get(`${BASE_MOVIE}/${id}/watch/providers`);
|
|
194
|
-
});
|
|
155
|
+
async watchProviders(id) {
|
|
156
|
+
return await this.api.get(`${BASE_MOVIE}/${id}/watch/providers`);
|
|
195
157
|
}
|
|
196
158
|
/**
|
|
197
159
|
* Retrieves details of the latest movie asynchronously.
|
|
198
160
|
* @returns {Promise<LatestMovie>} A Promise that resolves with the details of the latest movie.
|
|
199
161
|
*/
|
|
200
|
-
latest() {
|
|
201
|
-
return
|
|
202
|
-
return yield this.api.get(`${BASE_MOVIE}/latest`);
|
|
203
|
-
});
|
|
162
|
+
async latest() {
|
|
163
|
+
return await this.api.get(`${BASE_MOVIE}/latest`);
|
|
204
164
|
}
|
|
205
165
|
/**
|
|
206
166
|
* Retrieves movies playing now asynchronously.
|
|
207
167
|
* @param {PageOption & LanguageOption & RegionOption} [options] - Optional parameters for specifying language, region, and pagination options.
|
|
208
168
|
* @returns {Promise<MoviesPlayingNow>} A Promise that resolves with the movies playing now.
|
|
209
169
|
*/
|
|
210
|
-
nowPlaying(options) {
|
|
211
|
-
return
|
|
212
|
-
return yield this.api.get(`${BASE_MOVIE}/now_playing`, options);
|
|
213
|
-
});
|
|
170
|
+
async nowPlaying(options) {
|
|
171
|
+
return await this.api.get(`${BASE_MOVIE}/now_playing`, options);
|
|
214
172
|
}
|
|
215
173
|
/**
|
|
216
174
|
* Retrieves popular movies asynchronously.
|
|
217
175
|
* @param {LanguageOption & PageOption} [options] - Optional parameters for specifying language and pagination options.
|
|
218
176
|
* @returns {Promise<PopularMovies>} A Promise that resolves with the popular movies.
|
|
219
177
|
*/
|
|
220
|
-
popular(options) {
|
|
221
|
-
return
|
|
222
|
-
return yield this.api.get(`${BASE_MOVIE}/popular`, options);
|
|
223
|
-
});
|
|
178
|
+
async popular(options) {
|
|
179
|
+
return await this.api.get(`${BASE_MOVIE}/popular`, options);
|
|
224
180
|
}
|
|
225
181
|
/**
|
|
226
182
|
* Retrieves top rated movies asynchronously.
|
|
227
183
|
* @param {PageOption & LanguageOption & RegionOption} [options] - Optional parameters for specifying language, region, and pagination options.
|
|
228
184
|
* @returns {Promise<TopRatedMovies>} A Promise that resolves with the top rated movies.
|
|
229
185
|
*/
|
|
230
|
-
topRated(options) {
|
|
231
|
-
return
|
|
232
|
-
return yield this.api.get(`${BASE_MOVIE}/top_rated`, options);
|
|
233
|
-
});
|
|
186
|
+
async topRated(options) {
|
|
187
|
+
return await this.api.get(`${BASE_MOVIE}/top_rated`, options);
|
|
234
188
|
}
|
|
235
189
|
/**
|
|
236
190
|
* Retrieves upcoming movies asynchronously.
|
|
237
191
|
* @param {PageOption & LanguageOption & RegionOption} [options] - Optional parameters for specifying language, region, and pagination options.
|
|
238
192
|
* @returns {Promise<UpcomingMovies>} A Promise that resolves with the upcoming movies.
|
|
239
193
|
*/
|
|
240
|
-
upcoming(options) {
|
|
241
|
-
return
|
|
242
|
-
return yield this.api.get(`${BASE_MOVIE}/upcoming`, options);
|
|
243
|
-
});
|
|
194
|
+
async upcoming(options) {
|
|
195
|
+
return await this.api.get(`${BASE_MOVIE}/upcoming`, options);
|
|
244
196
|
}
|
|
245
197
|
}
|
|
246
198
|
exports.MoviesEndpoint = MoviesEndpoint;
|
|
@@ -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.NetworksEndpoint = void 0;
|
|
13
4
|
const _types_1 = require("../@types");
|
|
@@ -28,30 +19,24 @@ class NetworksEndpoint extends _types_1.BaseEndpoint {
|
|
|
28
19
|
* @param {number} id - The ID of the network.
|
|
29
20
|
* @returns {Promise<NetworkDetails>} A Promise that resolves with the details of the network.
|
|
30
21
|
*/
|
|
31
|
-
details(id) {
|
|
32
|
-
return
|
|
33
|
-
return yield this.api.get(`/network/${id}`);
|
|
34
|
-
});
|
|
22
|
+
async details(id) {
|
|
23
|
+
return await this.api.get(`/network/${id}`);
|
|
35
24
|
}
|
|
36
25
|
/**
|
|
37
26
|
* Retrieves alternative names of a specific network asynchronously.
|
|
38
27
|
* @param {number} id - The ID of the network.
|
|
39
28
|
* @returns {Promise<AlternativeNames>} A Promise that resolves with the alternative names of the network.
|
|
40
29
|
*/
|
|
41
|
-
alternativeNames(id) {
|
|
42
|
-
return
|
|
43
|
-
return yield this.api.get(`/network/${id}/alternative_names`);
|
|
44
|
-
});
|
|
30
|
+
async alternativeNames(id) {
|
|
31
|
+
return await this.api.get(`/network/${id}/alternative_names`);
|
|
45
32
|
}
|
|
46
33
|
/**
|
|
47
34
|
* Retrieves images of a specific network asynchronously.
|
|
48
35
|
* @param {number} id - The ID of the network.
|
|
49
36
|
* @returns {Promise<NetworkImages>} A Promise that resolves with the images of the network.
|
|
50
37
|
*/
|
|
51
|
-
images(id) {
|
|
52
|
-
return
|
|
53
|
-
return yield this.api.get(`/network/${id}/images`);
|
|
54
|
-
});
|
|
38
|
+
async images(id) {
|
|
39
|
+
return await this.api.get(`/network/${id}/images`);
|
|
55
40
|
}
|
|
56
41
|
}
|
|
57
42
|
exports.NetworksEndpoint = NetworksEndpoint;
|
package/dist/endpoints/people.js
CHANGED
|
@@ -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.PeopleEndpoint = void 0;
|
|
13
4
|
const _types_1 = require("../@types");
|
|
14
|
-
const BASE_PERSON =
|
|
5
|
+
const BASE_PERSON = "/person";
|
|
15
6
|
/**
|
|
16
7
|
* Represents an endpoint for accessing information about people.
|
|
17
8
|
*/
|
|
@@ -22,6 +13,7 @@ class PeopleEndpoint 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 person asynchronously.
|
|
@@ -30,14 +22,14 @@ class PeopleEndpoint extends _types_1.BaseEndpoint {
|
|
|
30
22
|
* @param {string} [language] - Optional parameter for specifying the language.
|
|
31
23
|
* @returns {Promise<AppendToResponse<PersonDetails, AppendToResponsePersonKey[], 'person'>>} A Promise that resolves with the details of the person.
|
|
32
24
|
*/
|
|
33
|
-
details(id, appendToResponse, language) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
});
|
|
25
|
+
async details(id, appendToResponse, language) {
|
|
26
|
+
const options = {
|
|
27
|
+
append_to_response: appendToResponse
|
|
28
|
+
? appendToResponse.join(",")
|
|
29
|
+
: undefined,
|
|
30
|
+
language: language,
|
|
31
|
+
};
|
|
32
|
+
return await this.api.get(`${BASE_PERSON}/${id}`, options);
|
|
41
33
|
}
|
|
42
34
|
/**
|
|
43
35
|
* Retrieves changes made to a specific person asynchronously.
|
|
@@ -45,10 +37,8 @@ class PeopleEndpoint extends _types_1.BaseEndpoint {
|
|
|
45
37
|
* @param {ChangeOption} [options] - Optional parameters for filtering changes.
|
|
46
38
|
* @returns {Promise<Changes<PersonChangeValue>>} A Promise that resolves with the changes made to the person.
|
|
47
39
|
*/
|
|
48
|
-
changes(id, options) {
|
|
49
|
-
return
|
|
50
|
-
return yield this.api.get(`${BASE_PERSON}/${id}/changes`, options);
|
|
51
|
-
});
|
|
40
|
+
async changes(id, options) {
|
|
41
|
+
return await this.api.get(`${BASE_PERSON}/${id}/changes`, options);
|
|
52
42
|
}
|
|
53
43
|
/**
|
|
54
44
|
* Retrieves movie credits of a specific person asynchronously.
|
|
@@ -56,10 +46,8 @@ class PeopleEndpoint extends _types_1.BaseEndpoint {
|
|
|
56
46
|
* @param {LanguageOption} [options] - Optional parameters for specifying the language.
|
|
57
47
|
* @returns {Promise<PersonMovieCredit>} A Promise that resolves with the movie credits of the person.
|
|
58
48
|
*/
|
|
59
|
-
movieCredits(id, options) {
|
|
60
|
-
return
|
|
61
|
-
return yield this.api.get(`${BASE_PERSON}/${id}/movie_credits`, options);
|
|
62
|
-
});
|
|
49
|
+
async movieCredits(id, options) {
|
|
50
|
+
return await this.api.get(`${BASE_PERSON}/${id}/movie_credits`, options);
|
|
63
51
|
}
|
|
64
52
|
/**
|
|
65
53
|
* Retrieves TV show credits of a specific person asynchronously.
|
|
@@ -67,10 +55,8 @@ class PeopleEndpoint extends _types_1.BaseEndpoint {
|
|
|
67
55
|
* @param {LanguageOption} [options] - Optional parameters for specifying the language.
|
|
68
56
|
* @returns {Promise<PersonTvShowCredit>} A Promise that resolves with the TV show credits of the person.
|
|
69
57
|
*/
|
|
70
|
-
tvShowCredits(id, options) {
|
|
71
|
-
return
|
|
72
|
-
return yield this.api.get(`${BASE_PERSON}/${id}/tv_credits`, options);
|
|
73
|
-
});
|
|
58
|
+
async tvShowCredits(id, options) {
|
|
59
|
+
return await this.api.get(`${BASE_PERSON}/${id}/tv_credits`, options);
|
|
74
60
|
}
|
|
75
61
|
/**
|
|
76
62
|
* Retrieves combined credits of a specific person asynchronously.
|
|
@@ -78,30 +64,24 @@ class PeopleEndpoint extends _types_1.BaseEndpoint {
|
|
|
78
64
|
* @param {LanguageOption} [options] - Optional parameters for specifying the language.
|
|
79
65
|
* @returns {Promise<PersonCombinedCredits>} A Promise that resolves with the combined credits of the person.
|
|
80
66
|
*/
|
|
81
|
-
combinedCredits(id, options) {
|
|
82
|
-
return
|
|
83
|
-
return yield this.api.get(`${BASE_PERSON}/${id}/combined_credits`, options);
|
|
84
|
-
});
|
|
67
|
+
async combinedCredits(id, options) {
|
|
68
|
+
return await this.api.get(`${BASE_PERSON}/${id}/combined_credits`, options);
|
|
85
69
|
}
|
|
86
70
|
/**
|
|
87
71
|
* Retrieves external IDs of a specific person asynchronously.
|
|
88
72
|
* @param {number} id - The ID of the person.
|
|
89
73
|
* @returns {Promise<ExternalIds>} A Promise that resolves with the external IDs of the person.
|
|
90
74
|
*/
|
|
91
|
-
externalId(id) {
|
|
92
|
-
return
|
|
93
|
-
return yield this.api.get(`${BASE_PERSON}/${id}/external_ids`);
|
|
94
|
-
});
|
|
75
|
+
async externalId(id) {
|
|
76
|
+
return await this.api.get(`${BASE_PERSON}/${id}/external_ids`);
|
|
95
77
|
}
|
|
96
78
|
/**
|
|
97
79
|
* Retrieves images of a specific person asynchronously.
|
|
98
80
|
* @param {number} id - The ID of the person.
|
|
99
81
|
* @returns {Promise<PeopleImages>} A Promise that resolves with the images of the person.
|
|
100
82
|
*/
|
|
101
|
-
images(id) {
|
|
102
|
-
return
|
|
103
|
-
return yield this.api.get(`${BASE_PERSON}/${id}/images`);
|
|
104
|
-
});
|
|
83
|
+
async images(id) {
|
|
84
|
+
return await this.api.get(`${BASE_PERSON}/${id}/images`);
|
|
105
85
|
}
|
|
106
86
|
/**
|
|
107
87
|
* Retrieves tagged images of a specific person asynchronously.
|
|
@@ -109,39 +89,31 @@ class PeopleEndpoint extends _types_1.BaseEndpoint {
|
|
|
109
89
|
* @param {PageOption} [options] - Optional parameters for specifying pagination options.
|
|
110
90
|
* @returns {Promise<TaggedImages>} A Promise that resolves with the tagged images of the person.
|
|
111
91
|
*/
|
|
112
|
-
taggedImages(id, options) {
|
|
113
|
-
return
|
|
114
|
-
return yield this.api.get(`${BASE_PERSON}/${id}/tagged_images`, options);
|
|
115
|
-
});
|
|
92
|
+
async taggedImages(id, options) {
|
|
93
|
+
return await this.api.get(`${BASE_PERSON}/${id}/tagged_images`, options);
|
|
116
94
|
}
|
|
117
95
|
/**
|
|
118
96
|
* Retrieves translations of a specific person asynchronously.
|
|
119
97
|
* @param {number} id - The ID of the person.
|
|
120
98
|
* @returns {Promise<PersonTranslations>} A Promise that resolves with the translations of the person.
|
|
121
99
|
*/
|
|
122
|
-
translation(id) {
|
|
123
|
-
return
|
|
124
|
-
return yield this.api.get(`${BASE_PERSON}/${id}/translations`);
|
|
125
|
-
});
|
|
100
|
+
async translation(id) {
|
|
101
|
+
return await this.api.get(`${BASE_PERSON}/${id}/translations`);
|
|
126
102
|
}
|
|
127
103
|
/**
|
|
128
104
|
* Retrieves details of the latest person asynchronously.
|
|
129
105
|
* @returns {Promise<PersonDetails>} A Promise that resolves with the details of the latest person.
|
|
130
106
|
*/
|
|
131
|
-
latest() {
|
|
132
|
-
return
|
|
133
|
-
return yield this.api.get(`${BASE_PERSON}/latest`);
|
|
134
|
-
});
|
|
107
|
+
async latest() {
|
|
108
|
+
return await this.api.get(`${BASE_PERSON}/latest`);
|
|
135
109
|
}
|
|
136
110
|
/**
|
|
137
111
|
* Retrieves popular persons asynchronously.
|
|
138
112
|
* @param {LanguageOption & PageOption} [options] - Optional parameters for specifying language and pagination options.
|
|
139
113
|
* @returns {Promise<PopularPersons>} A Promise that resolves with the popular persons.
|
|
140
114
|
*/
|
|
141
|
-
popular(options) {
|
|
142
|
-
return
|
|
143
|
-
return yield this.api.get(`${BASE_PERSON}/popular`, options);
|
|
144
|
-
});
|
|
115
|
+
async popular(options) {
|
|
116
|
+
return await this.api.get(`${BASE_PERSON}/popular`, options);
|
|
145
117
|
}
|
|
146
118
|
}
|
|
147
119
|
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");
|
|
@@ -21,16 +12,15 @@ class ReviewEndpoint 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 details of a specific review asynchronously.
|
|
27
19
|
* @param {string} id - The ID of the review.
|
|
28
20
|
* @returns {Promise<ReviewDetails>} A Promise that resolves with the details of the review.
|
|
29
21
|
*/
|
|
30
|
-
details(id) {
|
|
31
|
-
return
|
|
32
|
-
return yield this.api.get(`/review/${id}`);
|
|
33
|
-
});
|
|
22
|
+
async details(id) {
|
|
23
|
+
return await this.api.get(`/review/${id}`);
|
|
34
24
|
}
|
|
35
25
|
}
|
|
36
26
|
exports.ReviewEndpoint = ReviewEndpoint;
|
package/dist/endpoints/search.js
CHANGED
|
@@ -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.SearchEndpoint = void 0;
|
|
13
4
|
const _types_1 = require("../@types");
|
|
14
|
-
const BASE_SEARCH =
|
|
5
|
+
const BASE_SEARCH = "/search";
|
|
15
6
|
/**
|
|
16
7
|
* Represents an endpoint for performing various search operations.
|
|
17
8
|
*/
|
|
@@ -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;
|