node-red 2.2.1 → 3.0.0-beta.2

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/CHANGELOG.md CHANGED
@@ -1,3 +1,122 @@
1
+ #### 3.0.0-beta.2: Beta Release
2
+
3
+ **Migration from 2.x**
4
+
5
+ - The 'slice wires' action has changed from Ctrl-RightMouseButton to Alt-LeftMouseButton
6
+
7
+ Editor
8
+
9
+ - Rework Junctions to be more node like in their event handling (#3607) @knolleary
10
+ - Change slicing / slice-junction operations over to mouse button 0 (Left Mouse Button) (#3609) @Steve-Mcl
11
+ - Do not slice-junction link node wires (#3608) @knolleary
12
+ - Handle many-to-one slicing of wires (#3604) @knolleary
13
+ - Ensure ACE worker options are set (#3611) @Steve-Mcl
14
+ - Remove duplicate history add of ungroup event (#3605) @knolleary
15
+ - use text width instead of number of characters for deciding select fi… (#3603) @HiroyasuNishiyama
16
+ - Update Japanese info of link call node reflecting update of English info (#3600) @HiroyasuNishiyama
17
+ - Fix typedInput label not visible on themes (#3580) @bonanitech
18
+ - Fix project switching when junctions are present (#3595) @Steve-Mcl
19
+ - Fix junction: when wiring from a regular nodes INPUT, backwards to a junction (#3591) @Steve-Mcl
20
+ - Fix error initialising flow tab editor (#3585) @Steve-Mcl
21
+ - Add Japanese translations for v3.0-beta.1 (#3576) @kazuhitoyokoi
22
+ - Fix image paths where `red/image/typedInput/XXXX.png` should be `red/image/typedInput/XXXX.svg` (#3592) @kazuhitoyokoi
23
+ - Fix browser console error Uncaught TypeError when searching certain terms (#3584) @Steve-Mcl
24
+
25
+ Runtime
26
+
27
+ - fix error on system-info action (#3589) @HiroyasuNishiyama
28
+
29
+ Nodes
30
+
31
+ - I18n switch rule selector (#3602) @HiroyasuNishiyama
32
+ - Handle removal of event handlers to allow mqtt client.end() to work (#3594) @PhilDay-CT
33
+ - update link-call node info according to current behavior (#3597) @HiroyasuNishiyama
34
+
35
+
36
+ #### 3.0.0-beta.1: Beta Release
37
+
38
+ **Migration from 2.x**
39
+
40
+ - Node-RED now requires Node.js 14.x or later.
41
+ - New installs of Node-RED will default to the monaco editor.
42
+
43
+
44
+ Editor
45
+
46
+ - Add Junctions (#3462) @knolleary
47
+ - Allow node name to be auto-generated when added (#3478, #3538) @knolleary
48
+ - Set monaco as default code editor as of v3.x (#3543) @Steve-Mcl
49
+ - Update Monaco to V0.33.0 (#3522) @Steve-Mcl
50
+ - Auto-complete Improvements (#3521) @Steve-Mcl
51
+ - Add a tooltip to debug sidebar messages to reveal full path to node (#3503) @knolleary
52
+ - Fix down arrow triggering menu in search box (#3507) @Steve-Mcl
53
+ - Add Japanese translations for v3.0 (#3512) @kazuhitoyokoi
54
+ - Add feature: Continuous search tools (search previous, search next) (#3405) @Steve-Mcl
55
+ - Add feature: split-wire-to-links (#3399, #3476) @Steve-Mcl
56
+ - Add copy button to node properties tables (#3390) @knolleary
57
+ - Add info-tab search options dropdown to the regular search (#3395) @Steve-Mcl
58
+ - New Feature: Add ability to find modified nodes/flows. (#3392) @Steve-Mcl
59
+ - Code editor ux improvements around remembering state of each code editor in a flow (#3553) @Steve-Mcl
60
+ - Make it easier to apply themes on SVG icons (#3515) @bonanitech
61
+ - Add support of property validation message (#3438) @HiroyasuNishiyama
62
+ - Ensure node validation tooltip is closed when field becomes valid (#3570) @knolleary
63
+ - Add "search for" buttons to notifications (#3567) @Steve-Mcl
64
+ - Don't let themes change node config colors (#3564) @bonanitech
65
+ - Fix gap between typedInput containers borders (#3560) @bonanitech
66
+ - Fix recording removed links in edit history (#3547) @knolleary
67
+ - Remove unused SASS vars (#3536) @bonanitech
68
+ - Add custom style for jQuery widgets borders (#3537) @bonanitech
69
+ - fix out of scope reference of hasUnusedConfig variable (#3535) @HiroyasuNishiyama
70
+ - correct "non string" check parenthesis (#3524) @Steve-Mcl
71
+ - Ensure i18n of scoped package name (#3516) @Steve-Mcl
72
+ - Prevent shortcut deploy when deploy button shaded (#3517) @Steve-Mcl
73
+ - Fix: Sidebar "Configuration" filter button tooltip (#3500) @ralphwetzel
74
+ - Add the ability to customize diff colors even more (#3499) @bonanitech
75
+ - Do JSON comparison of old value/new value in editor (#3481) @Steve-Mcl
76
+ - Fix nodes losing their wires when in an iframe (#3484) @zettca
77
+ - Improve scroll into view (#3468) @Steve-Mcl
78
+ - Do not show 1st tab if hidden when loading (#3464) @Steve-Mcl
79
+
80
+ Runtime
81
+
82
+ - Fix importing external module from node-red module (#3541) @knolleary
83
+ - Add support for multiple static paths with optional static root (#3542) @Steve-Mcl
84
+ - Store external token when authenticating if provided (#3460) @ArFe
85
+ - Support OAuth/OpenID logout (#3388) @mw75
86
+ - Allow adminAuth to auto-login users when using passport strategy (#3519) @knolleary
87
+ - Add runtime diagnostics admin endpoint (#3511) @Steve-Mcl
88
+ - Don't start if user has no home directory (#3540) @hardillb
89
+ - Error on invalid encrypted credentials (#3498) @sammachin
90
+
91
+ Nodes
92
+
93
+ - Debug: Add message count option to Debug status (#3544 #3551) @rafaelmuynarsk @knolleary
94
+ - File: Change basic Filename field to a typedInput (#3533) @Steve-Mcl
95
+ - HTTP Request: Add UI for Http Request node headers (#3488) @Steve-Mcl
96
+ - Inject: let inject optionally fire at start in only at time mode. (#3385) @dceejay
97
+ - Link Call: Dynamic link call (#3463) @Steve-Mcl
98
+ - Link Call: Display link targets of nodes in a regular flow, for Link Call nodes inside a subflow (#3528) @Steve-Mcl
99
+ - MQTT: MQTT payload auto parsing improvements (#3530) @Steve-Mcl
100
+ - MQTT: Add client and Runtime MQTT topic validation (#3563) @Steve-Mcl [dev]
101
+ - MQTT: save and restore v5 config user props (#3562) @Steve-Mcl
102
+ - MQTT: Fix incorrect MQTT status (#3552) @Steve-Mcl
103
+ - MQTT: fix reference error of msg.status in debug node (#3526) @HiroyasuNishiyama
104
+ - MQTT: Add unit tests for MQTT nodes (#3497) @Steve-Mcl
105
+ - MQTT: fix typo of will properties (#3502) @Steve-Mcl
106
+ - MQTT: ensure mqtt v5 props can be set false (#3472) @Steve-Mcl
107
+ - Switch: add check for NaN in is of type number to be false (#3409) @dceejay
108
+ - TCP: TCP node better split (#3465) @dceejay
109
+ - Watch: Update Watch node to use node-watch module (#3559 #3569) @knolleary
110
+ - WebSocket: call done after ws disconnects (#3531) @Steve-Mcl
111
+
112
+
113
+ #### 2.2.2: Maintenance Release
114
+
115
+ Nodes
116
+
117
+ - Fix "close timed out" error when performing full deploy or modifying broker node. (#3451) @Steve-Mcl
118
+
119
+
1
120
  #### 2.2.1: Maintenance Release
2
121
 
3
122
  Editor
package/lib/red.js CHANGED
@@ -229,5 +229,12 @@ module.exports = {
229
229
  * @see @node-red/editor-api_auth
230
230
  * @memberof node-red
231
231
  */
232
- auth: api.auth
232
+ auth: api.auth,
233
+
234
+ /**
235
+ * The editor authentication api.
236
+ * @see @node-red/editor-api_auth
237
+ * @memberof node-red
238
+ */
239
+ get diagnostics() { return api.diagnostics }
233
240
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red",
3
- "version": "2.2.1",
3
+ "version": "3.0.0-beta.2",
4
4
  "description": "Low-code programming for event-driven applications",
5
5
  "homepage": "http://nodered.org",
6
6
  "license": "Apache-2.0",
@@ -31,22 +31,22 @@
31
31
  "flow"
32
32
  ],
33
33
  "dependencies": {
34
- "@node-red/editor-api": "2.2.1",
35
- "@node-red/runtime": "2.2.1",
36
- "@node-red/util": "2.2.1",
37
- "@node-red/nodes": "2.2.1",
34
+ "@node-red/editor-api": "3.0.0-beta.2",
35
+ "@node-red/runtime": "3.0.0-beta.2",
36
+ "@node-red/util": "3.0.0-beta.2",
37
+ "@node-red/nodes": "3.0.0-beta.2",
38
38
  "basic-auth": "2.0.1",
39
39
  "bcryptjs": "2.4.3",
40
- "express": "4.17.2",
41
- "fs-extra": "10.0.0",
42
- "node-red-admin": "^2.2.3",
40
+ "express": "4.18.1",
41
+ "fs-extra": "10.1.0",
42
+ "node-red-admin": "^3.0.0",
43
43
  "nopt": "5.0.0",
44
- "semver": "7.3.5"
44
+ "semver": "7.3.7"
45
45
  },
46
46
  "optionalDependencies": {
47
47
  "bcrypt": "5.0.1"
48
48
  },
49
49
  "engines": {
50
- "node": ">=12"
50
+ "node": ">=14"
51
51
  }
52
52
  }
package/red.js CHANGED
@@ -112,6 +112,10 @@ if (parsedArgs.settings) {
112
112
  // Consider compatibility for older versions
113
113
  settingsFile = path.join(process.env.HOMEPATH,".node-red","settings.js");
114
114
  } else {
115
+ if (!parsedArgs.userDir && !(process.env.HOME || process.env.USERPROFILE || process.env.HOMEPATH)) {
116
+ console.log("Could not find user directory. Ensure $HOME is set for the current user, or use --userDir option")
117
+ process.exit(1)
118
+ }
115
119
  var userDir = parsedArgs.userDir || path.join(process.env.HOME || process.env.USERPROFILE || process.env.HOMEPATH,".node-red");
116
120
  var userSettingsFile = path.join(userDir,"settings.js");
117
121
  if (fs.existsSync(userSettingsFile)) {
@@ -298,6 +302,26 @@ httpsPromise.then(function(startupHttps) {
298
302
  settings.httpNodeAuth = settings.httpNodeAuth || settings.httpAuth;
299
303
  }
300
304
 
305
+ if(settings.httpStatic) {
306
+ settings.httpStaticRoot = formatRoot(settings.httpStaticRoot || "/");
307
+ const statics = Array.isArray(settings.httpStatic) ? settings.httpStatic : [settings.httpStatic];
308
+ const sanitised = [];
309
+ for (let si = 0; si < statics.length; si++) {
310
+ let sp = statics[si];
311
+ if(typeof sp === "string") {
312
+ sp = { path: sp, root: "" }
313
+ sanitised.push(sp);
314
+ } else if (typeof sp === "object" && sp.path ) {
315
+ sanitised.push(sp);
316
+ } else {
317
+ continue;
318
+ }
319
+ sp.subRoot = formatRoot(sp.root);
320
+ sp.root = formatRoot(path.posix.join(settings.httpStaticRoot,sp.subRoot));
321
+ }
322
+ settings.httpStatic = sanitised.length ? sanitised : false;
323
+ }
324
+
301
325
  // if we got a port from command line, use it (even if 0)
302
326
  // replicate (settings.uiPort = parsedArgs.port||settings.uiPort||1880;) but allow zero
303
327
  if (parsedArgs.port !== undefined){
@@ -390,12 +414,28 @@ httpsPromise.then(function(startupHttps) {
390
414
  if (settings.httpNodeRoot !== false) {
391
415
  app.use(settings.httpNodeRoot,RED.httpNode);
392
416
  }
417
+ // if (settings.httpStatic) {
418
+ // settings.httpStaticAuth = settings.httpStaticAuth || settings.httpAuth;
419
+ // if (settings.httpStaticAuth) {
420
+ // app.use("/",basicAuthMiddleware(settings.httpStaticAuth.user,settings.httpStaticAuth.pass));
421
+ // }
422
+ // app.use("/",express.static(settings.httpStatic));
423
+ // }
393
424
  if (settings.httpStatic) {
394
- settings.httpStaticAuth = settings.httpStaticAuth || settings.httpAuth;
395
- if (settings.httpStaticAuth) {
396
- app.use("/",basicAuthMiddleware(settings.httpStaticAuth.user,settings.httpStaticAuth.pass));
425
+ let appUseMem = {};
426
+ for (let si = 0; si < settings.httpStatic.length; si++) {
427
+ const sp = settings.httpStatic[si];
428
+ const filePath = sp.path;
429
+ const thisRoot = sp.root || "/";
430
+ if(appUseMem[filePath + "::" + thisRoot]) {
431
+ continue;// this path and root already registered!
432
+ }
433
+ appUseMem[filePath + "::" + thisRoot] = true;
434
+ if (settings.httpStaticAuth) {
435
+ app.use(thisRoot, basicAuthMiddleware(settings.httpStaticAuth.user, settings.httpStaticAuth.pass));
436
+ }
437
+ app.use(thisRoot, express.static(filePath));
397
438
  }
398
- app.use("/",express.static(settings.httpStatic));
399
439
  }
400
440
 
401
441
  function getListenPath() {
package/settings.js CHANGED
@@ -137,6 +137,7 @@ module.exports = {
137
137
  * - httpNodeCors
138
138
  * - httpNodeMiddleware
139
139
  * - httpStatic
140
+ * - httpStaticRoot
140
141
  ******************************************************************************/
141
142
 
142
143
  /** the tcp port that the Node-RED web server is listening on */
@@ -218,12 +219,30 @@ module.exports = {
218
219
  /** When httpAdminRoot is used to move the UI to a different root path, the
219
220
  * following property can be used to identify a directory of static content
220
221
  * that should be served at http://localhost:1880/.
222
+ * When httpStaticRoot is set differently to httpAdminRoot, there is no need
223
+ * to move httpAdminRoot
221
224
  */
222
- //httpStatic: '/home/nol/node-red-static/',
225
+ //httpStatic: '/home/nol/node-red-static/', //single static source
226
+ /* OR multiple static sources can be created using an array of objects... */
227
+ //httpStatic: [
228
+ // {path: '/home/nol/pics/', root: "/img/"},
229
+ // {path: '/home/nol/reports/', root: "/doc/"},
230
+ //],
231
+
232
+ /**
233
+ * All static routes will be appended to httpStaticRoot
234
+ * e.g. if httpStatic = "/home/nol/docs" and httpStaticRoot = "/static/"
235
+ * then "/home/nol/docs" will be served at "/static/"
236
+ * e.g. if httpStatic = [{path: '/home/nol/pics/', root: "/img/"}]
237
+ * and httpStaticRoot = "/static/"
238
+ * then "/home/nol/pics/" will be served at "/static/img/"
239
+ */
240
+ //httpStaticRoot: '/static/',
223
241
 
224
242
  /*******************************************************************************
225
243
  * Runtime Settings
226
244
  * - lang
245
+ * - diagnostics
227
246
  * - logging
228
247
  * - contextStorage
229
248
  * - exportGlobalContextKeys
@@ -236,6 +255,19 @@ module.exports = {
236
255
  */
237
256
  // lang: "de",
238
257
 
258
+ /** Configure diagnostics options
259
+ * - enabled: When `enabled` is `true` (or unset), diagnostics data will
260
+ * be available at http://localhost:1880/diagnostics
261
+ * - ui: When `ui` is `true` (or unset), the action `show-system-info` will
262
+ * be available to logged in users of node-red editor
263
+ */
264
+ diagnostics: {
265
+ /** enable or disable diagnostics endpoint. Must be set to `false` to disable */
266
+ enabled: true,
267
+ /** enable or disable diagnostics display in the node-red editor. Must be set to `false` to disable */
268
+ ui: true,
269
+ },
270
+
239
271
  /** Configure the logging output */
240
272
  logging: {
241
273
  /** Only console logging is currently supported */
@@ -359,9 +391,9 @@ module.exports = {
359
391
 
360
392
  codeEditor: {
361
393
  /** Select the text editor component used by the editor.
362
- * Defaults to "ace", but can be set to "ace" or "monaco"
394
+ * As of Node-RED V3, this defaults to "monaco", but can be set to "ace" if desired
363
395
  */
364
- lib: "ace",
396
+ lib: "monaco",
365
397
  options: {
366
398
  /** The follow options only apply if the editor is set to "monaco"
367
399
  *
@@ -371,7 +403,7 @@ module.exports = {
371
403
  */
372
404
  theme: "vs",
373
405
  /** other overrides can be set e.g. fontSize, fontFamily, fontLigatures etc.
374
- * for the full list, see https://microsoft.github.io/monaco-editor/api/interfaces/monaco.editor.istandaloneeditorconstructionoptions.html
406
+ * for the full list, see https://microsoft.github.io/monaco-editor/api/interfaces/monaco.editor.IStandaloneEditorConstructionOptions.html
375
407
  */
376
408
  //fontSize: 14,
377
409
  //fontFamily: "Cascadia Code, Fira Code, Consolas, 'Courier New', monospace",