@camstack/system 1.2.458 → 1.2.460
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/dist/addon-runner.js +26 -11
- package/dist/addon-runner.mjs +26 -11
- package/dist/addon-utils.mjs +1 -1
- package/dist/{agent-https-DOELEug8.js → agent-https-Dnr_nIVx.js} +3 -723
- package/dist/{agent-https-CQA3W-3e.mjs → agent-https-Iw3RSQup.mjs} +4 -616
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +4 -4
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +5 -5
- package/dist/builtins/alerts/alerts.addon.js +5 -7
- package/dist/builtins/alerts/alerts.addon.mjs +5 -7
- package/dist/builtins/alerts/record-kinds.d.ts +1 -1
- package/dist/builtins/autotrack/index.js +1 -1
- package/dist/builtins/autotrack/index.mjs +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +242 -4
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +243 -5
- package/dist/builtins/calendars/calendars.addon.js +2 -10
- package/dist/builtins/calendars/calendars.addon.mjs +2 -3
- package/dist/builtins/calendars/record-kinds.d.ts +1 -1
- package/dist/builtins/camera-grid/index.js +1 -1
- package/dist/builtins/camera-grid/index.mjs +1 -1
- package/dist/builtins/composer/composer.addon.js +2 -2
- package/dist/builtins/composer/composer.addon.mjs +2 -2
- package/dist/builtins/console-logging/index.js +1 -1
- package/dist/builtins/console-logging/index.mjs +1 -1
- package/dist/builtins/core-blocks/core-blocks.addon.js +4 -6
- package/dist/builtins/core-blocks/core-blocks.addon.mjs +4 -6
- package/dist/builtins/device-history/device-history.addon.js +1 -1
- package/dist/builtins/device-history/device-history.addon.mjs +1 -1
- package/dist/builtins/device-manager/device-manager.addon.js +2 -4
- package/dist/builtins/device-manager/device-manager.addon.mjs +2 -4
- package/dist/builtins/hub-forwarder/index.js +1 -1
- package/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/dist/builtins/keychain/index.js +41 -43
- package/dist/builtins/keychain/index.mjs +41 -43
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/dist/builtins/local-auth/local-auth.addon.js +24 -40
- package/dist/builtins/local-auth/local-auth.addon.mjs +27 -43
- package/dist/builtins/local-network/local-network.addon.js +2 -2
- package/dist/builtins/local-network/local-network.addon.mjs +2 -2
- package/dist/builtins/loki-logging/index.js +1 -1
- package/dist/builtins/loki-logging/index.mjs +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.js +39 -4
- package/dist/builtins/native-metrics/native-metrics.addon.mjs +48 -13
- package/dist/builtins/native-metrics/node-metrics-history-recorder.d.ts +16 -2
- package/dist/builtins/platform-probe/coral-accelerators.d.ts +10 -1
- package/dist/builtins/platform-probe/index.js +7 -4
- package/dist/builtins/platform-probe/index.mjs +13 -10
- package/dist/builtins/platform-probe/platform-scorer.d.ts +4 -1
- package/dist/builtins/record-entries/index.js +1 -1
- package/dist/builtins/record-entries/index.mjs +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/dist/builtins/snapshot/index.js +1 -1
- package/dist/builtins/snapshot/index.mjs +1 -1
- package/dist/builtins/sqlite-storage/file-host-protocol.d.ts +0 -15
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +20 -20
- package/dist/builtins/sqlite-storage/index.js +1 -1
- package/dist/builtins/sqlite-storage/index.mjs +1 -1
- package/dist/builtins/sqlite-storage/owned-sqlite-file.d.ts +0 -44
- package/dist/builtins/sqlite-storage/records/records-catalog.d.ts +0 -2
- package/dist/builtins/sqlite-storage/records/records-engine-types.d.ts +0 -21
- package/dist/builtins/sqlite-storage/records/records-engine.d.ts +3 -20
- package/dist/builtins/sqlite-storage/records/records-plan.d.ts +9 -4
- package/dist/builtins/sqlite-storage/records/records-provider.d.ts +4 -18
- package/dist/builtins/sqlite-storage/records/records-sql.d.ts +1 -1
- package/dist/builtins/sqlite-storage/sqlite-settings-backend.d.ts +0 -17
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +21 -196
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +21 -196
- package/dist/builtins/sqlite-storage/storage-admin-provider.d.ts +6 -14
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.d.ts +2 -2
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +7 -9
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +7 -9
- package/dist/builtins/system-config/system-config.addon.js +667 -40
- package/dist/builtins/system-config/system-config.addon.mjs +737 -127
- package/dist/builtins/winston-logging/index.js +1 -1
- package/dist/builtins/winston-logging/index.mjs +1 -1
- package/dist/{composition-sources-BVguN7VV.mjs → composition-sources-DNRZWR1j.mjs} +1 -1
- package/dist/{composition-sources-DURQNDJ4.js → composition-sources-b0e_2I-D.js} +1 -1
- package/dist/{constants-Njka8Cv6.js → constants-6OeJiZgi.js} +1 -1
- package/dist/{constants-FGjnsE2x.mjs → constants-BnkOdj9Q.mjs} +1 -1
- package/dist/{coral-accelerators-DcnZvctM.mjs → coral-accelerators-Qhn5TOYZ.mjs} +18 -15
- package/dist/{coral-accelerators-Bi_c3Rft.js → coral-accelerators-oUXmmbc2.js} +13 -10
- package/dist/{custom-action-registry-stpC3Zy-.mjs → custom-action-registry-DStvrQKI.mjs} +37 -37
- package/dist/{device-ca-lEaAQ9Xi.mjs → device-ca-Bnkw8GyU.mjs} +1 -1
- package/dist/{device-ca-BrVK_5s3.js → device-ca-CPTDs--d.js} +1 -1
- package/dist/{dist-BZQjLPiz.js → dist-Bn-RNanh.js} +29 -130
- package/dist/{dist-B_GRPhnY.mjs → dist-Wy8cTxg6.mjs} +30 -113
- package/dist/file-host-worker.js +1 -1
- package/dist/file-host-worker.mjs +1 -1
- package/dist/{hub-mdns-ciao-Bg2HfTwP.mjs → hub-mdns-ciao-CJu0nhla.mjs} +2 -2
- package/dist/{hub-mdns-ciao-nce3TXs_.js → hub-mdns-ciao-CTBTlia4.js} +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +56 -31
- package/dist/index.mjs +257 -233
- package/dist/kernel/deps/addon-deps-manager.d.ts +9 -0
- package/dist/{restore-archive-C7kLDI_0.mjs → restore-archive-CM23Pq9B.mjs} +177 -424
- package/dist/{restore-archive-FyfZ8YMC.js → restore-archive-DM1OBYq4.js} +89 -342
- package/dist/{wal-maintenance-Duejh7Lx.mjs → wal-maintenance-Bj_MmDkr.mjs} +0 -0
- package/dist/{wal-maintenance-DfSIOj24.js → wal-maintenance-CaJjuLHq.js} +0 -0
- package/package.json +1 -1
- package/dist/builtins/records/legacy-table-row-count.d.ts +0 -5
- package/dist/builtins/records/phase6-declare-gate.d.ts +0 -28
- package/dist/builtins/sqlite-storage/records/count-settings-array-legacy.d.ts +0 -5
- package/dist/builtins/sqlite-storage/records/count-settings-brokers-legacy.d.ts +0 -6
- package/dist/phase6-declare-gate-Dag1_WR2.js +0 -98
- package/dist/phase6-declare-gate-Lb-mrVvz.mjs +0 -93
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { Wi as declarationsOf } from "./dist-B_GRPhnY.mjs";
|
|
2
|
-
//#region src/builtins/records/legacy-table-row-count.ts
|
|
3
|
-
/** Row count for a physical settings-db table (matches the records engine `legacyRowCount`). */
|
|
4
|
-
function legacyTableRowCountFromList(tables, collection) {
|
|
5
|
-
return tables.find((t) => t.name === collection)?.rows ?? 0;
|
|
6
|
-
}
|
|
7
|
-
//#endregion
|
|
8
|
-
//#region src/builtins/records/phase6-declare-gate.ts
|
|
9
|
-
/**
|
|
10
|
-
* Phase 6 auth/alert builtins: do not call `ctx.records.declare` while legacy
|
|
11
|
-
* tables still hold rows unless every kind is already adopted, or the operator
|
|
12
|
-
* set {@link CAMSTACK_RECORDS_DECLARE_PHASE6} for the declare pass before
|
|
13
|
-
* `records-adopt.ts --apply`.
|
|
14
|
-
*/
|
|
15
|
-
/** Operator override: declare kinds even when adoption is still pending (legacy path until adopt completes). */
|
|
16
|
-
var CAMSTACK_RECORDS_DECLARE_PHASE6 = "CAMSTACK_RECORDS_DECLARE_PHASE6";
|
|
17
|
-
function isPhase6RecordsDeclareForced() {
|
|
18
|
-
const raw = process.env[CAMSTACK_RECORDS_DECLARE_PHASE6]?.trim().toLowerCase();
|
|
19
|
-
return raw === "1" || raw === "true" || raw === "yes";
|
|
20
|
-
}
|
|
21
|
-
async function legacyTablesHoldRows(collections, legacyRowCount) {
|
|
22
|
-
for (const collection of collections) if (await legacyRowCount(collection) > 0) return true;
|
|
23
|
-
return false;
|
|
24
|
-
}
|
|
25
|
-
async function catalogKindsFullyAdopted(owner, kindNames, declarations, listKindsForOwner, isAdoptedLegacyTable) {
|
|
26
|
-
const listed = await listKindsForOwner(owner);
|
|
27
|
-
const byKind = new Map(listed.map((k) => [k.kind, k]));
|
|
28
|
-
for (const name of kindNames) {
|
|
29
|
-
if (byKind.get(name) === void 0) return false;
|
|
30
|
-
const legacy = declarations[name]?.adoptsFrom;
|
|
31
|
-
if (typeof legacy !== "string") continue;
|
|
32
|
-
if (!await isAdoptedLegacyTable(legacy)) return false;
|
|
33
|
-
}
|
|
34
|
-
return true;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* @returns `true` when stores should bind record kinds; `false` for legacy collections only.
|
|
38
|
-
*/
|
|
39
|
-
async function resolvePhase6UseRecordsPath(deps) {
|
|
40
|
-
const declarations = declarationsOf(deps.kinds);
|
|
41
|
-
const kindNames = Object.keys(deps.kinds);
|
|
42
|
-
if (await catalogKindsFullyAdopted(deps.owner, kindNames, declarations, deps.listKindsForOwner, deps.isAdoptedLegacyTable)) {
|
|
43
|
-
await deps.records.declare(deps.kinds);
|
|
44
|
-
return true;
|
|
45
|
-
}
|
|
46
|
-
if (!await legacyTablesHoldRows(deps.legacyCollections, deps.legacyRowCount)) {
|
|
47
|
-
await deps.records.declare(deps.kinds);
|
|
48
|
-
return true;
|
|
49
|
-
}
|
|
50
|
-
if (isPhase6RecordsDeclareForced()) {
|
|
51
|
-
try {
|
|
52
|
-
await deps.records.declare(deps.kinds);
|
|
53
|
-
} catch (err) {
|
|
54
|
-
if (!(err instanceof Error ? err.message : String(err)).startsWith("records/adoption-pending:")) throw err;
|
|
55
|
-
deps.log.info("phase 6: records kinds declared; legacy tables until adopt completes", { owner: deps.owner });
|
|
56
|
-
}
|
|
57
|
-
return false;
|
|
58
|
-
}
|
|
59
|
-
deps.log.info("phase 6: skipping records.declare — serving legacy collections until adopt completes", { owner: deps.owner });
|
|
60
|
-
return false;
|
|
61
|
-
}
|
|
62
|
-
/** Shared wiring for hub builtins (local-auth, keychain, alert-center). */
|
|
63
|
-
async function resolvePhase6UseRecordsPathForHub(ctx, owner, kinds, legacyCollections) {
|
|
64
|
-
const records = ctx.records;
|
|
65
|
-
const store = ctx.api?.settingsStore;
|
|
66
|
-
if (records === void 0 || store === void 0) return false;
|
|
67
|
-
const admin = ctx.api?.storageAdmin;
|
|
68
|
-
return resolvePhase6UseRecordsPath({
|
|
69
|
-
owner,
|
|
70
|
-
records,
|
|
71
|
-
kinds,
|
|
72
|
-
legacyCollections,
|
|
73
|
-
legacyRowCount: async (collection) => {
|
|
74
|
-
if (admin !== void 0) {
|
|
75
|
-
const fromEngine = legacyTableRowCountFromList((await admin.listTables.query({})).tables, collection);
|
|
76
|
-
if (fromEngine > 0) return fromEngine;
|
|
77
|
-
}
|
|
78
|
-
try {
|
|
79
|
-
return await store.count.query({ collection });
|
|
80
|
-
} catch {
|
|
81
|
-
return admin === void 0 ? 0 : legacyTableRowCountFromList((await admin.listTables.query({})).tables, collection);
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
listKindsForOwner: async (o) => admin === void 0 ? [] : (await admin.listKinds.query({
|
|
85
|
-
owner: o,
|
|
86
|
-
counts: false
|
|
87
|
-
})).kinds,
|
|
88
|
-
isAdoptedLegacyTable: async (collection) => admin === void 0 ? false : (await admin.isAdoptedLegacyTable.query({ collection })).adopted,
|
|
89
|
-
log: { info: (message, meta) => ctx.logger.info(message, meta ? { meta } : void 0) }
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
//#endregion
|
|
93
|
-
export { resolvePhase6UseRecordsPathForHub as t };
|