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

freshkds

v1.0.26

Published

FreshKDS implementation for Node

Downloads

18

Readme

JavaScript NodeJS

freshKDS

FreshKDS implementation in Node.JS. This plugin was built on the documentaton from FreshKDS Developer Documentation The author of this software is not affiliated with FreshKDS or its associates in any way.

NPM

https://www.npmjs.com/package/freshkds

npm install freshkds

Import

var freshKDS = require("freshkds");

Token Based Methods

Before running any functions you need to create a new token to pass later. freshKDS.token requires three parameters,

  1. demo or production
  2. Your API key
  3. Return method in which you will store your token for later use.
var freshKDS = require("freshkds");
var token;
freshKDS.token("demo",APIKEY,(returns) => {
    token = returns;
});

Get KDS Information

This method will return any valid KDS devices and associated ID's You will need to pass your token as previously mentioned

freshKDS.token(token,(returns) => {});

Get KDS Locations

This method will return a list of all locations. Same situation! Pass your token like before

freshKDS.getKDSLocations(token,(response) => {});

Get KDS Location Devices

Returns all devices at a location. Along with your token, you also need to pass a location ID to this method.

freshKDS.getKDSLocationDevices(token,location,response){});
 

Get all active orders!

Returns all active orders by location and (optionally) device If you would like to get all devices at a location, pass "all" in your device parameter instead of a device ID.

freshKDS.getKDSActiveOrders(token,location,device,(response)=>{});
 

Order Managemenet

This (WIP) order managment will help you establish order objects instead of manually coding for them. If you would like to manually code these, please follow the documentation at Send-KDS-Order

All order management functions are provided under a subpackage freshKDS.orderManager.*

The bare minimum for an order to be processed through FreshKDS is in the "Start Order Function"

Start new order

freshKDS.orderManager.startNewOrder(id,orderName,time,mode,name,qty,mods,terminal,(returns) => {
  console.log(returns);
});

The parameters are as follows

  1. ID (Self generated, UNIQUE, Integer) EX: 001
  2. orderName (Customer Name or External Order Number, String) Ex: John Smith
  3. DateTime of Order (ISO 8601 FORMAT, STRING/DATETIME OBJECT) I recomend using Moment.JS to generate these Info
  4. Mode of Order -- Accepts one of the Following (For Here, ToGo, Pickup, DriveThru, Delivery, CurbSide) (STRING)
  5. Name of Item (First item in order), follow next function to add more items to this order. (STRING) Ex: Large Expresso
  6. Quantity of Items (First item in order) EX: 1
  7. Modifications of order, if none use [] IN ARRAY FORMAT (ARRAY) Ex: ["No Whip Cream"].
  8. Terminal ID See "Get KDS Location Devices" (STRING)

Submit Order to FreshKDS

This will transmit your order to KDS and respond with a status.

function sendKDSOrder(token,order,location,device,response => {
  console.log(response);
});

The following additional and optional functions are avaible for order managmenet All of the following can be reviewed here

freshKDS.orderManager.startNewItem(name,qty,mods,returns){}; // creates a new item object
freshKDS.orderManager.addItemsToOrder(order,items,returns){}; // adds item object to order
freshKDS.orderManager.addPickupTime(order,pickupTime,returns){}; // adds phone number to order
freshKDS.orderManager.optInForSMS(order,optIn,returns){}; // adds SMS messaging provided by freshKDS
freshKDS.orderManager.addDeliveryAddress(order,address,returns){}; // adds a delivery address
freshKDS.orderManager.addServer(order,server,returns){}; // adds a server name to an order
freshKDS.orderManager.addSource(order,source,returns){}; // adds a source to an order
freshKDS.orderManager.addSpecialInstructions(order,specialInstructions,returns){}; // adds special instructions to an order
freshKDS.orderManager.addCustomerArrivedUrl(order,customerArrivedUrl,returns){}; // adds customer arrived url instructions to an order
freshKDS.orderManager.freshKDS.orderManager.addVehicleModel(order,vehicleModel,returns){}; // adds vehicle info to order
freshKDS.orderManager.addVehicleColor(order,vehicleColor,returns){}; // adds vehicle color to an order
freshKDS.orderManager.addCosts(order,costs,returns){}; // adds unit costs to an order
freshKDS.orderManager.addDeliveryService(order,deliveryService,returns){}; // adds delivery service information to an order