node-red-contrib-mobius-flow-base 3.0.0-rc.5 → 3.0.0-rc.7

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/README.md CHANGED
@@ -1,19 +1,47 @@
1
1
  # node-red-contrib-mobius-flow-base
2
2
 
3
- Copyright 2016 [iaconnects](http://www.iaconnects.co.uk).
3
+ Copyright 2023 [MobiusFlow](https://mobiusflow.com/).
4
4
 
5
- [Node-RED](http://nodered.org) nodes to interact with MOBiUSFlow.
6
-
7
- This module currently requires access to the iaconnects private NPM repository.
5
+ [Node-RED](http://nodered.org) nodes to interact with MobiusFlow.
8
6
 
9
7
  ## Nodes
10
8
 
11
- ### Service Config Node
12
- All nodes require a connection to a MOBiUS hub. The `mobius service` node takes a service ID as a property and creates a shared connection to the hub. All other nodes use this shared connection.
9
+ ### Connection Config Node
10
+ All nodes require a connection to a MobiusFlow Engine. The `mobius connection` config nodes connectes to the MobiusFlow Engine API via http / https
13
11
 
14
12
  ### Set Resource Node
15
13
  Sets the value of, or clears, the specified priority of resource.
16
14
 
15
+ ### Set Multi-Resource Node
16
+ Sets the value of multiple resources on a given object at once
17
+
18
+ ### Send BCMD Node
19
+ Sends a MobiusFlow broadcast command
20
+
21
+ ### Send DCMD Node
22
+ Send a MobiusFlow direct command to a specified MobiusFlow service
23
+
24
+ ### Get Multi-Resource Node
25
+ Get multiple resource at once
26
+
27
+ ### Get Multi-Object Node
28
+ Get mutliple objects at once
29
+
30
+ ### MobiusFlow Inject Node
31
+ Subscribe to change of value on a defined set of objects. Change events injected in MobiusFlow format.
32
+
33
+ ### Filter Object By Rid Value Node
34
+ Return a filtered list of objects based on a defined filtering function and resource.
35
+
36
+ ### Discover Node
37
+ Discover live MobiusFlow: Hubs, Services, Profiles, Objects and Resources
38
+
39
+ ### Discover Object List
40
+ Discover live objects from a pre-defined set of potentially wildcarded URIs
41
+
42
+ ### Change Admin Password
43
+ Change the password of the administator account of the MobiusFlow Engine
44
+
17
45
  ### Get Resource Node
18
46
  Reads the current `pv` or present value of a resource.
19
47
 
@@ -27,4 +55,5 @@ Clears the specified priority of resource.
27
55
  Subscribe to change of value events for an object
28
56
 
29
57
  ### Resource COV Node
30
- Subscribe to change of value events for a resource
58
+ Subscribe to change of value events for a resource
59
+
@@ -389,20 +389,23 @@ function getMobsearch(mobiusSrvc, useRid, listed, opts) {
389
389
  uri = uri.substring(0, uri.indexOf('#') + 1);
390
390
  }
391
391
  if (listed) {
392
- // opts.list[selectionIndex].uri = uri;
393
- tempList = JSON.parse(JSON.stringify(opts.list));
394
- tempList[selectionIndex].uri = uri;
392
+ tempList = JSON.parse(JSON.stringify(opts.list)); // Pre List
393
+ if (tempList.length === selectionIndex) {
394
+ tempList.push({uri, type: 'unknown'})
395
+ } else {
396
+ tempList[selectionIndex].uri = uri;
397
+ }
395
398
  updateList();
396
- opts.list = JSON.parse(JSON.stringify(tempList));
399
+ opts.list = JSON.parse(JSON.stringify(tempList)); // Set log
397
400
  } else {
398
401
  $(`#${opts.uriFieldName}`).val(uri);
399
402
  document.getElementById(opts.uriFieldName).dispatchEvent(new Event('change'));
403
+ $(`#${opts.searchButtonId}`).removeClass('disabled');
400
404
  }
401
405
  $('#node-search-accept').css('color', '#CCCCCC');
402
406
  readyToAccept = false;
403
407
  $('#node-search-return').addClass('disabled');
404
408
  $('#node-search-accept').addClass('disabled');
405
- $(`#${opts.searchButtonId}`).removeClass('disabled');
406
409
  $('#instance-search-row').hide();
407
410
  $('#instance-row').show();
408
411
  }
@@ -66,7 +66,8 @@ POSSIBILITY OF SUCH DAMAGE.
66
66
  name: {value:""},
67
67
  detailedOutput: {value:false},
68
68
  resource: {value:"", validate:function(v) {
69
- return (new RegExp(`^(([0-9A-Fa-f]{6}|(\\+))/(([0-9A-Fa-f]{3}|(\\+))/(([0-9A-Fa-f]{4}|(\\+))/(([0-9A-Fa-f]{4}|(\\+))/([0-9A-Fa-f]{2}|(\\#))|#)|#)|#)|#)$`)).test(v);
69
+ if (v === '') return true;
70
+ return (new RegExp(`^[0-9A-Fa-f]{6}/[0-9A-Fa-f]{3}/[0-9A-Fa-f]{4}/[0-9A-Fa-f]{4}/[0-9A-Fa-f]{2}$`)).test(v);
70
71
  }},
71
72
  priority: {value:15, type: 'Number', validate:function(v) { return (v > 0 && v < 16) }},
72
73
  connection: {type:"mobius connection", required:true},
@@ -106,6 +107,7 @@ POSSIBILITY OF SUCH DAMAGE.
106
107
  htmlElementId: 'mobsearch',
107
108
  uriFieldName: 'node-input-resource',
108
109
  searchButtonId: 'node-lookup-instance',
110
+ removeWildcards: true,
109
111
  };
110
112
  initMobsearch.toRid(mobiusSrvc, opts);
111
113
  },
@@ -76,19 +76,8 @@ POSSIBILITY OF SUCH DAMAGE.
76
76
  service: {
77
77
  value: '',
78
78
  validate: function (v) {
79
- if (v === '') {
80
- return true;
81
- }
82
- let parts = v.split('/');
83
- for (let lp = 0; lp < parts.length; lp++) {
84
- if (parts[lp] === null || parts[lp] === '') {
85
- return false;
86
- }
87
- }
88
- if (parts.length === 2) {
89
- return true;
90
- }
91
- return false;
79
+ if (v === '') return true;
80
+ return (new RegExp(`^[0-9A-Fa-f]{6}/[0-9A-Fa-f]{3}$`)).test(v);
92
81
  },
93
82
  },
94
83
  connection: { type: 'mobius connection', required: true },
@@ -74,7 +74,8 @@ POSSIBILITY OF SUCH DAMAGE.
74
74
  detailedOutput: {value:false},
75
75
  format: {value: "name", required: true},
76
76
  mobject: {value: "", validate:function(v) {
77
- return (new RegExp(`^(([0-9A-Fa-f]{6}|(\\+))/(([0-9A-Fa-f]{3}|(\\+))/(([0-9A-Fa-f]{4}|(\\+))/(([0-9A-Fa-f]{4})|#)|#)|#)|#)$`)).test(v);
77
+ if (v === '') return true;
78
+ return (new RegExp(`^[0-9A-Fa-f]{6}/[0-9A-Fa-f]{3}/[0-9A-Fa-f]{4}/[0-9A-Fa-f]{4}$`)).test(v);
78
79
  }},
79
80
  connection: {type: "mobius connection", required: true},
80
81
  outputs: {value:1},
@@ -111,6 +112,7 @@ POSSIBILITY OF SUCH DAMAGE.
111
112
  htmlElementId: 'mobsearch',
112
113
  uriFieldName: 'node-input-mobject',
113
114
  searchButtonId: 'node-lookup-instance',
115
+ removeWildcards: true,
114
116
  };
115
117
  initMobsearch.toIns(mobiusSrvc, opts);
116
118
  },
@@ -67,7 +67,8 @@ POSSIBILITY OF SUCH DAMAGE.
67
67
  name: {value:""},
68
68
  detailedOutput: {value:false},
69
69
  resource: {value:"", validate:function(v) {
70
- return (new RegExp(`^(([0-9A-Fa-f]{6}|(\\+))/(([0-9A-Fa-f]{3}|(\\+))/(([0-9A-Fa-f]{4}|(\\+))/(([0-9A-Fa-f]{4}|(\\+))/([0-9A-Fa-f]{2}|(\\#))|#)|#)|#)|#)$`)).test(v);
70
+ if (v === '') return true;
71
+ return (new RegExp(`^[0-9A-Fa-f]{6}/[0-9A-Fa-f]{3}/[0-9A-Fa-f]{4}/[0-9A-Fa-f]{4}/[0-9A-Fa-f]{2}$`)).test(v);
71
72
  }},
72
73
  connection: {type:"mobius connection", required: true},
73
74
  outputs: {value:2},
@@ -104,6 +105,7 @@ POSSIBILITY OF SUCH DAMAGE.
104
105
  htmlElementId: 'mobsearch',
105
106
  uriFieldName: 'node-input-resource',
106
107
  searchButtonId: 'node-lookup-instance',
108
+ removeWildcards: true,
107
109
  };
108
110
  initMobsearch.toRid(mobiusSrvc, opts);
109
111
 
@@ -82,6 +82,7 @@ POSSIBILITY OF SUCH DAMAGE.
82
82
  format: {value: "name", required: true},
83
83
  include: {value: "changed", required: true},
84
84
  object: {value:"", validate:function(v) {
85
+ if (v === '') return true;
85
86
  return (new RegExp(`^(([0-9A-Fa-f]{6}|(\\+))/(([0-9A-Fa-f]{3}|(\\+))/(([0-9A-Fa-f]{4}|(\\+))/(([0-9A-Fa-f]{4})|#)|#)|#)|#)$`)).test(v);
86
87
  }},
87
88
  connection: {type:"mobius connection", required:true},
@@ -63,6 +63,7 @@ POSSIBILITY OF SUCH DAMAGE.
63
63
  name: {value:""},
64
64
  detailedOutput: {value:false},
65
65
  resource: {value:"", required:true, validate:function(v) {
66
+ if (v === '') return true;
66
67
  return (new RegExp(`^(([0-9A-Fa-f]{6}|(\\+))/(([0-9A-Fa-f]{3}|(\\+))/(([0-9A-Fa-f]{4}|(\\+))/(([0-9A-Fa-f]{4}|(\\+))/([0-9A-Fa-f]{2}|(\\#))|#)|#)|#)|#)$`)).test(v);
67
68
  }},
68
69
  connection: {type:"mobius connection", required:true},
@@ -63,7 +63,8 @@ POSSIBILITY OF SUCH DAMAGE.
63
63
  name: {value:""},
64
64
  detailedOutput: {value:false},
65
65
  mobject: {value: "", validate:function(v) {
66
- return (new RegExp(`^(([0-9A-Fa-f]{6}|(\\+))/(([0-9A-Fa-f]{3}|(\\+))/(([0-9A-Fa-f]{4}|(\\+))/(([0-9A-Fa-f]{4})|#)|#)|#)|#)$`)).test(v);
66
+ if (v === '') return true;
67
+ return (new RegExp(`^[0-9A-Fa-f]{6}/[0-9A-Fa-f]{3}/[0-9A-Fa-f]{4}/[0-9A-Fa-f]{4}$`)).test(v);
67
68
  }},
68
69
  connection: {type:"mobius connection", required:true},
69
70
  outputs: {value:2},
@@ -68,7 +68,8 @@ POSSIBILITY OF SUCH DAMAGE.
68
68
  name: {value:""},
69
69
  detailedOutput: {value:false},
70
70
  resource: {value:"", validate:function(v) {
71
- return (new RegExp(`^(([0-9A-Fa-f]{6}|(\\+))/(([0-9A-Fa-f]{3}|(\\+))/(([0-9A-Fa-f]{4}|(\\+))/(([0-9A-Fa-f]{4}|(\\+))/([0-9A-Fa-f]{2}|(\\#))|#)|#)|#)|#)$`)).test(v);
71
+ if (v === '') return true;
72
+ return (new RegExp(`^[0-9A-Fa-f]{6}/[0-9A-Fa-f]{3}/[0-9A-Fa-f]{4}/[0-9A-Fa-f]{4}/[0-9A-Fa-f]{2}$`)).test(v);
72
73
  }},
73
74
  priority: {value:15, type: 'Number', validate:function(v) { return (v > 0 && v < 16) }},
74
75
  connection: {type:"mobius connection", required:true},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-mobius-flow-base",
3
- "version": "3.0.0-rc.5",
3
+ "version": "3.0.0-rc.7",
4
4
  "description": "Node-RED base nodes for Mobius Flow",
5
5
  "main": "index.js",
6
6
  "types": "dist/index.d.ts",