lor-sdk
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

LOR - SDK

Lor SDK is a node.js pacage and its serves your needs regarding data about The Lord of the Rings

Get started

This is a Node.js module available through the npm registry. Installation is done using the npm install command:

npm install lor-sdk --save

Usage

Sample usage

import { LorLib, AuthConfig } from "lor-sdk";

const authOptions: AuthConfig = {
    accessKey: "" // optional parameter
    baseUrl: ""  // optional parameter
 }

const lorService = new LorLib(authOptions);

if accessKey Or baseUrl is not passed while creating the instance, add those variables in env file.

generate the accesstoken from here

LOR_LIB_BASE_URL=https://the-one-api.dev/v2
LOR_LIB_ACCESS_KEY="acceessToken"

All available services

interface QueryParams {
    page?: number;
    limit?: number;
    offset?: number;
}

getMovies: (queryParms?: QueryParams) =>
    Promise<import("axios").AxiosResponse<any, any>>;

getMovieById: (movieId: string) => Promise<any>;

getOneMovieAndQuotes: (movieId: string, queryParms?: QueryParams) =>
    Promise<any>;

getOneMovieQuotes: (movieId: string, queryParms?: QueryParams) => Promise<any>;

getQuotes: (queryParms?: QueryParams) => Promise<any>;

getQuoteById: (quoteId: string) => Promise<any>;

Methods

  1. getMovies await lorService.getMovies(queryParms?: QueryParams) List of all movies, including the "The Lord of the Rings" and the "The Hobbit" trilogies and pagination enabled.
  2. getMovieById await lorService.getMovieById(movieId: string) Request one specific movie
  3. getOneMovieAndQuotes await lorService.getOneMovieAndQuotes(movieId: string, queryParms?: QueryParams) Request all movie quotes for one specific movie (only working for the LotR trilogy), Pagination is enabled.
  4. getOneMovieQuotes await lorService.getOneMovieQuotes(movieId: string, queryParms?: QueryParams) Request all movie quotes for one specific movie and movie details also will be fetched. (only working for the LotR trilogy), Pagination is enabled.
  5. getQuotes await lorService.getQuotes(queryParms?: QueryParams) List of all movie quotes. Pagination is enabled.
  6. getQuoteById await lorService.getQuoteById(quoteId: string) Fetch one quote by id

Readme

Keywords

none

Package Sidebar

Install

npm i lor-sdk

Weekly Downloads

1

Version

1.1.1

License

ISC

Unpacked Size

90.7 kB

Total Files

22

Last publish

Collaborators

  • jeeskdenny