node-red-contrib-nexmo
Advanced tools
Comparing version 3.1.3 to 3.1.4
@@ -26,3 +26,3 @@ const Nexmo = require('nexmo'); | ||
msg.payload=response; | ||
node.send(response) | ||
node.send(msg) | ||
} | ||
@@ -52,3 +52,3 @@ }) | ||
msg.payload=response; | ||
node.send(response) | ||
node.send(msg) | ||
} | ||
@@ -76,3 +76,3 @@ }) | ||
msg.payload=response; | ||
node.send(response) | ||
node.send(msg) | ||
} | ||
@@ -82,2 +82,3 @@ }) | ||
} | ||
function nextverify(config){ | ||
@@ -100,3 +101,3 @@ RED.nodes.createNode(this, config); | ||
msg.payload=response; | ||
node.send(response) | ||
node.send(msg) | ||
} | ||
@@ -106,2 +107,27 @@ }) | ||
} | ||
function searchverify(config){ | ||
RED.nodes.createNode(this, config); | ||
this.creds = RED.nodes.getNode(config.creds); | ||
var node = this; | ||
node.on('input', function(msg) { | ||
var debug = (this.context().global.get('nexmoDebug') | false); | ||
this.verify_id = mustache.render(config.verify_id, dataobject(this.context(), msg)); | ||
const nexmo = new Nexmo({ | ||
apiKey: this.creds.credentials.apikey, | ||
apiSecret: this.creds.credentials.apisecret | ||
}, {debug: debug, appendToUserAgent: "nexmo-nodered/"+version} | ||
); | ||
nexmo.verify.search(this.verify_id, function(err, response) { | ||
if (err) { | ||
console.error(err); | ||
} else { | ||
msg.payload = response; | ||
node.send(msg) | ||
} | ||
}); | ||
}) | ||
} | ||
RED.nodes.registerType("sendverify",sendverify); | ||
@@ -111,2 +137,3 @@ RED.nodes.registerType("checkverify",checkverify); | ||
RED.nodes.registerType("nextverify",nextverify); | ||
RED.nodes.registerType("searchverify", searchverify); | ||
} | ||
@@ -113,0 +140,0 @@ |
{ | ||
"name": "node-red-contrib-nexmo", | ||
"version": "3.1.3", | ||
"version": "3.1.4", | ||
"description": "Node Red module for the Nexmo API", | ||
@@ -5,0 +5,0 @@ "main": "ncco.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
123617
1237