stuller

Interact with the Stuller API. Converts from XML to json

Usage no npm install needed!

<script type="module">
  import stuller from 'https://cdn.skypack.dev/stuller';
</script>

README

Stuller API

Install

npm install stuller

Available Methods

  • Most methods can take either an Array, String, or Number
  • Calling send(callback) actually fires off the request to Stuller
  • The callback function is given two arguments (err, response)
    • error any error thrown by Equella, soap, or xml2js
    • response array of JSON objects

FetchItemInfo

var Stuller = require('stuller');

var stuller = new Stuller({
                apiUrl: APIURL,
                token: TOKEN
              });

stuller
  .FetchItemInfo(['123:A', '123:B'])
  .send(function(err, response) {
    console.log(response);
});

FetchItemInfoByItemID

var Stuller = require('stuller');

var stuller = new Stuller({
                apiUrl: APIURL,
                token: TOKEN
              });

stuller.FetchItemInfoByItemID(123).send(function(err, response) {
    console.log(response);
    });

FetchItemInfoBySeries

var Stuller = require('stuller');

var stuller = new Stuller({
                apiUrl: APIURL,
                token: TOKEN
              });

stuller.FetchItemInfoBySeries(['2222', '234233']).send(function(err, response) {
    console.log(response);
    });

FetchItemPriceOnHand

var Stuller = require('stuller');

var stuller = new Stuller({
                apiUrl: APIURL,
                token: TOKEN
              });

stuller.FetchItemPriceOnHand(['123:A', '123:B']).send(function(err, response) {
    console.log(response);
    });

FetchItemPriceOnHandByItemID

var Stuller = require('stuller');

var stuller = new Stuller({
                apiUrl: APIURL,
                token: TOKEN
              });

stuller.FetchItemPriceOnHandByItemID([123, 123]).send(function(err, response) {
    console.log(response);
    });

FetchItemPriceOnHandBySeries

var Stuller = require('stuller');

var stuller = new Stuller({
                apiUrl: APIURL,
                token: TOKEN
              });

stuller.FetchItemPriceOnHandBySeries([123, 123]).send(function(err, response) {
    console.log(response);
    });

FetchItems

var Stuller = require('stuller');

var stuller = new Stuller({
                apiUrl: APIURL,
                token: TOKEN
              });

stuller.FetchItems().send(function(err, response) {
    console.log(response);
    });

FetchRTWItems

var Stuller = require('stuller');

var stuller = new Stuller({
                apiUrl: APIURL,
                token: TOKEN
              });

stuller.FetchRTWItems(1).send(function(err, response) {
    console.log(response);
    });