🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more →
Socket
Book a DemoInstallSign in
Socket

vuori-request-gn

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vuori-request-gn

Package to connect with Vuori GN API

latest
Source
npmnpm
Version
0.0.49
Version published
Maintainers
1
Created
Source

Vuori Request GN (WARNING: Not production ready yet!)

Installation

npm install vuori-request-gn or yarn add vuori-request-gn

Usage

1. In development:


{ RequestGn, Database } = require('vuori-request-gn');

const dbConfig = {
  endpoint: "http://dynamo:8000'", // Connect to localhost
};

await Database.dbConnect(dbConfig);

const requestGn = new RequestGn({
  GN_PASSWORD: process.env.GN_PASSWORD,
  GN_USER: process.env.GN_USER,
  baseURL: process.env.GN_URL,
});

requestGn.setup();

response = await requestGn.getProductsByAgent('AG 145');

2. In production/staging (let AWS roles control access):


{ RequestGn, Database } = require('vuori-request-gn');
const AWS = require('aws-sdk');

Database.useDb(new AWS.DynamoDB({
  apiVersion: '2012-08-10',
  accessKeyId: process.env.ACCESS_KEY_ID,
  secretAccessKey: process.env.SECRET_ACCESS_KEY
}));

const requestGn = new RequestGn({
  GN_PASSWORD: process.env.GN_PASSWORD,
  GN_USER: process.env.GN_USER,
  baseURL: process.env.GN_URL,
});

requestGn.setup();

response = await requestGn.getProductsByAgent('AG 145');

Methods

  • getProductsByAgent(agentCode)
  • saveClient(clientData)
  • getClient(cpf)
  • editClient(clientData)
  • saveTransaction(transactionData)
  • saveDeliveryAddress(deliveryAddressData)

FAQs

Package last updated on 24 Oct 2018

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