4.0.0 • Published 3 years ago
@maxqwars/xconnect v4.0.0
XConnect
XConnect is an open library for working with AniLibria REST API. Using a modern API based on promises.
Installation
npm i @maxqwars/xconnect
Example of working with XConnect
Getting information about a random release using XConnect components
Using the XConnect module (recommended)
import { Database } from '@maxqwars/xconnect'
const XDatabase = new Database('api.service.com/v2/')
XDatabase.getRandomTitle({ /* query params */ })
.then(title => console.log(title))
.catch(e => onErrorCallback())
Using core classes (if target platform not support fetch, async/await, Promises)
import { URLBuilder, TitleQueryBuilder, API_ENDPOINTS_ENUM } from '@maxqwars/xconnect'
const U_BUILDER = new URLBuilder('api.service.com/v2/', true)
const QUERY_BUILDER = new TitleQueryBuilder()
const requestUrl = U_BUILDER()
.useEndpoint(API_ENDPOINTS_ENUM.GET_TITLE)
.useQuery(QUERY_BUILDER.code('release-code').build())
.build()
Current API support status
- getTitle
- getTitles
- getUpdates
- getChanges
- getSchedule
- getRandomTitle
- getYouTube
- getFeed
- getYears
- getGenres
- getCachingNodes
- getTeam
- getSeedStats
- getRSS
- searchTitles
- advancedSearch
- getFavorites
- addFavorite
- delFavorite