@camstack/server 1.2.769 → 1.2.771
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/CHANGELOG.md +12 -0
- package/dist/api/core/cap-providers.js +4 -193
- package/dist/api/trpc/generated-cap-routers.js +40 -30
- package/dist/core/addon/addon-registry.service.js +100 -65
- package/dist/core/addon/group-respawn-ledger.js +59 -0
- package/dist/core/addon/integration-visibility.js +0 -5
- package/dist/core/addon/runner-convergence.js +36 -0
- package/package.json +8 -17
- package/system/dist/addon-utils.mjs +1 -1
- package/system/dist/{agent-https-C_rkCAus.mjs → agent-https-BGRPCKwT.mjs} +1 -1
- package/system/dist/{agent-https-Cw5Wc_ip.js → agent-https-mq6d71iq.js} +1 -1
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +4 -4
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +5 -5
- package/system/dist/builtins/alerts/alerts.addon.js +1 -1
- package/system/dist/builtins/alerts/alerts.addon.mjs +1 -1
- package/system/dist/builtins/autotrack/index.js +1 -1
- package/system/dist/builtins/autotrack/index.mjs +1 -1
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +5 -5
- package/system/dist/builtins/calendars/calendars.addon.js +1 -1
- package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
- package/system/dist/builtins/camera-grid/index.js +1 -1
- package/system/dist/builtins/camera-grid/index.mjs +1 -1
- package/system/dist/builtins/composer/composer.addon.js +3 -3
- package/system/dist/builtins/composer/composer.addon.mjs +3 -3
- package/system/dist/builtins/console-logging/index.js +1 -1
- package/system/dist/builtins/console-logging/index.mjs +1 -1
- package/system/dist/builtins/core-blocks/core-blocks.addon.js +3 -3
- package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +3 -3
- package/system/dist/builtins/device-history/device-history.addon.js +2 -2
- package/system/dist/builtins/device-history/device-history.addon.mjs +2 -2
- package/system/dist/builtins/device-manager/device-manager.addon.js +1 -1
- package/system/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
- package/system/dist/builtins/hub-forwarder/index.js +1 -1
- package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/system/dist/builtins/keychain/index.js +17 -10
- package/system/dist/builtins/keychain/index.mjs +17 -10
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
- package/system/dist/builtins/local-auth/local-auth.addon.mjs +5 -5
- package/system/dist/builtins/local-network/local-network.addon.js +2 -2
- package/system/dist/builtins/local-network/local-network.addon.mjs +2 -2
- package/system/dist/builtins/loki-logging/index.js +1 -1
- package/system/dist/builtins/loki-logging/index.mjs +1 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +10 -10
- package/system/dist/builtins/platform-probe/index.js +1 -1
- package/system/dist/builtins/platform-probe/index.mjs +10 -10
- package/system/dist/builtins/record-entries/index.js +1 -1
- package/system/dist/builtins/record-entries/index.mjs +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/snapshot/index.js +1 -1
- package/system/dist/builtins/snapshot/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +20 -20
- package/system/dist/builtins/sqlite-storage/index.js +1 -1
- package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/integration-record-kinds.d.ts +3 -10
- package/system/dist/builtins/sqlite-storage/integration-registry.d.ts +1 -11
- package/system/dist/builtins/sqlite-storage/integration-rows-ports.d.ts +13 -15
- package/system/dist/builtins/sqlite-storage/migrations/legacy-integration-rows-door.d.ts +31 -0
- package/system/dist/builtins/sqlite-storage/migrations/migrations-provider.d.ts +39 -1
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +48 -5
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +48 -5
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/system-config/system-config.addon.js +3 -3
- package/system/dist/builtins/system-config/system-config.addon.mjs +115 -115
- package/system/dist/builtins/winston-logging/index.js +1 -1
- package/system/dist/builtins/winston-logging/index.mjs +1 -1
- package/system/dist/{capture-engine-DXSWU1PY.js → capture-engine--FQ8NUHh.js} +1 -1
- package/system/dist/{capture-engine-Kl46lSBi.mjs → capture-engine-Cmx7DIzV.mjs} +1 -1
- package/system/dist/{composition-sources-ClCP809M.mjs → composition-sources-Bd09D5f4.mjs} +1 -1
- package/system/dist/{composition-sources-Cq0IeRv9.js → composition-sources-cvZAN87H.js} +1 -1
- package/system/dist/{constants-CDxTuuXp.mjs → constants-Dce28BAx.mjs} +1 -1
- package/system/dist/{constants-CI5ySMIj.js → constants-gM9xHjyj.js} +1 -1
- package/system/dist/{coral-accelerators-BW3OcrLD.mjs → coral-accelerators-DBlgWB8k.mjs} +6 -6
- package/system/dist/{custom-action-registry-BIJZBObd.mjs → custom-action-registry-oHl1xltx.mjs} +37 -37
- package/system/dist/{device-ca-DPvU-3TE.js → device-ca-BmeH6Y9E.js} +1 -1
- package/system/dist/{device-ca-uRLJ8-jZ.mjs → device-ca-DcMuT-Yp.mjs} +1 -1
- package/system/dist/{dist-C_SNsYGY.mjs → dist-C3WXy3Ix.mjs} +78 -55
- package/system/dist/{dist-BDixk7cu.js → dist-Dtw1sIeQ.js} +78 -55
- package/system/dist/file-host-worker.js +1 -1
- package/system/dist/file-host-worker.mjs +1 -1
- package/system/dist/{hub-mdns-ciao-7uRbexmH.js → hub-mdns-ciao-C49eqyby.js} +2 -2
- package/system/dist/{hub-mdns-ciao-ea1EwFAF.mjs → hub-mdns-ciao-Dfue_0kR.mjs} +2 -2
- package/system/dist/index.d.ts +1 -1
- package/system/dist/index.js +42 -230
- package/system/dist/index.mjs +262 -450
- package/system/dist/legacy-integration-rows-door-B8_XCqUX.js +290 -0
- package/system/dist/legacy-integration-rows-door-DK42Bh2Q.mjs +255 -0
- package/system/dist/migrations/hub/2026-11-05-drop-integration-settings.d.ts +16 -0
- package/system/dist/{restore-archive-D0y_tFM2.mjs → restore-archive-C0YDO-qd.mjs} +94 -94
- package/system/dist/{restore-archive-CpTnlXUA.js → restore-archive-DuktQtye.js} +1 -1
- package/system/dist/{wal-maintenance-Dy4gxMdb.js → wal-maintenance-BEo-y-cQ.js} +0 -0
- package/system/dist/{wal-maintenance-BvxzVfje.mjs → wal-maintenance-DhuvKiGK.mjs} +0 -0
- package/system/package.json +1 -1
- package/dist/api/core/integration-secrets.js +0 -96
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.COERCED_MARKER_TEXT = void 0;
|
|
4
|
-
exports.writeIntegrationSettings = writeIntegrationSettings;
|
|
5
|
-
exports.readIntegrationSettings = readIntegrationSettings;
|
|
6
|
-
/**
|
|
7
|
-
* The integration-settings door of the keychain (D787). An integration's
|
|
8
|
-
* settings (a Wyze password, a PetKit account password) live in the
|
|
9
|
-
* `integration_settings` table, written by `integrations.create` /
|
|
10
|
-
* `setSettings` and read back by the integration's own addon through
|
|
11
|
-
* `integrations.getSettings` — and by the admin form through the same method.
|
|
12
|
-
*
|
|
13
|
-
* - WRITE: the keys the form's schema declares secret (`secretKeys`, by type)
|
|
14
|
-
* and every key that already holds a marker go through the keychain save
|
|
15
|
-
* path, OWNED by the integration's addon (`integration/<id>` scope). A value
|
|
16
|
-
* equal to an inline pre-keychain one stays inline; `''` keeps.
|
|
17
|
-
* - READ, by the owning addon (the caller the transport stamped): markers
|
|
18
|
-
* resolve to values. READ, by anyone else (the admin form): markers become
|
|
19
|
-
* their "set" views — the value never leaves the hub.
|
|
20
|
-
*/
|
|
21
|
-
const types_1 = require("@camstack/types");
|
|
22
|
-
async function writeIntegrationSettings(deps, input) {
|
|
23
|
-
if (deps.secrets === null) {
|
|
24
|
-
return deps.registry.setIntegrationSettings(input.integrationId, input.settings);
|
|
25
|
-
}
|
|
26
|
-
const stored = (await deps.registry.getIntegrationSettings(input.integrationId)) ?? {};
|
|
27
|
-
const markerKeys = Object.entries(stored)
|
|
28
|
-
.filter(([, v]) => (0, types_1.isSecretMarker)(v))
|
|
29
|
-
.map(([k]) => k);
|
|
30
|
-
const tree = (0, types_1.secretTreeFromPaths)([...new Set([...input.secretKeys, ...markerKeys])]);
|
|
31
|
-
if (tree.size === 0) {
|
|
32
|
-
return deps.registry.setIntegrationSettings(input.integrationId, input.settings);
|
|
33
|
-
}
|
|
34
|
-
const result = await (0, types_1.transformSecretWrite)({
|
|
35
|
-
tree,
|
|
36
|
-
secrets: deps.secrets,
|
|
37
|
-
patch: input.settings,
|
|
38
|
-
stored,
|
|
39
|
-
scope: { kind: 'integration', integrationId: input.integrationId },
|
|
40
|
-
operatorWrite: input.operatorWrite === true,
|
|
41
|
-
});
|
|
42
|
-
if (Object.keys(result.patch).length > 0) {
|
|
43
|
-
await deps.registry.setIntegrationSettings(input.integrationId, result.patch);
|
|
44
|
-
}
|
|
45
|
-
const { orphaned } = await result.afterWrite();
|
|
46
|
-
if (orphaned.length > 0)
|
|
47
|
-
deps.onOrphaned?.(orphaned);
|
|
48
|
-
}
|
|
49
|
-
/** The text `String(...)` makes of an object — a keychain marker some copy coerced. */
|
|
50
|
-
exports.COERCED_MARKER_TEXT = '[object Object]';
|
|
51
|
-
function suspectKind(key, value, secretKeys) {
|
|
52
|
-
if (value === exports.COERCED_MARKER_TEXT)
|
|
53
|
-
return 'coerced-marker';
|
|
54
|
-
if (secretKeys?.has(key) === true && typeof value === 'string' && value.length > 0) {
|
|
55
|
-
return 'plaintext';
|
|
56
|
-
}
|
|
57
|
-
return null;
|
|
58
|
-
}
|
|
59
|
-
async function readIntegrationSettings(deps, input) {
|
|
60
|
-
const stored = await deps.registry.getIntegrationSettings(input.integrationId);
|
|
61
|
-
const suspects = new Set();
|
|
62
|
-
for (const [key, value] of Object.entries(stored)) {
|
|
63
|
-
const kind = suspectKind(key, value, input.secretKeys);
|
|
64
|
-
if (kind === null)
|
|
65
|
-
continue;
|
|
66
|
-
suspects.add(key);
|
|
67
|
-
input.onSuspectSecret?.({ key, kind });
|
|
68
|
-
}
|
|
69
|
-
if (input.forOwner) {
|
|
70
|
-
if (deps.secrets === null)
|
|
71
|
-
return stored;
|
|
72
|
-
return (await (0, types_1.resolveSecretMarkers)(stored, deps.secrets)).value;
|
|
73
|
-
}
|
|
74
|
-
// Anyone but the owner — the admin form — never receives a secret's text:
|
|
75
|
-
// a marker becomes its "set" view, and so does a suspect plaintext.
|
|
76
|
-
const out = {};
|
|
77
|
-
for (const [key, value] of Object.entries(stored)) {
|
|
78
|
-
out[key] = suspects.has(key) ? (0, types_1.toSecretFieldView)(value) : toFormView(value);
|
|
79
|
-
}
|
|
80
|
-
return out;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* A marker anywhere in a stored value becomes its "set" view: a secret inside
|
|
84
|
-
* an array row (`boards[id].encryptionKey`) is stored as a marker in the row,
|
|
85
|
-
* and the admin form must not receive the marker itself.
|
|
86
|
-
*/
|
|
87
|
-
function toFormView(value) {
|
|
88
|
-
if ((0, types_1.isSecretMarker)(value))
|
|
89
|
-
return (0, types_1.toSecretFieldView)(value);
|
|
90
|
-
if (Array.isArray(value))
|
|
91
|
-
return value.map(toFormView);
|
|
92
|
-
if (typeof value === 'object' && value !== null) {
|
|
93
|
-
return Object.fromEntries(Object.entries(value).map(([k, v]) => [k, toFormView(v)]));
|
|
94
|
-
}
|
|
95
|
-
return value;
|
|
96
|
-
}
|