@chrissung/the-one-sdk-node
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

The One SDK for Node.js

This SDK allows one to connect to the The One API to get lists of movies, books, characters, quotes, and more.

How to install

npm install @chrissung/the-one-sdk-node

How to Use

const { Client } = require("@chrissung/the-one-sdk-node");
const client = new Client({
  accessToken: "<your-access-token-here",
});

async function run() {
  // Get a list of movies
  const movies = await client.getMovies({
    pagination: {
      limit: 5,
    },
  });

  console.log(movies);
}

run().catch(console.log);

Query Options for Lists

DomainQueryOptions {
    pagination: {
        limit: number;
        page: number;
        offset: number;
    }
    sort:
        sort: string;
    }
}

SDK Methods

Movies

Get a list of movies
async getMovies(options: DomainQueryOptions): Promise<Movie[]>

Get a single movie
async getMovie(id: string): Promise<Movie>

Get a list of quotes from a movie
getMovieQuotes(id: string, options: DomainQueryOptions): Promise<Quote[]>

Quotes

Get a list of quotes
async getQuotes(options: DomainQueryOptions): Promise<Quote[]>

Get a single quote
async getQuote(id: string): Promise<Quote>

Books

coming soon!

Characters

coming soon!

Chapters

coming soon!

Dependencies (6)

Dev Dependencies (25)

Package Sidebar

Install

npm i @chrissung/the-one-sdk-node

Weekly Downloads

0

Version

1.0.2

License

ISC

Unpacked Size

76.4 kB

Total Files

55

Last publish

Collaborators

  • chrissung