Move node registry to its own top level dir

This commit is contained in:
Nick O'Leary
2018-04-26 12:32:05 +01:00
parent 5866d414ce
commit 11d87205d7
63 changed files with 674 additions and 584 deletions

View File

@@ -16,10 +16,11 @@
var when = require("when");
var clone = require("clone");
var typeRegistry = require("../registry");
var typeRegistry = require("../../../runtime-registry");
var Log;
var redUtil = require("../../util");
var flowUtil = require("./util");
var Node;
var nodeCloseTimeout = 15000;
@@ -292,6 +293,7 @@ function Flow(global,flow) {
function createNode(type,config) {
var nn = null;
try {
var nt = typeRegistry.get(type);
if (nt) {
var conf = clone(config);
@@ -315,6 +317,9 @@ function createNode(type,config) {
} else {
Log.error(Log._("nodes.flow.unknown-type", {type:type}));
}
} catch(err) {
Log.error(err);
}
return nn;
}
@@ -498,6 +503,7 @@ module.exports = {
init: function(runtime) {
nodeCloseTimeout = runtime.settings.nodeCloseTimeout || 15000;
Log = runtime.log;
Node = require("../Node");
},
create: function(global,conf) {
return new Flow(global,conf);

View File

@@ -19,7 +19,10 @@ var when = require("when");
var Flow = require('./Flow');
var typeRegistry = require("../registry");
var typeRegistry = require("../../../runtime-registry");
var deprecated = typeRegistry.deprecated;
var context = require("../context")
var credentials = require("../credentials");
@@ -27,7 +30,6 @@ var flowUtil = require("./util");
var log;
var events = require("../../events");
var redUtil = require("../../util");
var deprecated = require("../registry/deprecated");
var storage = null;
var settings = null;

View File

@@ -16,7 +16,7 @@
var clone = require("clone");
var redUtil = require("../../util");
var subflowInstanceRE = /^subflow:(.+)$/;
var typeRegistry = require("../registry");
var typeRegistry = require("../../../runtime-registry");
function diffNodes(oldNode,newNode) {
if (oldNode == null) {
@@ -203,7 +203,7 @@ module.exports = {
var linkMap = {};
var changedTabs = {};
// Look for tabs that have been removed
for (id in oldConfig.flows) {
if (oldConfig.flows.hasOwnProperty(id) && (!newConfig.flows.hasOwnProperty(id))) {