1.0.6 • Published 11 months ago

askfrodo v1.0.6

Weekly downloads
-
License
ISC
Repository
-
Last release
11 months ago

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
1.0.6

11 months ago

1.0.5

11 months ago

1.0.4

11 months ago

1.0.3

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago