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

onepoint-node-sdk

v1.0.4

Published

OnePoint HCM REST API Node.js SDK

Downloads

24

Readme

OnePoint HCM Node.js REST API SDK

NPM

Build Status Coverage Status dependencies Status devDependencies Status

OnePoint HCM is a cloud-based HR and administration solution. Much of the functionality is available via the OnePoint REST API, and is constrained by security permissions assigned to the acting API user.

Examples

Below are a few usage examples.

Connecting

To connect, you must have a user account registered with the company in OnePoint, as well as the company's REST API key (generated and retrieved by admin users). The company short name can be found in company settings.

const OnePoint = require('onepoint-node-sdk');

var onePoint = new OnePoint({
  username: 'your_username',
  password: 'your_password',
  companyShortName: 'company_short_name',
  apiKey: 'your_api_key'
});

onePoint.connect((err) => {
  // You are now connected
});

Disconnecting

After a connected client is closed, it will reject any further requests. Once it has completed all requests that are currently in the queue, the callback triggers.

// 1) close() is called
onePoint.close(() => {
  // 3) All enqueued requests are now complete and the client is disconnected
});

// 2) Any further requests return an error

Reports

When dealing with reports, you can pass an options object with a query-like structure to designate what kind of report(s) you want to run. All report-related functions will return an array of results, even if one match is found. The exception is when passing the report's unique identifier (settingsId) directly (see below).

Note that there are data size and row restrictions enforced by OnePoint depending on the time of day you run reports. More information here

List Reports

onePoint.listReports((err, reports) => {
  // reports is an array of reports saved under the acting user account
  //
  // [
  //   {
  //     settingsId: 12345,
  //     savedName: 'Your Report Name'
  //   },
  //   ...
  // ]
});

Get Report (query-like)

onePoint.getReport({
  where: {
    savedName: 'Your Report Name'
  }
}, (err, reports) => {
  // reports is an array of reports and results that match your filter
  //
  // [
  //   {
  //     settingsId: 12345,
  //     savedName: 'Your Report Name'
  //   },
  //   ...
  // ]
});

Get Report (exact)

onePoint.getReport(12345, (err, report) => {
  // reports is a single report object
  //
  // {
  //   settingsId: 12345,
  //   savedName: 'Your Report Name'
  // }
});

Run Report (query-like)

Run reports that match a query-like filter. You can pass a report name directly as the first argument as shorthand.

onePoint.runReport({
  where: {
    savedName: 'Your Report Name'
  }
}, (err, reports) => {
  // reports is an array of reports and results that match your filter
  //
  // [
  //   {
  //     settingsId: 12345,
  //     savedName: 'Your Report Name',
  //     results: [
  //       {
  //         "Col1": "Val1",
  //         "Col2": "Val2"
  //       },
  //       ...
  //     ]
  //   },
  //   ...
  // ]
});

// or

onePoint.runReport('Your Report Name', (err, reports) => {
  // Same result as above
});

Run Report (exact)

Pass the report's System ID (you can find this in OnePoint via the web interface, or by listing/retrieving reports).

onePoint.runReport(12345, (err, reports) => {
  // reports is a single report object with results
  //
  // {
  //   settingsId: 12345,
  //   savedName: 'Your Report Name',
  //   results: [
  //     {
  //       "Col1": "Val1",
  //       "Col2": "Val2"
  //     },
  //     ...
  //   ]
  // }
});