@lorenzopant/tmdb 1.17.1 → 1.17.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/dist/index.d.ts +5087 -4
  2. package/dist/index.js +3721 -5
  3. package/package.json +12 -5
  4. package/dist/client.d.ts +0 -51
  5. package/dist/client.js +0 -166
  6. package/dist/endpoints/base.d.ts +0 -22
  7. package/dist/endpoints/base.js +0 -32
  8. package/dist/endpoints/certifications.d.ts +0 -20
  9. package/dist/endpoints/certifications.js +0 -24
  10. package/dist/endpoints/changes.d.ts +0 -40
  11. package/dist/endpoints/changes.js +0 -46
  12. package/dist/endpoints/collections.d.ts +0 -39
  13. package/dist/endpoints/collections.js +0 -52
  14. package/dist/endpoints/companies.d.ts +0 -37
  15. package/dist/endpoints/companies.js +0 -49
  16. package/dist/endpoints/configuration.d.ts +0 -72
  17. package/dist/endpoints/configuration.js +0 -83
  18. package/dist/endpoints/credits.d.ts +0 -16
  19. package/dist/endpoints/credits.js +0 -22
  20. package/dist/endpoints/discover.d.ts +0 -36
  21. package/dist/endpoints/discover.js +0 -61
  22. package/dist/endpoints/find.d.ts +0 -16
  23. package/dist/endpoints/find.js +0 -21
  24. package/dist/endpoints/genres.d.ts +0 -25
  25. package/dist/endpoints/genres.js +0 -28
  26. package/dist/endpoints/keywords.d.ts +0 -29
  27. package/dist/endpoints/keywords.js +0 -38
  28. package/dist/endpoints/movie_lists.d.ts +0 -53
  29. package/dist/endpoints/movie_lists.js +0 -65
  30. package/dist/endpoints/movies.d.ts +0 -202
  31. package/dist/endpoints/movies.js +0 -255
  32. package/dist/endpoints/networks.d.ts +0 -36
  33. package/dist/endpoints/networks.js +0 -46
  34. package/dist/endpoints/people.d.ts +0 -91
  35. package/dist/endpoints/people.js +0 -128
  36. package/dist/endpoints/people_lists.d.ts +0 -16
  37. package/dist/endpoints/people_lists.js +0 -16
  38. package/dist/endpoints/reviews.d.ts +0 -14
  39. package/dist/endpoints/reviews.js +0 -16
  40. package/dist/endpoints/search.d.ts +0 -88
  41. package/dist/endpoints/search.js +0 -102
  42. package/dist/endpoints/trending.d.ts +0 -36
  43. package/dist/endpoints/trending.js +0 -48
  44. package/dist/endpoints/tv_episode_groups.d.ts +0 -13
  45. package/dist/endpoints/tv_episode_groups.js +0 -16
  46. package/dist/endpoints/tv_episodes.d.ts +0 -110
  47. package/dist/endpoints/tv_episodes.js +0 -136
  48. package/dist/endpoints/tv_seasons.d.ts +0 -128
  49. package/dist/endpoints/tv_seasons.js +0 -164
  50. package/dist/endpoints/tv_series.d.ts +0 -244
  51. package/dist/endpoints/tv_series.js +0 -311
  52. package/dist/endpoints/tv_series_lists.d.ts +0 -51
  53. package/dist/endpoints/tv_series_lists.js +0 -63
  54. package/dist/endpoints/watch_providers.d.ts +0 -34
  55. package/dist/endpoints/watch_providers.js +0 -46
  56. package/dist/errors/messages.d.ts +0 -15
  57. package/dist/errors/messages.js +0 -47
  58. package/dist/errors/tmdb.d.ts +0 -45
  59. package/dist/errors/tmdb.js +0 -39
  60. package/dist/images/images.d.ts +0 -12
  61. package/dist/images/images.js +0 -26
  62. package/dist/routes.d.ts +0 -157
  63. package/dist/routes.js +0 -157
  64. package/dist/tmdb.d.ts +0 -61
  65. package/dist/tmdb.js +0 -94
  66. package/dist/types/collections.d.ts +0 -72
  67. package/dist/types/collections.js +0 -1
  68. package/dist/types/common/certifications.d.ts +0 -19
  69. package/dist/types/common/certifications.js +0 -1
  70. package/dist/types/common/changes.d.ts +0 -44
  71. package/dist/types/common/changes.js +0 -1
  72. package/dist/types/common/images.d.ts +0 -64
  73. package/dist/types/common/images.js +0 -1
  74. package/dist/types/common/index.d.ts +0 -6
  75. package/dist/types/common/index.js +0 -6
  76. package/dist/types/common/media.d.ts +0 -305
  77. package/dist/types/common/media.js +0 -1
  78. package/dist/types/common/pagination.d.ts +0 -6
  79. package/dist/types/common/pagination.js +0 -1
  80. package/dist/types/common/params.d.ts +0 -27
  81. package/dist/types/common/params.js +0 -1
  82. package/dist/types/companies.d.ts +0 -53
  83. package/dist/types/companies.js +0 -1
  84. package/dist/types/config/configuration.d.ts +0 -56
  85. package/dist/types/config/configuration.js +0 -1
  86. package/dist/types/config/countries.d.ts +0 -3
  87. package/dist/types/config/countries.js +0 -1257
  88. package/dist/types/config/images.d.ts +0 -49
  89. package/dist/types/config/images.js +0 -13
  90. package/dist/types/config/index.d.ts +0 -6
  91. package/dist/types/config/index.js +0 -6
  92. package/dist/types/config/languages.d.ts +0 -11
  93. package/dist/types/config/languages.js +0 -1
  94. package/dist/types/config/options.d.ts +0 -46
  95. package/dist/types/config/options.js +0 -1
  96. package/dist/types/config/timezones.d.ts +0 -751
  97. package/dist/types/config/timezones.js +0 -1149
  98. package/dist/types/credits.d.ts +0 -148
  99. package/dist/types/credits.js +0 -1
  100. package/dist/types/discover.d.ts +0 -130
  101. package/dist/types/discover.js +0 -27
  102. package/dist/types/enums.d.ts +0 -8
  103. package/dist/types/enums.js +0 -9
  104. package/dist/types/find.d.ts +0 -103
  105. package/dist/types/find.js +0 -1
  106. package/dist/types/index.d.ts +0 -21
  107. package/dist/types/index.js +0 -21
  108. package/dist/types/keywords.d.ts +0 -19
  109. package/dist/types/keywords.js +0 -1
  110. package/dist/types/movies.d.ts +0 -304
  111. package/dist/types/movies.js +0 -1
  112. package/dist/types/networks.d.ts +0 -45
  113. package/dist/types/networks.js +0 -1
  114. package/dist/types/people-lists.d.ts +0 -5
  115. package/dist/types/people-lists.js +0 -1
  116. package/dist/types/people.d.ts +0 -214
  117. package/dist/types/people.js +0 -1
  118. package/dist/types/reviews.d.ts +0 -22
  119. package/dist/types/reviews.js +0 -1
  120. package/dist/types/search.d.ts +0 -198
  121. package/dist/types/search.js +0 -1
  122. package/dist/types/trending.d.ts +0 -55
  123. package/dist/types/trending.js +0 -1
  124. package/dist/types/tv-episode-groups.d.ts +0 -63
  125. package/dist/types/tv-episode-groups.js +0 -13
  126. package/dist/types/tv-episodes.d.ts +0 -98
  127. package/dist/types/tv-episodes.js +0 -1
  128. package/dist/types/tv-seasons.d.ts +0 -133
  129. package/dist/types/tv-seasons.js +0 -1
  130. package/dist/types/tv-series.d.ts +0 -445
  131. package/dist/types/tv-series.js +0 -1
  132. package/dist/types/utility.d.ts +0 -16
  133. package/dist/types/utility.js +0 -10
  134. package/dist/types/watch-providers.d.ts +0 -34
  135. package/dist/types/watch-providers.js +0 -1
  136. package/dist/utils/index.d.ts +0 -2
  137. package/dist/utils/index.js +0 -2
  138. package/dist/utils/jwt.d.ts +0 -1
  139. package/dist/utils/jwt.js +0 -61
  140. package/dist/utils/logger.d.ts +0 -18
  141. package/dist/utils/logger.js +0 -40
package/dist/tmdb.js DELETED
@@ -1,94 +0,0 @@
1
- // src.tmdb.ts
2
- import { ApiClient } from "./client";
3
- import { CertificationsAPI } from "./endpoints/certifications";
4
- import { ChangesAPI } from "./endpoints/changes";
5
- import { CompaniesAPI } from "./endpoints/companies";
6
- import { CreditsAPI } from "./endpoints/credits";
7
- import { CollectionsAPI } from "./endpoints/collections";
8
- import { ConfigurationAPI } from "./endpoints/configuration";
9
- import { DiscoverAPI } from "./endpoints/discover";
10
- import { FindAPI } from "./endpoints/find";
11
- import { GenresAPI } from "./endpoints/genres";
12
- import { KeywordsAPI } from "./endpoints/keywords";
13
- import { MovieListsAPI } from "./endpoints/movie_lists";
14
- import { MoviesAPI } from "./endpoints/movies";
15
- import { SearchAPI } from "./endpoints/search";
16
- import { TVSeriesAPI } from "./endpoints/tv_series";
17
- import { TVSeriesListsAPI } from "./endpoints/tv_series_lists";
18
- import { WatchProvidersAPI } from "./endpoints/watch_providers";
19
- import { Errors } from "./errors/messages";
20
- import { ImageAPI } from "./images/images";
21
- import { NetworksAPI } from "./endpoints/networks";
22
- import { TVEpisodesAPI } from "./endpoints/tv_episodes";
23
- import { TVEpisodeGroupsAPI } from "./endpoints/tv_episode_groups";
24
- import { TVSeasonsAPI } from "./endpoints/tv_seasons";
25
- import { TrendingAPI } from "./endpoints/trending";
26
- import { ReviewsAPI } from "./endpoints/reviews";
27
- import { PeopleListsAPI } from "./endpoints/people_lists";
28
- import { PeopleAPI } from "./endpoints/people";
29
- export class TMDB {
30
- client;
31
- options; // ** Default options for all requests
32
- movies;
33
- movie_lists;
34
- search;
35
- images;
36
- configuration;
37
- genres;
38
- keywords;
39
- tv_lists;
40
- tv_series;
41
- watch_providers;
42
- certifications;
43
- changes;
44
- companies;
45
- credits;
46
- collections;
47
- discover;
48
- find;
49
- networks;
50
- tv_episodes;
51
- tv_episode_groups;
52
- tv_seasons;
53
- trending;
54
- reviews;
55
- people_lists;
56
- people;
57
- // etc...
58
- /**
59
- * Creates a new TMDB instance.
60
- * @param accessToken The TMDB API access token.
61
- * @param options Optional default options (e.g., language) for all requests.
62
- */
63
- constructor(accessToken, options = {}) {
64
- if (!accessToken)
65
- throw new Error(Errors.NO_ACCESS_TOKEN);
66
- this.options = options;
67
- this.client = new ApiClient(accessToken, { logger: options.logger, deduplication: options.deduplication });
68
- this.movies = new MoviesAPI(this.client, this.options);
69
- this.movie_lists = new MovieListsAPI(this.client, this.options);
70
- this.search = new SearchAPI(this.client, this.options);
71
- this.images = new ImageAPI(this.options.images);
72
- this.configuration = new ConfigurationAPI(this.client, this.options);
73
- this.genres = new GenresAPI(this.client, this.options);
74
- this.keywords = new KeywordsAPI(this.client, this.options);
75
- this.tv_lists = new TVSeriesListsAPI(this.client, this.options);
76
- this.tv_series = new TVSeriesAPI(this.client, this.options);
77
- this.watch_providers = new WatchProvidersAPI(this.client, this.options);
78
- this.certifications = new CertificationsAPI(this.client, this.options);
79
- this.changes = new ChangesAPI(this.client, this.options);
80
- this.companies = new CompaniesAPI(this.client, this.options);
81
- this.credits = new CreditsAPI(this.client, this.options);
82
- this.collections = new CollectionsAPI(this.client, this.options);
83
- this.discover = new DiscoverAPI(this.client, this.options);
84
- this.find = new FindAPI(this.client, this.options);
85
- this.networks = new NetworksAPI(this.client, this.options);
86
- this.tv_episodes = new TVEpisodesAPI(this.client, this.options);
87
- this.tv_episode_groups = new TVEpisodeGroupsAPI(this.client, this.options);
88
- this.tv_seasons = new TVSeasonsAPI(this.client, this.options);
89
- this.trending = new TrendingAPI(this.client, this.options);
90
- this.reviews = new ReviewsAPI(this.client, this.options);
91
- this.people_lists = new PeopleListsAPI(this.client, this.options);
92
- this.people = new PeopleAPI(this.client, this.options);
93
- }
94
- }
@@ -1,72 +0,0 @@
1
- import { MediaType, TranslationResults, WithLanguage } from "./common";
2
- import { ImageItem, ImagesResult } from "./common/images";
3
- import { Language, LanguageISO6391 } from "./config";
4
- import { MovieResultItem } from "./search";
5
- /**
6
- * Represents a TMDB collection (e.g. a movie franchise or saga),
7
- * including metadata and the list of media items that belong to it.
8
- */
9
- export type Collection = {
10
- /** Unique TMDB identifier for the collection */
11
- id: number;
12
- /** Display name of the collection */
13
- name: string;
14
- /** Original language code of the collection (e.g. `"en"`, `"it"`) */
15
- original_language: string;
16
- /** Name of the collection in its original language */
17
- original_name: string;
18
- /** Short description or synopsis of the collection */
19
- overview: string;
20
- /** Relative path to the collection's poster image on TMDB, if available (sanitized nulls become undefined) */
21
- poster_path?: string | null;
22
- /** Relative path to the collection's backdrop image on TMDB, if available (sanitized nulls become undefined) */
23
- backdrop_path?: string | null;
24
- /** Ordered list of media items that make up the collection */
25
- parts: CollectionItem[];
26
- };
27
- /**
28
- * Represents a single media item within a collection.
29
- * Extends {@link MovieResultItem} by replacing `title` and `original_title`
30
- * with their localization-agnostic equivalents, and adding a `media_type` discriminator.
31
- * Hopefully both tv and movies use name and original name instead of title.
32
- */
33
- export type CollectionItem = Omit<MovieResultItem, "title" | "original_title"> & {
34
- /** The type of media (e.g. `"movie"` or `"tv"`), used as a discriminator */
35
- media_type: MediaType;
36
- /** Display name of the media item */
37
- name: string;
38
- /** Name of the media item in its original language */
39
- original_name: string;
40
- };
41
- /**
42
- * Represents the images associated with a TMDB collection,
43
- * including backdrops and posters.
44
- */
45
- export type CollectionImages = ImagesResult<ImageItem, "backdrops" | "posters">;
46
- /**
47
- * Represents the available translations for a TMDB collection.
48
- */
49
- export type CollectionTranslations = TranslationResults<CollectionTranslationData>;
50
- /**
51
- * Contains the localized fields provided by a collection translation.
52
- * All fields are optional as not every translation may supply all values.
53
- */
54
- export type CollectionTranslationData = {
55
- /** Localized title of the collection */
56
- title?: string;
57
- /** Localized overview or synopsis of the collection */
58
- overview?: string;
59
- /** Localized homepage URL for the collection */
60
- homepage?: string;
61
- };
62
- /** Base param used by all collection queries */
63
- export type CollectionBaseParam = {
64
- /** Uniquely identifies a collection in TMDB. */
65
- collection_id: number;
66
- };
67
- export type CollectionDetailsParams = CollectionBaseParam & WithLanguage;
68
- export type CollectionImagesParams = CollectionBaseParam & {
69
- language?: Language | LanguageISO6391;
70
- /** Languages to include images for. Pass an array — it will be serialized as a comma-separated list (e.g. ["en", "null"]). Use "null" to include untagged images. */
71
- include_image_language?: (Language | "null")[];
72
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,19 +0,0 @@
1
- import { CountryISO3166_1 } from "../config";
2
- /**
3
- * Represents a content rating certification for a movie or TV show.
4
- */
5
- export type CertificationItem = {
6
- /** The certification label as defined by the rating authority (e.g. `PG-13`, `18+`, `R`) */
7
- certification: string;
8
- /** A human-readable description of the audience this certification targets or restricts */
9
- meaning?: string;
10
- /** The display order of this certification relative to others in the same rating system */
11
- order?: number;
12
- };
13
- /**
14
- * A map of content rating certifications grouped by country.
15
- */
16
- export type Certifications = {
17
- /** A record mapping each country (ISO 3166-1 alpha-2 code) to its list of applicable certifications */
18
- certifications: Record<CountryISO3166_1, CertificationItem[]>;
19
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,44 +0,0 @@
1
- /**
2
- * Container for entity change history
3
- */
4
- export type Changes = {
5
- /** Array of changes grouped by type */
6
- changes: Change[];
7
- };
8
- /**
9
- * Group of changes for a specific field or property
10
- */
11
- export type Change = {
12
- /** Name of the field that changed (e.g., "title", "overview", "images") */
13
- key: string;
14
- /** Individual change entries for this field */
15
- items: ChangeItem[];
16
- };
17
- /**
18
- * Individual change record with action details
19
- */
20
- export type ChangeItem = {
21
- /** Unique identifier for the changed item */
22
- id: number | string;
23
- /** Type of change performed (e.g., "added", "updated", "deleted") */
24
- action: string;
25
- /** Timestamp of when the change occurred (ISO 8601 format) */
26
- time: string;
27
- /** ISO 639-1 language code associated with the change */
28
- iso_639_1?: string | null;
29
- /** ISO 3166-1 country code associated with the change */
30
- iso_3166_1?: string | null;
31
- /** The changed data object (structure varies by change type) */
32
- value: object | string;
33
- /** The original data object (structure varies by change type) */
34
- original_value?: object | string;
35
- };
36
- /**
37
- * Represents a single change result item from the changes endpoint.
38
- */
39
- export type ChangeResultItem = {
40
- /** Id of the movie, tv show or person */
41
- id: number;
42
- /** Whether the movie, tv show or person is marked as adult content */
43
- adult: boolean;
44
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,64 +0,0 @@
1
- import { LiteralUnion } from "../utility";
2
- /**
3
- * Defines the possible image collection keys returned by TMDB image endpoints.
4
- */
5
- export type ImageCollectionKey = "backdrops" | "logos" | "posters" | "profiles" | "stills";
6
- /**
7
- * Image metadata and details
8
- */
9
- export type ImageItem = {
10
- /** Aspect ratio of the image (width/height) */
11
- aspect_ratio: number;
12
- /** Image height in pixels */
13
- height: number;
14
- /** ISO 639-1 language code if image contains text, null otherwise */
15
- iso_639_1?: string | null;
16
- /** Relative path to the image file (append to base URL) */
17
- file_path: string;
18
- /** Average user rating for this image */
19
- vote_average: number;
20
- /** Total number of votes for this image */
21
- vote_count: number;
22
- /** Image width in pixels */
23
- width: number;
24
- };
25
- /**
26
- * Represents a single company or network logo (slightly different from ImageItem)
27
- *
28
- * Note on FileType from TMDB:
29
- * There are two image formats that are supported for companies, PNG's and SVG's.
30
- * You can see which type the original file is by looking at the file_type field.
31
- * We prefer SVG's as they are resolution independent and as such, the width and height are only
32
- * there to reflect the original asset that was uploaded.
33
- * An SVG can be scaled properly beyond those dimensions if you call them as a PNG.
34
- */
35
- export type OrganizationImage = Omit<ImageItem, "iso_639_1"> & {
36
- id: string;
37
- file_type: FileType;
38
- };
39
- /**
40
- * Represents the response from a TMDB image endpoint.
41
- * Use the generic parameter to specify which image collections are present.
42
- *
43
- * @template K - The image collection keys available for the given entity type.
44
- *
45
- * @example
46
- * // Company or Network (logos only)
47
- * type OrganizationImagesResult = ImagesResult<"logos">;
48
- *
49
- * @example
50
- * // Movie or TV Show (backdrops, logos and posters)
51
- * type MovieImagesResult = ImagesResult<"backdrops" | "logos" | "posters">;
52
- *
53
- * @example
54
- * // Person (profiles only)
55
- * type PersonImagesResult = ImagesResult<"profiles">;
56
- */
57
- export type ImagesResult<T, K extends ImageCollectionKey> = {
58
- /** The unique TMDB identifier of the entity. */
59
- id: number;
60
- } & {
61
- [P in K]: T[];
62
- };
63
- /** Available file type on svg (for images) */
64
- export type FileType = LiteralUnion<".png" | ".svg">;
@@ -1 +0,0 @@
1
- export {};
@@ -1,6 +0,0 @@
1
- export * from "./changes";
2
- export * from "./media";
3
- export * from "./images";
4
- export * from "./pagination";
5
- export * from "./params";
6
- export * from "./certifications";
@@ -1,6 +0,0 @@
1
- export * from "./changes";
2
- export * from "./media";
3
- export * from "./images";
4
- export * from "./pagination";
5
- export * from "./params";
6
- export * from "./certifications";
@@ -1,305 +0,0 @@
1
- import { CountryISO3166_1 } from "../config/countries";
2
- /**
3
- * Represents a genre of a movie or TV show.
4
- */
5
- export type Genre = {
6
- id: number;
7
- name: string;
8
- };
9
- /**
10
- * Response containing available genres
11
- */
12
- export type GenresResponse = {
13
- /** Array of genre objects with ID and name */
14
- genres: Genre[];
15
- };
16
- /**
17
- * Represents a production company involved in creating a movie or TV show.
18
- */
19
- export type ProductionCompany = {
20
- id: number;
21
- logo_path: string | null;
22
- name: string;
23
- origin_country: string;
24
- };
25
- /**
26
- * Represents a country where a movie or TV show was produced.
27
- */
28
- export type ProductionCountry = {
29
- iso_3166_1: string;
30
- name: string;
31
- };
32
- /**
33
- * Represents a spoken language in a movie or TV show.
34
- */
35
- export type SpokenLanguage = {
36
- english_name: string;
37
- iso_639_1: string;
38
- name: string;
39
- };
40
- /**
41
- * Represents a collection of movies.
42
- */
43
- export type MovieCollection = {
44
- id: number;
45
- name: string;
46
- poster_path?: string | null;
47
- backdrop_path?: string | null;
48
- };
49
- /**
50
- * Represents common class for cast and crew types
51
- */
52
- export type Credit = {
53
- adult: boolean;
54
- gender: number | null;
55
- id: number;
56
- known_for_department: string;
57
- name: string;
58
- original_name: string;
59
- popularity: number;
60
- profile_path?: string | null;
61
- credit_id: string;
62
- };
63
- /**
64
- * Represents a cast member in a movie or TV show.
65
- */
66
- export type Cast = Credit & {
67
- cast_id: number;
68
- character: string;
69
- order: number;
70
- };
71
- /**
72
- * Represents a crew member in a movie or TV show.
73
- */
74
- export type Crew = Credit & {
75
- department: string;
76
- job: string;
77
- };
78
- /**
79
- * Represents a keyword entry
80
- */
81
- export type Keyword = {
82
- id: number;
83
- name: string;
84
- };
85
- /**
86
- * Represents an alternative name entry for a company or network.
87
- *
88
- * @see https://developer.themoviedb.org/reference/company-alternative-names
89
- * @see https://developer.themoviedb.org/reference/network-alternative-names
90
- */
91
- export type AlternativeName = {
92
- /** The alternative name. */
93
- name: string;
94
- /** The type or context of the alternative name (e.g. "short name", "abbreviation"). */
95
- type: string;
96
- };
97
- /**
98
- * Represents the response from the TMDB alternative names endpoint
99
- * for a company or network.
100
- *
101
- * @see https://developer.themoviedb.org/reference/company-alternative-names
102
- * @see https://developer.themoviedb.org/reference/network-alternative-names
103
- */
104
- export type AlternativeNamesResult = {
105
- /** The unique TMDB identifier of the company or network. */
106
- id: number;
107
- /** A list of alternative names associated with the company or network. */
108
- results: AlternativeName[];
109
- };
110
- /**
111
- * Alternative title entry
112
- */
113
- export type AlternativeTitle = {
114
- /** Alternative title text */
115
- title: string;
116
- /** ISO 3166-1 country code where this title is used */
117
- iso_3166_1: string;
118
- /** Type of title (e.g., "original title", "working title") */
119
- type: string;
120
- };
121
- export type VideoResults = {
122
- /** Media identifier */
123
- id: number | string;
124
- /** Array of video items */
125
- results: VideoItem[];
126
- };
127
- /**
128
- * Video metadata and details
129
- */
130
- export type VideoItem = {
131
- /** ISO 639-1 language code of the video */
132
- iso_639_1: string;
133
- /** ISO 3166-1 country code where the video is available */
134
- iso_3166_1: string;
135
- /** Video title or name */
136
- name: string;
137
- /** Unique video key/ID on the hosting platform */
138
- key: string;
139
- /** Video hosting platform (e.g., "YouTube", "Vimeo") */
140
- site: string;
141
- /** Video resolution/size (e.g., 1080, 720) */
142
- size: number;
143
- /** Type of video (e.g., "Trailer", "Teaser", "Clip", "Featurette", "Behind the Scenes") */
144
- type: string;
145
- /** Whether this is an official video from the content distributor */
146
- official: boolean;
147
- /** Publication date and time (ISO 8601 format) */
148
- published_at: string;
149
- /** Unique video identifier in TMDB */
150
- id: string;
151
- };
152
- /**
153
- * Watch provider monetization filters supported by TMDB media discovery endpoints.
154
- */
155
- export type WatchMonetizationType = "flatrate" | "free" | "ads" | "rent" | "buy";
156
- /**
157
- * Base properties shared between movie and TV show results
158
- */
159
- type BaseKnownForItem = {
160
- adult: boolean;
161
- backdrop_path: string | null;
162
- id: number;
163
- original_language: string;
164
- overview: string;
165
- poster_path: string | null;
166
- genre_ids: number[];
167
- popularity: number;
168
- vote_average: number;
169
- vote_count: number;
170
- };
171
- /**
172
- * Movie item in known_for array
173
- */
174
- export type KnownForMovie = BaseKnownForItem & {
175
- /** Media type discriminator */
176
- media_type: "movie";
177
- /** Movie title (localized) */
178
- title: string;
179
- /** Original title in the original language */
180
- original_title: string;
181
- /** Release date in ISO 8601 format (YYYY-MM-DD) */
182
- release_date: string;
183
- /** Whether a video is available on TMDB */
184
- video: boolean;
185
- };
186
- /**
187
- * TV show item in known_for array
188
- */
189
- export type KnownForTV = BaseKnownForItem & {
190
- /** Media type discriminator */
191
- media_type: "tv";
192
- /** Series name (localized) */
193
- name: string;
194
- /** Original series name */
195
- original_name: string;
196
- /** First air date (YYYY-MM-DD) */
197
- first_air_date: string;
198
- /** Origin country codes (ISO 3166-1 array) */
199
- origin_country: CountryISO3166_1[];
200
- };
201
- /**
202
- * Union type for items in the known_for array (can be either movie or TV show)
203
- */
204
- export type KnownForItem = KnownForMovie | KnownForTV;
205
- /** Available media types on TMDB */
206
- export type MediaType = "movie" | "tv";
207
- /**
208
- * Content rating information for a TV show or movie
209
- */
210
- export type ContentRating = {
211
- /** Additional content descriptors or advisory warnings (e.g., "violence", "language", "nudity") */
212
- descriptors: string[];
213
- /** ISO 3166-1 country code where this rating applies */
214
- iso_3166_1: string;
215
- /** Age or content rating (e.g., "TV-MA", "PG-13", "TV-14", "R") */
216
- rating: string;
217
- };
218
- /**
219
- * Individual movie review with author information
220
- */
221
- export type Review = {
222
- /** Review author's display name */
223
- author: string;
224
- /** Detailed information about the review author */
225
- author_details: ReviewAuthorDetails;
226
- /** Full review text content */
227
- content: string;
228
- /** Timestamp when the review was created (ISO 8601) */
229
- created_at: string;
230
- /** Unique review identifier */
231
- id: string;
232
- /** Timestamp of last update (ISO 8601) */
233
- updated_at: string;
234
- /** URL to the review on TMDB website */
235
- url: string;
236
- };
237
- /**
238
- * Author information for a movie review
239
- */
240
- export type ReviewAuthorDetails = {
241
- /** Author's full name */
242
- name: string;
243
- /** Author's username on TMDB */
244
- username: string;
245
- /** Path to author's avatar image (optional) */
246
- avatar_path?: string;
247
- /** Rating given by the author (0-10 scale, optional) */
248
- rating?: number;
249
- };
250
- /** Collection of translations for a media item (object with `id` and `translations`). */
251
- export type TranslationResults<T> = {
252
- id: number | string;
253
- translations: Translation<T>[];
254
- };
255
- /**
256
- * Translation data for a specific language
257
- */
258
- export type Translation<T = unknown> = {
259
- /** ISO 3166-1 alpha-2 country code */
260
- iso_3166_1: string;
261
- /** ISO 639-1 language code */
262
- iso_639_1: string;
263
- /** Native name of the language */
264
- name: string;
265
- /** English name of the language */
266
- english_name: string;
267
- /** Translated media (tv/movie) information */
268
- data: T;
269
- };
270
- /**
271
- * Watch provider availability by country
272
- */
273
- export type MediaWatchProviders = {
274
- /** Movie/TV show identifier */
275
- id: number;
276
- /** Watch providers grouped by country code */
277
- results: Record<CountryISO3166_1, WatchProvider>;
278
- };
279
- /**
280
- * Watch provider options for a specific country
281
- */
282
- export type WatchProvider = {
283
- /** URL to watch/purchase the movie */
284
- link: string;
285
- /** Streaming providers (subscription required) */
286
- flatrate?: WatchProviderItem[];
287
- /** Rental providers */
288
- rent?: WatchProviderItem[];
289
- /** Purchase providers */
290
- buy?: WatchProviderItem[];
291
- };
292
- /**
293
- * Individual watch provider details
294
- */
295
- export type WatchProviderItem = {
296
- /** Path to provider logo image */
297
- logo_path: string;
298
- /** Unique provider identifier */
299
- provider_id: number;
300
- /** Provider name (e.g., "Netflix", "Amazon Prime Video") */
301
- provider_name: string;
302
- /** Display priority order (lower numbers = higher priority) */
303
- display_priority: number;
304
- };
305
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,6 +0,0 @@
1
- export type PaginatedResponse<T> = {
2
- page: number;
3
- total_pages: number;
4
- total_results: number;
5
- results: T[];
6
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,27 +0,0 @@
1
- import { CountryISO3166_1 } from "../config/countries";
2
- import { Language } from "../config/languages";
3
- /**
4
- * Most of the commonly used params for
5
- * TMDB queries. Defined here for reuse.
6
- */
7
- export type TMDBQueryParams = {
8
- language?: Language;
9
- page?: number;
10
- region?: CountryISO3166_1;
11
- };
12
- /**
13
- * Specify a date range with start and end date.
14
- */
15
- export type DateRange = {
16
- /** Start date for changes in ISO 8601 format (YYYY-MM-DD) */
17
- start_date?: string;
18
- /** End date for changes in ISO 8601 format (YYYY-MM-DD) */
19
- end_date?: string;
20
- };
21
- /** Generic utility */
22
- export type WithParams<T extends keyof TMDBQueryParams> = Pick<TMDBQueryParams, T>;
23
- export type WithLanguage = WithParams<"language">;
24
- export type WithPage = WithParams<"page">;
25
- export type WithRegion = WithParams<"region">;
26
- export type WithLanguagePage = WithParams<"language" | "page">;
27
- export type WithPageAndDateRange = WithParams<"page"> & DateRange;
@@ -1 +0,0 @@
1
- export {};