@lorenzopant/tmdb 1.4.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.d.ts +2 -2
- package/dist/client.js +2 -2
- package/dist/endpoints/collections.d.ts +40 -0
- package/dist/endpoints/collections.d.ts.map +1 -0
- package/dist/endpoints/collections.js +52 -0
- package/dist/routes.d.ts +5 -0
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +5 -0
- package/dist/tmdb.d.ts +2 -0
- package/dist/tmdb.d.ts.map +1 -1
- package/dist/tmdb.js +3 -0
- package/dist/types/common/media.d.ts +3 -3
- package/dist/types/common/media.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -0
- package/dist/types/movies/movie.d.ts +2 -2
- package/dist/types/movies/movie.d.ts.map +1 -1
- package/dist/types/other/collections.d.ts +91 -0
- package/dist/types/other/collections.d.ts.map +1 -0
- package/dist/types/other/collections.js +1 -0
- package/dist/types/other/index.d.ts +2 -0
- package/dist/types/other/index.d.ts.map +1 -0
- package/dist/types/other/index.js +1 -0
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ export declare class ApiClient {
|
|
|
5
5
|
request<T>(endpoint: string, params?: Record<string, unknown | undefined>): Promise<T>;
|
|
6
6
|
/**
|
|
7
7
|
* Recursively converts null values to undefined in API responses.
|
|
8
|
-
* This allows
|
|
9
|
-
*
|
|
8
|
+
* This allows optional properties to model fields that TMDB returns as nullable.
|
|
9
|
+
* Response types for nullable fields should account for possible undefined values.
|
|
10
10
|
*/
|
|
11
11
|
private sanitizeNulls;
|
|
12
12
|
private handleError;
|
package/dist/client.js
CHANGED
|
@@ -25,8 +25,8 @@ export class ApiClient {
|
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
27
|
* Recursively converts null values to undefined in API responses.
|
|
28
|
-
* This allows
|
|
29
|
-
*
|
|
28
|
+
* This allows optional properties to model fields that TMDB returns as nullable.
|
|
29
|
+
* Response types for nullable fields should account for possible undefined values.
|
|
30
30
|
*/
|
|
31
31
|
sanitizeNulls(value) {
|
|
32
32
|
// Only convert null to undefined, keep undefined as-is
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { CollectionBaseParam, Collection, CollectionDetailsParams, CollectionImages, CollectionImagesParams, CollectionTranslations } from "../types/other/collections";
|
|
2
|
+
import { TMDBAPIBase } from "./base";
|
|
3
|
+
export declare class CollectionsAPI extends TMDBAPIBase {
|
|
4
|
+
private collectionPath;
|
|
5
|
+
/**
|
|
6
|
+
* Details
|
|
7
|
+
* GET - https://api.themoviedb.org/3/collection/{collection_id}
|
|
8
|
+
*
|
|
9
|
+
* Get collection details by ID.
|
|
10
|
+
*
|
|
11
|
+
* @param collection_id Unique identifier for the collection
|
|
12
|
+
* @param language Language for the response
|
|
13
|
+
* @reference https://developer.themoviedb.org/reference/collection-details
|
|
14
|
+
*/
|
|
15
|
+
details(params: CollectionDetailsParams): Promise<Collection>;
|
|
16
|
+
/**
|
|
17
|
+
* Images
|
|
18
|
+
* GET - https://api.themoviedb.org/3/collection/{collection_id}/images
|
|
19
|
+
*
|
|
20
|
+
* Get the images that belong to a collection.
|
|
21
|
+
* This method will return the backdrops and posters that have been added to a collection.
|
|
22
|
+
*
|
|
23
|
+
* @param collection_id Unique identifier for the collection
|
|
24
|
+
* @param language Language for the response
|
|
25
|
+
* @param include_image_language Additional language for images
|
|
26
|
+
* @reference https://developer.themoviedb.org/reference/collection-images
|
|
27
|
+
*/
|
|
28
|
+
images(params: CollectionImagesParams): Promise<CollectionImages>;
|
|
29
|
+
/**
|
|
30
|
+
* Translations
|
|
31
|
+
* GET - https://api.themoviedb.org/3/collection/{collection_id}/translations
|
|
32
|
+
*
|
|
33
|
+
* Get collection translations by ID.
|
|
34
|
+
*
|
|
35
|
+
* @param collection_id Unique identifier for the collection
|
|
36
|
+
* @reference https://developer.themoviedb.org/reference/collection-translations
|
|
37
|
+
*/
|
|
38
|
+
translations(params: CollectionBaseParam): Promise<CollectionTranslations>;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=collections.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collections.d.ts","sourceRoot":"","sources":["../../src/endpoints/collections.ts"],"names":[],"mappings":"AACA,OAAO,EACN,mBAAmB,EACnB,UAAU,EACV,uBAAuB,EACvB,gBAAgB,EAChB,sBAAsB,EACtB,sBAAsB,EACtB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,qBAAa,cAAe,SAAQ,WAAW;IAC9C,OAAO,CAAC,cAAc;IAItB;;;;;;;;;OASG;IACG,OAAO,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,UAAU,CAAC;IAMnE;;;;;;;;;;;OAWG;IACG,MAAM,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAMvE;;;;;;;;OAQG;IACG,YAAY,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,sBAAsB,CAAC;CAIhF"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ENDPOINTS } from "../routes";
|
|
2
|
+
import { TMDBAPIBase } from "./base";
|
|
3
|
+
export class CollectionsAPI extends TMDBAPIBase {
|
|
4
|
+
collectionPath(collection_id) {
|
|
5
|
+
return `${ENDPOINTS.COLLECTIONS.DETAILS}/${collection_id}`;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Details
|
|
9
|
+
* GET - https://api.themoviedb.org/3/collection/{collection_id}
|
|
10
|
+
*
|
|
11
|
+
* Get collection details by ID.
|
|
12
|
+
*
|
|
13
|
+
* @param collection_id Unique identifier for the collection
|
|
14
|
+
* @param language Language for the response
|
|
15
|
+
* @reference https://developer.themoviedb.org/reference/collection-details
|
|
16
|
+
*/
|
|
17
|
+
async details(params) {
|
|
18
|
+
const { language = this.defaultOptions.language, ...rest } = params;
|
|
19
|
+
const endpoint = this.collectionPath(params.collection_id);
|
|
20
|
+
return this.client.request(endpoint, { language, ...rest });
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Images
|
|
24
|
+
* GET - https://api.themoviedb.org/3/collection/{collection_id}/images
|
|
25
|
+
*
|
|
26
|
+
* Get the images that belong to a collection.
|
|
27
|
+
* This method will return the backdrops and posters that have been added to a collection.
|
|
28
|
+
*
|
|
29
|
+
* @param collection_id Unique identifier for the collection
|
|
30
|
+
* @param language Language for the response
|
|
31
|
+
* @param include_image_language Additional language for images
|
|
32
|
+
* @reference https://developer.themoviedb.org/reference/collection-images
|
|
33
|
+
*/
|
|
34
|
+
async images(params) {
|
|
35
|
+
const endpoint = `${this.collectionPath(params.collection_id)}${ENDPOINTS.COLLECTIONS.IMAGES}`;
|
|
36
|
+
const requestParams = this.withLanguage(params) ?? params;
|
|
37
|
+
return this.client.request(endpoint, requestParams);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Translations
|
|
41
|
+
* GET - https://api.themoviedb.org/3/collection/{collection_id}/translations
|
|
42
|
+
*
|
|
43
|
+
* Get collection translations by ID.
|
|
44
|
+
*
|
|
45
|
+
* @param collection_id Unique identifier for the collection
|
|
46
|
+
* @reference https://developer.themoviedb.org/reference/collection-translations
|
|
47
|
+
*/
|
|
48
|
+
async translations(params) {
|
|
49
|
+
const endpoint = `${this.collectionPath(params.collection_id)}${ENDPOINTS.COLLECTIONS.TRANSLATIONS}`;
|
|
50
|
+
return this.client.request(endpoint, params);
|
|
51
|
+
}
|
|
52
|
+
}
|
package/dist/routes.d.ts
CHANGED
package/dist/routes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;CAuBrB,CAAC"}
|
package/dist/routes.js
CHANGED
package/dist/tmdb.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CertificationsAPI } from "./endpoints/certifications";
|
|
2
2
|
import { ChangesAPI } from "./endpoints/changes";
|
|
3
|
+
import { CollectionsAPI } from "./endpoints/collections";
|
|
3
4
|
import { ConfigurationAPI } from "./endpoints/configuration";
|
|
4
5
|
import { GenresAPI } from "./endpoints/genres";
|
|
5
6
|
import { MovieListsAPI } from "./endpoints/movie_lists";
|
|
@@ -22,6 +23,7 @@ export declare class TMDB {
|
|
|
22
23
|
tv_series: TVSeriesAPI;
|
|
23
24
|
certifications: CertificationsAPI;
|
|
24
25
|
changes: ChangesAPI;
|
|
26
|
+
collections: CollectionsAPI;
|
|
25
27
|
/**
|
|
26
28
|
* Creates a new TMDB instance.
|
|
27
29
|
* @param accessToken The TMDB API access token.
|
package/dist/tmdb.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tmdb.d.ts","sourceRoot":"","sources":["../src/tmdb.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,gBAAg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AAE7C,qBAAa,IAAI;IAChB,OAAO,CAAC,MAAM,CAAY;IAC1B,OAAO,CAAC,OAAO,CAAc;IACtB,MAAM,EAAE,SAAS,CAAC;IAClB,WAAW,EAAE,aAAa,CAAC;IAC3B,MAAM,EAAE,SAAS,CAAC;IAClB,MAAM,EAAE,QAAQ,CAAC;IACjB,aAAa,EAAE,gBAAgB,CAAC;IAChC,MAAM,EAAE,SAAS,CAAC;IAClB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,SAAS,EAAE,WAAW,CAAC;IACvB,cAAc,EAAE,iBAAiB,CAAC;IAClC,OAAO,EAAE,UAAU,CAAC;IACpB,WAAW,EAAE,cAAc,CAAC;IAGnC;;;;OAIG;gBACS,WAAW,EAAE,MAAM,EAAE,OAAO,GAAE,WAAgB;CAgB1D"}
|
package/dist/tmdb.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { ApiClient } from "./client";
|
|
3
3
|
import { CertificationsAPI } from "./endpoints/certifications";
|
|
4
4
|
import { ChangesAPI } from "./endpoints/changes";
|
|
5
|
+
import { CollectionsAPI } from "./endpoints/collections";
|
|
5
6
|
import { ConfigurationAPI } from "./endpoints/configuration";
|
|
6
7
|
import { GenresAPI } from "./endpoints/genres";
|
|
7
8
|
import { MovieListsAPI } from "./endpoints/movie_lists";
|
|
@@ -24,6 +25,7 @@ export class TMDB {
|
|
|
24
25
|
tv_series;
|
|
25
26
|
certifications;
|
|
26
27
|
changes;
|
|
28
|
+
collections;
|
|
27
29
|
// etc...
|
|
28
30
|
/**
|
|
29
31
|
* Creates a new TMDB instance.
|
|
@@ -45,5 +47,6 @@ export class TMDB {
|
|
|
45
47
|
this.tv_series = new TVSeriesAPI(this.client, this.options);
|
|
46
48
|
this.certifications = new CertificationsAPI(this.client, this.options);
|
|
47
49
|
this.changes = new ChangesAPI(this.client, this.options);
|
|
50
|
+
this.collections = new CollectionsAPI(this.client, this.options);
|
|
48
51
|
}
|
|
49
52
|
}
|
|
@@ -40,11 +40,11 @@ export type SpokenLanguage = {
|
|
|
40
40
|
/**
|
|
41
41
|
* Represents a collection of movies.
|
|
42
42
|
*/
|
|
43
|
-
export type
|
|
43
|
+
export type MovieCollection = {
|
|
44
44
|
id: number;
|
|
45
45
|
name: string;
|
|
46
|
-
poster_path
|
|
47
|
-
backdrop_path
|
|
46
|
+
poster_path?: string | null;
|
|
47
|
+
backdrop_path?: string | null;
|
|
48
48
|
};
|
|
49
49
|
/**
|
|
50
50
|
* Represents common class for cast and crew types
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../../../src/types/common/media.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;GAEG;AACH,MAAM,MAAM,KAAK,GAAG;IAEnB,EAAE,EAAE,MAAM,CAAC;IAEX,IAAI,EAAE,MAAM,CAAC;CACb,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC5B,8CAA8C;IAC9C,MAAM,EAAE,KAAK,EAAE,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAE/B,EAAE,EAAE,MAAM,CAAC;IAEX,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB,IAAI,EAAE,MAAM,CAAC;IAEb,cAAc,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAE/B,UAAU,EAAE,MAAM,CAAC;IAEnB,IAAI,EAAE,MAAM,CAAC;CACb,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAE5B,YAAY,EAAE,MAAM,CAAC;IAErB,SAAS,EAAE,MAAM,CAAC;IAElB,IAAI,EAAE,MAAM,CAAC;CACb,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../../../src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EAAE,MAAM,CAAC;IACrB,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;CACb,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IACjC,+BAA+B;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,8CAA8C;IAC9C,OAAO,EAAE,MAAM,CAAC,gBAAgB,EAAE,aAAa,CAAC,CAAC;CACjD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC3B,sCAAsC;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,kDAAkD;IAClD,QAAQ,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC/B,uBAAuB;IACvB,IAAI,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC3B,yBAAyB;IACzB,GAAG,CAAC,EAAE,iBAAiB,EAAE,CAAC;CAC1B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC/B,kCAAkC;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,iCAAiC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,4DAA4D;IAC5D,aAAa,EAAE,MAAM,CAAC;IACtB,+DAA+D;IAC/D,gBAAgB,EAAE,MAAM,CAAC;CACzB,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,MAAM,CAAC;AACrB,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,MAAM,CAAC;AACrB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC"}
|
package/dist/types/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MovieCollection, Genre, ProductionCompany, ProductionCountry, SpokenLanguage } from "../common";
|
|
2
2
|
import { MovieAlternativeTitles } from "./alternative_titles";
|
|
3
3
|
import { MovieChanges } from "./changes";
|
|
4
4
|
import { MovieCredits } from "./credits";
|
|
@@ -20,7 +20,7 @@ export type MovieDetails = {
|
|
|
20
20
|
/** Path to backdrop image, null if not available */
|
|
21
21
|
backdrop_path: string | null;
|
|
22
22
|
/** Collection the movie belongs to (e.g., "The Lord of the Rings Collection"), null if standalone */
|
|
23
|
-
belongs_to_collection:
|
|
23
|
+
belongs_to_collection: MovieCollection | null;
|
|
24
24
|
/** Production budget in US dollars */
|
|
25
25
|
budget: number;
|
|
26
26
|
/** Array of genres associated with the movie */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"movie.d.ts","sourceRoot":"","sources":["../../../src/types/movies/movie.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"movie.d.ts","sourceRoot":"","sources":["../../../src/types/movies/movie.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACzG,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM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AkB,CAAC,CAAC,CAAC;CACvC,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { ImageItem, MediaType, Translation, WithLanguage } from "../common";
|
|
2
|
+
import { Language, LanguageISO6391 } from "../config";
|
|
3
|
+
import { MovieResultItem } from "../search";
|
|
4
|
+
/**
|
|
5
|
+
* Represents a TMDB collection (e.g. a movie franchise or saga),
|
|
6
|
+
* including metadata and the list of media items that belong to it.
|
|
7
|
+
*/
|
|
8
|
+
export type Collection = {
|
|
9
|
+
/** Unique TMDB identifier for the collection */
|
|
10
|
+
id: number;
|
|
11
|
+
/** Display name of the collection */
|
|
12
|
+
name: string;
|
|
13
|
+
/** Original language code of the collection (e.g. `"en"`, `"it"`) */
|
|
14
|
+
original_language: string;
|
|
15
|
+
/** Name of the collection in its original language */
|
|
16
|
+
original_name: string;
|
|
17
|
+
/** Short description or synopsis of the collection */
|
|
18
|
+
overview: string;
|
|
19
|
+
/** Relative path to the collection's poster image on TMDB, if available (sanitized nulls become undefined) */
|
|
20
|
+
poster_path?: string | null;
|
|
21
|
+
/** Relative path to the collection's backdrop image on TMDB, if available (sanitized nulls become undefined) */
|
|
22
|
+
backdrop_path?: string | null;
|
|
23
|
+
/** Ordered list of media items that make up the collection */
|
|
24
|
+
parts: CollectionItem[];
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Represents a single media item within a collection.
|
|
28
|
+
* Extends {@link MovieResultItem} by replacing `title` and `original_title`
|
|
29
|
+
* with their localization-agnostic equivalents, and adding a `media_type` discriminator.
|
|
30
|
+
* Hopefully both tv and movies use name and original name instead of title.
|
|
31
|
+
*/
|
|
32
|
+
export type CollectionItem = Omit<MovieResultItem, "title" | "original_title"> & {
|
|
33
|
+
/** The type of media (e.g. `"movie"` or `"tv"`), used as a discriminator */
|
|
34
|
+
media_type: MediaType;
|
|
35
|
+
/** Display name of the media item */
|
|
36
|
+
name: string;
|
|
37
|
+
/** Name of the media item in its original language */
|
|
38
|
+
original_name: string;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Represents the images associated with a TMDB collection,
|
|
42
|
+
* including backdrops and posters.
|
|
43
|
+
*/
|
|
44
|
+
export type CollectionImages = {
|
|
45
|
+
/** Unique TMDB identifier for the collection */
|
|
46
|
+
id: number;
|
|
47
|
+
/** List of backdrop images available for the collection */
|
|
48
|
+
backdrops: ImageItem[];
|
|
49
|
+
/** List of poster images available for the collection */
|
|
50
|
+
posters: ImageItem[];
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Represents the available translations for a TMDB collection.
|
|
54
|
+
*/
|
|
55
|
+
export type CollectionTranslations = {
|
|
56
|
+
/** Unique TMDB identifier for the collection */
|
|
57
|
+
id: number;
|
|
58
|
+
/** List of translations available for the collection */
|
|
59
|
+
translations: CollectionTranslationItem[];
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Represents a single translation entry for a collection,
|
|
63
|
+
* containing the localized data payload.
|
|
64
|
+
*/
|
|
65
|
+
export type CollectionTranslationItem = Translation & {
|
|
66
|
+
/** Localized data for this translation */
|
|
67
|
+
data: CollectionTranslationData;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Contains the localized fields provided by a collection translation.
|
|
71
|
+
* All fields are optional as not every translation may supply all values.
|
|
72
|
+
*/
|
|
73
|
+
export type CollectionTranslationData = {
|
|
74
|
+
/** Localized title of the collection */
|
|
75
|
+
title?: string;
|
|
76
|
+
/** Localized overview or synopsis of the collection */
|
|
77
|
+
overview?: string;
|
|
78
|
+
/** Localized homepage URL for the collection */
|
|
79
|
+
homepage?: string;
|
|
80
|
+
};
|
|
81
|
+
/** Base param used by all collection queries */
|
|
82
|
+
export type CollectionBaseParam = {
|
|
83
|
+
/** Uniquely identifies a collection in TMDB. */
|
|
84
|
+
collection_id: number;
|
|
85
|
+
};
|
|
86
|
+
export type CollectionDetailsParams = CollectionBaseParam & WithLanguage;
|
|
87
|
+
export type CollectionImagesParams = CollectionBaseParam & {
|
|
88
|
+
language?: Language | LanguageISO6391;
|
|
89
|
+
include_image_language?: Language | LanguageISO6391;
|
|
90
|
+
};
|
|
91
|
+
//# sourceMappingURL=collections.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collections.d.ts","sourceRoot":"","sources":["../../../src/types/other/collections.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC5E,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG;IACxB,gDAAgD;IAChD,EAAE,EAAE,MAAM,CAAC;IACX,qCAAqC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,qEAAqE;IACrE,iBAAiB,EAAE,MAAM,CAAC;IAC1B,sDAAsD;IACtD,aAAa,EAAE,MAAM,CAAC;IACtB,sDAAsD;IACtD,QAAQ,EAAE,MAAM,CAAC;IACjB,8GAA8G;IAC9G,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,gHAAgH;IAChH,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,8DAA8D;IAC9D,KAAK,EAAE,cAAc,EAAE,CAAC;CACxB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,eAAe,EAAE,OAAO,GAAG,gBAAgB,CAAC,GAAG;IAChF,4EAA4E;IAC5E,UAAU,EAAE,SAAS,CAAC;IACtB,qCAAqC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,sDAAsD;IACtD,aAAa,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC9B,gDAAgD;IAChD,EAAE,EAAE,MAAM,CAAC;IACX,2DAA2D;IAC3D,SAAS,EAAE,SAAS,EAAE,CAAC;IACvB,yDAAyD;IACzD,OAAO,EAAE,SAAS,EAAE,CAAC;CACrB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACpC,gDAAgD;IAChD,EAAE,EAAE,MAAM,CAAC;IACX,wDAAwD;IACxD,YAAY,EAAE,yBAAyB,EAAE,CAAC;CAC1C,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,yBAAyB,GAAG,WAAW,GAAG;IACrD,0CAA0C;IAC1C,IAAI,EAAE,yBAAyB,CAAC;CAChC,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACvC,wCAAwC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uDAAuD;IACvD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gDAAgD;IAChD,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,gDAAgD;AAChD,MAAM,MAAM,mBAAmB,GAAG;IACjC,gDAAgD;IAChD,aAAa,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,mBAAmB,GAAG,YAAY,CAAC;AACzE,MAAM,MAAM,sBAAsB,GAAG,mBAAmB,GAAG;IAC1D,QAAQ,CAAC,EAAE,QAAQ,GAAG,eAAe,CAAC;IACtC,sBAAsB,CAAC,EAAE,QAAQ,GAAG,eAAe,CAAC;CACpD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/other/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./collections";
|
package/package.json
CHANGED