duration to wait for a PING before disconnecting
duration to wait until a reconnect is attempted
unused
the function that will return an instance of the CloverWebSocketInterface that will be used when connecting. For Browser implementations, this can be
the base url for the clover server used in the cloud connection. EX: https://www.clover.com, http://localhost:9000
the merchant the device belongs to.
the OAuth access token that will be used when contacting the clover server
the id (not uuid) of the device to connect to
an identifier for the specific terminal connected to this device. This id is used in debugging and may be sent to other clients if they attempt to connect to the same device. It will also be sent to other clients that are currently connected if this device does a forceConnect.
if true, overtake any existing connection.
the helper object used when making http requests.
prevent reconnects if shutdown was requested
This is the WebSocket implementation. This is odd, but it is how we can keep ourselves from being tied to a browser.
A NodeJS app that uses this library would pass in a different object than a browser implementation. NodeJS has an object that satisfies the requirements of the WebSocket (looks the same).
HTTP Header key that helps identify the connected client. Typically set to the 'friendlyId'.
Handles the response to the OPTIONS call. This helps with a 401 response, and is used to help identify any existing connection to the device.
If the endpoint is available, then the transport is connected to the websocket.
Clear the observers list
This handles the response from the server of the request to send a notification to the device. If the notification was successful, then an OPTIONS call is made using the information provided.
has a boolean property for 'sent', that indicates if the notification was sent to the device. If it was, then the properties 'host' and 'token' are used to derive the websocket endpoint uri.
Do an OPTIONS call to the web socket endpoint (using http). This helps with a problem where a 401 response came back from the websocket endpoint.
The cloud needs to call an endpoint on the server to notify the device that it wants to talk. This requires a valid OAuth access token, and we also need to know which Clover server to contact.
To make the call, we also need to have an object that we can use that does not tie us to a particular environment. This is the httpSupport.
Called from subclasses at the end of the constructor.
Notify observers that the device is connected
Notify observers that the device has disconnected
Notify observers that the device is ready
Messed up way ts/js does function overloading
Add new observer to receive notifications from the device
the observer to notify
Remove an observer from the list of observers
the observer to remove
Generated using TypeDoc
WebSocket Cloud Clover Transport. This handles the need to notify the device before a connection attempt is made.