@yarkivaev/scada 2.5.3 → 2.5.5

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
@@ -580,6 +580,14 @@ servers:
580
580
 
581
581
  This changes the selected server only; it does not mutate the shared profile.
582
582
 
583
+ The optional `mdmesh` module projects `chart` settings into `releases(...).scada.mdmesh`,
584
+ with its explicit `namespace` and `enabled` (default `true`) taking precedence.
585
+ It uses the same profile inheritance and server overrides. A consuming application
586
+ owns the MDMesh chart and deployment; the generic application chart does not install it.
587
+ An optional root `hmi` catalog passes through reading, includes, expansion, and release
588
+ projection as `releases(...).hmi` without interpretation. Catalog validation belongs
589
+ to the consuming application.
590
+
583
591
  ### Central backup freshness
584
592
 
585
593
  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.3",
3
+ "version": "2.5.5",
4
4
  "description": "SCADA domain objects, state persistence, and plant monitoring",
5
5
  "repository": {
6
6
  "type": "git",
@@ -41,6 +41,7 @@ export default function expand(document) {
41
41
  assertProfiles(document.servers || [], profiles);
42
42
  const servers = expandServers(document.servers || [], paths, document.mappings || {});
43
43
  return frozen({
44
+ ...(document.hmi !== undefined && { hmi: document.hmi }),
44
45
  mappings: document.mappings || {},
45
46
  namespace,
46
47
  profiles,
@@ -23,6 +23,10 @@ function bindOne(name, spec, secret) {
23
23
  if (name === 'telemetry_store') {
24
24
  return ['clickhouse', { enabled: spec.enabled !== false }];
25
25
  }
26
+ if (name === 'mdmesh') {
27
+ return ['mdmesh', { ...spec.chart, ...(spec.namespace !== undefined && { namespace: spec.namespace }),
28
+ enabled: spec.enabled !== false }];
29
+ }
26
30
  throw new Error(`system document has no module ${name}`);
27
31
  }
28
32
 
@@ -31,7 +35,7 @@ function bindOne(name, spec, secret) {
31
35
  *
32
36
  * @param {object} profile - server profile
33
37
  * @param {string|undefined} secret - state-store Secret name
34
- * @returns {object} postgres, rabbitmq, and clickhouse fragments
38
+ * @returns {object} postgres, rabbitmq, clickhouse, and mdmesh fragments
35
39
  * @example
36
40
  * bindModules({ modules: { telemetry_store: { enabled: true } } }, 'pg');
37
41
  */
@@ -110,6 +110,7 @@ export default function releases(document, cluster) {
110
110
  const profile = profileFor(expanded, host);
111
111
  assertHeld(expanded, links);
112
112
  return frozen({
113
+ ...(expanded.hmi !== undefined && { hmi: expanded.hmi }),
113
114
  ...(profile.target && { target: profile.target }),
114
115
  apps: passedApps(profile),
115
116
  scada: scadaRelease(expanded, host, profile, links)
@@ -120,7 +120,7 @@ function siteExtraRoutes(catalog, extraRoutes, syncRoutes) {
120
120
  */
121
121
  export default async function siteServer(config) {
122
122
  const env = collectionEnvironment(config);
123
- const sink = supervisorSink(env);
123
+ const sink = supervisorSink(env, { stateData: config.stateData });
124
124
  const ops = bindSiteOperations(sink, config.kindSources || config.operationSources);
125
125
  const http = edgeApi(sink.dataAccess, {
126
126
  port: sink.apiPort,
@@ -97,7 +97,8 @@ export default function supervisorSink(env = process.env, options = {}) {
97
97
  if (cfg.pipeline.transactions.enabled) { cfg.pipeline.onBatch = segmentBatchStats(cfg.pipeline.transactions.statsIntervalMs); }
98
98
  const pool = holdClient(new pg.Pool({ connectionString: cfg.postgres, max: cfg.dbPoolMax }));
99
99
  const metricsEnabled = cfg.sinkDbProfile === 'edge';
100
- const dataAccess = stateDataFromPool(pool, { metricsEnabled });
100
+ const data = stateDataFromPool(pool, { metricsEnabled });
101
+ const dataAccess = options.stateData ? options.stateData(data, pool) : data;
101
102
  return {
102
103
  health: () => {return health.status()},
103
104
  apiPort: cfg.apiPort,
@@ -35,7 +35,7 @@ function overlay(items, rows) {
35
35
  }));
36
36
  rows.forEach((row) => {
37
37
  const item = byKey.get(row.kind);
38
- if (!item) {
38
+ if (!item || (item.found && Date.parse(item.timestamp) > row.end_time.getTime())) {
39
39
  return;
40
40
  }
41
41
  item.found = true;