Giter Site home page Giter Site logo

node-alma-api-wrapper's Introduction

node-alma-api-wrapper

A nodeJS wrapper for the Alma API

Usage

npm install git+ssh://[email protected]/lulibrary/node-alma-api-wrapper.git#master

const AlmaClient = require('alma-api-wrapper')

const almaApi = new AlmaClient({
    region: 'eu', // defaults to eu
    apikey: 'my_alma_api_key' // the api key can also be set on the environment variable ALMA_KEY
})

almaApi.users.for('my_user').loans()
    .then(loans => console.log(loans[0].data))

The wrapper covers retrieving certain data for Users in Alma. All user endpoints are covered in the User class, which exists on almaApi.users. almaApi.users.get(userID) Calls GET /users/<userID>, returns a promise which resolves with a new User instance created from the API data.

almaApi.users.for(userID) Returns a new instance of the User class.

user.loans() Calls GET /users/<userID>/loans, returns a promise which resolves with an array of Loan instances.

user.getLoan(loanID) Calls GET /users/<userID>/loans/<loanID>, returns a promise which a Loan instance created from the API data.

user.requests() Calls GET /users/<userID>/requests, returns a promise which resolves with an array of Request instances.

user.getRequest(requestID) Calls GET /users/<userID>/requests/<requestID>, returns a promise which a Request instance created from the API data.

user.fees() Calls GET /users/<userID>/fees, returns a promise which resolves with an array of Fee instances.

user.getFee(feeID) Calls GET /users/<userID>/fees/<feeID>, returns a promise which a Fee instance created from the API data.

All class instances created by API calls will have the raw API data stored on data property of the class

Associated Services

There are four services that make up the Alma caching stack. These are:

There are also 3 custom packages on which these depend. These are:

Development

It is intended that this package can be extended to cover more, or all, of the current Alma API. Contributions to this service or any of the associated services and packages are welcome.

node-alma-api-wrapper's People

Contributors

dombelcher avatar stephenrob avatar

Watchers

James Cloos avatar Masud Khokhar avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.