Lor SDK is a node.js pacage and its serves your needs regarding data about The Lord of the Rings
This is a Node.js module available through the npm registry. Installation is done using the npm install command:
npm install lor-sdk --save
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"
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>;
-
getMovies
List of all movies, including the "The Lord of the Rings" and the "The Hobbit" trilogies and pagination enabled.await lorService.getMovies(queryParms?: QueryParams)
-
getMovieById
Request one specific movieawait lorService.getMovieById(movieId: string)
-
getOneMovieAndQuotes
Request all movie quotes for one specific movie (only working for the LotR trilogy), Pagination is enabled.await lorService.getOneMovieAndQuotes(movieId: string, queryParms?: QueryParams)
-
getOneMovieQuotes
Request all movie quotes for one specific movie and movie details also will be fetched. (only working for the LotR trilogy), Pagination is enabled.await lorService.getOneMovieQuotes(movieId: string, queryParms?: QueryParams)
-
getQuotes
List of all movie quotes. Pagination is enabled.await lorService.getQuotes(queryParms?: QueryParams)
-
getQuoteById
Fetch one quote by idawait lorService.getQuoteById(quoteId: string)