@node-red/runtime 4.0.0-beta.4 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,6 @@
1
1
  const flowUtil = require("./util");
2
2
  const credentials = require("../nodes/credentials");
3
+ const clone = require("clone");
3
4
 
4
5
  /**
5
6
  * This class represents a group within the runtime.
@@ -462,9 +462,8 @@ function stop(type,diff,muteLog,isDeploy) {
462
462
  if (type === 'nodes') {
463
463
  stopList = diff.changed.concat(diff.removed);
464
464
  } else if (type === 'flows') {
465
- stopList = diff.changed.concat(diff.removed).concat(diff.linked);
465
+ stopList = diff.changed.concat(diff.removed).concat(diff.linked).concat(diff.rewired);
466
466
  }
467
-
468
467
  events.emit("flows:stopping",{config: activeConfig, type: type, diff: diff})
469
468
 
470
469
  // Stop the global flow object last
@@ -646,16 +645,27 @@ function getFlow(id) {
646
645
  if (id !== 'global') {
647
646
  result.nodes = [];
648
647
  }
648
+
649
+ if (flow.groups) {
650
+ var nodeIds = Object.keys(flow.groups);
651
+ if (nodeIds.length > 0) {
652
+ nodeIds.forEach(function(nodeId) {
653
+ var node = jsonClone(flow.groups[nodeId]);
654
+ delete node.credentials;
655
+ result.nodes.push(node)
656
+ })
657
+ }
658
+ }
649
659
  if (flow.nodes) {
650
660
  var nodeIds = Object.keys(flow.nodes);
651
661
  if (nodeIds.length > 0) {
652
- result.nodes = nodeIds.map(function(nodeId) {
662
+ nodeIds.forEach(function(nodeId) {
653
663
  var node = jsonClone(flow.nodes[nodeId]);
654
664
  if (node.type === 'link out') {
655
665
  delete node.wires;
656
666
  }
657
667
  delete node.credentials;
658
- return node;
668
+ result.nodes.push(node)
659
669
  })
660
670
  }
661
671
  }
@@ -681,6 +691,17 @@ function getFlow(id) {
681
691
  delete node.credentials
682
692
  return node
683
693
  });
694
+ if (subflow.groups) {
695
+ var nodeIds = Object.keys(subflow.groups);
696
+ if (nodeIds.length > 0) {
697
+ nodeIds.forEach(function(nodeId) {
698
+ var node = jsonClone(subflow.groups[nodeId]);
699
+ delete node.credentials;
700
+ subflow.nodes.push(node)
701
+ })
702
+ }
703
+ delete subflow.groups
704
+ }
684
705
  if (subflow.configs) {
685
706
  var configIds = Object.keys(subflow.configs);
686
707
  subflow.configs = configIds.map(function(id) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@node-red/runtime",
3
- "version": "4.0.0-beta.4",
3
+ "version": "4.0.1",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./lib/index.js",
6
6
  "repository": {
@@ -16,8 +16,8 @@
16
16
  }
17
17
  ],
18
18
  "dependencies": {
19
- "@node-red/registry": "4.0.0-beta.4",
20
- "@node-red/util": "4.0.0-beta.4",
19
+ "@node-red/registry": "4.0.1",
20
+ "@node-red/util": "4.0.1",
21
21
  "async-mutex": "0.5.0",
22
22
  "clone": "2.1.2",
23
23
  "express": "4.19.2",