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

node-springboard

v0.0.31

Published

Node JS library for interacting with Springboard Retail API

Downloads

7

Readme

node-springboard

Node JS Library for Interacting with Springboard Retail API. Uses the [restler] (https://github.com/danwrong/restler) module as its foundation for querying the service.

Springboard Retail is a cloud based point-of-sale system that is well designed and highly accessible. Refer to their API docs for details on API usage.

This is a work on progress. I'll be adding more methods over time.

This is my first foray into Node. Forgive the lack of tests, I'm one of "those" people.

Installing and Configuring

npm install node-springboard

Require the module, passing in a valid domain, user, and password. Then experience Springboard API nirvana.

var springboard = require('node-springboard')('mydomain', 'myuser', 'mypassword');

Usage

####Basic Example

var springboard = require('node-springboard')('mydomain', 'myuser', 'mypassword');

springboard.getItem(100001, function(err, data, response) {
	// Check for error and handle
	if(err) {
		// Handle error
	} else {
		// Outputs JSON information returned by Springboard
		console.dir(data);
	}
});

####General Use This module follows the Node callback convention of passing either null or an Error object as the first argument of the callback. See the basic example above.

All functions in this module expect a callback that accepts three parameters: err, data, and response.

#####Err An Error object if there was a problem; null if not. Always check for this first in your callbacks.

#####Data Varies based on the method call.

Methods beginning with "create" will return a hash with a "path" and "objectId" value. For example:

springboard.createVendor('New Vendor', {'public_id': 'NEW'}, function(err, data, response) {
	// Outputs '/api/purchasing/vendors/100002' where 100002 is the ID of the new vendor.
	console.log(data.path);
	
	// Outputs '100002' where 100002 is the ID of the new vendor.
	console.log(data.objectId);
});

All other methods will return the JSON object returned by the Springboard API, easily accessible through dot notation or your preferred method of data access.

#####Response The raw response as returned by restler. Refer to restler documentation for info on how to interact with this object.

####API As a general rule, API method signatures begin with data required by Springboard, then accept a hash parameter for other data, and finally method callback. I'm not fully sold on this design yet but it works. For now, only parameters that are not self explanatory are documented.

#####data parameter The data parameter in the method calls is the catch all of capturing information not necessariliy required by the API. The following example creates an item that includes some custom fields:

springboard.createItem(1.44, {'description': 'This is my description', 'custom': {'department': '37: Hard Crafts'}}, function(err, data, response) {
	console.log(data.path);
	console.log(data.objectId);
});

#####createInventoryAdjustment(locationId, itemId, adjustmentReasonId, qtyAdjust, cost, data, callback) Note: Undocumented API method.

Creates an inventory adjustment entry.

qtyAdjust: The quantity adjustment to make to current on hand counts. NOT the on hand count.

#####createItem(cost, data, callback) Creates an item. Cost is the only field required by Springboard. However, if you have custom fields that are required, you will have to provide those via the data parameter.

#####createItemVendor(itemId, vendorId, data, callback) Note: Undocumented API method.

Creates a vendor record for an item (sometimes called a source record).

#####createTicket(data, callback) Creates a sales ticket.

#####createTicketLine(ticketId, data, callback) Note: The Springboard API does not currently provide the newly created ID for a ticket line. Not sure why Creates a line for a given ticket ID.

#####createVendor(name, data, callback) Creates a vendor.

#####createVendorAddress(vendorId, city, state, country, postalCode, data, callback) Note: Undocumented API method Creates an address for a vendor.

#####createVendorContact(vendorId, data, callback) Note: Undocumented API method Creates a contact for a vendor.

#####getGiftCard(giftCardNumber, callback) Gets gift card with the given number. Springboard throws an error if the gift card is not found.

#####getInventoryValues(data, callback) Gets inventory values. Recommend using convenience methods for retrieving inventory values for a given item ID by location.

#####getInventoryValuesByLocation(itemId, data, callback) Gets inventory values for an item, grouped by location.

#####getItem(id, callback) Retrieves an item based on its ID.

#####getItemByLookup(lookup, callback) Retrieves an item based on its lookup code.

#####getItemsByFilter(jsonFilter, callback) Retrieve items based on advanced JSON filter.

#####getItemVendors(id, callback) Retrieves vendor records for a given item ID.

#####getTicket(id, callback) Retrieves a ticket based on its ID.

#####getTicketLines(id, callback) Retrieves ticket lines based on a ticket ID.

#####getVendor(id, callback) Retrieves a vendor based on its ID.

#####getVendorsByFilter(jsonFilter, callback) Retrieve vendors based on advanced JSON filter.

#####searchItems(searchTerm, page, perPage, callback) A basic way to query items using Springboard's standard search. Springboard has a sophisticated query system that is not yet implemented in this module.

#####searchVendors(searchTerm, page, perPage, callback) A basic way to query vendors using Springboard's standard search. Springboard has a sophisticated query system that is not yet implemented in this module.

#####updateItem(id, data, callback) Update an item.

#####updateVendor(id, data, callback) Update a vendor.