Socket
Socket
Sign inDemoInstall

@node-red/runtime

Package Overview
Dependencies
76
Maintainers
2
Versions
104
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.3.5 to 2.0.0-beta.1

15

lib/api/settings.js

@@ -39,3 +39,11 @@ /**

if (target.hasOwnProperty(keys[i])) {
target[keys[i]] = extend(target[keys[i]],value);
// Target property exists. Need to handle the case
// where the existing property is a string/number/boolean
// and is being replaced wholesale.
var targetType = typeof target[keys[i]];
if (targetType === 'string' || targetType === 'number' || targetType === 'boolean') {
target[keys[i]] = value;
} else {
target[keys[i]] = extend(target[keys[i]],value);
}
} else {

@@ -85,2 +93,7 @@ target[keys[i]] = value;

safeSettings.context = runtime.nodes.listContextStores();
if (runtime.settings.editorTheme && runtime.settings.editorTheme.codeEditor) {
safeSettings.codeEditor = runtime.settings.editorTheme.codeEditor || {};
safeSettings.codeEditor.lib = safeSettings.codeEditor.lib || "ace";
safeSettings.codeEditor.options = safeSettings.codeEditor.options || {};
}
safeSettings.libraries = runtime.library.getLibraries();

@@ -87,0 +100,0 @@ if (util.isArray(runtime.settings.paletteCategories)) {

6

lib/flows/Flow.js

@@ -22,3 +22,3 @@ /**

const context = require('../nodes/context');
const hooks = require("../hooks");
const hooks = require("@node-red/util").hooks;

@@ -373,3 +373,3 @@ var Subflow;

// console.log((new Error().stack).toString().split("\n").slice(1,3).join("\n"))
if ((this.flow.configs && this.flow.configs[id]) || (this.flow.nodes && this.flow.nodes[id])) {
if ((this.flow.configs && this.flow.configs[id]) || (this.flow.nodes && this.flow.nodes[id] && this.flow.nodes[id].type.substring(0,8) != "subflow:")) {
// This is a node owned by this flow, so return whatever we have got

@@ -379,3 +379,3 @@ // During a stop/restart, activeNodes could be null for this id

} else if (this.activeNodes[id]) {
// TEMP: this is a subflow internal node within this flow
// TEMP: this is a subflow internal node within this flow or subflow instance node
return this.activeNodes[id];

@@ -382,0 +382,0 @@ } else if (this.subflowInstanceNodes[id]) {

@@ -700,3 +700,5 @@ /**

nodes.forEach(function(n) {
n.z = id;
if (n.type !== 'tab') {
n.z = id;
}
});

@@ -703,0 +705,0 @@ }

@@ -113,3 +113,3 @@ /**

case "number": nodePropType = "num"; break;
case "boolean": nodePropType = "bool"; nodePropValue = nodeProp?"true":"false"; break;
case "boolean": nodePropType = "bool"; nodePropValue == nodeProp?"true":"false"; break;
default:

@@ -116,0 +116,0 @@ nodePropType = config[nodeProp.name].type;

@@ -23,3 +23,2 @@ /*!

var library = require("./library");
var hooks = require("./hooks");
var plugins = require("./plugins");

@@ -33,3 +32,3 @@ var settings = require("./settings");

const {log,i18n,events,exec,util} = require("@node-red/util");
const {log,i18n,events,exec,util,hooks} = require("@node-red/util");

@@ -207,2 +206,5 @@ var runtimeMetricInterval = null;

}
if (settings.httpRoot !== undefined) {
log.warn(log._("server.deprecatedOption",{old:"httpRoot", new: "httpNodeRoot/httpAdminRoot"}));
}
if (settings.httpStatic) {

@@ -209,0 +211,0 @@ log.info(log._("runtime.paths.httpStatic",{path:path.resolve(settings.httpStatic)}));

@@ -218,2 +218,18 @@ /**

function validateContextKey(key) {
try {
const keys = Array.isArray(key) ? key : [key];
if(!keys.length) { return false }; //no key to get/set
for (let index = 0; index < keys.length; index++) {
const k = keys[index];
if (typeof k !== "string" || !k.length) {
return false; //not string or zero-length
}
}
} catch (error) {
return false;
}
return true;
}
function createContext(id,seed,parent) {

@@ -255,2 +271,3 @@ // Seed is only set for global context - sourced from functionGlobalContext

}
Object.defineProperties(obj, {

@@ -260,3 +277,2 @@ get: {

var context;
if (!callback && typeof storage === 'function') {

@@ -269,3 +285,10 @@ callback = storage;

}
if (!validateContextKey(key)) {
var err = Error("Invalid context key");
if(callback) {
return callback(err);
} else {
throw err;
}
}
if (!Array.isArray(key)) {

@@ -344,3 +367,2 @@ var keyParts = util.parseContextStore(key);

var context;
if (!callback && typeof storage === 'function') {

@@ -353,3 +375,10 @@ callback = storage;

}
if (!validateContextKey(key)) {
var err = Error("Invalid context key");
if(callback) {
return callback(err);
} else {
throw err;
}
}
if (!Array.isArray(key)) {

@@ -356,0 +385,0 @@ var keyParts = util.parseContextStore(key);

@@ -24,3 +24,3 @@ /**

var flows = require("../flows");
const hooks = require("../hooks");
const hooks = require("@node-red/util").hooks;

@@ -342,3 +342,4 @@

if (promises.length > 0) {
return Promise.all(promises).then(function() {
return Promise.all(promises).then(() => {
this.removeAllListeners("input")
if (this._context) {

@@ -349,2 +350,3 @@ return context.delete(this._alias||this.id,this.z);

} else {
this.removeAllListeners("input")
if (this._context) {

@@ -351,0 +353,0 @@ return context.delete(this._alias||this.id,this.z);

@@ -294,3 +294,3 @@ /**

}
var m = /^(.*): (.*)$/.exec(l);
var m = /^(.*?): (.*)$/.exec(l);
if (m) {

@@ -297,0 +297,0 @@ // git 2.1.4 (Debian Stable) doesn't support %D for refs - so filter out

@@ -41,2 +41,4 @@ /**

var usingHostName = false;
function init(_settings, _runtime) {

@@ -81,2 +83,3 @@ settings = _settings;

flowsFullPath = fspath.join(settings.userDir,flowsFile);
usingHostName = true;
}

@@ -531,3 +534,3 @@ var ffExt = fspath.extname(flowsFullPath);

}
if (activeProject) {

@@ -547,2 +550,3 @@ // At this point activeProject will be a string, so go load it and

}
if (usingHostName) { log.warn(log._("storage.localfilesystem.warn_name")) };
log.info(log._("storage.localfilesystem.flows-file",{path:flowsFullPath}));

@@ -549,0 +553,0 @@ }

@@ -37,2 +37,3 @@ {

"install-failed-url": "$t(server.install.install-failed-long) invalid url: __url__",
"post-install-error": "Error running 'postInstall' hook:",
"upgrading": "Upgrading module: __name__ to version: __version__",

@@ -46,3 +47,3 @@ "upgraded": "Upgraded module: __name__. Restart Node-RED to use the new version",

},
"deprecatedOption": "Use of __old__ is deprecated. Use __new__ instead",
"deprecatedOption": "Use of __old__ is DEPRECATED. Use __new__ instead",
"unable-to-listen": "Unable to listen on __listenpath__",

@@ -55,3 +56,3 @@ "port-in-use": "Error: port in use",

"headless-mode": "Running in headless mode",
"httpadminauth-deprecated": "use of httpAdminAuth is deprecated. Use adminAuth instead",
"httpadminauth-deprecated": "Use of httpAdminAuth is DEPRECATED. Use adminAuth instead",
"https": {

@@ -165,2 +166,3 @@ "refresh-interval": "Refreshing https settings every __interval__ hours",

"fsync-fail": "Flushing file __path__ to disk failed : __message__",
"warn_name": "Flows file name not set. Generating name using hostname.",
"projects": {

@@ -167,0 +169,0 @@ "changing-project": "Setting active project : __project__",

{
"name": "@node-red/runtime",
"version": "1.3.5",
"version": "2.0.0-beta.1",
"license": "Apache-2.0",

@@ -19,10 +19,10 @@ "main": "./lib/index.js",

"dependencies": {
"@node-red/registry": "1.3.5",
"@node-red/util": "1.3.5",
"@node-red/registry": "2.0.0-beta.1",
"@node-red/util": "2.0.0-beta.1",
"async-mutex": "0.3.1",
"clone": "2.1.2",
"express": "4.17.1",
"fs-extra": "8.1.0",
"fs-extra": "10.0.0",
"json-stringify-safe": "5.0.1"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc