Merge branch 'master' into dev

This commit is contained in:
Nick O'Leary
2022-01-12 17:59:26 +00:00
38 changed files with 545 additions and 230 deletions

View File

@@ -146,7 +146,7 @@ function authenticateUserToken(req) {
} else { } else {
reject(); reject();
} }
}); }).catch(reject);
} else { } else {
reject(); reject();
} }
@@ -163,6 +163,9 @@ TokensStrategy.prototype.authenticate = function(req) {
authenticateUserToken(req).then(user => { authenticateUserToken(req).then(user => {
this.success(user,{scope:user.permissions}); this.success(user,{scope:user.permissions});
}).catch(err => { }).catch(err => {
if (err) {
log.trace("token authentication failure: "+err.stack?err.stack:err)
}
this.fail(401); this.fail(401);
}); });
} }

View File

@@ -90,6 +90,8 @@ function init(settings,_server,storage,runtimeAPI) {
auth.getToken, auth.getToken,
auth.errorHandler auth.errorHandler
); );
} else if (settings.adminAuth.tokens) {
adminApp.use(passport.initialize());
} }
adminApp.post("/auth/revoke",auth.needsPermission(""),auth.revoke,apiUtil.errorHandler); adminApp.post("/auth/revoke",auth.needsPermission(""),auth.revoke,apiUtil.errorHandler);
} }

View File

@@ -59,6 +59,8 @@
"hideOtherFlows": "他のフローを非表示", "hideOtherFlows": "他のフローを非表示",
"showAllFlows": "全てのフローを表示", "showAllFlows": "全てのフローを表示",
"hideAllFlows": "全てのフローを非表示", "hideAllFlows": "全てのフローを非表示",
"hiddenFlows": "__count__ 個の非表示のフロー一覧",
"hiddenFlows_plural": "__count__ 個の非表示のフロー一覧",
"showLastHiddenFlow": "最後に非表示にしたフローを表示", "showLastHiddenFlow": "最後に非表示にしたフローを表示",
"listFlows": "フロー一覧", "listFlows": "フロー一覧",
"listSubflows": "サブフロー一覧", "listSubflows": "サブフロー一覧",
@@ -669,7 +671,8 @@
"unusedConfigNodes": "未使用の設定ノード", "unusedConfigNodes": "未使用の設定ノード",
"invalidNodes": "不正なノード", "invalidNodes": "不正なノード",
"uknownNodes": "未知のノード", "uknownNodes": "未知のノード",
"unusedSubflows": "未使用のサブフロー" "unusedSubflows": "未使用のサブフロー",
"hiddenFlows": "非表示のフロー"
} }
}, },
"help": { "help": {

View File

@@ -71,6 +71,7 @@ RED.clipboard = (function() {
text: RED._("common.label.cancel"), text: RED._("common.label.cancel"),
click: function() { click: function() {
$( this ).dialog( "close" ); $( this ).dialog( "close" );
RED.view.focus();
} }
}, },
{ // red-ui-clipboard-dialog-download { // red-ui-clipboard-dialog-download
@@ -81,6 +82,7 @@ RED.clipboard = (function() {
var data = $("#red-ui-clipboard-dialog-export-text").val(); var data = $("#red-ui-clipboard-dialog-export-text").val();
downloadData("flows.json", data); downloadData("flows.json", data);
$( this ).dialog( "close" ); $( this ).dialog( "close" );
RED.view.focus();
} }
}, },
{ // red-ui-clipboard-dialog-export { // red-ui-clipboard-dialog-export
@@ -95,6 +97,7 @@ RED.clipboard = (function() {
$( this ).dialog( "close" ); $( this ).dialog( "close" );
copyText(flowData); copyText(flowData);
RED.notify(RED._("clipboard.nodesExported"),{id:"clipboard"}); RED.notify(RED._("clipboard.nodesExported"),{id:"clipboard"});
RED.view.focus();
} else { } else {
var flowToExport = $("#red-ui-clipboard-dialog-export-text").val(); var flowToExport = $("#red-ui-clipboard-dialog-export-text").val();
var selectedPath = activeLibraries[activeTab].getSelected(); var selectedPath = activeLibraries[activeTab].getSelected();
@@ -110,6 +113,7 @@ RED.clipboard = (function() {
contentType: "application/json; charset=utf-8" contentType: "application/json; charset=utf-8"
}).done(function() { }).done(function() {
$(dialog).dialog( "close" ); $(dialog).dialog( "close" );
RED.view.focus();
RED.notify(RED._("library.exportedToLibrary"),"success"); RED.notify(RED._("library.exportedToLibrary"),"success");
}).fail(function(xhr,textStatus,err) { }).fail(function(xhr,textStatus,err) {
if (xhr.status === 401) { if (xhr.status === 401) {
@@ -171,6 +175,7 @@ RED.clipboard = (function() {
} }
} }
$( this ).dialog( "close" ); $( this ).dialog( "close" );
RED.view.focus();
} }
}, },
{ // red-ui-clipboard-dialog-import-conflict { // red-ui-clipboard-dialog-import-conflict
@@ -203,6 +208,7 @@ RED.clipboard = (function() {
// console.table(pendingImportConfig.importNodes.map(function(n) { return {id:n.id,type:n.type,result:importMap[n.id]}})) // console.table(pendingImportConfig.importNodes.map(function(n) { return {id:n.id,type:n.type,result:importMap[n.id]}}))
RED.view.importNodes(newNodes, pendingImportConfig.importOptions); RED.view.importNodes(newNodes, pendingImportConfig.importOptions);
$( this ).dialog( "close" ); $( this ).dialog( "close" );
RED.view.focus();
} }
} }
], ],

View File

@@ -578,7 +578,7 @@ RED.tabs = (function() {
function findPreviousVisibleTab(li) { function findPreviousVisibleTab(li) {
if (!li) { if (!li) {
li = ul.find("li.active").parent(); li = ul.find("li.active");
} }
var previous = li.prev(); var previous = li.prev();
while(previous.length > 0 && previous.hasClass("hide-tab")) { while(previous.length > 0 && previous.hasClass("hide-tab")) {
@@ -588,9 +588,9 @@ RED.tabs = (function() {
} }
function findNextVisibleTab(li) { function findNextVisibleTab(li) {
if (!li) { if (!li) {
li = ul.find("li.active").parent(); li = ul.find("li.active");
} }
var next = ul.find("li.active").next(); var next = li.next();
while(next.length > 0 && next.hasClass("hide-tab")) { while(next.length > 0 && next.hasClass("hide-tab")) {
next = next.next(); next = next.next();
} }

View File

@@ -81,7 +81,8 @@
clearTimeout: true, clearTimeout: true,
setInterval: true, setInterval: true,
clearInterval: true clearInterval: true
} },
extraLibs: options.extraLibs
}); });
if (options.cursor) { if (options.cursor) {
expressionEditor.gotoLine(options.cursor.row+1,options.cursor.column,false); expressionEditor.gotoLine(options.cursor.row+1,options.cursor.column,false);

View File

@@ -55,7 +55,9 @@
} }
}); });
} }
if (!isSameObj(old_env, new_env)) { if (!old_env && new_env.length === 0) {
delete node.env;
} else if (!isSameObj(old_env, new_env)) {
editState.changes.env = node.env; editState.changes.env = node.env;
if (new_env.length === 0) { if (new_env.length === 0) {
delete node.env; delete node.env;

View File

@@ -208,10 +208,20 @@ RED.workspaces = (function() {
}, },
onhide: function(tab) { onhide: function(tab) {
hideStack.push(tab.id); hideStack.push(tab.id);
var hiddenTabs = JSON.parse(RED.settings.getLocal("hiddenTabs")||"{}");
hiddenTabs[tab.id] = true;
RED.settings.setLocal("hiddenTabs",JSON.stringify(hiddenTabs));
RED.events.emit("workspace:hide",{workspace: tab.id}) RED.events.emit("workspace:hide",{workspace: tab.id})
}, },
onshow: function(tab) { onshow: function(tab) {
removeFromHideStack(tab.id); removeFromHideStack(tab.id);
var hiddenTabs = JSON.parse(RED.settings.getLocal("hiddenTabs")||"{}");
delete hiddenTabs[tab.id];
RED.settings.setLocal("hiddenTabs",JSON.stringify(hiddenTabs));
RED.events.emit("workspace:show",{workspace: tab.id}) RED.events.emit("workspace:show",{workspace: tab.id})
}, },
minimumActiveTabWidth: 150, minimumActiveTabWidth: 150,
@@ -542,9 +552,6 @@ RED.workspaces = (function() {
} }
if (workspace_tabs.contains(id)) { if (workspace_tabs.contains(id)) {
workspace_tabs.hideTab(id); workspace_tabs.hideTab(id);
var hiddenTabs = JSON.parse(RED.settings.getLocal("hiddenTabs")||"{}");
hiddenTabs[id] = true;
RED.settings.setLocal("hiddenTabs",JSON.stringify(hiddenTabs));
} }
}, },
isHidden: function(id) { isHidden: function(id) {
@@ -572,9 +579,6 @@ RED.workspaces = (function() {
} }
workspace_tabs.activateTab(id); workspace_tabs.activateTab(id);
} }
var hiddenTabs = JSON.parse(RED.settings.getLocal("hiddenTabs")||"{}");
delete hiddenTabs[id];
RED.settings.setLocal("hiddenTabs",JSON.stringify(hiddenTabs));
}, },
refresh: function() { refresh: function() {
RED.nodes.eachWorkspace(function(ws) { RED.nodes.eachWorkspace(function(ws) {

View File

@@ -73,8 +73,8 @@ export default {
}, },
element: "#red-ui-workspace-tabs > li.active", element: "#red-ui-workspace-tabs > li.active",
description: { description: {
"en-US": '<p>Tabs can now be hidden by clicking their <i class="fa fa-times"></i> icon.</p><p>The Info Sidebar will still list all of your tabs, and tell you which ones are currently hidden.', "en-US": '<p>Tabs can now be hidden by clicking their <i class="fa fa-eye-slash"></i> icon.</p><p>The Info Sidebar will still list all of your tabs, and tell you which ones are currently hidden.',
"ja": '<p><i class="fa fa-times"></i> アイコンをクリックすることで、タブを非表示にできます。</p><p>情報サイドバーには、全てのタブが一覧表示されており、現在非表示になっているタブを確認できます。' "ja": '<p><i class="fa fa-eye-slash"></i> アイコンをクリックすることで、タブを非表示にできます。</p><p>情報サイドバーには、全てのタブが一覧表示されており、現在非表示になっているタブを確認できます。'
}, },
interactive: false, interactive: false,
prepare() { prepare() {

View File

@@ -690,9 +690,9 @@
this.topic = ""; this.topic = "";
var result = getProps(items, true); var result = getProps(items, true);
this.props = result.props; this.props = result.props;
if(result.payloadType) { this.payloadType = result.payloadType; }; if(result.hasOwnProperty('payloadType')) { this.payloadType = result.payloadType; };
if(result.payload) { this.payload = result.payload; }; if(result.hasOwnProperty('payload')) { this.payload = result.payload; };
if(result.topic) { this.topic = result.topic; }; if(result.hasOwnProperty('topic')) { this.topic = result.topic; };
}, },
button: { button: {
enabled: function() { enabled: function() {

View File

@@ -512,6 +512,7 @@
return function(e) { return function(e) {
e.preventDefault(); e.preventDefault();
var value = editor.getValue(); var value = editor.getValue();
var extraLibs = that.libs || [];
RED.editor.editJavaScript({ RED.editor.editJavaScript({
value: value, value: value,
width: "Infinity", width: "Infinity",
@@ -523,7 +524,8 @@
setTimeout(function() { setTimeout(function() {
editor.focus(); editor.focus();
},300); },300);
} },
extraLibs: extraLibs
}) })
} }
} }

View File

@@ -234,8 +234,7 @@ module.exports = function(RED) {
}, },
env: { env: {
get: function(envVar) { get: function(envVar) {
var flow = node._flow; return RED.util.getSetting(node, envVar);
return flow.getSetting(envVar);
} }
}, },
setTimeout: function () { setTimeout: function () {

View File

@@ -58,7 +58,7 @@ module.exports = function(RED) {
else { else {
var n = parseFloat(value); var n = parseFloat(value);
if (!isNaN(n)) { if (!isNaN(n)) {
if ((typeof node.previous[t] === 'undefined') && (this.func === "narrowband")) { if ((typeof node.previous[t] === 'undefined') && (this.func === "narrowband" || this.func === "narrowbandEq")) {
if (node.start === '') { node.previous[t] = n; } if (node.start === '') { node.previous[t] = n; }
else { node.previous[t] = node.start; } else { node.previous[t] = node.start; }
} }

View File

@@ -302,6 +302,8 @@ in your Node-RED user directory (${RED.settings.userDir}).
// var cred = "" // var cred = ""
if (this.credentials.user || this.credentials.password) { if (this.credentials.user || this.credentials.password) {
// cred = `${this.credentials.user}:${this.credentials.password}`; // cred = `${this.credentials.user}:${this.credentials.password}`;
if (this.credentials.user === undefined) { this.credentials.user = ""}
if (this.credentials.password === undefined) { this.credentials.password = ""}
opts.headers.Authorization = "Basic " + Buffer.from(`${this.credentials.user}:${this.credentials.password}`).toString("base64"); opts.headers.Authorization = "Basic " + Buffer.from(`${this.credentials.user}:${this.credentials.password}`).toString("base64");
} }
// build own basic auth header // build own basic auth header

View File

@@ -0,0 +1,156 @@
[
{
"id": "62ea32aa.d73aac",
"type": "comment",
"z": "6312c0588348b2d4",
"name": "Example: Link Call Node",
"info": "Link call node can call link in node then get result from link out node.",
"x": 230,
"y": 180,
"wires": []
},
{
"id": "c588bc36.87fec",
"type": "comment",
"z": "6312c0588348b2d4",
"name": "↓ call link in node",
"info": "",
"x": 440,
"y": 220,
"wires": []
},
{
"id": "cd31efb4d2c6967e",
"type": "link call",
"z": "6312c0588348b2d4",
"name": "",
"links": [
"dbc46892c8d14c37"
],
"timeout": "30",
"x": 420,
"y": 260,
"wires": [
[
"c3db64d1d2260340"
]
]
},
{
"id": "dbc46892c8d14c37",
"type": "link in",
"z": "6312c0588348b2d4",
"name": "",
"links": [],
"x": 315,
"y": 340,
"wires": [
[
"e10575d73f2e5352"
]
]
},
{
"id": "6b61792143b3b0a3",
"type": "inject",
"z": "6312c0588348b2d4",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 240,
"y": 260,
"wires": [
[
"cd31efb4d2c6967e"
]
]
},
{
"id": "e10575d73f2e5352",
"type": "change",
"z": "6312c0588348b2d4",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "Hello, World!",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 450,
"y": 340,
"wires": [
[
"cf8438e7137bc0f0"
]
]
},
{
"id": "cf8438e7137bc0f0",
"type": "link out",
"z": "6312c0588348b2d4",
"name": "",
"mode": "return",
"links": [],
"x": 595,
"y": 340,
"wires": []
},
{
"id": "c3db64d1d2260340",
"type": "debug",
"z": "6312c0588348b2d4",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 600,
"y": 260,
"wires": []
},
{
"id": "6d077dfa0987febb",
"type": "comment",
"z": "6312c0588348b2d4",
"name": "↑called from link call node",
"info": "",
"x": 410,
"y": 380,
"wires": []
},
{
"id": "53b9a0adfd8c4217",
"type": "comment",
"z": "6312c0588348b2d4",
"name": "↑return to link call node",
"info": "",
"x": 680,
"y": 380,
"wires": []
}
]

View File

@@ -2,7 +2,7 @@
{ {
"id": "84222b92.d65d18", "id": "84222b92.d65d18",
"type": "inject", "type": "inject",
"z": "194a3e4f.a92772", "z": "6312c0588348b2d4",
"name": "", "name": "",
"props": [ "props": [
{ {
@@ -20,8 +20,8 @@
"topic": "", "topic": "",
"payload": "Hello, World!", "payload": "Hello, World!",
"payloadType": "str", "payloadType": "str",
"x": 230, "x": 190,
"y": 220, "y": 180,
"wires": [ "wires": [
[ [
"b4b9f603.739598" "b4b9f603.739598"
@@ -31,25 +31,25 @@
{ {
"id": "7b014430.dfd94c", "id": "7b014430.dfd94c",
"type": "comment", "type": "comment",
"z": "194a3e4f.a92772", "z": "6312c0588348b2d4",
"name": "Write string to a file, then read from the file", "name": "Write string to a file, then read from the file",
"info": "File-in node can read string from a file.", "info": "Read file node can read string from a file.",
"x": 260, "x": 220,
"y": 140, "y": 100,
"wires": [] "wires": []
}, },
{ {
"id": "b4b9f603.739598", "id": "b4b9f603.739598",
"type": "file", "type": "file",
"z": "194a3e4f.a92772", "z": "6312c0588348b2d4",
"name": "", "name": "",
"filename": "/tmp/hello.txt", "filename": "/tmp/hello.txt",
"appendNewline": true, "appendNewline": true,
"createDir": false, "createDir": false,
"overwriteFile": "true", "overwriteFile": "true",
"encoding": "none", "encoding": "none",
"x": 420, "x": 380,
"y": 220, "y": 180,
"wires": [ "wires": [
[ [
"6dc01cac.5c4bf4" "6dc01cac.5c4bf4"
@@ -59,7 +59,7 @@
{ {
"id": "2587adb9.7e60f2", "id": "2587adb9.7e60f2",
"type": "debug", "type": "debug",
"z": "194a3e4f.a92772", "z": "6312c0588348b2d4",
"name": "", "name": "",
"active": true, "active": true,
"tosidebar": true, "tosidebar": true,
@@ -68,22 +68,22 @@
"complete": "false", "complete": "false",
"statusVal": "", "statusVal": "",
"statusType": "auto", "statusType": "auto",
"x": 810, "x": 770,
"y": 220, "y": 180,
"wires": [] "wires": []
}, },
{ {
"id": "6dc01cac.5c4bf4", "id": "6dc01cac.5c4bf4",
"type": "file in", "type": "file in",
"z": "194a3e4f.a92772", "z": "6312c0588348b2d4",
"name": "", "name": "",
"filename": "/tmp/hello.txt", "filename": "/tmp/hello.txt",
"format": "utf8", "format": "utf8",
"chunk": false, "chunk": false,
"sendError": false, "sendError": false,
"encoding": "none", "encoding": "none",
"x": 620, "x": 580,
"y": 220, "y": 180,
"wires": [ "wires": [
[ [
"2587adb9.7e60f2" "2587adb9.7e60f2"
@@ -93,21 +93,21 @@
{ {
"id": "f4b4309a.3b78a", "id": "f4b4309a.3b78a",
"type": "comment", "type": "comment",
"z": "194a3e4f.a92772", "z": "6312c0588348b2d4",
"name": "↑read result from file", "name": "↑read result from file",
"info": "", "info": "",
"x": 630, "x": 590,
"y": 260, "y": 220,
"wires": [] "wires": []
}, },
{ {
"id": "672d3693.3cabd8", "id": "672d3693.3cabd8",
"type": "comment", "type": "comment",
"z": "194a3e4f.a92772", "z": "6312c0588348b2d4",
"name": "↓write to /tmp/hello.txt", "name": "↓write to /tmp/hello.txt",
"info": "", "info": "",
"x": 440, "x": 400,
"y": 180, "y": 140,
"wires": [] "wires": []
} }
] ]

View File

@@ -2,7 +2,7 @@
{ {
"id": "8997398f.c5d628", "id": "8997398f.c5d628",
"type": "inject", "type": "inject",
"z": "194a3e4f.a92772", "z": "6312c0588348b2d4",
"name": "", "name": "",
"props": [ "props": [
{ {
@@ -20,8 +20,8 @@
"topic": "", "topic": "",
"payload": "😀", "payload": "😀",
"payloadType": "str", "payloadType": "str",
"x": 210, "x": 170,
"y": 480, "y": 260,
"wires": [ "wires": [
[ [
"56e32d23.050f44" "56e32d23.050f44"
@@ -31,25 +31,25 @@
{ {
"id": "4e598e65.1799d", "id": "4e598e65.1799d",
"type": "comment", "type": "comment",
"z": "194a3e4f.a92772", "z": "6312c0588348b2d4",
"name": "Read data in specified encoding", "name": "Read data in specified encoding",
"info": "File-in node can specify encoding of data read from a file.", "info": "Read file node can specify encoding of data read from a file.",
"x": 230, "x": 190,
"y": 400, "y": 180,
"wires": [] "wires": []
}, },
{ {
"id": "56e32d23.050f44", "id": "56e32d23.050f44",
"type": "file", "type": "file",
"z": "194a3e4f.a92772", "z": "6312c0588348b2d4",
"name": "", "name": "",
"filename": "/tmp/hello.txt", "filename": "/tmp/hello.txt",
"appendNewline": true, "appendNewline": true,
"createDir": false, "createDir": false,
"overwriteFile": "true", "overwriteFile": "true",
"encoding": "none", "encoding": "none",
"x": 380, "x": 340,
"y": 480, "y": 260,
"wires": [ "wires": [
[ [
"38fa0579.f2cd8a" "38fa0579.f2cd8a"
@@ -59,7 +59,7 @@
{ {
"id": "d28c8994.99c0a8", "id": "d28c8994.99c0a8",
"type": "debug", "type": "debug",
"z": "194a3e4f.a92772", "z": "6312c0588348b2d4",
"name": "", "name": "",
"active": true, "active": true,
"tosidebar": true, "tosidebar": true,
@@ -68,22 +68,23 @@
"complete": "false", "complete": "false",
"statusVal": "", "statusVal": "",
"statusType": "auto", "statusType": "auto",
"x": 770, "x": 730,
"y": 480, "y": 260,
"wires": [] "wires": []
}, },
{ {
"id": "38fa0579.f2cd8a", "id": "38fa0579.f2cd8a",
"type": "file in", "type": "file in",
"z": "194a3e4f.a92772", "z": "6312c0588348b2d4",
"name": "", "name": "",
"filename": "/tmp/hello.txt", "filename": "/tmp/hello.txt",
"format": "utf8", "format": "utf8",
"chunk": false, "chunk": false,
"sendError": false, "sendError": false,
"encoding": "base64", "encoding": "base64",
"x": 580, "allProps": false,
"y": 480, "x": 540,
"y": 260,
"wires": [ "wires": [
[ [
"d28c8994.99c0a8" "d28c8994.99c0a8"
@@ -93,21 +94,21 @@
{ {
"id": "fa22ca20.ae4528", "id": "fa22ca20.ae4528",
"type": "comment", "type": "comment",
"z": "194a3e4f.a92772", "z": "6312c0588348b2d4",
"name": "↑read data from file as base64 string", "name": "↑read data from file as base64 string",
"info": "", "info": "",
"x": 640, "x": 600,
"y": 520, "y": 300,
"wires": [] "wires": []
}, },
{ {
"id": "148e25ad.98891a", "id": "148e25ad.98891a",
"type": "comment", "type": "comment",
"z": "194a3e4f.a92772", "z": "6312c0588348b2d4",
"name": "↓write to /tmp/hello.txt", "name": "↓write to /tmp/hello.txt",
"info": "", "info": "",
"x": 400, "x": 360,
"y": 440, "y": 220,
"wires": [] "wires": []
} }
] ]

View File

@@ -2,7 +2,7 @@
{ {
"id": "6a0b1d03.d4cee4", "id": "6a0b1d03.d4cee4",
"type": "inject", "type": "inject",
"z": "194a3e4f.a92772", "z": "6312c0588348b2d4",
"name": "", "name": "",
"props": [ "props": [
{ {
@@ -20,8 +20,8 @@
"topic": "", "topic": "",
"payload": "", "payload": "",
"payloadType": "date", "payloadType": "date",
"x": 220, "x": 160,
"y": 740, "y": 220,
"wires": [ "wires": [
[ [
"d4b00cb7.a5a23" "d4b00cb7.a5a23"
@@ -31,25 +31,25 @@
{ {
"id": "f17ea1d1.8ecc3", "id": "f17ea1d1.8ecc3",
"type": "comment", "type": "comment",
"z": "194a3e4f.a92772", "z": "6312c0588348b2d4",
"name": "Read data breaking lines into individual messages", "name": "Read data breaking lines into individual messages",
"info": "File-in node can break read text into messages with individual lines", "info": "Read file node can break read text into messages with individual lines",
"x": 290, "x": 230,
"y": 660, "y": 140,
"wires": [] "wires": []
}, },
{ {
"id": "99ae7806.1d6428", "id": "99ae7806.1d6428",
"type": "file", "type": "file",
"z": "194a3e4f.a92772", "z": "6312c0588348b2d4",
"name": "", "name": "",
"filename": "/tmp/hello.txt", "filename": "/tmp/hello.txt",
"appendNewline": true, "appendNewline": true,
"createDir": false, "createDir": false,
"overwriteFile": "true", "overwriteFile": "true",
"encoding": "none", "encoding": "none",
"x": 540, "x": 480,
"y": 740, "y": 220,
"wires": [ "wires": [
[ [
"70d7892f.d27db8" "70d7892f.d27db8"
@@ -59,7 +59,7 @@
{ {
"id": "7ed8282c.92b338", "id": "7ed8282c.92b338",
"type": "debug", "type": "debug",
"z": "194a3e4f.a92772", "z": "6312c0588348b2d4",
"name": "", "name": "",
"active": true, "active": true,
"tosidebar": true, "tosidebar": true,
@@ -68,22 +68,22 @@
"complete": "false", "complete": "false",
"statusVal": "", "statusVal": "",
"statusType": "auto", "statusType": "auto",
"x": 810, "x": 750,
"y": 800, "y": 280,
"wires": [] "wires": []
}, },
{ {
"id": "70d7892f.d27db8", "id": "70d7892f.d27db8",
"type": "file in", "type": "file in",
"z": "194a3e4f.a92772", "z": "6312c0588348b2d4",
"name": "", "name": "",
"filename": "/tmp/hello.txt", "filename": "/tmp/hello.txt",
"format": "lines", "format": "lines",
"chunk": false, "chunk": false,
"sendError": false, "sendError": false,
"encoding": "none", "encoding": "none",
"x": 620, "x": 560,
"y": 800, "y": 280,
"wires": [ "wires": [
[ [
"7ed8282c.92b338" "7ed8282c.92b338"
@@ -93,27 +93,27 @@
{ {
"id": "c1b7e05.1d94b2", "id": "c1b7e05.1d94b2",
"type": "comment", "type": "comment",
"z": "194a3e4f.a92772", "z": "6312c0588348b2d4",
"name": "↑read data from file breaking lines into messages", "name": "↑read data from file breaking lines into messages",
"info": "", "info": "",
"x": 720, "x": 660,
"y": 840, "y": 320,
"wires": [] "wires": []
}, },
{ {
"id": "a5f647b2.cf27a8", "id": "a5f647b2.cf27a8",
"type": "comment", "type": "comment",
"z": "194a3e4f.a92772", "z": "6312c0588348b2d4",
"name": "↓write to /tmp/hello.txt", "name": "↓write to /tmp/hello.txt",
"info": "", "info": "",
"x": 560, "x": 500,
"y": 700, "y": 180,
"wires": [] "wires": []
}, },
{ {
"id": "d4b00cb7.a5a23", "id": "d4b00cb7.a5a23",
"type": "template", "type": "template",
"z": "194a3e4f.a92772", "z": "6312c0588348b2d4",
"name": "data", "name": "data",
"field": "payload", "field": "payload",
"fieldType": "msg", "fieldType": "msg",
@@ -121,8 +121,8 @@
"syntax": "plain", "syntax": "plain",
"template": "one\ntwo\nthree!", "template": "one\ntwo\nthree!",
"output": "str", "output": "str",
"x": 370, "x": 310,
"y": 740, "y": 220,
"wires": [ "wires": [
[ [
"99ae7806.1d6428" "99ae7806.1d6428"

View File

@@ -2,7 +2,7 @@
{ {
"id": "bdd57acc.2edc48", "id": "bdd57acc.2edc48",
"type": "inject", "type": "inject",
"z": "194a3e4f.a92772", "z": "6312c0588348b2d4",
"name": "", "name": "",
"props": [ "props": [
{ {
@@ -20,8 +20,8 @@
"topic": "", "topic": "",
"payload": "", "payload": "",
"payloadType": "date", "payloadType": "date",
"x": 220, "x": 180,
"y": 1040, "y": 220,
"wires": [ "wires": [
[ [
"7a069b01.0c2324" "7a069b01.0c2324"
@@ -31,25 +31,25 @@
{ {
"id": "1fd12220.33953e", "id": "1fd12220.33953e",
"type": "comment", "type": "comment",
"z": "194a3e4f.a92772", "z": "6312c0588348b2d4",
"name": "Creating a message stream from lines of data", "name": "Creating a message stream from lines of data",
"info": "File-in node can break read text into messages with individual lines. The messages creates a stream of messages.", "info": "Read file node can break read text into messages with individual lines. The messages creates a stream of messages.",
"x": 270, "x": 230,
"y": 960, "y": 140,
"wires": [] "wires": []
}, },
{ {
"id": "ab6eb213.2a08d", "id": "ab6eb213.2a08d",
"type": "file", "type": "file",
"z": "194a3e4f.a92772", "z": "6312c0588348b2d4",
"name": "", "name": "",
"filename": "/tmp/hello.txt", "filename": "/tmp/hello.txt",
"appendNewline": true, "appendNewline": true,
"createDir": false, "createDir": false,
"overwriteFile": "true", "overwriteFile": "true",
"encoding": "none", "encoding": "none",
"x": 540, "x": 500,
"y": 1040, "y": 220,
"wires": [ "wires": [
[ [
"b7ed49b0.649fb8" "b7ed49b0.649fb8"
@@ -59,7 +59,7 @@
{ {
"id": "c48d8ae0.9ff3a8", "id": "c48d8ae0.9ff3a8",
"type": "debug", "type": "debug",
"z": "194a3e4f.a92772", "z": "6312c0588348b2d4",
"name": "", "name": "",
"active": true, "active": true,
"tosidebar": true, "tosidebar": true,
@@ -68,22 +68,22 @@
"complete": "false", "complete": "false",
"statusVal": "", "statusVal": "",
"statusType": "auto", "statusType": "auto",
"x": 810, "x": 770,
"y": 1140, "y": 320,
"wires": [] "wires": []
}, },
{ {
"id": "b7ed49b0.649fb8", "id": "b7ed49b0.649fb8",
"type": "file in", "type": "file in",
"z": "194a3e4f.a92772", "z": "6312c0588348b2d4",
"name": "", "name": "",
"filename": "/tmp/hello.txt", "filename": "/tmp/hello.txt",
"format": "lines", "format": "lines",
"chunk": false, "chunk": false,
"sendError": false, "sendError": false,
"encoding": "none", "encoding": "none",
"x": 280, "x": 240,
"y": 1140, "y": 320,
"wires": [ "wires": [
[ [
"83073ebe.fcce4" "83073ebe.fcce4"
@@ -93,27 +93,27 @@
{ {
"id": "3c33e69f.6a04ba", "id": "3c33e69f.6a04ba",
"type": "comment", "type": "comment",
"z": "194a3e4f.a92772", "z": "6312c0588348b2d4",
"name": "↑read data from file breaking lines into messages", "name": "↑read data from file breaking lines into messages",
"info": "", "info": "",
"x": 380, "x": 340,
"y": 1180, "y": 360,
"wires": [] "wires": []
}, },
{ {
"id": "3598bf7d.5712a", "id": "3598bf7d.5712a",
"type": "comment", "type": "comment",
"z": "194a3e4f.a92772", "z": "6312c0588348b2d4",
"name": "↓write to /tmp/hello.txt", "name": "↓write to /tmp/hello.txt",
"info": "", "info": "",
"x": 560, "x": 520,
"y": 1000, "y": 180,
"wires": [] "wires": []
}, },
{ {
"id": "7a069b01.0c2324", "id": "7a069b01.0c2324",
"type": "template", "type": "template",
"z": "194a3e4f.a92772", "z": "6312c0588348b2d4",
"name": "data", "name": "data",
"field": "payload", "field": "payload",
"fieldType": "msg", "fieldType": "msg",
@@ -121,8 +121,8 @@
"syntax": "plain", "syntax": "plain",
"template": "Apple\nBanana\nGrape\nOrange", "template": "Apple\nBanana\nGrape\nOrange",
"output": "str", "output": "str",
"x": 370, "x": 330,
"y": 1040, "y": 220,
"wires": [ "wires": [
[ [
"ab6eb213.2a08d" "ab6eb213.2a08d"
@@ -132,7 +132,7 @@
{ {
"id": "8d4ed1d0.821fe", "id": "8d4ed1d0.821fe",
"type": "join", "type": "join",
"z": "194a3e4f.a92772", "z": "6312c0588348b2d4",
"name": "", "name": "",
"mode": "auto", "mode": "auto",
"build": "string", "build": "string",
@@ -145,8 +145,8 @@
"timeout": "", "timeout": "",
"count": "", "count": "",
"reduceRight": false, "reduceRight": false,
"x": 630, "x": 590,
"y": 1140, "y": 320,
"wires": [ "wires": [
[ [
"c48d8ae0.9ff3a8" "c48d8ae0.9ff3a8"
@@ -156,7 +156,7 @@
{ {
"id": "83073ebe.fcce4", "id": "83073ebe.fcce4",
"type": "switch", "type": "switch",
"z": "194a3e4f.a92772", "z": "6312c0588348b2d4",
"name": "< D", "name": "< D",
"property": "payload", "property": "payload",
"propertyType": "msg", "propertyType": "msg",
@@ -170,8 +170,8 @@
"checkall": "true", "checkall": "true",
"repair": true, "repair": true,
"outputs": 1, "outputs": 1,
"x": 470, "x": 430,
"y": 1140, "y": 320,
"wires": [ "wires": [
[ [
"8d4ed1d0.821fe" "8d4ed1d0.821fe"
@@ -181,21 +181,21 @@
{ {
"id": "2088e195.f7aebe", "id": "2088e195.f7aebe",
"type": "comment", "type": "comment",
"z": "194a3e4f.a92772", "z": "6312c0588348b2d4",
"name": "↓filter data before \"D\"", "name": "↓filter data before \"D\"",
"info": "", "info": "",
"x": 520, "x": 480,
"y": 1100, "y": 280,
"wires": [] "wires": []
}, },
{ {
"id": "b848cdc7.61e06", "id": "b848cdc7.61e06",
"type": "comment", "type": "comment",
"z": "194a3e4f.a92772", "z": "6312c0588348b2d4",
"name": "↑join to single string", "name": "↑join to single string",
"info": "", "info": "",
"x": 670, "x": 630,
"y": 1180, "y": 360,
"wires": [] "wires": []
} }
] ]

View File

@@ -2,7 +2,7 @@
{ {
"id": "84222b92.d65d18", "id": "84222b92.d65d18",
"type": "inject", "type": "inject",
"z": "4b63452d.672afc", "z": "5132b95f037524f9",
"name": "", "name": "",
"props": [ "props": [
{ {
@@ -20,8 +20,8 @@
"topic": "", "topic": "",
"payload": "Hello, World!", "payload": "Hello, World!",
"payloadType": "str", "payloadType": "str",
"x": 230, "x": 150,
"y": 200, "y": 220,
"wires": [ "wires": [
[ [
"b4b9f603.739598" "b4b9f603.739598"
@@ -31,25 +31,25 @@
{ {
"id": "7b014430.dfd94c", "id": "7b014430.dfd94c",
"type": "comment", "type": "comment",
"z": "4b63452d.672afc", "z": "5132b95f037524f9",
"name": "Write string to a file, then read from the file", "name": "Write string to a file, then read from the file",
"info": "File node can write string to a file.", "info": "Write file node can write string from a file.",
"x": 260, "x": 180,
"y": 120, "y": 140,
"wires": [] "wires": []
}, },
{ {
"id": "b4b9f603.739598", "id": "b4b9f603.739598",
"type": "file", "type": "file",
"z": "4b63452d.672afc", "z": "5132b95f037524f9",
"name": "", "name": "",
"filename": "/tmp/hello.txt", "filename": "/tmp/hello.txt",
"appendNewline": true, "appendNewline": true,
"createDir": false, "createDir": false,
"overwriteFile": "true", "overwriteFile": "true",
"encoding": "none", "encoding": "none",
"x": 420, "x": 340,
"y": 200, "y": 220,
"wires": [ "wires": [
[ [
"6dc01cac.5c4bf4" "6dc01cac.5c4bf4"
@@ -59,7 +59,7 @@
{ {
"id": "2587adb9.7e60f2", "id": "2587adb9.7e60f2",
"type": "debug", "type": "debug",
"z": "4b63452d.672afc", "z": "5132b95f037524f9",
"name": "", "name": "",
"active": true, "active": true,
"tosidebar": true, "tosidebar": true,
@@ -68,22 +68,22 @@
"complete": "false", "complete": "false",
"statusVal": "", "statusVal": "",
"statusType": "auto", "statusType": "auto",
"x": 810, "x": 730,
"y": 200, "y": 220,
"wires": [] "wires": []
}, },
{ {
"id": "6dc01cac.5c4bf4", "id": "6dc01cac.5c4bf4",
"type": "file in", "type": "file in",
"z": "4b63452d.672afc", "z": "5132b95f037524f9",
"name": "", "name": "",
"filename": "/tmp/hello.txt", "filename": "/tmp/hello.txt",
"format": "utf8", "format": "utf8",
"chunk": false, "chunk": false,
"sendError": false, "sendError": false,
"encoding": "none", "encoding": "none",
"x": 620, "x": 540,
"y": 200, "y": 220,
"wires": [ "wires": [
[ [
"2587adb9.7e60f2" "2587adb9.7e60f2"
@@ -93,21 +93,21 @@
{ {
"id": "f4b4309a.3b78a", "id": "f4b4309a.3b78a",
"type": "comment", "type": "comment",
"z": "4b63452d.672afc", "z": "5132b95f037524f9",
"name": "↑read result from file", "name": "↑read result from file",
"info": "", "info": "",
"x": 630, "x": 550,
"y": 240, "y": 260,
"wires": [] "wires": []
}, },
{ {
"id": "672d3693.3cabd8", "id": "672d3693.3cabd8",
"type": "comment", "type": "comment",
"z": "4b63452d.672afc", "z": "5132b95f037524f9",
"name": "↓write to /tmp/hello.txt", "name": "↓write to /tmp/hello.txt",
"info": "", "info": "",
"x": 440, "x": 360,
"y": 160, "y": 180,
"wires": [] "wires": []
} }
] ]

View File

@@ -2,7 +2,7 @@
{ {
"id": "704479e1.399388", "id": "704479e1.399388",
"type": "inject", "type": "inject",
"z": "4b63452d.672afc", "z": "6312c0588348b2d4",
"name": "", "name": "",
"props": [ "props": [
{ {
@@ -25,8 +25,8 @@
"topic": "", "topic": "",
"payload": "Hello, World!", "payload": "Hello, World!",
"payloadType": "str", "payloadType": "str",
"x": 230, "x": 190,
"y": 400, "y": 260,
"wires": [ "wires": [
[ [
"402f3b7e.988014" "402f3b7e.988014"
@@ -36,25 +36,25 @@
{ {
"id": "8e876a75.e9beb8", "id": "8e876a75.e9beb8",
"type": "comment", "type": "comment",
"z": "4b63452d.672afc", "z": "6312c0588348b2d4",
"name": "Write string to a file specied by filename property, the read from the file", "name": "Write string to a file specied by filename property, the read from the file",
"info": "File node can target file using `filename` property.", "info": "Write file node can target file using `filename` property.",
"x": 350, "x": 310,
"y": 320, "y": 180,
"wires": [] "wires": []
}, },
{ {
"id": "402f3b7e.988014", "id": "402f3b7e.988014",
"type": "file", "type": "file",
"z": "4b63452d.672afc", "z": "6312c0588348b2d4",
"name": "", "name": "",
"filename": "", "filename": "",
"appendNewline": true, "appendNewline": true,
"createDir": false, "createDir": false,
"overwriteFile": "true", "overwriteFile": "true",
"encoding": "none", "encoding": "none",
"x": 390, "x": 350,
"y": 400, "y": 260,
"wires": [ "wires": [
[ [
"26e077d6.bbcd98" "26e077d6.bbcd98"
@@ -64,7 +64,7 @@
{ {
"id": "97b6b6b2.a54b38", "id": "97b6b6b2.a54b38",
"type": "debug", "type": "debug",
"z": "4b63452d.672afc", "z": "6312c0588348b2d4",
"name": "", "name": "",
"active": true, "active": true,
"tosidebar": true, "tosidebar": true,
@@ -73,22 +73,22 @@
"complete": "false", "complete": "false",
"statusVal": "", "statusVal": "",
"statusType": "auto", "statusType": "auto",
"x": 770, "x": 730,
"y": 400, "y": 260,
"wires": [] "wires": []
}, },
{ {
"id": "26e077d6.bbcd98", "id": "26e077d6.bbcd98",
"type": "file in", "type": "file in",
"z": "4b63452d.672afc", "z": "6312c0588348b2d4",
"name": "", "name": "",
"filename": "/tmp/hello.txt", "filename": "/tmp/hello.txt",
"format": "utf8", "format": "utf8",
"chunk": false, "chunk": false,
"sendError": false, "sendError": false,
"encoding": "none", "encoding": "none",
"x": 580, "x": 540,
"y": 400, "y": 260,
"wires": [ "wires": [
[ [
"97b6b6b2.a54b38" "97b6b6b2.a54b38"
@@ -98,21 +98,21 @@
{ {
"id": "85062297.da79", "id": "85062297.da79",
"type": "comment", "type": "comment",
"z": "4b63452d.672afc", "z": "6312c0588348b2d4",
"name": "↑read result from file", "name": "↑read result from file",
"info": "", "info": "",
"x": 590, "x": 550,
"y": 440, "y": 300,
"wires": [] "wires": []
}, },
{ {
"id": "7316c4fc.b1dcdc", "id": "7316c4fc.b1dcdc",
"type": "comment", "type": "comment",
"z": "4b63452d.672afc", "z": "6312c0588348b2d4",
"name": "↓write to file specified by filename property", "name": "↓write to file specified by filename property",
"info": "", "info": "",
"x": 500, "x": 460,
"y": 360, "y": 220,
"wires": [] "wires": []
} }
] ]

View File

@@ -2,7 +2,7 @@
{ {
"id": "4ac00fb0.d5f52", "id": "4ac00fb0.d5f52",
"type": "inject", "type": "inject",
"z": "4b63452d.672afc", "z": "6312c0588348b2d4",
"name": "", "name": "",
"props": [ "props": [
{ {
@@ -20,8 +20,8 @@
"topic": "", "topic": "",
"payload": "", "payload": "",
"payloadType": "date", "payloadType": "date",
"x": 220, "x": 180,
"y": 600, "y": 220,
"wires": [ "wires": [
[ [
"542cc2f4.92857c" "542cc2f4.92857c"
@@ -31,25 +31,25 @@
{ {
"id": "671f8295.0e6f6c", "id": "671f8295.0e6f6c",
"type": "comment", "type": "comment",
"z": "4b63452d.672afc", "z": "6312c0588348b2d4",
"name": "Delete a file", "name": "Delete a file",
"info": "File node can delete a file.", "info": "Write file node can delete a file.",
"x": 170, "x": 130,
"y": 540, "y": 160,
"wires": [] "wires": []
}, },
{ {
"id": "542cc2f4.92857c", "id": "542cc2f4.92857c",
"type": "file", "type": "file",
"z": "4b63452d.672afc", "z": "6312c0588348b2d4",
"name": "", "name": "",
"filename": "/tmp/hello.txt", "filename": "/tmp/hello.txt",
"appendNewline": true, "appendNewline": true,
"createDir": false, "createDir": false,
"overwriteFile": "delete", "overwriteFile": "delete",
"encoding": "none", "encoding": "none",
"x": 420, "x": 380,
"y": 600, "y": 220,
"wires": [ "wires": [
[ [
"a24da523.5babe8" "a24da523.5babe8"
@@ -59,7 +59,7 @@
{ {
"id": "a24da523.5babe8", "id": "a24da523.5babe8",
"type": "debug", "type": "debug",
"z": "4b63452d.672afc", "z": "6312c0588348b2d4",
"name": "", "name": "",
"active": true, "active": true,
"tosidebar": true, "tosidebar": true,
@@ -68,18 +68,18 @@
"complete": "false", "complete": "false",
"statusVal": "", "statusVal": "",
"statusType": "auto", "statusType": "auto",
"x": 630, "x": 590,
"y": 600, "y": 220,
"wires": [] "wires": []
}, },
{ {
"id": "51157051.2f62", "id": "51157051.2f62",
"type": "comment", "type": "comment",
"z": "4b63452d.672afc", "z": "6312c0588348b2d4",
"name": "↓delete a file", "name": "↓delete a file",
"info": "", "info": "",
"x": 390, "x": 350,
"y": 560, "y": 180,
"wires": [] "wires": []
} }
] ]

View File

@@ -2,8 +2,8 @@
{ {
"id": "e4ef1f5e.7cd82", "id": "e4ef1f5e.7cd82",
"type": "inject", "type": "inject",
"z": "4b63452d.672afc", "z": "6312c0588348b2d4",
"name": "", "name": "Base64 encoded string",
"props": [ "props": [
{ {
"p": "payload" "p": "payload"
@@ -20,8 +20,8 @@
"topic": "", "topic": "",
"payload": "8J+YgA==", "payload": "8J+YgA==",
"payloadType": "str", "payloadType": "str",
"x": 220, "x": 200,
"y": 820, "y": 220,
"wires": [ "wires": [
[ [
"72b37cc8.177054" "72b37cc8.177054"
@@ -31,25 +31,25 @@
{ {
"id": "f5997af4.5a9298", "id": "f5997af4.5a9298",
"type": "comment", "type": "comment",
"z": "4b63452d.672afc", "z": "6312c0588348b2d4",
"name": "Specify encoding of written data", "name": "Specify encoding of written data",
"info": "File node can specify encoding of data.", "info": "Write file node can specify encoding of data.",
"x": 230, "x": 170,
"y": 740, "y": 140,
"wires": [] "wires": []
}, },
{ {
"id": "72b37cc8.177054", "id": "72b37cc8.177054",
"type": "file", "type": "file",
"z": "4b63452d.672afc", "z": "6312c0588348b2d4",
"name": "", "name": "",
"filename": "/tmp/hello.txt", "filename": "/tmp/hello.txt",
"appendNewline": true, "appendNewline": true,
"createDir": false, "createDir": false,
"overwriteFile": "true", "overwriteFile": "true",
"encoding": "base64", "encoding": "base64",
"x": 400, "x": 420,
"y": 820, "y": 220,
"wires": [ "wires": [
[ [
"2da33ec.f45cac2" "2da33ec.f45cac2"
@@ -59,7 +59,7 @@
{ {
"id": "2e814354.278c8c", "id": "2e814354.278c8c",
"type": "debug", "type": "debug",
"z": "4b63452d.672afc", "z": "6312c0588348b2d4",
"name": "", "name": "",
"active": true, "active": true,
"tosidebar": true, "tosidebar": true,
@@ -68,22 +68,22 @@
"complete": "false", "complete": "false",
"statusVal": "", "statusVal": "",
"statusType": "auto", "statusType": "auto",
"x": 790, "x": 810,
"y": 820, "y": 220,
"wires": [] "wires": []
}, },
{ {
"id": "2da33ec.f45cac2", "id": "2da33ec.f45cac2",
"type": "file in", "type": "file in",
"z": "4b63452d.672afc", "z": "6312c0588348b2d4",
"name": "", "name": "",
"filename": "/tmp/hello.txt", "filename": "/tmp/hello.txt",
"format": "utf8", "format": "utf8",
"chunk": false, "chunk": false,
"sendError": false, "sendError": false,
"encoding": "none", "encoding": "none",
"x": 600, "x": 620,
"y": 820, "y": 220,
"wires": [ "wires": [
[ [
"2e814354.278c8c" "2e814354.278c8c"
@@ -93,21 +93,21 @@
{ {
"id": "ec754c99.84bfd", "id": "ec754c99.84bfd",
"type": "comment", "type": "comment",
"z": "4b63452d.672afc", "z": "6312c0588348b2d4",
"name": "↓write string with base64 encoding", "name": "↓write string with base64 encoding",
"info": "", "info": "",
"x": 460, "x": 480,
"y": 780, "y": 180,
"wires": [] "wires": []
}, },
{ {
"id": "3e6704ff.4ce25c", "id": "3e6704ff.4ce25c",
"type": "comment", "type": "comment",
"z": "4b63452d.672afc", "z": "6312c0588348b2d4",
"name": "↑read result from file", "name": "↑read result from file",
"info": "", "info": "",
"x": 610, "x": 630,
"y": 860, "y": 260,
"wires": [] "wires": []
} }
] ]

View File

@@ -21,7 +21,7 @@
<dt>msg <span class="property-type">object</span></dt> <dt>msg <span class="property-type">object</span></dt>
<dd>A msg object containing information to populate the template.</dd> <dd>A msg object containing information to populate the template.</dd>
<dt class="optional">template <span class="property-type">string</span></dt> <dt class="optional">template <span class="property-type">string</span></dt>
<dd>A template to be populated from msg.payload. If not configured in the edit panel, <dd>A template to be populated from <code>msg.payload</code>. If not configured in the edit panel,
this can be set as a property of msg.</dd> this can be set as a property of msg.</dd>
</dl> </dl>
<h3>Outputs</h3> <h3>Outputs</h3>

View File

@@ -60,5 +60,5 @@
for the next topic. for the next topic.
</p> </p>
<p><b>Note</b>: In rate limit mode the maximum queue depth can be set by a property in your <p><b>Note</b>: In rate limit mode the maximum queue depth can be set by a property in your
<i>settings.js</i> file. For example <code>nodeMessageBufferMaxLength: 1000,</code> <i>settings.js</i> file. For example <code>nodeMessageBufferMaxLength: 1000,</code></p>
</script> </script>

View File

@@ -25,7 +25,7 @@
<h3>Details</h3> <h3>Details</h3>
<p>In RBE mode this node will block until the <code>msg.payload</code>, <p>In RBE mode this node will block until the <code>msg.payload</code>,
(or selected property) value is different to the previous one. (or selected property) value is different to the previous one.
If required it can ignore the intial value, so as not to send anything at start.</p> If required it can ignore the initial value, so as not to send anything at start.</p>
<p>The <a href="https://en.wikipedia.org/wiki/Deadband" target="_blank">Deadband</a> modes will block the incoming value <p>The <a href="https://en.wikipedia.org/wiki/Deadband" target="_blank">Deadband</a> modes will block the incoming value
<i>unless</i> its change is greater or greater-equal than &plusmn; the band gap away from a previous value.</p> <i>unless</i> its change is greater or greater-equal than &plusmn; the band gap away from a previous value.</p>
<p>The Narrowband modes will block the incoming value, <p>The Narrowband modes will block the incoming value,
@@ -37,5 +37,5 @@
ignoring any values out of range, or the previous input value, which resets the set point, thus allowing ignoring any values out of range, or the previous input value, which resets the set point, thus allowing
gradual drift (deadband), or a step change (narrowband).</p> gradual drift (deadband), or a step change (narrowband).</p>
<p><b>Note:</b> This works on a per <code>msg.topic</code> basis, though this can be changed to another property if desired. <p><b>Note:</b> This works on a per <code>msg.topic</code> basis, though this can be changed to another property if desired.
This means that a single rbe node can handle multiple different topics at the same time.</p> This means that a single filter node can handle multiple different topics at the same time.</p>
</script> </script>

View File

@@ -52,7 +52,7 @@
<dt class="optional">topic <span class="property-type">string|object|array</span></dt> <dt class="optional">topic <span class="property-type">string|object|array</span></dt>
<dd>For the <code>"subscribe"</code> and <code>"unsubscribe"</code> actions, this property <dd>For the <code>"subscribe"</code> and <code>"unsubscribe"</code> actions, this property
provides the topic. It can be set as either:<ul> provides the topic. It can be set as either:<ul>
<li>a String continaing the topic filter</li> <li>a String containing the topic filter</li>
<li>an Object containing <code>topic</code> and <code>qos</code> properties</li> <li>an Object containing <code>topic</code> and <code>qos</code> properties</li>
<li>an array of either strings or objects to handle multiple topics in one</li> <li>an array of either strings or objects to handle multiple topics in one</li>
</ul> </ul>

View File

@@ -52,7 +52,7 @@
<dd>In case any redirects occurred while processing the request, this property is the final redirected url. <dd>In case any redirects occurred while processing the request, this property is the final redirected url.
Otherwise, the url of the original request.</dd> Otherwise, the url of the original request.</dd>
<dt>responseCookies <span class="property-type">object</span></dt> <dt>responseCookies <span class="property-type">object</span></dt>
<dd>If the response includes cookies, this propery is an object of name/value pairs for each cookie.</dd> <dd>If the response includes cookies, this property is an object of name/value pairs for each cookie.</dd>
<dt>redirectList <span class="property-type">array</span></dt> <dt>redirectList <span class="property-type">array</span></dt>
<dd>If the request was redirected one or more times, the accumulated information will be added to this property. `location` is the next redirect destination. `cookies` is the cookies returned from the redirect source.</dd> <dd>If the request was redirected one or more times, the accumulated information will be added to this property. `location` is the next redirect destination. `cookies` is the cookies returned from the redirect source.</dd>
</dl> </dl>

View File

@@ -60,7 +60,7 @@
</p> </p>
<p>When operating in this mode, the node will not set the <code>msg.parts.count</code> <p>When operating in this mode, the node will not set the <code>msg.parts.count</code>
property as it does not know how many messages to expect in the stream. This property as it does not know how many messages to expect in the stream. This
means it cannot be used with the <b>join</b> node in its automatic mode</p> means it cannot be used with the <b>join</b> node in its automatic mode.</p>
</script> </script>
<script type="text/html" data-help-name="join"> <script type="text/html" data-help-name="join">

View File

@@ -46,4 +46,6 @@
<code>{{global[store].名前}}</code> <code>{{global[store].名前}}</code>
</p> </p>
<p><b>: </b>デフォルトでは、<i>mustache</i>形式は置換対象のHTML要素をエスケープしますこれを抑止するには<code>{{{三重}}}</code>使</p> <p><b>: </b>デフォルトでは、<i>mustache</i>形式は置換対象のHTML要素をエスケープしますこれを抑止するには<code>{{{三重}}}</code>使</p>
<p>もしコンテンツの中で<code>{{ }}</code>使<code>[[ ]]</code></p>
<pre>{{=[[ ]]=}}</pre>
</script> </script>

View File

@@ -25,11 +25,14 @@
<dt class="optional">reset</dt> <dt class="optional">reset</dt>
<dd>受信メッセージでこのプロパティを任意の値に設定するとノードが保持する全ての未送信メッセージをクリアします</dd> <dd>受信メッセージでこのプロパティを任意の値に設定するとノードが保持する全ての未送信メッセージをクリアします</dd>
<dt class="optional">flush</dt> <dt class="optional">flush</dt>
<dd>受信メッセージでこのプロパティを任意の値に設定するとノードが保持る全ての未送信メッセージを直ちに送信します</dd> <dd>本プロパティに数値が設定されたメッセージを受信すると直ちに指定された数のメッセージを送信しますもし他の型(例えば真偽型)が設定されている場合はノードが保持している全ての未送信メッセージを直ちに送信します</dd>
<dt class="optional">toFront</dt>
<dd>流量制御モードにおいて本プロパティに真偽型<code>true</code><code>msg.flush=1</code></dd>
</dl> </dl>
<h3>詳細</h3> <h3>詳細</h3>
<p>メッセージを遅延させるように設定する場合遅延時間は固定値範囲内の乱数値メッセージ毎の動的な指定値のいずれかを指定できます</p> <p>メッセージを遅延させるように設定する場合遅延時間は固定値範囲内の乱数値メッセージ毎の動的な指定値のいずれかを指定できます各メッセージは到着時刻に基づいて他のメッセージとは独立して遅延されます</p>
<p>流量制御する場合メッセージは指定した時間間隔内に分散して送信しますキューに残っているメッセージ数はノードのステータスに表示されます受け取った中間メッセージを破棄することも可能です</p> <p>流量制御する場合メッセージは指定した時間間隔内に分散して送信しますキューに残っているメッセージ数はノードのステータスに表示されます受け取った中間メッセージを破棄することも可能です</p>
<p>流量値を上書きできるように設定されている場合新しい流量値はすぐに適用されますこの流量値は再度変更されるまで本ノードがリセットされるまでまたはフローが再実行されるまで有効です</p> <p>流量値を上書きできるように設定されている場合新しい流量値はすぐに適用されますこの流量値は再度変更されるまで本ノードがリセットされるまでまたはフローが再実行されるまで有効です</p>
<p>流量制御は全てのメッセージに適用することも<code>msg.topic</code></p> <p>流量制御は全てのメッセージに適用することも<code>msg.topic</code></p>
<p><b></b>: 流量制御モードでは、キューの大きさの最大値を<i>settings.js</i>ファイルのプロパティに設定できます例えば次の様な設定です<code>nodeMessageBufferMaxLength: 1000,</code></p>
</script> </script>

View File

@@ -27,5 +27,5 @@
<p>不感帯モードでは%による指定もサポートしています入力と前の値の差分がX%より大きな場合に出力を行います</p> <p>不感帯モードでは%による指定もサポートしています入力と前の値の差分がX%より大きな場合に出力を行います</p>
<p>狭帯域(narrowband)モードでは前の値に対する差分が一定値より大きな場合に入力ペイロードをブロックしますこのモードは故障したセンサから発生する外れ値を無視する時などに有用です</p> <p>狭帯域(narrowband)モードでは前の値に対する差分が一定値より大きな場合に入力ペイロードをブロックしますこのモードは故障したセンサから発生する外れ値を無視する時などに有用です</p>
<p>不感帯モードと狭帯域モードでは以前の有効出力値もしくは以前の入力値との比較ができます有効出力値を用いると範囲外の値を無視することが入力値を用いると設定点がリセットされるため漸次的変化(不感帯モード)もしくは段階的変化(狭帯域モード)が可能です</p> <p>不感帯モードと狭帯域モードでは以前の有効出力値もしくは以前の入力値との比較ができます有効出力値を用いると範囲外の値を無視することが入力値を用いると設定点がリセットされるため漸次的変化(不感帯モード)もしくは段階的変化(狭帯域モード)が可能です</p>
<p><b>:</b> <code>msg.topic</code>rbe</p> <p><b>:</b> <code>msg.topic</code>filter</p>
</script> </script>

View File

@@ -26,11 +26,46 @@
<dd>0: 最大1度到着, 1: 一度以上到着, 2: 1度のみ到着</dd> <dd>0: 最大1度到着, 1: 一度以上到着, 2: 1度のみ到着</dd>
<dt>retain <span class="property-type">真偽値</span></dt> <dt>retain <span class="property-type">真偽値</span></dt>
<dd>真の場合メッセージを保持メッセージが古い値の場合があります</dd> <dd>真の場合メッセージを保持メッセージが古い値の場合があります</dd>
<dt class="optional">responseTopic <span class="property-type">文字列</span></dt>
<dd><b>MQTTv5</b>: MQTT</dd>
<dt class="optional">correlationData <span class="property-type">バッファ</span></dt>
<dd><b>MQTTv5</b>: </dd>
<dt class="optional">contentType <span class="property-type">文字列</span></dt>
<dd><b>MQTTv5</b>: </dd>
<dt class="optional">userProperties <span class="property-type">オブジェクト</span></dt>
<dd><b>MQTTv5</b>: </dd>
<dt class="optional">messageExpiryInterval <span class="property-type">数値</span></dt>
<dd><b>MQTTv5</b>: </dd>
</dl> </dl>
<h3>詳細</h3> <h3>詳細</h3>
<p>購読トピックにはMQTTのワイルドカード(+: 1レベル, #: 複数レベル)を含めることができます</p> <p>購読トピックにはMQTTのワイルドカード(+: 1レベル, #: 複数レベル)を含めることができます</p>
<p>このノードの利用のためにはMQTTブローカへの接続設定が必要ですこの設定は鉛筆アイコンをクリックすることで行えます</p> <p>このノードの利用のためにはMQTTブローカへの接続設定が必要ですこの設定は鉛筆アイコンをクリックすることで行えます</p>
<p>MQTT(inおよびout)ノードはブローカへの接続設定を必要に応じて共有できます</p> <p>MQTT(inおよびout)ノードはブローカへの接続設定を必要に応じて共有できます</p>
<h4>動的購読</h4>
本ノードはMQTTの接続と購読を動的に制御するよう設定できます有効にすると本ノードの入力にメッセージを渡すことで制御できます
<h3>入力</h3>
<p>これらは動的購読が設定されている場合のみ適用されます</p>
<dl class="message-properties">
<dt>action <span class="property-type">文字列</span></dt>
<dd>本ノードが行う動作の名前利用可能な動作は<code>"connect"</code><code>"disconnect"</code><code>"subscribe"</code><code>"unsubscribe"</code></dd>
<dt class="optional">topic <span class="property-type">文字列|オブジェクト|配列</span></dt>
<dd><code>"subscribe"</code><code>"unsubscribe"</code>:<ul>
<li>トピックフィルターを含む文字列</li>
<li><code>topic</code><code>qos</code></li>
<li>複数のトピックを扱う文字列やオブジェクトの配列</li>
</ul>
</dd>
<dt class="optional">broker <span class="property-type">broker</span> </dt>
<dd><code>"connect"</code>: <ul>
<li><code>broker</code></li>
<li><code>port</code></li>
<li><code>url</code> - URLbrokerport</li>
<li><code>username</code></li>
<li><code>password</code></li>
</ul>
<p>本プロパティが設定され既にブローカが接続されている場合<code>force</code></p>
</dd>
</dl>
</script> </script>
<script type="text/html" data-help-name="mqtt out"> <script type="text/html" data-help-name="mqtt out">
@@ -39,15 +74,24 @@
<dl class="message-properties"> <dl class="message-properties">
<dt>payload <span class="property-type">文字列 | バッファ</span></dt> <dt>payload <span class="property-type">文字列 | バッファ</span></dt>
<dd>発行するペイロードプロパティが設定されていない場合にはメッセージは送信されません空のメッセージを送信するにはプロパティに空文字列を設定します</dd> <dd>発行するペイロードプロパティが設定されていない場合にはメッセージは送信されません空のメッセージを送信するにはプロパティに空文字列を設定します</dd>
<dt class="optional">topic <span class="property-type">文字列</span></dt> <dt class="optional">topic <span class="property-type">文字列</span></dt>
<dd>発行対象のMQTTトピック</dd> <dd>発行対象のMQTTトピック</dd>
<dt class="optional">qos <span class="property-type">数値</span></dt> <dt class="optional">qos <span class="property-type">数値</span></dt>
<dd>0: 最大一度到着, 1: 一度以上到着, 2: 一度のみ到着デフォルトは0です</dd> <dd>0: 最大一度到着, 1: 一度以上到着, 2: 一度のみ到着デフォルトは0です</dd>
<dt class="optional">retain <span class="property-type">真偽値</span></dt> <dt class="optional">retain <span class="property-type">真偽値</span></dt>
<dd>真の場合メッセージをブローカに保持しますデフォルトは偽です</dd> <dd>真の場合メッセージをブローカに保持しますデフォルトは偽です</dd>
<dt class="optional">responseTopic <span class="property-type">文字列</span></dt>
<dd><b>MQTTv5</b>: MQTT</dd>
<dt class="optional">correlationData <span class="property-type">バッファ</span></dt>
<dd><b>MQTTv5</b>: </dd>
<dt class="optional">contentType <span class="property-type">文字列</span></dt>
<dd><b>MQTTv5</b>: </dd>
<dt class="optional">userProperties <span class="property-type">オブジェクト</span></dt>
<dd><b>MQTTv5</b>: </dd>
<dt class="optional">messageExpiryInterval <span class="property-type">数値</span></dt>
<dd><b>MQTTv5</b>: </dd>
<dt class="optional">topicAlias <span class="property-type">数値</span></dt>
<dd><b>MQTTv5</b>: 使MQTT</dd>
</dl> </dl>
<h3>詳細</h3> <h3>詳細</h3>
<p><code>msg.payload</code>JSON</p> <p><code>msg.payload</code>JSON</p>
@@ -55,6 +99,24 @@
<p>同様にQoSとretainもードの設定もしくはノードの設定が空の場合にはそれぞれ<code>msg.qos</code><code>msg.retain</code>retain</p> <p>同様にQoSとretainもードの設定もしくはノードの設定が空の場合にはそれぞれ<code>msg.qos</code><code>msg.retain</code>retain</p>
<p>このノードの利用のためにはMQTTブローカへの接続設定が必要ですこの設定は鉛筆アイコンをクリックすることで行えます</p> <p>このノードの利用のためにはMQTTブローカへの接続設定が必要ですこの設定は鉛筆アイコンをクリックすることで行えます</p>
<p>MQTT(inおよびout)ノードはブローカへの接続設定を必要に応じて共有できます</p> <p>MQTT(inおよびout)ノードはブローカへの接続設定を必要に応じて共有できます</p>
<h4>動的制御</h4>
本ノードによって接続を動的に制御できます本ノードが以下の制御メッセージのいずれかを受け取った際はペイロードと同じ様にパブリッシュされることはありません
<h3>入力</h3>
<dl class="message-properties">
<dt>action <span class="property-type">文字列</span></dt>
<dd>本ノードが行う動作の名前利用可能な動作は<code>"connect"</code><code>"disconnect"</code><code>"subscribe"</code><code>"unsubscribe"</code></dd>
<dt class="optional">broker <span class="property-type">broker</span> </dt>
<dd><code>"connect"</code>: <ul>
<li><code>broker</code></li>
<li><code>port</code></li>
<li><code>url</code> - URLbrokerport</li>
<li><code>username</code></li>
<li><code>password</code></li>
</ul>
<p>本プロパティが設定され既にブローカが接続されている場合<code>force</code></p>
</dd>
</dl>
</script> </script>
<script type="text/html" data-help-name="mqtt-broker"> <script type="text/html" data-help-name="mqtt-broker">
@@ -70,5 +132,4 @@
<h4>WebSocket</h4> <h4>WebSocket</h4>
<p>WebSocketによる接続を行うように設定できますWebSocketを利用するにはサーバフィールドに接続先のURIを完全な形式で記述します以下に例を示します</p> <p>WebSocketによる接続を行うように設定できますWebSocketを利用するにはサーバフィールドに接続先のURIを完全な形式で記述します以下に例を示します</p>
<pre>ws://example.com:4000/mqtt</pre> <pre>ws://example.com:4000/mqtt</pre>
</script> </script>

View File

@@ -36,7 +36,7 @@
<h3>詳細</h3> <h3>詳細</h3>
<p>列名にカラム名のリストを指定することができますCSVからオブジェクトに変換を行う際カラム名をプロパティ名として使用します列名の代わりにCSVデータの1行目にカラム名を含めることもできます</p> <p>列名にカラム名のリストを指定することができますCSVからオブジェクトに変換を行う際カラム名をプロパティ名として使用します列名の代わりにCSVデータの1行目にカラム名を含めることもできます</p>
<p>CSVへの変換を行う際にはオブジェクトから取り出すべきプロパティとその順序を列名を参照して決めます</p> <p>CSVへの変換を行う際にはオブジェクトから取り出すべきプロパティとその順序を列名を参照して決めます</p>
<p>列名がない場合本ノードは<code>msg.columns</code>使</p> <p>列名がない場合本ノードは<code>msg.columns</code>使</p>
<p>入力が配列の場合には列名はカラム名を表す行の出力指定がされた場合だけ用います</p> <p>入力が配列の場合には列名はカラム名を表す行の出力指定がされた場合だけ用います</p>
<p>数値を変換するオプションがチェックされている場合文字列型の数値が数値として返されますつまり1,"1.5",2の真ん中の値が数値になります</p> <p>数値を変換するオプションがチェックされている場合文字列型の数値が数値として返されますつまり1,"1.5",2の真ん中の値が数値になります</p>
<p>空の文字を含むオプションがチェックされている場合空の文字列が結果に返されますつまり"1","",3の真ん中の値が空の文字列になります</p> <p>空の文字を含むオプションがチェックされている場合空の文字列が結果に返されますつまり"1","",3の真ん中の値が空の文字列になります</p>

View File

@@ -52,7 +52,6 @@
<p>このモードで処理する際にはメッセージ数を予め知ることができないため<code>msg.parts.count</code><b>join</b></p> <p>このモードで処理する際にはメッセージ数を予め知ることができないため<code>msg.parts.count</code><b>join</b></p>
</script> </script>
<script type="text/html" data-help-name="join"> <script type="text/html" data-help-name="join">
<p>メッセージ列を結合して一つのメッセージにします</p> <p>メッセージ列を結合して一つのメッセージにします</p>
<p>メッセージの結合には次の3つのモードが利用できます</p> <p>メッセージの結合には次の3つのモードが利用できます</p>
@@ -80,6 +79,10 @@
</dd> </dd>
<dt class="optional">complete</dt> <dt class="optional">complete</dt>
<dd>設定されている場合本ノードはペイロードを追加し保持しているメッセージを送信しますペイロードを追加したくない場合はmsgから削除してください</dd> <dd>設定されている場合本ノードはペイロードを追加し保持しているメッセージを送信しますペイロードを追加したくない場合はmsgから削除してください</dd>
<dt class="optional">reset</dt>
<dd>設定されている場合本ノードは部分的に完成したメッセージを送信せず削除します</dd>
<dt class="optional">restartTimeout</dt>
<dd>設定されている場合本ノードにタイムアウトが設定されそのタイムアウトを用いて処理が再開されます</dd>
</dl> </dl>
<h3>詳細</h3> <h3>詳細</h3>
@@ -96,7 +99,7 @@
</ul> </ul>
<p>出力メッセージのその他のプロパティはメッセージを送信する直前のメッセージをコピーします</p> <p>出力メッセージのその他のプロパティはメッセージを送信する直前のメッセージをコピーします</p>
<p><i>合計値</i></p> <p><i>合計値</i></p>
<p><i></i></p> <p><i></i><code>msg.restartTimeout</code></p>
<p><code>msg.complete</code></p> <p><code>msg.complete</code></p>
<p><code>msg.reset</code></p> <p><code>msg.reset</code></p>

View File

@@ -83,6 +83,7 @@ function createNode(flow,config) {
} }
} }
try { try {
Object.defineProperty(conf,'_module', {value: typeRegistry.getNodeInfo(type), enumerable: false, writable: true })
Object.defineProperty(conf,'_flow', {value: flow, enumerable: false, writable: true }) Object.defineProperty(conf,'_flow', {value: flow, enumerable: false, writable: true })
newNode = new nodeTypeConstructor(conf); newNode = new nodeTypeConstructor(conf);
} catch (err) { } catch (err) {

View File

@@ -59,6 +59,9 @@ function Node(n) {
// which we can tolerate as they are the same object. // which we can tolerate as they are the same object.
Object.defineProperty(this,'_flow', {value: n._flow, enumerable: false, writable: true }) Object.defineProperty(this,'_flow', {value: n._flow, enumerable: false, writable: true })
} }
if (n._module) {
Object.defineProperty(this,'_module', {value: n._module, enumerable: false, writable: true })
}
this.updateWires(n.wires); this.updateWires(n.wires);
} }
@@ -496,7 +499,12 @@ function log_helper(self, level, msg) {
if (self.name) { if (self.name) {
o.name = self.name; o.name = self.name;
} }
self._flow.log(o); // See https://github.com/node-red/node-red/issues/3327
try {
self._flow.log(o);
} catch(err) {
logUnexpectedError(self, err)
}
} }
/** /**
* Log an INFO level message * Log an INFO level message
@@ -576,4 +584,59 @@ Node.prototype.status = function(status) {
this._flow.handleStatus(this,status); this._flow.handleStatus(this,status);
}; };
function inspectObject(flow) {
try {
let properties = new Set()
let currentObj = flow
do {
if (!Object.getPrototypeOf(currentObj)) { break }
Object.getOwnPropertyNames(currentObj).map(item => properties.add(item))
} while ((currentObj = Object.getPrototypeOf(currentObj)))
let propList = [...properties.keys()].map(item => `${item}[${(typeof flow[item])[0]}]`)
propList.sort();
let result = [];
let line = "";
while (propList.length > 0) {
let prop = propList.shift()
if (line.length+prop.length > 80) {
result.push(line)
line = "";
} else {
line += " "+prop
}
}
if (line.length > 0) {
result.push(line);
}
return result.join("\n ")
} catch(err) {
return "Failed to capture object properties: "+err.toString()
}
}
function logUnexpectedError(node, error) {
let moduleInfo = node._module?`${node._module.module}@${node._module.version}`:"undefined"
Log.error(`
********************************************************************
Unexpected Node Error
${error.stack}
Node:
Type: ${node.type}
Module: ${moduleInfo}
ID: ${node._alias||node.id}
Properties:
${inspectObject(node)}
Flow: ${node._flow?node._flow.path:'undefined'}
Type: ${node._flow?node._flow.TYPE:'undefined'}
Properties:
${node._flow?inspectObject(node._flow):'undefined'}
Please report this issue, including the information logged above:
https://github.com/node-red/node-red/issues/
********************************************************************
`)
}
module.exports = Node; module.exports = Node;

View File

@@ -425,7 +425,7 @@ describe('rbe node', function() {
}); });
it('should not send output if x away or greater from original value (narrowbandEq)', function(done) { it('should not send output if x away or greater from original value (narrowbandEq)', function(done) {
var flow = [{"id":"n1", "type":"rbe", func:"narrowbandEq", gap:"10", inout:"out", wires:[["n2"]] }, var flow = [{"id":"n1", "type":"rbe", func:"narrowbandEq", gap:"10", inout:"out", start:"1", wires:[["n2"]] },
{id:"n2", type:"helper"} ]; {id:"n2", type:"helper"} ];
helper.load(testNode, flow, function() { helper.load(testNode, flow, function() {
var n1 = helper.getNode("n1"); var n1 = helper.getNode("n1");
@@ -445,6 +445,7 @@ describe('rbe node', function() {
done(); done();
} }
}); });
n1.emit("input", {payload:100});
n1.emit("input", {payload:0}); n1.emit("input", {payload:0});
n1.emit("input", {payload:10}); n1.emit("input", {payload:10});
n1.emit("input", {payload:5}); n1.emit("input", {payload:5});