Releases: SydneyUniLibrary/sierra-api-as-promised
Version 0.4.2
Upgrade dependencies to mitigate CVE-2018-3728.
Version 0.4.1
Minor bug fix.
- URLs are no longer being logged to the console.
Support for v5 of the Patron API
Complete support for the Patron API
In additional to completing support for v4 of the Patron API, this release also extends support to v5.
Updated function names
The naming scheme of the functions in Patron API has been updated.
Support for v5
This has required some structural changes to the library so it can automatically select either v4 or v5 of the API is used, depending on the capabilities of the Sierra API host.
Instead of the library initialising at start up, the library now exports the factory function SierraAPIAsPromised
, that returns SierraAPIConnection
objects. From an SierraAPIConnection
object, you can access the API. SierraAPIAsPromised
selects the correct version of the API based on the about info received from the Sierra API host.
Forwards compatibility
Normally the latest API version that both the host and the library supports is selected. This can be controlled with apiMajorVersion
configuration option. apiMajorVersion
can bring forwards compatibility to library users when the library is updated with newer API versions that bring breaking changes.
Backwards compatability
The new findPatron
function has been added to the v5 Patron API. So the findPatronWithBarcode
function in the v5 Patron API is emulated by calling findPatron
giving b
for varFieldTag
.
Date/time range convenience
For range-capable date/time parameters, in addition to giving an ISO string or a range string, support passing an array of two: ISO strings, native Date objects, moment.js moment objects
or Luxon DateTime objects.
Also support passing in a Luxon Interval object, and adjusting for the end of Luxon Interval objects being exclusive but the end of Sierra API ranges being inclusive.
Support open-ended ranges.
Similarly for range-capable date parameters, except the time part is truncated for these.
This doesn't create a dependency on either the moment.js or Luxon libraries. Duck-typing is used to detect moement.js and Luxon objects and convert them to ISO strings. There is a dev dependency on these in order to use these objects for testing.
Accept record ids in the patron API functions
Update the patron API functions to accept record ids from sierra-record-id
.
Changlog
- Add dep on v0.2.0 of sierra-record-id.
- Update v4/patrons.js to accept record ids.
- Add getPatronFines and getPatronHolds to v4/patrons.js.
- Require Node v8 LTS.
Initial release
Partially exposes the Patron API.