3.0.0 • Published 2 years ago
@nypl/scsb-rest-client v3.0.0
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 --saveUsage
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 inCHANGELOG.md
- git tag -a v[version]
- npm publish