npm.io
4.0.0 • Published 4 years ago

@maxqwars/xconnect

Licence
MIT
Version
4.0.0
Deps
0
Size
43 kB
Vulns
0
Weekly
0

Xconnect logo

XConnect

XConnect is an open library for working with AniLibria REST API. Using a modern API based on promises.

Live demo - Online docs

Installation

npm i @maxqwars/xconnect

Example of working with XConnect

Getting information about a random release using XConnect components

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

Keywords