From b23cf0b78821f412eab34b58069ce1234044fd07 Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Thu, 19 May 2016 10:13:47 +0100 Subject: [PATCH 01/60] add envelope to email node options as part of node-red#875 --- social/email/61-email.html | 11 ++++++----- social/email/61-email.js | 1 + social/email/package.json | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/social/email/61-email.html b/social/email/61-email.html index 4ebc4865..bfddae01 100644 --- a/social/email/61-email.html +++ b/social/email/61-email.html @@ -77,6 +77,7 @@ The filename should be set using msg.filename. Optionally msg.description can be added for the body text.

Alternatively you may provide msg.attachments which should contain an array of one or more attachments in nodemailer format.

+

If required by your recipient you may also pass in a msg.envelope object, typically containing extra from and to properties.

Note: uses SMTP with SSL to port 465.

@@ -178,13 +179,13 @@ } } }; - + $("#node-input-useSSL").change(function(x, y) { console.log("useSSL: x="+ JSON.stringify(x) + ", y=" + y); console.log("Value: " + $("#node-input-useSSL").prop("checked")); checkPorts(); }); - + $("#node-input-protocol").change(function() { var protocol = $("#node-input-protocol").val(); if (protocol === "IMAP") { @@ -192,7 +193,7 @@ $(".node-input-disposition").show(); } else { $(".node-input-box").hide(); - $(".node-input-disposition").hide(); + $(".node-input-disposition").hide(); } checkPorts(); }); @@ -210,7 +211,7 @@

Note: uses IMAP with SSL to port 993.

Any attachments supplied in the incoming email can be found in the msg.attachments property. This will be an array of objects where each object represents a specific attachments. The format of the object is:

- +
 {
   contentType:        // The MIME content description
@@ -240,7 +241,7 @@
             server: {value:"imap.gmail.com",required:true},
             useSSL: {value: true},
             port: {value:"993",required:true},
-            box: {value:"INBOX"}, // For IMAP, The mailbox to process 
+            box: {value:"INBOX"}, // For IMAP, The mailbox to process
             disposition: { value: "None" }, // For IMAP, the disposition of the read email
             repeat: {value:"300",required:true}
         },
diff --git a/social/email/61-email.js b/social/email/61-email.js
index bda5efc2..178bf2f9 100644
--- a/social/email/61-email.js
+++ b/social/email/61-email.js
@@ -89,6 +89,7 @@ module.exports = function(RED) {
                     var sendopts = { from: node.userid };   // sender address
                     sendopts.to = node.name || msg.to; // comma separated list of addressees
                     sendopts.subject = msg.topic || msg.title || "Message from Node-RED"; // subject line
+                    if (msg.hasOwnProperty("envelope")) { sendopts.envelope = msg.envelope; }
                     if (Buffer.isBuffer(msg.payload)) { // if it's a buffer in the payload then auto create an attachment instead
                         if (!msg.filename) {
                             var fe = "bin";
diff --git a/social/email/package.json b/social/email/package.json
index cd5961bf..9ea93d9d 100644
--- a/social/email/package.json
+++ b/social/email/package.json
@@ -1,6 +1,6 @@
 {
     "name"          : "node-red-node-email",
-    "version"       : "0.1.5",
+    "version"       : "0.1.6",
     "description"   : "Node-RED nodes to send and receive simple emails",
     "dependencies"  : {
         "nodemailer"   : "1.11.*",

From 966e7a520b1fac9ad7d8ce3526e51fc77e8de65a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nathana=C3=ABl=20L=C3=A9caud=C3=A9?=
 
Date: Fri, 20 May 2016 11:00:52 -0400
Subject: [PATCH 02/60] Physical-web: Added status (found, updated and lost) as
 msg.topic (#206)

Added msg.advertising = true/false to enable/disable advertising
Added status (lost, updated, found) as msg.topic, if not already set
Added checkbox to allow duplicates or not.

* Re-added optional topic to avoid breaking compatibility

* Cleaner topic slection
---
 hardware/physical-web/package.json      |  2 +-
 hardware/physical-web/physical-web.html | 55 ++++++++++++++-----------
 hardware/physical-web/physical-web.js   | 24 +++++++----
 3 files changed, 48 insertions(+), 33 deletions(-)

diff --git a/hardware/physical-web/package.json b/hardware/physical-web/package.json
index 18801f81..958d90bf 100644
--- a/hardware/physical-web/package.json
+++ b/hardware/physical-web/package.json
@@ -1,6 +1,6 @@
 {
   "name": "node-red-node-physical-web",
-  "version": "0.0.12",
+  "version": "0.0.13",
   "description": "Node-RED nodes to interact with the Physical Web",
   "main": "physical-web.js",
   "scripts": {
diff --git a/hardware/physical-web/physical-web.html b/hardware/physical-web/physical-web.html
index 381d20d0..4cb548b3 100644
--- a/hardware/physical-web/physical-web.html
+++ b/hardware/physical-web/physical-web.html
@@ -15,7 +15,11 @@
         
         
     
-    
+
+ + + Check this to allow duplicate messages +
@@ -24,33 +28,35 @@ diff --git a/social/email/61-email.js b/social/email/61-email.js index 178bf2f9..fc8b91a5 100644 --- a/social/email/61-email.js +++ b/social/email/61-email.js @@ -88,6 +88,10 @@ module.exports = function(RED) { } var sendopts = { from: node.userid }; // sender address sendopts.to = node.name || msg.to; // comma separated list of addressees + if (node.name === "") { + sendopts.cc = msg.cc; + sendopts.bcc = msg.bcc; + } sendopts.subject = msg.topic || msg.title || "Message from Node-RED"; // subject line if (msg.hasOwnProperty("envelope")) { sendopts.envelope = msg.envelope; } if (Buffer.isBuffer(msg.payload)) { // if it's a buffer in the payload then auto create an attachment instead diff --git a/social/email/package.json b/social/email/package.json index 9ea93d9d..953b0e8e 100644 --- a/social/email/package.json +++ b/social/email/package.json @@ -1,21 +1,21 @@ { "name" : "node-red-node-email", - "version" : "0.1.6", + "version" : "0.1.7", "description" : "Node-RED nodes to send and receive simple emails", - "dependencies" : { - "nodemailer" : "1.11.*", - "poplib" : "0.1.7", - "mailparser" : "0.5.3", - "imap" : "0.8.17" + "dependencies": { + "nodemailer": "^1.11.0", + "poplib": "^0.1.7", + "mailparser": "^0.5.3", + "imap": "^0.8.17" }, - "repository" : { - "type":"git", + "repository": { + "type": "git", "url":"https://github.com/node-red/node-red-nodes/tree/master/social/email" }, "license": "Apache-2.0", "keywords": [ "node-red", "email", "gmail", "imap" ], - "node-red" : { - "nodes" : { + "node-red": { + "nodes": { "email": "61-email.js" } }, From f91b7c4630543ab0738c462569d1a913903f1b35 Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Tue, 7 Jun 2016 15:57:40 +0100 Subject: [PATCH 06/60] updates to email node to better handle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit different mail types. Still not great - but does the basics… To close #210 for now --- social/email/61-email.js | 121 ++++++++++++++++++++++++++------------ social/email/package.json | 53 +++++++++-------- 2 files changed, 113 insertions(+), 61 deletions(-) diff --git a/social/email/61-email.js b/social/email/61-email.js index fc8b91a5..afeaf0bb 100644 --- a/social/email/61-email.js +++ b/social/email/61-email.js @@ -191,26 +191,69 @@ module.exports = function(RED) { // in the message flow. The parameter called `msg` is the template message we // start with while `mailMessage` is an object returned from `mailparser` that // will be used to populate the email. + // DCJ NOTE: - heirachical multipart mime parsers seem to not exist - this one is barely functional. function processNewMessage(msg, mailMessage) { msg = JSON.parse(JSON.stringify(msg)); // Clone the message - // Populate the msg fields from the content of the email message // that we have just parsed. - msg.html = mailMessage.html; - msg.payload = mailMessage.text; - if (mailMessage.attachments) { - msg.attachments = mailMessage.attachments; - } else { - msg.attachments = []; + if ((mailMessage.text) && (mailMessage.text.indexOf("--=_") !== -1)) { + //processNewMessage(msg,mailMessage.text); + var parts = mailMessage.text.split("--=_"); + msg.payload = parts[0].trim(); + for (var p = 0; p < parts.length; p++) { + //console.log("\n\nP***",p+"\n"+JSON.stringify(parts[p]),"\n***P\n\n"); + if (parts[p].indexOf("text/plain") >= 0) { + msg.payload = parts[p].split("\n\n",2)[1].trim(); + } + if (parts[p].indexOf("text/html") >= 0) { + msg.html = parts[p].split("\n\n",2)[1].trim(); + } + if (parts[p].indexOf("=--\n\n") >= 0) { + //msg.header = "text: "+msg.payload+"\n\n"+parts[p].split("\n\n",2)[1].trim(); + var mailparser = new MailParser(); + mailparser.on("end", function(mailMessage) { + //console.log("DONG",mailMessage); + msg.header = mailMessage.headers; + msg.topic = mailMessage.subject; + msg.date = mailMessage.date; + if (mailMessage.from && mailMessage.from.length > 0) { + msg.from = mailMessage.from[0].address; + } + if (mailMessage.attachments) { + msg.attachments = mailMessage.attachments; + } else { + msg.attachments = []; + } + node.send(msg); // Propagate the message down the flow + }); + mailparser.write(parts[p].split("\n\n",2)[1].trim()); + mailparser.end(); + } + } } - msg.topic = mailMessage.subject; - msg.header = mailMessage.headers; - msg.date = mailMessage.date; - if (mailMessage.from && mailMessage.from.length > 0) { - msg.from = mailMessage.from[0].address; + else { + if (!mailMessage.text) { + msg.payload = mailMessage.headers.text; + msg.topic = mailMessage.subject; + msg.header = mailMessage.headers; + msg.date = mailMessage.date; + } + else { + msg.payload = mailMessage.text; + } + if (mailMessage.html) { + msg.html = mailMessage.html; + } + if (mailMessage.from && mailMessage.from.length > 0) { + msg.from = mailMessage.from[0].address; + } + if (mailMessage.attachments) { + msg.attachments = mailMessage.attachments; + } else { + msg.attachments = []; + } + node.send(msg); // Propagate the message down the flow } - - node.send(msg); // Propagate the message down the flow } // End of processNewMessage // Check the POP3 email mailbox for any new messages. For any that are found, @@ -313,59 +356,63 @@ module.exports = function(RED) { // // Check the email sever using the IMAP protocol for new messages. function checkIMAP(msg) { - node.log("Checkimg IMAP for new messages"); + node.log("Checking IMAP for new messages"); // We get back a 'ready' event once we have connected to imap imap.once("ready", function() { node.status({fill:"blue", shape:"dot", text:"email.status.fetching"}); - console.log("> ready"); + //console.log("> ready"); // Open the inbox folder imap.openBox('INBOX', // Mailbox name false, // Open readonly? function(err, box) { - console.log("> Inbox open: %j", box); + //console.log("> Inbox open: %j", box); imap.search([ 'UNSEEN' ], function(err, results) { if (err) { node.status({fill:"red", shape:"ring", text:"email.status.foldererror"}); node.error(RED._("email.errors.fetchfail", {folder:node.box}),err); + imap.end(); return; } - console.log("> search - err=%j, results=%j", err, results); + //console.log("> search - err=%j, results=%j", err, results); if (results.length === 0) { - console.log(" [X] - Nothing to fetch"); + //console.log(" [X] - Nothing to fetch"); + node.status({}); + imap.end(); return; } // We have the search results that contain the list of unseen messages and can now fetch those messages. var fetch = imap.fetch(results, { - bodies : ["HEADER", "TEXT"], + //bodies : ['HEADER.FIELDS (FROM SUBJECT DATE)','TEXT'], + bodies : ['HEADER','TEXT'], markSeen : true }); // For each fetched message returned ... fetch.on('message', function(imapMessage, seqno) { - node.log(RED._("email.status.message",{number:seqno})); - var messageText = ""; - console.log("> Fetch message - msg=%j, seqno=%d", imapMessage, seqno); + //node.log(RED._("email.status.message",{number:seqno})); + var messageText = "text: "; + //console.log("> Fetch message - msg=%j, seqno=%d", imapMessage, seqno); imapMessage.on('body', function(stream, info) { - console.log("> message - body - stream=?, info=%j", info); + //console.log("> message - body - stream=?, info=%j", info); // Info defined which part of the message this is ... for example // 'TEXT' or 'HEADER' stream.on('data', function(chunk) { - console.log("> stream - data - chunk=??"); + //console.log("> stream - data - chunk=??"); messageText += chunk.toString('utf8'); }); + stream.once('end', function() { + if (info.which !== 'TEXT') { + var mailparser = new MailParser(); + mailparser.on("end", function(mailMessage) { + //console.log("mailparser: on(end): %j", mailMessage); + processNewMessage(msg, mailMessage); + }); + mailparser.write(messageText); + mailparser.end(); + } + }); // End of msg->end }); // End of msg->body - // When the `end` event is raised on the message - imapMessage.once('end', function() { - console.log("> msg - end : %j", messageText); - var mailparser = new MailParser(); - mailparser.on("end", function(mailMessage) { - //console.log("mailparser: on(end): %j", mailMessage); - processNewMessage(msg, mailMessage); - }); - mailparser.write(messageText); - mailparser.end(); - }); // End of msg->end }); // End of fetch->message // When we have fetched all the messages, we don't need the imap connection any more. @@ -416,7 +463,7 @@ module.exports = function(RED) { }); imap.on('error', function(err) { node.log(err); - node.status({fill:"red",shape:"ring",text:"email.status.connecterror"}); + //node.status({fill:"red",shape:"ring",text:"email.status.connecterror"}); }); } diff --git a/social/email/package.json b/social/email/package.json index 953b0e8e..06082c2a 100644 --- a/social/email/package.json +++ b/social/email/package.json @@ -1,27 +1,32 @@ { - "name" : "node-red-node-email", - "version" : "0.1.7", - "description" : "Node-RED nodes to send and receive simple emails", - "dependencies": { - "nodemailer": "^1.11.0", - "poplib": "^0.1.7", - "mailparser": "^0.5.3", - "imap": "^0.8.17" - }, - "repository": { - "type": "git", - "url":"https://github.com/node-red/node-red-nodes/tree/master/social/email" - }, - "license": "Apache-2.0", - "keywords": [ "node-red", "email", "gmail", "imap" ], - "node-red": { - "nodes": { - "email": "61-email.js" - } - }, - "author": { - "name": "Dave Conway-Jones", - "email": "ceejay@vnet.ibm.com", - "url": "http://nodered.org" + "name": "node-red-node-email", + "version": "0.1.8", + "description": "Node-RED nodes to send and receive simple emails", + "dependencies": { + "nodemailer": "^1.11.0", + "poplib": "^0.1.7", + "mailparser": "^0.6.0", + "imap": "^0.8.17" + }, + "repository": { + "type": "git", + "url": "https://github.com/node-red/node-red-nodes/tree/master/social/email" + }, + "license": "Apache-2.0", + "keywords": [ + "node-red", + "email", + "gmail", + "imap" + ], + "node-red": { + "nodes": { + "email": "61-email.js" } + }, + "author": { + "name": "Dave Conway-Jones", + "email": "ceejay@vnet.ibm.com", + "url": "http://nodered.org" + } } From 49692b32555cdc4e954f59126e9e96eafd9145ba Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Sun, 12 Jun 2016 17:04:07 +0100 Subject: [PATCH 07/60] Better email node parsing (again) --- .gitignore | 3 -- Gruntfile.js | 2 +- coverall | 3 ++ social/email/61-email.js | 101 ++++++++++---------------------------- social/email/package.json | 2 +- 5 files changed, 32 insertions(+), 79 deletions(-) create mode 100755 coverall diff --git a/.gitignore b/.gitignore index b9c6d903..09ee0ffd 100644 --- a/.gitignore +++ b/.gitignore @@ -2,9 +2,6 @@ npm-debug.log node_modules .npm coverage -coverall - puball.sh - setenv.sh /.project diff --git a/Gruntfile.js b/Gruntfile.js index 6d936e19..f64a8ff8 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,5 +1,5 @@ /** - * Copyright 2015 IBM Corp. + * Copyright 2014, 2016 IBM Corp. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/coverall b/coverall new file mode 100755 index 00000000..c4a004f8 --- /dev/null +++ b/coverall @@ -0,0 +1,3 @@ +# check coverage of tests... and browse report +istanbul cover ./node_modules/.bin/grunt --report lcovonly && istanbul report html +/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome coverage/index.html diff --git a/social/email/61-email.js b/social/email/61-email.js index afeaf0bb..81818356 100644 --- a/social/email/61-email.js +++ b/social/email/61-email.js @@ -140,7 +140,6 @@ module.exports = function(RED) { }); - // // EmailInNode // @@ -196,64 +195,21 @@ module.exports = function(RED) { msg = JSON.parse(JSON.stringify(msg)); // Clone the message // Populate the msg fields from the content of the email message // that we have just parsed. - if ((mailMessage.text) && (mailMessage.text.indexOf("--=_") !== -1)) { - //processNewMessage(msg,mailMessage.text); - var parts = mailMessage.text.split("--=_"); - msg.payload = parts[0].trim(); - for (var p = 0; p < parts.length; p++) { - //console.log("\n\nP***",p+"\n"+JSON.stringify(parts[p]),"\n***P\n\n"); - if (parts[p].indexOf("text/plain") >= 0) { - msg.payload = parts[p].split("\n\n",2)[1].trim(); - } - if (parts[p].indexOf("text/html") >= 0) { - msg.html = parts[p].split("\n\n",2)[1].trim(); - } - if (parts[p].indexOf("=--\n\n") >= 0) { - //msg.header = "text: "+msg.payload+"\n\n"+parts[p].split("\n\n",2)[1].trim(); - var mailparser = new MailParser(); - mailparser.on("end", function(mailMessage) { - //console.log("DONG",mailMessage); - msg.header = mailMessage.headers; - msg.topic = mailMessage.subject; - msg.date = mailMessage.date; - if (mailMessage.from && mailMessage.from.length > 0) { - msg.from = mailMessage.from[0].address; - } - if (mailMessage.attachments) { - msg.attachments = mailMessage.attachments; - } else { - msg.attachments = []; - } - node.send(msg); // Propagate the message down the flow - }); - mailparser.write(parts[p].split("\n\n",2)[1].trim()); - mailparser.end(); - } - } + msg.payload = mailMessage.text; + msg.topic = mailMessage.subject; + msg.date = mailMessage.date; + if (mailMessage.html) { + msg.html = mailMessage.html; } - else { - if (!mailMessage.text) { - msg.payload = mailMessage.headers.text; - msg.topic = mailMessage.subject; - msg.header = mailMessage.headers; - msg.date = mailMessage.date; - } - else { - msg.payload = mailMessage.text; - } - if (mailMessage.html) { - msg.html = mailMessage.html; - } - if (mailMessage.from && mailMessage.from.length > 0) { - msg.from = mailMessage.from[0].address; - } - if (mailMessage.attachments) { - msg.attachments = mailMessage.attachments; - } else { - msg.attachments = []; - } - node.send(msg); // Propagate the message down the flow + if (mailMessage.from && mailMessage.from.length > 0) { + msg.from = mailMessage.from[0].address; } + if (mailMessage.attachments) { + msg.attachments = mailMessage.attachments; + } else { + msg.attachments = []; + } + node.send(msg); // Propagate the message down the flow } // End of processNewMessage // Check the POP3 email mailbox for any new messages. For any that are found, @@ -383,34 +339,29 @@ module.exports = function(RED) { // We have the search results that contain the list of unseen messages and can now fetch those messages. var fetch = imap.fetch(results, { - //bodies : ['HEADER.FIELDS (FROM SUBJECT DATE)','TEXT'], - bodies : ['HEADER','TEXT'], + bodies: '', + struct: true, markSeen : true }); // For each fetched message returned ... fetch.on('message', function(imapMessage, seqno) { //node.log(RED._("email.status.message",{number:seqno})); - var messageText = "text: "; + var messageText = ""; //console.log("> Fetch message - msg=%j, seqno=%d", imapMessage, seqno); imapMessage.on('body', function(stream, info) { //console.log("> message - body - stream=?, info=%j", info); - // Info defined which part of the message this is ... for example - // 'TEXT' or 'HEADER' stream.on('data', function(chunk) { //console.log("> stream - data - chunk=??"); messageText += chunk.toString('utf8'); }); stream.once('end', function() { - if (info.which !== 'TEXT') { - var mailparser = new MailParser(); - mailparser.on("end", function(mailMessage) { - //console.log("mailparser: on(end): %j", mailMessage); - processNewMessage(msg, mailMessage); - }); - mailparser.write(messageText); - mailparser.end(); - } + var mailParser = new MailParser(); + mailParser.on('end', function(mailMessage) { + processNewMessage(msg, mailMessage); + }); + mailParser.write(messageText); + mailParser.end(); }); // End of msg->end }); // End of msg->body }); // End of fetch->message @@ -461,9 +412,11 @@ module.exports = function(RED) { connTimeout: node.repeat, authTimeout: node.repeat }); - imap.on('error', function(err) { - node.log(err); - //node.status({fill:"red",shape:"ring",text:"email.status.connecterror"}); + imap.on('error', function(err) { + if (err.errno !== "ECONNRESET") { + node.log(err); + node.status({fill:"red",shape:"ring",text:"email.status.connecterror"}); + } }); } diff --git a/social/email/package.json b/social/email/package.json index 06082c2a..2fed930e 100644 --- a/social/email/package.json +++ b/social/email/package.json @@ -1,6 +1,6 @@ { "name": "node-red-node-email", - "version": "0.1.8", + "version": "0.1.9", "description": "Node-RED nodes to send and receive simple emails", "dependencies": { "nodemailer": "^1.11.0", From 46cc9bb906d42aa93e2a6a01a9f5540ea82fe5e5 Mon Sep 17 00:00:00 2001 From: Ben Hardill Date: Fri, 24 Jun 2016 11:06:59 +0100 Subject: [PATCH 08/60] Added more error checking in the discovery section (#214) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Replacing the original wemo node with the wemo-ng node * Added install instructions * Fix name of wemo out node * Fix some jshint errors More jshint fixes fix jshint last jshint fix Fix last jshint error * Adds proper url length detection * fix up the extra line added in the merge * Fix some jshint errors More jshint fixes fix jshint last jshint fix Fix last jshint error load of tiny listing fixes, undef, unused, etc fix slight wrinkle in new Wemo node Fix wemo package name for npm. Add contribution.md to node-red-nodes to make it more obvious. correct spelling in readme.md revert .jshintrc Added subtree and walker nodes. (#200) Thanks @mikakaraila - very useful. slight edits to snmp to pass jslint-ing Bump underlying serial port nam version correct BBB callback response to check exists To Fix #198 * Adds proper url length detection fix up the extra line added in the merge * Added some more error checking in discovery * Adds proper url length detection* fix up the extra line added in the merge * Adds proper url length detection * fix up the extra line added in the merge Add line output mode for Daemon node to address #202 Email rework (#195) * Rework of Node-RED email nodes tidy up email listing - no code changes add latest email node dips and update email node libs - bump version update package version for nodes tests add a few tests geohash, smooth, base64, msgpack correct path of source file Thanks @Ltrlg Fix typo in node-red-node-smooth (#205) node-red-node-physical-web: Added msg.advertising = true/false to enable/disable advertising (#204) * Added msg.advertising = true/false to enable/disable advertising * Fixed comparison with bool Don't use get_compass as it breaks get_orientation add envelope to email node options as part of node-red#875 Physical-web: Added status (found, updated and lost) as msg.topic (#206) Added msg.advertising = true/false to enable/disable advertising Added status (lost, updated, found) as msg.topic, if not already set Added checkbox to allow duplicates or not. * Re-added optional topic to avoid breaking compatibility * Cleaner topic slection add a v0.3 serial port to help with node5/6 let PI try to enable sensorTag access on install Add cc and bcc options to email node to close #209 updates to email node to better handle different mail types. Still not great - but does the basics… To close Better email node parsing (again) Fix indent fixed formating * Fix heading in README.md Fix node name in README.md --- hardware/wemo/README.md | 2 +- hardware/wemo/lib/wemo.js | 210 +++++++++++++++++++------------------ hardware/wemo/package.json | 2 +- 3 files changed, 112 insertions(+), 102 deletions(-) diff --git a/hardware/wemo/README.md b/hardware/wemo/README.md index 57e4a44f..3f5fe7f1 100644 --- a/hardware/wemo/README.md +++ b/hardware/wemo/README.md @@ -1,4 +1,4 @@ -# node-red-contrib-nodes-wemo +# node-red-node-wemo A set of Node-RED nodes for working with Belkin WeMo devices. diff --git a/hardware/wemo/lib/wemo.js b/hardware/wemo/lib/wemo.js index d3822fed..757a8f85 100644 --- a/hardware/wemo/lib/wemo.js +++ b/hardware/wemo/lib/wemo.js @@ -79,119 +79,129 @@ WeMoNG.prototype.start = function start() { var location = url.parse(headers.LOCATION); var port = location.port; request.get(location.href, function(err, res, xml) { - xml2js.parseString(xml, function(err, json) { - var device = { ip: location.hostname, port: location.port }; - for (var key in json.root.device[0]) { - device[key] = json.root.device[0][key][0]; - } - if (device.deviceType == "urn:Belkin:device:bridge:1") { - //console.log( device.ip + ' -' + device.deviceType); - var ip = device.ip; - var port = device.port; - var udn = device.UDN; - var postoptions = { - host: ip, - port: port, - path: getenddevs.path, - method: 'POST', - headers: { - 'SOAPACTION': getenddevs.action, - 'Content-Type': 'text/xml; charset="utf-8"', - 'Accept': '' + if (!err) { + xml2js.parseString(xml, function(err, json) { + if (!err) { + var device = { ip: location.hostname, port: location.port }; + for (var key in json.root.device[0]) { + device[key] = json.root.device[0][key][0]; } - }; + if (device.deviceType == "urn:Belkin:device:bridge:1") { + //console.log( device.ip + ' -' + device.deviceType); + var ip = device.ip; + var port = device.port; + var udn = device.UDN; + var postoptions = { + host: ip, + port: port, + path: getenddevs.path, + method: 'POST', + headers: { + 'SOAPACTION': getenddevs.action, + 'Content-Type': 'text/xml; charset="utf-8"', + 'Accept': '' + } + }; - var post_request = http.request(postoptions, function(res) { - var data = ""; - res.setEncoding('utf8'); - res.on('data', function(chunk) { - data += chunk; - }); + var post_request = http.request(postoptions, function(res) { + var data = ""; + res.setEncoding('utf8'); + res.on('data', function(chunk) { + data += chunk; + }); - res.on('end',function() { - xml2js.parseString(data, function(err, result) { - if(!err) { - var list = result["s:Envelope"]["s:Body"][0]["u:GetEndDevicesResponse"][0].DeviceLists[0]; - xml2js.parseString(list, function(err, result2) { - if (!err) { - var devinfo = result2.DeviceLists.DeviceList[0].DeviceInfos[0].DeviceInfo; - for (var i=0; i Date: Mon, 27 Jun 2016 12:01:19 +0100 Subject: [PATCH 09/60] Allow Email node to select folder other than INBOX Closes #215 Thanks to @aamol for spotting --- social/email/61-email.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/social/email/61-email.js b/social/email/61-email.js index 81818356..12738bc2 100644 --- a/social/email/61-email.js +++ b/social/email/61-email.js @@ -318,7 +318,7 @@ module.exports = function(RED) { node.status({fill:"blue", shape:"dot", text:"email.status.fetching"}); //console.log("> ready"); // Open the inbox folder - imap.openBox('INBOX', // Mailbox name + imap.openBox(node.box, // Mailbox name false, // Open readonly? function(err, box) { //console.log("> Inbox open: %j", box); @@ -412,7 +412,7 @@ module.exports = function(RED) { connTimeout: node.repeat, authTimeout: node.repeat }); - imap.on('error', function(err) { + imap.on('error', function(err) { if (err.errno !== "ECONNRESET") { node.log(err); node.status({fill:"red",shape:"ring",text:"email.status.connecterror"}); From c830e461eaf11de3a893639db28a51e564f959df Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Mon, 27 Jun 2016 12:03:31 +0100 Subject: [PATCH 10/60] Bump email node package version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit should have been part of previous fix…. darn. --- social/email/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/social/email/package.json b/social/email/package.json index 2fed930e..a0ba9a44 100644 --- a/social/email/package.json +++ b/social/email/package.json @@ -1,6 +1,6 @@ { "name": "node-red-node-email", - "version": "0.1.9", + "version": "0.1.10", "description": "Node-RED nodes to send and receive simple emails", "dependencies": { "nodemailer": "^1.11.0", From 14cfbf7b0b883a98aeb67a28326f38ec2ad89213 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nathana=C3=ABl=20L=C3=A9caud=C3=A9?= Date: Wed, 29 Jun 2016 13:32:27 -0300 Subject: [PATCH 11/60] Update spinner to reflect new power range. (#218) --- hardware/physical-web/physical-web.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hardware/physical-web/physical-web.html b/hardware/physical-web/physical-web.html index 4cb548b3..ff5ea95b 100644 --- a/hardware/physical-web/physical-web.html +++ b/hardware/physical-web/physical-web.html @@ -218,7 +218,7 @@ $("#node-input-period").spinner({min:0}); $("#node-input-count").spinner({min:0}); - $("#node-input-power").spinner({min:-30,max:100}); + $("#node-input-power").spinner({min:-100,max:20}); $("#url-length").text(checkLength($('#node-input-url').val())); $("#node-input-mode").on("change",function() { if ($("#node-input-mode").val() === "uid") { From 648d6438b12b70af955c9c804945bcc316c49835 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nathana=C3=ABl=20L=C3=A9caud=C3=A9?= Date: Wed, 29 Jun 2016 13:32:50 -0300 Subject: [PATCH 12/60] Corrected error in power level (#217) --- hardware/physical-web/physical-web.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hardware/physical-web/physical-web.html b/hardware/physical-web/physical-web.html index ff5ea95b..8a2b6867 100644 --- a/hardware/physical-web/physical-web.html +++ b/hardware/physical-web/physical-web.html @@ -134,7 +134,7 @@

You can also preset the URL, in which case the node does not require any input.

In UID mode this node can take the 10 bytes namespace (as an HEX string) as msg.payload and the 6 bytes instance (as an HEX string) as msg.topic. -

The config window will allow you to set the powerlevel (-30 to 100 db) and the TLM count and period values.

+

The config window will allow you to set the powerlevel (-100 to 20 dbm) and the TLM count and period values.

TLM stands for telemetry data and is a type of packet sent alongside the main packet that provides diagnostics information. The count and period determine the ratio of TLM packets sent versus normal packets. A period of 10 and a count of 2 means that 2 TLM packets are sent for each 10 advertisements.

From 0b094cbfc7ff621c9c3f87934ee56e850625bbcf Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Wed, 29 Jun 2016 17:36:00 +0100 Subject: [PATCH 13/60] bump physical-web package version for nom --- hardware/physical-web/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hardware/physical-web/package.json b/hardware/physical-web/package.json index 958d90bf..dc3e7bac 100644 --- a/hardware/physical-web/package.json +++ b/hardware/physical-web/package.json @@ -1,6 +1,6 @@ { "name": "node-red-node-physical-web", - "version": "0.0.13", + "version": "0.0.14", "description": "Node-RED nodes to interact with the Physical Web", "main": "physical-web.js", "scripts": { From 0bfeb13abcef6d5b6ff820b568b641446f2a87a6 Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Wed, 13 Jul 2016 14:19:09 +0100 Subject: [PATCH 14/60] Move Arduino nodes to use firmata nom rather than arduino-firmata --- hardware/Arduino/35-arduino.html | 16 +-- hardware/Arduino/35-arduino.js | 114 +++++++----------- .../Arduino/locales/en-US/35-arduino.json | 3 +- hardware/Arduino/package.json | 4 +- 4 files changed, 58 insertions(+), 79 deletions(-) diff --git a/hardware/Arduino/35-arduino.html b/hardware/Arduino/35-arduino.html index a1134698..0eb77bd9 100644 --- a/hardware/Arduino/35-arduino.html +++ b/hardware/Arduino/35-arduino.html @@ -52,9 +52,9 @@ defaults: { name: {value:""}, pin: {value:"",validate: function(v) { - var ct = $("#node-input-state").val() || this.state; - return ct === 'STRING' || (v !== ''); - }}, + var ct = $("#node-input-state").val() || this.state; + return ct === 'STRING' || (v !== ''); + }}, state: {value:"INPUT",required:true}, arduino: {type:"arduino-board"} }, @@ -107,15 +107,15 @@ + + + + diff --git a/hardware/mcp3008/pimcp3008.js b/hardware/mcp3008/pimcp3008.js new file mode 100644 index 00000000..6cc34591 --- /dev/null +++ b/hardware/mcp3008/pimcp3008.js @@ -0,0 +1,76 @@ +/** + * Copyright 2016 IBM Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + **/ + +module.exports = function(RED) { + "use strict"; + var fs = require('fs'); + // unlikely if not on a Pi + try { fs.statSync("/dev/ttyAMA0"); } + catch(err) { throw "Info : Ignoring Raspberry Pi specific node"; } + + var mcpadc = require('mcp-spi-adc'); + var mcp3008 = []; + + function PiMcpNode(n) { + RED.nodes.createNode(this,n); + this.pin = n.pin || 0; + this.interval = n.interval || 1000; + var node = this; + + try { + fs.statSync("/dev/spidev0.0"); + if (mcp3008.length === 0) { + for (var i=0; i<8; i++) { + mcp3008.push(mcpadc.open(i, function (err) { + if (err) { node.error("Error: "+err); } + })); + } + } + node.on("input", function(msg) { + var pin = null; + if (node.pin === "M") { + var pay = parseInt(msg.payload.toString()); + if ((pay >= 0) && (pay <= 7)) { pin = pay; } + else { node.warn("Payload needs to select channel 0 to 7"); } + } + else { pin = parseInt(node.pin); } + if (pin !== null) { + mcp3008[pin].read(function (err, reading) { + if (err) { node.warn("Read error: "+err); } + else { node.send({payload:reading.rawValue, topic:"adc/"+pin}); } + }); + } + }); + + } + catch(err) { + node.error("Error : Can't find SPI device - is SPI enabled in raspi-config ?"); + } + + node.on("close", function(done) { + if (mcp3008.length !== 0) { + var j=0; + for (var i=0; i<8; i++) { + mcp3008[i].close(function() { j += 1; if (j === 8) {done()} }); + } + mcp3008 = []; + } + else { done(); } + }); + } + + RED.nodes.registerType("pimcp3008",PiMcpNode); +} diff --git a/package.json b/package.json index dd4dcfc9..2fe474bf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name" : "node-red-nodes", - "version" : "0.0.5", + "version" : "0.0.6", "description" : "Node-RED-nodes package to hold the test framework ONLY - use npm to install individual nodes", "homepage" : "http://nodered.org", "license" : "Apache-2.0", @@ -18,24 +18,24 @@ ], "devDependencies": { "grunt": "^0.4.5", - "grunt-simple-mocha": "0.4.1", - "grunt-contrib-jshint": "1.0.0", - "grunt-lint-inline": "0.4.4", - "grunt-jscs": "2.8.0", + "grunt-simple-mocha": "^0.4.1", + "grunt-contrib-jshint": "^1.0.0", + "grunt-lint-inline": "^0.4.4", + "grunt-jscs": "^2.8.0", "mocha": "^2.4.5", "should": "^8.3.1", "sinon": "^1.17.3", "supertest": "^1.2.0", - "proxyquire": "1.7.4", - "pushbullet": "1.4.*", + "proxyquire": "^1.7.10", + "pushbullet": "^1.4.0", "when": "^3.7.7", - "exif": "0.6.0", - "ngeohash": "0.6.*", - "nodemailer" : "1.11.*", - "poplib" : "0.1.7", - "mailparser" : "0.5.3", - "imap" : "0.8.17", - "msgpack-js": "0.3.0" + "exif": "^0.6.0", + "ngeohash": "^0.6.0", + "nodemailer" : "^1.11.0", + "poplib" : "^0.1.7", + "mailparser" : "^0.5.3", + "imap" : "^0.8.18", + "msgpack-js": "^0.3.0" }, "engines": { "node": ">=0.10" From b0c93e44b84c54e81763ebe18846d0ba7528f764 Mon Sep 17 00:00:00 2001 From: smchamberlin Date: Tue, 27 Sep 2016 17:34:04 +0100 Subject: [PATCH 32/60] Twitter node: Add support for search terms passed in through msg.payload (#235) * Add support for search terms passed in through msg.payload * Add support for dynamic left ping connector * Suggestions from David Conway-Jones * Better error message * Add green status indicator when msg.payload is dynamically passed in and revised warning messages --- social/twitter/27-twitter.html | 14 ++++++++++++-- social/twitter/27-twitter.js | 26 +++++++++++++++++++++----- 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/social/twitter/27-twitter.html b/social/twitter/27-twitter.html index 94fd76c8..60276c84 100644 --- a/social/twitter/27-twitter.html +++ b/social/twitter/27-twitter.html @@ -124,7 +124,7 @@
  • all tweets by specific users
  • direct messages received by the authenticated user
  • -

    Use space for and and comma , for or when searching for multiple terms.

    +

    Use space for and and comma , for or when searching for multiple terms. If you want to pass in the term(s) via the msg.payload, leave the field blank.

    Sets the msg.topic to tweets/ and then appends the senders screen name.

    Sets msg.location to the tweeters location if known.

    Sets msg.tweet to the full tweet object as documented by Twitter. @@ -140,7 +140,7 @@ color:"#C0DEED", defaults: { twitter: {type:"twitter-credentials",required:true}, - tags: {value:"",validate:function(v) { return this.user == "dm" || v.length > 0;}}, + tags: {value:""}, user: {value:"false",required:true}, name: {value:""}, topic: {value:"tweets"} @@ -184,6 +184,16 @@ }); $("#node-input-user").change(); + }, + oneditsave: function() { + if ($('#node-input-tags').val() == '' && $("#node-input-user option:selected").val() != 'dm' + && $("#node-input-user option:selected").val() != 'user') { + this.inputs=1; + } + else { + //set back the default state of 0 inputs + this.inputs=0; + } } }); diff --git a/social/twitter/27-twitter.js b/social/twitter/27-twitter.js index f0e24e04..fd7bf221 100644 --- a/social/twitter/27-twitter.js +++ b/social/twitter/27-twitter.js @@ -89,6 +89,7 @@ module.exports = function(RED) { node.poll_ids = []; node.since_ids = {}; var users = node.tags.split(","); + if (users == '') node.warn("User option selected but no users specified"); for (var i=0;i Date: Tue, 27 Sep 2016 17:56:35 +0100 Subject: [PATCH 33/60] Tidy up twitter node, add status, i18n etc --- social/twitter/27-twitter.html | 15 ++++--- social/twitter/27-twitter.js | 44 ++++++++++---------- social/twitter/locales/en-US/27-twitter.json | 10 +++-- 3 files changed, 37 insertions(+), 32 deletions(-) diff --git a/social/twitter/27-twitter.html b/social/twitter/27-twitter.html index 60276c84..4ac7729f 100644 --- a/social/twitter/27-twitter.html +++ b/social/twitter/27-twitter.html @@ -1,5 +1,5 @@ diff --git a/99-sample.js.demo b/99-sample.js.demo index 939cffd0..acc4d554 100644 --- a/99-sample.js.demo +++ b/99-sample.js.demo @@ -1,18 +1,3 @@ -/** - * Copyright 2014 IBM Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - **/ // If you use this as a template, update the copyright with your own name. diff --git a/Gruntfile.js b/Gruntfile.js index f64a8ff8..fc388087 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,18 +1,3 @@ -/** - * Copyright 2014, 2016 IBM Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - **/ // Configuration for Node-RED-nodes project module.exports = function(grunt) { diff --git a/LICENSE b/LICENSE index 37ec93a1..f5b60114 100644 --- a/LICENSE +++ b/LICENSE @@ -1,191 +1,14 @@ -Apache License -Version 2.0, January 2004 -http://www.apache.org/licenses/ +Copyright 2016 JS Foundation and other contributors, https://js.foundation/ +Copyright 2013-2016 IBM Corp. -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at -1. Definitions. +http://www.apache.org/licenses/LICENSE-2.0 -"License" shall mean the terms and conditions for use, reproduction, and -distribution as defined by Sections 1 through 9 of this document. - -"Licensor" shall mean the copyright owner or entity authorized by the copyright -owner that is granting the License. - -"Legal Entity" shall mean the union of the acting entity and all other entities -that control, are controlled by, or are under common control with that entity. -For the purposes of this definition, "control" means (i) the power, direct or -indirect, to cause the direction or management of such entity, whether by -contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the -outstanding shares, or (iii) beneficial ownership of such entity. - -"You" (or "Your") shall mean an individual or Legal Entity exercising -permissions granted by this License. - -"Source" form shall mean the preferred form for making modifications, including -but not limited to software source code, documentation source, and configuration -files. - -"Object" form shall mean any form resulting from mechanical transformation or -translation of a Source form, including but not limited to compiled object code, -generated documentation, and conversions to other media types. - -"Work" shall mean the work of authorship, whether in Source or Object form, made -available under the License, as indicated by a copyright notice that is included -in or attached to the work (an example is provided in the Appendix below). - -"Derivative Works" shall mean any work, whether in Source or Object form, that -is based on (or derived from) the Work and for which the editorial revisions, -annotations, elaborations, or other modifications represent, as a whole, an -original work of authorship. For the purposes of this License, Derivative Works -shall not include works that remain separable from, or merely link (or bind by -name) to the interfaces of, the Work and Derivative Works thereof. - -"Contribution" shall mean any work of authorship, including the original version -of the Work and any modifications or additions to that Work or Derivative Works -thereof, that is intentionally submitted to Licensor for inclusion in the Work -by the copyright owner or by an individual or Legal Entity authorized to submit -on behalf of the copyright owner. For the purposes of this definition, -"submitted" means any form of electronic, verbal, or written communication sent -to the Licensor or its representatives, including but not limited to -communication on electronic mailing lists, source code control systems, and -issue tracking systems that are managed by, or on behalf of, the Licensor for -the purpose of discussing and improving the Work, but excluding communication -that is conspicuously marked or otherwise designated in writing by the copyright -owner as "Not a Contribution." - -"Contributor" shall mean Licensor and any individual or Legal Entity on behalf -of whom a Contribution has been received by Licensor and subsequently -incorporated within the Work. - -2. Grant of Copyright License. - -Subject to the terms and conditions of this License, each Contributor hereby -grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, -irrevocable copyright license to reproduce, prepare Derivative Works of, -publicly display, publicly perform, sublicense, and distribute the Work and such -Derivative Works in Source or Object form. - -3. Grant of Patent License. - -Subject to the terms and conditions of this License, each Contributor hereby -grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, -irrevocable (except as stated in this section) patent license to make, have -made, use, offer to sell, sell, import, and otherwise transfer the Work, where -such license applies only to those patent claims licensable by such Contributor -that are necessarily infringed by their Contribution(s) alone or by combination -of their Contribution(s) with the Work to which such Contribution(s) was -submitted. If You institute patent litigation against any entity (including a -cross-claim or counterclaim in a lawsuit) alleging that the Work or a -Contribution incorporated within the Work constitutes direct or contributory -patent infringement, then any patent licenses granted to You under this License -for that Work shall terminate as of the date such litigation is filed. - -4. Redistribution. - -You may reproduce and distribute copies of the Work or Derivative Works thereof -in any medium, with or without modifications, and in Source or Object form, -provided that You meet the following conditions: - -You must give any other recipients of the Work or Derivative Works a copy of -this License; and -You must cause any modified files to carry prominent notices stating that You -changed the files; and -You must retain, in the Source form of any Derivative Works that You distribute, -all copyright, patent, trademark, and attribution notices from the Source form -of the Work, excluding those notices that do not pertain to any part of the -Derivative Works; and -If the Work includes a "NOTICE" text file as part of its distribution, then any -Derivative Works that You distribute must include a readable copy of the -attribution notices contained within such NOTICE file, excluding those notices -that do not pertain to any part of the Derivative Works, in at least one of the -following places: within a NOTICE text file distributed as part of the -Derivative Works; within the Source form or documentation, if provided along -with the Derivative Works; or, within a display generated by the Derivative -Works, if and wherever such third-party notices normally appear. The contents of -the NOTICE file are for informational purposes only and do not modify the -License. You may add Your own attribution notices within Derivative Works that -You distribute, alongside or as an addendum to the NOTICE text from the Work, -provided that such additional attribution notices cannot be construed as -modifying the License. -You may add Your own copyright statement to Your modifications and may provide -additional or different license terms and conditions for use, reproduction, or -distribution of Your modifications, or for any such Derivative Works as a whole, -provided Your use, reproduction, and distribution of the Work otherwise complies -with the conditions stated in this License. - -5. Submission of Contributions. - -Unless You explicitly state otherwise, any Contribution intentionally submitted -for inclusion in the Work by You to the Licensor shall be under the terms and -conditions of this License, without any additional terms or conditions. -Notwithstanding the above, nothing herein shall supersede or modify the terms of -any separate license agreement you may have executed with Licensor regarding -such Contributions. - -6. Trademarks. - -This License does not grant permission to use the trade names, trademarks, -service marks, or product names of the Licensor, except as required for -reasonable and customary use in describing the origin of the Work and -reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. - -Unless required by applicable law or agreed to in writing, Licensor provides the -Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, -including, without limitation, any warranties or conditions of TITLE, -NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are -solely responsible for determining the appropriateness of using or -redistributing the Work and assume any risks associated with Your exercise of -permissions under this License. - -8. Limitation of Liability. - -In no event and under no legal theory, whether in tort (including negligence), -contract, or otherwise, unless required by applicable law (such as deliberate -and grossly negligent acts) or agreed to in writing, shall any Contributor be -liable to You for damages, including any direct, indirect, special, incidental, -or consequential damages of any character arising as a result of this License or -out of the use or inability to use the Work (including but not limited to -damages for loss of goodwill, work stoppage, computer failure or malfunction, or -any and all other commercial damages or losses), even if such Contributor has -been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. - -While redistributing the Work or Derivative Works thereof, You may choose to -offer, and charge a fee for, acceptance of support, warranty, indemnity, or -other liability obligations and/or rights consistent with this License. However, -in accepting such obligations, You may act only on Your own behalf and on Your -sole responsibility, not on behalf of any other Contributor, and only if You -agree to indemnify, defend, and hold each Contributor harmless for any liability -incurred by, or claims asserted against, such Contributor by reason of your -accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work - -To apply the Apache License to your work, attach the following boilerplate -notice, with the fields enclosed by brackets "[]" replaced with your own -identifying information. (Don't include the brackets!) The text should be -enclosed in the appropriate comment syntax for the file format. We also -recommend that a file or class name and description of purpose be included on -the same "printed page" as the copyright notice for easier identification within -third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/analysis/swearfilter/74-swearfilter.html b/analysis/swearfilter/74-swearfilter.html index 5940816d..8dc11045 100644 --- a/analysis/swearfilter/74-swearfilter.html +++ b/analysis/swearfilter/74-swearfilter.html @@ -1,18 +1,3 @@ - diff --git a/hardware/PiFace/37-rpi-piface.js b/hardware/PiFace/37-rpi-piface.js index 82fb0602..901c2a8b 100644 --- a/hardware/PiFace/37-rpi-piface.js +++ b/hardware/PiFace/37-rpi-piface.js @@ -1,18 +1,3 @@ -/** - * Copyright 2013,2014 IBM Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - **/ module.exports = function(RED) { "use strict"; diff --git a/hardware/PiFace/LICENSE b/hardware/PiFace/LICENSE index f433b1a5..f5b60114 100644 --- a/hardware/PiFace/LICENSE +++ b/hardware/PiFace/LICENSE @@ -1,177 +1,14 @@ +Copyright 2016 JS Foundation and other contributors, https://js.foundation/ +Copyright 2013-2016 IBM Corp. - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION +http://www.apache.org/licenses/LICENSE-2.0 - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/hardware/PiFace/package.json b/hardware/PiFace/package.json index 1c58b9d3..79bc034d 100644 --- a/hardware/PiFace/package.json +++ b/hardware/PiFace/package.json @@ -1,6 +1,6 @@ { "name" : "node-red-node-piface", - "version" : "0.0.7", + "version" : "0.0.8", "description" : "Node-RED nodes to read from and write to a PiFace Digital Raspberry Pi add-on board", "dependencies" : { }, diff --git a/hardware/PiLcd/LICENSE b/hardware/PiLcd/LICENSE index f433b1a5..f5b60114 100644 --- a/hardware/PiLcd/LICENSE +++ b/hardware/PiLcd/LICENSE @@ -1,177 +1,14 @@ +Copyright 2016 JS Foundation and other contributors, https://js.foundation/ +Copyright 2013-2016 IBM Corp. - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION +http://www.apache.org/licenses/LICENSE-2.0 - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/hardware/PiLcd/nrlcd b/hardware/PiLcd/nrlcd index d6258bed..7536a6ce 100755 --- a/hardware/PiLcd/nrlcd +++ b/hardware/PiLcd/nrlcd @@ -1,16 +1,3 @@ -# -# Copyright 2015 IBM Corp. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - +#!/bin/bash BASEDIR=$(dirname $0) sudo python -u $BASEDIR/nrlcd.py $@ diff --git a/hardware/PiLcd/package.json b/hardware/PiLcd/package.json index f21e4dd0..39be00f5 100644 --- a/hardware/PiLcd/package.json +++ b/hardware/PiLcd/package.json @@ -1,6 +1,6 @@ { "name" : "node-red-node-pilcd", - "version" : "0.0.5", + "version" : "0.0.6", "description" : "A Node-RED node for Raspberry Pi to write to HD44780 style LCD panels.", "dependencies" : { }, diff --git a/hardware/PiLcd/pilcd.html b/hardware/PiLcd/pilcd.html index ffabd048..faa4b475 100644 --- a/hardware/PiLcd/pilcd.html +++ b/hardware/PiLcd/pilcd.html @@ -1,18 +1,3 @@ -