grexxconnect-ess
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -5,3 +5,3 @@ { | ||
"description" : "Grexx Connect - External System Service Helper", | ||
"version" : "1.0.5", | ||
"version" : "1.0.6", | ||
"contributors" : [ | ||
@@ -8,0 +8,0 @@ { |
@@ -8,3 +8,8 @@ # GrexxConnect External System Service (ESS) Helper | ||
## Example | ||
## Features | ||
* auto-reconnect (since v1.0.5) | ||
* custom monitoring data (since v1.0.5) | ||
* basic receiving and responding to ESS messages | ||
## Simple Example | ||
``` | ||
@@ -29,4 +34,36 @@ "use strict"; | ||
}); | ||
``` | ||
GrexxConnectEss.on('connected', () => console.info('Connected!')); | ||
## Full Example | ||
``` | ||
"use strict"; | ||
const EssConnect = require('grexxconnect-ess'); | ||
const GrexxConnectEss = new EssConnect({ | ||
applicationName: "My Custom ESS v2.4", | ||
username: "John", | ||
password: "JohnsPassword", | ||
server: "wss://server.com", | ||
debug: true | ||
}); | ||
GrexxConnectEss.on('message', Message => { | ||
console.info('Received a message', Message.parsed, Message.content); | ||
const reversedValue = (Message.parsed.content || '').split("").reverse().join(""); | ||
Message.resolve([{ | ||
reference: 'outputField', | ||
values: [{ value: reversedValue }] | ||
}]) | ||
}); | ||
GrexxConnectEss.setMonitoringResponse(() => { | ||
return { | ||
//== required. can be 'ok', 'warning', 'error' | ||
status: 'ok', | ||
//== Optional extra status data. Can be whatever you want. | ||
messagesInQueue: 0, | ||
lastMessage: '10 days ago' | ||
}; | ||
}); | ||
GrexxConnectEss.on('authorized', serviceName => console.info('Authorized!', serviceName)); | ||
@@ -33,0 +70,0 @@ GrexxConnectEss.on('disconnected', () => console.info('Disconnected!')); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10777
71