@yarkivaev/scada 2.3.72 → 2.3.73

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yarkivaev/scada",
3
- "version": "2.3.72",
3
+ "version": "2.3.73",
4
4
  "description": "SCADA domain objects, state persistence, and plant monitoring",
5
5
  "repository": {
6
6
  "type": "git",
@@ -37,7 +37,7 @@ const RISES_SQL = `WITH prior AS (
37
37
  lagInFrame(toNullable(value), 1) OVER (ORDER BY ts) AS prev
38
38
  FROM series
39
39
  )
40
- SELECT ts, sum(1) OVER (ORDER BY ts) AS value
40
+ SELECT ts, sum(1) OVER (ORDER BY ts) AS prefix
41
41
  FROM lagged
42
42
  WHERE ts >= {start:DateTime64(3)} AND prev = 0 AND value = 1
43
43
  ORDER BY ts`;
@@ -49,7 +49,7 @@ export default async function clickhouseRises(connection, topic, range, unit) {
49
49
  end: formatDateTime(range.end)
50
50
  });
51
51
  return rows.map((row) => {
52
- return { timestamp: new Date(`${row.ts}Z`), value: row.value, unit };
52
+ return { timestamp: new Date(`${row.ts}Z`), value: Number(row.prefix), unit };
53
53
  });
54
54
  }
55
55