1.0.1 • Published 1 year ago
amarty-lotr-sdk v1.0.1
OleksandrAmartyApiSdk
This project was generated with:
-angular version 12.0.2
-node version 14.17.0
-npm 6.14.13
Instruction
This is an SDK (Software Development Kit) that facilitates interaction with a movie data API.
The SDK provides a set of features, including the ability to retrieve movies based on their ID,
fetch all available movies, and get quotes for a specific movie using its ID.
Usage
Add package
npm i amarty-lotr-sdk
Update imports in module
ApiMovieModule.forRoot({
apiUrl : environment.apiUrl, // api main url
token : environment.token, // your personal token
})
Update constructor in component
constructor(private readonly apiService: ApiMovieService) {}
Call methods
getMovieList(limit: number, page: number): Observable<IMovieListModel | null>
getMovie(id: string | null): Observable<IMovieModel | null>
getMovieQuotes(id: string | null, limit: number, page: number): Observable<IQuoteListModel | null>
Models
export interface IPaginatorModel {
total: number | null,
limit: number | null,
offset: number | null,
page: number | null,
pages: number | null,
}
export interface IMovieListModel extends IPaginatorModel{
items: IMovieModel[] | null,
}
export interface IMovieModel {
movieId: string | null,
movieName: string | null,
duration: number | null,
budget: number | null,
revenue: number | null,
nominations: number | null,
wins: number | null,
rating: number | null,
}
export interface IQuoteListModel extends IPaginatorModel {
items: IQuoteModel[] | null,
}
export interface IQuoteModel {
quoteId: string | null,
dialog: string | null,
movieId: string | null,
characterId: string | null,
id: string | null,
}
Scripts
Command | Description |
---|---|
build-library | Rebuild your library |
pack-lib | Create new version of tgz file |
NOTE: file:../oleksandr-amarty-api-sdk/dist/oleksandr-amarty-api-sdk/oleksandr-amarty-api-sdk-{your_version_here}.tgz
NOTE: For changing version - open projects' package.json
Develop
Run
Run ng serve
for a dev server. Navigate to http://localhost:4200/
. The app will automatically reload if you change any of the source files.
Code scaffolding
Run ng generate component component-name
to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module
.
Build
Run ng build
to build the project. The build artifacts will be stored in the dist/
directory.
Running unit tests
Run ng test
to execute the unit tests via Karma.
Running end-to-end tests
Run ng e2e
to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
Further help
To get more help on the Angular CLI use ng help
or go check out the Angular CLI Overview and Command Reference page.