@node-red/runtime 4.1.0-beta.2 → 4.1.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.
package/lib/flows/Flow.js CHANGED
@@ -268,6 +268,9 @@ class Flow {
268
268
  try {
269
269
  var subflowDefinition = this.flow.subflows[node.subflow]||this.global.subflows[node.subflow]
270
270
  // console.log("NEED TO CREATE A SUBFLOW",id,node.subflow);
271
+ // Ensure the path property is set on the instance node so NR_SUBFLOW_PATH env is evaluated properly
272
+ Object.defineProperty(node,'_path', {value: `${this.path}/${node._alias||node.id}`, enumerable: false, writable: true })
273
+
271
274
  this.subflowInstanceNodes[id] = true;
272
275
  var subflow = Subflow.create(
273
276
  this,
package/lib/flows/util.js CHANGED
@@ -229,7 +229,11 @@ async function createNode(flow,config) {
229
229
  instanceConfig.env = nodeTypeConstructor.subflow.env.map(nodeProp => {
230
230
  var nodePropType;
231
231
  var nodePropValue = config[nodeProp.name];
232
- if (nodeProp.type === "cred") {
232
+ if (nodeProp.ui?.type === "conf-types" && /^\${[^}]+}$/.test(nodePropValue)) {
233
+ const valName = nodePropValue.substring(2, nodePropValue.length - 1);
234
+ nodePropValue = flow.getSetting(valName)
235
+ nodePropType = "conf-type";
236
+ } else if (nodeProp.type === "cred") {
233
237
  nodePropType = "cred";
234
238
  } else {
235
239
  switch(typeof config[nodeProp.name]) {
@@ -172,9 +172,10 @@ function installModule(module,version,url) {
172
172
  if (info.pending_version) {
173
173
  events.emit("runtime-event",{id:"node/upgraded",retain:false,payload:{module:info.name,version:info.pending_version}});
174
174
  } else {
175
- if (!info.nodes.length && info.plugins.length) {
175
+ if (info.plugins.length) {
176
176
  events.emit("runtime-event",{id:"plugin/added",retain:false,payload:info.plugins});
177
- } else {
177
+ }
178
+ if (info.nodes.length) {
178
179
  events.emit("runtime-event",{id:"node/added",retain:false,payload:info.nodes});
179
180
  }
180
181
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@node-red/runtime",
3
- "version": "4.1.0-beta.2",
3
+ "version": "4.1.1",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./lib/index.js",
6
6
  "repository": {
@@ -16,13 +16,14 @@
16
16
  }
17
17
  ],
18
18
  "dependencies": {
19
- "@node-red/registry": "4.1.0-beta.2",
20
- "@node-red/util": "4.1.0-beta.2",
19
+ "@node-red/registry": "4.1.1",
20
+ "@node-red/util": "4.1.1",
21
21
  "async-mutex": "0.5.0",
22
22
  "clone": "2.1.2",
23
23
  "cronosjs": "1.7.1",
24
24
  "express": "4.21.2",
25
25
  "fs-extra": "11.3.0",
26
+ "got": "12.6.1",
26
27
  "json-stringify-safe": "5.0.1",
27
28
  "rfdc": "^1.3.1",
28
29
  "semver": "7.7.1"