@mxtommy/kip 4.5.1 → 4.6.0-beta.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.
Files changed (41) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/package.json +13 -15
  3. package/plugin/history-series.service.js +14 -24
  4. package/plugin/index.js +198 -146
  5. package/plugin/{duckdb-parquet-storage.service.js → sqlite-history-storage.service.js} +327 -381
  6. package/public/{chunk-D7VDX7ZF.js → chunk-67V4XHCY.js} +1 -1
  7. package/public/{chunk-EQ2N7KDA.js → chunk-BEQKBGLG.js} +2 -2
  8. package/public/{chunk-JGGMFMY5.js → chunk-BJEHRCYP.js} +1 -1
  9. package/public/chunk-BTFZS2TW.js +16 -0
  10. package/public/chunk-FZFDGAQO.js +1 -0
  11. package/public/{chunk-VCY32MWT.js → chunk-FZSLNGBK.js} +8 -8
  12. package/public/{chunk-RONXIZ2U.js → chunk-J6EEFXKZ.js} +3 -3
  13. package/public/{chunk-IYRLINL7.js → chunk-KWTS7JF7.js} +1 -1
  14. package/public/chunk-NFJ4RQSE.js +4 -0
  15. package/public/{chunk-DEM56G4S.js → chunk-OPTBDYBL.js} +1 -1
  16. package/public/{chunk-YCEXTKGG.js → chunk-P4CRTB7N.js} +1 -1
  17. package/public/{chunk-IHURI4IH.js → chunk-P7JKENHI.js} +3 -3
  18. package/public/chunk-Q2ANAJAD.js +1 -0
  19. package/public/{chunk-B75MT7ND.js → chunk-R36UY4Q4.js} +1 -1
  20. package/public/{chunk-CHGXAEKT.js → chunk-RCYOZLZB.js} +1 -1
  21. package/public/chunk-RFNZ4AQG.js +50 -0
  22. package/public/{chunk-KPHICV76.js → chunk-SJFJEOSG.js} +1 -1
  23. package/public/{chunk-MGPPVLZ7.js → chunk-TBNKOU7M.js} +1 -1
  24. package/public/chunk-TVNXBPFF.js +6 -0
  25. package/public/{chunk-S72JTJPN.js → chunk-VPF5756E.js} +1 -1
  26. package/public/chunk-VXCYPAWR.js +1 -0
  27. package/public/{chunk-R7RQHWKJ.js → chunk-WH5CIUSB.js} +1 -1
  28. package/public/{chunk-LQDSU4WS.js → chunk-WQSJFJLW.js} +1 -1
  29. package/public/{chunk-KZ5DUKAX.js → chunk-XBSU7OGT.js} +1 -1
  30. package/public/{chunk-CEB42O2C.js → chunk-YI3MZWRZ.js} +1 -1
  31. package/public/index.html +1 -1
  32. package/public/main-TZOV3JCT.js +1 -0
  33. package/plugin/plugin-auth.service.js +0 -75
  34. package/public/chunk-A6DQJFP4.js +0 -16
  35. package/public/chunk-DEGYRCMI.js +0 -1
  36. package/public/chunk-DYTBBUMI.js +0 -4
  37. package/public/chunk-FNF7M3AE.js +0 -1
  38. package/public/chunk-JB4YVVNW.js +0 -1
  39. package/public/chunk-YKJKIWXO.js +0 -6
  40. package/public/chunk-ZV7IYYEQ.js +0 -50
  41. package/public/main-FQESQQV6.js +0 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # v4.5.2
2
+ ## Fixes
3
+ * DuckDB initialized when features are not enabled.
4
+ * Parquet data compression and pruning not executing.
1
5
  # v4.5.1
2
6
  ## Fixes
3
7
  * DuckDB dependency causing build and installation errors. Fixes #979
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mxtommy/kip",
3
- "version": "4.5.1",
3
+ "version": "4.6.0-beta.2",
4
4
  "description": "An advanced and versatile marine instrumentation package to display Signal K data.",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -66,12 +66,22 @@
66
66
  },
67
67
  "schematics": "tools/schematics/collection.json",
68
68
  "devDependencies": {
69
+ "@angular/cdk": "21.2.0",
70
+ "@angular/common": "21.2.0",
71
+ "@angular/compiler": "21.2.0",
72
+ "@angular/core": "21.2.0",
73
+ "@angular/forms": "21.2.0",
74
+ "@angular/material": "21.2.0",
75
+ "@angular/animations": "21.2.0",
76
+ "@angular/platform-browser": "21.2.0",
77
+ "@angular/platform-browser-dynamic": "21.2.0",
78
+ "@angular/router": "21.2.0",
69
79
  "@angular-devkit/build-angular": "^21.1.4",
70
80
  "@angular-devkit/schematics-cli": "^20.1.6",
71
81
  "@angular/build": "^21.1.4",
72
82
  "@angular/cli": "^21.1.4",
73
- "@angular/compiler-cli": "21.1.4",
74
- "@angular/language-service": "21.1.4",
83
+ "@angular/compiler-cli": "21.2.0",
84
+ "@angular/language-service": "21.2.0",
75
85
  "@types/canvas-gauges": "^2.1.8",
76
86
  "@types/d3": "^7.4.3",
77
87
  "@types/jasmine": "~3.6.0",
@@ -97,16 +107,6 @@
97
107
  "sass": "^1.49.9",
98
108
  "ts-node": "^10.9.2",
99
109
  "typescript": "^5.9.3",
100
- "@angular/animations": "21.1.4",
101
- "@angular/cdk": "21.1.4",
102
- "@angular/common": "21.1.4",
103
- "@angular/compiler": "21.1.4",
104
- "@angular/core": "21.1.4",
105
- "@angular/forms": "21.1.4",
106
- "@angular/material": "21.1.4",
107
- "@angular/platform-browser": "21.1.4",
108
- "@angular/platform-browser-dynamic": "21.1.4",
109
- "@angular/router": "21.1.4",
110
110
  "@aziham/chartjs-plugin-streaming": "^3.5.1",
111
111
  "@godind/ng-canvas-gauges": "^6.2.1",
112
112
  "@zakj/no-sleep": "^0.13.5",
@@ -131,8 +131,6 @@
131
131
  "zone.js": "^0.15.1"
132
132
  },
133
133
  "dependencies": {
134
- "@dsnp/parquetjs": "^1.8.7",
135
- "@duckdb/node-api": "^1.4.4-r.2",
136
134
  "@signalk/server-api": "^2.22.0"
137
135
  }
138
136
  }
@@ -6,13 +6,11 @@ exports.HistorySeriesService = void 0;
6
6
  */
7
7
  class HistorySeriesService {
8
8
  nowProvider;
9
- retainSamplesInMemory;
10
9
  seriesById = new Map();
11
10
  lastAcceptedTimestampBySeriesKey = new Map();
12
11
  sampleSink = null;
13
- constructor(nowProvider = () => Date.now(), retainSamplesInMemory = true) {
12
+ constructor(nowProvider = () => Date.now()) {
14
13
  this.nowProvider = nowProvider;
15
- this.retainSamplesInMemory = retainSamplesInMemory;
16
14
  }
17
15
  /**
18
16
  * Returns all configured series sorted by `seriesId`.
@@ -171,9 +169,10 @@ class HistorySeriesService {
171
169
  if (!series || series.enabled === false || !Number.isFinite(value) || !Number.isFinite(timestamp)) {
172
170
  return false;
173
171
  }
174
- const samplingIntervalMs = this.resolveSampleTimeMs(series.sampleTime);
175
172
  const previousTimestamp = this.lastAcceptedTimestampBySeriesKey.get(seriesKey);
176
- if (previousTimestamp !== undefined && (timestamp - previousTimestamp) < samplingIntervalMs) {
173
+ // Enforces a minimum of 1 second to prevent excessive sampling on short retention durations
174
+ const minSampleTime = Math.max(Number(series.sampleTime) || 0, 1000);
175
+ if (previousTimestamp !== undefined && (timestamp - previousTimestamp) < minSampleTime) {
177
176
  return false;
178
177
  }
179
178
  const context = series.context ?? 'vessels.self';
@@ -311,17 +310,19 @@ class HistorySeriesService {
311
310
  if (!path) {
312
311
  throw new Error('path is required');
313
312
  }
314
- // Determine if this is a data chart based widget
315
- const dsSampleTime = ownerWidgetUuid?.startsWith('widget-windtrends-chart') ||
316
- ownerWidgetUuid?.startsWith('widget-data-chart');
313
+ // Determine if this is a chart type widget
314
+ const isDataWidget = ownerWidgetUuid?.startsWith('widget-windtrends-chart') || ownerWidgetUuid?.startsWith('widget-data-chart');
315
+ const retentionMs = this.resolveRetentionMs(input);
317
316
  let sampleTime;
318
- const retentionMs = input.retentionDurationMs ?? this.resolveRetentionMs(input);
319
- if (dsSampleTime && Number.isFinite(retentionMs) && retentionMs > 0) {
320
- // regular widget sampleTime: 15 sec
321
- sampleTime = Math.max(1, Math.trunc(15000));
317
+ if (isDataWidget) {
318
+ // For chart type widgets we use retention duration to dynamically calculate sampleTime to
319
+ // aims for around 120 samples.
320
+ sampleTime = retentionMs ? Math.max(1000, Math.round(retentionMs / 120)) : 1000;
322
321
  }
323
322
  else {
324
- sampleTime = this.resolveSampleTimeMs(input.sampleTime);
323
+ // Non chart type widgets, ie historical Time-Series, have a fixed sampleTime of 15 sec that is
324
+ // a good median amount of samples for the dynamically queryable chart display range (15 min up to 24h).
325
+ sampleTime = 15000; // ms
325
326
  }
326
327
  return {
327
328
  ...input,
@@ -336,17 +337,6 @@ class HistorySeriesService {
336
337
  sampleTime
337
338
  };
338
339
  }
339
- resolveSampleTimeMs(sampleTime) {
340
- const parsed = Number(sampleTime);
341
- if (Number.isFinite(parsed) && parsed > 0) {
342
- return Math.max(1, Math.trunc(parsed));
343
- }
344
- return 1000;
345
- }
346
- buildSeriesMapKey(seriesId) {
347
- // userScope removed; now returns only seriesId
348
- return String(seriesId).trim();
349
- }
350
340
  resolveRetentionMs(series) {
351
341
  if (Number.isFinite(series.retentionDurationMs) && series.retentionDurationMs > 0) {
352
342
  return series.retentionDurationMs;