@nypl/scsb-rest-client

3.0.0 • Public • Published

SCSBRestClient

This is a light wrapper around SCSB's RESTful interace.

Version

3.0.0

Install

With Github

"@nypl/scsb-rest-client": "https://github.com/NYPL/scsb-rest-client.git#BRANCH-OR-TAG-NAME"

With NPM

npm i @nypl/scsb-rest-client --save

Usage

const scsbClient = require('@nypl/scsb-rest-client')

scsbClient.config({
  url: "http://theurl.example.com:theports",
  apiKey: "anAPIKEY"
})

let myResponse = scsbClient.getItemsAvailabilityForBarcodes(this.barcodes)
.then((response) => {
  // do something with the response
})
.catch((error) => {
  // log this error and...
  return Promise.reject(error)
})

Supported Endpoints

See the SCSB swagger documentation for the authoritative documentation of each endpoint's params.

Method Endpoint
getItemsAvailabilityForBarcodes(barcodes = []) /sharedCollection/itemAvailabilityStatus
requestItem(data = {}) /requestItem/requestItem
search(data = {}) /searchService/search
searchByParam(queryParams = {}) /searchService/searchByParam(deprecated)

Contributing

  • Cut feature branch from main
  • After review, merge to main
  • Bump version in package.json & note changes in CHANGELOG.md
  • git tag -a v[version]
  • npm publish

Readme

Keywords

Package Sidebar

Install

npm i @nypl/scsb-rest-client

Weekly Downloads

38

Version

3.0.0

License

MIT

Unpacked Size

16.4 kB

Total Files

10

Last publish

Collaborators

  • avertrees
  • mansell77
  • bigfishdesign
  • jackiequach
  • toxiapo
  • charmingduchess-nypl
  • samandrews
  • oliviawong
  • thespicemustflow
  • danielappel
  • nonword
  • gkallenberg
  • crystalngai
  • kristo_