Export saves layout + elements with datapoint names for re-linking.
Import creates new layout and re-links datapoints by name.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Discovery uses /states?pattern=* (not /objects?type=state)
- Stores initial values during discovery
- Test uses root endpoint to verify API help page
- getBulk URL with trailing slash
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Loads only 30 topics at a time with server-side search instead
of fetching all 6000+ topics. Debounced search input, pagination,
selected-only filter. Much faster for large Victron brokers.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace all db.run(sql, [params]) calls with db.prepare(sql).run(...params)
across all source modules and test files. Also remove the node-sqlite3-wasm
import from tests/db.test.ts and update the type annotation accordingly.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Collect payloads in memory Map, flush to SQLite every 2 seconds
instead of on every message. Prevents DB lock and slowness with
high-volume brokers like Venus OS.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The discovery message handler was missing the payload parameter,
so topics were saved without their last value.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When a user checks a topic checkbox, a datapoint is automatically
created and the broker subscribes to that topic for live updates.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Set strict:false and --noEmitOnError false to allow production build
while node-sqlite3-wasm QueryResult type conflicts are present.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- src/db/index.ts: initDb/getDb/closeDb using node-sqlite3-wasm (pure WASM, no VS build required)
- src/db/migrations/001-initial.ts: creates all 9 tables with FK constraints and CHECK constraints
- tests/db.test.ts: 10 tests verifying WAL mode, FK cascade, all table columns, and constraint enforcement
- Switched from better-sqlite3 (requires Visual Studio on Windows) to node-sqlite3-wasm
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- package.json with express, better-sqlite3, mqtt, pg, bcrypt, jsonwebtoken, cors
- tsconfig.json targeting ES2022/commonjs
- src/index.ts with GET /health on port 4000
- vitest.config.ts for test runner configuration
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>