node-red-contrib-mobius-flow-base 3.2.0 → 3.3.0

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.
@@ -24,7 +24,10 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24
24
  POSSIBILITY OF SUCH DAMAGE.
25
25
  -->
26
26
 
27
- <script type="text/x-red" data-template-name="mobius get multi-object">
27
+ <script
28
+ type="text/x-red"
29
+ data-template-name="mobius get multi-object"
30
+ >
28
31
  <div class="form-row">
29
32
  <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
30
33
  <input type="text" id="node-input-name" placeholder="Name">
@@ -48,84 +51,96 @@ POSSIBILITY OF SUCH DAMAGE.
48
51
  RED.nodes.registerType('mobius get multi-object', {
49
52
  category: 'mobius',
50
53
  defaults: {
51
- name: {value:""},
52
- mobjects: {value:[{uri: '', comment: ''}]},
53
- connection: {type:"mobius connection", required:true}
54
+ name: { value: '' },
55
+ mobjects: { value: [{ uri: '', comment: '' }] },
56
+ connection: { type: 'mobius connection', required: true },
54
57
  },
55
- color:"#9ee3fa",
56
- inputs:1,
57
- outputs:1,
58
- outputLabels: ["MOBiUS objects"],
59
- icon: "mobius.png",
60
- align: "left",
58
+ color: '#9ee3fa',
59
+ inputs: 1,
60
+ outputs: 1,
61
+ outputLabels: ['MOBiUS objects'],
62
+ icon: 'mobius.png',
63
+ align: 'left',
61
64
  paletteLabel: 'get multi-object',
62
- label: function() {
63
- if(this.name) {
65
+ label: function () {
66
+ if (this.name) {
64
67
  return this.name;
65
68
  } else {
66
- return "get multi-object";
69
+ return 'get multi-object';
67
70
  }
68
71
  },
69
- labelStyle: function() {
70
- return this.name ? "node_label_italic":"";
72
+ labelStyle: function () {
73
+ return this.name ? 'node_label_italic' : '';
71
74
  },
72
75
  oneditprepare: function () {
73
76
  var node = this;
74
- let mobiusSrvc = $("#node-input-connection").val();
77
+ let mobiusSrvc = $('#node-input-connection').val();
75
78
 
76
79
  /** Resize a object when it has changed */
77
- function resizeObject (mobject) {
80
+ function resizeObject(mobject) {
78
81
  let newWidth = mobject.width();
79
- mobject.find(".node-input-mobject-comment").width(newWidth - 300);
82
+ mobject.find('.node-input-mobject-comment').width(newWidth - 300);
80
83
  }
81
84
 
82
85
  /** Create the objects container and populate it */
83
- $('#node-input-mobjects-container').css('min-height', '300px').css('min-width', '450px').editableList ({
84
- addButton: "add",
85
- removable: true,
86
- sortable: true,
87
- addItem: function (container, i, mobject) {
88
- container.css({
89
- overflow: 'hidden',
90
- whiteSpace: 'nowrap'
91
- });
92
-
93
- // Add a default resource if it does not exist
94
- if (!mobject.hasOwnProperty("uri")) {
95
- mobject = {uri: '', comment: ''};
96
- }
97
-
98
- var row = $('<div>URI</div>').appendTo(container);
99
- var uriField = $('<input/>',{class: "node-input-mobject-uri", type: "text", style: "width: 200px; margin-left: 5px; text-align: left;"}).appendTo(row);
100
-
101
- // *** MOBSEARCH *** //
102
- var searchField = $('<a class="searchbutton" style="margin-left: 5px; vertical-align: middle"><i id="node-lookup-instance-icon" class="fa fa-search"></i></a>').appendTo(row);
103
- // *** END MOBSEARCH *** //
104
-
105
- row.append('&nbsp;&nbsp;-&nbsp;');
106
- var commentField = $('<input/>',{class: "node-input-mobject-comment", type: "text", style: "width: 35%; margin-left: 5px; text-align: left;"}).appendTo(row);
107
-
108
- // Populate the new stat
109
- uriField.val(mobject.uri);
110
- commentField.val(mobject.comment);
111
- // resizeObject(container);
112
-
113
- // *** MOBSEARCH *** //
114
-
115
- if (!node.mobjects[i]) {
116
- node.mobjects[i] = {uri: '', comment: ''}
117
- }
118
-
119
- addMobsearchListButton(mobiusSrvc, searchField, i, mobsearchOpts)
120
- // *** END MOBSEARCH *** //
121
-
122
- },
123
- // resizeItem: resizeObject
124
- });
86
+ $('#node-input-mobjects-container')
87
+ .css('min-height', '300px')
88
+ .css('min-width', '450px')
89
+ .editableList({
90
+ addButton: 'add',
91
+ removable: true,
92
+ sortable: true,
93
+ addItem: function (container, i, mobject) {
94
+ container.css({
95
+ overflow: 'hidden',
96
+ whiteSpace: 'nowrap',
97
+ });
98
+
99
+ // Add a default resource if it does not exist
100
+ if (!mobject.hasOwnProperty('uri')) {
101
+ mobject = { uri: '', comment: '' };
102
+ }
103
+
104
+ var row = $('<div>URI</div>').appendTo(container);
105
+ var uriField = $('<input/>', {
106
+ class: 'node-input-mobject-uri',
107
+ type: 'text',
108
+ style: 'width: 200px; margin-left: 5px; text-align: left;',
109
+ }).appendTo(row);
110
+
111
+ // *** MOBSEARCH *** //
112
+ var searchField = $(
113
+ '<a class="searchbutton" style="margin-left: 5px; vertical-align: middle"><i id="node-lookup-instance-icon" class="fa fa-search"></i></a>'
114
+ ).appendTo(row);
115
+ // *** END MOBSEARCH *** //
116
+
117
+ row.append('&nbsp;&nbsp;-&nbsp;');
118
+ var commentField = $('<input/>', {
119
+ class: 'node-input-mobject-comment',
120
+ type: 'text',
121
+ style: 'width: 35%; margin-left: 5px; text-align: left;',
122
+ }).appendTo(row);
123
+
124
+ // Populate the new stat
125
+ uriField.val(mobject.uri);
126
+ commentField.val(mobject.comment);
127
+ // resizeObject(container);
128
+
129
+ // *** MOBSEARCH *** //
130
+
131
+ if (!node.mobjects[i]) {
132
+ node.mobjects[i] = { uri: '', comment: '' };
133
+ }
134
+
135
+ addMobsearchListButton(mobiusSrvc, searchField, i, mobsearchOpts);
136
+ // *** END MOBSEARCH *** //
137
+ },
138
+ // resizeItem: resizeObject
139
+ });
125
140
 
126
141
  // If no mobjects exists, create a default one
127
142
  if (!node.mobjects) {
128
- node.mobjects = [mobject = {uri: '', comment: ''}];
143
+ node.mobjects = [(mobject = { uri: '', comment: '' })];
129
144
  }
130
145
 
131
146
  // *** MOBSEARCH *** //
@@ -136,43 +151,50 @@ POSSIBILITY OF SUCH DAMAGE.
136
151
  containerRowName: 'node-input-mobjects-container-row',
137
152
  containerName: 'node-input-mobjects-container',
138
153
  containerSecondFieldName: 'node-input-mobject-comment',
154
+ removeWildcards: true,
139
155
  };
140
156
  initMobsearch.toIns_listed(mobiusSrvc, mobsearchOpts);
141
157
 
142
158
  // *** END MOBSEARCH *** //
143
-
159
+
144
160
  // Populate list with all saved filters
145
161
  for (let i = 0; i < node.mobjects.length; i++) {
146
162
  let mobject = node.mobjects[i];
147
- $("#node-input-mobjects-container").editableList('addItem', mobject);
163
+ $('#node-input-mobjects-container').editableList('addItem', mobject);
148
164
  }
149
165
  },
150
166
  oneditresize(size) {
151
- var rows = $("#dialog-form>div:not(.node-input-mobjects-container-row)");
167
+ var rows = $('#dialog-form>div:not(.node-input-mobjects-container-row)');
152
168
  var height = size.height;
153
- for (var i=0; i<rows.size(); i++) {
169
+ for (var i = 0; i < rows.size(); i++) {
154
170
  height -= $(rows[i]).outerHeight(true);
155
171
  }
156
- var editorRow = $("#dialog-form>div.node-input-mobjects-container-row");
157
- height -= 4 * ((parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom"))));
172
+ var editorRow = $('#dialog-form>div.node-input-mobjects-container-row');
173
+ height -=
174
+ 4 *
175
+ (parseInt(editorRow.css('marginTop')) +
176
+ parseInt(editorRow.css('marginBottom')));
158
177
 
159
- $("#node-input-mobjects-container").editableList('height',height);
178
+ $('#node-input-mobjects-container').editableList('height', height);
160
179
  },
161
- oneditsave: function() {
162
- let mobjects = $("#node-input-mobjects-container").editableList('items');
180
+ oneditsave: function () {
181
+ let mobjects = $('#node-input-mobjects-container').editableList('items');
163
182
  let node = this;
164
- node.mobjects= [];
183
+ node.mobjects = [];
165
184
  mobjects.each(function (i) {
166
185
  let mobject = $(this);
167
- let uri = mobject.find(".node-input-mobject-uri").val();
168
- let comment = mobject.find(".node-input-mobject-comment").val();
169
- node.mobjects.push({uri: uri, comment: comment});
186
+ let uri = mobject.find('.node-input-mobject-uri').val();
187
+ let comment = mobject.find('.node-input-mobject-comment').val();
188
+ node.mobjects.push({ uri: uri, comment: comment });
170
189
  });
171
- }
190
+ },
172
191
  });
173
192
  </script>
174
193
 
175
- <script type="text/x-red" data-help-name="mobius get multi-object">
194
+ <script
195
+ type="text/x-red"
196
+ data-help-name="mobius get multi-object"
197
+ >
176
198
  <p>Read multiple MOBiUS object values.</p>
177
199
 
178
200
  <h3>Configuration Page</h3>
@@ -34,6 +34,10 @@ module.exports = function (RED) {
34
34
  this.serviceConn = RED.nodes.getNode(n.connection);
35
35
  var node = this;
36
36
 
37
+ const uriValidTest = new RegExp(
38
+ `^[0-9A-Fa-f]{6}/[0-9A-Fa-f]{3}/[0-9A-Fa-f]{4}/[0-9A-Fa-f]{4}$`
39
+ );
40
+
37
41
  if (node.serviceConn) {
38
42
  node.status({
39
43
  fill: 'red',
@@ -51,11 +55,11 @@ module.exports = function (RED) {
51
55
  });
52
56
 
53
57
  for (const mobject of node.mobjects) {
54
- if (!validateResourceURI(mobject.uri)) {
58
+ if (!uriValidTest.test(mobject.uri)) {
55
59
  node.status({
56
60
  fill: 'yellow',
57
61
  shape: 'dot',
58
- text: 'URIs not Valid',
62
+ text: 'Error: URIs not Valid',
59
63
  });
60
64
  if (done) {
61
65
  return done();
@@ -79,12 +83,24 @@ module.exports = function (RED) {
79
83
  node.status({
80
84
  fill: 'yellow',
81
85
  shape: 'dot',
82
- text: `Error: ${err.code ? err.code : 'Unknown'}`,
86
+ text: (() => {
87
+ if (err.response.status === 404) {
88
+ return `Error: One or more objects not found`;
89
+ } else {
90
+ return `Error: ${err.code ? err.code : 'Unknown'}`;
91
+ }
92
+ })(),
83
93
  });
84
94
  node.error(
85
- `Mobius error reading object: ${
86
- err.code ? err.code : 'Unknown'
87
- }, ${err.message ? err.message : ''}`
95
+ (() => {
96
+ if (err.response.status === 404) {
97
+ return `Error: One or more objects not found`;
98
+ } else {
99
+ return `Error: ${err.code ? err.code : 'Unknown'}, ${
100
+ err.message ? err.message : ''
101
+ }`;
102
+ }
103
+ })()
88
104
  );
89
105
  })
90
106
  .finally(() => {
@@ -102,19 +118,6 @@ module.exports = function (RED) {
102
118
  }
103
119
  }
104
120
 
105
- function validateResourceURI(uri) {
106
- let parts = uri.split('/');
107
- for (let lp = 0; lp < parts.length; lp++) {
108
- if (parts[lp] === null || parts[lp] === '') {
109
- return false;
110
- }
111
- }
112
- if (parts.length === 4) {
113
- return true;
114
- }
115
- return false;
116
- }
117
-
118
121
  function readObject(node, uri) {
119
122
  return new Promise((resolve, reject) => {
120
123
  node.serviceConn.readObject(uri, (err, response) => {
@@ -24,7 +24,10 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24
24
  POSSIBILITY OF SUCH DAMAGE.
25
25
  -->
26
26
 
27
- <script type="text/x-red" data-template-name="mobius get multi-resource">
27
+ <script
28
+ type="text/x-red"
29
+ data-template-name="mobius get multi-resource"
30
+ >
28
31
  <div class="form-row">
29
32
  <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
30
33
  <input type="text" id="node-input-name" placeholder="Name">
@@ -55,84 +58,96 @@ POSSIBILITY OF SUCH DAMAGE.
55
58
  RED.nodes.registerType('mobius get multi-resource', {
56
59
  category: 'mobius',
57
60
  defaults: {
58
- name: {value:""},
59
- send: {value: "array", required: true},
60
- resources: {value:[{uri: '', comment: ''}]},
61
- connection: {type:"mobius connection", required:true}
61
+ name: { value: '' },
62
+ send: { value: 'array', required: true },
63
+ resources: { value: [{ uri: '', comment: '' }] },
64
+ connection: { type: 'mobius connection', required: true },
62
65
  },
63
- color:"#9ee3fa",
64
- inputs:1,
65
- outputs:1,
66
- outputLabels: ["MOBiUS resources"],
67
- icon: "mobius.png",
68
- align: "left",
66
+ color: '#9ee3fa',
67
+ inputs: 1,
68
+ outputs: 1,
69
+ outputLabels: ['MOBiUS resources'],
70
+ icon: 'mobius.png',
71
+ align: 'left',
69
72
  paletteLabel: 'get multi-resource',
70
- label: function() {
71
- if(this.name) {
73
+ label: function () {
74
+ if (this.name) {
72
75
  return this.name;
73
76
  } else {
74
- return "get multi-resource";
77
+ return 'get multi-resource';
75
78
  }
76
79
  },
77
- labelStyle: function() {
78
- return this.name ? "node_label_italic":"";
80
+ labelStyle: function () {
81
+ return this.name ? 'node_label_italic' : '';
79
82
  },
80
83
  oneditprepare: function () {
81
84
  var node = this;
82
- let mobiusSrvc = $("#node-input-connection").val();
85
+ let mobiusSrvc = $('#node-input-connection').val();
83
86
 
84
87
  /** Resize a resource when it has changed */
85
- function resizeResource (resource) {
88
+ function resizeResource(resource) {
86
89
  let newWidth = resource.width();
87
- resource.find(".node-input-resource-comment").width(newWidth - 270);
90
+ resource.find('.node-input-resource-comment').width(newWidth - 270);
88
91
  }
89
92
 
90
93
  /** Create the subs container and populate it */
91
- $('#node-input-resources-container').css('min-height', '300px').css('min-width', '450px').editableList ({
92
- addButton: "add",
93
- removable: true,
94
- sortable: true,
95
- addItem: function (container, i, resource) {
96
- container.css({
97
- overflow: 'hidden',
98
- whiteSpace: 'nowrap'
99
- });
100
-
101
- // Add a default resource if it does not exist
102
- if (!resource.hasOwnProperty("uri")) {
103
- resource = {uri: '', comment: ''};
104
- }
105
-
106
- var row = $('<div>URI</div>').appendTo(container);
107
- var uriField = $('<input/>',{class: "node-input-resource-uri", type: "text", style: "width: 200px; margin-left: 5px; text-align: left;"}).appendTo(row);
108
-
109
- // *** MOBSEARCH *** //
110
- var searchField = $('<a class="searchbutton" style="margin-left: 5px; vertical-align: middle"><i id="node-lookup-instance-icon" class="fa fa-search"></i></a>').appendTo(row);
111
-
112
- // *** END MOBSEARCH *** //
113
-
114
- row.append('&nbsp;&nbsp;-&nbsp;');
115
- var commentField = $('<input/>',{class: "node-input-resource-comment", type: "text", style: "width: 35%; margin-left: 5px; text-align: left;"}).appendTo(row);
116
-
117
- // Populate the new stat
118
- uriField.val(resource.uri);
119
- commentField.val(resource.comment);
120
- //resizeResource(container);
121
-
122
- // *** MOBSEARCH *** //
123
- if (!node.resources[i]) {
124
- node.resources[i] = {uri: '', comment: ''}
125
- }
126
- addMobsearchListButton(mobiusSrvc, searchField, i, mobsearchOpts)
127
- // *** END MOBSEARCH *** //
128
-
129
- },
130
- // resizeItem: resizeResource
131
- });
94
+ $('#node-input-resources-container')
95
+ .css('min-height', '300px')
96
+ .css('min-width', '450px')
97
+ .editableList({
98
+ addButton: 'add',
99
+ removable: true,
100
+ sortable: true,
101
+ addItem: function (container, i, resource) {
102
+ container.css({
103
+ overflow: 'hidden',
104
+ whiteSpace: 'nowrap',
105
+ });
106
+
107
+ // Add a default resource if it does not exist
108
+ if (!resource.hasOwnProperty('uri')) {
109
+ resource = { uri: '', comment: '' };
110
+ }
111
+
112
+ var row = $('<div>URI</div>').appendTo(container);
113
+ var uriField = $('<input/>', {
114
+ class: 'node-input-resource-uri',
115
+ type: 'text',
116
+ style: 'width: 200px; margin-left: 5px; text-align: left;',
117
+ }).appendTo(row);
118
+
119
+ // *** MOBSEARCH *** //
120
+ var searchField = $(
121
+ '<a class="searchbutton" style="margin-left: 5px; vertical-align: middle"><i id="node-lookup-instance-icon" class="fa fa-search"></i></a>'
122
+ ).appendTo(row);
123
+
124
+ // *** END MOBSEARCH *** //
125
+
126
+ row.append('&nbsp;&nbsp;-&nbsp;');
127
+ var commentField = $('<input/>', {
128
+ class: 'node-input-resource-comment',
129
+ type: 'text',
130
+ style: 'width: 35%; margin-left: 5px; text-align: left;',
131
+ }).appendTo(row);
132
+
133
+ // Populate the new stat
134
+ uriField.val(resource.uri);
135
+ commentField.val(resource.comment);
136
+ //resizeResource(container);
137
+
138
+ // *** MOBSEARCH *** //
139
+ if (!node.resources[i]) {
140
+ node.resources[i] = { uri: '', comment: '' };
141
+ }
142
+ addMobsearchListButton(mobiusSrvc, searchField, i, mobsearchOpts);
143
+ // *** END MOBSEARCH *** //
144
+ },
145
+ // resizeItem: resizeResource
146
+ });
132
147
 
133
148
  // If no stat exists, create a default one
134
149
  if (!node.resources) {
135
- node.resources = [resource = {uri: '', comment: ''}];
150
+ node.resources = [(resource = { uri: '', comment: '' })];
136
151
  }
137
152
 
138
153
  // *** MOBSEARCH *** //
@@ -143,6 +158,7 @@ POSSIBILITY OF SUCH DAMAGE.
143
158
  containerRowName: 'node-input-resources-container-row',
144
159
  containerName: 'node-input-resources-container',
145
160
  containerSecondFieldName: 'node-input-resources-comment',
161
+ removeWildcards: true,
146
162
  };
147
163
  initMobsearch.toRid_listed(mobiusSrvc, mobsearchOpts);
148
164
 
@@ -151,35 +167,43 @@ POSSIBILITY OF SUCH DAMAGE.
151
167
  // Populate list with all saved filters
152
168
  for (let i = 0; i < node.resources.length; i++) {
153
169
  let resource = node.resources[i];
154
- $("#node-input-resources-container").editableList('addItem', resource);
170
+ $('#node-input-resources-container').editableList('addItem', resource);
155
171
  }
156
172
  },
157
173
  oneditresize(size) {
158
- var rows = $("#dialog-form>div:not(.node-input-resources-container-row)");
174
+ var rows = $('#dialog-form>div:not(.node-input-resources-container-row)');
159
175
  var height = size.height;
160
- for (var i=0; i<rows.size(); i++) {
176
+ for (var i = 0; i < rows.size(); i++) {
161
177
  height -= $(rows[i]).outerHeight(true);
162
178
  }
163
- var editorRow = $("#dialog-form>div.node-input-resources-container-row");
164
- height -= 4 * ((parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom"))));
179
+ var editorRow = $('#dialog-form>div.node-input-resources-container-row');
180
+ height -=
181
+ 4 *
182
+ (parseInt(editorRow.css('marginTop')) +
183
+ parseInt(editorRow.css('marginBottom')));
165
184
 
166
- $("#node-input-resources-container").editableList('height',height);
185
+ $('#node-input-resources-container').editableList('height', height);
167
186
  },
168
- oneditsave: function() {
169
- let resources = $("#node-input-resources-container").editableList('items');
187
+ oneditsave: function () {
188
+ let resources = $('#node-input-resources-container').editableList(
189
+ 'items'
190
+ );
170
191
  let node = this;
171
- node.resources= [];
192
+ node.resources = [];
172
193
  resources.each(function (i) {
173
194
  var resource = $(this);
174
- let uri = resource.find(".node-input-resource-uri").val();
175
- let comment = resource.find(".node-input-resource-comment").val();
176
- node.resources.push({uri: uri, comment: comment});
195
+ let uri = resource.find('.node-input-resource-uri').val();
196
+ let comment = resource.find('.node-input-resource-comment').val();
197
+ node.resources.push({ uri: uri, comment: comment });
177
198
  });
178
- }
199
+ },
179
200
  });
180
201
  </script>
181
202
 
182
- <script type="text/x-red" data-help-name="mobius get multi-resource">
203
+ <script
204
+ type="text/x-red"
205
+ data-help-name="mobius get multi-resource"
206
+ >
183
207
  <p>Read multiple MOBiUS object resource values.</p>
184
208
 
185
209
  <h3>Configuration Page</h3>
@@ -35,6 +35,10 @@ module.exports = function (RED) {
35
35
  this.serviceConn = RED.nodes.getNode(n.connection);
36
36
  var node = this;
37
37
 
38
+ const uriValidTest = new RegExp(
39
+ `^[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}$`
40
+ );
41
+
38
42
  if (node.serviceConn) {
39
43
  node.status({
40
44
  fill: 'red',
@@ -52,11 +56,11 @@ module.exports = function (RED) {
52
56
  });
53
57
 
54
58
  for (const resource of node.resources) {
55
- if (!validateResourceURI(resource.uri)) {
59
+ if (!uriValidTest.test(resource.uri)) {
56
60
  node.status({
57
61
  fill: 'yellow',
58
62
  shape: 'dot',
59
- text: 'URIs not Valid',
63
+ text: 'Error: URIs not Valid',
60
64
  });
61
65
  if (done) {
62
66
  return done();
@@ -88,12 +92,24 @@ module.exports = function (RED) {
88
92
  node.status({
89
93
  fill: 'yellow',
90
94
  shape: 'dot',
91
- text: `Error: ${err.code ? err.code : 'Unknown'}`,
95
+ text: (() => {
96
+ if (err.response.status === 404) {
97
+ return `Error: One or more resources not found`;
98
+ } else {
99
+ return `Error: ${err.code ? err.code : 'Unknown'}`;
100
+ }
101
+ })(),
92
102
  });
93
103
  node.error(
94
- `Mobius error reading resource: ${
95
- err.code ? err.code : 'Unknown'
96
- }, ${err.message ? err.message : ''}`
104
+ (() => {
105
+ if (err.response.status === 404) {
106
+ return `Error: One or more resources not found`;
107
+ } else {
108
+ return `Error: ${err.code ? err.code : 'Unknown'}, ${
109
+ err.message ? err.message : ''
110
+ }`;
111
+ }
112
+ })()
97
113
  );
98
114
  })
99
115
  .finally(() => {
@@ -111,19 +127,6 @@ module.exports = function (RED) {
111
127
  }
112
128
  }
113
129
 
114
- function validateResourceURI(uri) {
115
- let parts = uri.split('/');
116
- for (let lp = 0; lp < parts.length; lp++) {
117
- if (parts[lp] === null || parts[lp] === '') {
118
- return false;
119
- }
120
- }
121
- if (parts.length === 5) {
122
- return true;
123
- }
124
- return false;
125
- }
126
-
127
130
  function readResource(node, uri) {
128
131
  return new Promise((resolve, reject) => {
129
132
  node.serviceConn.readResource(uri, (err, response) => {