@lorenzopant/tmdb 1.17.2 → 1.17.3

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.d.ts CHANGED
@@ -25,9 +25,9 @@ type ChangeItem = {
25
25
  /** Timestamp of when the change occurred (ISO 8601 format) */
26
26
  time: string;
27
27
  /** ISO 639-1 language code associated with the change */
28
- iso_639_1?: string | null;
28
+ iso_639_1?: string;
29
29
  /** ISO 3166-1 country code associated with the change */
30
- iso_3166_1?: string | null;
30
+ iso_3166_1?: string;
31
31
  /** The changed data object (structure varies by change type) */
32
32
  value: object | string;
33
33
  /** The original data object (structure varies by change type) */
@@ -132,7 +132,7 @@ type GenresResponse = {
132
132
  */
133
133
  type ProductionCompany = {
134
134
  id: number;
135
- logo_path: string | null;
135
+ logo_path?: string;
136
136
  name: string;
137
137
  origin_country: string;
138
138
  };
@@ -157,21 +157,21 @@ type SpokenLanguage = {
157
157
  type MovieCollection = {
158
158
  id: number;
159
159
  name: string;
160
- poster_path?: string | null;
161
- backdrop_path?: string | null;
160
+ poster_path?: string;
161
+ backdrop_path?: string;
162
162
  };
163
163
  /**
164
164
  * Represents common class for cast and crew types
165
165
  */
166
166
  type Credit = {
167
167
  adult: boolean;
168
- gender: number | null;
168
+ gender?: number;
169
169
  id: number;
170
170
  known_for_department: string;
171
171
  name: string;
172
172
  original_name: string;
173
173
  popularity: number;
174
- profile_path?: string | null;
174
+ profile_path?: string;
175
175
  credit_id: string;
176
176
  };
177
177
  /**
@@ -272,11 +272,11 @@ type WatchMonetizationType = "flatrate" | "free" | "ads" | "rent" | "buy";
272
272
  */
273
273
  type BaseKnownForItem = {
274
274
  adult: boolean;
275
- backdrop_path: string | null;
275
+ backdrop_path?: string;
276
276
  id: number;
277
277
  original_language: string;
278
278
  overview: string;
279
- poster_path: string | null;
279
+ poster_path?: string;
280
280
  genre_ids: number[];
281
281
  popularity: number;
282
282
  vote_average: number;
@@ -446,7 +446,7 @@ type ImageItem = {
446
446
  /** Image height in pixels */
447
447
  height: number;
448
448
  /** ISO 639-1 language code if image contains text, null otherwise */
449
- iso_639_1?: string | null;
449
+ iso_639_1?: string;
450
450
  /** Relative path to the image file (append to base URL) */
451
451
  file_path: string;
452
452
  /** Average user rating for this image */
@@ -1459,7 +1459,7 @@ declare enum DiscoverTVType {
1459
1459
  * A TV result item as returned by discover endpoints.
1460
1460
  */
1461
1461
  type DiscoverTVResultItem = {
1462
- backdrop_path: string | null;
1462
+ backdrop_path?: string;
1463
1463
  first_air_date: string;
1464
1464
  genre_ids: number[];
1465
1465
  id: number;
@@ -1469,7 +1469,7 @@ type DiscoverTVResultItem = {
1469
1469
  original_name: string;
1470
1470
  overview: string;
1471
1471
  popularity: number;
1472
- poster_path: string | null;
1472
+ poster_path?: string;
1473
1473
  vote_average: number;
1474
1474
  vote_count: number;
1475
1475
  };
@@ -1565,7 +1565,7 @@ type CollectionResultItem = {
1565
1565
  /** Collection overview/description */
1566
1566
  overview: string;
1567
1567
  /** Path to poster image */
1568
- poster_path?: string | null;
1568
+ poster_path?: string;
1569
1569
  };
1570
1570
  /**
1571
1571
  * Company information in search results
@@ -1574,7 +1574,7 @@ type CompanyResultItem = {
1574
1574
  /** Unique company identifier */
1575
1575
  id: number;
1576
1576
  /** Path to company logo image */
1577
- logo_path?: string | null;
1577
+ logo_path?: string;
1578
1578
  /** Company name */
1579
1579
  name: string;
1580
1580
  /** ISO 3166-1 country code of company's origin */
@@ -1603,7 +1603,7 @@ type PersonResultItem = {
1603
1603
  /** TMDB popularity score based on views, votes, and activity */
1604
1604
  popularity: number;
1605
1605
  /** Path to person's profile image */
1606
- profile_path?: string | null;
1606
+ profile_path?: string;
1607
1607
  /** List of notable movies or TV shows the person is known for */
1608
1608
  known_for: KnownForItem[];
1609
1609
  };
@@ -1616,7 +1616,7 @@ type PersonResultItem = {
1616
1616
  */
1617
1617
  type TVSeriesResultItem = {
1618
1618
  /** Relative path to the backdrop image for the series (nullable on some responses). */
1619
- backdrop_path?: string | null;
1619
+ backdrop_path?: string;
1620
1620
  /** First air date of the series (YYYY-MM-DD). */
1621
1621
  first_air_date: string;
1622
1622
  /** Array of genre ids associated with the series. */
@@ -1634,7 +1634,7 @@ type TVSeriesResultItem = {
1634
1634
  /** Popularity score as returned by TMDB. */
1635
1635
  popularity: number;
1636
1636
  /** Relative path to the poster image for the series (nullable on some responses). */
1637
- poster_path?: string | null;
1637
+ poster_path?: string;
1638
1638
  /** Average vote score for the series. */
1639
1639
  vote_average: number;
1640
1640
  /** Total number of votes the series has received. */
@@ -1647,7 +1647,7 @@ type TVSeriesResultItem = {
1647
1647
  */
1648
1648
  type MovieResultItem = {
1649
1649
  /** Path to backdrop image */
1650
- backdrop_path?: string | null;
1650
+ backdrop_path?: string;
1651
1651
  /** Unique movie identifier */
1652
1652
  id: number;
1653
1653
  /** Movie title (localized) */
@@ -1657,7 +1657,7 @@ type MovieResultItem = {
1657
1657
  /** Plot synopsis/overview */
1658
1658
  overview: string;
1659
1659
  /** Path to poster image */
1660
- poster_path?: string | null;
1660
+ poster_path?: string;
1661
1661
  /** Whether the movie is marked as adult content */
1662
1662
  adult: boolean;
1663
1663
  /** Original language of the movie (ISO 639-1 code) */
@@ -1804,19 +1804,19 @@ type MovieDetails = {
1804
1804
  /** Whether the movie is marked as adult content */
1805
1805
  adult: boolean;
1806
1806
  /** Path to backdrop image, null if not available */
1807
- backdrop_path: string | null;
1807
+ backdrop_path?: string;
1808
1808
  /** Collection the movie belongs to (e.g., "The Lord of the Rings Collection"), null if standalone */
1809
- belongs_to_collection: MovieCollection | null;
1809
+ belongs_to_collection?: MovieCollection;
1810
1810
  /** Production budget in US dollars */
1811
1811
  budget: number;
1812
1812
  /** Array of genres associated with the movie */
1813
1813
  genres: Genre[];
1814
1814
  /** Official homepage URL, null if not available */
1815
- homepage: string | null;
1815
+ homepage?: string;
1816
1816
  /** Unique movie identifier in TMDB */
1817
1817
  id: number;
1818
1818
  /** IMDb identifier (e.g., "tt0133093"), null if not linked */
1819
- imdb_id: string | null;
1819
+ imdb_id?: string;
1820
1820
  /** Array of origin country codes (ISO 3166-1) */
1821
1821
  origin_country: string[];
1822
1822
  /** Original language of the movie (ISO 639-1 code) */
@@ -1824,11 +1824,11 @@ type MovieDetails = {
1824
1824
  /** Original title in the original language */
1825
1825
  original_title: string;
1826
1826
  /** Plot synopsis/overview, null if not available */
1827
- overview: string | null;
1827
+ overview?: string;
1828
1828
  /** Popularity score calculated by TMDB */
1829
1829
  popularity: number;
1830
1830
  /** Path to poster image, null if not available */
1831
- poster_path: string | null;
1831
+ poster_path?: string;
1832
1832
  /** Array of companies that produced the movie */
1833
1833
  production_companies: ProductionCompany[];
1834
1834
  /** Array of countries where the movie was produced */
@@ -1838,13 +1838,13 @@ type MovieDetails = {
1838
1838
  /** Box office revenue in US dollars */
1839
1839
  revenue: number;
1840
1840
  /** Runtime in minutes, null if not set */
1841
- runtime: number | null;
1841
+ runtime?: number;
1842
1842
  /** Array of languages spoken in the movie */
1843
1843
  spoken_languages: SpokenLanguage[];
1844
1844
  /** Release status (e.g., "Released", "Post Production", "In Production") */
1845
1845
  status: string;
1846
1846
  /** Movie tagline/slogan, null if not available */
1847
- tagline: string | null;
1847
+ tagline?: string;
1848
1848
  /** Movie title (localized if language parameter was provided) */
1849
1849
  title: string;
1850
1850
  /** Whether a video is available on TMDB */
@@ -1917,13 +1917,13 @@ type MovieExternalIDs = {
1917
1917
  /** Movie identifier in TMDB */
1918
1918
  id: number;
1919
1919
  /** IMDb identifier (e.g., "tt0133093"), null if not available */
1920
- imdb_id?: string | null;
1920
+ imdb_id?: string;
1921
1921
  /** Facebook page identifier, null if not available */
1922
- facebook_id?: string | null;
1922
+ facebook_id?: string;
1923
1923
  /** Twitter/X handle, null if not available */
1924
- twitter_id?: string | null;
1924
+ twitter_id?: string;
1925
1925
  /** Instagram handle, null if not available */
1926
- instagram_id?: string | null;
1926
+ instagram_id?: string;
1927
1927
  };
1928
1928
  /**
1929
1929
  * Collection of movie images (backdrops, logos, posters)
@@ -2126,9 +2126,9 @@ type NetworkImages = ImagesResult<OrganizationImage, "logos">;
2126
2126
  */
2127
2127
  type Network = NetworkItem & {
2128
2128
  /** The city or location of the network's headquarters, if available. */
2129
- headquarters?: string | null;
2129
+ headquarters?: string;
2130
2130
  /** The URL of the network's official homepage, if available. */
2131
- homepage?: string | null;
2131
+ homepage?: string;
2132
2132
  };
2133
2133
  /**
2134
2134
  * Base parameters required by all network endpoints.
@@ -2145,7 +2145,7 @@ type NetworkBaseParams = {
2145
2145
  */
2146
2146
  type TVSeriesDetails = {
2147
2147
  /** The path to the backdrop image, or null if not available */
2148
- backdrop_path: string | null;
2148
+ backdrop_path?: string;
2149
2149
  /** Array of creators who developed the TV show */
2150
2150
  created_by: Pick<Credit, "id" | "credit_id" | "gender" | "name" | "profile_path">[];
2151
2151
  /** Array of typical episode runtimes in minutes */
@@ -2155,7 +2155,7 @@ type TVSeriesDetails = {
2155
2155
  /** Array of genres associated with the TV show */
2156
2156
  genres: Genre[];
2157
2157
  /** The official homepage URL for the TV show, or null if not available */
2158
- homepage: string | null;
2158
+ homepage?: string;
2159
2159
  /** The unique identifier for the TV show */
2160
2160
  id: number;
2161
2161
  /** Indicates whether the TV show is currently in production */
@@ -2165,7 +2165,7 @@ type TVSeriesDetails = {
2165
2165
  /** The date the most recent episode aired */
2166
2166
  last_air_date: string;
2167
2167
  /** Details of the last episode that aired, if available */
2168
- last_episode_to_air?: TVEpisodeItem | null;
2168
+ last_episode_to_air?: TVEpisodeItem;
2169
2169
  /** The title of the TV show */
2170
2170
  name: string;
2171
2171
  /** Details of the next episode to air, if available */
@@ -2183,11 +2183,11 @@ type TVSeriesDetails = {
2183
2183
  /** The original title of the TV show */
2184
2184
  original_name: string;
2185
2185
  /** A brief description or summary of the TV show, or null if not available */
2186
- overview: string | null;
2186
+ overview?: string;
2187
2187
  /** The popularity score of the TV show */
2188
2188
  popularity: number;
2189
2189
  /** The path to the poster image, or null if not available */
2190
- poster_path: string | null;
2190
+ poster_path?: string;
2191
2191
  /** Array of companies that produced the TV show */
2192
2192
  production_companies?: ProductionCompany[];
2193
2193
  /** Array of countries where the TV show was produced */
@@ -2217,19 +2217,19 @@ type TVEpisodeItem = {
2217
2217
  /** The total number of votes received for the episode */
2218
2218
  vote_count: number;
2219
2219
  /** The date the episode first aired */
2220
- air_date?: string | null;
2220
+ air_date?: string;
2221
2221
  /** The episode number within its season */
2222
2222
  episode_number: number;
2223
2223
  /** The production code used internally during filming */
2224
- production_code?: string | null;
2224
+ production_code?: string;
2225
2225
  /** The runtime of the episode in minutes */
2226
- runtime?: number | null;
2226
+ runtime?: number;
2227
2227
  /** The season number this episode belongs to */
2228
2228
  season_number: number;
2229
2229
  /** The unique identifier of the TV show this episode belongs to */
2230
2230
  show_id: number;
2231
2231
  /** The path to the episode's still image (screenshot) */
2232
- still_path?: string | null;
2232
+ still_path?: string;
2233
2233
  };
2234
2234
  type TVSeasonItem = {
2235
2235
  /** The date the season first aired, or null if not available */
@@ -2388,23 +2388,23 @@ type TVExternalIDs = {
2388
2388
  /** TV series identifier in TMDB */
2389
2389
  id: number;
2390
2390
  /** IMDb identifier (e.g., "tt0944947"), null if not available */
2391
- imdb_id?: string | null;
2391
+ imdb_id?: string;
2392
2392
  /** Freebase MID identifier (deprecated), null if not available */
2393
- freebase_mid?: string | null;
2393
+ freebase_mid?: string;
2394
2394
  /** Freebase ID (deprecated), null if not available */
2395
- freebase_id?: string | null;
2395
+ freebase_id?: string;
2396
2396
  /** TheTVDB identifier, null if not available */
2397
- tvdb_id?: number | null;
2397
+ tvdb_id?: number;
2398
2398
  /** TVRage identifier (service discontinued), null if not available */
2399
- tvrage_id?: number | null;
2399
+ tvrage_id?: number;
2400
2400
  /** Wikidata identifier (e.g., "Q23572"), null if not available */
2401
- wikidata_id?: string | null;
2401
+ wikidata_id?: string;
2402
2402
  /** Facebook page identifier, null if not available */
2403
- facebook_id?: string | null;
2403
+ facebook_id?: string;
2404
2404
  /** Instagram handle, null if not available */
2405
- instagram_id?: string | null;
2405
+ instagram_id?: string;
2406
2406
  /** Twitter/X handle, null if not available */
2407
- twitter_id?: string | null;
2407
+ twitter_id?: string;
2408
2408
  };
2409
2409
  /**
2410
2410
  * Images related to a TV show.
@@ -2614,7 +2614,7 @@ type TVSeasonEpisode = TVEpisodeItem & {
2614
2614
  */
2615
2615
  type TVSeason = {
2616
2616
  /** ISO 8601 date when the season first aired */
2617
- air_date?: string | null;
2617
+ air_date?: string;
2618
2618
  /** Array of episodes in this season */
2619
2619
  episodes: TVSeasonEpisode[];
2620
2620
  /** Unique TMDB identifier for the season */
@@ -2626,7 +2626,7 @@ type TVSeason = {
2626
2626
  /** Season overview/description */
2627
2627
  overview: string;
2628
2628
  /** Relative path to the season poster */
2629
- poster_path?: string | null;
2629
+ poster_path?: string;
2630
2630
  /** Season number within the TV show */
2631
2631
  season_number: number;
2632
2632
  /** Average user rating (0–10) */
@@ -2678,8 +2678,8 @@ type TVSeasonExternalIDs = Pick<TVExternalIDs, "id" | "freebase_mid" | "freebase
2678
2678
  type TVSeasonImages = ImagesResult<ImageItem, "posters">;
2679
2679
  /** Translation data for a TV season. */
2680
2680
  type TVSeasonTranslationData = {
2681
- name?: string | null;
2682
- overview?: string | null;
2681
+ name?: string;
2682
+ overview?: string;
2683
2683
  };
2684
2684
  /** Collection of all available translations for a TV season. */
2685
2685
  type TVSeasonTranslations = TranslationResults<TVSeasonTranslationData>;
@@ -2727,13 +2727,13 @@ type TVEpisode = {
2727
2727
  /** Unique TMDB identifier for this episode */
2728
2728
  id: number;
2729
2729
  /** Production code assigned by the production company, if available */
2730
- production_code?: string | null;
2730
+ production_code?: string;
2731
2731
  /** Runtime of the episode in minutes */
2732
2732
  runtime: number;
2733
2733
  /** Season number this episode belongs to (1-based) */
2734
2734
  season_number: number;
2735
2735
  /** Relative path to the episode still/image (e.g. `"/abc123.jpg"`), or null if none */
2736
- still_path?: string | null;
2736
+ still_path?: string;
2737
2737
  /** Average user rating of the episode (0-10 scale) */
2738
2738
  vote_average: number;
2739
2739
  /** Total number of user votes for the episode */
@@ -2771,8 +2771,8 @@ type TVEpisodeExternalIDs = Omit<TVExternalIDs, "facebook_id" | "instagram_id" |
2771
2771
  type TVEpisodeImages = ImagesResult<ImageItem, "stills">;
2772
2772
  type TVEpisodeTranslations = TranslationResults<TVEpisodeTranslationData>;
2773
2773
  type TVEpisodeTranslationData = {
2774
- name?: string | null;
2775
- overview?: string | null;
2774
+ name?: string;
2775
+ overview?: string;
2776
2776
  };
2777
2777
  type TVEpisodeVideos = VideoResults;
2778
2778
  /**
@@ -2817,7 +2817,7 @@ type Collection = {
2817
2817
  /** Short description or synopsis of the collection */
2818
2818
  overview: string;
2819
2819
  /** Relative path to the collection's poster image on TMDB, if available (sanitized nulls become undefined) */
2820
- poster_path?: string | null;
2820
+ poster_path?: string;
2821
2821
  /** Relative path to the collection's backdrop image on TMDB, if available (sanitized nulls become undefined) */
2822
2822
  backdrop_path?: string | null;
2823
2823
  /** Ordered list of media items that make up the collection */
@@ -2877,7 +2877,7 @@ type CompanySummary = {
2877
2877
  /** Unique company identifier */
2878
2878
  id: number;
2879
2879
  /** Relative path to the company logo */
2880
- logo_path?: string | null;
2880
+ logo_path?: string;
2881
2881
  /** Company display name */
2882
2882
  name: string;
2883
2883
  };
@@ -2892,9 +2892,9 @@ type Company = CompanySummary & {
2892
2892
  /** Company headquarters location */
2893
2893
  headquarters: string;
2894
2894
  /** Official company homepage */
2895
- homepage: string | null;
2895
+ homepage?: string;
2896
2896
  /** Parent company, if TMDB links one */
2897
- parent_company?: CompanySummary | null;
2897
+ parent_company?: CompanySummary;
2898
2898
  };
2899
2899
  /**
2900
2900
  * A single alternative company name entry.
@@ -2961,9 +2961,9 @@ type TVEpisodeGroupDetailsItem = {
2961
2961
  */
2962
2962
  type TVEpisodeGroupEpisode = Omit<TVEpisode, "guest_stars" | "runtime"> & {
2963
2963
  /** Production code for the episode, if available */
2964
- production_code?: string | null;
2964
+ production_code?: string;
2965
2965
  /** Path to the episode still image, if available */
2966
- still_path?: string | null;
2966
+ still_path?: string;
2967
2967
  };
2968
2968
  /**
2969
2969
  * Supported episode group type identifiers.
@@ -2998,11 +2998,11 @@ type FindByIDParams = {
2998
2998
  };
2999
2999
  type FindMediaResultBase = {
3000
3000
  adult: boolean;
3001
- backdrop_path: string | null;
3001
+ backdrop_path?: string;
3002
3002
  id: number;
3003
3003
  original_language: string;
3004
3004
  overview: string;
3005
- poster_path: string | null;
3005
+ poster_path?: string;
3006
3006
  popularity: number;
3007
3007
  vote_average: number;
3008
3008
  vote_count: number;
@@ -3022,14 +3022,14 @@ type FindMovieResultItem = FindMediaResultBase & {
3022
3022
  */
3023
3023
  type FindPersonResultItem = {
3024
3024
  adult: boolean;
3025
- gender: number | null;
3025
+ gender?: number;
3026
3026
  id: number;
3027
3027
  known_for_department: string;
3028
3028
  media_type: "person";
3029
3029
  name: string;
3030
3030
  original_name: string;
3031
3031
  popularity: number;
3032
- profile_path: string | null;
3032
+ profile_path?: string;
3033
3033
  };
3034
3034
  /**
3035
3035
  * TV series item returned inside `tv_results`.
@@ -3054,7 +3054,7 @@ type FindTVEpisodeResultItem = {
3054
3054
  production_code: string;
3055
3055
  season_number: number;
3056
3056
  show_id: number;
3057
- still_path: string | null;
3057
+ still_path?: string;
3058
3058
  vote_average: number;
3059
3059
  vote_count: number;
3060
3060
  };
@@ -3068,7 +3068,7 @@ type FindTVSeasonResultItem = {
3068
3068
  media_type: "tv_season";
3069
3069
  name: string;
3070
3070
  overview: string;
3071
- poster_path: string | null;
3071
+ poster_path?: string;
3072
3072
  season_number: number;
3073
3073
  };
3074
3074
  /**
@@ -3148,7 +3148,7 @@ type CreditDetailsMediaBase = {
3148
3148
  /** Indicates whether the title is marked for adult content. */
3149
3149
  adult: boolean;
3150
3150
  /** Relative path to the backdrop image, if available. */
3151
- backdrop_path?: string | null;
3151
+ backdrop_path?: string;
3152
3152
  /** Character name when the credit belongs to cast. */
3153
3153
  character?: string;
3154
3154
  /** Genre identifiers attached to the media item. */
@@ -3160,7 +3160,7 @@ type CreditDetailsMediaBase = {
3160
3160
  /** Plot summary. */
3161
3161
  overview: string;
3162
3162
  /** Relative path to the poster image, if available. */
3163
- poster_path?: string | null;
3163
+ poster_path?: string;
3164
3164
  /** Popularity score. */
3165
3165
  popularity: number;
3166
3166
  /** Average vote score. */
@@ -3190,7 +3190,7 @@ type CreditDetailsTVEpisode = {
3190
3190
  /** Indicates whether the episode is marked for adult content. */
3191
3191
  adult: boolean;
3192
3192
  /** Episode air date in ISO 8601 format, if available. */
3193
- air_date?: string | null;
3193
+ air_date?: string;
3194
3194
  /** Episode number within the season. */
3195
3195
  episode_number: number;
3196
3196
  /** Episode type reported by TMDB. */
@@ -3204,11 +3204,11 @@ type CreditDetailsTVEpisode = {
3204
3204
  /** Production code if available. */
3205
3205
  production_code: string;
3206
3206
  /** Runtime in minutes, if available. */
3207
- runtime?: number | null;
3207
+ runtime?: number;
3208
3208
  /** Season number for the episode. */
3209
3209
  season_number: number;
3210
3210
  /** Episode still image path, if available. */
3211
- still_path?: string | null;
3211
+ still_path?: string;
3212
3212
  /** Average vote score. */
3213
3213
  vote_average: number;
3214
3214
  /** Total vote count. */
@@ -3219,7 +3219,7 @@ type CreditDetailsTVEpisode = {
3219
3219
  */
3220
3220
  type CreditDetailsTVSeason = {
3221
3221
  /** Season air date in ISO 8601 format, if available. */
3222
- air_date?: string | null;
3222
+ air_date?: string;
3223
3223
  /** Total number of episodes in the season. */
3224
3224
  episode_count: number;
3225
3225
  /** Unique season identifier. */
@@ -3229,7 +3229,7 @@ type CreditDetailsTVSeason = {
3229
3229
  /** Plot summary. */
3230
3230
  overview: string;
3231
3231
  /** Relative path to the season poster, if available. */
3232
- poster_path?: string | null;
3232
+ poster_path?: string;
3233
3233
  /** Season number within the series. */
3234
3234
  season_number: number;
3235
3235
  /** Average vote score. */
@@ -3541,6 +3541,11 @@ declare class ApiClient {
3541
3541
  * `{ language, page }` and `{ page, language }` produce the same key.
3542
3542
  */
3543
3543
  private buildRequestKey;
3544
+ /**
3545
+ * Serializes request params once so URL construction and deduplication keys stay aligned.
3546
+ * `undefined` values are intentionally skipped because they are not sent to TMDB.
3547
+ */
3548
+ private serializeParams;
3544
3549
  /**
3545
3550
  * Makes an authenticated GET request to the TMDB API, returning the parsed and
3546
3551
  * null-sanitised response.
@@ -5084,4 +5089,25 @@ declare class TMDBError extends Error {
5084
5089
 
5085
5090
  declare function isJwt(token: string): boolean;
5086
5091
 
5087
- export { type AlternativeName, type AlternativeNamesResult, type AlternativeTitle, BACKDROP_SIZES, type BackdropSize, type Cast, type CertificationItem, type Certifications, type Change, type ChangeItem, type ChangeResultItem, type Changes, type Collection, type CollectionBaseParam, type CollectionDetailsParams, type CollectionImages, type CollectionImagesParams, type CollectionItem, type CollectionResultItem, type CollectionTranslationData, type CollectionTranslations, type Company, type CompanyAlternativeName, type CompanyAlternativeNames, type CompanyAlternativeNamesParams, type CompanyBaseParam, type CompanyDetailsParams, type CompanyImages, type CompanyImagesParams, type CompanyResultItem, type CompanySummary, type ConfigurationCountriesParams, type ConfigurationCountry, type ConfigurationJob, type ConfigurationLanguage, type ConfigurationResponse, type ConfigurationTimezone, type ContentRating, type CountryISO3166_1, type Credit, type CreditBaseParam, type CreditDetails, type CreditDetailsMedia, type CreditDetailsMovieMedia, type CreditDetailsParams, type CreditDetailsPerson, type CreditDetailsTVEpisode, type CreditDetailsTVMedia, type CreditDetailsTVSeason, type Crew, type DateRange, type DefaultImageSizesConfig, type DiscoverFilterExpression, type DiscoverMovieParams, type DiscoverMovieSortBy, type DiscoverTVParams, type DiscoverTVResultItem, type DiscoverTVSortBy, DiscoverTVStatus, DiscoverTVType, type FileType, type FindByIDParams, type FindExternalSource, type FindMovieResultItem, type FindPersonResultItem, type FindResults, type FindTVEpisodeResultItem, type FindTVResultItem, type FindTVSeasonResultItem, type Genre, type GenresResponse, IMAGE_BASE_URL, IMAGE_SECURE_BASE_URL, type ImageCollectionKey, type ImageConfiguration, type ImageItem, type ImageSize, type ImageSizeTypes, type ImagesConfig, type ImagesResult, type Keyword, type KeywordBaseParam, type KeywordDetailsParams, type KeywordMoviesParams, type KeywordResultItem, type KnownForItem, type KnownForMovie, type KnownForTV, LOGO_SIZES, type Language, type LanguageISO6391, type LiteralUnion, type LogoSize, type MediaType, type MediaWatchProviders, type MovieAlternativeTitles, type MovieAlternativeTitlesParams, type MovieAppendToResponseNamespace, type MovieAppendableMap, type MovieChanges, type MovieChangesParams, type MovieCollection, type MovieCredits, type MovieCreditsParams, type MovieDetails, type MovieDetailsParams, type MovieDetailsWithAppends, type MovieExternalIDs, type MovieExternalIDsParams, type MovieImages, type MovieImagesParams, type MovieKeywords, type MovieKeywordsParams, type MovieListParams, type MovieRecommendations, type MovieRecommendationsParams, type MovieReleaseDate, type MovieReleaseDateResult, type MovieReleaseDates, type MovieReleaseDatesParams, type MovieResultItem, type MovieReviews, type MovieReviewsParams, type MovieSimilar, type MovieSimilarParams, type MovieTranslationData, type MovieTranslations, type MovieTranslationsParams, type MovieVideos, type MovieVideosParams, type MovieWatchProvidersParams, type MultiSearchResultItem, type Network, type NetworkBaseParams, type NetworkImages, type NetworkItem, type OrganizationImage, POSTER_SIZES, PROFILE_SIZES, type PaginatedResponse, type PeopleListParams, type PersonAppendToResponseNamespace, type PersonAppendableMap, type PersonBaseParam, type PersonChanges, type PersonChangesParams, type PersonCombinedCastCredit, type PersonCombinedCredits, type PersonCombinedCrewCredit, type PersonCreditsParams, type PersonDetails, type PersonDetailsParams, type PersonDetailsWithAppends, type PersonExternalIDs, type PersonExternalIDsParams, type PersonImages, type PersonImagesParams, type PersonMovieCastCredit, type PersonMovieCredits, type PersonMovieCrewCredit, type PersonResultItem, type PersonTVCastCredit, type PersonTVCredits, type PersonTVCrewCredit, type PersonTaggedImage, type PersonTaggedImageMedia, type PersonTaggedImages, type PersonTaggedImagesParams, type PersonTranslationData, type PersonTranslations, type PersonTranslationsParams, type PosterSize, type Prettify, type PrimaryTranslations, type ProductionCompany, type ProductionCountry, type ProfileSize, type Review, type ReviewAuthorDetails, type ReviewDetails, type ReviewDetailsParams, STILL_SIZES, type SearchCollectionsParams, type SearchCompanyParams, type SearchKeywordsParams, type SearchMoviesParams, type SearchMultiParams, type SearchPersonParams, type SearchTVSeriesParams, type SpokenLanguage, type StillSize, TMDB, TMDBCountries, TMDBError, TMDBLogger, type TMDBLoggerEntry, type TMDBLoggerFn, type TMDBOptions, type TMDBQueryParams, type TVAggregateCredits, type TVAggregateCreditsCastItem, type TVAggregateCreditsCrewItem, type TVAggregateCreditsParams, type TVAlternativeTitles, type TVAppendToResponseNamespace, type TVAppendableMap, type TVBaseParam, type TVChangeParams, type TVContentRatings, type TVCreditJob, type TVCreditRole, type TVCredits, type TVCreditsParams, type TVDetailsParams, type TVDetailsWithAppends, type TVEpisode, type TVEpisodeAppendToResponseNamespace, type TVEpisodeAppendableMap, type TVEpisodeBaseParams, type TVEpisodeCredits, type TVEpisodeCreditsParams, type TVEpisodeDetailsParams, type TVEpisodeDetailsWithAppends, type TVEpisodeExternalIDs, type TVEpisodeGroupDetails, type TVEpisodeGroupDetailsItem, type TVEpisodeGroupEpisode, type TVEpisodeGroupItem, type TVEpisodeGroupParams, TVEpisodeGroupType, type TVEpisodeGroups, type TVEpisodeId, type TVEpisodeImages, type TVEpisodeImagesParams, type TVEpisodeItem, type TVEpisodeTranslationData, type TVEpisodeTranslations, type TVEpisodeVideos, type TVExternalIDs, type TVImageItem, type TVImages, type TVImagesParams, type TVKeywords, type TVRecommendations, type TVRecommendationsParams, type TVReviews, type TVReviewsParams, type TVScreenedTheatrically, type TVScreeningItem, type TVSeason, type TVSeasonAggregateCredits, type TVSeasonAggregateCreditsParams, type TVSeasonAppendToResponseNamespace, type TVSeasonAppendableMap, type TVSeasonBaseParams, type TVSeasonChanges, type TVSeasonChangesParams, type TVSeasonCredits, type TVSeasonCreditsParams, type TVSeasonDetailsParams, type TVSeasonDetailsWithAppends, type TVSeasonEpisode, type TVSeasonExternalIDs, type TVSeasonId, type TVSeasonImages, type TVSeasonImagesParams, type TVSeasonItem, type TVSeasonTranslationData, type TVSeasonTranslations, type TVSeasonVideos, type TVSeasonVideosParams, type TVSeasonWatchProvidersParams, type TVSeriesChanges, type TVSeriesDetails, type TVSeriesListItem, type TVSeriesListParams, type TVSeriesLists, type TVSeriesListsParams, type TVSeriesResultItem, type TVSimilar, type TVSimilarParams, type TVTranslationData, type TVTranslations, type TVVideos, type Timezone, type Translation, type TranslationResults, type TrendingAllResult, type TrendingMovieResult, type TrendingParams, type TrendingPersonResult, type TrendingTVResult, type TrendingTimeWindow, type VideoItem, type VideoResults, type WatchMonetizationType, type WatchProvider, type WatchProviderDisplayPriorities, type WatchProviderItem, type WatchProviderListItem, type WatchProviderListParams, type WatchProviderListResponse, type WatchProviderRegionsParams, type WatchProviderRegionsResponse, type WithLanguage, type WithLanguagePage, type WithPage, type WithPageAndDateRange, type WithParams, type WithRegion, isJwt, isKnownForMovie, isKnownForTV };
5092
+ /** Utility type guard to check if an object has a poster_path property */
5093
+ declare function hasPosterPath(data: unknown): data is {
5094
+ poster_path: string;
5095
+ };
5096
+ /** Utility type guard to check if an object has a backdrop_path property */
5097
+ declare function hasBackdropPath(data: unknown): data is {
5098
+ backdrop_path: string;
5099
+ };
5100
+ /** Utility type guard to check if an object has a profile_path property */
5101
+ declare function hasProfilePath(data: unknown): data is {
5102
+ profile_path: string;
5103
+ };
5104
+ /** Utility type guard to check if an object has a still_path property */
5105
+ declare function hasStillPath(data: unknown): data is {
5106
+ still_path: string;
5107
+ };
5108
+ /** Utility type guard to check if an object has a logo_path property */
5109
+ declare function hasLogoPath(data: unknown): data is {
5110
+ logo_path: string;
5111
+ };
5112
+
5113
+ export { type AlternativeName, type AlternativeNamesResult, type AlternativeTitle, BACKDROP_SIZES, type BackdropSize, type Cast, type CertificationItem, type Certifications, type Change, type ChangeItem, type ChangeResultItem, type Changes, type Collection, type CollectionBaseParam, type CollectionDetailsParams, type CollectionImages, type CollectionImagesParams, type CollectionItem, type CollectionResultItem, type CollectionTranslationData, type CollectionTranslations, type Company, type CompanyAlternativeName, type CompanyAlternativeNames, type CompanyAlternativeNamesParams, type CompanyBaseParam, type CompanyDetailsParams, type CompanyImages, type CompanyImagesParams, type CompanyResultItem, type CompanySummary, type ConfigurationCountriesParams, type ConfigurationCountry, type ConfigurationJob, type ConfigurationLanguage, type ConfigurationResponse, type ConfigurationTimezone, type ContentRating, type CountryISO3166_1, type Credit, type CreditBaseParam, type CreditDetails, type CreditDetailsMedia, type CreditDetailsMovieMedia, type CreditDetailsParams, type CreditDetailsPerson, type CreditDetailsTVEpisode, type CreditDetailsTVMedia, type CreditDetailsTVSeason, type Crew, type DateRange, type DefaultImageSizesConfig, type DiscoverFilterExpression, type DiscoverMovieParams, type DiscoverMovieSortBy, type DiscoverTVParams, type DiscoverTVResultItem, type DiscoverTVSortBy, DiscoverTVStatus, DiscoverTVType, type FileType, type FindByIDParams, type FindExternalSource, type FindMovieResultItem, type FindPersonResultItem, type FindResults, type FindTVEpisodeResultItem, type FindTVResultItem, type FindTVSeasonResultItem, type Genre, type GenresResponse, IMAGE_BASE_URL, IMAGE_SECURE_BASE_URL, type ImageCollectionKey, type ImageConfiguration, type ImageItem, type ImageSize, type ImageSizeTypes, type ImagesConfig, type ImagesResult, type Keyword, type KeywordBaseParam, type KeywordDetailsParams, type KeywordMoviesParams, type KeywordResultItem, type KnownForItem, type KnownForMovie, type KnownForTV, LOGO_SIZES, type Language, type LanguageISO6391, type LiteralUnion, type LogoSize, type MediaType, type MediaWatchProviders, type MovieAlternativeTitles, type MovieAlternativeTitlesParams, type MovieAppendToResponseNamespace, type MovieAppendableMap, type MovieChanges, type MovieChangesParams, type MovieCollection, type MovieCredits, type MovieCreditsParams, type MovieDetails, type MovieDetailsParams, type MovieDetailsWithAppends, type MovieExternalIDs, type MovieExternalIDsParams, type MovieImages, type MovieImagesParams, type MovieKeywords, type MovieKeywordsParams, type MovieListParams, type MovieRecommendations, type MovieRecommendationsParams, type MovieReleaseDate, type MovieReleaseDateResult, type MovieReleaseDates, type MovieReleaseDatesParams, type MovieResultItem, type MovieReviews, type MovieReviewsParams, type MovieSimilar, type MovieSimilarParams, type MovieTranslationData, type MovieTranslations, type MovieTranslationsParams, type MovieVideos, type MovieVideosParams, type MovieWatchProvidersParams, type MultiSearchResultItem, type Network, type NetworkBaseParams, type NetworkImages, type NetworkItem, type OrganizationImage, POSTER_SIZES, PROFILE_SIZES, type PaginatedResponse, type PeopleListParams, type PersonAppendToResponseNamespace, type PersonAppendableMap, type PersonBaseParam, type PersonChanges, type PersonChangesParams, type PersonCombinedCastCredit, type PersonCombinedCredits, type PersonCombinedCrewCredit, type PersonCreditsParams, type PersonDetails, type PersonDetailsParams, type PersonDetailsWithAppends, type PersonExternalIDs, type PersonExternalIDsParams, type PersonImages, type PersonImagesParams, type PersonMovieCastCredit, type PersonMovieCredits, type PersonMovieCrewCredit, type PersonResultItem, type PersonTVCastCredit, type PersonTVCredits, type PersonTVCrewCredit, type PersonTaggedImage, type PersonTaggedImageMedia, type PersonTaggedImages, type PersonTaggedImagesParams, type PersonTranslationData, type PersonTranslations, type PersonTranslationsParams, type PosterSize, type Prettify, type PrimaryTranslations, type ProductionCompany, type ProductionCountry, type ProfileSize, type Review, type ReviewAuthorDetails, type ReviewDetails, type ReviewDetailsParams, STILL_SIZES, type SearchCollectionsParams, type SearchCompanyParams, type SearchKeywordsParams, type SearchMoviesParams, type SearchMultiParams, type SearchPersonParams, type SearchTVSeriesParams, type SpokenLanguage, type StillSize, TMDB, TMDBCountries, TMDBError, TMDBLogger, type TMDBLoggerEntry, type TMDBLoggerFn, type TMDBOptions, type TMDBQueryParams, type TVAggregateCredits, type TVAggregateCreditsCastItem, type TVAggregateCreditsCrewItem, type TVAggregateCreditsParams, type TVAlternativeTitles, type TVAppendToResponseNamespace, type TVAppendableMap, type TVBaseParam, type TVChangeParams, type TVContentRatings, type TVCreditJob, type TVCreditRole, type TVCredits, type TVCreditsParams, type TVDetailsParams, type TVDetailsWithAppends, type TVEpisode, type TVEpisodeAppendToResponseNamespace, type TVEpisodeAppendableMap, type TVEpisodeBaseParams, type TVEpisodeCredits, type TVEpisodeCreditsParams, type TVEpisodeDetailsParams, type TVEpisodeDetailsWithAppends, type TVEpisodeExternalIDs, type TVEpisodeGroupDetails, type TVEpisodeGroupDetailsItem, type TVEpisodeGroupEpisode, type TVEpisodeGroupItem, type TVEpisodeGroupParams, TVEpisodeGroupType, type TVEpisodeGroups, type TVEpisodeId, type TVEpisodeImages, type TVEpisodeImagesParams, type TVEpisodeItem, type TVEpisodeTranslationData, type TVEpisodeTranslations, type TVEpisodeVideos, type TVExternalIDs, type TVImageItem, type TVImages, type TVImagesParams, type TVKeywords, type TVRecommendations, type TVRecommendationsParams, type TVReviews, type TVReviewsParams, type TVScreenedTheatrically, type TVScreeningItem, type TVSeason, type TVSeasonAggregateCredits, type TVSeasonAggregateCreditsParams, type TVSeasonAppendToResponseNamespace, type TVSeasonAppendableMap, type TVSeasonBaseParams, type TVSeasonChanges, type TVSeasonChangesParams, type TVSeasonCredits, type TVSeasonCreditsParams, type TVSeasonDetailsParams, type TVSeasonDetailsWithAppends, type TVSeasonEpisode, type TVSeasonExternalIDs, type TVSeasonId, type TVSeasonImages, type TVSeasonImagesParams, type TVSeasonItem, type TVSeasonTranslationData, type TVSeasonTranslations, type TVSeasonVideos, type TVSeasonVideosParams, type TVSeasonWatchProvidersParams, type TVSeriesChanges, type TVSeriesDetails, type TVSeriesListItem, type TVSeriesListParams, type TVSeriesLists, type TVSeriesListsParams, type TVSeriesResultItem, type TVSimilar, type TVSimilarParams, type TVTranslationData, type TVTranslations, type TVVideos, type Timezone, type Translation, type TranslationResults, type TrendingAllResult, type TrendingMovieResult, type TrendingParams, type TrendingPersonResult, type TrendingTVResult, type TrendingTimeWindow, type VideoItem, type VideoResults, type WatchMonetizationType, type WatchProvider, type WatchProviderDisplayPriorities, type WatchProviderItem, type WatchProviderListItem, type WatchProviderListParams, type WatchProviderListResponse, type WatchProviderRegionsParams, type WatchProviderRegionsResponse, type WithLanguage, type WithLanguagePage, type WithPage, type WithPageAndDateRange, type WithParams, type WithRegion, hasBackdropPath, hasLogoPath, hasPosterPath, hasProfilePath, hasStillPath, isJwt, isKnownForMovie, isKnownForTV };
package/dist/index.js CHANGED
@@ -126,6 +126,23 @@ function isJwt(token) {
126
126
  return true;
127
127
  }
128
128
 
129
+ // src/utils/index.ts
130
+ function hasPosterPath(data) {
131
+ return typeof data === "object" && data !== null && "poster_path" in data && typeof data.poster_path === "string";
132
+ }
133
+ function hasBackdropPath(data) {
134
+ return typeof data === "object" && data !== null && "backdrop_path" in data && typeof data.backdrop_path === "string";
135
+ }
136
+ function hasProfilePath(data) {
137
+ return typeof data === "object" && data !== null && "profile_path" in data && typeof data.profile_path === "string";
138
+ }
139
+ function hasStillPath(data) {
140
+ return typeof data === "object" && data !== null && "still_path" in data && typeof data.still_path === "string";
141
+ }
142
+ function hasLogoPath(data) {
143
+ return typeof data === "object" && data !== null && "logo_path" in data && typeof data.logo_path === "string";
144
+ }
145
+
129
146
  // src/client.ts
130
147
  var ApiClient = class {
131
148
  accessToken;
@@ -152,9 +169,19 @@ var ApiClient = class {
152
169
  * `{ language, page }` and `{ page, language }` produce the same key.
153
170
  */
154
171
  buildRequestKey(endpoint, params) {
155
- const definedEntries = Object.entries(params).filter(([, v]) => v !== void 0).sort(([a], [b]) => a.localeCompare(b)).map(([k, v]) => `${k}=${String(v)}`);
172
+ const definedEntries = this.serializeParams(params).sort(([a], [b]) => a.localeCompare(b)).map(([key, value]) => `${key}=${value}`);
156
173
  return definedEntries.length > 0 ? `${endpoint}?${definedEntries.join("&")}` : endpoint;
157
174
  }
175
+ /**
176
+ * Serializes request params once so URL construction and deduplication keys stay aligned.
177
+ * `undefined` values are intentionally skipped because they are not sent to TMDB.
178
+ */
179
+ serializeParams(params) {
180
+ return Object.entries(params).flatMap(([key, value]) => {
181
+ if (value === void 0) return [];
182
+ return [[key, String(value)]];
183
+ });
184
+ }
158
185
  /**
159
186
  * Makes an authenticated GET request to the TMDB API, returning the parsed and
160
187
  * null-sanitised response.
@@ -185,9 +212,8 @@ var ApiClient = class {
185
212
  async doRequest(endpoint, params) {
186
213
  const url = new URL(`${this.baseUrl}${endpoint}`);
187
214
  const jwt = isJwt(this.accessToken);
188
- for (const [key, value] of Object.entries(params)) {
189
- if (value === void 0) continue;
190
- url.searchParams.append(key, String(value));
215
+ for (const [key, value] of this.serializeParams(params)) {
216
+ url.searchParams.append(key, value);
191
217
  }
192
218
  if (!jwt) {
193
219
  url.searchParams.append("api_key", this.accessToken);
@@ -554,7 +580,7 @@ var CompaniesAPI = class extends TMDBAPIBase {
554
580
  */
555
581
  async details(params) {
556
582
  const endpoint = this.companyPath(params.company_id);
557
- return this.client.request(endpoint, params);
583
+ return this.client.request(endpoint);
558
584
  }
559
585
  /**
560
586
  * Alternative names
@@ -567,7 +593,7 @@ var CompaniesAPI = class extends TMDBAPIBase {
567
593
  */
568
594
  async alternative_names(params) {
569
595
  const endpoint = `${this.companyPath(params.company_id)}${ENDPOINTS.COMPANIES.ALTERNATIVE_NAMES}`;
570
- return this.client.request(endpoint, params);
596
+ return this.client.request(endpoint);
571
597
  }
572
598
  /**
573
599
  * Images
@@ -581,9 +607,9 @@ var CompaniesAPI = class extends TMDBAPIBase {
581
607
  * @reference https://developer.themoviedb.org/reference/company-images
582
608
  */
583
609
  async images(params) {
584
- const endpoint = `${this.companyPath(params.company_id)}${ENDPOINTS.COMPANIES.IMAGES}`;
585
- const requestParams = this.withLanguage(params) ?? params;
586
- return this.client.request(endpoint, requestParams);
610
+ const { company_id, ...rest } = params;
611
+ const endpoint = `${this.companyPath(company_id)}${ENDPOINTS.COMPANIES.IMAGES}`;
612
+ return this.client.request(endpoint, this.withLanguage(rest));
587
613
  }
588
614
  };
589
615
 
@@ -603,9 +629,9 @@ var CreditsAPI = class extends TMDBAPIBase {
603
629
  * @reference https://developer.themoviedb.org/reference/credit-details
604
630
  */
605
631
  async details(params) {
606
- const endpoint = this.creditPath(params.credit_id);
607
- const requestParams = this.withLanguage(params) ?? params;
608
- return this.client.request(endpoint, requestParams);
632
+ const { credit_id, ...rest } = params;
633
+ const endpoint = this.creditPath(credit_id);
634
+ return this.client.request(endpoint, this.withLanguage(rest));
609
635
  }
610
636
  };
611
637
 
@@ -625,9 +651,9 @@ var CollectionsAPI = class extends TMDBAPIBase {
625
651
  * @reference https://developer.themoviedb.org/reference/collection-details
626
652
  */
627
653
  async details(params) {
628
- const { language = this.defaultOptions.language, ...rest } = params;
629
- const endpoint = this.collectionPath(params.collection_id);
630
- return this.client.request(endpoint, { language, ...rest });
654
+ const { language = this.defaultOptions.language, collection_id } = params;
655
+ const endpoint = this.collectionPath(collection_id);
656
+ return this.client.request(endpoint, { language });
631
657
  }
632
658
  /**
633
659
  * Images
@@ -642,9 +668,9 @@ var CollectionsAPI = class extends TMDBAPIBase {
642
668
  * @reference https://developer.themoviedb.org/reference/collection-images
643
669
  */
644
670
  async images(params) {
645
- const endpoint = `${this.collectionPath(params.collection_id)}${ENDPOINTS.COLLECTIONS.IMAGES}`;
646
- const requestParams = this.withLanguage(params) ?? params;
647
- return this.client.request(endpoint, requestParams);
671
+ const { collection_id, ...rest } = params;
672
+ const endpoint = `${this.collectionPath(collection_id)}${ENDPOINTS.COLLECTIONS.IMAGES}`;
673
+ return this.client.request(endpoint, this.withLanguage(rest));
648
674
  }
649
675
  /**
650
676
  * Translations
@@ -657,7 +683,7 @@ var CollectionsAPI = class extends TMDBAPIBase {
657
683
  */
658
684
  async translations(params) {
659
685
  const endpoint = `${this.collectionPath(params.collection_id)}${ENDPOINTS.COLLECTIONS.TRANSLATIONS}`;
660
- return this.client.request(endpoint, params);
686
+ return this.client.request(endpoint);
661
687
  }
662
688
  };
663
689
 
@@ -869,7 +895,7 @@ var KeywordsAPI = class extends TMDBAPIBase {
869
895
  */
870
896
  async details(params) {
871
897
  const endpoint = this.keywordPath(params.keyword_id);
872
- return this.client.request(endpoint, params);
898
+ return this.client.request(endpoint);
873
899
  }
874
900
  /**
875
901
  * Movies
@@ -885,8 +911,9 @@ var KeywordsAPI = class extends TMDBAPIBase {
885
911
  * @reference https://developer.themoviedb.org/reference/keyword-movies
886
912
  */
887
913
  async movies(params) {
888
- const endpoint = `${this.keywordPath(params.keyword_id)}${ENDPOINTS.KEYWORDS.MOVIES}`;
889
- const requestParams = this.withLanguage(params);
914
+ const { keyword_id, ...rest } = params;
915
+ const endpoint = `${this.keywordPath(keyword_id)}${ENDPOINTS.KEYWORDS.MOVIES}`;
916
+ const requestParams = this.withLanguage(rest);
890
917
  return this.client.request(endpoint, requestParams);
891
918
  }
892
919
  };
@@ -976,9 +1003,9 @@ var MoviesAPI = class extends TMDBAPIBase {
976
1003
  * @reference https://developer.themoviedb.org/reference/movie-details
977
1004
  */
978
1005
  async details(params) {
979
- const { language = this.defaultOptions.language, ...rest } = params;
980
- const endpoint = this.moviePath(params.movie_id);
981
- return this.client.request(endpoint, { language, ...rest });
1006
+ const { language = this.defaultOptions.language, movie_id, append_to_response } = params;
1007
+ const endpoint = this.moviePath(movie_id);
1008
+ return this.client.request(endpoint, { language, append_to_response });
982
1009
  }
983
1010
  /**
984
1011
  * Alternative Titles
@@ -991,8 +1018,9 @@ var MoviesAPI = class extends TMDBAPIBase {
991
1018
  * @reference https://developer.themoviedb.org/reference/movie-alternative-titles
992
1019
  */
993
1020
  async alternative_titles(params) {
994
- const endpoint = this.movieSubPath(params.movie_id, ENDPOINTS.MOVIES.ALTERNATIVE_TITLES);
995
- return this.client.request(endpoint, params);
1021
+ const { movie_id, ...rest } = params;
1022
+ const endpoint = this.movieSubPath(movie_id, ENDPOINTS.MOVIES.ALTERNATIVE_TITLES);
1023
+ return this.client.request(endpoint, rest);
996
1024
  }
997
1025
  /**
998
1026
  * Credits
@@ -1053,8 +1081,9 @@ var MoviesAPI = class extends TMDBAPIBase {
1053
1081
  * @reference https://developer.themoviedb.org/reference/movie-changes
1054
1082
  */
1055
1083
  async changes(params) {
1056
- const endpoint = this.movieSubPath(params.movie_id, ENDPOINTS.MOVIES.CHANGES);
1057
- return this.client.request(endpoint, params);
1084
+ const { movie_id, ...rest } = params;
1085
+ const endpoint = this.movieSubPath(movie_id, ENDPOINTS.MOVIES.CHANGES);
1086
+ return this.client.request(endpoint, rest);
1058
1087
  }
1059
1088
  /**
1060
1089
  * Images
@@ -1793,7 +1822,7 @@ var NetworksAPI = class extends TMDBAPIBase {
1793
1822
  */
1794
1823
  async details(params) {
1795
1824
  const endpoint = this.networkPath(params.network_id);
1796
- return this.client.request(endpoint, params);
1825
+ return this.client.request(endpoint);
1797
1826
  }
1798
1827
  /**
1799
1828
  * Alternative names
@@ -1806,7 +1835,7 @@ var NetworksAPI = class extends TMDBAPIBase {
1806
1835
  */
1807
1836
  async alternative_names(params) {
1808
1837
  const endpoint = `${this.networkPath(params.network_id)}${ENDPOINTS.NETWORKS.ALTERNATIVE_NAMES}`;
1809
- return this.client.request(endpoint, params);
1838
+ return this.client.request(endpoint);
1810
1839
  }
1811
1840
  /**
1812
1841
  * Images
@@ -1869,8 +1898,8 @@ var TVEpisodesAPI = class extends TMDBAPIBase {
1869
1898
  * @reference https://developer.themoviedb.org/reference/tv-episode-changes-by-id
1870
1899
  */
1871
1900
  async changes(params) {
1872
- const endpoint = `${ENDPOINTS.TV_SERIES.DETAILS}/${ENDPOINTS.TV_EPISODES.DETAILS}/${params.episode_id}/${ENDPOINTS.TV_EPISODES.CHANGES}`;
1873
- return this.client.request(endpoint, { ...params });
1901
+ const endpoint = `${ENDPOINTS.TV_SERIES.DETAILS}${ENDPOINTS.TV_EPISODES.DETAILS}/${params.episode_id}${ENDPOINTS.TV_EPISODES.CHANGES}`;
1902
+ return this.client.request(endpoint);
1874
1903
  }
1875
1904
  /**
1876
1905
  * Credits
@@ -2215,10 +2244,7 @@ var PeopleListsAPI = class extends TMDBAPIBase {
2215
2244
  * @reference https://developer.themoviedb.org/reference/person-popular-list
2216
2245
  */
2217
2246
  async popular(params = {}) {
2218
- return this.client.request(
2219
- ENDPOINTS.PEOPLE_LISTS.POPULAR,
2220
- this.withLanguage(params) ?? params
2221
- );
2247
+ return this.client.request(ENDPOINTS.PEOPLE_LISTS.POPULAR, this.withLanguage(params));
2222
2248
  }
2223
2249
  };
2224
2250
 
@@ -3718,4 +3744,4 @@ var TVEpisodeGroupType = /* @__PURE__ */ ((TVEpisodeGroupType2) => {
3718
3744
  return TVEpisodeGroupType2;
3719
3745
  })(TVEpisodeGroupType || {});
3720
3746
 
3721
- export { BACKDROP_SIZES, DiscoverTVStatus, DiscoverTVType, IMAGE_BASE_URL, IMAGE_SECURE_BASE_URL, LOGO_SIZES, POSTER_SIZES, PROFILE_SIZES, STILL_SIZES, TMDB, TMDBCountries, TMDBError, TMDBLogger, TVEpisodeGroupType, isJwt, isKnownForMovie, isKnownForTV };
3747
+ export { BACKDROP_SIZES, DiscoverTVStatus, DiscoverTVType, IMAGE_BASE_URL, IMAGE_SECURE_BASE_URL, LOGO_SIZES, POSTER_SIZES, PROFILE_SIZES, STILL_SIZES, TMDB, TMDBCountries, TMDBError, TMDBLogger, TVEpisodeGroupType, hasBackdropPath, hasLogoPath, hasPosterPath, hasProfilePath, hasStillPath, isJwt, isKnownForMovie, isKnownForTV };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lorenzopant/tmdb",
3
- "version": "1.17.2",
3
+ "version": "1.17.3",
4
4
  "type": "module",
5
5
  "description": "A completely type-safe The Movie Database (TMDB) API wrapper for typescript applications.",
6
6
  "main": "dist/index.js",