@tdanks2000/tmdb-wrapper 1.4.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -114,6 +114,39 @@ let ReleaseDateType = /* @__PURE__ */ function(ReleaseDateType$1) {
114
114
  //#endregion
115
115
  //#region src/utils/api.ts
116
116
  const BASE_URL_V3 = "https://api.themoviedb.org/3";
117
+ var TMDBError = class extends Error {
118
+ constructor(message, status, url, payload) {
119
+ super(message);
120
+ this.status = status;
121
+ this.url = url;
122
+ this.payload = payload;
123
+ this.name = "TMDBError";
124
+ }
125
+ };
126
+ const parseOptions = (options) => {
127
+ if (!options) return "";
128
+ const entries = [];
129
+ for (const [key, value] of Object.entries(options)) {
130
+ if (value === void 0 || value === null) continue;
131
+ if (Array.isArray(value)) for (const item of value) {
132
+ if (item === void 0 || item === null) continue;
133
+ entries.push([key, String(item)]);
134
+ }
135
+ else entries.push([key, String(value)]);
136
+ }
137
+ return new URLSearchParams(entries).toString();
138
+ };
139
+ const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
140
+ const shouldRetry = (status) => status === 429 || status === 502 || status === 503 || status === 504;
141
+ const readRetryAfterMs = (res) => {
142
+ const raw = res.headers.get("retry-after");
143
+ if (!raw) return void 0;
144
+ const asSeconds = Number(raw);
145
+ if (Number.isFinite(asSeconds)) return Math.max(0, asSeconds * 1e3);
146
+ const asDate = Date.parse(raw);
147
+ if (!Number.isNaN(asDate)) return Math.max(0, asDate - Date.now());
148
+ return void 0;
149
+ };
117
150
  var API = class {
118
151
  apiKey;
119
152
  accessToken;
@@ -124,41 +157,55 @@ var API = class {
124
157
  this.accessToken = auth.accessToken;
125
158
  }
126
159
  }
127
- /**
128
- * Generic GET:
129
- * @template T response type
130
- * @template O — options (query params) type
131
- */
132
- async get(path, options) {
133
- const rawOptions = {
134
- ...options ?? {},
160
+ async get(path, opts = {}) {
161
+ const query = {
162
+ ...opts.query ? opts.query : {},
135
163
  ...this.apiKey ? { api_key: this.apiKey } : {}
136
164
  };
137
- const params = parseOptions(rawOptions);
138
- const response = await fetch(`${BASE_URL_V3}${path}?${params}`, {
139
- method: "GET",
140
- headers: {
141
- ...this.accessToken ? { Authorization: `Bearer ${this.accessToken}` } : {},
142
- "Content-Type": "application/json;charset=utf-8"
165
+ const qs = parseOptions(query);
166
+ const url = `${BASE_URL_V3}${path}${qs ? `?${qs}` : ""}`;
167
+ const retries = opts.retries ?? 2;
168
+ const retryDelayMs = opts.retryDelayMs ?? 300;
169
+ const timeoutMs = opts.timeoutMs ?? 3e4;
170
+ const controller = new AbortController();
171
+ const timeout = setTimeout(() => controller.abort(), timeoutMs);
172
+ if (opts.signal) if (opts.signal.aborted) controller.abort();
173
+ else opts.signal.addEventListener("abort", () => controller.abort(), { once: true });
174
+ try {
175
+ for (let attempt = 0; attempt <= retries; attempt++) {
176
+ const res = await fetch(url, {
177
+ method: "GET",
178
+ signal: controller.signal,
179
+ headers: {
180
+ ...this.accessToken ? { Authorization: `Bearer ${this.accessToken}` } : {},
181
+ Accept: "application/json"
182
+ }
183
+ });
184
+ if (res.ok) return await res.json();
185
+ let payload;
186
+ let message = `${res.status} ${res.statusText}`;
187
+ try {
188
+ payload = await res.json();
189
+ if (payload && typeof payload === "object" && "status_message" in payload) message = String(payload.status_message);
190
+ } catch {
191
+ try {
192
+ payload = await res.text();
193
+ } catch {}
194
+ }
195
+ if (attempt < retries && shouldRetry(res.status)) {
196
+ const retryAfter = readRetryAfterMs(res);
197
+ const delay = retryAfter ?? retryDelayMs * 2 ** attempt;
198
+ await sleep(delay);
199
+ continue;
200
+ }
201
+ throw new TMDBError(message, res.status, url, payload);
143
202
  }
144
- });
145
- if (!response.ok) {
146
- const error = await response.json();
147
- return Promise.reject(error);
203
+ throw new TMDBError("Request failed", 0, url);
204
+ } finally {
205
+ clearTimeout(timeout);
148
206
  }
149
- return await response.json();
150
207
  }
151
208
  };
152
- const parseOptions = (options) => {
153
- if (!options) return "";
154
- const entries = [];
155
- for (const [key, value] of Object.entries(options)) {
156
- if (value === void 0 || value === null) continue;
157
- if (Array.isArray(value)) for (const item of value) entries.push([key, String(item)]);
158
- else entries.push([key, String(value)]);
159
- }
160
- return new URLSearchParams(entries).toString();
161
- };
162
209
 
163
210
  //#endregion
164
211
  //#region src/utils/getimagePath.ts
@@ -215,8 +262,23 @@ const formImage = (image, fileSize, format) => {
215
262
 
216
263
  //#endregion
217
264
  //#region src/@types/models/baseEndpoint.ts
265
+ /**
266
+ * Base class for all TMDB API endpoints.
267
+ *
268
+ * Provides a configured {@link API} client instance to subclasses.
269
+ */
218
270
  var BaseEndpoint = class {
271
+ /**
272
+ * Low-level HTTP client wrapper used by all endpoints.
273
+ */
219
274
  api;
275
+ /**
276
+ * Create a new endpoint instance.
277
+ *
278
+ * @param {TokenType} auth - Authentication information.
279
+ * - If a string: treated as a v4 API Read Access Token (Bearer token).
280
+ * - If an object: can include an API key and/or access token.
281
+ */
220
282
  constructor(auth) {
221
283
  this.auth = auth;
222
284
  this.api = new API(auth);
@@ -227,11 +289,20 @@ var BaseEndpoint = class {
227
289
  //#region src/endpoints/account.ts
228
290
  /**
229
291
  * Represents an endpoint for retrieving account details.
292
+ *
293
+ * TMDB v3 reference:
294
+ * - GET /account/{account_id}
295
+ *
296
+ * Note:
297
+ * TMDB does not expose a generic "GET /account" for account details. You must
298
+ * provide an `account_id`. Most apps obtain it from an auth flow and then cache
299
+ * it for subsequent requests.
230
300
  */
231
301
  var AccountEndpoint = class extends BaseEndpoint {
232
302
  /**
233
303
  * Constructs a new AccountEndpoint instance.
234
- * @param {string} access_token - The access token used for authentication.
304
+ *
305
+ * @param {TokenType} access_token - The access token used for authentication.
235
306
  */
236
307
  constructor(access_token) {
237
308
  super(access_token);
@@ -239,10 +310,14 @@ var AccountEndpoint = class extends BaseEndpoint {
239
310
  }
240
311
  /**
241
312
  * Retrieves account details asynchronously.
313
+ *
314
+ * TMDB: GET /account/{account_id}
315
+ *
316
+ * @param {number} accountId - The TMDB account ID.
242
317
  * @returns {Promise<AccountDetails>} A Promise that resolves with the account details.
243
318
  */
244
- async details() {
245
- return await this.api.get("/account");
319
+ details(accountId) {
320
+ return this.api.get(`/account/${accountId}`);
246
321
  }
247
322
  };
248
323
 
@@ -250,11 +325,16 @@ var AccountEndpoint = class extends BaseEndpoint {
250
325
  //#region src/endpoints/certification.ts
251
326
  /**
252
327
  * Represents an endpoint for retrieving certifications for movies and TV shows.
328
+ *
329
+ * TMDB v3 reference:
330
+ * - GET /certification/movie/list
331
+ * - GET /certification/tv/list
253
332
  */
254
333
  var CertificationEndpoint = class extends BaseEndpoint {
255
334
  /**
256
335
  * Constructs a new CertificationEndpoint instance.
257
- * @param {string} access_token - The access token used for authentication.
336
+ *
337
+ * @param {TokenType} access_token - The access token used for authentication.
258
338
  */
259
339
  constructor(access_token) {
260
340
  super(access_token);
@@ -262,17 +342,23 @@ var CertificationEndpoint = class extends BaseEndpoint {
262
342
  }
263
343
  /**
264
344
  * Retrieves certifications for movies asynchronously.
345
+ *
346
+ * TMDB: GET /certification/movie/list
347
+ *
265
348
  * @returns {Promise<Certifications>} A Promise that resolves with the certifications for movies.
266
349
  */
267
- async movies() {
268
- return await this.api.get("/certification/movie/list");
350
+ movies() {
351
+ return this.api.get("/certification/movie/list");
269
352
  }
270
353
  /**
271
354
  * Retrieves certifications for TV shows asynchronously.
355
+ *
356
+ * TMDB: GET /certification/tv/list
357
+ *
272
358
  * @returns {Promise<Certifications>} A Promise that resolves with the certifications for TV shows.
273
359
  */
274
- async tv() {
275
- return await this.api.get("/certification/tv/list");
360
+ tv() {
361
+ return this.api.get("/certification/tv/list");
276
362
  }
277
363
  };
278
364
 
@@ -280,11 +366,17 @@ var CertificationEndpoint = class extends BaseEndpoint {
280
366
  //#region src/endpoints/changes.ts
281
367
  /**
282
368
  * Represents an endpoint for retrieving changes in movies, TV shows, and persons.
369
+ *
370
+ * TMDB v3 reference:
371
+ * - GET /movie/changes
372
+ * - GET /tv/changes
373
+ * - GET /person/changes
283
374
  */
284
375
  var ChangeEndpoint = class extends BaseEndpoint {
285
376
  /**
286
377
  * Constructs a new ChangeEndpoint instance.
287
- * @param {string} access_token - The access token used for authentication.
378
+ *
379
+ * @param {TokenType} access_token - The access token used for authentication.
288
380
  */
289
381
  constructor(access_token) {
290
382
  super(access_token);
@@ -292,27 +384,36 @@ var ChangeEndpoint = class extends BaseEndpoint {
292
384
  }
293
385
  /**
294
386
  * Retrieves changes in movies asynchronously.
387
+ *
388
+ * TMDB: GET /movie/changes
389
+ *
295
390
  * @param {ChangeOption} [options] - Optional parameters for filtering the changes.
296
391
  * @returns {Promise<MediaChanges>} A Promise that resolves with the changes in movies.
297
392
  */
298
- async movies(options) {
299
- return await this.api.get("/movie/changes", options);
393
+ movies(options) {
394
+ return this.api.get("/movie/changes", { query: options });
300
395
  }
301
396
  /**
302
397
  * Retrieves changes in TV shows asynchronously.
398
+ *
399
+ * TMDB: GET /tv/changes
400
+ *
303
401
  * @param {ChangeOption} [options] - Optional parameters for filtering the changes.
304
402
  * @returns {Promise<MediaChanges>} A Promise that resolves with the changes in TV shows.
305
403
  */
306
- async tv(options) {
307
- return await this.api.get("/tv/changes", options);
404
+ tv(options) {
405
+ return this.api.get("/tv/changes", { query: options });
308
406
  }
309
407
  /**
310
408
  * Retrieves changes related to persons asynchronously.
409
+ *
410
+ * TMDB: GET /person/changes
411
+ *
311
412
  * @param {ChangeOption} [options] - Optional parameters for filtering the changes.
312
413
  * @returns {Promise<MediaChanges>} A Promise that resolves with the changes related to persons.
313
414
  */
314
- async person(options) {
315
- return await this.api.get("/person/changes", options);
415
+ person(options) {
416
+ return this.api.get("/person/changes", { query: options });
316
417
  }
317
418
  };
318
419
 
@@ -338,7 +439,7 @@ var CollectionsEndpoint = class extends BaseEndpoint {
338
439
  * @returns {Promise<DetailedCollection>} A Promise that resolves with the detailed information of the collection.
339
440
  */
340
441
  async details(id, options) {
341
- return await this.api.get(`${BASE_COLLECTION}/${id}`, options);
442
+ return await this.api.get(`${BASE_COLLECTION}/${id}`, { query: options });
342
443
  }
343
444
  /**
344
445
  * Retrieves images associated with a specific collection asynchronously.
@@ -351,7 +452,7 @@ var CollectionsEndpoint = class extends BaseEndpoint {
351
452
  include_image_language: options?.include_image_language?.join(","),
352
453
  language: options?.language
353
454
  };
354
- return await this.api.get(`${BASE_COLLECTION}/${id}/images`, computedOptions);
455
+ return await this.api.get(`${BASE_COLLECTION}/${id}/images`, { query: computedOptions });
355
456
  }
356
457
  /**
357
458
  * Retrieves translations for a specific collection asynchronously.
@@ -360,7 +461,7 @@ var CollectionsEndpoint = class extends BaseEndpoint {
360
461
  * @returns {Promise<Translations>} A Promise that resolves with the translations of the collection.
361
462
  */
362
463
  async translations(id, options) {
363
- return await this.api.get(`${BASE_COLLECTION}/${id}/translations`, options);
464
+ return await this.api.get(`${BASE_COLLECTION}/${id}/translations`, { query: options });
364
465
  }
365
466
  };
366
467
 
@@ -456,11 +557,16 @@ var CreditsEndpoint = class extends BaseEndpoint {
456
557
  const BASE_DISCOVER = "/discover";
457
558
  /**
458
559
  * Represents an endpoint for discovering movies and TV shows based on various criteria.
560
+ *
561
+ * TMDB v3 reference:
562
+ * - GET /discover/movie
563
+ * - GET /discover/tv
459
564
  */
460
565
  var DiscoverEndpoint = class extends BaseEndpoint {
461
566
  /**
462
567
  * Constructs a new DiscoverEndpoint instance.
463
- * @param {string} access_token - The access token used for authentication.
568
+ *
569
+ * @param {TokenType} access_token - The access token used for authentication.
464
570
  */
465
571
  constructor(access_token) {
466
572
  super(access_token);
@@ -468,19 +574,25 @@ var DiscoverEndpoint = class extends BaseEndpoint {
468
574
  }
469
575
  /**
470
576
  * Retrieves a list of movies based on the provided query options asynchronously.
577
+ *
578
+ * TMDB: GET /discover/movie
579
+ *
471
580
  * @param {MovieQueryOptions} [options] - Optional parameters for refining the movie discovery.
472
581
  * @returns {Promise<MovieDiscoverResult>} A Promise that resolves with the movie discovery results.
473
582
  */
474
- async movie(options) {
475
- return await this.api.get(`${BASE_DISCOVER}/movie`, options);
583
+ movie(options) {
584
+ return this.api.get(`${BASE_DISCOVER}/movie`, { query: options });
476
585
  }
477
586
  /**
478
587
  * Retrieves a list of TV shows based on the provided query options asynchronously.
588
+ *
589
+ * TMDB: GET /discover/tv
590
+ *
479
591
  * @param {TvShowQueryOptions} [options] - Optional parameters for refining the TV show discovery.
480
592
  * @returns {Promise<TvShowDiscoverResult>} A Promise that resolves with the TV show discovery results.
481
593
  */
482
- async tvShow(options) {
483
- return await this.api.get(`${BASE_DISCOVER}/tv`, options);
594
+ tvShow(options) {
595
+ return this.api.get(`${BASE_DISCOVER}/tv`, { query: options });
484
596
  }
485
597
  };
486
598
 
@@ -505,7 +617,7 @@ var FindEndpoint = class extends BaseEndpoint {
505
617
  * @returns {Promise<FindResult>} A Promise that resolves with the result of the find operation.
506
618
  */
507
619
  async byId(externalId, options) {
508
- return await this.api.get(`/find/${externalId}`, options);
620
+ return await this.api.get(`/find/${externalId}`, { query: options });
509
621
  }
510
622
  };
511
623
 
@@ -529,7 +641,7 @@ var GenreEndpoint = class extends BaseEndpoint {
529
641
  * @returns {Promise<Genres>} A Promise that resolves with the genre information for movies.
530
642
  */
531
643
  async movies(options) {
532
- return await this.api.get("/genre/movie/list", options);
644
+ return await this.api.get("/genre/movie/list", { query: options });
533
645
  }
534
646
  /**
535
647
  * Retrieves genre information for TV shows asynchronously.
@@ -537,7 +649,7 @@ var GenreEndpoint = class extends BaseEndpoint {
537
649
  * @returns {Promise<Genres>} A Promise that resolves with the genre information for TV shows.
538
650
  */
539
651
  async tv(options) {
540
- return await this.api.get("/genre/tv/list", options);
652
+ return await this.api.get("/genre/tv/list", { query: options });
541
653
  }
542
654
  };
543
655
 
@@ -571,7 +683,7 @@ var KeywordsEndpoint = class extends BaseEndpoint {
571
683
  * @returns {Promise<BelongingMovies>} A Promise that resolves with the movies belonging to the keyword.
572
684
  */
573
685
  async belongingMovies(keywordId, options) {
574
- return await this.api.get(`${BASE_KEYWORD}/${keywordId}/movies`, options);
686
+ return await this.api.get(`${BASE_KEYWORD}/${keywordId}/movies`, { query: options });
575
687
  }
576
688
  };
577
689
 
@@ -598,11 +710,11 @@ var MoviesEndpoint = class extends BaseEndpoint {
598
710
  * @returns {Promise<AppendToResponse<MovieDetails, AppendToResponseMovieKey[], 'movie'>>} A Promise that resolves with the details of the movie.
599
711
  */
600
712
  async details(id, appendToResponse, language) {
601
- const options = {
713
+ const query = {
602
714
  append_to_response: appendToResponse ? appendToResponse.join(",") : void 0,
603
715
  language
604
716
  };
605
- return await this.api.get(`${BASE_MOVIE}/${id}`, options);
717
+ return await this.api.get(`${BASE_MOVIE}/${id}`, { query });
606
718
  }
607
719
  /**
608
720
  * Retrieves alternative titles of a specific movie asynchronously.
@@ -619,7 +731,7 @@ var MoviesEndpoint = class extends BaseEndpoint {
619
731
  * @returns {Promise<Changes<MovieChangeValue>>} A Promise that resolves with the changes made to the movie.
620
732
  */
621
733
  async changes(id, options) {
622
- return await this.api.get(`${BASE_MOVIE}/${id}/changes`, options);
734
+ return await this.api.get(`${BASE_MOVIE}/${id}/changes`, { query: options });
623
735
  }
624
736
  /**
625
737
  * Retrieves credits of a specific movie asynchronously.
@@ -628,7 +740,7 @@ var MoviesEndpoint = class extends BaseEndpoint {
628
740
  * @returns {Promise<Credits>} A Promise that resolves with the credits of the movie.
629
741
  */
630
742
  async credits(id, options) {
631
- return await this.api.get(`${BASE_MOVIE}/${id}/credits`, options);
743
+ return await this.api.get(`${BASE_MOVIE}/${id}/credits`, { query: options });
632
744
  }
633
745
  /**
634
746
  * Retrieves external IDs of a specific movie asynchronously.
@@ -649,7 +761,7 @@ var MoviesEndpoint = class extends BaseEndpoint {
649
761
  include_image_language: options?.include_image_language?.join(","),
650
762
  language: options?.language
651
763
  };
652
- return await this.api.get(`${BASE_MOVIE}/${id}/images`, computedOptions);
764
+ return await this.api.get(`${BASE_MOVIE}/${id}/images`, { query: computedOptions });
653
765
  }
654
766
  /**
655
767
  * Retrieves keywords of a specific movie asynchronously.
@@ -666,7 +778,7 @@ var MoviesEndpoint = class extends BaseEndpoint {
666
778
  * @returns {Promise<MovieLists>} A Promise that resolves with the lists containing the movie.
667
779
  */
668
780
  async lists(id, options) {
669
- return await this.api.get(`${BASE_MOVIE}/${id}/lists`, options);
781
+ return await this.api.get(`${BASE_MOVIE}/${id}/lists`, { query: options });
670
782
  }
671
783
  /**
672
784
  * Retrieves recommendations for a specific movie asynchronously.
@@ -675,7 +787,7 @@ var MoviesEndpoint = class extends BaseEndpoint {
675
787
  * @returns {Promise<Recommendations>} A Promise that resolves with the recommendations for the movie.
676
788
  */
677
789
  async recommendations(id, options) {
678
- return await this.api.get(`${BASE_MOVIE}/${id}/recommendations`, options);
790
+ return await this.api.get(`${BASE_MOVIE}/${id}/recommendations`, { query: options });
679
791
  }
680
792
  /**
681
793
  * Retrieves release dates of a specific movie asynchronously.
@@ -692,7 +804,7 @@ var MoviesEndpoint = class extends BaseEndpoint {
692
804
  * @returns {Promise<Reviews>} A Promise that resolves with the reviews for the movie.
693
805
  */
694
806
  async reviews(id, options) {
695
- return await this.api.get(`${BASE_MOVIE}/${id}/reviews`, options);
807
+ return await this.api.get(`${BASE_MOVIE}/${id}/reviews`, { query: options });
696
808
  }
697
809
  /**
698
810
  * Retrieves similar movies for a specific movie asynchronously.
@@ -701,7 +813,7 @@ var MoviesEndpoint = class extends BaseEndpoint {
701
813
  * @returns {Promise<SimilarMovies>} A Promise that resolves with the similar movies for the movie.
702
814
  */
703
815
  async similar(id, options) {
704
- return await this.api.get(`${BASE_MOVIE}/${id}/similar`, options);
816
+ return await this.api.get(`${BASE_MOVIE}/${id}/similar`, { query: options });
705
817
  }
706
818
  /**
707
819
  * Retrieves translations of a specific movie asynchronously.
@@ -718,7 +830,7 @@ var MoviesEndpoint = class extends BaseEndpoint {
718
830
  * @returns {Promise<Videos>} A Promise that resolves with the videos of the movie.
719
831
  */
720
832
  async videos(id, options) {
721
- return await this.api.get(`${BASE_MOVIE}/${id}/videos`, options);
833
+ return await this.api.get(`${BASE_MOVIE}/${id}/videos`, { query: options });
722
834
  }
723
835
  /**
724
836
  * Retrieves watch providers of a specific movie asynchronously.
@@ -741,7 +853,7 @@ var MoviesEndpoint = class extends BaseEndpoint {
741
853
  * @returns {Promise<MoviesPlayingNow>} A Promise that resolves with the movies playing now.
742
854
  */
743
855
  async nowPlaying(options) {
744
- return await this.api.get(`${BASE_MOVIE}/now_playing`, options);
856
+ return await this.api.get(`${BASE_MOVIE}/now_playing`, { query: options });
745
857
  }
746
858
  /**
747
859
  * Retrieves popular movies asynchronously.
@@ -749,7 +861,7 @@ var MoviesEndpoint = class extends BaseEndpoint {
749
861
  * @returns {Promise<PopularMovies>} A Promise that resolves with the popular movies.
750
862
  */
751
863
  async popular(options) {
752
- return await this.api.get(`${BASE_MOVIE}/popular`, options);
864
+ return await this.api.get(`${BASE_MOVIE}/popular`, { query: options });
753
865
  }
754
866
  /**
755
867
  * Retrieves top rated movies asynchronously.
@@ -757,7 +869,7 @@ var MoviesEndpoint = class extends BaseEndpoint {
757
869
  * @returns {Promise<TopRatedMovies>} A Promise that resolves with the top rated movies.
758
870
  */
759
871
  async topRated(options) {
760
- return await this.api.get(`${BASE_MOVIE}/top_rated`, options);
872
+ return await this.api.get(`${BASE_MOVIE}/top_rated`, { query: options });
761
873
  }
762
874
  /**
763
875
  * Retrieves upcoming movies asynchronously.
@@ -765,7 +877,7 @@ var MoviesEndpoint = class extends BaseEndpoint {
765
877
  * @returns {Promise<UpcomingMovies>} A Promise that resolves with the upcoming movies.
766
878
  */
767
879
  async upcoming(options) {
768
- return await this.api.get(`${BASE_MOVIE}/upcoming`, options);
880
+ return await this.api.get(`${BASE_MOVIE}/upcoming`, { query: options });
769
881
  }
770
882
  };
771
883
 
@@ -836,7 +948,7 @@ var PeopleEndpoint = class extends BaseEndpoint {
836
948
  append_to_response: appendToResponse ? appendToResponse.join(",") : void 0,
837
949
  language
838
950
  };
839
- return await this.api.get(`${BASE_PERSON}/${id}`, options);
951
+ return await this.api.get(`${BASE_PERSON}/${id}`, { query: options });
840
952
  }
841
953
  /**
842
954
  * Retrieves changes made to a specific person asynchronously.
@@ -845,7 +957,7 @@ var PeopleEndpoint = class extends BaseEndpoint {
845
957
  * @returns {Promise<Changes<PersonChangeValue>>} A Promise that resolves with the changes made to the person.
846
958
  */
847
959
  async changes(id, options) {
848
- return await this.api.get(`${BASE_PERSON}/${id}/changes`, options);
960
+ return await this.api.get(`${BASE_PERSON}/${id}/changes`, { query: options });
849
961
  }
850
962
  /**
851
963
  * Retrieves movie credits of a specific person asynchronously.
@@ -854,7 +966,7 @@ var PeopleEndpoint = class extends BaseEndpoint {
854
966
  * @returns {Promise<PersonMovieCredit>} A Promise that resolves with the movie credits of the person.
855
967
  */
856
968
  async movieCredits(id, options) {
857
- return await this.api.get(`${BASE_PERSON}/${id}/movie_credits`, options);
969
+ return await this.api.get(`${BASE_PERSON}/${id}/movie_credits`, { query: options });
858
970
  }
859
971
  /**
860
972
  * Retrieves TV show credits of a specific person asynchronously.
@@ -863,7 +975,7 @@ var PeopleEndpoint = class extends BaseEndpoint {
863
975
  * @returns {Promise<PersonTvShowCredit>} A Promise that resolves with the TV show credits of the person.
864
976
  */
865
977
  async tvShowCredits(id, options) {
866
- return await this.api.get(`${BASE_PERSON}/${id}/tv_credits`, options);
978
+ return await this.api.get(`${BASE_PERSON}/${id}/tv_credits`, { query: options });
867
979
  }
868
980
  /**
869
981
  * Retrieves combined credits of a specific person asynchronously.
@@ -872,7 +984,7 @@ var PeopleEndpoint = class extends BaseEndpoint {
872
984
  * @returns {Promise<PersonCombinedCredits>} A Promise that resolves with the combined credits of the person.
873
985
  */
874
986
  async combinedCredits(id, options) {
875
- return await this.api.get(`${BASE_PERSON}/${id}/combined_credits`, options);
987
+ return await this.api.get(`${BASE_PERSON}/${id}/combined_credits`, { query: options });
876
988
  }
877
989
  /**
878
990
  * Retrieves external IDs of a specific person asynchronously.
@@ -897,7 +1009,7 @@ var PeopleEndpoint = class extends BaseEndpoint {
897
1009
  * @returns {Promise<TaggedImages>} A Promise that resolves with the tagged images of the person.
898
1010
  */
899
1011
  async taggedImages(id, options) {
900
- return await this.api.get(`${BASE_PERSON}/${id}/tagged_images`, options);
1012
+ return await this.api.get(`${BASE_PERSON}/${id}/tagged_images`, { query: options });
901
1013
  }
902
1014
  /**
903
1015
  * Retrieves translations of a specific person asynchronously.
@@ -920,7 +1032,7 @@ var PeopleEndpoint = class extends BaseEndpoint {
920
1032
  * @returns {Promise<PopularPersons>} A Promise that resolves with the popular persons.
921
1033
  */
922
1034
  async popular(options) {
923
- return await this.api.get(`${BASE_PERSON}/popular`, options);
1035
+ return await this.api.get(`${BASE_PERSON}/popular`, { query: options });
924
1036
  }
925
1037
  };
926
1038
 
@@ -969,7 +1081,7 @@ var SearchEndpoint = class extends BaseEndpoint {
969
1081
  * @returns {Promise<Search<Company>>} A Promise that resolves with the search results for companies.
970
1082
  */
971
1083
  async companies(options) {
972
- return await this.api.get(`${BASE_SEARCH}/company`, options);
1084
+ return await this.api.get(`${BASE_SEARCH}/company`, { query: options });
973
1085
  }
974
1086
  /**
975
1087
  * Searches for collections asynchronously.
@@ -977,7 +1089,7 @@ var SearchEndpoint = class extends BaseEndpoint {
977
1089
  * @returns {Promise<Search<Collection>>} A Promise that resolves with the search results for collections.
978
1090
  */
979
1091
  async collections(options) {
980
- return await this.api.get(`${BASE_SEARCH}/collection`, options);
1092
+ return await this.api.get(`${BASE_SEARCH}/collection`, { query: options });
981
1093
  }
982
1094
  /**
983
1095
  * Searches for keywords asynchronously.
@@ -985,7 +1097,7 @@ var SearchEndpoint = class extends BaseEndpoint {
985
1097
  * @returns {Promise<Search<{ id: string; name: string }>>} A Promise that resolves with the search results for keywords.
986
1098
  */
987
1099
  async keywords(options) {
988
- return await this.api.get(`${BASE_SEARCH}/keyword`, options);
1100
+ return await this.api.get(`${BASE_SEARCH}/keyword`, { query: options });
989
1101
  }
990
1102
  /**
991
1103
  * Searches for movies asynchronously.
@@ -993,7 +1105,7 @@ var SearchEndpoint = class extends BaseEndpoint {
993
1105
  * @returns {Promise<Search<Movie>>} A Promise that resolves with the search results for movies.
994
1106
  */
995
1107
  async movies(options) {
996
- return await this.api.get(`${BASE_SEARCH}/movie`, options);
1108
+ return await this.api.get(`${BASE_SEARCH}/movie`, { query: options });
997
1109
  }
998
1110
  /**
999
1111
  * Searches for people asynchronously.
@@ -1001,7 +1113,7 @@ var SearchEndpoint = class extends BaseEndpoint {
1001
1113
  * @returns {Promise<Search<Person>>} A Promise that resolves with the search results for people.
1002
1114
  */
1003
1115
  async people(options) {
1004
- return await this.api.get(`${BASE_SEARCH}/person`, options);
1116
+ return await this.api.get(`${BASE_SEARCH}/person`, { query: options });
1005
1117
  }
1006
1118
  /**
1007
1119
  * Searches for TV shows asynchronously.
@@ -1009,7 +1121,7 @@ var SearchEndpoint = class extends BaseEndpoint {
1009
1121
  * @returns {Promise<Search<TV>>} A Promise that resolves with the search results for TV shows.
1010
1122
  */
1011
1123
  async tv(options) {
1012
- return await this.api.get(`${BASE_SEARCH}/tv`, options);
1124
+ return await this.api.get(`${BASE_SEARCH}/tv`, { query: options });
1013
1125
  }
1014
1126
  /**
1015
1127
  * Performs a multi-search asynchronously.
@@ -1017,7 +1129,7 @@ var SearchEndpoint = class extends BaseEndpoint {
1017
1129
  * @returns {Promise<Search<MultiSearchResult>>} A Promise that resolves with the multi-search results.
1018
1130
  */
1019
1131
  async multi(options) {
1020
- return await this.api.get(`${BASE_SEARCH}/multi`, options);
1132
+ return await this.api.get(`${BASE_SEARCH}/multi`, { query: options });
1021
1133
  }
1022
1134
  };
1023
1135
 
@@ -1044,7 +1156,7 @@ var TrendingEndpoint = class extends BaseEndpoint {
1044
1156
  * @template T - The type of media being searched for (e.g., 'movie', 'tv').
1045
1157
  */
1046
1158
  async trending(mediaType, timeWindow, options) {
1047
- return await this.api.get(`/trending/${mediaType}/${timeWindow}`, options);
1159
+ return await this.api.get(`/trending/${mediaType}/${timeWindow}`, { query: options });
1048
1160
  }
1049
1161
  };
1050
1162
 
@@ -1078,7 +1190,7 @@ var TvEpisodesEndpoint = class extends BaseEndpoint {
1078
1190
  append_to_response: appendToResponse ? appendToResponse.join(",") : void 0,
1079
1191
  ...options
1080
1192
  };
1081
- return await this.api.get(`${BASE_EPISODE(episodeSelection)}`, combinedOptions);
1193
+ return await this.api.get(`${BASE_EPISODE(episodeSelection)}`, { query: combinedOptions });
1082
1194
  }
1083
1195
  /**
1084
1196
  * Retrieves changes related to a specific TV episode asynchronously.
@@ -1087,7 +1199,7 @@ var TvEpisodesEndpoint = class extends BaseEndpoint {
1087
1199
  * @returns {Promise<Changes<TvEpisodeChangeValue>>} A Promise that resolves with the changes related to the TV episode.
1088
1200
  */
1089
1201
  async changes(episodeID, options) {
1090
- return await this.api.get(`/tv/episode/${episodeID}/changes`, options);
1202
+ return await this.api.get(`/tv/episode/${episodeID}/changes`, { query: options });
1091
1203
  }
1092
1204
  /**
1093
1205
  * Retrieves credits for a specific TV episode asynchronously.
@@ -1096,7 +1208,7 @@ var TvEpisodesEndpoint = class extends BaseEndpoint {
1096
1208
  * @returns {Promise<TvEpisodeCredit>} A Promise that resolves with the credits for the TV episode.
1097
1209
  */
1098
1210
  async credits(episodeSelection, options) {
1099
- return await this.api.get(`${BASE_EPISODE(episodeSelection)}/credits`, options);
1211
+ return await this.api.get(`${BASE_EPISODE(episodeSelection)}/credits`, { query: options });
1100
1212
  }
1101
1213
  /**
1102
1214
  * Retrieves external IDs for a specific TV episode asynchronously.
@@ -1117,7 +1229,7 @@ var TvEpisodesEndpoint = class extends BaseEndpoint {
1117
1229
  include_image_language: options?.include_image_language?.join(","),
1118
1230
  language: options?.language
1119
1231
  };
1120
- return await this.api.get(`${BASE_EPISODE(episodeSelection)}/images`, computedOptions);
1232
+ return await this.api.get(`${BASE_EPISODE(episodeSelection)}/images`, { query: computedOptions });
1121
1233
  }
1122
1234
  /**
1123
1235
  * Retrieves translations for a specific TV episode asynchronously.
@@ -1138,7 +1250,7 @@ var TvEpisodesEndpoint = class extends BaseEndpoint {
1138
1250
  include_video_language: options?.include_video_language?.join(","),
1139
1251
  language: options?.language
1140
1252
  };
1141
- return await this.api.get(`${BASE_EPISODE(episodeSelection)}/videos`, computedOptions);
1253
+ return await this.api.get(`${BASE_EPISODE(episodeSelection)}/videos`, { query: computedOptions });
1142
1254
  }
1143
1255
  };
1144
1256
 
@@ -1172,7 +1284,7 @@ var TvSeasonsEndpoint = class extends BaseEndpoint {
1172
1284
  append_to_response: appendToResponse ? appendToResponse.join(",") : void 0,
1173
1285
  ...options
1174
1286
  };
1175
- return await this.api.get(`${BASE_SEASON(seasonSelection)}`, combinedOptions);
1287
+ return await this.api.get(`${BASE_SEASON(seasonSelection)}`, { query: combinedOptions });
1176
1288
  }
1177
1289
  /**
1178
1290
  * Retrieves aggregate credits for a specific TV season asynchronously.
@@ -1181,7 +1293,7 @@ var TvSeasonsEndpoint = class extends BaseEndpoint {
1181
1293
  * @returns {Promise<AggregateCredits>} A Promise that resolves with the aggregate credits for the TV season.
1182
1294
  */
1183
1295
  async aggregateCredits(seasonSelection, options) {
1184
- return await this.api.get(`${BASE_SEASON(seasonSelection)}/aggregate_credits`, options);
1296
+ return await this.api.get(`${BASE_SEASON(seasonSelection)}/aggregate_credits`, { query: options });
1185
1297
  }
1186
1298
  /**
1187
1299
  * Retrieves changes related to a specific TV season asynchronously.
@@ -1190,7 +1302,7 @@ var TvSeasonsEndpoint = class extends BaseEndpoint {
1190
1302
  * @returns {Promise<Changes<TvSeasonChangeValue>>} A Promise that resolves with the changes related to the TV season.
1191
1303
  */
1192
1304
  async changes(seasonId, options) {
1193
- return await this.api.get(`/tv/season/${seasonId}/changes`, options);
1305
+ return await this.api.get(`/tv/season/${seasonId}/changes`, { query: options });
1194
1306
  }
1195
1307
  /**
1196
1308
  * Retrieves credits for a specific TV season asynchronously.
@@ -1199,7 +1311,7 @@ var TvSeasonsEndpoint = class extends BaseEndpoint {
1199
1311
  * @returns {Promise<Credits>} A Promise that resolves with the credits for the TV season.
1200
1312
  */
1201
1313
  async credits(seasonSelection, options) {
1202
- return await this.api.get(`${BASE_SEASON(seasonSelection)}/credits`, options);
1314
+ return await this.api.get(`${BASE_SEASON(seasonSelection)}/credits`, { query: options });
1203
1315
  }
1204
1316
  /**
1205
1317
  * Retrieves external IDs for a specific TV season asynchronously.
@@ -1208,7 +1320,7 @@ var TvSeasonsEndpoint = class extends BaseEndpoint {
1208
1320
  * @returns {Promise<ExternalIds>} A Promise that resolves with the external IDs for the TV season.
1209
1321
  */
1210
1322
  async externalIds(seasonSelection, options) {
1211
- return await this.api.get(`${BASE_SEASON(seasonSelection)}/external_ids`, options);
1323
+ return await this.api.get(`${BASE_SEASON(seasonSelection)}/external_ids`, { query: options });
1212
1324
  }
1213
1325
  /**
1214
1326
  * Retrieves images for a specific TV season asynchronously.
@@ -1221,7 +1333,7 @@ var TvSeasonsEndpoint = class extends BaseEndpoint {
1221
1333
  include_image_language: options?.include_image_language?.join(","),
1222
1334
  language: options?.language
1223
1335
  };
1224
- return await this.api.get(`${BASE_SEASON(seasonSelection)}/images`, computedOptions);
1336
+ return await this.api.get(`${BASE_SEASON(seasonSelection)}/images`, { query: computedOptions });
1225
1337
  }
1226
1338
  /**
1227
1339
  * Retrieves videos for a specific TV season asynchronously.
@@ -1234,7 +1346,7 @@ var TvSeasonsEndpoint = class extends BaseEndpoint {
1234
1346
  include_video_language: options?.include_video_language?.join(","),
1235
1347
  language: options?.language
1236
1348
  };
1237
- return await this.api.get(`${BASE_SEASON(seasonSelection)}/videos`, computedOptions);
1349
+ return await this.api.get(`${BASE_SEASON(seasonSelection)}/videos`, { query: computedOptions });
1238
1350
  }
1239
1351
  /**
1240
1352
  * Retrieves translations for a specific TV season asynchronously.
@@ -1243,7 +1355,7 @@ var TvSeasonsEndpoint = class extends BaseEndpoint {
1243
1355
  * @returns {Promise<Translations>} A Promise that resolves with the translations for the TV season.
1244
1356
  */
1245
1357
  async translations(seasonSelection, options) {
1246
- return await this.api.get(`${BASE_SEASON(seasonSelection)}/translations`, options);
1358
+ return await this.api.get(`${BASE_SEASON(seasonSelection)}/translations`, { query: options });
1247
1359
  }
1248
1360
  };
1249
1361
 
@@ -1275,7 +1387,7 @@ var TvShowsEndpoint = class extends BaseEndpoint {
1275
1387
  append_to_response: appendToResponse ? appendToResponse.join(",") : void 0,
1276
1388
  language
1277
1389
  };
1278
- return await this.api.get(`${BASE_TV}/${id}`, options);
1390
+ return await this.api.get(`${BASE_TV}/${id}`, { query: options });
1279
1391
  }
1280
1392
  /**
1281
1393
  * Retrieves alternative titles of a specific TV show asynchronously.
@@ -1293,7 +1405,7 @@ var TvShowsEndpoint = class extends BaseEndpoint {
1293
1405
  * A Promise that resolves with the changes for the TV show.
1294
1406
  */
1295
1407
  async changes(id, options) {
1296
- return await this.api.get(`${BASE_TV}/${id}/changes`, options);
1408
+ return await this.api.get(`${BASE_TV}/${id}/changes`, { query: options });
1297
1409
  }
1298
1410
  /**
1299
1411
  * Retrieves content ratings for a specific TV show asynchronously.
@@ -1310,7 +1422,7 @@ var TvShowsEndpoint = class extends BaseEndpoint {
1310
1422
  * @returns {Promise<AggregateCredits>} A Promise that resolves with the aggregate credits of the TV show.
1311
1423
  */
1312
1424
  async aggregateCredits(id, options) {
1313
- return await this.api.get(`${BASE_TV}/${id}/aggregate_credits`, options);
1425
+ return await this.api.get(`${BASE_TV}/${id}/aggregate_credits`, { query: options });
1314
1426
  }
1315
1427
  /**
1316
1428
  * Retrieves credits for a specific TV show asynchronously.
@@ -1319,7 +1431,7 @@ var TvShowsEndpoint = class extends BaseEndpoint {
1319
1431
  * @returns {Promise<Credits>} A Promise that resolves with the credits of the TV show.
1320
1432
  */
1321
1433
  async credits(id, options) {
1322
- return await this.api.get(`${BASE_TV}/${id}/credits`, options);
1434
+ return await this.api.get(`${BASE_TV}/${id}/credits`, { query: options });
1323
1435
  }
1324
1436
  /**
1325
1437
  * Retrieves details of a specific season of a TV show asynchronously.
@@ -1357,7 +1469,7 @@ var TvShowsEndpoint = class extends BaseEndpoint {
1357
1469
  include_image_language: options?.include_image_language?.join(","),
1358
1470
  language: options?.language
1359
1471
  };
1360
- return await this.api.get(`${BASE_TV}/${id}/images`, computedOptions);
1472
+ return await this.api.get(`${BASE_TV}/${id}/images`, { query: computedOptions });
1361
1473
  }
1362
1474
  /**
1363
1475
  * Retrieves keywords for a specific TV show asynchronously.
@@ -1374,7 +1486,7 @@ var TvShowsEndpoint = class extends BaseEndpoint {
1374
1486
  * @returns {Promise<Recommendations>} A Promise that resolves with the recommendations for the TV show.
1375
1487
  */
1376
1488
  async recommendations(id, options) {
1377
- return await this.api.get(`${BASE_TV}/${id}/recommendations`, options);
1489
+ return await this.api.get(`${BASE_TV}/${id}/recommendations`, { query: options });
1378
1490
  }
1379
1491
  /**
1380
1492
  * Retrieves reviews for a specific TV show asynchronously.
@@ -1383,7 +1495,7 @@ var TvShowsEndpoint = class extends BaseEndpoint {
1383
1495
  * @returns {Promise<Reviews>} A Promise that resolves with the reviews of the TV show.
1384
1496
  */
1385
1497
  async reviews(id, options) {
1386
- return await this.api.get(`${BASE_TV}/${id}/reviews`, options);
1498
+ return await this.api.get(`${BASE_TV}/${id}/reviews`, { query: options });
1387
1499
  }
1388
1500
  /**
1389
1501
  * Retrieves information about whether the TV show was screened theatrically asynchronously.
@@ -1400,7 +1512,7 @@ var TvShowsEndpoint = class extends BaseEndpoint {
1400
1512
  * @returns {Promise<Similartv>} A Promise that resolves with the similar TV shows.
1401
1513
  */
1402
1514
  async similar(id, options) {
1403
- return await this.api.get(`${BASE_TV}/${id}/similar`, options);
1515
+ return await this.api.get(`${BASE_TV}/${id}/similar`, { query: options });
1404
1516
  }
1405
1517
  /**
1406
1518
  * Retrieves translations for a specific TV show asynchronously.
@@ -1421,7 +1533,7 @@ var TvShowsEndpoint = class extends BaseEndpoint {
1421
1533
  include_video_language: options?.include_video_language?.join(","),
1422
1534
  language: options?.language
1423
1535
  };
1424
- return await this.api.get(`${BASE_TV}/${id}/videos`, computedOptions);
1536
+ return await this.api.get(`${BASE_TV}/${id}/videos`, { query: computedOptions });
1425
1537
  }
1426
1538
  /**
1427
1539
  * Retrieves watch providers for a specific TV show asynchronously.
@@ -1445,7 +1557,7 @@ var TvShowsEndpoint = class extends BaseEndpoint {
1445
1557
  * @returns {Promise<OnTheAir>} A Promise that resolves with TV shows currently on the air.
1446
1558
  */
1447
1559
  async onTheAir(options) {
1448
- return await this.api.get(`${BASE_TV}/on_the_air`, options);
1560
+ return await this.api.get(`${BASE_TV}/on_the_air`, { query: options });
1449
1561
  }
1450
1562
  /**
1451
1563
  * Retrieves TV shows that are airing today asynchronously.
@@ -1453,7 +1565,7 @@ var TvShowsEndpoint = class extends BaseEndpoint {
1453
1565
  * @returns {Promise<tvAiringToday>} A Promise that resolves with TV shows airing today.
1454
1566
  */
1455
1567
  async airingToday(options) {
1456
- return await this.api.get(`${BASE_TV}/airing_today`, options);
1568
+ return await this.api.get(`${BASE_TV}/airing_today`, { query: options });
1457
1569
  }
1458
1570
  /**
1459
1571
  * Retrieves popular TV shows asynchronously.
@@ -1461,7 +1573,7 @@ var TvShowsEndpoint = class extends BaseEndpoint {
1461
1573
  * @returns {Promise<Populartv>} A Promise that resolves with popular TV shows.
1462
1574
  */
1463
1575
  async popular(options) {
1464
- return await this.api.get(`${BASE_TV}/popular`, options);
1576
+ return await this.api.get(`${BASE_TV}/popular`, { query: options });
1465
1577
  }
1466
1578
  /**
1467
1579
  * Retrieves top-rated TV shows asynchronously.
@@ -1469,7 +1581,7 @@ var TvShowsEndpoint = class extends BaseEndpoint {
1469
1581
  * @returns {Promise<TopRatedtv>} A Promise that resolves with top-rated TV shows.
1470
1582
  */
1471
1583
  async topRated(options) {
1472
- return await this.api.get(`${BASE_TV}/top_rated`, options);
1584
+ return await this.api.get(`${BASE_TV}/top_rated`, { query: options });
1473
1585
  }
1474
1586
  };
1475
1587
 
@@ -1488,33 +1600,26 @@ var WatchProvidersEndpoint = class extends BaseEndpoint {
1488
1600
  this.access_token = access_token;
1489
1601
  }
1490
1602
  /**
1491
- * Retrieves a list of all available watch providers (streaming services).
1492
- * @returns {Promise<WatchProviders>} A Promise that resolves with the list of watch providers.
1493
- */
1494
- async available() {
1495
- return await this.api.get("/watch/providers/movie");
1496
- }
1497
- /**
1498
- * Retrieves a list of available regions for watch providers.
1499
- * @returns {Promise<WatchRegionsResponse>} A Promise that resolves with the list of available regions.
1500
- */
1501
- async regions() {
1502
- return await this.api.get("/watch/providers/regions");
1503
- }
1504
- /**
1505
1603
  * Retrieves a list of watch providers for movies.
1506
- * @returns {Promise<WatchProviders>} A Promise that resolves with the list of movie watch providers.
1604
+ * @returns {Promise<WatchProviderListResponse>} A Promise that resolves with the list of movie watch providers.
1507
1605
  */
1508
1606
  async movie() {
1509
1607
  return await this.api.get("/watch/providers/movie");
1510
1608
  }
1511
1609
  /**
1512
1610
  * Retrieves a list of watch providers for TV shows.
1513
- * @returns {Promise<WatchProviders>} A Promise that resolves with the list of TV watch providers.
1611
+ * @returns {Promise<WatchProviderListResponse>} A Promise that resolves with the list of TV watch providers.
1514
1612
  */
1515
1613
  async tv() {
1516
1614
  return await this.api.get("/watch/providers/tv");
1517
1615
  }
1616
+ /**
1617
+ * Retrieves a list of available regions for watch providers.
1618
+ * @returns {Promise<WatchProviderListResponse>} A Promise that resolves with the list of available regions.
1619
+ */
1620
+ async regions() {
1621
+ return await this.api.get("/watch/providers/regions");
1622
+ }
1518
1623
  };
1519
1624
 
1520
1625
  //#endregion
@@ -1579,6 +1684,7 @@ exports.ProfileSizes = ProfileSizes;
1579
1684
  exports.ReleaseDateType = ReleaseDateType;
1580
1685
  exports.StillSizes = StillSizes;
1581
1686
  exports.TMDB = TMDB;
1687
+ exports.TMDBError = TMDBError;
1582
1688
  exports.TMDB_IMAGE_BASE_URL = TMDB_IMAGE_BASE_URL;
1583
1689
  exports.formImage = formImage;
1584
1690
  exports.getFullImagePath = getFullImagePath;