@camstack/server 1.2.928 → 1.2.929
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 +6 -0
- package/package.json +10 -8
- package/system/dist/addon-id-CVg1_r5E.mjs +39 -0
- package/system/dist/addon-id-Di0lNJ89.js +50 -0
- package/system/dist/addon-pages.cap-Df9FQwN1.js +49 -0
- package/system/dist/addon-pages.cap-DksUlE8j.mjs +44 -0
- package/system/dist/addon-settings.cap-3-TIIMq_.mjs +592 -0
- package/system/dist/addon-settings.cap-DAiE0Nb0.js +651 -0
- package/system/dist/addon-utils.mjs +1 -1
- package/system/dist/addon-widgets.cap-C4jxflbF.js +200 -0
- package/system/dist/addon-widgets.cap-D9m48X78.mjs +183 -0
- package/system/dist/base-addon-DD5dIfcZ.js +4624 -0
- package/system/dist/base-addon-Md14i7pe.mjs +4505 -0
- package/system/dist/base-device-2sL1DMm1.js +1103 -0
- package/system/dist/base-device-IuM1AwXZ.mjs +1098 -0
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +8 -6
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +6 -4
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +8 -6
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +7 -5
- package/system/dist/builtins/alerts/alerts.addon.js +113 -56
- package/system/dist/builtins/alerts/alerts.addon.mjs +60 -3
- package/system/dist/builtins/autotrack/index.js +21 -17
- package/system/dist/builtins/autotrack/index.mjs +5 -1
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +14 -11
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +8 -5
- package/system/dist/builtins/calendars/calendars.addon.js +8 -6
- package/system/dist/builtins/calendars/calendars.addon.mjs +3 -1
- package/system/dist/builtins/camera-grid/index.js +615 -58
- package/system/dist/builtins/camera-grid/index.mjs +558 -1
- package/system/dist/builtins/composer/composer.addon.js +788 -209
- package/system/dist/builtins/composer/composer.addon.mjs +583 -4
- package/system/dist/builtins/console-logging/index.js +4 -3
- package/system/dist/builtins/console-logging/index.mjs +2 -1
- package/system/dist/builtins/core-blocks/core-blocks.addon.js +7887 -381
- package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +7511 -5
- package/system/dist/builtins/core-notifier/core-notifier.addon.js +731 -21
- package/system/dist/builtins/core-notifier/core-notifier.addon.mjs +711 -1
- package/system/dist/builtins/device-history/device-history.addon.js +110 -31
- package/system/dist/builtins/device-history/device-history.addon.mjs +81 -2
- package/system/dist/builtins/device-manager/device-manager.addon.js +12806 -227
- package/system/dist/builtins/device-manager/device-manager.addon.mjs +12583 -5
- package/system/dist/builtins/hub-forwarder/index.js +4 -3
- package/system/dist/builtins/hub-forwarder/index.mjs +2 -1
- package/system/dist/builtins/keychain/index.js +31 -28
- package/system/dist/builtins/keychain/index.mjs +7 -4
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +15 -12
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +4 -1
- package/system/dist/builtins/local-auth/local-auth.addon.js +140 -39
- package/system/dist/builtins/local-auth/local-auth.addon.mjs +106 -6
- package/system/dist/builtins/local-network/local-network.addon.js +43 -39
- package/system/dist/builtins/local-network/local-network.addon.mjs +7 -3
- package/system/dist/builtins/loki-logging/index.js +23 -17
- package/system/dist/builtins/loki-logging/index.mjs +7 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.js +156 -15
- package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +151 -10
- package/system/dist/builtins/platform-probe/index.js +25 -23
- package/system/dist/builtins/platform-probe/index.mjs +12 -10
- package/system/dist/builtins/record-entries/index.js +9 -7
- package/system/dist/builtins/record-entries/index.mjs +3 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +4 -4
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/snapshot/index.js +97 -44
- package/system/dist/builtins/snapshot/index.mjs +54 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +5 -4
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +21 -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/sqlite-settings.addon.js +87 -61
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +29 -3
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +81 -72
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +10 -1
- package/system/dist/builtins/system-config/system-config.addon.js +17 -14
- package/system/dist/builtins/system-config/system-config.addon.mjs +118 -115
- package/system/dist/builtins/winston-logging/index.js +7 -5
- package/system/dist/builtins/winston-logging/index.mjs +3 -1
- package/system/dist/calendars.cap-CaFlShS9.js +155 -0
- package/system/dist/calendars.cap-_C4eD4fi.mjs +138 -0
- package/system/dist/camstack-error-DJ-TUAi1.js +23 -0
- package/system/dist/camstack-error-viZYfcj9.mjs +18 -0
- package/system/dist/cap-call-context-Bd76CbOW.js +95 -0
- package/system/dist/cap-call-context-DNwdgGSQ.mjs +78 -0
- package/system/dist/capability-definition-C2rJdVeX.mjs +177 -0
- package/system/dist/capability-definition-HCmTem8c.js +242 -0
- package/system/dist/{capture-engine-BcuwOSXv.js → capture-engine-DZ0LIUqA.js} +5 -4
- package/system/dist/{capture-engine-Bz7eXFjT.mjs → capture-engine-DiwbjoWp.mjs} +2 -1
- package/system/dist/command-origin-claim-Cief660O.js +35 -0
- package/system/dist/command-origin-claim-D1Wy7Qld.mjs +24 -0
- package/system/dist/composition-sources-Caqv7O7z.mjs +391 -0
- package/system/dist/composition-sources-CgnHjm8Q.js +408 -0
- package/system/dist/{constants-D2etJ02O.js → constants-Ba3FTIHl.js} +1 -1
- package/system/dist/constants-C860Y6U4.js +26 -0
- package/system/dist/{constants-BcUTQd1M.mjs → constants-DB4piTD5.mjs} +1 -1
- package/system/dist/constants-DCLpoF4L.mjs +21 -0
- package/system/dist/coral-accelerators-7o8hqvcN.js +564 -0
- package/system/dist/coral-accelerators-BKcXP59c.mjs +521 -0
- package/system/dist/core-blocks.cap-C6iKAZ-x.mjs +17986 -0
- package/system/dist/core-blocks.cap-LEMqVwxO.js +18705 -0
- package/system/dist/{custom-action-registry-N7flBDwT.mjs → custom-action-registry-B9zFBNVa.mjs} +37 -37
- package/system/dist/custom-actions-BFUSalC9.mjs +25 -0
- package/system/dist/custom-actions-D92NRi2c.js +36 -0
- package/system/dist/database-snapshot.cap-DF38e-0P.js +162 -0
- package/system/dist/database-snapshot.cap-dhrc9xnY.mjs +133 -0
- package/system/dist/declared-device-BWphj9WE.js +303 -0
- package/system/dist/declared-device-CKERA1Hi.mjs +286 -0
- package/system/dist/{device-ca-ExMN3xW3.mjs → device-ca-BLM6fccc.mjs} +2 -1
- package/system/dist/{device-ca-CU8zh9Pi.js → device-ca-C5kJE6mL.js} +7 -6
- package/system/dist/device-certificate-Cddm4Idn.mjs +91 -0
- package/system/dist/device-certificate-CguVACQO.js +162 -0
- package/system/dist/device-identifiers-BQg9EQi1.js +600 -0
- package/system/dist/device-identifiers-iSuQCKmK.mjs +529 -0
- package/system/dist/device-kind-BJ2pfsjw.mjs +78 -0
- package/system/dist/device-kind-CsSiv_YF.js +101 -0
- package/system/dist/device-manager.cap-2abwVLCM.js +2874 -0
- package/system/dist/device-manager.cap-CFZSPfUh.mjs +2749 -0
- package/system/dist/device-provider.cap-3Uvk6f5-.mjs +331 -0
- package/system/dist/device-provider.cap-D7TV2kVH.js +366 -0
- package/system/dist/{device-row-store-CeW_GWh9.mjs → device-row-store-YF3jtmkk.mjs} +4 -1
- package/system/dist/{device-row-store-BMIR-n3m.js → device-row-store-doTfMOqn.js} +12 -9
- package/system/dist/device-transitions.cap-B5w5PYU_.js +860 -0
- package/system/dist/device-transitions.cap-DojcwEuX.mjs +819 -0
- package/system/dist/device-type-CbQsnFdC.js +477 -0
- package/system/dist/device-type-DgEvK3ch.mjs +454 -0
- package/system/dist/entry-kind-D9MuVJCK.mjs +44 -0
- package/system/dist/entry-kind-cq90c--V.js +55 -0
- package/system/dist/error.cap-CSM_SRfR.mjs +3423 -0
- package/system/dist/error.cap-DBhgPeWK.js +3848 -0
- package/system/dist/file-host-worker.js +1 -1
- package/system/dist/file-host-worker.mjs +1 -1
- package/system/dist/history-catalog-BKRarIL_.js +831 -0
- package/system/dist/history-catalog-BwTeQ4Mr.mjs +802 -0
- package/system/dist/{hub-identity-Csxx2Q8k.js → hub-identity-BMdR3Mw9.js} +2 -2
- package/system/dist/{hub-identity-CYC1820R.mjs → hub-identity-DjMN9Ac2.mjs} +10 -10
- package/system/dist/{hub-mdns-ciao-By5577HM.js → hub-mdns-ciao--0v1TKME.js} +5 -5
- package/system/dist/{hub-mdns-ciao-CCDxM5qz.mjs → hub-mdns-ciao-DBrtHOcc.mjs} +2 -2
- package/system/dist/index.js +763 -151
- package/system/dist/index.mjs +832 -220
- package/system/dist/integration-instances.cap-Cl9O-k4h.mjs +538 -0
- package/system/dist/integration-instances.cap-dJIxg2_s.js +549 -0
- package/system/dist/keychain-admin.cap-Db_oFX4H.js +425 -0
- package/system/dist/keychain-admin.cap-GtM7gVGG.mjs +396 -0
- package/system/dist/l10n-Bu6aUvSY.mjs +10 -0
- package/system/dist/l10n-CGMvp7NF.js +15 -0
- package/system/dist/labels-DX5S8deC.js +81 -0
- package/system/dist/labels-DsBcU7md.mjs +64 -0
- package/system/dist/{legacy-integration-rows-door-CVwOo5aq.js → legacy-integration-rows-door-B1nzxxr5.js} +2 -2
- package/system/dist/{legacy-integration-rows-door-D9tQOUzh.mjs → legacy-integration-rows-door-nTvo_6jQ.mjs} +1 -1
- package/system/dist/log-destination.cap-CxZzAVaR.mjs +143 -0
- package/system/dist/log-destination.cap-DELPJkZ0.js +148 -0
- package/system/dist/low-power-sleep.cap-7lfVU41N.js +103 -0
- package/system/dist/low-power-sleep.cap-tGPmaZ_V.mjs +92 -0
- package/system/dist/mask-shape-Ci8Co9w0.mjs +57 -0
- package/system/dist/mask-shape-CmPA2fst.js +92 -0
- package/system/dist/metrics-provider.cap-BNmcHDkQ.mjs +405 -0
- package/system/dist/metrics-provider.cap-BcmQUt6l.js +410 -0
- package/system/dist/migration-BMjgkyG2.js +380 -0
- package/system/dist/migration-DRJAtdy7.mjs +321 -0
- package/system/dist/network-access.cap-B5TWLDCC.js +1099 -0
- package/system/dist/network-access.cap-BJnGbE6n.mjs +1004 -0
- package/system/dist/notification-rules.cap-B__YBgnG.js +3422 -0
- package/system/dist/notification-rules.cap-D9ArZlwx.mjs +3357 -0
- package/system/dist/ops-log-CB4pIdqi.mjs +64 -0
- package/system/dist/ops-log-pxt9176Z.js +81 -0
- package/system/dist/pinned-binary-BOhOSNff.js +28 -0
- package/system/dist/pinned-binary-CrIRAi4G.mjs +23 -0
- package/system/dist/platform-probe.cap-1WrMhWHx.js +250 -0
- package/system/dist/platform-probe.cap-BFeqFLtQ.mjs +233 -0
- package/system/dist/prefix-walk-B4b2-9aK.mjs +790 -0
- package/system/dist/prefix-walk-DC0ljmbB.js +843 -0
- package/system/dist/ptz-autotrack.cap-BW7w0zHD.js +229 -0
- package/system/dist/ptz-autotrack.cap-DT2GypXw.mjs +224 -0
- package/system/dist/quantity-D3g5SxsZ.mjs +114 -0
- package/system/dist/quantity-lY1KiTSZ.js +143 -0
- package/system/dist/raw-secret-migration-DxuBFtvi.js +50 -0
- package/system/dist/raw-secret-migration-iv88mLoc.mjs +39 -0
- package/system/dist/record-entries.cap-sMUhTvTU.mjs +75 -0
- package/system/dist/record-entries.cap-ti1C046R.js +80 -0
- package/system/dist/record-kind-DoBfYHCs.js +203 -0
- package/system/dist/record-kind-ub6NXqfh.mjs +162 -0
- package/system/dist/recording-archive.cap-7OrIn9e5.mjs +1299 -0
- package/system/dist/recording-archive.cap-D7bo-QSM.js +1328 -0
- package/system/dist/records.cap-ClcWV64i.js +329 -0
- package/system/dist/records.cap-CwLT2ByG.mjs +294 -0
- package/system/dist/relocate-CdVQAk-w.js +804 -0
- package/system/dist/relocate-CoZZTui1.mjs +661 -0
- package/system/dist/rename-composition-block-7WIICIDq.mjs +33525 -0
- package/system/dist/rename-composition-block-CcWLwVhG.js +34692 -0
- package/system/dist/{restore-archive-BJfyu0sG.mjs → restore-archive-CjAyKpgX.mjs} +96 -94
- package/system/dist/{restore-archive-CIFvqOze.js → restore-archive-CkTkv3Ss.js} +6 -4
- package/system/dist/scoped-settings-CylSSq_8.js +955 -0
- package/system/dist/scoped-settings-DVWUIP7Z.mjs +650 -0
- package/system/dist/server-name-BIhLuHvX.mjs +35 -0
- package/system/dist/server-name-OALNvpqC.js +52 -0
- package/system/dist/settings-store.cap-Ci4F2zul.mjs +569 -0
- package/system/dist/settings-store.cap-wlJhCspr.js +640 -0
- package/system/dist/snapshot.cap-3suPdBHV.js +250 -0
- package/system/dist/snapshot.cap-Bs8Oyaqh.mjs +245 -0
- package/system/dist/source-info-DGB7SdB_.mjs +190 -0
- package/system/dist/source-info-DtWf4k2j.js +225 -0
- package/system/dist/storage-admin.cap-BSv1NjKJ.mjs +883 -0
- package/system/dist/storage-admin.cap-he0OqvVM.js +906 -0
- package/system/dist/storage-location-CBT8GCD6.mjs +163 -0
- package/system/dist/storage-location-CTweDMZf.js +198 -0
- package/system/dist/storage-location-mode-B21UVRRX.mjs +167 -0
- package/system/dist/storage-location-mode-CS4sMzo-.js +232 -0
- package/system/dist/storage-migration.cap-CyyATY_p.js +330 -0
- package/system/dist/storage-migration.cap-D7QqGobp.mjs +313 -0
- package/system/dist/storage-occupancy.cap-2rmnS58Z.js +622 -0
- package/system/dist/storage-occupancy.cap-CqBztTl9.mjs +611 -0
- package/system/dist/storage-provider.cap-Bw0CfxVc.js +213 -0
- package/system/dist/storage-provider.cap-CMeck2w4.mjs +202 -0
- package/system/dist/stream-catalog.cap-Bp7SkgIf.mjs +6560 -0
- package/system/dist/stream-catalog.cap-D3uwePiA.js +6763 -0
- package/system/dist/streaming-shared-B8cXatuU.mjs +431 -0
- package/system/dist/streaming-shared-DQwFZOSi.js +526 -0
- package/system/dist/system-reasons-Be_k1W8g.js +25 -0
- package/system/dist/system-reasons-CYj4qwyS.mjs +20 -0
- package/system/dist/tag-BxLazvVb.js +2138 -0
- package/system/dist/tag-uZBAq6ox.mjs +2073 -0
- package/system/dist/user-management.cap-B9QDu8NE.js +825 -0
- package/system/dist/user-management.cap-DBIi77sB.mjs +766 -0
- package/system/dist/vector-store.cap-DnyfrYDn.js +330 -0
- package/system/dist/vector-store.cap-h2GHWQ1t.mjs +319 -0
- package/system/dist/{wal-maintenance-CTrCPzds.mjs → wal-maintenance-BG01rOn9.mjs} +0 -0
- package/system/dist/{wal-maintenance-dq7T3quB.js → wal-maintenance-DyrebYKF.js} +0 -0
- package/system/dist/zod-secret-DS7mj1bk.js +78 -0
- package/system/dist/zod-secret-zY4nM61M.mjs +73 -0
- package/system/package.json +1 -1
- package/system/dist/composition-sources-BI614LJx.mjs +0 -141
- package/system/dist/composition-sources-v_kkb8A9.js +0 -152
- package/system/dist/coral-accelerators-BSVsBVzt.js +0 -250
- package/system/dist/coral-accelerators-BW3OcrLD.mjs +0 -231
- package/system/dist/dist-BCHMSqzc.mjs +0 -143467
- package/system/dist/dist-BZfvhfS1.js +0 -146970
- package/system/dist/prefix-walk-DAOBSyH1.mjs +0 -88
- package/system/dist/prefix-walk-Dv6MLZlM.js +0 -99
- package/system/dist/rename-composition-block-C9HuBrKS.js +0 -112
- package/system/dist/rename-composition-block-DtaYmYAR.mjs +0 -101
|
@@ -0,0 +1,622 @@
|
|
|
1
|
+
const require_capability_definition = require("./capability-definition-HCmTem8c.js");
|
|
2
|
+
const require_system_reasons = require("./system-reasons-Be_k1W8g.js");
|
|
3
|
+
const require_settings_store_cap = require("./settings-store.cap-wlJhCspr.js");
|
|
4
|
+
const require_database_snapshot_cap = require("./database-snapshot.cap-DF38e-0P.js");
|
|
5
|
+
let zod = require("zod");
|
|
6
|
+
//#region ../types/dist/esm/capabilities/backup.cap.mjs
|
|
7
|
+
/**
|
|
8
|
+
* Orchestrator-side destination metadata. The orchestrator computes
|
|
9
|
+
* `id = <addonId>:<subId>` from its provider lookup so consumers
|
|
10
|
+
* (admin UI, restore flow) see one canonical key.
|
|
11
|
+
*
|
|
12
|
+
* Phase 4 (admin UI redesign) adds the per-destination policy fields
|
|
13
|
+
* (`enabled`, `retentionCount`, `label`) so the destinations table can
|
|
14
|
+
* render the joined view without a follow-up round-trip. The backend
|
|
15
|
+
* already joins these in `listDestinations` — we now surface them on
|
|
16
|
+
* the wire.
|
|
17
|
+
*
|
|
18
|
+
* `lastSuccessAt` / `lastSuccessSizeBytes` are computed from each
|
|
19
|
+
* location's `manifests.json` (newest archive). Optional — locations
|
|
20
|
+
* with no archives yet leave them undefined.
|
|
21
|
+
*/
|
|
22
|
+
var BackupDestinationInfoSchema = /* @__PURE__ */ (/* @__PURE__ */ zod.z.object({
|
|
23
|
+
/**
|
|
24
|
+
* Sub-id within this addon. Convention `default` for single-
|
|
25
|
+
* destination addons; addons that host many (S3 with N buckets)
|
|
26
|
+
* pick stable per-bucket strings. The orchestrator stitches
|
|
27
|
+
* `<manifestId>:<subId>` for the wire format.
|
|
28
|
+
*/
|
|
29
|
+
subId: /* @__PURE__ */ zod.z.string(),
|
|
30
|
+
displayName: /* @__PURE__ */ zod.z.string(),
|
|
31
|
+
description: /* @__PURE__ */ zod.z.string().optional(),
|
|
32
|
+
kind: /* @__PURE__ */ zod.z.string(),
|
|
33
|
+
triggerSupported: /* @__PURE__ */ zod.z.boolean(),
|
|
34
|
+
restoreSupported: /* @__PURE__ */ zod.z.boolean()
|
|
35
|
+
})).extend({
|
|
36
|
+
/** `<addonId>:<subId>` — globally-unique dispatch key. */
|
|
37
|
+
id: /* @__PURE__ */ zod.z.string(),
|
|
38
|
+
/**
|
|
39
|
+
* Manifest id of the owning addon. The Settings button on the
|
|
40
|
+
* destination card opens that addon's scoped settings panel.
|
|
41
|
+
*/
|
|
42
|
+
addonId: /* @__PURE__ */ zod.z.string(),
|
|
43
|
+
/** Operator-toggled enable flag from the destination-policy table. */
|
|
44
|
+
enabled: /* @__PURE__ */ zod.z.boolean(),
|
|
45
|
+
/** Operator-defined retention count (archives kept per destination). */
|
|
46
|
+
retentionCount: /* @__PURE__ */ zod.z.number(),
|
|
47
|
+
/** Operator-defined display label (overrides storage location displayName). */
|
|
48
|
+
label: /* @__PURE__ */ zod.z.string().optional(),
|
|
49
|
+
/** Newest-archive timestamp from `manifests.json`, or undefined. */
|
|
50
|
+
lastSuccessAt: /* @__PURE__ */ zod.z.number().optional(),
|
|
51
|
+
/** Newest-archive size from `manifests.json`, or undefined. */
|
|
52
|
+
lastSuccessSizeBytes: /* @__PURE__ */ zod.z.number().optional(),
|
|
53
|
+
/**
|
|
54
|
+
* Cron cadence(s) of the ENABLED schedules that fan out to this
|
|
55
|
+
* destination, comma-joined. Absent when no enabled schedule targets it
|
|
56
|
+
* — a destination nothing is scheduled to write to must not advertise a
|
|
57
|
+
* cadence (D384). This is never the `backup_destination_policies.cron`
|
|
58
|
+
* column: that per-location cron has scheduled nothing since 2026-07-28
|
|
59
|
+
* and reading it made a destination with a DISABLED schedule claim a
|
|
60
|
+
* nightly run.
|
|
61
|
+
*/
|
|
62
|
+
cron: /* @__PURE__ */ zod.z.string().optional(),
|
|
63
|
+
/** ms-epoch of the next firing across those schedules (earliest), if any. */
|
|
64
|
+
nextRunAt: /* @__PURE__ */ zod.z.number().optional(),
|
|
65
|
+
/**
|
|
66
|
+
* ms-epoch of the last time a run ATTEMPTED to write here — success or
|
|
67
|
+
* failure. Never a success stamp: pair it with `lastSuccessAt` (the
|
|
68
|
+
* newest archive that actually landed) and `lastError`.
|
|
69
|
+
*/
|
|
70
|
+
lastAttemptAt: /* @__PURE__ */ zod.z.number().optional(),
|
|
71
|
+
/**
|
|
72
|
+
* Why the last attempt failed, verbatim. Absent when the last attempt
|
|
73
|
+
* landed the archive. A destination that has never been written to has
|
|
74
|
+
* neither this nor `lastAttemptAt`.
|
|
75
|
+
*/
|
|
76
|
+
lastError: /* @__PURE__ */ zod.z.string().optional()
|
|
77
|
+
});
|
|
78
|
+
/**
|
|
79
|
+
* How an archive is encrypted (operator decision 2026-10-09): to a backup
|
|
80
|
+
* PUBLIC key the hub holds, so only the operator's secret key opens it.
|
|
81
|
+
* Absent on a plain `.tar.gz` — every archive made before encryption, or
|
|
82
|
+
* with it off — which restores without a key.
|
|
83
|
+
*/
|
|
84
|
+
var BackupArchiveEncryptionSchema = /* @__PURE__ */ zod.z.object({
|
|
85
|
+
/** `x25519-hkdf-aes256gcm-stream-v1`. */
|
|
86
|
+
scheme: /* @__PURE__ */ zod.z.string(),
|
|
87
|
+
/** 16 hex — the backup key whose secret restores this archive. */
|
|
88
|
+
keyId: /* @__PURE__ */ zod.z.string()
|
|
89
|
+
});
|
|
90
|
+
/**
|
|
91
|
+
* The backup encryption setting. The hub keeps PUBLIC keys only: the active
|
|
92
|
+
* one new archives are encrypted to, and the retired ones older archives
|
|
93
|
+
* still need. The secret key is shown once, at `setupEncryption`.
|
|
94
|
+
*/
|
|
95
|
+
var BackupEncryptionStatusSchema = /* @__PURE__ */ zod.z.object({
|
|
96
|
+
enabled: /* @__PURE__ */ zod.z.boolean(),
|
|
97
|
+
active: /* @__PURE__ */ zod.z.object({
|
|
98
|
+
keyId: /* @__PURE__ */ zod.z.string(),
|
|
99
|
+
publicKey: /* @__PURE__ */ zod.z.string(),
|
|
100
|
+
createdAt: /* @__PURE__ */ zod.z.number()
|
|
101
|
+
}).nullable(),
|
|
102
|
+
/** Every key ever set up, newest first. */
|
|
103
|
+
keys: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.object({
|
|
104
|
+
keyId: /* @__PURE__ */ zod.z.string(),
|
|
105
|
+
createdAt: /* @__PURE__ */ zod.z.number(),
|
|
106
|
+
retiredAt: /* @__PURE__ */ zod.z.number().nullable()
|
|
107
|
+
})).readonly()
|
|
108
|
+
});
|
|
109
|
+
/**
|
|
110
|
+
* Per-archive entry returned by `backup.listArchives({ destinationId })`.
|
|
111
|
+
* Same shape the destination drill-in renders. Sourced from the per-
|
|
112
|
+
* location `manifests.json` (no per-archive tarball read required).
|
|
113
|
+
*/
|
|
114
|
+
var BackupArchiveEntrySchema = /* @__PURE__ */ zod.z.object({
|
|
115
|
+
id: /* @__PURE__ */ zod.z.string(),
|
|
116
|
+
filename: /* @__PURE__ */ zod.z.string(),
|
|
117
|
+
createdAt: /* @__PURE__ */ zod.z.number(),
|
|
118
|
+
sizeBytes: /* @__PURE__ */ zod.z.number(),
|
|
119
|
+
label: /* @__PURE__ */ zod.z.string().optional(),
|
|
120
|
+
/** Top-level locations included in the archive (db, addons, tls, …). */
|
|
121
|
+
locations: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.string()).readonly(),
|
|
122
|
+
/** Present when the archive is encrypted; restore then needs that key. */
|
|
123
|
+
encryption: /* @__PURE__ */ BackupArchiveEncryptionSchema.optional(),
|
|
124
|
+
/**
|
|
125
|
+
* The databases the run asked to carry (its retention class). Absent on an
|
|
126
|
+
* archive made before several files were owned: that was `['settings']`.
|
|
127
|
+
*/
|
|
128
|
+
databases: /* @__PURE__ */ zod.z.array(require_settings_store_cap.DataStoreDatabaseSchema).readonly().optional()
|
|
129
|
+
});
|
|
130
|
+
var BackupEntrySchema = /* @__PURE__ */ zod.z.object({
|
|
131
|
+
id: /* @__PURE__ */ zod.z.string(),
|
|
132
|
+
/** Addon id of the destination that owns this backup (e.g. `local-backup`, `s3-backup`). */
|
|
133
|
+
destinationId: /* @__PURE__ */ zod.z.string().optional(),
|
|
134
|
+
label: /* @__PURE__ */ zod.z.string().optional(),
|
|
135
|
+
createdAt: /* @__PURE__ */ zod.z.number(),
|
|
136
|
+
sizeBytes: /* @__PURE__ */ zod.z.number(),
|
|
137
|
+
locations: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.string()).optional(),
|
|
138
|
+
encryption: /* @__PURE__ */ BackupArchiveEncryptionSchema.optional()
|
|
139
|
+
});
|
|
140
|
+
var ArchiveEntrySchema = /* @__PURE__ */ zod.z.object({
|
|
141
|
+
path: /* @__PURE__ */ zod.z.string(),
|
|
142
|
+
kind: /* @__PURE__ */ zod.z.enum([
|
|
143
|
+
"file",
|
|
144
|
+
"dir",
|
|
145
|
+
"symlink"
|
|
146
|
+
]),
|
|
147
|
+
sizeBytes: /* @__PURE__ */ zod.z.number(),
|
|
148
|
+
mtime: /* @__PURE__ */ zod.z.number()
|
|
149
|
+
});
|
|
150
|
+
var ArchiveManifestSchema = /* @__PURE__ */ zod.z.object({
|
|
151
|
+
archiveVersion: /* @__PURE__ */ zod.z.literal(1),
|
|
152
|
+
createdAt: /* @__PURE__ */ zod.z.number(),
|
|
153
|
+
dataDir: /* @__PURE__ */ zod.z.string(),
|
|
154
|
+
locations: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.string()),
|
|
155
|
+
entries: /* @__PURE__ */ zod.z.array(ArchiveEntrySchema),
|
|
156
|
+
totalBytes: /* @__PURE__ */ zod.z.number(),
|
|
157
|
+
totalFiles: /* @__PURE__ */ zod.z.number(),
|
|
158
|
+
/**
|
|
159
|
+
* Live SQLite databases this archive carries as their OWNER's verified
|
|
160
|
+
* snapshot instead of as files (D693). Absent on archives made before.
|
|
161
|
+
*/
|
|
162
|
+
sqliteSnapshots: /* @__PURE__ */ zod.z.array(require_database_snapshot_cap.ArchiveSqliteSnapshotSchema).optional(),
|
|
163
|
+
/**
|
|
164
|
+
* Owned database files the run did NOT carry (not selected): left out of the
|
|
165
|
+
* tar and the entry list alike. Absent when every owned file was carried.
|
|
166
|
+
*/
|
|
167
|
+
omittedDatabases: /* @__PURE__ */ zod.z.array(require_settings_store_cap.DataStoreDatabaseSchema).optional()
|
|
168
|
+
});
|
|
169
|
+
var LocationStatSchema = /* @__PURE__ */ zod.z.object({
|
|
170
|
+
name: /* @__PURE__ */ zod.z.string(),
|
|
171
|
+
sizeBytes: /* @__PURE__ */ zod.z.number(),
|
|
172
|
+
fileCount: /* @__PURE__ */ zod.z.number(),
|
|
173
|
+
present: /* @__PURE__ */ zod.z.boolean()
|
|
174
|
+
});
|
|
175
|
+
/** Lifecycle of a backup run. Terminal states: succeeded / failed / cancelled. */
|
|
176
|
+
var BackupRunStateSchema = /* @__PURE__ */ zod.z.enum([
|
|
177
|
+
"queued",
|
|
178
|
+
"running",
|
|
179
|
+
"succeeded",
|
|
180
|
+
"failed",
|
|
181
|
+
"cancelled"
|
|
182
|
+
]);
|
|
183
|
+
/**
|
|
184
|
+
* Where a running backup currently is. `queued` before it starts,
|
|
185
|
+
* `building` while the tar.gz is being staged, `uploading` during the
|
|
186
|
+
* per-destination fan-out, `done` once terminal.
|
|
187
|
+
*/
|
|
188
|
+
var BackupRunPhaseSchema = /* @__PURE__ */ zod.z.enum([
|
|
189
|
+
"queued",
|
|
190
|
+
"building",
|
|
191
|
+
"uploading",
|
|
192
|
+
"done"
|
|
193
|
+
]);
|
|
194
|
+
/**
|
|
195
|
+
* Observable state of one backup run — readable WHILE it runs via
|
|
196
|
+
* `backup.listRuns`. This is what makes the execution queue and
|
|
197
|
+
* `backup.cancel` usable: the 2026-09-04 incident (two concurrent
|
|
198
|
+
* multi-GB builds, staging 5.1 GB → 18 GB, load 62) was only
|
|
199
|
+
* diagnosable with `du` because nothing reported that runs existed or
|
|
200
|
+
* how large the staged archive had grown.
|
|
201
|
+
*/
|
|
202
|
+
var BackupRunSchema = /* @__PURE__ */ zod.z.object({
|
|
203
|
+
/** Stable run id — the handle `backup.cancel` takes. */
|
|
204
|
+
id: /* @__PURE__ */ zod.z.string(),
|
|
205
|
+
state: BackupRunStateSchema,
|
|
206
|
+
phase: BackupRunPhaseSchema,
|
|
207
|
+
/**
|
|
208
|
+
* Resolved destination location ids. Empty while queued (targets are
|
|
209
|
+
* resolved when the run starts, against the then-current policies).
|
|
210
|
+
*/
|
|
211
|
+
destinationIds: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.string()).readonly(),
|
|
212
|
+
label: /* @__PURE__ */ zod.z.string().optional(),
|
|
213
|
+
/** ms-epoch when the run was submitted (trigger call / schedule fire). */
|
|
214
|
+
requestedAt: /* @__PURE__ */ zod.z.number(),
|
|
215
|
+
/** ms-epoch when the run left the queue and started building. */
|
|
216
|
+
startedAt: /* @__PURE__ */ zod.z.number().optional(),
|
|
217
|
+
/** ms-epoch when the run reached a terminal state. */
|
|
218
|
+
finishedAt: /* @__PURE__ */ zod.z.number().optional(),
|
|
219
|
+
/** Compressed bytes of the staging archive written so far. */
|
|
220
|
+
stagedBytes: /* @__PURE__ */ zod.z.number(),
|
|
221
|
+
/** Final staged archive size, once the build phase completes. */
|
|
222
|
+
archiveSizeBytes: /* @__PURE__ */ zod.z.number().optional(),
|
|
223
|
+
/** Bytes pushed to the destination currently uploading. */
|
|
224
|
+
uploadedBytes: /* @__PURE__ */ zod.z.number(),
|
|
225
|
+
/** Destinations where the archive fully landed (uploaded + indexed). */
|
|
226
|
+
completedDestinationIds: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.string()).readonly(),
|
|
227
|
+
/** Destinations that failed during the fan-out. */
|
|
228
|
+
failedDestinationIds: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.string()).readonly(),
|
|
229
|
+
/** Failure message when `state === 'failed'`. */
|
|
230
|
+
error: /* @__PURE__ */ zod.z.string().optional(),
|
|
231
|
+
/**
|
|
232
|
+
* 1-based place in the execution queue — 1 = runs next. Present only
|
|
233
|
+
* while `state === 'queued'`. Stamped by the orchestrator from the
|
|
234
|
+
* queue's OWN pending order, never derived from timestamps, so the
|
|
235
|
+
* UI cannot show an order the executor will not honour.
|
|
236
|
+
*/
|
|
237
|
+
queuePosition: /* @__PURE__ */ zod.z.number().int().min(1).optional()
|
|
238
|
+
});
|
|
239
|
+
/**
|
|
240
|
+
* Result of `backup.trigger`. The call still resolves when the run
|
|
241
|
+
* terminates (compat with schedule-driven runs and the admin UI), but
|
|
242
|
+
* it now names the run and says whether it had to WAIT: a trigger that
|
|
243
|
+
* arrives while another run is in flight is enqueued (or joined onto
|
|
244
|
+
* an identical already-queued run), never started concurrently.
|
|
245
|
+
*/
|
|
246
|
+
var BackupTriggerResultSchema = /* @__PURE__ */ zod.z.object({
|
|
247
|
+
/** The run this trigger mapped to — poll it via `listRuns`, stop it via `cancel`. */
|
|
248
|
+
runId: /* @__PURE__ */ zod.z.string(),
|
|
249
|
+
/** True when the run waited behind an in-flight run instead of starting immediately. */
|
|
250
|
+
queued: /* @__PURE__ */ zod.z.boolean(),
|
|
251
|
+
/** True when this trigger was coalesced onto an identical already-queued run. */
|
|
252
|
+
joined: /* @__PURE__ */ zod.z.boolean(),
|
|
253
|
+
/** True when the run was cancelled before completing every destination. */
|
|
254
|
+
cancelled: /* @__PURE__ */ zod.z.boolean(),
|
|
255
|
+
/** One entry per destination the archive landed at (partial on cancel). */
|
|
256
|
+
entries: /* @__PURE__ */ zod.z.array(BackupEntrySchema).readonly()
|
|
257
|
+
});
|
|
258
|
+
/**
|
|
259
|
+
* A backup schedule — the N:M "entry" that binds one cron cadence to a
|
|
260
|
+
* SET of destination locations. Supersedes the per-location cron on
|
|
261
|
+
* `BackupDestinationPolicy`: an operator creates a schedule, picks the
|
|
262
|
+
* `backups` locations it should write to, and the orchestrator fans a
|
|
263
|
+
* single archive out to all of them when the cron fires.
|
|
264
|
+
*
|
|
265
|
+
* `retentionCount` is per-schedule (D-decision 2026-07-28): every
|
|
266
|
+
* location targeted by this schedule keeps this many archives from
|
|
267
|
+
* this schedule's runs.
|
|
268
|
+
*
|
|
269
|
+
* `dataSources` optionally narrows which top-level state locations
|
|
270
|
+
* (db, addons, tls, …) are archived; omitted = the orchestrator's
|
|
271
|
+
* default full set.
|
|
272
|
+
*/
|
|
273
|
+
var BackupScheduleSchema = /* @__PURE__ */ zod.z.object({
|
|
274
|
+
/** Stable id. Generated by the orchestrator on first upsert if absent. */
|
|
275
|
+
id: /* @__PURE__ */ zod.z.string(),
|
|
276
|
+
/** Operator-facing display name. */
|
|
277
|
+
label: /* @__PURE__ */ zod.z.string(),
|
|
278
|
+
/** 5-field POSIX cron. Empty = disabled cadence (kept for editing). */
|
|
279
|
+
cron: /* @__PURE__ */ zod.z.string(),
|
|
280
|
+
/** Master on/off toggle for the whole schedule. */
|
|
281
|
+
enabled: /* @__PURE__ */ zod.z.boolean(),
|
|
282
|
+
/** `backups`-location ids this schedule writes to (fan-out set). */
|
|
283
|
+
locationIds: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.string()).readonly(),
|
|
284
|
+
/** Archives kept per targeted location for this schedule. */
|
|
285
|
+
retentionCount: /* @__PURE__ */ zod.z.number().int().min(1).max(1e3),
|
|
286
|
+
/** Optional subset of source locations to include; omitted = all. */
|
|
287
|
+
dataSources: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.string()).readonly().optional(),
|
|
288
|
+
/**
|
|
289
|
+
* Which database files this schedule carries. Absent = `['settings']`
|
|
290
|
+
* (an unstated ask is the minimum, D382). Events and history run weekly,
|
|
291
|
+
* settings nightly (D852).
|
|
292
|
+
*/
|
|
293
|
+
databases: /* @__PURE__ */ zod.z.array(require_settings_store_cap.DataStoreDatabaseSchema).readonly().optional(),
|
|
294
|
+
/**
|
|
295
|
+
* ms-epoch of the last tick that FIRED this schedule. Stamped before the
|
|
296
|
+
* archive runs (it is the dedupe anchor), so it says "attempted", never
|
|
297
|
+
* "succeeded" — a run refused by every destination stamps it too.
|
|
298
|
+
*/
|
|
299
|
+
lastAttemptAt: /* @__PURE__ */ zod.z.number().optional(),
|
|
300
|
+
/** ms-epoch of the last run of this schedule that landed at ≥1 destination. */
|
|
301
|
+
lastSuccessAt: /* @__PURE__ */ zod.z.number().optional(),
|
|
302
|
+
/** Why the last fired run failed, verbatim. Absent when it succeeded. */
|
|
303
|
+
lastError: /* @__PURE__ */ zod.z.string().optional(),
|
|
304
|
+
/** ms-epoch of next computed firing (read-only, filled on list). */
|
|
305
|
+
nextRunAt: /* @__PURE__ */ zod.z.number().optional()
|
|
306
|
+
});
|
|
307
|
+
/**
|
|
308
|
+
* backup — singleton capability for backup management.
|
|
309
|
+
*
|
|
310
|
+
* Implemented by `local-backup` addon. Future providers (S3, rsync)
|
|
311
|
+
* can replace it by registering the same capability.
|
|
312
|
+
*/
|
|
313
|
+
var backupCapability = {
|
|
314
|
+
name: "backup",
|
|
315
|
+
scope: "system",
|
|
316
|
+
mode: "singleton",
|
|
317
|
+
methods: {
|
|
318
|
+
/**
|
|
319
|
+
* Flat aggregate of every destination across every registered
|
|
320
|
+
* `backup-destination` provider. This is the orchestrator-side
|
|
321
|
+
* surface; it expands per-addon `listDestinations()` results into
|
|
322
|
+
* one list the UI can render directly.
|
|
323
|
+
*/
|
|
324
|
+
listDestinations: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.void(), /* @__PURE__ */ zod.z.array(BackupDestinationInfoSchema).readonly(), { auth: "admin" }),
|
|
325
|
+
/**
|
|
326
|
+
* Trigger a backup. Without `destinations` the orchestrator fans
|
|
327
|
+
* out to every destination flagged as enabled in the routing
|
|
328
|
+
* config; with it, only the listed addons receive the archive.
|
|
329
|
+
*
|
|
330
|
+
* At most ONE backup run executes at a time — the source tree and
|
|
331
|
+
* the staging disk are shared by every run, so a second trigger
|
|
332
|
+
* while one is in flight is enqueued (or joined onto an identical
|
|
333
|
+
* queued run) and the result says so. See D342.
|
|
334
|
+
*/
|
|
335
|
+
trigger: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({
|
|
336
|
+
/** Subset of registered `backup-destination` addon ids to write to. */
|
|
337
|
+
destinations: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.string()).optional(),
|
|
338
|
+
locations: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.string()).optional(),
|
|
339
|
+
label: /* @__PURE__ */ zod.z.string().optional(),
|
|
340
|
+
/**
|
|
341
|
+
* Per-run retention override applied to every targeted
|
|
342
|
+
* destination. Used by schedule-driven runs (per-entry
|
|
343
|
+
* retention). Omitted = each destination's own policy
|
|
344
|
+
* retention (manual runs).
|
|
345
|
+
*/
|
|
346
|
+
retentionCount: /* @__PURE__ */ zod.z.number().int().min(1).max(1e3).optional(),
|
|
347
|
+
/** Database files to carry; omitted = `['settings']`. */
|
|
348
|
+
databases: /* @__PURE__ */ zod.z.array(require_settings_store_cap.DataStoreDatabaseSchema).optional()
|
|
349
|
+
}).optional(), BackupTriggerResultSchema, {
|
|
350
|
+
kind: "mutation",
|
|
351
|
+
auth: "admin"
|
|
352
|
+
}),
|
|
353
|
+
/**
|
|
354
|
+
* Every run the orchestrator knows about, in EXECUTION order: the
|
|
355
|
+
* running run first, then queued runs in the exact order they will
|
|
356
|
+
* execute (each with `queuePosition`, 1 = next), then the bounded
|
|
357
|
+
* finished history newest-first. Only one run executes at a time
|
|
358
|
+
* (D342) — the queued section IS the line. Each run carries live
|
|
359
|
+
* phase + byte counters so a runaway build is visible in seconds,
|
|
360
|
+
* not via `du`.
|
|
361
|
+
*/
|
|
362
|
+
listRuns: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.void(), /* @__PURE__ */ zod.z.array(BackupRunSchema).readonly(), { auth: "admin" }),
|
|
363
|
+
/**
|
|
364
|
+
* Stop a backup run. Mirrors `storage-migration.cancel` semantics:
|
|
365
|
+
* id in, `{ cancelled }` out — `false` when the run is unknown or
|
|
366
|
+
* already terminal. A QUEUED run is removed before it ever starts;
|
|
367
|
+
* the RUNNING run has its tar/upload stream actually aborted, the
|
|
368
|
+
* half-written staging archive is deleted, and the in-flight
|
|
369
|
+
* destination upload is aborted server-side (partial discarded).
|
|
370
|
+
* Destinations that already completed keep their archive.
|
|
371
|
+
*/
|
|
372
|
+
cancel: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({ runId: /* @__PURE__ */ zod.z.string() }), /* @__PURE__ */ zod.z.object({ cancelled: /* @__PURE__ */ zod.z.boolean() }), {
|
|
373
|
+
kind: "mutation",
|
|
374
|
+
auth: "admin"
|
|
375
|
+
}),
|
|
376
|
+
/** Union of every destination's archives, each tagged with `destinationId`. */
|
|
377
|
+
list: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.void(), /* @__PURE__ */ zod.z.array(BackupEntrySchema).readonly(), { auth: "admin" }),
|
|
378
|
+
/**
|
|
379
|
+
* Pre-backup snapshot of the well-known locations on disk — sizes
|
|
380
|
+
* + file counts. Powers the opt-in checklist that lets the
|
|
381
|
+
* operator pick which subsections of state get archived.
|
|
382
|
+
*/
|
|
383
|
+
listLocations: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.void(), /* @__PURE__ */ zod.z.array(LocationStatSchema).readonly(), { auth: "admin" }),
|
|
384
|
+
/**
|
|
385
|
+
* Read the embedded `.camstack-backup-manifest.json` from a
|
|
386
|
+
* previously-created archive. The manifest carries the full
|
|
387
|
+
* file/dir listing with sizes + mtimes — the readdir snapshot
|
|
388
|
+
* the UI shows in the "Contents" panel. Returns `null` when the
|
|
389
|
+
* archive predates manifests (created before this feature
|
|
390
|
+
* shipped).
|
|
391
|
+
*/
|
|
392
|
+
getEntries: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({
|
|
393
|
+
destinationId: /* @__PURE__ */ zod.z.string(),
|
|
394
|
+
backupId: /* @__PURE__ */ zod.z.string()
|
|
395
|
+
}), /* @__PURE__ */ ArchiveManifestSchema.nullable(), { auth: "admin" }),
|
|
396
|
+
restore: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({
|
|
397
|
+
destinationId: /* @__PURE__ */ zod.z.string(),
|
|
398
|
+
backupId: /* @__PURE__ */ zod.z.string(),
|
|
399
|
+
/**
|
|
400
|
+
* Optional whitelist — only restore these top-level locations
|
|
401
|
+
* from the archive. Default = every location the archive
|
|
402
|
+
* carries (full restore). The boot-time apply hook reads
|
|
403
|
+
* this list and skips entries whose path doesn't start with
|
|
404
|
+
* any of them.
|
|
405
|
+
*/
|
|
406
|
+
locations: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.string()).optional(),
|
|
407
|
+
/**
|
|
408
|
+
* The backup SECRET key, for an encrypted archive (ignored for a plain
|
|
409
|
+
* one). The archive is decrypted into the hub's private staging
|
|
410
|
+
* before the restart; the key is not stored. A wrong or missing key
|
|
411
|
+
* is refused before the archive is downloaded.
|
|
412
|
+
*/
|
|
413
|
+
backupSecretKey: /* @__PURE__ */ zod.z.string().optional()
|
|
414
|
+
}), /* @__PURE__ */ zod.z.void(), {
|
|
415
|
+
kind: "mutation",
|
|
416
|
+
auth: "admin"
|
|
417
|
+
}),
|
|
418
|
+
/** The encryption setting — public keys only. */
|
|
419
|
+
getEncryption: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.void(), BackupEncryptionStatusSchema, { auth: "admin" }),
|
|
420
|
+
/**
|
|
421
|
+
* Turn encryption on, or replace the key: generates a new key pair, keeps
|
|
422
|
+
* the PUBLIC key, and returns the SECRET key — once. It is never stored
|
|
423
|
+
* on the hub and cannot be shown again; archives made from now on need
|
|
424
|
+
* it to be restored. A previous key is retired: archives made with it
|
|
425
|
+
* still need IT.
|
|
426
|
+
*/
|
|
427
|
+
setupEncryption: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({}), /* @__PURE__ */ zod.z.object({
|
|
428
|
+
keyId: /* @__PURE__ */ zod.z.string(),
|
|
429
|
+
secretKey: /* @__PURE__ */ zod.z.string(),
|
|
430
|
+
publicKey: /* @__PURE__ */ zod.z.string(),
|
|
431
|
+
createdAt: /* @__PURE__ */ zod.z.number(),
|
|
432
|
+
replacedKeyId: /* @__PURE__ */ zod.z.string().nullable()
|
|
433
|
+
}), {
|
|
434
|
+
kind: "mutation",
|
|
435
|
+
auth: "admin"
|
|
436
|
+
}),
|
|
437
|
+
/** New archives are plain again. Existing encrypted archives keep needing their key. */
|
|
438
|
+
disableEncryption: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({}), /* @__PURE__ */ zod.z.object({ disabledKeyId: /* @__PURE__ */ zod.z.string().nullable() }), {
|
|
439
|
+
kind: "mutation",
|
|
440
|
+
auth: "admin"
|
|
441
|
+
}),
|
|
442
|
+
/**
|
|
443
|
+
* Does this secret key parse, and which backup key is it? A mutation so
|
|
444
|
+
* the key never travels in a URL. Nothing is stored.
|
|
445
|
+
*/
|
|
446
|
+
checkBackupKey: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({ backupSecretKey: /* @__PURE__ */ zod.z.string() }), /* @__PURE__ */ zod.z.object({
|
|
447
|
+
valid: /* @__PURE__ */ zod.z.boolean(),
|
|
448
|
+
keyId: /* @__PURE__ */ zod.z.string().nullable(),
|
|
449
|
+
/** The hub knows this key (active or retired). */
|
|
450
|
+
known: /* @__PURE__ */ zod.z.boolean(),
|
|
451
|
+
/** It is the key new archives are encrypted to. */
|
|
452
|
+
active: /* @__PURE__ */ zod.z.boolean(),
|
|
453
|
+
error: /* @__PURE__ */ zod.z.string().optional()
|
|
454
|
+
}), {
|
|
455
|
+
kind: "mutation",
|
|
456
|
+
auth: "admin"
|
|
457
|
+
}),
|
|
458
|
+
delete: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({
|
|
459
|
+
destinationId: /* @__PURE__ */ zod.z.string(),
|
|
460
|
+
backupId: /* @__PURE__ */ zod.z.string()
|
|
461
|
+
}), /* @__PURE__ */ zod.z.void(), {
|
|
462
|
+
kind: "mutation",
|
|
463
|
+
auth: "admin"
|
|
464
|
+
}),
|
|
465
|
+
/**
|
|
466
|
+
* List archives at a single destination. Reads the per-location
|
|
467
|
+
* `manifests.json` and returns one entry per archive (newest
|
|
468
|
+
* first). Powers the destinations-table drill-in in admin UI.
|
|
469
|
+
*/
|
|
470
|
+
listArchives: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({ destinationId: /* @__PURE__ */ zod.z.string() }), /* @__PURE__ */ zod.z.array(BackupArchiveEntrySchema).readonly(), { auth: "admin" }),
|
|
471
|
+
/**
|
|
472
|
+
* Upsert a per-destination policy row. The `locationId` MUST be
|
|
473
|
+
* the id of an existing `backups`-typed `StorageLocation`. Used
|
|
474
|
+
* by the admin-UI destinations table (enable toggle + retention
|
|
475
|
+
* input + optional label).
|
|
476
|
+
*/
|
|
477
|
+
upsertDestinationPolicy: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({
|
|
478
|
+
locationId: /* @__PURE__ */ zod.z.string(),
|
|
479
|
+
enabled: /* @__PURE__ */ zod.z.boolean(),
|
|
480
|
+
retentionCount: /* @__PURE__ */ zod.z.number().int().min(1).max(1e3),
|
|
481
|
+
label: /* @__PURE__ */ zod.z.string().optional()
|
|
482
|
+
}), /* @__PURE__ */ zod.z.void(), {
|
|
483
|
+
kind: "mutation",
|
|
484
|
+
auth: "admin"
|
|
485
|
+
}),
|
|
486
|
+
/**
|
|
487
|
+
* Validate a cron expression and peek the next N firing times.
|
|
488
|
+
* Used by the admin-UI CronEditor to render a live "next-run"
|
|
489
|
+
* preview as the operator edits the pattern.
|
|
490
|
+
*/
|
|
491
|
+
previewSchedule: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({
|
|
492
|
+
cron: /* @__PURE__ */ zod.z.string(),
|
|
493
|
+
count: /* @__PURE__ */ zod.z.number().int().min(1).max(20).optional()
|
|
494
|
+
}), /* @__PURE__ */ zod.z.object({
|
|
495
|
+
ok: /* @__PURE__ */ zod.z.boolean(),
|
|
496
|
+
error: /* @__PURE__ */ zod.z.string().optional(),
|
|
497
|
+
nextRuns: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.number()).readonly()
|
|
498
|
+
})),
|
|
499
|
+
/**
|
|
500
|
+
* List every backup schedule (the N:M entries), each with its
|
|
501
|
+
* computed `nextRunAt`. Powers the Schedules section of the
|
|
502
|
+
* admin-UI Backups page.
|
|
503
|
+
*/
|
|
504
|
+
listSchedules: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.void(), /* @__PURE__ */ zod.z.array(BackupScheduleSchema).readonly(), { auth: "admin" }),
|
|
505
|
+
/**
|
|
506
|
+
* The database files that exist on this hub right now (the owner's open
|
|
507
|
+
* files), so the selection UI can offer all of them and mark a file that
|
|
508
|
+
* is not created yet. `answered: false` = the owner did not answer, which
|
|
509
|
+
* is not the same as "none exist".
|
|
510
|
+
*/
|
|
511
|
+
listAvailableDatabases: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.void(), /* @__PURE__ */ zod.z.object({
|
|
512
|
+
answered: /* @__PURE__ */ zod.z.boolean(),
|
|
513
|
+
databases: /* @__PURE__ */ zod.z.array(require_settings_store_cap.DataStoreDatabaseSchema).readonly()
|
|
514
|
+
}), { auth: "admin" }),
|
|
515
|
+
/**
|
|
516
|
+
* Create or replace a schedule. An empty / absent `id` mints a new
|
|
517
|
+
* one; a present `id` replaces in place. `cron` is validated
|
|
518
|
+
* server-side; `locationIds` must reference existing `backups`
|
|
519
|
+
* locations (unknown ids are dropped with a warning).
|
|
520
|
+
*/
|
|
521
|
+
upsertSchedule: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({
|
|
522
|
+
id: /* @__PURE__ */ zod.z.string().optional(),
|
|
523
|
+
label: /* @__PURE__ */ zod.z.string(),
|
|
524
|
+
cron: /* @__PURE__ */ zod.z.string(),
|
|
525
|
+
enabled: /* @__PURE__ */ zod.z.boolean(),
|
|
526
|
+
locationIds: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.string()).readonly(),
|
|
527
|
+
retentionCount: /* @__PURE__ */ zod.z.number().int().min(1).max(1e3),
|
|
528
|
+
dataSources: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.string()).readonly().optional(),
|
|
529
|
+
databases: /* @__PURE__ */ zod.z.array(require_settings_store_cap.DataStoreDatabaseSchema).readonly().optional()
|
|
530
|
+
}), BackupScheduleSchema, {
|
|
531
|
+
kind: "mutation",
|
|
532
|
+
auth: "admin"
|
|
533
|
+
}),
|
|
534
|
+
/** Delete a schedule by id. Does not touch the target locations. */
|
|
535
|
+
deleteSchedule: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({ id: /* @__PURE__ */ zod.z.string() }), /* @__PURE__ */ zod.z.void(), {
|
|
536
|
+
kind: "mutation",
|
|
537
|
+
auth: "admin"
|
|
538
|
+
})
|
|
539
|
+
},
|
|
540
|
+
vocabulary: { notOperatorFacing: "system backups — run and restored from the Backups page" }
|
|
541
|
+
};
|
|
542
|
+
//#endregion
|
|
543
|
+
//#region ../types/dist/esm/capabilities/storage-occupancy.cap.mjs
|
|
544
|
+
/**
|
|
545
|
+
* `storage-occupancy` — how many bytes an addon actually HOLDS on a storage
|
|
546
|
+
* location (D388).
|
|
547
|
+
*
|
|
548
|
+
* ## Why this is not `storage-evictable`
|
|
549
|
+
*
|
|
550
|
+
* `storage-evictable.getEvictableUsage` looks like the same question and is
|
|
551
|
+
* not, in two ways that both matter and both bite hardest on the locations an
|
|
552
|
+
* operator most wants a figure for:
|
|
553
|
+
*
|
|
554
|
+
* - it reports the whole eviction DOMAIN, not the location. `recordings:default`
|
|
555
|
+
* and `recordingsLow:default` deliberately share one root and evict as one
|
|
556
|
+
* oldest-first pool, so both answer with the SAME combined total. As an
|
|
557
|
+
* occupancy figure that double-counts the disk.
|
|
558
|
+
* - it reports ZERO for a location whose eviction policy is `never` (D385) —
|
|
559
|
+
* a `readonly` or `disabled` disk. Those are exactly the disks an operator
|
|
560
|
+
* is retiring and staring at.
|
|
561
|
+
*
|
|
562
|
+
* So this is its own contract with its own quantity, and the quantity is
|
|
563
|
+
* OCCUPIED: every byte the addon holds on that location, whether or not it
|
|
564
|
+
* would ever be willing to delete it. A provider that can only answer
|
|
565
|
+
* "evictable" must not register here — a number that silently means different
|
|
566
|
+
* things per class is worse than no number.
|
|
567
|
+
*
|
|
568
|
+
* ## Absence is an answer
|
|
569
|
+
*
|
|
570
|
+
* A location nobody reports for is UNKNOWN, never zero (D315). The orchestrator
|
|
571
|
+
* stamps `StorageLocation.owned` only for locations it has a report for, and
|
|
572
|
+
* the field is an OBJECT rather than a bare number so that a `?? 0` on the
|
|
573
|
+
* consuming side has to be written out loud instead of appearing by accident.
|
|
574
|
+
*
|
|
575
|
+
* `internal: true` — consumed by the orchestrator's `listLocations` stamp, never
|
|
576
|
+
* a public client surface. Clients read the stamped `StorageLocation.owned`.
|
|
577
|
+
*/
|
|
578
|
+
/** One provider's occupancy answer for one location. */
|
|
579
|
+
var StorageOccupancyReportSchema = /* @__PURE__ */ zod.z.object({
|
|
580
|
+
locationId: /* @__PURE__ */ zod.z.string(),
|
|
581
|
+
/** Bytes this provider holds on THAT location — not its eviction domain, and
|
|
582
|
+
* not net of what it is willing to delete. */
|
|
583
|
+
ownedBytes: /* @__PURE__ */ zod.z.number().int().nonnegative(),
|
|
584
|
+
/** When the provider last actually measured this. The orchestrator carries it
|
|
585
|
+
* through so a UI can say how old the figure is instead of implying "now". */
|
|
586
|
+
measuredAtMs: /* @__PURE__ */ zod.z.number().int().nonnegative()
|
|
587
|
+
});
|
|
588
|
+
var storageOccupancyCapability = {
|
|
589
|
+
name: "storage-occupancy",
|
|
590
|
+
scope: "system",
|
|
591
|
+
mode: "collection",
|
|
592
|
+
internal: true,
|
|
593
|
+
methods: {
|
|
594
|
+
/**
|
|
595
|
+
* Occupancy for the given locations, in ONE round trip.
|
|
596
|
+
*
|
|
597
|
+
* A provider answers only for the locations it actually holds bytes on and
|
|
598
|
+
* OMITS the rest — an omitted location is "I hold nothing measurable here",
|
|
599
|
+
* which the orchestrator merges as a contribution of nothing rather than as
|
|
600
|
+
* a claim that the location is empty. Only a location no provider reports
|
|
601
|
+
* at all stays unknown.
|
|
602
|
+
*
|
|
603
|
+
* This must be CHEAP and must never walk a filesystem: it is on the admin
|
|
604
|
+
* UI's `listLocations` path. The owner keeps its own figure fresh (D224) and
|
|
605
|
+
* answers from what it already has.
|
|
606
|
+
*/
|
|
607
|
+
getOccupancy: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({ locationIds: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.string()).readonly() }), /* @__PURE__ */ zod.z.array(StorageOccupancyReportSchema).readonly(), { auth: "admin" }) },
|
|
608
|
+
vocabulary: { notOperatorFacing: require_system_reasons.NOT_A_DEVICE.STORAGE }
|
|
609
|
+
};
|
|
610
|
+
//#endregion
|
|
611
|
+
Object.defineProperty(exports, "backupCapability", {
|
|
612
|
+
enumerable: true,
|
|
613
|
+
get: function() {
|
|
614
|
+
return backupCapability;
|
|
615
|
+
}
|
|
616
|
+
});
|
|
617
|
+
Object.defineProperty(exports, "storageOccupancyCapability", {
|
|
618
|
+
enumerable: true,
|
|
619
|
+
get: function() {
|
|
620
|
+
return storageOccupancyCapability;
|
|
621
|
+
}
|
|
622
|
+
});
|