1.0.6 • Published 11 months ago
askfrodo v1.0.6
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
- 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);
})
- Get Single Movie by Id
askFrodo.functions.getMovieById({ id: string }).then((movie) => {
console.log(movie.data.docs);
})
- 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);
})
- 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);
})
- 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