mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
parent
8b53d09ad3
commit
86ab73662b
@ -74,13 +74,12 @@
|
|||||||
RED.nodes.registerType('twilio-api',{
|
RED.nodes.registerType('twilio-api',{
|
||||||
category: 'config',
|
category: 'config',
|
||||||
defaults: {
|
defaults: {
|
||||||
|
name: {value:""},
|
||||||
sid: {value:"",required:true},
|
sid: {value:"",required:true},
|
||||||
from: {value:"",required:true},
|
from: {value:"",required:true}
|
||||||
// token -> credentials
|
|
||||||
name: { value: ""}
|
|
||||||
},
|
},
|
||||||
credentials: {
|
credentials: {
|
||||||
token: "password"
|
token: {type: "password"}
|
||||||
},
|
},
|
||||||
label: function() {
|
label: function() {
|
||||||
return this.name||this.from;
|
return this.name||this.from;
|
||||||
@ -91,8 +90,8 @@
|
|||||||
category: 'mobile-output',
|
category: 'mobile-output',
|
||||||
defaults: {
|
defaults: {
|
||||||
twilio:{
|
twilio:{
|
||||||
type:"twilio-api",validate:function(v) {
|
type:"twilio-api", validate:function(v) {
|
||||||
return hasGlobal || (v && v!="_ADD_");
|
return hasGlobal || (v && v != "_ADD_");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
twilioType: {value:"sms"},
|
twilioType: {value:"sms"},
|
||||||
|
@ -10,7 +10,7 @@ module.exports = function(RED) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
RED.httpAdmin.get('/twilio-api/global', RED.auth.needsPermission("twilio.read"), function(req,res) {
|
RED.httpAdmin.get('/twilio-api/global', RED.auth.needsPermission("twilio.read"), function(req,res) {
|
||||||
res.json({hasToken:!(twiliokey && twiliokey.account && twiliokey.authtoken)});
|
res.json({hasToken:!!(twiliokey && twiliokey.account && twiliokey.authtoken)});
|
||||||
});
|
});
|
||||||
|
|
||||||
function TwilioAPINode(n) {
|
function TwilioAPINode(n) {
|
||||||
@ -22,7 +22,7 @@ module.exports = function(RED) {
|
|||||||
if (credentials) { this.token = credentials.token; }
|
if (credentials) { this.token = credentials.token; }
|
||||||
}
|
}
|
||||||
RED.nodes.registerType("twilio-api",TwilioAPINode,{
|
RED.nodes.registerType("twilio-api",TwilioAPINode,{
|
||||||
credentials: { token: "password" }
|
credentials: { token:"password" }
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name" : "node-red-node-twilio",
|
"name" : "node-red-node-twilio",
|
||||||
"version" : "0.0.14",
|
"version" : "0.0.15",
|
||||||
"description" : "A Node-RED node to send SMS messages via the Twilio service.",
|
"description" : "A Node-RED node to send SMS messages via the Twilio service.",
|
||||||
"dependencies" : {
|
"dependencies" : {
|
||||||
"twilio" : "^2.11.1"
|
"twilio" : "^2.11.1"
|
||||||
|
Loading…
Reference in New Issue
Block a user