@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.
Files changed (185) hide show
  1. package/README.md +334 -148
  2. package/dist/endpoints/account.js +2 -13
  3. package/dist/endpoints/certification.js +4 -17
  4. package/dist/endpoints/changes.js +6 -21
  5. package/dist/endpoints/collections.js +10 -26
  6. package/dist/endpoints/companies.js +6 -21
  7. package/dist/endpoints/configuration.js +2 -13
  8. package/dist/endpoints/credits.js +2 -13
  9. package/dist/endpoints/discover.js +4 -17
  10. package/dist/endpoints/find.js +2 -13
  11. package/dist/endpoints/genre.js +4 -17
  12. package/dist/endpoints/index.js +3 -0
  13. package/dist/endpoints/keywords.js +4 -17
  14. package/dist/endpoints/movies.js +48 -98
  15. package/dist/endpoints/networks.js +6 -21
  16. package/dist/endpoints/people.js +26 -57
  17. package/dist/endpoints/review.js +2 -13
  18. package/dist/endpoints/search.js +14 -37
  19. package/dist/endpoints/trending.js +2 -13
  20. package/dist/endpoints/tvEpisodes.js +26 -48
  21. package/dist/endpoints/tvSeasons.js +28 -52
  22. package/dist/endpoints/tvShows.js +58 -115
  23. package/dist/endpoints/watchProviders.js +46 -0
  24. package/dist/index.js +3 -0
  25. package/dist/utils/api.js +12 -23
  26. package/dist/utils/getimagePath.js +39 -8
  27. package/package.json +59 -41
  28. package/.github/workflows/npm-publish.yml +0 -33
  29. package/dist/@types/endpoints/account.d.ts +0 -16
  30. package/dist/@types/endpoints/account.d.ts.map +0 -1
  31. package/dist/@types/endpoints/certification.d.ts +0 -19
  32. package/dist/@types/endpoints/certification.d.ts.map +0 -1
  33. package/dist/@types/endpoints/changes.d.ts +0 -26
  34. package/dist/@types/endpoints/changes.d.ts.map +0 -1
  35. package/dist/@types/endpoints/collection.d.ts +0 -21
  36. package/dist/@types/endpoints/collection.d.ts.map +0 -1
  37. package/dist/@types/endpoints/companies.d.ts +0 -29
  38. package/dist/@types/endpoints/companies.d.ts.map +0 -1
  39. package/dist/@types/endpoints/configuration.d.ts +0 -106
  40. package/dist/@types/endpoints/configuration.d.ts.map +0 -1
  41. package/dist/@types/endpoints/credits.d.ts +0 -135
  42. package/dist/@types/endpoints/credits.d.ts.map +0 -1
  43. package/dist/@types/endpoints/discover.d.ts +0 -68
  44. package/dist/@types/endpoints/discover.d.ts.map +0 -1
  45. package/dist/@types/endpoints/find.d.ts +0 -20
  46. package/dist/@types/endpoints/find.d.ts.map +0 -1
  47. package/dist/@types/endpoints/genre.d.ts +0 -7
  48. package/dist/@types/endpoints/genre.d.ts.map +0 -1
  49. package/dist/@types/endpoints/index.d.ts +0 -23
  50. package/dist/@types/endpoints/index.d.ts.map +0 -1
  51. package/dist/@types/endpoints/keywords.d.ts +0 -21
  52. package/dist/@types/endpoints/keywords.d.ts.map +0 -1
  53. package/dist/@types/endpoints/movies.d.ts +0 -150
  54. package/dist/@types/endpoints/movies.d.ts.map +0 -1
  55. package/dist/@types/endpoints/networks.d.ts +0 -14
  56. package/dist/@types/endpoints/networks.d.ts.map +0 -1
  57. package/dist/@types/endpoints/options.d.ts +0 -73
  58. package/dist/@types/endpoints/options.d.ts.map +0 -1
  59. package/dist/@types/endpoints/people.d.ts +0 -135
  60. package/dist/@types/endpoints/people.d.ts.map +0 -1
  61. package/dist/@types/endpoints/review.d.ts +0 -8
  62. package/dist/@types/endpoints/review.d.ts.map +0 -1
  63. package/dist/@types/endpoints/search.d.ts +0 -32
  64. package/dist/@types/endpoints/search.d.ts.map +0 -1
  65. package/dist/@types/endpoints/trending.d.ts +0 -12
  66. package/dist/@types/endpoints/trending.d.ts.map +0 -1
  67. package/dist/@types/endpoints/tvEpisode.d.ts +0 -65
  68. package/dist/@types/endpoints/tvEpisode.d.ts.map +0 -1
  69. package/dist/@types/endpoints/tvSeasons.d.ts +0 -31
  70. package/dist/@types/endpoints/tvSeasons.d.ts.map +0 -1
  71. package/dist/@types/endpoints/tvShows.d.ts +0 -260
  72. package/dist/@types/endpoints/tvShows.d.ts.map +0 -1
  73. package/dist/@types/endpoints/watchProviders.d.ts +0 -295
  74. package/dist/@types/endpoints/watchProviders.d.ts.map +0 -1
  75. package/dist/@types/index.d.ts +0 -4
  76. package/dist/@types/index.d.ts.map +0 -1
  77. package/dist/@types/models/baseEndpoint.d.ts +0 -7
  78. package/dist/@types/models/baseEndpoint.d.ts.map +0 -1
  79. package/dist/@types/models/index.d.ts +0 -2
  80. package/dist/@types/models/index.d.ts.map +0 -1
  81. package/dist/@types/types.d.ts +0 -174
  82. package/dist/@types/types.d.ts.map +0 -1
  83. package/dist/endpoints/account.d.ts +0 -17
  84. package/dist/endpoints/account.d.ts.map +0 -1
  85. package/dist/endpoints/certification.d.ts +0 -23
  86. package/dist/endpoints/certification.d.ts.map +0 -1
  87. package/dist/endpoints/changes.d.ts +0 -31
  88. package/dist/endpoints/changes.d.ts.map +0 -1
  89. package/dist/endpoints/collections.d.ts +0 -34
  90. package/dist/endpoints/collections.d.ts.map +0 -1
  91. package/dist/endpoints/companies.d.ts +0 -31
  92. package/dist/endpoints/companies.d.ts.map +0 -1
  93. package/dist/endpoints/configuration.d.ts +0 -18
  94. package/dist/endpoints/configuration.d.ts.map +0 -1
  95. package/dist/endpoints/credits.d.ts +0 -19
  96. package/dist/endpoints/credits.d.ts.map +0 -1
  97. package/dist/endpoints/discover.d.ts +0 -24
  98. package/dist/endpoints/discover.d.ts.map +0 -1
  99. package/dist/endpoints/find.d.ts +0 -19
  100. package/dist/endpoints/find.d.ts.map +0 -1
  101. package/dist/endpoints/genre.d.ts +0 -25
  102. package/dist/endpoints/genre.d.ts.map +0 -1
  103. package/dist/endpoints/index.d.ts +0 -19
  104. package/dist/endpoints/index.d.ts.map +0 -1
  105. package/dist/endpoints/keywords.d.ts +0 -25
  106. package/dist/endpoints/keywords.d.ts.map +0 -1
  107. package/dist/endpoints/movies.d.ts +0 -142
  108. package/dist/endpoints/movies.d.ts.map +0 -1
  109. package/dist/endpoints/networks.d.ts +0 -31
  110. package/dist/endpoints/networks.d.ts.map +0 -1
  111. package/dist/endpoints/people.d.ts +0 -84
  112. package/dist/endpoints/people.d.ts.map +0 -1
  113. package/dist/endpoints/review.d.ts +0 -18
  114. package/dist/endpoints/review.d.ts.map +0 -1
  115. package/dist/endpoints/search.d.ts +0 -58
  116. package/dist/endpoints/search.d.ts.map +0 -1
  117. package/dist/endpoints/trending.d.ts +0 -21
  118. package/dist/endpoints/trending.d.ts.map +0 -1
  119. package/dist/endpoints/tvEpisodes.d.ts +0 -61
  120. package/dist/endpoints/tvEpisodes.d.ts.map +0 -1
  121. package/dist/endpoints/tvSeasons.d.ts +0 -70
  122. package/dist/endpoints/tvSeasons.d.ts.map +0 -1
  123. package/dist/endpoints/tvShows.d.ts +0 -164
  124. package/dist/endpoints/tvShows.d.ts.map +0 -1
  125. package/dist/index.d.ts +0 -26
  126. package/dist/index.d.ts.map +0 -1
  127. package/dist/utils/api.d.ts +0 -7
  128. package/dist/utils/api.d.ts.map +0 -1
  129. package/dist/utils/getimagePath.d.ts +0 -12
  130. package/dist/utils/getimagePath.d.ts.map +0 -1
  131. package/dist/utils/index.d.ts +0 -3
  132. package/dist/utils/index.d.ts.map +0 -1
  133. package/src/@types/endpoints/account.ts +0 -17
  134. package/src/@types/endpoints/certification.ts +0 -19
  135. package/src/@types/endpoints/changes.ts +0 -29
  136. package/src/@types/endpoints/collection.ts +0 -23
  137. package/src/@types/endpoints/companies.ts +0 -33
  138. package/src/@types/endpoints/configuration.ts +0 -112
  139. package/src/@types/endpoints/credits.ts +0 -149
  140. package/src/@types/endpoints/discover.ts +0 -87
  141. package/src/@types/endpoints/find.ts +0 -28
  142. package/src/@types/endpoints/genre.ts +0 -3
  143. package/src/@types/endpoints/index.ts +0 -22
  144. package/src/@types/endpoints/keywords.ts +0 -24
  145. package/src/@types/endpoints/movies.ts +0 -169
  146. package/src/@types/endpoints/networks.ts +0 -15
  147. package/src/@types/endpoints/options.ts +0 -189
  148. package/src/@types/endpoints/people.ts +0 -151
  149. package/src/@types/endpoints/review.ts +0 -8
  150. package/src/@types/endpoints/search.ts +0 -39
  151. package/src/@types/endpoints/trending.ts +0 -20
  152. package/src/@types/endpoints/tvEpisode.ts +0 -72
  153. package/src/@types/endpoints/tvSeasons.ts +0 -37
  154. package/src/@types/endpoints/tvShows.ts +0 -284
  155. package/src/@types/endpoints/watchProviders.ts +0 -298
  156. package/src/@types/index.ts +0 -3
  157. package/src/@types/models/baseEndpoint.ts +0 -9
  158. package/src/@types/models/index.ts +0 -1
  159. package/src/@types/types.ts +0 -199
  160. package/src/endpoints/account.ts +0 -22
  161. package/src/endpoints/certification.ts +0 -30
  162. package/src/endpoints/changes.ts +0 -41
  163. package/src/endpoints/collections.ts +0 -57
  164. package/src/endpoints/companies.ts +0 -41
  165. package/src/endpoints/configuration.ts +0 -22
  166. package/src/endpoints/credits.ts +0 -23
  167. package/src/endpoints/discover.ts +0 -40
  168. package/src/endpoints/find.ts +0 -24
  169. package/src/endpoints/genre.ts +0 -32
  170. package/src/endpoints/index.ts +0 -18
  171. package/src/endpoints/keywords.ts +0 -35
  172. package/src/endpoints/movies.ts +0 -244
  173. package/src/endpoints/networks.ts +0 -41
  174. package/src/endpoints/people.ts +0 -147
  175. package/src/endpoints/review.ts +0 -23
  176. package/src/endpoints/search.ts +0 -93
  177. package/src/endpoints/trending.ts +0 -30
  178. package/src/endpoints/tvEpisodes.ts +0 -125
  179. package/src/endpoints/tvSeasons.ts +0 -138
  180. package/src/endpoints/tvShows.ts +0 -286
  181. package/src/index.ts +0 -66
  182. package/src/utils/api.ts +0 -31
  183. package/src/utils/getimagePath.ts +0 -16
  184. package/src/utils/index.ts +0 -2
  185. package/tsconfig.json +0 -101
@@ -1,13 +1,4 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.CompaniesEndpoint = void 0;
13
4
  const _types_1 = require("../@types");
@@ -28,30 +19,24 @@ class CompaniesEndpoint extends _types_1.BaseEndpoint {
28
19
  * @param {number} id - The ID of the company.
29
20
  * @returns {Promise<CompanyDetails>} A Promise that resolves with the detailed information of the company.
30
21
  */
31
- details(id) {
32
- return __awaiter(this, void 0, void 0, function* () {
33
- return yield this.api.get(`/company/${id}`);
34
- });
22
+ async details(id) {
23
+ return await this.api.get(`/company/${id}`);
35
24
  }
36
25
  /**
37
26
  * Retrieves alternative names of a specific company asynchronously.
38
27
  * @param {number} id - The ID of the company.
39
28
  * @returns {Promise<AlternativeNames>} A Promise that resolves with the alternative names of the company.
40
29
  */
41
- alternativeNames(id) {
42
- return __awaiter(this, void 0, void 0, function* () {
43
- return yield this.api.get(`/company/${id}/alternative_names`);
44
- });
30
+ async alternativeNames(id) {
31
+ return await this.api.get(`/company/${id}/alternative_names`);
45
32
  }
46
33
  /**
47
34
  * Retrieves images associated with a specific company asynchronously.
48
35
  * @param {number} id - The ID of the company.
49
36
  * @returns {Promise<CompanyImages>} A Promise that resolves with the images of the company.
50
37
  */
51
- images(id) {
52
- return __awaiter(this, void 0, void 0, function* () {
53
- return yield this.api.get(`/company/${id}/images`);
54
- });
38
+ async images(id) {
39
+ return await this.api.get(`/company/${id}/images`);
55
40
  }
56
41
  }
57
42
  exports.CompaniesEndpoint = CompaniesEndpoint;
@@ -1,13 +1,4 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.ConfigurationEndpoint = void 0;
13
4
  const _types_1 = require("../@types");
@@ -27,10 +18,8 @@ class ConfigurationEndpoint extends _types_1.BaseEndpoint {
27
18
  * Retrieves the current system configuration asynchronously.
28
19
  * @returns {Promise<Configuration>} A Promise that resolves with the current system configuration.
29
20
  */
30
- getCurrent() {
31
- return __awaiter(this, void 0, void 0, function* () {
32
- return yield this.api.get(`/configuration`);
33
- });
21
+ async getCurrent() {
22
+ return await this.api.get(`/configuration`);
34
23
  }
35
24
  }
36
25
  exports.ConfigurationEndpoint = ConfigurationEndpoint;
@@ -1,13 +1,4 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.CreditsEndpoint = void 0;
13
4
  const _types_1 = require("../@types");
@@ -28,10 +19,8 @@ class CreditsEndpoint extends _types_1.BaseEndpoint {
28
19
  * @param {string} id - The ID of the credit.
29
20
  * @returns {Promise<CreditResponse>} A Promise that resolves with the credit details.
30
21
  */
31
- getById(id) {
32
- return __awaiter(this, void 0, void 0, function* () {
33
- return yield this.api.get(`/credit/${id}`);
34
- });
22
+ async getById(id) {
23
+ return await this.api.get(`/credit/${id}`);
35
24
  }
36
25
  }
37
26
  exports.CreditsEndpoint = CreditsEndpoint;
@@ -1,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.DiscoverEndpoint = void 0;
13
4
  const _types_1 = require("../@types");
@@ -28,20 +19,16 @@ class DiscoverEndpoint extends _types_1.BaseEndpoint {
28
19
  * @param {MovieQueryOptions} [options] - Optional parameters for refining the movie discovery.
29
20
  * @returns {Promise<MovieDiscoverResult>} A Promise that resolves with the movie discovery results.
30
21
  */
31
- movie(options) {
32
- return __awaiter(this, void 0, void 0, function* () {
33
- return yield this.api.get(`${BASE_DISCOVER}/movie`, options);
34
- });
22
+ async movie(options) {
23
+ return await this.api.get(`${BASE_DISCOVER}/movie`, options);
35
24
  }
36
25
  /**
37
26
  * Retrieves a list of TV shows based on the provided query options asynchronously.
38
27
  * @param {TvShowQueryOptions} [options] - Optional parameters for refining the TV show discovery.
39
28
  * @returns {Promise<TvShowDiscoverResult>} A Promise that resolves with the TV show discovery results.
40
29
  */
41
- tvShow(options) {
42
- return __awaiter(this, void 0, void 0, function* () {
43
- return yield this.api.get(`${BASE_DISCOVER}/tv`, options);
44
- });
30
+ async tvShow(options) {
31
+ return await this.api.get(`${BASE_DISCOVER}/tv`, options);
45
32
  }
46
33
  }
47
34
  exports.DiscoverEndpoint = DiscoverEndpoint;
@@ -1,13 +1,4 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.FindEndpoint = void 0;
13
4
  const _types_1 = require("../@types");
@@ -28,10 +19,8 @@ class FindEndpoint extends _types_1.BaseEndpoint {
28
19
  * @param {ExternalIdOptions} options - Options for finding media by external ID.
29
20
  * @returns {Promise<FindResult>} A Promise that resolves with the result of the find operation.
30
21
  */
31
- byId(externalId, options) {
32
- return __awaiter(this, void 0, void 0, function* () {
33
- return yield this.api.get(`/find/${externalId}`, options);
34
- });
22
+ async byId(externalId, options) {
23
+ return await this.api.get(`/find/${externalId}`, options);
35
24
  }
36
25
  }
37
26
  exports.FindEndpoint = FindEndpoint;
@@ -1,13 +1,4 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.GenreEndpoint = void 0;
13
4
  const _types_1 = require("../@types");
@@ -28,20 +19,16 @@ class GenreEndpoint extends _types_1.BaseEndpoint {
28
19
  * @param {LanguageOption} [options] - Optional parameters for specifying the language.
29
20
  * @returns {Promise<Genres>} A Promise that resolves with the genre information for movies.
30
21
  */
31
- movies(options) {
32
- return __awaiter(this, void 0, void 0, function* () {
33
- return yield this.api.get('/genre/movie/list', options);
34
- });
22
+ async movies(options) {
23
+ return await this.api.get('/genre/movie/list', options);
35
24
  }
36
25
  /**
37
26
  * Retrieves genre information for TV shows asynchronously.
38
27
  * @param {LanguageOption} [options] - Optional parameters for specifying the language.
39
28
  * @returns {Promise<Genres>} A Promise that resolves with the genre information for TV shows.
40
29
  */
41
- tv(options) {
42
- return __awaiter(this, void 0, void 0, function* () {
43
- return yield this.api.get('/genre/tv/list', options);
44
- });
30
+ async tv(options) {
31
+ return await this.api.get('/genre/tv/list', options);
45
32
  }
46
33
  }
47
34
  exports.GenreEndpoint = GenreEndpoint;
@@ -18,6 +18,7 @@ __exportStar(require("./account"), exports);
18
18
  __exportStar(require("./certification"), exports);
19
19
  __exportStar(require("./changes"), exports);
20
20
  __exportStar(require("./collections"), exports);
21
+ __exportStar(require("./companies"), exports);
21
22
  __exportStar(require("./configuration"), exports);
22
23
  __exportStar(require("./credits"), exports);
23
24
  __exportStar(require("./discover"), exports);
@@ -25,6 +26,7 @@ __exportStar(require("./find"), exports);
25
26
  __exportStar(require("./genre"), exports);
26
27
  __exportStar(require("./keywords"), exports);
27
28
  __exportStar(require("./movies"), exports);
29
+ __exportStar(require("./networks"), exports);
28
30
  __exportStar(require("./people"), exports);
29
31
  __exportStar(require("./review"), exports);
30
32
  __exportStar(require("./search"), exports);
@@ -32,3 +34,4 @@ __exportStar(require("./trending"), exports);
32
34
  __exportStar(require("./tvEpisodes"), exports);
33
35
  __exportStar(require("./tvSeasons"), exports);
34
36
  __exportStar(require("./tvShows"), exports);
37
+ __exportStar(require("./watchProviders"), exports);
@@ -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.KeywordsEndpoint = void 0;
13
4
  const _types_1 = require("../@types");
@@ -28,10 +19,8 @@ class KeywordsEndpoint extends _types_1.BaseEndpoint {
28
19
  * @param {number} keywordId - The ID of the keyword.
29
20
  * @returns {Promise<Keyword>} A Promise that resolves with the details of the keyword.
30
21
  */
31
- details(keywordId) {
32
- return __awaiter(this, void 0, void 0, function* () {
33
- return yield this.api.get(`${BASE_KEYWORD}/${keywordId}`);
34
- });
22
+ async details(keywordId) {
23
+ return await this.api.get(`${BASE_KEYWORD}/${keywordId}`);
35
24
  }
36
25
  /**
37
26
  * Retrieves movies belonging to a specific keyword asynchronously.
@@ -39,10 +28,8 @@ class KeywordsEndpoint extends _types_1.BaseEndpoint {
39
28
  * @param {KeywordsOptions} [options] - Optional parameters for refining the search.
40
29
  * @returns {Promise<BelongingMovies>} A Promise that resolves with the movies belonging to the keyword.
41
30
  */
42
- belongingMovies(keywordId, options) {
43
- return __awaiter(this, void 0, void 0, function* () {
44
- return yield this.api.get(`${BASE_KEYWORD}/${keywordId}/movies`, options);
45
- });
31
+ async belongingMovies(keywordId, options) {
32
+ return await this.api.get(`${BASE_KEYWORD}/${keywordId}/movies`, options);
46
33
  }
47
34
  }
48
35
  exports.KeywordsEndpoint = KeywordsEndpoint;
@@ -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.MoviesEndpoint = void 0;
13
4
  const _types_1 = require("../@types");
@@ -31,24 +22,20 @@ 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
- return __awaiter(this, void 0, void 0, function* () {
36
- const options = {
37
- append_to_response: appendToResponse ? appendToResponse.join(',') : undefined,
38
- language: language,
39
- };
40
- return yield this.api.get(`${BASE_MOVIE}/${id}`, options);
41
- });
25
+ async details(id, appendToResponse, language) {
26
+ const options = {
27
+ append_to_response: appendToResponse ? appendToResponse.join(',') : undefined,
28
+ language: language,
29
+ };
30
+ return await this.api.get(`${BASE_MOVIE}/${id}`, options);
42
31
  }
43
32
  /**
44
33
  * Retrieves alternative titles of a specific movie asynchronously.
45
34
  * @param {number} id - The ID of the movie.
46
35
  * @returns {Promise<AlternativeTitles>} A Promise that resolves with the alternative titles of the movie.
47
36
  */
48
- alternativeTitles(id) {
49
- return __awaiter(this, void 0, void 0, function* () {
50
- return yield this.api.get(`${BASE_MOVIE}/${id}/alternative_titles`);
51
- });
37
+ async alternativeTitles(id) {
38
+ return await this.api.get(`${BASE_MOVIE}/${id}/alternative_titles`);
52
39
  }
53
40
  /**
54
41
  * Retrieves changes made to a specific movie asynchronously.
@@ -56,10 +43,8 @@ class MoviesEndpoint extends _types_1.BaseEndpoint {
56
43
  * @param {ChangeOption} [options] - Optional parameters for filtering changes.
57
44
  * @returns {Promise<Changes<MovieChangeValue>>} A Promise that resolves with the changes made to the movie.
58
45
  */
59
- changes(id, options) {
60
- return __awaiter(this, void 0, void 0, function* () {
61
- return yield this.api.get(`${BASE_MOVIE}/${id}/changes`, options);
62
- });
46
+ async changes(id, options) {
47
+ return await this.api.get(`${BASE_MOVIE}/${id}/changes`, options);
63
48
  }
64
49
  /**
65
50
  * Retrieves credits of a specific movie asynchronously.
@@ -67,20 +52,16 @@ class MoviesEndpoint extends _types_1.BaseEndpoint {
67
52
  * @param {LanguageOption} [options] - Optional parameters for specifying the language.
68
53
  * @returns {Promise<Credits>} A Promise that resolves with the credits of the movie.
69
54
  */
70
- credits(id, options) {
71
- return __awaiter(this, void 0, void 0, function* () {
72
- return yield this.api.get(`${BASE_MOVIE}/${id}/credits`, options);
73
- });
55
+ async credits(id, options) {
56
+ return await this.api.get(`${BASE_MOVIE}/${id}/credits`, options);
74
57
  }
75
58
  /**
76
59
  * Retrieves external IDs of a specific movie asynchronously.
77
60
  * @param {number} id - The ID of the movie.
78
61
  * @returns {Promise<ExternalIds>} A Promise that resolves with the external IDs of the movie.
79
62
  */
80
- externalIds(id) {
81
- return __awaiter(this, void 0, void 0, function* () {
82
- return yield this.api.get(`${BASE_MOVIE}/${id}/external_ids`);
83
- });
63
+ async externalIds(id) {
64
+ return await this.api.get(`${BASE_MOVIE}/${id}/external_ids`);
84
65
  }
85
66
  /**
86
67
  * Retrieves images of a specific movie asynchronously.
@@ -88,25 +69,20 @@ class MoviesEndpoint extends _types_1.BaseEndpoint {
88
69
  * @param {MoviesImageSearchOptions} [options] - Optional parameters for specifying image search options.
89
70
  * @returns {Promise<Images>} A Promise that resolves with the images of the movie.
90
71
  */
91
- images(id, options) {
92
- var _a;
93
- return __awaiter(this, void 0, void 0, function* () {
94
- const computedOptions = {
95
- include_image_language: (_a = options === null || options === void 0 ? void 0 : options.include_image_language) === null || _a === void 0 ? void 0 : _a.join(','),
96
- language: options === null || options === void 0 ? void 0 : options.language,
97
- };
98
- return yield this.api.get(`${BASE_MOVIE}/${id}/images`, computedOptions);
99
- });
72
+ async images(id, options) {
73
+ const computedOptions = {
74
+ include_image_language: options?.include_image_language?.join(','),
75
+ language: options?.language,
76
+ };
77
+ return await this.api.get(`${BASE_MOVIE}/${id}/images`, computedOptions);
100
78
  }
101
79
  /**
102
80
  * Retrieves keywords of a specific movie asynchronously.
103
81
  * @param {number} id - The ID of the movie.
104
82
  * @returns {Promise<Keywords>} A Promise that resolves with the keywords of the movie.
105
83
  */
106
- keywords(id) {
107
- return __awaiter(this, void 0, void 0, function* () {
108
- return yield this.api.get(`${BASE_MOVIE}/${id}/keywords`);
109
- });
84
+ async keywords(id) {
85
+ return await this.api.get(`${BASE_MOVIE}/${id}/keywords`);
110
86
  }
111
87
  /**
112
88
  * Retrieves lists containing a specific movie asynchronously.
@@ -114,10 +90,8 @@ class MoviesEndpoint extends _types_1.BaseEndpoint {
114
90
  * @param {LanguageOption & PageOption} [options] - Optional parameters for specifying language and pagination options.
115
91
  * @returns {Promise<MovieLists>} A Promise that resolves with the lists containing the movie.
116
92
  */
117
- lists(id, options) {
118
- return __awaiter(this, void 0, void 0, function* () {
119
- return yield this.api.get(`${BASE_MOVIE}/${id}/lists`, options);
120
- });
93
+ async lists(id, options) {
94
+ return await this.api.get(`${BASE_MOVIE}/${id}/lists`, options);
121
95
  }
122
96
  /**
123
97
  * Retrieves recommendations for a specific movie asynchronously.
@@ -125,20 +99,16 @@ class MoviesEndpoint extends _types_1.BaseEndpoint {
125
99
  * @param {LanguageOption & PageOption} [options] - Optional parameters for specifying language and pagination options.
126
100
  * @returns {Promise<Recommendations>} A Promise that resolves with the recommendations for the movie.
127
101
  */
128
- recommendations(id, options) {
129
- return __awaiter(this, void 0, void 0, function* () {
130
- return yield this.api.get(`${BASE_MOVIE}/${id}/recommendations`, options);
131
- });
102
+ async recommendations(id, options) {
103
+ return await this.api.get(`${BASE_MOVIE}/${id}/recommendations`, options);
132
104
  }
133
105
  /**
134
106
  * Retrieves release dates of a specific movie asynchronously.
135
107
  * @param {number} id - The ID of the movie.
136
108
  * @returns {Promise<ReleaseDates>} A Promise that resolves with the release dates of the movie.
137
109
  */
138
- releaseDates(id) {
139
- return __awaiter(this, void 0, void 0, function* () {
140
- return yield this.api.get(`${BASE_MOVIE}/${id}/release_dates`);
141
- });
110
+ async releaseDates(id) {
111
+ return await this.api.get(`${BASE_MOVIE}/${id}/release_dates`);
142
112
  }
143
113
  /**
144
114
  * Retrieves reviews for a specific movie asynchronously.
@@ -146,10 +116,8 @@ class MoviesEndpoint extends _types_1.BaseEndpoint {
146
116
  * @param {LanguageOption & PageOption} [options] - Optional parameters for specifying language and pagination options.
147
117
  * @returns {Promise<Reviews>} A Promise that resolves with the reviews for the movie.
148
118
  */
149
- reviews(id, options) {
150
- return __awaiter(this, void 0, void 0, function* () {
151
- return yield this.api.get(`${BASE_MOVIE}/${id}/reviews`, options);
152
- });
119
+ async reviews(id, options) {
120
+ return await this.api.get(`${BASE_MOVIE}/${id}/reviews`, options);
153
121
  }
154
122
  /**
155
123
  * Retrieves similar movies for a specific movie asynchronously.
@@ -157,20 +125,16 @@ class MoviesEndpoint extends _types_1.BaseEndpoint {
157
125
  * @param {LanguageOption & PageOption} [options] - Optional parameters for specifying language and pagination options.
158
126
  * @returns {Promise<SimilarMovies>} A Promise that resolves with the similar movies for the movie.
159
127
  */
160
- similar(id, options) {
161
- return __awaiter(this, void 0, void 0, function* () {
162
- return yield this.api.get(`${BASE_MOVIE}/${id}/similar`, options);
163
- });
128
+ async similar(id, options) {
129
+ return await this.api.get(`${BASE_MOVIE}/${id}/similar`, options);
164
130
  }
165
131
  /**
166
132
  * Retrieves translations of a specific movie asynchronously.
167
133
  * @param {number} id - The ID of the movie.
168
134
  * @returns {Promise<Translations>} A Promise that resolves with the translations of the movie.
169
135
  */
170
- translations(id) {
171
- return __awaiter(this, void 0, void 0, function* () {
172
- return yield this.api.get(`${BASE_MOVIE}/${id}/translations`);
173
- });
136
+ async translations(id) {
137
+ return await this.api.get(`${BASE_MOVIE}/${id}/translations`);
174
138
  }
175
139
  /**
176
140
  * Retrieves videos of a specific movie asynchronously.
@@ -178,69 +142,55 @@ class MoviesEndpoint extends _types_1.BaseEndpoint {
178
142
  * @param {LanguageOption} [options] - Optional parameters for specifying the language.
179
143
  * @returns {Promise<Videos>} A Promise that resolves with the videos of the movie.
180
144
  */
181
- videos(id, options) {
182
- return __awaiter(this, void 0, void 0, function* () {
183
- return yield this.api.get(`${BASE_MOVIE}/${id}/videos`, options);
184
- });
145
+ async videos(id, options) {
146
+ return await this.api.get(`${BASE_MOVIE}/${id}/videos`, options);
185
147
  }
186
148
  /**
187
149
  * Retrieves watch providers of a specific movie asynchronously.
188
150
  * @param {number} id - The ID of the movie.
189
151
  * @returns {Promise<WatchProviders>} A Promise that resolves with the watch providers of the movie.
190
152
  */
191
- watchProviders(id) {
192
- return __awaiter(this, void 0, void 0, function* () {
193
- return yield this.api.get(`${BASE_MOVIE}/${id}/watch/providers`);
194
- });
153
+ async watchProviders(id) {
154
+ return await this.api.get(`${BASE_MOVIE}/${id}/watch/providers`);
195
155
  }
196
156
  /**
197
157
  * Retrieves details of the latest movie asynchronously.
198
158
  * @returns {Promise<LatestMovie>} A Promise that resolves with the details of the latest movie.
199
159
  */
200
- latest() {
201
- return __awaiter(this, void 0, void 0, function* () {
202
- return yield this.api.get(`${BASE_MOVIE}/latest`);
203
- });
160
+ async latest() {
161
+ return await this.api.get(`${BASE_MOVIE}/latest`);
204
162
  }
205
163
  /**
206
164
  * Retrieves movies playing now asynchronously.
207
165
  * @param {PageOption & LanguageOption & RegionOption} [options] - Optional parameters for specifying language, region, and pagination options.
208
166
  * @returns {Promise<MoviesPlayingNow>} A Promise that resolves with the movies playing now.
209
167
  */
210
- nowPlaying(options) {
211
- return __awaiter(this, void 0, void 0, function* () {
212
- return yield this.api.get(`${BASE_MOVIE}/now_playing`, options);
213
- });
168
+ async nowPlaying(options) {
169
+ return await this.api.get(`${BASE_MOVIE}/now_playing`, options);
214
170
  }
215
171
  /**
216
172
  * Retrieves popular movies asynchronously.
217
173
  * @param {LanguageOption & PageOption} [options] - Optional parameters for specifying language and pagination options.
218
174
  * @returns {Promise<PopularMovies>} A Promise that resolves with the popular movies.
219
175
  */
220
- popular(options) {
221
- return __awaiter(this, void 0, void 0, function* () {
222
- return yield this.api.get(`${BASE_MOVIE}/popular`, options);
223
- });
176
+ async popular(options) {
177
+ return await this.api.get(`${BASE_MOVIE}/popular`, options);
224
178
  }
225
179
  /**
226
180
  * Retrieves top rated movies asynchronously.
227
181
  * @param {PageOption & LanguageOption & RegionOption} [options] - Optional parameters for specifying language, region, and pagination options.
228
182
  * @returns {Promise<TopRatedMovies>} A Promise that resolves with the top rated movies.
229
183
  */
230
- topRated(options) {
231
- return __awaiter(this, void 0, void 0, function* () {
232
- return yield this.api.get(`${BASE_MOVIE}/top_rated`, options);
233
- });
184
+ async topRated(options) {
185
+ return await this.api.get(`${BASE_MOVIE}/top_rated`, options);
234
186
  }
235
187
  /**
236
188
  * Retrieves upcoming movies asynchronously.
237
189
  * @param {PageOption & LanguageOption & RegionOption} [options] - Optional parameters for specifying language, region, and pagination options.
238
190
  * @returns {Promise<UpcomingMovies>} A Promise that resolves with the upcoming movies.
239
191
  */
240
- upcoming(options) {
241
- return __awaiter(this, void 0, void 0, function* () {
242
- return yield this.api.get(`${BASE_MOVIE}/upcoming`, options);
243
- });
192
+ async upcoming(options) {
193
+ return await this.api.get(`${BASE_MOVIE}/upcoming`, options);
244
194
  }
245
195
  }
246
196
  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 __awaiter(this, void 0, void 0, function* () {
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 __awaiter(this, void 0, void 0, function* () {
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 __awaiter(this, void 0, void 0, function* () {
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;