New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

sierra-wrapper

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sierra-wrapper

A node wrapper for Innovative's Sierra API v3

latest
Source
npmnpm
Version
0.1.4
Version published
Weekly downloads
4
300%
Maintainers
1
Weekly downloads
 
Created
Source

sierra-wrapper

A basic node wrapper for the III Sierra v3 API

The wrapper currently only supports:

  • Authorizing
  • Returning a single, multiple and range Bib records
  • Returning a single, multiple and range Item records
  • Returning item records beloning to a single Bib record

More endpoint will be added as the need arises.

To use make sure you have your credentials stored in a json file in the format:

{
	"key": "YOURKEY",
	"secret": "YOURSECRET",
	"base": "https://your.domain.name.org/iii/sierra-api/v3/"
}

You then authorize and request by

var wrapper = require('sierra-wrapper')

var loadedConfig = wrapper.loadConfig('./path/to/config.json')
wrapper.auth((error, results) => {
  if (error) console.log(error)
  wrapper.requestSingleBib('14628261', (errorBibReq, results) => {
    if (errorBibReq) console.log(errorBibReq)
    console.log(results)
  })
})

You can also set your credentials via enviorment variables: SIERRA_KEY, SIERRA_SECRET, SIERRA_BASE

Functions

loadConfig(configOrFile)boolean

Loads a congig object, passed or from disk

auth(cb)

Requests an auth token from the sierra API and stores it for future use, it also setups a time to renew the token

requestSingleBib(bibId, cb)

Requests a single bib data from the API

Return format: { data: { total: 1, entries: [ [Object] ] }, url: 'https://catalog.library.org/iii/sierra-api/v3/bibs/17292415?fields=default,fixedFields,varFields,normTitle,normAuthor,orders,locations' }

requestRangeBib(bibIdStart, bibIdEnd, cb)

Requests a bib range from the API

Return format: { data: { total: 1, entries: [ [Object] ] }, url: 'https://catalog.library.org/iii/sierra-api/v3/bibs/?limit=1&id=17292415&fields=default,fixedFields,varFields,normTitle,normAuthor,orders,locations' }

requestRangeItem(itemIdStart, itemIdEnd, cb)

Requests an item range from the API

Return format: { data: { total: 1, entries: [ [Object] ] }, url: 'https://catalog.library.org/iii/sierra-api/v3/items/?limit=1&id=17292415&fields=default,fixedFields,varFields,normTitle,normAuthor,orders,locations' }

requestBibItems(bibId, cb)

Requests all the items of a specified bib id Return format: { data: { total: 2, entries: [ [Object], [Object] ] }, url: [ 'https://catalog.library.org/iii/sierra-api/v3/items/?bibIds=17292415&fields=default,fixedFields,varFields&offset=0' ] }

requestMultiBibBasic(bibsIds, cb)

Requests multiple bibs, but no orders or locations

Return format: { data: { total: 1, entries: [ [Object] ] }, url: 'https://catalog.library.org/iii/sierra-api/v3/bibs/?id=14628261,14628262,14628263,14628264,14628265,14628266,14628267,14628268,14628269,14628270&fields=default,fixedFields,varFields,normTitle,normAuthor' }

requestMultiItemBasic(itemIds, cb)

Requests multiple items

Return format: { data: { total: 1, entries: [ [Object] ] }, url: 'https://catalog.library.org/iii/sierra-api/v3/items/?id=10000000,10000100,10000200,10000300,10000400,10000500,10000600,10000700,10000800,10000900,10001000&fields=default,fixedFields,varFields' }

loadConfig(configOrFile) ⇒ boolean

Loads a congig object, passed or from disk

Kind: global function Returns: boolean - did it load or not

ParamTypeDescription
configOrFileobject | stringThe object with the credentials or a path to a json file with the credentials

auth(cb)

Requests an auth token from the sierra API and stores it for future use, it also setups a time to renew the token

Kind: global function

ParamTypeDescription
cbfunctioncallback

requestSingleBib(bibId, cb)

Requests a single bib data from the API

Return format: { data: { total: 1, entries: [ [Object] ] }, url: 'https://catalog.library.org/iii/sierra-api/v3/bibs/17292415?fields=default,fixedFields,varFields,normTitle,normAuthor,orders,locations' }

Kind: global function

ParamTypeDescription
bibIdstringthe bnumber of the bib you want to request
cbfunctioncallback

requestRangeBib(bibIdStart, bibIdEnd, cb)

Requests a bib range from the API

Return format: { data: { total: 1, entries: [ [Object] ] }, url: 'https://catalog.library.org/iii/sierra-api/v3/bibs/?limit=1&id=17292415&fields=default,fixedFields,varFields,normTitle,normAuthor,orders,locations' }

Kind: global function

ParamTypeDescription
bibIdStartstringthe bnumber of the bib you want to request
bibIdEndstringthe bnumber of the bib you want to request
cbfunctioncallback

requestRangeItem(itemIdStart, itemIdEnd, cb)

Requests an item range from the API

Return format: { data: { total: 1, entries: [ [Object] ] }, url: 'https://catalog.library.org/iii/sierra-api/v3/items/?limit=1&id=17292415&fields=default,fixedFields,varFields,normTitle,normAuthor,orders,locations' }

Kind: global function

ParamTypeDescription
itemIdStartstringthe bnumber of the bib you want to request
itemIdEndstringthe bnumber of the bib you want to request
cbfunctioncallback

requestBibItems(bibId, cb)

Requests all the items of a specified bib id Return format: { data: { total: 2, entries: [ [Object], [Object] ] }, url: [ 'https://catalog.library.org/iii/sierra-api/v3/items/?bibIds=17292415&fields=default,fixedFields,varFields&offset=0' ] }

Kind: global function

ParamTypeDescription
bibIdstringthe bnumber of the bib you want to request
cbfunctioncallback

requestMultiBibBasic(bibsIds, cb)

Requests multiple bibs, but no orders or locations

Return format: { data: { total: 1, entries: [ [Object] ] }, url: 'https://catalog.library.org/iii/sierra-api/v3/bibs/?id=14628261,14628262,14628263,14628264,14628265,14628266,14628267,14628268,14628269,14628270&fields=default,fixedFields,varFields,normTitle,normAuthor' }

Kind: global function

ParamTypeDescription
bibsIdsarrayan array of bib id strings
cbfunctioncallback

requestMultiItemBasic(itemIds, cb)

Requests multiple items

Return format: { data: { total: 1, entries: [ [Object] ] }, url: 'https://catalog.library.org/iii/sierra-api/v3/items/?id=10000000,10000100,10000200,10000300,10000400,10000500,10000600,10000700,10000800,10000900,10001000&fields=default,fixedFields,varFields' }

Kind: global function

ParamTypeDescription
itemIdsarrayarray of item ids
cbfunctioncallback

FAQs

Package last updated on 13 May 2017

Did you know?

Socket

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.

Install

Related posts