node-red-contrib-agilite
Advanced tools
Comparing version 5.1.5 to 5.4.0
@@ -8,2 +8,4 @@ module.exports = function(RED) { | ||
var errorMessage = ""; | ||
this.field = config.field || "payload"; | ||
this.fieldType = config.fieldType || "msg"; | ||
@@ -112,3 +114,11 @@ this.on('input', function(msg) { | ||
if(response.data.success){ | ||
msg.payload = response.data.data; | ||
if (node.fieldType === "msg"){ | ||
RED.util.setMessageProperty(msg,node.field,response.data.data) | ||
}else if (node.fieldType === "flow") { | ||
node.context().flow.set(node.field,response.data.data); | ||
}else if (node.fieldType === "global") { | ||
node.context().global.set(node.field,response.data.data); | ||
} | ||
}else{ | ||
@@ -115,0 +125,0 @@ msg.payload = ""; |
@@ -8,2 +8,4 @@ module.exports = function(RED) { | ||
var errorMessage = ""; | ||
this.field = config.field || "payload"; | ||
this.fieldType = config.fieldType || "msg"; | ||
@@ -92,2 +94,4 @@ this.on('input', function(msg) { | ||
node.status({ fill: "yellow", text: "Running", shape: "ring" }); | ||
axios.post(url, data, headers) | ||
@@ -99,3 +103,11 @@ .then(function (response) { | ||
if(response.data.success){ | ||
msg.payload = response.data.data; | ||
if (node.fieldType === "msg"){ | ||
RED.util.setMessageProperty(msg,node.field,response.data.data) | ||
}else if (node.fieldType === "flow") { | ||
node.context().flow.set(node.field,response.data.data); | ||
}else if (node.fieldType === "global") { | ||
node.context().global.set(node.field,response.data.data); | ||
} | ||
}else{ | ||
@@ -105,2 +117,3 @@ msg.payload = ""; | ||
node.status({ fill: "green", text: "Success", shape: "ring" }); | ||
node.send(msg); | ||
@@ -119,2 +132,3 @@ }) | ||
node.status({ fill: "red", text: "Error", shape: "ring" }); | ||
node.send(msg); | ||
@@ -121,0 +135,0 @@ }); |
@@ -8,2 +8,4 @@ module.exports = function(RED) { | ||
var errorMessage = ""; | ||
this.field = config.field || "payload"; | ||
this.fieldType = config.fieldType || "msg"; | ||
@@ -235,3 +237,11 @@ this.on('input', function(msg) { | ||
if(response.data.success){ | ||
msg.payload = response.data.data; | ||
if (node.fieldType === "msg"){ | ||
RED.util.setMessageProperty(msg,node.field,response.data.data) | ||
}else if (node.fieldType === "flow") { | ||
node.context().flow.set(node.field,response.data.data); | ||
}else if (node.fieldType === "global") { | ||
node.context().global.set(node.field,response.data.data); | ||
} | ||
}else{ | ||
@@ -238,0 +248,0 @@ msg.payload = ""; |
@@ -8,2 +8,4 @@ module.exports = function(RED) { | ||
var errorMessage = ""; | ||
this.field = config.field || "payload"; | ||
this.fieldType = config.fieldType || "msg"; | ||
@@ -97,4 +99,13 @@ this.on('input', function(msg) { | ||
if(response.data.success){ | ||
msg.payload = response.data.data; | ||
if (node.fieldType === "msg"){ | ||
RED.util.setMessageProperty(msg,node.field,response.data.data) | ||
}else if (node.fieldType === "flow") { | ||
node.context().flow.set(node.field,response.data.data); | ||
}else if (node.fieldType === "global") { | ||
node.context().global.set(node.field,response.data.data); | ||
} | ||
}else{ | ||
@@ -107,2 +118,3 @@ msg.payload = ""; | ||
.catch(function (error) { | ||
console.log(error); | ||
if(error.response){ | ||
@@ -109,0 +121,0 @@ msg.payload = error.response.data.data; |
{ | ||
"name": "node-red-contrib-agilite", | ||
"license": "MIT", | ||
"version": "5.1.5", | ||
"version": "5.4.0", | ||
"description": "Node-RED nodes to integrate with Agilit-e cloud or Agilit-e on-prem", | ||
"homepage": "https://portal.agilite.io", | ||
"dependencies": { | ||
"axios": "0.17.0" | ||
"axios": "0.18.0" | ||
}, | ||
@@ -22,3 +22,4 @@ "keywords": [ | ||
"logging", | ||
"logs" | ||
"logs", | ||
"roles" | ||
], | ||
@@ -33,2 +34,3 @@ "node-red": { | ||
"Templates": "templates/templates.js", | ||
"Roles": "roles/roles.js", | ||
"Files": "files/files.js", | ||
@@ -35,0 +37,0 @@ "Utilities": "utilities/utilities.js", |
@@ -1,11 +0,11 @@ | ||
### node-red Agilit-e | ||
================== | ||
### Node-RED [Agilit-e](https://agilite.io) | ||
====================== | ||
* The set of nodes in this Node-RED module allow for easy integration into [Agilit-e](http://www.agilite.io) | ||
* The set of nodes in this Node-RED module allow for easy integration into [Agilit-e](https://agilite.io) | ||
* [API Reference Documentation](https://docs.agilite.io/v5.1/reference) | ||
# Author | ||
John Jardin (Integration and Cloud Architect at [Agilit-e](http://www.agilite.io)) | ||
John Jardin (Integration and Cloud Architect at [Agilit-e](https://agilite.io)) | ||
# License | ||
MIT |
@@ -8,2 +8,4 @@ module.exports = function(RED) { | ||
var errorMessage = ""; | ||
this.field = config.field || "payload"; | ||
this.fieldType = config.fieldType || "msg"; | ||
@@ -98,3 +100,11 @@ this.on('input', function(msg) { | ||
if(response.data.success){ | ||
msg.payload = response.data.data; | ||
if (node.fieldType === "msg"){ | ||
RED.util.setMessageProperty(msg,node.field,response.data.data) | ||
}else if (node.fieldType === "flow") { | ||
node.context().flow.set(node.field,response.data.data); | ||
}else if (node.fieldType === "global") { | ||
node.context().global.set(node.field,response.data.data); | ||
} | ||
}else{ | ||
@@ -101,0 +111,0 @@ msg.payload = ""; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
106913
32
1431
+ Addedaxios@0.18.0(transitive)
- Removedaxios@0.17.0(transitive)
Updatedaxios@0.18.0