@yarkivaev/scada 2.5.1 → 2.5.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/README.md CHANGED
@@ -579,3 +579,7 @@ servers:
579
579
  ```
580
580
 
581
581
  This changes the selected server only; it does not mutate the shared profile.
582
+
583
+ ### Central backup freshness
584
+
585
+ Silent Modbus backup sources use `MX210/<device>` freshness identities. AMQP telemetry tracks `<source-family>/<device>`, so cooling for a device cannot hide missing MX210 electrical samples. Measurement topic paths are unchanged. Custom freshness callbacks must pass the source’s full identity to `seen()`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yarkivaev/scada",
3
- "version": "2.5.1",
3
+ "version": "2.5.2",
4
4
  "description": "SCADA domain objects, state persistence, and plant monitoring",
5
5
  "repository": {
6
6
  "type": "git",
@@ -59,12 +59,12 @@ export function mx210Metrics(device, collector) {
59
59
  * @param {string} name - Stream id (device name in MX210 topics)
60
60
  * @param {string} host - Modbus TCP host
61
61
  * @param {number} port - Modbus TCP port
62
- * @returns {object} Stream with name() and open(collector, clock, interval)
62
+ * @returns {object} Stream with family/device name() and open(collector, clock, interval)
63
63
  */
64
64
  export default function mx210Tcp(name, host, port) {
65
65
  return Object.freeze({
66
66
  name() {
67
- return name;
67
+ return `MX210/${name}`;
68
68
  },
69
69
  open(collector, clk, interval) {
70
70
  return modbusSource(
@@ -2,10 +2,10 @@
2
2
  * Extracts the stream id from a metrics MQTT/AMQP topic path.
3
3
  *
4
4
  * @example
5
- * streamNameFromTopic('MX210/m-1/GET/AI1/VALUE') === 'm-1'
5
+ * streamNameFromTopic('MX210/m-1/GET/AI1/VALUE') === 'MX210/m-1'
6
6
  *
7
7
  * @param {string} topic - Slash-separated topic
8
- * @returns {string|undefined} Device/stream id
8
+ * @returns {string|undefined} Source-family/device id
9
9
  */
10
10
  export default function streamNameFromTopic(topic) {
11
11
  if (typeof topic !== 'string' || topic.length === 0) {
@@ -17,5 +17,5 @@ export default function streamNameFromTopic(topic) {
17
17
  if (parts.length < 2) {
18
18
  return undefined;
19
19
  }
20
- return parts[1];
20
+ return `${parts[0]}/${parts[1]}`;
21
21
  }