Socket
Socket
Sign inDemoInstall

@truebill/regaliator

Package Overview
Dependencies
0
Maintainers
4
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @truebill/regaliator

Nodejs client library for connecting to the Regalii API


Version published
Weekly downloads
0
Maintainers
4
Install size
9.95 kB
Created
Weekly downloads
 

Readme

Source

Regalii Node.js Client

A Node.js client for connecting to the Regalii API.

The client is tested and compatible with the following versions of Node.js:

  • v4.7.2 ;
  • v5.12.0 ;
  • v6.9.4 ;
  • v7.4.0.

Usage

Example:

const Regaliator = require('regaliator');

const client = new Regaliator(
  'https://test.casiregalii.com',
  processs.env.REGALII_API_KEY,
  processs.env.REGALII_SECRET
);

client.account().then((args) => {
  console.log(args.body)
});

All methods of the object regaliator returns a Promise. In case of success, an object having the following keys:

  • body: The decoded JSON response ;
  • req: The request emitted ;
  • res: The response returned by server.

For instance, to get all arguments:

client.account().then((args) => console.log(args.body));

Examples

Examples of some common use-cases:

Creating a credential bill

client.createCredentialsBill(12376, 'login', 'challengeme').then((args) => {
  console.log('Created bill ' + args.body.id);
});

Polling for while bill updating

Coming soon.

Answering MFA Challenge

Coming soon.

Test

To test with your current version of Node.js:

npm test

If you want to test in multiple versions (requires Docker), run:

# For the first time:
npm install -g node-docker-test
ndt --setup

# Then, each time you want:
ndt

Todo

  • Factor test code:
    • Repetitive parts ;
    • Fake server init.
  • Expose some private method as function ;
  • Implement missing methods existing on Ruby client.

Keywords

FAQs

Last updated on 06 Mar 2019

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc