node-red-contrib-uos-nats 0.2.15 → 0.2.19
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/icons/datahub-provider.svg +12 -0
- package/icons/datahub-read.svg +11 -0
- package/icons/datahub-write.svg +11 -0
- package/lib/fbs/weidmueller/ucontrol/hub/variable-list.js +1 -1
- package/lib/fbs/weidmueller/ucontrol/hub/variable.js +2 -5
- package/nodes/datahub-output.js +9 -0
- package/package.json +4 -1
- package/icons/white/datahub-provider.svg +0 -12
- package/icons/white/datahub-read.svg +0 -11
- package/icons/white/datahub-write.svg +0 -11
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40">
|
|
2
|
+
<!-- Broadcast/antenna symbol (centered at 20,20) -->
|
|
3
|
+
<circle cx="20" cy="20" r="3" fill="white"/>
|
|
4
|
+
|
|
5
|
+
<!-- Inner waves (centered) -->
|
|
6
|
+
<path d="M 12,12 Q 8,20 12,28" fill="none" stroke="white" stroke-width="2.5" stroke-linecap="round"/>
|
|
7
|
+
<path d="M 28,12 Q 32,20 28,28" fill="none" stroke="white" stroke-width="2.5" stroke-linecap="round"/>
|
|
8
|
+
|
|
9
|
+
<!-- Outer waves (centered) -->
|
|
10
|
+
<path d="M 7,4 Q 2,20 7,36" fill="none" stroke="white" stroke-width="2.5" stroke-linecap="round"/>
|
|
11
|
+
<path d="M 33,4 Q 38,20 33,36" fill="none" stroke="white" stroke-width="2.5" stroke-linecap="round"/>
|
|
12
|
+
</svg>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40">
|
|
2
|
+
<!-- Database cylinder (shifted up for 40x40) -->
|
|
3
|
+
<ellipse cx="20" cy="10" rx="14" ry="4" fill="none" stroke="white" stroke-width="2.5"/>
|
|
4
|
+
<line x1="6" y1="10" x2="6" y2="25" stroke="white" stroke-width="2.5"/>
|
|
5
|
+
<line x1="34" y1="10" x2="34" y2="25" stroke="white" stroke-width="2.5"/>
|
|
6
|
+
<ellipse cx="20" cy="25" rx="14" ry="4" fill="none" stroke="white" stroke-width="2.5"/>
|
|
7
|
+
|
|
8
|
+
<!-- Arrow pointing DOWN (data flowing out) -->
|
|
9
|
+
<line x1="20" y1="28" x2="20" y2="38" stroke="white" stroke-width="2.5"/>
|
|
10
|
+
<polyline points="16,34 20,38 24,34" fill="none" stroke="white" stroke-width="2.5" stroke-linejoin="round"/>
|
|
11
|
+
</svg>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40">
|
|
2
|
+
<!-- Database cylinder (shifted up) -->
|
|
3
|
+
<ellipse cx="20" cy="30" rx="14" ry="4" fill="none" stroke="white" stroke-width="2.5"/>
|
|
4
|
+
<line x1="6" y1="30" x2="6" y2="15" stroke="white" stroke-width="2.5"/>
|
|
5
|
+
<line x1="34" y1="30" x2="34" y2="15" stroke="white" stroke-width="2.5"/>
|
|
6
|
+
<ellipse cx="20" cy="15" rx="14" ry="4" fill="none" stroke="white" stroke-width="2.5"/>
|
|
7
|
+
|
|
8
|
+
<!-- Arrow pointing UP (data flowing in/command) -->
|
|
9
|
+
<line x1="20" y1="12" x2="20" y2="2" stroke="white" stroke-width="2.5"/>
|
|
10
|
+
<polyline points="16,6 20,2 24,6" fill="none" stroke="white" stroke-width="2.5" stroke-linejoin="round"/>
|
|
11
|
+
</svg>
|
|
@@ -77,7 +77,7 @@ export class VariableList {
|
|
|
77
77
|
}
|
|
78
78
|
static endVariableList(builder) {
|
|
79
79
|
const offset = builder.endObject();
|
|
80
|
-
builder.requiredField(offset, 6); // base_timestamp
|
|
80
|
+
// builder.requiredField(offset, 6); // base_timestamp - DISABLED for stability
|
|
81
81
|
return offset;
|
|
82
82
|
}
|
|
83
83
|
unpack() {
|
|
@@ -84,7 +84,7 @@ export class Variable {
|
|
|
84
84
|
}
|
|
85
85
|
static endVariable(builder) {
|
|
86
86
|
const offset = builder.endObject();
|
|
87
|
-
// builder.requiredField(offset, 6); // value -
|
|
87
|
+
// builder.requiredField(offset, 6); // value - DISABLED for stability
|
|
88
88
|
return offset;
|
|
89
89
|
}
|
|
90
90
|
unpack() {
|
|
@@ -119,10 +119,7 @@ export class VariableT {
|
|
|
119
119
|
this.quality = quality;
|
|
120
120
|
}
|
|
121
121
|
pack(builder) {
|
|
122
|
-
|
|
123
|
-
if (this.value !== null) {
|
|
124
|
-
value = this.value.pack(builder);
|
|
125
|
-
}
|
|
122
|
+
const value = builder.createObjectOffset(this.value);
|
|
126
123
|
Variable.startVariable(builder);
|
|
127
124
|
Variable.addValueType(builder, this.valueType);
|
|
128
125
|
Variable.addValue(builder, value);
|
package/nodes/datahub-output.js
CHANGED
|
@@ -133,6 +133,15 @@ module.exports = function (RED) {
|
|
|
133
133
|
|
|
134
134
|
this.on('input', async (msg, send, done) => {
|
|
135
135
|
try {
|
|
136
|
+
// Auto-parse string payloads
|
|
137
|
+
if (typeof msg.payload === 'string') {
|
|
138
|
+
try {
|
|
139
|
+
msg.payload = JSON.parse(msg.payload);
|
|
140
|
+
} catch (e) {
|
|
141
|
+
// Ignore parse error, let validation below handle it
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
136
145
|
if (!msg || !msg.payload || typeof msg.payload !== 'object') {
|
|
137
146
|
done(new Error('Payload must be an object describing your structure.'));
|
|
138
147
|
return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-red-contrib-uos-nats",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.19",
|
|
4
4
|
"description": "Node-RED nodes for Weidmüller u-OS Data Hub. Read, write, and provide variables via NATS protocol with OAuth2 authentication. Features: Variable Key resolution, custom icons, example flows, and provider definition caching.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "IoTUeli",
|
|
@@ -59,5 +59,8 @@
|
|
|
59
59
|
"datahub-output": "nodes/datahub-output.js",
|
|
60
60
|
"datahub-write": "nodes/datahub-write.js"
|
|
61
61
|
}
|
|
62
|
+
},
|
|
63
|
+
"devDependencies": {
|
|
64
|
+
"dotenv": "^17.2.3"
|
|
62
65
|
}
|
|
63
66
|
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 60">
|
|
2
|
-
<!-- Broadcast/antenna symbol -->
|
|
3
|
-
<circle cx="20" cy="30" r="3" fill="white"/>
|
|
4
|
-
|
|
5
|
-
<!-- Inner waves -->
|
|
6
|
-
<path d="M 12,22 Q 8,30 12,38" fill="none" stroke="white" stroke-width="2.5" stroke-linecap="round"/>
|
|
7
|
-
<path d="M 28,22 Q 32,30 28,38" fill="none" stroke="white" stroke-width="2.5" stroke-linecap="round"/>
|
|
8
|
-
|
|
9
|
-
<!-- Outer waves -->
|
|
10
|
-
<path d="M 7,14 Q 2,30 7,46" fill="none" stroke="white" stroke-width="2.5" stroke-linecap="round"/>
|
|
11
|
-
<path d="M 33,14 Q 38,30 33,46" fill="none" stroke="white" stroke-width="2.5" stroke-linecap="round"/>
|
|
12
|
-
</svg>
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 60">
|
|
2
|
-
<!-- Database cylinder -->
|
|
3
|
-
<ellipse cx="20" cy="15" rx="14" ry="5" fill="none" stroke="white" stroke-width="2.5"/>
|
|
4
|
-
<line x1="6" y1="15" x2="6" y2="35" stroke="white" stroke-width="2.5"/>
|
|
5
|
-
<line x1="34" y1="15" x2="34" y2="35" stroke="white" stroke-width="2.5"/>
|
|
6
|
-
<ellipse cx="20" cy="35" rx="14" ry="5" fill="none" stroke="white" stroke-width="2.5"/>
|
|
7
|
-
|
|
8
|
-
<!-- Arrow pointing DOWN (data flowing out) -->
|
|
9
|
-
<line x1="20" y1="40" x2="20" y2="55" stroke="white" stroke-width="2.5"/>
|
|
10
|
-
<polyline points="15,50 20,55 25,50" fill="none" stroke="white" stroke-width="2.5" stroke-linejoin="round"/>
|
|
11
|
-
</svg>
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 60">
|
|
2
|
-
<!-- Database cylinder -->
|
|
3
|
-
<ellipse cx="20" cy="45" rx="14" ry="5" fill="none" stroke="white" stroke-width="2.5"/>
|
|
4
|
-
<line x1="6" y1="45" x2="6" y2="25" stroke="white" stroke-width="2.5"/>
|
|
5
|
-
<line x1="34" y1="45" x2="34" y2="25" stroke="white" stroke-width="2.5"/>
|
|
6
|
-
<ellipse cx="20" cy="25" rx="14" ry="5" fill="none" stroke="white" stroke-width="2.5"/>
|
|
7
|
-
|
|
8
|
-
<!-- Arrow pointing UP (data flowing in/command) -->
|
|
9
|
-
<line x1="20" y1="20" x2="20" y2="5" stroke="white" stroke-width="2.5"/>
|
|
10
|
-
<polyline points="15,10 20,5 25,10" fill="none" stroke="white" stroke-width="2.5" stroke-linejoin="round"/>
|
|
11
|
-
</svg>
|