@lifefinder/vsm-mqtt-client-open-source 0.0.61 → 0.0.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/publishers/https.js +4 -1
- package/vsm-mqtt-client.js +2 -2
package/package.json
CHANGED
package/publishers/https.js
CHANGED
|
@@ -23,7 +23,10 @@ module.exports.api = {
|
|
|
23
23
|
headers: {
|
|
24
24
|
"Accept": "application/json",
|
|
25
25
|
"Content-type" : "application/json",
|
|
26
|
-
"cache-control": "no-cache"
|
|
26
|
+
"cache-control": "no-cache",
|
|
27
|
+
// lfndr-service /push is behind ingress auth (fail-closed): send the
|
|
28
|
+
// shared secret when configured, matching keyfetch/series-processor.
|
|
29
|
+
...(process.env.INGRESS_SHARED_SECRET && { "X-Ingress-Secret": process.env.INGRESS_SHARED_SECRET })
|
|
27
30
|
},}).then(response => response.json())
|
|
28
31
|
.then(data => {console.log(" Response: ", data); return data; })
|
|
29
32
|
.catch(err => {console.log(" HTTPS Publish Failed: " + err.message);});
|
package/vsm-mqtt-client.js
CHANGED
|
@@ -103,7 +103,7 @@ exports.getMqttClient = () => {
|
|
|
103
103
|
return mqtt_client;
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
exports.sendDownlink = async (args, deveui, port, buffer) => {
|
|
106
|
+
exports.sendDownlink = async (args, deveui, port, buffer, confirmed = false) => {
|
|
107
107
|
if (!args || !deveui || !port || !buffer)
|
|
108
108
|
throw { message: "sendDownlink: Required argument missing"};
|
|
109
109
|
|
|
@@ -115,7 +115,7 @@ exports.sendDownlink = async (args, deveui, port, buffer) => {
|
|
|
115
115
|
if (!this.getMqttClient())
|
|
116
116
|
throw { message: "sendDownlink: MQTT not initialized."};
|
|
117
117
|
|
|
118
|
-
await integration.api.sendDownlink(this.getMqttClient(), args, deveui, port, Buffer.from(buffer, "hex"),
|
|
118
|
+
await integration.api.sendDownlink(this.getMqttClient(), args, deveui, port, Buffer.from(buffer, "hex"), confirmed === true);
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
const run = async () => {
|