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

@jaakaru/softpos_api

v0.1.48

Published

Kassamagneetti SoftPoS Javascript API

Downloads

8

Readme

Table of Contents

jsonApi

JSON API methods to control the SoftPoS CashRegister, see also https://github.com/Soft-Contact/resto/issues/2#placeorder

placeOrder

Place order

Parameters

  • order as a JSON object
  • successCallback as a function for successful callback
  • failureCallback as a function for failure callback

addToOpenTable

addToOpenTable

Parameters

removeFromOpenTable

removeFromOpenTable

Parameters

  • removeReq as a JSON object with parameters "tableCode", "clerkCode": "rowID"
  • successCallback as a function for successful callback
  • failureCallback as a function for failure callback

getActiveTransaction

get currently on cashregister screen active transaction

Parameters

  • successCallback
  • failureCallback

executeLisp

Execute lisp macro on cashregister side

Parameters

  • cmd lisp macro to execute
  • successCallback
  • failureCallback

Meta

  • deprecated: use evalLisp instead, kept some time for backwards compatibility

evalLisp

Evaluate lisp macro on cashregister side

Parameters

  • cmd lisp macro to evaluate
  • successCallback
  • failureCallback

printer

JSON API methods to control the SoftPoS CashRegister printing

print

Experimental: Print data to the printer

Parameters

  • printData
  • successCallback

Examples

let printData =
{
lines: [

{ type: "TEXT", contents: "test string"},
{ type: "TEXT", contents: "text\non\nmultiple\nlines"},
{ type: "QR_CODE", contents: "sample code", alignment: "RIGHT"},
{ type: "BAR_CODE", contents: "1234567890123"},
{ type: "QR_CODE", contents: "another code"},
]
}

payments

JSON API methods to control the SoftPoS CashRegister payment terminal

authorizePayment

Experimental: Authorize payment on SoftPoS side using SoftPos configured payment device

Parameters

  • payment
  • successCallback
  • failureCallback
  • statusCallback

abortAuthorization

Experimental: Abort currently active payment

Parameters

  • successCallback

articles

JSON API methods to get article and article group data

listAll

Get all articles from SoftPos

Parameters

  • successCallback
  • errorCallback

displays

API methods needed by various separate displays (KitchenDisplay, OrderDisplay).

listAllKitchenSystemTransactions

Experimental: List all transactions based on jobOrderSystemId

Parameters

  • jobOrderSystemId Job order system id from which to list transactions
  • successCallback
  • errorCallback

removeTransactionFromKitchenSystem

Experimental: Remove transactions based on jobOrderSystemId and transactionUuid

Parameters

  • jobOrderSystemId Job order system id from which to remove transaction
  • transactionUuid transcation to remove
  • successCallback
  • errorCallback

setLineStateInKitchenSystem

Experimental: Change transactionsline state

Parameters

  • jobOrderSystemId Job order system id from which to remove transaction
  • transactionUuid transcation to modify
  • lineStateName Ordered, Ready, Prepared, Served, Deleted, Other
  • successCallback
  • errorCallback

getConfiguration

Experimental: Get map of configuration parameters, including custom configuration

Parameters

  • successCallback
  • errorCallback

saveCustomConfiguration

Experimental: Save custom configuration

Parameters

  • conf custom configuration
  • successCallback
  • errorCallback

saveWaitingTime

Save kitchen system waiting time in minutes

Parameters

  • jobOrderSystemId
  • waitingTime
  • successCallback
  • errorCallback

getWaitingTime

Get kitchen system waiting time in minutes

Parameters

  • jobOrderSystemId
  • successCallback
  • errorCallback

messages

Methods related to messages from SoftPos

listenAll

Experimental: Listen for all messages

Parameters

  • listenCallbackFn callback fn where all SoftPoS side asynchronous messages are passed

Examples

{ type: "COMMAND", data: "REFRESH_KITCHEN_DISPLAY"}

utils

Utility methods

getApiType

Gets the SoftPoS API type depending on which environment is used to run it

Returns string one of NONE/HTMLVIEW_LEGACY/HTMLVIEW_JCEF

getSoftPosVersion

Gets the SoftPoS version

Returns string SoftPoS version

getSoftPosInfo

Get the SoftPos info JSON

Parameters

  • successCallback
  • failureCallback

Returns json with fields "success" and "response", where response contains the SoftPosInfo object

log

Utility methods for logging

log

Parameters
  • logRecord
Examples
window.softPos.log({level: 'INFO', msg:'Info message'});

trace

Log TRACE message

Parameters
  • msg
  • obj

debug

Log DEBUG message

Parameters
  • msg
  • obj

info

Log INFO message

Parameters
  • msg
  • obj

warn

Log WARN message

Parameters
  • msg
  • obj

error

Log ERROR message

Parameters
  • msg
  • obj

fatal

Log FATAL message

Parameters
  • msg
  • obj