npm.io
1.0.6 • Published 3 years ago

askfrodo

Licence
ISC
Version
1.0.6
Deps
2
Size
15 kB
Vulns
0
Weekly
0

Lord of the Rings SDK

Description

This is an SDK for The One API to rule them all it has been built to the specification in the documentation here

Usage

To install


  npm install askfrodo

  yarn add askfrodo

You will need to sign up and get an Access Token here. Then initialize the library


  import { AskFrodo } from 'askfrodo'

  const askFrodo = new AskFrodo({
    accessToken: "ACCESS_TOKEN"
  });

Listed are the features of the SDK

  1. Get All Movies
  askFrodo.functions.getMovie({
    pagination?: {
      page?: number;
      limit?: number;
      offset?: number;
    };
    filtering?: {
      budgetInMillions? : {
        sign: "gt" | "lt" | "gte" | "lte" | "eq";
        value: number;
      };
      runtimeInMinutes? : {
        sign: "gt" | "lt" | "gte" | "lte" | "eq";
        value: number;
      };
      academyAwardWins? : {
        sign: "gt" | "lt" | "gte" | "lte" | "eq";
        value: number;
      };
    }
  }).then((movie) => {
    console.log(movie.data.docs);
  })
  1. Get Single Movie by Id
  askFrodo.functions.getMovieById({ id: string }).then((movie) => {
    console.log(movie.data.docs);
  })
  1. Get All Quote in a Single Movie
  askFrodo.functions.getMovieQuote({
    id: string;
    pagination?: {
      page?: number;
      limit?: number;
      offset?: number;
    }
  }).then((movie) => {
    console.log(movie.data.docs);
  })
  1. Get All Quotes
  askFrodo.functions.getQuote({
    sorting?: {
      value?: string;
      order?: "asc" | "desc";
    };
    pagination?: {
      page?: number;
      limit?: number;
      offset?: number;
    }
  }).then((movie) => {
    console.log(movie.data.docs);
  })
  1. Get Single Quote by Id
  askFrodo.functions.getQuoteById({
    id: string;
  }).then((movie) => {
    console.log(movie.data.docs);
  })
Testing
npm test

yarn test
Build
npm run build

yarn build
Publish
npm publish

yarn publish