
Security News
Feross on the 10 Minutes or Less Podcast: Nobody Reads the Code
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.
@nypl/sierra-wrapper
Advanced tools
A basic node wrapper for the III Sierra v3/v6 API
The wrapper currently supports:
In addition there are general methods that can be used to make any GET POST PUT or DELETE request:
Load the client as follows:
const wrapper = require('@nypl/sierra-wrapper')
To configure credentials there are three options:
{
"key": "YOURKEY",
"secret": "YOURSECRET",
"base": "https://your.domain.name.org/iii/sierra-api/v3/"
}
You then authorize and request by
const wrapper = require('@nypl/sierra-wrapper')
wrapper.config('./path/to/config.json')
wrapper.config(options)
SIERRA_KEY, SIERRA_SECRET, SIERRA_BASEThe following retrieves a bunch of bib ids:
const printBibIds = async () => {
try {
const bibs = await wrapper.get('bibs')
console.log('Got bibs:', bibs.entries.map(b => b.id))
} catch (e) {
console.log(e.message)
}
}
booleanLoads a config object, passed or from disk
Returns: boolean - did it load or not
| Param | Type | Description |
|---|---|---|
| configOrFile | object | string | The object with the credentials or a path to a json file with the credentials |
Called internally to retrieve an access token before all calls. Requests an auth token from the sierra API and stores it for future use. It automatically reattempts when there is an empty response from Sierra (a not uncommon error).
Makes a get request to ${exports.credsBase}${path} and returns the response. It automatically reattempts when there is an empty response from Sierra (a not uncommon error).
resolves to the result:
{"id":1001006,"expirationDate":"2019-01-07","patronType":10,"patronCodes":{"pcode1":"-","pcode2":"-","pcode3":2,"pcode4":0},"homeLibraryCode":"hd","message":{"code":"-","accountMessages":["LBR6@columbia.edu"]}
Makes a post request to ${exports.credsBase}${path} and returns the response
resolves to the result:
{ code: 132, specificCode: 2, httpStatus: 500, name: 'XCirc error', description: 'XCirc error : Bib record cannot be loaded' }
Makes a post request to ${exports.credsBase}${path}. The response is just a status code.
Makes a delete request to ${exports.credsBase}${path}. The response is just a status code.
Requests a single bib data from the API
Return format: [Object]
| Param | Type | Description |
|---|---|---|
| bibId | string | the bnumber of the bib you want to request |
Requests a bib range from the API
Return format: [Object]
| Param | Type | Description |
|---|---|---|
| bibIdStart | string | the bnumber of the bib you want to request |
| bibIdEnd | string | the bnumber of the bib you want to request |
Requests an item range from the API
Return format: [Object]
| Param | Type | Description |
|---|---|---|
| itemIdStart | string | the bnumber of the bib you want to request |
| itemIdEnd | string | the bnumber of the bib you want to request |
Requests all the items of a specified bib id Return format: [ [Object], [Object] ]
| Param | Type | Description |
|---|---|---|
| bibId | string | the bnumber of the bib you want to request |
Requests multiple bibs, but no orders or locations
Return format: [Object]
| Param | Type | Description |
|---|---|---|
| bibsIds | array | an array of bib id strings |
Requests multiple items
Return format: [Object]
| Param | Type | Description |
|---|---|---|
| itemIds | array | array of item ids |
Run unit tests via:
npm test
See ./test/installation-test for scripts to validate a release before publication.
FAQs
A node wrapper for Innovative's Sierra API v3
The npm package @nypl/sierra-wrapper receives a total of 61 weekly downloads. As such, @nypl/sierra-wrapper popularity was classified as not popular.
We found that @nypl/sierra-wrapper demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 13 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.