@lorenzopant/tmdb 1.2.0 → 1.3.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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # TMDB API TS
1
+ # 🍿 @lorenzopant/tmdb
2
2
 
3
3
  A **TypeScript-first** lightweight client for [The Movie Database (TMDB)](https://developer.themoviedb.org/docs/getting-started) API.
4
4
 
@@ -9,7 +9,7 @@ Feel free to open pull requests on the project repository.
9
9
  - 🔥 Simple and tiny wrapper
10
10
  - 🚀 Designed for server-side and frontend use (NextJS, React, Vue, etc.)
11
11
 
12
- ## Full documentation is available at [@lorenzopant/tmdb](https://lorenzopant-docs.vercel.app/)
12
+ ## Full documentation is available at [@lorenzopant/tmdb](https://lorenzopant-tmdb-docs.vercel.app)
13
13
 
14
14
  ---
15
15
 
@@ -17,6 +17,10 @@ Feel free to open pull requests on the project repository.
17
17
 
18
18
  ```bash
19
19
  npm install @lorenzopant/tmdb
20
+ // or
21
+ pnpm add @lorenzopant/tmdb
22
+ // or
23
+ yard add @lorenzopant/tmdb
20
24
  ```
21
25
 
22
26
  ---
@@ -0,0 +1,21 @@
1
+ import { Certifications } from "../types";
2
+ import { TMDBAPIBase } from "./base";
3
+ export declare class CertificationsAPI extends TMDBAPIBase {
4
+ /**
5
+ * Movie Certifications
6
+ * GET - https://api.themoviedb.org/3/certification/movie/list
7
+ *
8
+ * Get an up to date list of the officially supported movie certifications on TMDB.
9
+ * @reference https://developer.themoviedb.org/reference/certification-movie-list
10
+ */
11
+ movie_certifications(): Promise<Certifications>;
12
+ /**
13
+ * TV Certifications
14
+ * GET - https://api.themoviedb.org/3/certification/tv/list
15
+ *
16
+ * Get an up to date list of the officially supported tv certifications on TMDB.
17
+ * @reference https://developer.themoviedb.org/reference/certification-tv-list
18
+ */
19
+ tv_certifications(): Promise<Certifications>;
20
+ }
21
+ //# sourceMappingURL=certifications.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"certifications.d.ts","sourceRoot":"","sources":["../../src/endpoints/certifications.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,qBAAa,iBAAkB,SAAQ,WAAW;IACjD;;;;;;OAMG;IACG,oBAAoB,IAAI,OAAO,CAAC,cAAc,CAAC;IAIrD;;;;;;OAMG;IACG,iBAAiB,IAAI,OAAO,CAAC,cAAc,CAAC;CAGlD"}
@@ -0,0 +1,24 @@
1
+ import { ENDPOINTS } from "../routes";
2
+ import { TMDBAPIBase } from "./base";
3
+ export class CertificationsAPI extends TMDBAPIBase {
4
+ /**
5
+ * Movie Certifications
6
+ * GET - https://api.themoviedb.org/3/certification/movie/list
7
+ *
8
+ * Get an up to date list of the officially supported movie certifications on TMDB.
9
+ * @reference https://developer.themoviedb.org/reference/certification-movie-list
10
+ */
11
+ async movie_certifications() {
12
+ return this.client.request(ENDPOINTS.CERTIFICATIONS.MOVIE_CERTIFICATIONS);
13
+ }
14
+ /**
15
+ * TV Certifications
16
+ * GET - https://api.themoviedb.org/3/certification/tv/list
17
+ *
18
+ * Get an up to date list of the officially supported tv certifications on TMDB.
19
+ * @reference https://developer.themoviedb.org/reference/certification-tv-list
20
+ */
21
+ async tv_certifications() {
22
+ return this.client.request(ENDPOINTS.CERTIFICATIONS.TV_CERTIFICATIONS);
23
+ }
24
+ }
package/dist/routes.d.ts CHANGED
@@ -7,5 +7,9 @@ export declare const ENDPOINTS: {
7
7
  TIMEZONES: string;
8
8
  PRIMARY_TRANSLATIONS: string;
9
9
  };
10
+ CERTIFICATIONS: {
11
+ MOVIE_CERTIFICATIONS: string;
12
+ TV_CERTIFICATIONS: string;
13
+ };
10
14
  };
11
15
  //# sourceMappingURL=routes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS;;;;;;;;;CASrB,CAAC"}
1
+ {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS;;;;;;;;;;;;;CAarB,CAAC"}
package/dist/routes.js CHANGED
@@ -7,4 +7,8 @@ export const ENDPOINTS = {
7
7
  TIMEZONES: "/configuration/timezones",
8
8
  PRIMARY_TRANSLATIONS: "/configuration/primary_translations",
9
9
  },
10
+ CERTIFICATIONS: {
11
+ MOVIE_CERTIFICATIONS: "/certification/movie/list",
12
+ TV_CERTIFICATIONS: "/certification/tv/list",
13
+ },
10
14
  };
package/dist/tmdb.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { CertificationsAPI } from "./endpoints/certifications";
1
2
  import { ConfigurationAPI } from "./endpoints/configuration";
2
3
  import { GenresAPI } from "./endpoints/genres";
3
4
  import { MovieListsAPI } from "./endpoints/movie_lists";
@@ -18,6 +19,7 @@ export declare class TMDB {
18
19
  genres: GenresAPI;
19
20
  tv_lists: TVSeriesListsAPI;
20
21
  tv_series: TVSeriesAPI;
22
+ certifications: CertificationsAPI;
21
23
  /**
22
24
  * Creates a new TMDB instance.
23
25
  * @param accessToken The TMDB API access token.
@@ -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,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,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,O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a,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;IAGzC;;;;OAIG;gBACS,WAAW,EAAE,MAAM,EAAE,OAAO,GAAE,WAAgB;CAc1D"}
package/dist/tmdb.js CHANGED
@@ -1,5 +1,6 @@
1
1
  // src.tmdb.ts
2
2
  import { ApiClient } from "./client";
3
+ import { CertificationsAPI } from "./endpoints/certifications";
3
4
  import { ConfigurationAPI } from "./endpoints/configuration";
4
5
  import { GenresAPI } from "./endpoints/genres";
5
6
  import { MovieListsAPI } from "./endpoints/movie_lists";
@@ -20,6 +21,7 @@ export class TMDB {
20
21
  genres;
21
22
  tv_lists;
22
23
  tv_series;
24
+ certifications;
23
25
  // etc...
24
26
  /**
25
27
  * Creates a new TMDB instance.
@@ -39,5 +41,6 @@ export class TMDB {
39
41
  this.genres = new GenresAPI(this.client, this.options);
40
42
  this.tv_lists = new TVSeriesListsAPI(this.client, this.options);
41
43
  this.tv_series = new TVSeriesAPI(this.client, this.options);
44
+ this.certifications = new CertificationsAPI(this.client, this.options);
42
45
  }
43
46
  }
@@ -0,0 +1,20 @@
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
+ };
20
+ //# sourceMappingURL=certifications.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"certifications.d.ts","sourceRoot":"","sources":["../../../src/types/common/certifications.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE7C;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC/B,4FAA4F;IAC5F,aAAa,EAAE,MAAM,CAAC;IACtB,2FAA2F;IAC3F,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2FAA2F;IAC3F,KAAK,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC5B,uGAAuG;IACvG,cAAc,EAAE,MAAM,CAAC,gBAAgB,EAAE,iBAAiB,EAAE,CAAC,CAAC;CAC9D,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -2,4 +2,5 @@ export * from "./changes";
2
2
  export * from "./media";
3
3
  export * from "./pagination";
4
4
  export * from "./params";
5
+ export * from "./certifications";
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC"}
@@ -2,3 +2,4 @@ export * from "./changes";
2
2
  export * from "./media";
3
3
  export * from "./pagination";
4
4
  export * from "./params";
5
+ export * from "./certifications";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lorenzopant/tmdb",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "A completely type-safe The Movie Database (TMDB) API wrapper for typescript applications.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",