npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

okra-node

v0.2.0

Published

Okra JS Node Module

Downloads

23

Readme

okra-node

This is a npm module that abstracts the complexity of using okra with node.

USAGE

1. Install the module

Install with yarn:

yarn add okra-node

but you can use npm if you like:

npm install --save okra-node

2. Import the module

In your app.js or any module where the component would be used:

import * as okra_client from "okra-node";

3. Implementation

Okra Node exposes all the API endpoint that are available in Okra docs (https://docs.okra.ng/reference/). Please find the parameters you can pass to the endpoints in the API refenece mentioned above.

4. Okra Classes

The Okra Node Client is devided to classes that can be consumed sepratley as it's necessary for you. The classes are inheriting Okra Client class, so you'll need to pass the enviornment and Okra Secret (found here: https://dash.okra.ng/settings/api-keys) to each class you implement.

Each function of the class will intake an options object as argument. The object can contain different parameters that you would like to return, for example, you can pass the object: {id: "1234567890"} to Auth.get() and it will point that request to the correct endpoint.

Examples

  • list accounts:
const accounts = new Accounts(okraSecret, env);
const getAccounts = accounts.get()
  • get account by id:
const accountId = { id: 'bb11189898kll' }
const accounts = new Accounts(okraSecret, env);
const getAccounts = accounts.get(accountId);
  • check balance:
const options = {account_id: "bbb118989kll", record_id: "ccc1144090987"}
const balances = new Balance(okraSecret, env);
const checkBalance = balances.check(options)

5. Pagination

If pagination is available, you can call the next and previous page via the .nextPage() or .prevPage() derivited from the resposne object.

Example:

const reports = new Reports(okraSecret, env);

const getReports = reports.get();
const getNextPage = getReports.nextPage();
  • Auth: Allows you to get information on extisting authentication.

Available options:

  • Get Auth list:
    • options:{} or null
    • ref: https://docs.okra.ng/reference/fetchauths
  • Get Auth by Id:
    • options: {id: <<string>>}
    • ref: https://docs.okra.ng/reference/getauthbyid
  • Get Auth by customer id:
    • options: { customer: <<string>>, from: <<date>>, to: <<date>> }
    • ref: https://docs.okra.ng/reference/getauthbycustomer
  • Get Auth by date:
    • options: { from: <<date>>, to: <<date>>, page: <<int>>, limit: <<int>> }
    • ref: https://docs.okra.ng/reference/getauthbydate
  • Get Auth by bank:
    • options: { bank: <<string>> ,page: <<int>> , limit: <<int>> }
    • ref: https://docs.okra.ng/reference/getauthbybank
  • Get Auth by customer date:
    • options: { customer: <<string>>, from: <<date>>, to: <<date>>, page: <<int>>, limit: <<int>> }
    • ref: https://docs.okra.ng/reference/getauthbycustomerdate

For more information checkout okra's documentation

Contributing

Please feel free to fork this package and contribute by submitting a pull request to enhance the functionalities.

License

The MIT License (MIT). Please see License File for more information.