Socket
Book a DemoInstallSign in
Socket

xtuple-rest-client

Package Overview
Dependencies
Maintainers
4
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xtuple-rest-client

Client for xTuple's REST Api

0.0.9
latest
npmnpm
Version published
Maintainers
4
Created
Source

xTuple ERP Node.js REST API Client Library

xTuple ERP Node.js REST API Client Library using the Google APIs Client Library for Node.js. For more information about xTuple's web application, look at the source code.

Usage:

Create new OAuth2 Client in xTuple

Before you can use this client with xTuple's OAuth 2.0 Server, you need to install the OAuth 2.0 extension in your xTuple application and create a reference for a new OAuth 2.0 Client. Be sure to select a "Client Type" of "Service Account" and ensure that "Delegated Access" is checked. This will generate a private key and give you all the other information that you wll need to connect to the xTuple REST API.

Installation

Clone this repository and run npm install

or npm install xtuple-rest-client

Set your Private Key

Convert your key.p12 file to key.pem and copy it to the keys folder:

openssl pkcs12 -in keys/key.p12 -nocerts -nodes | openssl rsa -out keys/key.pem

This key and the folder are in the .gitignore and should never be committed to source control.

Enter Import Password: 'notasecret'

Setup Environment Variables

cp sample.env .env

Open the .env file and change the information to match what was provided by the xTuple OAuth 2.0 extension. This .env file should also never be committed to source control.

Example Use

var _ = require('underscore'),
  Client = require('xtuple-rest-client');

new Client(function (client) {
  client.query({
    type: 'ToDo',
    method: 'list',
    params: { maxResults: 50 },
    callback: function (err, result) {
      if (err) {
        console.log('Error:', err);
      }
      if (result) {
        console.log('To Dos:');
        _.map(result.data.data, function (obj) {
          console.log('Id:', obj.uuid);
          console.log('Name:', obj.name);
          console.log('Description:', obj.description);
        });
      }
    }
  });
});

License

Apache License, Version 2.0

Copyright (c) 2012-2013 xTuple http://www.xtuple.com/

Keywords

rest

FAQs

Package last updated on 11 Sep 2014

Did you know?

Socket

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.