Comparing version 0.0.3 to 0.0.4
@@ -1,5 +0,5 @@ | ||
import { Base } from './base'; | ||
export declare class Account extends Base { | ||
import { BaseEndpoint } from './base'; | ||
export declare class AccountEndpoint extends BaseEndpoint { | ||
constructor(accessToken: string); | ||
details(): Promise<any>; | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Account = void 0; | ||
exports.AccountEndpoint = void 0; | ||
const base_1 = require("./base"); | ||
class Account extends base_1.Base { | ||
class AccountEndpoint extends base_1.BaseEndpoint { | ||
constructor(accessToken) { | ||
@@ -13,3 +13,3 @@ super(accessToken); | ||
} | ||
exports.Account = Account; | ||
exports.AccountEndpoint = AccountEndpoint; | ||
//# sourceMappingURL=account.js.map |
import Api from '../api'; | ||
export declare class Base { | ||
export declare class BaseEndpoint { | ||
protected readonly accessToken: string; | ||
@@ -4,0 +4,0 @@ protected api: Api; |
@@ -6,5 +6,5 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Base = void 0; | ||
exports.BaseEndpoint = void 0; | ||
const api_1 = __importDefault(require("../api")); | ||
class Base { | ||
class BaseEndpoint { | ||
constructor(accessToken) { | ||
@@ -15,3 +15,3 @@ this.accessToken = accessToken; | ||
} | ||
exports.Base = Base; | ||
exports.BaseEndpoint = BaseEndpoint; | ||
//# sourceMappingURL=base.js.map |
@@ -1,4 +0,4 @@ | ||
import { Base } from './base'; | ||
import { BaseEndpoint } from './base'; | ||
import { Certifications } from '../types/certification'; | ||
export declare class Certification extends Base { | ||
export declare class CertificationEndpoint extends BaseEndpoint { | ||
protected readonly accessToken: string; | ||
@@ -5,0 +5,0 @@ constructor(accessToken: string); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Certification = void 0; | ||
exports.CertificationEndpoint = void 0; | ||
const base_1 = require("./base"); | ||
class Certification extends base_1.Base { | ||
class CertificationEndpoint extends base_1.BaseEndpoint { | ||
constructor(accessToken) { | ||
@@ -17,3 +17,3 @@ super(accessToken); | ||
} | ||
exports.Certification = Certification; | ||
exports.CertificationEndpoint = CertificationEndpoint; | ||
//# sourceMappingURL=certification.js.map |
/// <reference types="node" /> | ||
import { ParsedUrlQueryInput } from 'querystring'; | ||
import { Base } from './base'; | ||
import { BaseEndpoint } from './base'; | ||
import { Changes } from '../types/changes'; | ||
@@ -10,3 +10,3 @@ export interface ChangeOptions extends ParsedUrlQueryInput { | ||
} | ||
export declare class Change extends Base { | ||
export declare class ChangeEndpoint extends BaseEndpoint { | ||
protected readonly accessToken: string; | ||
@@ -13,0 +13,0 @@ constructor(accessToken: string); |
@@ -6,6 +6,6 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Change = void 0; | ||
exports.ChangeEndpoint = void 0; | ||
const querystring_1 = __importDefault(require("querystring")); | ||
const base_1 = require("./base"); | ||
class Change extends base_1.Base { | ||
class ChangeEndpoint extends base_1.BaseEndpoint { | ||
constructor(accessToken) { | ||
@@ -28,3 +28,3 @@ super(accessToken); | ||
} | ||
exports.Change = Change; | ||
exports.ChangeEndpoint = ChangeEndpoint; | ||
//# sourceMappingURL=changes.js.map |
@@ -1,4 +0,4 @@ | ||
import { Base } from './base'; | ||
import { BaseEndpoint } from './base'; | ||
import { CreditResponse } from '../types/credits'; | ||
export declare class Credits extends Base { | ||
export declare class CreditsEndpoint extends BaseEndpoint { | ||
protected readonly accessToken: string; | ||
@@ -5,0 +5,0 @@ constructor(accessToken: string); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Credits = void 0; | ||
exports.CreditsEndpoint = void 0; | ||
const base_1 = require("./base"); | ||
class Credits extends base_1.Base { | ||
class CreditsEndpoint extends base_1.BaseEndpoint { | ||
constructor(accessToken) { | ||
@@ -14,3 +14,3 @@ super(accessToken); | ||
} | ||
exports.Credits = Credits; | ||
exports.CreditsEndpoint = CreditsEndpoint; | ||
//# sourceMappingURL=credits.js.map |
import TMDB from './tmdb'; | ||
export * from './types'; | ||
export default TMDB; |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -7,3 +17,4 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
const tmdb_1 = __importDefault(require("./tmdb")); | ||
__exportStar(require("./types"), exports); | ||
exports.default = tmdb_1.default; | ||
//# sourceMappingURL=index.js.map |
@@ -1,12 +0,13 @@ | ||
import { Account } from './endpoints/account'; | ||
import { Certification } from './endpoints/certification'; | ||
import { Change } from './endpoints/changes'; | ||
import { Credits } from './endpoints/credits'; | ||
import { AccountEndpoint, CertificationEndpoint, ChangeEndpoint, CreditsEndpoint, GenreEndpoint, MoviesEndpoint, SearchEndpoint, ConfigurationEndpoint } from './endpoints'; | ||
export default class TMDB { | ||
private readonly accessToken; | ||
constructor(accessToken: string); | ||
get account(): Account; | ||
get certifications(): Certification; | ||
get changes(): Change; | ||
get credits(): Credits; | ||
get account(): AccountEndpoint; | ||
get configuration(): ConfigurationEndpoint; | ||
get certifications(): CertificationEndpoint; | ||
get changes(): ChangeEndpoint; | ||
get credits(): CreditsEndpoint; | ||
get search(): SearchEndpoint; | ||
get genres(): GenreEndpoint; | ||
get movies(): MoviesEndpoint; | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const account_1 = require("./endpoints/account"); | ||
const certification_1 = require("./endpoints/certification"); | ||
const changes_1 = require("./endpoints/changes"); | ||
const credits_1 = require("./endpoints/credits"); | ||
const endpoints_1 = require("./endpoints"); | ||
class TMDB { | ||
@@ -12,15 +9,27 @@ constructor(accessToken) { | ||
get account() { | ||
return new account_1.Account(this.accessToken); | ||
return new endpoints_1.AccountEndpoint(this.accessToken); | ||
} | ||
get configuration() { | ||
return new endpoints_1.ConfigurationEndpoint(this.accessToken); | ||
} | ||
get certifications() { | ||
return new certification_1.Certification(this.accessToken); | ||
return new endpoints_1.CertificationEndpoint(this.accessToken); | ||
} | ||
get changes() { | ||
return new changes_1.Change(this.accessToken); | ||
return new endpoints_1.ChangeEndpoint(this.accessToken); | ||
} | ||
get credits() { | ||
return new credits_1.Credits(this.accessToken); | ||
return new endpoints_1.CreditsEndpoint(this.accessToken); | ||
} | ||
get search() { | ||
return new endpoints_1.SearchEndpoint(this.accessToken); | ||
} | ||
get genres() { | ||
return new endpoints_1.GenreEndpoint(this.accessToken); | ||
} | ||
get movies() { | ||
return new endpoints_1.MoviesEndpoint(this.accessToken); | ||
} | ||
} | ||
exports.default = TMDB; | ||
//# sourceMappingURL=tmdb.js.map |
{ | ||
"name": "tmdb-ts", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "TMDB v3 library wrapper", | ||
"main": "dist/index.ts", | ||
"types": "dist/index.d.ts", | ||
"types": "dist/types/index.d.ts", | ||
"scripts": { | ||
"compile": "rm -rf dist && tsc -d", | ||
"lint": "eslint --ext .ts lib/", | ||
"lint:fix": "eslint --ext .ts lib/ --fix", | ||
"prepublish": "tsc" | ||
"compile": "rm -rf dist && tsc -d && npm run copy-types", | ||
"lint": "eslint --ext .ts src/", | ||
"lint:fix": "eslint --ext .ts src/ --fix", | ||
"prepublish": "tsc", | ||
"copy-types": "mkdir dist/types && cp src/types/*.d.ts dist/types" | ||
}, | ||
@@ -35,2 +36,3 @@ "bugs": { | ||
"@typescript-eslint/parser": "^4.23.0", | ||
"dotenv": "^9.0.2", | ||
"eslint": "^7.26.0", | ||
@@ -43,3 +45,2 @@ "eslint-config-airbnb-base": "^14.2.1", | ||
"dependencies": { | ||
"dotenv": "^9.0.2", | ||
"node-fetch": "^2.6.1" | ||
@@ -46,0 +47,0 @@ }, |
# tmdb-ts | ||
Typescript implementation of [TMDB](https://developers.themoviedb.org/) v3. | ||
Typescript library wrapper of [TMDB API](https://developers.themoviedb.org/) v3 . | ||
This uses authenication token for requests so there is no need to append api key to the url. | ||
This uses new jwt authentication token for requests so there is no need to append api key to the url. | ||
Once you have registered for access to the api you can use your access token as follows: | ||
Installation: | ||
`` | ||
npm install --save tmdb-ts | ||
`` | ||
```js | ||
import TMDB from 'tmdb-ts'; | ||
const tmdb = new TMDB('accessToken'); | ||
try { | ||
const movies = await tmdb.search.movies({ query: 'American Pie' }); | ||
console.log(movies); | ||
} catch(err) { | ||
// handle error | ||
} | ||
``` | ||
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
49632
1
53
1395
32
10
1
- Removeddotenv@^9.0.2
- Removeddotenv@9.0.2(transitive)