mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Compare commits
25 Commits
3.1.2
...
check-node
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ae09a16b61 | ||
|
|
c1958d0bbe | ||
|
|
82b45362b1 | ||
|
|
918943816f | ||
|
|
0e8d312794 | ||
|
|
c584d51432 | ||
|
|
2366b4508f | ||
|
|
2f1565fbc9 | ||
|
|
33cf34f7c7 | ||
|
|
5b5b06cc06 | ||
|
|
f49f692ffa | ||
|
|
08c6ea94cb | ||
|
|
fea1da5542 | ||
|
|
32e8f4eac6 | ||
|
|
bfe5a8a986 | ||
|
|
f2cb5ea44e | ||
|
|
c7335ed25b | ||
|
|
eb940d6d57 | ||
|
|
9091935d77 | ||
|
|
34e8d2b051 | ||
|
|
0c2ab13c48 | ||
|
|
9489953a8f | ||
|
|
54d4079457 | ||
|
|
cef3a01042 | ||
|
|
0c042abcab |
@@ -1,3 +1,9 @@
|
|||||||
|
#### 3.1.3: Maintenance Release
|
||||||
|
|
||||||
|
Editor
|
||||||
|
|
||||||
|
- Add missing en-us messages (#4475) @knolleary
|
||||||
|
|
||||||
#### 3.1.2: Maintenance Release
|
#### 3.1.2: Maintenance Release
|
||||||
|
|
||||||
Editor
|
Editor
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "node-red",
|
"name": "node-red",
|
||||||
"version": "3.1.2",
|
"version": "4.0.0-dev",
|
||||||
"description": "Low-code programming for event-driven applications",
|
"description": "Low-code programming for event-driven applications",
|
||||||
"homepage": "https://nodered.org",
|
"homepage": "https://nodered.org",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@node-red/editor-api",
|
"name": "@node-red/editor-api",
|
||||||
"version": "3.1.2",
|
"version": "4.0.0-dev",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"main": "./lib/index.js",
|
"main": "./lib/index.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -16,8 +16,8 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@node-red/util": "3.1.2",
|
"@node-red/util": "4.0.0-dev",
|
||||||
"@node-red/editor-client": "3.1.2",
|
"@node-red/editor-client": "4.0.0-dev",
|
||||||
"bcryptjs": "2.4.3",
|
"bcryptjs": "2.4.3",
|
||||||
"body-parser": "1.20.2",
|
"body-parser": "1.20.2",
|
||||||
"clone": "2.1.2",
|
"clone": "2.1.2",
|
||||||
|
|||||||
@@ -113,7 +113,7 @@
|
|||||||
"displayStatus": "Show node status",
|
"displayStatus": "Show node status",
|
||||||
"displayConfig": "Configuration nodes",
|
"displayConfig": "Configuration nodes",
|
||||||
"import": "Import",
|
"import": "Import",
|
||||||
"importExample": "Import Example Flow",
|
"importExample": "Import example flow",
|
||||||
"export": "Export",
|
"export": "Export",
|
||||||
"search": "Search flows",
|
"search": "Search flows",
|
||||||
"searchInput": "search your flows",
|
"searchInput": "search your flows",
|
||||||
@@ -130,6 +130,11 @@
|
|||||||
"editPalette": "Manage palette",
|
"editPalette": "Manage palette",
|
||||||
"other": "Other",
|
"other": "Other",
|
||||||
"showTips": "Show tips",
|
"showTips": "Show tips",
|
||||||
|
"showNodeHelp": "Show node help",
|
||||||
|
"enableSelectedNodes": "Enable selected nodes",
|
||||||
|
"disableSelectedNodes": "Disable selected nodes",
|
||||||
|
"showSelectedNodeLabels": "Show selected node labels",
|
||||||
|
"hideSelectedNodeLabels": "Hide selected node labels",
|
||||||
"showWelcomeTours": "Show guided tours for new versions",
|
"showWelcomeTours": "Show guided tours for new versions",
|
||||||
"help": "Node-RED website",
|
"help": "Node-RED website",
|
||||||
"projects": "Projects",
|
"projects": "Projects",
|
||||||
@@ -511,8 +516,8 @@
|
|||||||
"selectAllConnected": "Select connected",
|
"selectAllConnected": "Select connected",
|
||||||
"addRemoveNode": "Add/remove node from selection",
|
"addRemoveNode": "Add/remove node from selection",
|
||||||
"editSelected": "Edit selected node",
|
"editSelected": "Edit selected node",
|
||||||
"deleteSelected": "Delete selected nodes or link",
|
"deleteSelected": "Delete selection",
|
||||||
"deleteReconnect": "Delete and Reconnect",
|
"deleteReconnect": "Delete and reconnect",
|
||||||
"importNode": "Import nodes",
|
"importNode": "Import nodes",
|
||||||
"exportNode": "Export nodes",
|
"exportNode": "Export nodes",
|
||||||
"nudgeNode": "Move selected nodes (1px)",
|
"nudgeNode": "Move selected nodes (1px)",
|
||||||
@@ -1227,6 +1232,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"contextMenu": {
|
"contextMenu": {
|
||||||
|
"showActionList": "Show action list",
|
||||||
"insert": "Insert",
|
"insert": "Insert",
|
||||||
"node": "Node",
|
"node": "Node",
|
||||||
"junction": "Junction",
|
"junction": "Junction",
|
||||||
|
|||||||
@@ -156,7 +156,7 @@
|
|||||||
"moveForwards": "向前移动",
|
"moveForwards": "向前移动",
|
||||||
"showNodeHelp":"显示节点帮助",
|
"showNodeHelp":"显示节点帮助",
|
||||||
"enableSelectedNodes":"启用当前选中节点",
|
"enableSelectedNodes":"启用当前选中节点",
|
||||||
"disableDelectedNodes":"禁用当前选中节点",
|
"disableSelectedNodes":"禁用当前选中节点",
|
||||||
"showSelectedNodeLabels":"显示选中的节点标签",
|
"showSelectedNodeLabels":"显示选中的节点标签",
|
||||||
"hideSelectedNodeLabels":"隐藏选中的节点标签"
|
"hideSelectedNodeLabels":"隐藏选中的节点标签"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -156,7 +156,7 @@
|
|||||||
"moveForwards": "向前移動",
|
"moveForwards": "向前移動",
|
||||||
"showNodeHelp":"顯示節點幫助",
|
"showNodeHelp":"顯示節點幫助",
|
||||||
"enableSelectedNodes":"啟用當前選中節點",
|
"enableSelectedNodes":"啟用當前選中節點",
|
||||||
"disableDelectedNodes":"禁用當前選中節點",
|
"disableSelectedNodes":"禁用當前選中節點",
|
||||||
"showSelectedNodeLabels":"顯示選中的節點標簽",
|
"showSelectedNodeLabels":"顯示選中的節點標簽",
|
||||||
"hideSelectedNodeLabels":"隱藏選中的節點標簽"
|
"hideSelectedNodeLabels":"隱藏選中的節點標簽"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@node-red/editor-client",
|
"name": "@node-red/editor-client",
|
||||||
"version": "3.1.2",
|
"version": "4.0.0-dev",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ RED.contextMenu = (function () {
|
|||||||
}
|
}
|
||||||
nodeOptions.push(
|
nodeOptions.push(
|
||||||
{ onselect: 'core:enable-selected-nodes', label: RED._('menu.label.enableSelectedNodes') },
|
{ onselect: 'core:enable-selected-nodes', label: RED._('menu.label.enableSelectedNodes') },
|
||||||
{ onselect: 'core:disable-selected-nodes', label: RED._('menu.label.disableDelectedNodes') },
|
{ onselect: 'core:disable-selected-nodes', label: RED._('menu.label.disableSelectedNodes') },
|
||||||
null,
|
null,
|
||||||
{ onselect: 'core:show-selected-node-labels', label: RED._('menu.label.showSelectedNodeLabels') },
|
{ onselect: 'core:show-selected-node-labels', label: RED._('menu.label.showSelectedNodeLabels') },
|
||||||
{ onselect: 'core:hide-selected-node-labels', label: RED._('menu.label.hideSelectedNodeLabels') }
|
{ onselect: 'core:hide-selected-node-labels', label: RED._('menu.label.hideSelectedNodeLabels') }
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ module.exports = function(RED) {
|
|||||||
const fs = require("fs-extra");
|
const fs = require("fs-extra");
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
var debuglength = RED.settings.debugMaxLength || 1000;
|
var debuglength = RED.settings.debugMaxLength || 1000;
|
||||||
|
var statuslength = RED.settings.debugStatusLength || 32;
|
||||||
var useColors = RED.settings.debugUseColors || false;
|
var useColors = RED.settings.debugUseColors || false;
|
||||||
util.inspect.styles.boolean = "red";
|
util.inspect.styles.boolean = "red";
|
||||||
const { hasOwnProperty } = Object.prototype;
|
const { hasOwnProperty } = Object.prototype;
|
||||||
@@ -164,7 +165,7 @@ module.exports = function(RED) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (st.length > 32) { st = st.substr(0,32) + "..."; }
|
if (st.length > statuslength) { st = st.substr(0,statuslength) + "..."; }
|
||||||
|
|
||||||
var newStatus = {fill:fill, shape:shape, text:st};
|
var newStatus = {fill:fill, shape:shape, text:st};
|
||||||
if (JSON.stringify(newStatus) !== node.oldState) { // only send if we have to
|
if (JSON.stringify(newStatus) !== node.oldState) { // only send if we have to
|
||||||
|
|||||||
@@ -411,23 +411,33 @@ module.exports = function(RED) {
|
|||||||
if (msg._session && msg._session.type == "tcp") {
|
if (msg._session && msg._session.type == "tcp") {
|
||||||
var client = connectionPool[msg._session.id];
|
var client = connectionPool[msg._session.id];
|
||||||
if (client) {
|
if (client) {
|
||||||
if (Buffer.isBuffer(msg.payload)) {
|
if (msg?.reset === true) {
|
||||||
client.write(msg.payload);
|
client.destroy();
|
||||||
} else if (typeof msg.payload === "string" && node.base64) {
|
}
|
||||||
client.write(Buffer.from(msg.payload,'base64'));
|
else {
|
||||||
} else {
|
if (Buffer.isBuffer(msg.payload)) {
|
||||||
client.write(Buffer.from(""+msg.payload));
|
client.write(msg.payload);
|
||||||
|
} else if (typeof msg.payload === "string" && node.base64) {
|
||||||
|
client.write(Buffer.from(msg.payload,'base64'));
|
||||||
|
} else {
|
||||||
|
client.write(Buffer.from(""+msg.payload));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
for (var i in connectionPool) {
|
for (var i in connectionPool) {
|
||||||
if (Buffer.isBuffer(msg.payload)) {
|
if (msg?.reset === true) {
|
||||||
connectionPool[i].write(msg.payload);
|
connectionPool[i].destroy();
|
||||||
} else if (typeof msg.payload === "string" && node.base64) {
|
}
|
||||||
connectionPool[i].write(Buffer.from(msg.payload,'base64'));
|
else {
|
||||||
} else {
|
if (Buffer.isBuffer(msg.payload)) {
|
||||||
connectionPool[i].write(Buffer.from(""+msg.payload));
|
connectionPool[i].write(msg.payload);
|
||||||
|
} else if (typeof msg.payload === "string" && node.base64) {
|
||||||
|
connectionPool[i].write(Buffer.from(msg.payload,'base64'));
|
||||||
|
} else {
|
||||||
|
connectionPool[i].write(Buffer.from(""+msg.payload));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -547,13 +557,33 @@ module.exports = function(RED) {
|
|||||||
|
|
||||||
this.on("input", function(msg, nodeSend, nodeDone) {
|
this.on("input", function(msg, nodeSend, nodeDone) {
|
||||||
var i = 0;
|
var i = 0;
|
||||||
if ((!Buffer.isBuffer(msg.payload)) && (typeof msg.payload !== "string")) {
|
if (msg.payload !== undefined && (!Buffer.isBuffer(msg.payload)) && (typeof msg.payload !== "string")) {
|
||||||
msg.payload = msg.payload.toString();
|
msg.payload = msg.payload.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
var host = node.server || msg.host;
|
var host = node.server || msg.host;
|
||||||
var port = node.port || msg.port;
|
var port = node.port || msg.port;
|
||||||
|
|
||||||
|
if (node.out === "sit" && msg?.reset) {
|
||||||
|
if (msg.reset === true) { // kill all connections
|
||||||
|
for (var cl in clients) {
|
||||||
|
if (clients[cl].hasOwnProperty("client")) {
|
||||||
|
clients[cl].client.destroy();
|
||||||
|
delete clients[cl];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (typeof(msg.reset) === "string" && msg.reset.includes(":")) { // just kill connection host:port
|
||||||
|
if (clients.hasOwnProperty(msg.reset) && clients[msg.reset].hasOwnProperty("client")) {
|
||||||
|
clients[msg.reset].client.destroy();
|
||||||
|
delete clients[msg.reset];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const cc = Object.keys(clients).length;
|
||||||
|
node.status({fill:"green",shape:cc===0?"ring":"dot",text:RED._("tcpin.status.connections",{count:cc})});
|
||||||
|
if ((host === undefined || port === undefined) && !msg.hasOwnProperty("payload")) { return; }
|
||||||
|
}
|
||||||
|
|
||||||
// Store client information independently
|
// Store client information independently
|
||||||
// the clients object will have:
|
// the clients object will have:
|
||||||
// clients[id].client, clients[id].msg, clients[id].timeout
|
// clients[id].client, clients[id].msg, clients[id].timeout
|
||||||
@@ -621,13 +651,16 @@ module.exports = function(RED) {
|
|||||||
clients[connection_id].connecting = true;
|
clients[connection_id].connecting = true;
|
||||||
clients[connection_id].client.connect(connOpts, function() {
|
clients[connection_id].client.connect(connOpts, function() {
|
||||||
//node.log(RED._("tcpin.errors.client-connected"));
|
//node.log(RED._("tcpin.errors.client-connected"));
|
||||||
node.status({fill:"green",shape:"dot",text:"common.status.connected"});
|
// node.status({fill:"green",shape:"dot",text:"common.status.connected"});
|
||||||
|
node.status({fill:"green",shape:"dot",text:RED._("tcpin.status.connections",{count:Object.keys(clients).length})});
|
||||||
if (clients[connection_id] && clients[connection_id].client) {
|
if (clients[connection_id] && clients[connection_id].client) {
|
||||||
clients[connection_id].connected = true;
|
clients[connection_id].connected = true;
|
||||||
clients[connection_id].connecting = false;
|
clients[connection_id].connecting = false;
|
||||||
let event;
|
let event;
|
||||||
while (event = dequeue(clients[connection_id].msgQueue)) {
|
while (event = dequeue(clients[connection_id].msgQueue)) {
|
||||||
clients[connection_id].client.write(event.msg.payload);
|
if (event.msg.payload !== undefined) {
|
||||||
|
clients[connection_id].client.write(event.msg.payload);
|
||||||
|
}
|
||||||
event.nodeDone();
|
event.nodeDone();
|
||||||
}
|
}
|
||||||
if (node.out === "time" && node.splitc < 0) {
|
if (node.out === "time" && node.splitc < 0) {
|
||||||
@@ -823,7 +856,9 @@ module.exports = function(RED) {
|
|||||||
else if (!clients[connection_id].connecting && clients[connection_id].connected) {
|
else if (!clients[connection_id].connecting && clients[connection_id].connected) {
|
||||||
if (clients[connection_id] && clients[connection_id].client) {
|
if (clients[connection_id] && clients[connection_id].client) {
|
||||||
let event = dequeue(clients[connection_id].msgQueue)
|
let event = dequeue(clients[connection_id].msgQueue)
|
||||||
clients[connection_id].client.write(event.msg.payload);
|
if (event.msg.payload !== undefined ) {
|
||||||
|
clients[connection_id].client.write(event.msg.payload);
|
||||||
|
}
|
||||||
event.nodeDone();
|
event.nodeDone();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,8 @@
|
|||||||
before being sent.</p>
|
before being sent.</p>
|
||||||
<p>If <code>msg._session</code> is not present the payload is
|
<p>If <code>msg._session</code> is not present the payload is
|
||||||
sent to <b>all</b> connected clients.</p>
|
sent to <b>all</b> connected clients.</p>
|
||||||
|
<p>In Reply-to mode, setting <code>msg.reset = true</code> will reset the connection
|
||||||
|
specified by _session.id, or all connections if no _session.id is specified.</p>
|
||||||
<p><b>Note: </b>On some systems you may need root or administrator access
|
<p><b>Note: </b>On some systems you may need root or administrator access
|
||||||
to access ports below 1024.</p>
|
to access ports below 1024.</p>
|
||||||
</script>
|
</script>
|
||||||
@@ -40,6 +42,8 @@
|
|||||||
returned characters into a fixed buffer, match a specified character before returning,
|
returned characters into a fixed buffer, match a specified character before returning,
|
||||||
wait a fixed timeout from first reply and then return, sit and wait for data, or send then close the connection
|
wait a fixed timeout from first reply and then return, sit and wait for data, or send then close the connection
|
||||||
immediately, without waiting for a reply.</p>
|
immediately, without waiting for a reply.</p>
|
||||||
|
<p>If in sit and wait mode (remain connected) you can send <code>msg.reset = true</code> or <code>msg.reset = "host:port"</code> to force a break in
|
||||||
|
the connection and an automatic reconnection.</p>
|
||||||
<p>The response will be output in <code>msg.payload</code> as a buffer, so you may want to .toString() it.</p>
|
<p>The response will be output in <code>msg.payload</code> as a buffer, so you may want to .toString() it.</p>
|
||||||
<p>If you leave tcp host or port blank they must be set by using the <code>msg.host</code> and <code>msg.port</code> properties in every message sent to the node.</p>
|
<p>If you leave tcp host or port blank they must be set by using the <code>msg.host</code> and <code>msg.port</code> properties in every message sent to the node.</p>
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@node-red/nodes",
|
"name": "@node-red/nodes",
|
||||||
"version": "3.1.2",
|
"version": "4.0.0-dev",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
@@ -264,7 +264,7 @@ async function installModule(moduleDetails) {
|
|||||||
"module": moduleDetails.module,
|
"module": moduleDetails.module,
|
||||||
"version": moduleDetails.version,
|
"version": moduleDetails.version,
|
||||||
"dir": installDir,
|
"dir": installDir,
|
||||||
"args": ["--production","--engine-strict"]
|
"args": ["--omit=dev","--engine-strict"]
|
||||||
}
|
}
|
||||||
return hooks.trigger("preInstall", triggerPayload).then((result) => {
|
return hooks.trigger("preInstall", triggerPayload).then((result) => {
|
||||||
// preInstall passed
|
// preInstall passed
|
||||||
|
|||||||
@@ -215,7 +215,7 @@ async function installModule(module,version,url) {
|
|||||||
"dir": installDir,
|
"dir": installDir,
|
||||||
"isExisting": isExisting,
|
"isExisting": isExisting,
|
||||||
"isUpgrade": isUpgrade,
|
"isUpgrade": isUpgrade,
|
||||||
"args": ['--no-audit','--no-update-notifier','--no-fund','--save','--save-prefix=~','--production','--engine-strict']
|
"args": ['--no-audit','--no-update-notifier','--no-fund','--save','--save-prefix=~','--omit=dev','--engine-strict']
|
||||||
}
|
}
|
||||||
|
|
||||||
return hooks.trigger("preInstall", triggerPayload).then((result) => {
|
return hooks.trigger("preInstall", triggerPayload).then((result) => {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@node-red/registry",
|
"name": "@node-red/registry",
|
||||||
"version": "3.1.2",
|
"version": "4.0.0-dev",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"main": "./lib/index.js",
|
"main": "./lib/index.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@node-red/util": "3.1.2",
|
"@node-red/util": "4.0.0-dev",
|
||||||
"clone": "2.1.2",
|
"clone": "2.1.2",
|
||||||
"fs-extra": "11.1.1",
|
"fs-extra": "11.1.1",
|
||||||
"semver": "7.5.4",
|
"semver": "7.5.4",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@node-red/runtime",
|
"name": "@node-red/runtime",
|
||||||
"version": "3.1.2",
|
"version": "4.0.0-dev",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"main": "./lib/index.js",
|
"main": "./lib/index.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -16,8 +16,8 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@node-red/registry": "3.1.2",
|
"@node-red/registry": "4.0.0-dev",
|
||||||
"@node-red/util": "3.1.2",
|
"@node-red/util": "4.0.0-dev",
|
||||||
"async-mutex": "0.4.0",
|
"async-mutex": "0.4.0",
|
||||||
"clone": "2.1.2",
|
"clone": "2.1.2",
|
||||||
"express": "4.18.2",
|
"express": "4.18.2",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@node-red/util",
|
"name": "@node-red/util",
|
||||||
"version": "3.1.2",
|
"version": "4.0.0-dev",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
10
packages/node_modules/node-red/package.json
vendored
10
packages/node_modules/node-red/package.json
vendored
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "node-red",
|
"name": "node-red",
|
||||||
"version": "3.1.2",
|
"version": "4.0.0-dev",
|
||||||
"description": "Low-code programming for event-driven applications",
|
"description": "Low-code programming for event-driven applications",
|
||||||
"homepage": "https://nodered.org",
|
"homepage": "https://nodered.org",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
@@ -31,10 +31,10 @@
|
|||||||
"flow"
|
"flow"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@node-red/editor-api": "3.1.2",
|
"@node-red/editor-api": "4.0.0-dev",
|
||||||
"@node-red/runtime": "3.1.2",
|
"@node-red/runtime": "4.0.0-dev",
|
||||||
"@node-red/util": "3.1.2",
|
"@node-red/util": "4.0.0-dev",
|
||||||
"@node-red/nodes": "3.1.2",
|
"@node-red/nodes": "4.0.0-dev",
|
||||||
"basic-auth": "2.0.1",
|
"basic-auth": "2.0.1",
|
||||||
"bcryptjs": "2.4.3",
|
"bcryptjs": "2.4.3",
|
||||||
"express": "4.18.2",
|
"express": "4.18.2",
|
||||||
|
|||||||
9
packages/node_modules/node-red/red.js
vendored
9
packages/node_modules/node-red/red.js
vendored
@@ -26,6 +26,15 @@ if (process.argv[2] === 'admin') {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var node_ver = parseInt(process.version.split('.')[0].substring(1));
|
||||||
|
var node_rqd = parseInt((require('./package.json').engines.node || "0").match(/\d+/).join(''));
|
||||||
|
if (node_ver < node_rqd) {
|
||||||
|
console.log("This version of Node-RED requires Node.js version",node_rqd,"as a minimum.");
|
||||||
|
console.log("Please upgrade your Node.js version and restart.")
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
// else { console.log(node_ver,">=",node_rqd,"- OK")}
|
||||||
|
|
||||||
var http = require('http');
|
var http = require('http');
|
||||||
var https = require('https');
|
var https = require('https');
|
||||||
var util = require("util");
|
var util = require("util");
|
||||||
|
|||||||
4
packages/node_modules/node-red/settings.js
vendored
4
packages/node_modules/node-red/settings.js
vendored
@@ -449,6 +449,7 @@ module.exports = {
|
|||||||
* - ui (for use with Node-RED Dashboard)
|
* - ui (for use with Node-RED Dashboard)
|
||||||
* - debugUseColors
|
* - debugUseColors
|
||||||
* - debugMaxLength
|
* - debugMaxLength
|
||||||
|
* - debugStatusLength
|
||||||
* - execMaxBufferSize
|
* - execMaxBufferSize
|
||||||
* - httpRequestTimeout
|
* - httpRequestTimeout
|
||||||
* - mqttReconnectTime
|
* - mqttReconnectTime
|
||||||
@@ -504,6 +505,9 @@ module.exports = {
|
|||||||
/** The maximum length, in characters, of any message sent to the debug sidebar tab */
|
/** The maximum length, in characters, of any message sent to the debug sidebar tab */
|
||||||
debugMaxLength: 1000,
|
debugMaxLength: 1000,
|
||||||
|
|
||||||
|
/** The maximum length, in characters, of status messages under the debug node */
|
||||||
|
//debugStatusLength: 32,
|
||||||
|
|
||||||
/** Maximum buffer size for the exec node. Defaults to 10Mb */
|
/** Maximum buffer size for the exec node. Defaults to 10Mb */
|
||||||
//execMaxBufferSize: 10000000,
|
//execMaxBufferSize: 10000000,
|
||||||
|
|
||||||
|
|||||||
@@ -1718,9 +1718,13 @@ describe('function node', function() {
|
|||||||
describe("init function", function() {
|
describe("init function", function() {
|
||||||
|
|
||||||
it('should delay handling messages until init completes', function(done) {
|
it('should delay handling messages until init completes', function(done) {
|
||||||
|
const timeoutMS = 200;
|
||||||
|
// Since helper.load uses process.nextTick timers might occasionally finish
|
||||||
|
// a couple of milliseconds too early, so give some leeway to the check.
|
||||||
|
const timeoutCheckMargin = 5;
|
||||||
var flow = [{id:"n1",type:"function",wires:[["n2"]],initialize: `
|
var flow = [{id:"n1",type:"function",wires:[["n2"]],initialize: `
|
||||||
return new Promise((resolve,reject) => {
|
return new Promise((resolve,reject) => {
|
||||||
setTimeout(resolve,200)
|
setTimeout(resolve, ${timeoutMS});
|
||||||
})`,
|
})`,
|
||||||
func:"return msg;"
|
func:"return msg;"
|
||||||
},
|
},
|
||||||
@@ -1733,9 +1737,10 @@ describe('function node', function() {
|
|||||||
msg.delta = Date.now() - msg.payload;
|
msg.delta = Date.now() - msg.payload;
|
||||||
receivedMsgs.push(msg)
|
receivedMsgs.push(msg)
|
||||||
if (receivedMsgs.length === 5) {
|
if (receivedMsgs.length === 5) {
|
||||||
var errors = receivedMsgs.filter(msg => msg.delta < 200)
|
let deltas = receivedMsgs.map(msg => msg.delta);
|
||||||
|
var errors = deltas.filter(delta => delta < (timeoutMS - timeoutCheckMargin))
|
||||||
if (errors.length > 0) {
|
if (errors.length > 0) {
|
||||||
done(new Error(`Message received before init completed - was ${msg.delta} expected >300`))
|
done(new Error(`Message received before init completed - delta values ${JSON.stringify(deltas)} expected to be > ${timeoutMS - timeoutCheckMargin}`))
|
||||||
} else {
|
} else {
|
||||||
done();
|
done();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user