@lorenzopant/tmdb 1.0.4 → 1.0.6
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/endpoints/genres.d.ts +30 -0
- package/dist/endpoints/genres.d.ts.map +1 -0
- package/dist/endpoints/genres.js +35 -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/genres.d.ts +8 -0
- package/dist/types/genres.d.ts.map +1 -0
- package/dist/types/genres.js +2 -0
- package/package.json +62 -63
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { TMDBCommonParams } from "../types";
|
|
2
|
+
import { GenresResponse } from "../types/genres";
|
|
3
|
+
import { TMDBAPIBase } from "./base";
|
|
4
|
+
export declare const GENRES_ENDPOINTS: {
|
|
5
|
+
MOVIE_LIST: string;
|
|
6
|
+
TV_LIST: string;
|
|
7
|
+
};
|
|
8
|
+
export declare class GenresAPI extends TMDBAPIBase {
|
|
9
|
+
/**
|
|
10
|
+
* Movie List
|
|
11
|
+
* GET - https://api.themoviedb.org/3/genre/movie/list
|
|
12
|
+
*
|
|
13
|
+
* Get the list of official genres for movies.
|
|
14
|
+
* @param language The language to use for the response.
|
|
15
|
+
* @returns A promise that resolves to the genres list.
|
|
16
|
+
* @reference https://developer.themoviedb.org/reference/genre-movie-list
|
|
17
|
+
*/
|
|
18
|
+
movie_list(params?: Pick<TMDBCommonParams, "language">): Promise<GenresResponse>;
|
|
19
|
+
/**
|
|
20
|
+
* TV List
|
|
21
|
+
* GET - https://api.themoviedb.org/3/genre/tv/list
|
|
22
|
+
*
|
|
23
|
+
* Get the list of official genres for TV shows.
|
|
24
|
+
* @param language The language to use for the response.
|
|
25
|
+
* @returns A promise that resolves to the genres list.
|
|
26
|
+
* @reference https://developer.themoviedb.org/reference/genre-tv-list
|
|
27
|
+
*/
|
|
28
|
+
tv_list(params?: Pick<TMDBCommonParams, "language">): Promise<GenresResponse>;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=genres.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"genres.d.ts","sourceRoot":"","sources":["../../src/endpoints/genres.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,eAAO,MAAM,gBAAgB;;;CAG5B,CAAC;AAEF,qBAAa,SAAU,SAAQ,WAAW;IACzC;;;;;;;;OAQG;IACG,UAAU,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC;IAItF;;;;;;;;OAQG;IACG,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC;CAGnF"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GenresAPI = exports.GENRES_ENDPOINTS = void 0;
|
|
4
|
+
const base_1 = require("./base");
|
|
5
|
+
exports.GENRES_ENDPOINTS = {
|
|
6
|
+
MOVIE_LIST: "/genre/movie/list",
|
|
7
|
+
TV_LIST: "/genre/tv/list",
|
|
8
|
+
};
|
|
9
|
+
class GenresAPI extends base_1.TMDBAPIBase {
|
|
10
|
+
/**
|
|
11
|
+
* Movie List
|
|
12
|
+
* GET - https://api.themoviedb.org/3/genre/movie/list
|
|
13
|
+
*
|
|
14
|
+
* Get the list of official genres for movies.
|
|
15
|
+
* @param language The language to use for the response.
|
|
16
|
+
* @returns A promise that resolves to the genres list.
|
|
17
|
+
* @reference https://developer.themoviedb.org/reference/genre-movie-list
|
|
18
|
+
*/
|
|
19
|
+
async movie_list(params) {
|
|
20
|
+
return this.client.request(exports.GENRES_ENDPOINTS.MOVIE_LIST, this.withLanguage(params));
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* TV List
|
|
24
|
+
* GET - https://api.themoviedb.org/3/genre/tv/list
|
|
25
|
+
*
|
|
26
|
+
* Get the list of official genres for TV shows.
|
|
27
|
+
* @param language The language to use for the response.
|
|
28
|
+
* @returns A promise that resolves to the genres list.
|
|
29
|
+
* @reference https://developer.themoviedb.org/reference/genre-tv-list
|
|
30
|
+
*/
|
|
31
|
+
async tv_list(params) {
|
|
32
|
+
return this.client.request(exports.GENRES_ENDPOINTS.TV_LIST, this.withLanguage(params));
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.GenresAPI = GenresAPI;
|
package/dist/tmdb.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ConfigurationAPI } from "./endpoints/configuration";
|
|
2
|
+
import { GenresAPI } from "./endpoints/genres";
|
|
2
3
|
import { MovieListsAPI } from "./endpoints/movie_lists";
|
|
3
4
|
import { MoviesAPI } from "./endpoints/movies";
|
|
4
5
|
import { SearchAPI } from "./endpoints/search";
|
|
@@ -12,6 +13,7 @@ export declare class TMDB {
|
|
|
12
13
|
search: SearchAPI;
|
|
13
14
|
images: ImageAPI;
|
|
14
15
|
config: ConfigurationAPI;
|
|
16
|
+
genres: GenresAPI;
|
|
15
17
|
/**
|
|
16
18
|
* Creates a new TMDB instance.
|
|
17
19
|
* @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,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAA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ty(exports, "__esModule", { value: true });
|
|
|
4
4
|
exports.TMDB = void 0;
|
|
5
5
|
const client_1 = require("./client");
|
|
6
6
|
const configuration_1 = require("./endpoints/configuration");
|
|
7
|
+
const genres_1 = require("./endpoints/genres");
|
|
7
8
|
const movie_lists_1 = require("./endpoints/movie_lists");
|
|
8
9
|
const movies_1 = require("./endpoints/movies");
|
|
9
10
|
const search_1 = require("./endpoints/search");
|
|
@@ -17,6 +18,7 @@ class TMDB {
|
|
|
17
18
|
search;
|
|
18
19
|
images;
|
|
19
20
|
config;
|
|
21
|
+
genres;
|
|
20
22
|
// etc...
|
|
21
23
|
/**
|
|
22
24
|
* Creates a new TMDB instance.
|
|
@@ -33,6 +35,7 @@ class TMDB {
|
|
|
33
35
|
this.search = new search_1.SearchAPI(this.client, this.options);
|
|
34
36
|
this.images = new images_1.ImageAPI(this.options.images);
|
|
35
37
|
this.config = new configuration_1.ConfigurationAPI(this.client, this.options);
|
|
38
|
+
this.genres = new genres_1.GenresAPI(this.client, this.options);
|
|
36
39
|
}
|
|
37
40
|
}
|
|
38
41
|
exports.TMDB = TMDB;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"genres.d.ts","sourceRoot":"","sources":["../../src/types/genres.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,GAAG;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC5B,MAAM,EAAE,KAAK,EAAE,CAAC;CAChB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,64 +1,63 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
2
|
+
"name": "@lorenzopant/tmdb",
|
|
3
|
+
"version": "1.0.6",
|
|
4
|
+
"description": "A completely type-safe The Movie Database (TMDB) API wrapper for typescript applications.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/lorenzopant/tmdb"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://lorenzopant-docs.vercel.app/",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/lorenzopant/tmdb/issues"
|
|
14
|
+
},
|
|
15
|
+
"author": "Lorenzo Pantano",
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"keywords": [
|
|
18
|
+
"tmdb",
|
|
19
|
+
"typescript",
|
|
20
|
+
"api",
|
|
21
|
+
"movies"
|
|
22
|
+
],
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@eslint/compat": "^2.0.0",
|
|
25
|
+
"@eslint/eslintrc": "^3.3.1",
|
|
26
|
+
"@eslint/js": "^9.30.0",
|
|
27
|
+
"@types/node": "^22.15.2",
|
|
28
|
+
"@typescript-eslint/eslint-plugin": "^8.35.0",
|
|
29
|
+
"@typescript-eslint/parser": "^8.35.0",
|
|
30
|
+
"@vitest/coverage-v8": "^4.0.9",
|
|
31
|
+
"@vitest/ui": "^4.0.10",
|
|
32
|
+
"dotenv": "^16.5.0",
|
|
33
|
+
"eslint": "^9.30.0",
|
|
34
|
+
"eslint-config-prettier": "^10.1.5",
|
|
35
|
+
"eslint-plugin-import": "^2.32.0",
|
|
36
|
+
"husky": "^9.1.7",
|
|
37
|
+
"release-it": "^19.0.3",
|
|
38
|
+
"release-it-pnpm": "^4.6.6",
|
|
39
|
+
"typescript": "^5.8.3",
|
|
40
|
+
"typescript-eslint": "^8.35.0",
|
|
41
|
+
"vite": "^7.0.0",
|
|
42
|
+
"vitest": "^4.0.9"
|
|
43
|
+
},
|
|
44
|
+
"exports": {
|
|
45
|
+
".": {
|
|
46
|
+
"import": "./dist/index.js",
|
|
47
|
+
"types": "./dist/index.d.ts"
|
|
48
|
+
},
|
|
49
|
+
"./types": {
|
|
50
|
+
"types": "./dist/types/index.d.ts",
|
|
51
|
+
"default": "./dist/types/index.js"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"scripts": {
|
|
55
|
+
"build": "tsc",
|
|
56
|
+
"build:watch": "tsc --watch",
|
|
57
|
+
"test": "vitest",
|
|
58
|
+
"test:ui": "vitest --ui",
|
|
59
|
+
"test:coverage": "vitest --coverage",
|
|
60
|
+
"lint": "eslint .",
|
|
61
|
+
"patch": "npm version patch && npm publish"
|
|
62
|
+
}
|
|
63
|
+
}
|