added output port for storage-write that gives status
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "node-red-contrib-firebase-admin",
|
"name": "node-red-contrib-firebase-admin",
|
||||||
"version": "1.0.9",
|
"version": "1.0.95",
|
||||||
"description": "A node-red module that wraps the server-side admin SDK of firebase, firestore, et.c.",
|
"description": "A node-red module that wraps the server-side admin SDK of firebase, firestore, et.c.",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
cred: {value: "", type: 'firebase-config'}
|
cred: {value: "", type: 'firebase-config'}
|
||||||
},
|
},
|
||||||
inputs:1,
|
inputs:1,
|
||||||
outputs:0,
|
outputs:1,
|
||||||
icon: "storage.png",
|
icon: "storage.png",
|
||||||
label: function() {
|
label: function() {
|
||||||
return this.name||"storage-write";
|
return this.name||"storage-write";
|
||||||
|
|||||||
@ -33,8 +33,10 @@ module.exports = function(RED) {
|
|||||||
file.save(contents, options, function(err) {
|
file.save(contents, options, function(err) {
|
||||||
if (!err) {
|
if (!err) {
|
||||||
// File written successfully.
|
// File written successfully.
|
||||||
|
node.send({payload:{success:true, filename: path}})
|
||||||
} else {
|
} else {
|
||||||
console.log('cloud storage write error: '+err)
|
console.log('cloud storage write error: '+err)
|
||||||
|
node.send({payload:{success:false, filename: path}})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user