@camstack/system 1.2.439 → 1.2.440
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 +743 -79
- package/dist/addon-runner.mjs +743 -79
- package/dist/addon-utils.js +1 -1
- package/dist/addon-utils.mjs +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/dist/builtins/alerts/alerts.addon.js +1 -1
- package/dist/builtins/alerts/alerts.addon.mjs +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 +2 -2
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
- package/dist/builtins/calendars/calendars.addon.js +1 -1
- package/dist/builtins/calendars/calendars.addon.mjs +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/block-settings-store.d.ts +1 -1
- package/dist/builtins/core-blocks/core-blocks.addon.js +77 -11
- package/dist/builtins/core-blocks/core-blocks.addon.mjs +77 -12
- package/dist/builtins/core-blocks/index.mjs +1 -1
- package/dist/builtins/device-manager/device-manager.addon.js +181 -59
- package/dist/builtins/device-manager/device-manager.addon.mjs +180 -60
- package/dist/builtins/device-manager/device-removal-hooks.d.ts +0 -11
- package/dist/builtins/hub-forwarder/index.js +1 -1
- package/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/dist/builtins/keychain/index.js +29 -11
- package/dist/builtins/keychain/index.mjs +29 -11
- package/dist/builtins/keychain/keychain-service.d.ts +8 -0
- 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 +2 -2
- package/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
- 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 +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
- package/dist/builtins/platform-probe/index.js +1 -1
- package/dist/builtins/platform-probe/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/filesystem-storage.addon.js +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
- package/dist/builtins/sqlite-storage/index.js +1 -1
- package/dist/builtins/sqlite-storage/index.mjs +1 -1
- package/dist/builtins/sqlite-storage/sqlite-settings-backend.d.ts +38 -7
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +69 -3
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +69 -3
- package/dist/builtins/sqlite-storage/storage-admin-provider.d.ts +31 -0
- package/dist/builtins/storage-orchestrator/hub-settings-forward.d.ts +3 -3
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +4 -4
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +4 -4
- package/dist/builtins/system-config/system-config.addon.js +2 -2
- package/dist/builtins/system-config/system-config.addon.mjs +283 -283
- package/dist/builtins/winston-logging/index.js +1 -1
- package/dist/builtins/winston-logging/index.mjs +1 -1
- package/dist/{composition-sources-BGOSCGWa.mjs → composition-sources-CS0D7imL.mjs} +1 -1
- package/dist/{composition-sources-B4jC2FC7.js → composition-sources-cBG8fBTu.js} +1 -1
- package/dist/{constants-B92BjObl.mjs → constants-CIzPjw7L.mjs} +1 -1
- package/dist/{constants-BRsjQwi-.js → constants-CRI3QzT4.js} +1 -1
- package/dist/{device-ca-46BUsWD1.mjs → device-ca-DLKXYseS.mjs} +1 -1
- package/dist/{device-ca-DHG9OW2m.js → device-ca-DNHjts4_.js} +1 -1
- package/dist/{dist-yI6kF6r6.mjs → dist-9fcsrFU3.mjs} +237 -25
- package/dist/{dist-BOWdLjoK.js → dist-BKhlcYz6.js} +254 -24
- package/dist/file-host-worker.js +1 -1
- package/dist/file-host-worker.mjs +1 -1
- package/dist/{hub-mdns-ciao-D7S5AJRU.js → hub-mdns-ciao-3Zc9G9MS.js} +1 -1
- package/dist/{hub-mdns-ciao-DGwVc2uh.mjs → hub-mdns-ciao-Dy2YjRqC.mjs} +1 -1
- package/dist/index.js +336 -336
- package/dist/index.mjs +337 -337
- package/dist/kernel/addon-settings-store.d.ts +43 -0
- package/dist/kernel/config-manager.d.ts +0 -19
- package/dist/kernel/device-settings-store.d.ts +74 -0
- package/dist/kernel/legacy-blob-guard.d.ts +58 -0
- package/dist/kernel/moleculer/runner-addon-settings.d.ts +34 -0
- package/dist/kernel/moleculer/runner-device-settings.d.ts +39 -0
- package/dist/kernel/prefix-walk.d.ts +39 -0
- package/dist/kernel/sections-store.d.ts +20 -0
- package/dist/kernel/settings-door-view.d.ts +2 -2
- package/dist/kernel/settings-view-types.d.ts +5 -30
- package/dist/kernel/store-settings-view.d.ts +0 -3
- package/dist/prefix-range-D_KueXbQ.js +27 -0
- package/dist/prefix-range-Dl0znowN.mjs +22 -0
- package/dist/prefix-walk-DAOBSyH1.mjs +88 -0
- package/dist/prefix-walk-Dv6MLZlM.js +99 -0
- package/dist/{restore-archive-DiGiI6Jp.js → restore-archive-49aZwkp8.js} +1 -1
- package/dist/{restore-archive-CpdUO-uS.mjs → restore-archive-DgvDecXM.mjs} +82 -82
- package/dist/{retired-settings-keys-UsVtLOT0.mjs → retired-settings-keys-Bhwe4ymb.mjs} +2 -2
- package/dist/{retired-settings-keys-CyQ7uvta.js → retired-settings-keys-D_VwZiDt.js} +10 -4
- package/dist/{wal-maintenance-xsvdT5Go.mjs → wal-maintenance-BZGmF-3U.mjs} +0 -0
- package/dist/{wal-maintenance-DEL_jeG0.js → wal-maintenance-C041zn6V.js} +0 -0
- package/package.json +5 -2
- package/dist/{custom-action-registry-Bf_YnagS.js → custom-action-registry-BKmoaqG0.js} +1 -1
- package/dist/{custom-action-registry-BQnbN0DP.mjs → custom-action-registry-CyUuhATc.mjs} +1 -1
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-BKhlcYz6.js");
|
|
7
7
|
const require_formatter = require("../../formatter-DqAKDlvN.js");
|
|
8
8
|
let node_path = require("node:path");
|
|
9
9
|
node_path = require_chunk.__toESM(node_path);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { gn as logDestinationCapability, jr as BaseAddon } from "../../dist-9fcsrFU3.mjs";
|
|
2
2
|
import { t as formatLogLine } from "../../formatter-B7qW8bPJ.mjs";
|
|
3
3
|
import * as path$1 from "node:path";
|
|
4
4
|
import path from "node:path";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ar as errMsg, Cr as compositionSourceKey } from "./dist-9fcsrFU3.mjs";
|
|
2
2
|
//#region src/builtins/core-blocks/composition-sources.ts
|
|
3
3
|
/**
|
|
4
4
|
* Describe what a composition reads and writes for SAVE-time validation
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** `secret://system/global/meshCaKey` — EC P-256 PKCS#8 PEM of the hub mesh CA. */
|
|
2
|
-
var MESH_CA_KEY_REF = require("./dist-
|
|
2
|
+
var MESH_CA_KEY_REF = require("./dist-BKhlcYz6.js").buildSecretRef({
|
|
3
3
|
owner: "system",
|
|
4
4
|
scope: { kind: "global" },
|
|
5
5
|
fieldPath: "meshCaKey"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as DEVICE_SAN_CREDENTIAL_PREFIX, O as DEVICE_SAN_USER_PREFIX,
|
|
1
|
+
import { D as DEVICE_SAN_CREDENTIAL_PREFIX, O as DEVICE_SAN_USER_PREFIX, Wr as buildSecretRef } from "./dist-9fcsrFU3.mjs";
|
|
2
2
|
import { S as backdatedNotBefore, a as KeyUsageFlags, d as SubjectKeyIdentifierExtension, f as X509Certificate$1, m as cryptoProvider, n as BasicConstraintsExtension, o as KeyUsagesExtension, p as X509CertificateGenerator, r as ExtendedKeyUsageExtension, s as PemConverter, t as AuthorityKeyIdentifierExtension, u as SubjectAlternativeNameExtension } from "./x509.es-DK__ETIe.mjs";
|
|
3
3
|
import { X509Certificate, createPublicKey, randomBytes, verify, webcrypto } from "node:crypto";
|
|
4
4
|
//#region src/auth/jwt-signing-key.ts
|
|
@@ -718,7 +718,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
718
718
|
return EventCategory;
|
|
719
719
|
}({});
|
|
720
720
|
//#endregion
|
|
721
|
-
//#region ../types/dist/sleep-
|
|
721
|
+
//#region ../types/dist/sleep-bwsTj221.mjs
|
|
722
722
|
/**
|
|
723
723
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
724
724
|
* window to float samples (D455).
|
|
@@ -2079,7 +2079,6 @@ function createHandle(raw, opts) {
|
|
|
2079
2079
|
const writeAddon = (patch) => write("addon", opts.addonTree(), void 0, patch, () => readStoredAddonBlob(raw), (p) => raw.writeAddonStore(p));
|
|
2080
2080
|
const readAddonStoreResult = raw.readAddonStoreResult;
|
|
2081
2081
|
const readAddonStoreKeyResult = raw.readAddonStoreKeyResult;
|
|
2082
|
-
const readDeviceStoreBatch = raw.readDeviceStoreBatch;
|
|
2083
2082
|
const overrides = {
|
|
2084
2083
|
readAddonStore: async () => resolveRead("addon", await raw.readAddonStore()),
|
|
2085
2084
|
...readAddonStoreResult !== void 0 ? { readAddonStoreResult: async () => {
|
|
@@ -2103,12 +2102,12 @@ function createHandle(raw, opts) {
|
|
|
2103
2102
|
};
|
|
2104
2103
|
} } : {},
|
|
2105
2104
|
readDeviceStore: async (deviceId) => resolveRead(`device:${deviceId}`, await raw.readDeviceStore(deviceId)),
|
|
2106
|
-
|
|
2107
|
-
const rows = await readDeviceStoreBatch
|
|
2105
|
+
readDeviceStoreBatch: async (deviceIds) => {
|
|
2106
|
+
const rows = await raw.readDeviceStoreBatch(deviceIds);
|
|
2108
2107
|
const out = /* @__PURE__ */ new Map();
|
|
2109
2108
|
for (const [deviceId, blob] of rows) out.set(deviceId, await resolveRead(`device:${deviceId}`, blob));
|
|
2110
2109
|
return out;
|
|
2111
|
-
}
|
|
2110
|
+
},
|
|
2112
2111
|
writeAddonStore: async (patch) => {
|
|
2113
2112
|
await writeAddon(patch);
|
|
2114
2113
|
},
|
|
@@ -2948,7 +2947,7 @@ var BaseAddon = class {
|
|
|
2948
2947
|
return this._addonSecretTree;
|
|
2949
2948
|
}
|
|
2950
2949
|
deviceSecretTree() {
|
|
2951
|
-
this._deviceSecretTree ??= secretTreeFromSchema(this.deviceSettingsSchema());
|
|
2950
|
+
this._deviceSecretTree ??= mergeSecretStatePaths(secretTreeFromSchema(this.deviceSettingsSchema()), this.secretStatePaths);
|
|
2952
2951
|
return this._deviceSecretTree;
|
|
2953
2952
|
}
|
|
2954
2953
|
/**
|
|
@@ -3024,42 +3023,135 @@ var BaseAddon = class {
|
|
|
3024
3023
|
this[timerOf] = timer;
|
|
3025
3024
|
}
|
|
3026
3025
|
/**
|
|
3027
|
-
* Wrap `ctx.settings.readAddonStore()` with a
|
|
3028
|
-
*
|
|
3029
|
-
* swap, or any race where the SqliteSettingsBackend is between shutdown and
|
|
3030
|
-
* re-initialize) doesn't propagate up into `initialize()` and leave the
|
|
3026
|
+
* Wrap `ctx.settings.readAddonStore()` with a retry budget so a transient
|
|
3027
|
+
* settings-store outage doesn't propagate up into `initialize()` and leave the
|
|
3031
3028
|
* addon permanently broken.
|
|
3032
3029
|
*
|
|
3033
|
-
*
|
|
3034
|
-
*
|
|
3035
|
-
* `
|
|
3030
|
+
* Two kinds of outage, two budgets:
|
|
3031
|
+
* - the store's own restart fingerprints (`SqliteSettingsBackend not
|
|
3032
|
+
* initialized`, `provider not available`): a short budget, then the addon
|
|
3033
|
+
* falls back to `{}` (defaults) - its first successful patch rehydrates;
|
|
3034
|
+
* - a TRANSPORT failure (the hub is restarting while this runner boots:
|
|
3035
|
+
* `discovery deadline exceeded`, `parent could not route`, a refused or
|
|
3036
|
+
* timed-out connection). Since D870 a runner's settings read THROWS instead
|
|
3037
|
+
* of answering `{}`, so without a budget a hub restart ends in a respawn
|
|
3038
|
+
* loop. A long, bounded budget; only after it the error propagates - the
|
|
3039
|
+
* addon never runs on defaults for a store it could not ask.
|
|
3040
|
+
* Anything else propagates immediately so real bugs surface.
|
|
3036
3041
|
*/
|
|
3037
3042
|
async readAddonStoreWithRetry() {
|
|
3038
3043
|
const settings = this.rawSettings();
|
|
3039
3044
|
if (!settings) return {};
|
|
3040
|
-
const delaysMs = [
|
|
3041
|
-
150,
|
|
3042
|
-
350,
|
|
3043
|
-
600,
|
|
3044
|
-
900
|
|
3045
|
-
];
|
|
3046
3045
|
let lastErr;
|
|
3047
|
-
for (let attempt = 0
|
|
3046
|
+
for (let attempt = 0;; attempt++) try {
|
|
3048
3047
|
const stored = await settings.readAddonStore() ?? {};
|
|
3049
3048
|
this.settingsStoreReady = true;
|
|
3050
3049
|
return stored;
|
|
3051
3050
|
} catch (err) {
|
|
3052
3051
|
lastErr = err;
|
|
3053
|
-
const
|
|
3054
|
-
if (
|
|
3055
|
-
|
|
3056
|
-
|
|
3052
|
+
const kind = classifyStoreError(err);
|
|
3053
|
+
if (kind === "permanent") throw err;
|
|
3054
|
+
const delay = (kind === "transport" ? TRANSPORT_RETRY_DELAYS_MS : RESTART_RETRY_DELAYS_MS)[attempt];
|
|
3055
|
+
if (delay === void 0) {
|
|
3056
|
+
if (kind === "transport") throw err;
|
|
3057
|
+
break;
|
|
3058
|
+
}
|
|
3059
|
+
await new Promise((r) => setTimeout(r, delay));
|
|
3057
3060
|
}
|
|
3058
3061
|
this.settingsStoreReady = false;
|
|
3059
3062
|
this._ctx?.logger?.warn?.("readAddonStore: settings-store unavailable after retries — using defaults", { meta: { error: lastErr instanceof Error ? lastErr.message : String(lastErr) } });
|
|
3060
3063
|
return {};
|
|
3061
3064
|
}
|
|
3062
3065
|
};
|
|
3066
|
+
/** The settings store's own restart fingerprints. */
|
|
3067
|
+
var RESTART_RETRY_DELAYS_MS = [
|
|
3068
|
+
150,
|
|
3069
|
+
350,
|
|
3070
|
+
600,
|
|
3071
|
+
900
|
|
3072
|
+
];
|
|
3073
|
+
/** A hub restarting under a booting runner: ~100 s in total. */
|
|
3074
|
+
var TRANSPORT_RETRY_DELAYS_MS = [
|
|
3075
|
+
150,
|
|
3076
|
+
350,
|
|
3077
|
+
600,
|
|
3078
|
+
900,
|
|
3079
|
+
2e3,
|
|
3080
|
+
5e3,
|
|
3081
|
+
1e4,
|
|
3082
|
+
2e4,
|
|
3083
|
+
3e4,
|
|
3084
|
+
3e4
|
|
3085
|
+
];
|
|
3086
|
+
var RESTART_FINGERPRINTS = ["SqliteSettingsBackend not initialized", "provider not available"];
|
|
3087
|
+
/** Node / socket error codes of a connection that did not happen or broke. */
|
|
3088
|
+
var TRANSPORT_CODES = new Set([
|
|
3089
|
+
"ECONNREFUSED",
|
|
3090
|
+
"ECONNRESET",
|
|
3091
|
+
"ETIMEDOUT",
|
|
3092
|
+
"EPIPE",
|
|
3093
|
+
"EHOSTUNREACH",
|
|
3094
|
+
"ENETUNREACH"
|
|
3095
|
+
]);
|
|
3096
|
+
/** tRPC error codes that mean "the other side is not answering now", not "your call is wrong". */
|
|
3097
|
+
var UNAVAILABLE_TRPC_CODES = new Set([
|
|
3098
|
+
"TIMEOUT",
|
|
3099
|
+
"SERVICE_UNAVAILABLE",
|
|
3100
|
+
"BAD_GATEWAY",
|
|
3101
|
+
"GATEWAY_TIMEOUT"
|
|
3102
|
+
]);
|
|
3103
|
+
/** The exact phrases OUR transport raises when it cannot reach the hub. */
|
|
3104
|
+
var TRANSPORT_PHRASES = [
|
|
3105
|
+
"discovery deadline exceeded",
|
|
3106
|
+
"parent could not route child unowned cap call",
|
|
3107
|
+
"UDS request timed out after",
|
|
3108
|
+
"channel closed"
|
|
3109
|
+
];
|
|
3110
|
+
/** Moleculer error `type`s of a call that could not be served right now. */
|
|
3111
|
+
var MOLECULER_TRANSIENT_TYPES = new Set([
|
|
3112
|
+
"REQUEST_TIMEOUT",
|
|
3113
|
+
"SERVICE_NOT_FOUND",
|
|
3114
|
+
"SERVICE_NOT_AVAILABLE",
|
|
3115
|
+
"REQUEST_REJECTED",
|
|
3116
|
+
"BROKER_DISCONNECTED"
|
|
3117
|
+
]);
|
|
3118
|
+
function stringProp(value, key) {
|
|
3119
|
+
if (typeof value !== "object" || value === null) return void 0;
|
|
3120
|
+
const found = Reflect.get(value, key);
|
|
3121
|
+
return typeof found === "string" ? found : void 0;
|
|
3122
|
+
}
|
|
3123
|
+
/** The code an error carries: its own, its cause's, or a tRPC `data.code`. */
|
|
3124
|
+
function errorCode(err) {
|
|
3125
|
+
const out = {};
|
|
3126
|
+
const cause = typeof err === "object" && err !== null ? Reflect.get(err, "cause") : void 0;
|
|
3127
|
+
const data = typeof err === "object" && err !== null ? Reflect.get(err, "data") : void 0;
|
|
3128
|
+
const node = stringProp(err, "code") ?? stringProp(cause, "code");
|
|
3129
|
+
if (node !== void 0) out.node = node;
|
|
3130
|
+
const trpc = stringProp(data, "code");
|
|
3131
|
+
if (trpc !== void 0) out.trpc = trpc;
|
|
3132
|
+
return out;
|
|
3133
|
+
}
|
|
3134
|
+
/**
|
|
3135
|
+
* Is a settings read failure worth retrying, and with which budget? Only
|
|
3136
|
+
* EXPLICIT signals count: a socket error code, a tRPC "unavailable" code, or
|
|
3137
|
+
* one of the exact phrases our own transport raises. A message that merely
|
|
3138
|
+
* contains "timed out" or "unreachable" is not evidence of anything, and
|
|
3139
|
+
* `settings store not wired` is a wiring bug that retrying cannot fix.
|
|
3140
|
+
*/
|
|
3141
|
+
function classifyStoreError(err) {
|
|
3142
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
3143
|
+
if (RESTART_FINGERPRINTS.some((f) => message.includes(f))) return "restart";
|
|
3144
|
+
const code = errorCode(err);
|
|
3145
|
+
if (code.node !== void 0 && TRANSPORT_CODES.has(code.node)) return "transport";
|
|
3146
|
+
if (code.trpc !== void 0 && UNAVAILABLE_TRPC_CODES.has(code.trpc)) return "transport";
|
|
3147
|
+
if (typeof err === "object" && err !== null) {
|
|
3148
|
+
if (Reflect.get(err, "retryable") === true) return "transport";
|
|
3149
|
+
const type = stringProp(err, "type");
|
|
3150
|
+
if (type !== void 0 && MOLECULER_TRANSIENT_TYPES.has(type)) return "transport";
|
|
3151
|
+
}
|
|
3152
|
+
if (TRANSPORT_PHRASES.some((f) => message.includes(f))) return "transport";
|
|
3153
|
+
return "permanent";
|
|
3154
|
+
}
|
|
3063
3155
|
/**
|
|
3064
3156
|
* Collect the keys of every field marked `perNode: true`, recursing into
|
|
3065
3157
|
* layout containers (`group` fields and `sub-tabs` tabs) the same way
|
|
@@ -16168,6 +16260,89 @@ id: z.union([z.string(), z.number()]) }), {
|
|
|
16168
16260
|
})
|
|
16169
16261
|
}
|
|
16170
16262
|
};
|
|
16263
|
+
/** One table of the settings database. */
|
|
16264
|
+
var StorageTableSchema = z.object({
|
|
16265
|
+
/** The table's full name, e.g. `recorder:addon-settings` or `addon-device-settings`. */
|
|
16266
|
+
name: z.string(),
|
|
16267
|
+
/** The owner prefix of a scoped name (`recorder` for `recorder:addon-settings`), else null. */
|
|
16268
|
+
owner: z.string().nullable(),
|
|
16269
|
+
rows: z.number().int().nonnegative(),
|
|
16270
|
+
/** Bytes the table's pages occupy (`dbstat`); null when the engine cannot measure. */
|
|
16271
|
+
bytes: z.number().int().nonnegative().nullable(),
|
|
16272
|
+
/** Declared by an addon since this engine process started (a running addon claims it). */
|
|
16273
|
+
declaredThisBoot: z.boolean()
|
|
16274
|
+
});
|
|
16275
|
+
/**
|
|
16276
|
+
* The collections retired by exact name: the D870 ones (their data became keys
|
|
16277
|
+
* of the camera's settings) and the three D871 leftovers (the `stats-5m` tables
|
|
16278
|
+
* superseded by `stats-5m-v2`, and the unread `vec_object_clip`). No addon
|
|
16279
|
+
* declares any of them any more; the engine still refuses one a running addon
|
|
16280
|
+
* declared this boot. `dropCollection` may remove these, the
|
|
16281
|
+
* per-addon scoped `addon-settings` / `addon-devices` / `sections` tables, and
|
|
16282
|
+
* the tables of owners that are no longer installed - nothing else.
|
|
16283
|
+
*/
|
|
16284
|
+
var STORAGE_ADMIN_MOVED_COLLECTIONS = [
|
|
16285
|
+
"stream-broker:probe-snapshots",
|
|
16286
|
+
"stream-broker:profile-map",
|
|
16287
|
+
"stream-broker:rtsp-tokens",
|
|
16288
|
+
"notification-center:device-mutes",
|
|
16289
|
+
"recorder:recording-configs",
|
|
16290
|
+
"pipeline-orchestrator:device-features",
|
|
16291
|
+
"pipeline-analytics:stats-5m",
|
|
16292
|
+
"pipeline-orchestrator:stats-5m",
|
|
16293
|
+
"vec_object_clip"
|
|
16294
|
+
];
|
|
16295
|
+
/** The per-addon blob tables a scoped name may carry. */
|
|
16296
|
+
var STORAGE_ADMIN_SCOPED_BASES = [
|
|
16297
|
+
"addon-settings",
|
|
16298
|
+
"addon-devices",
|
|
16299
|
+
"sections"
|
|
16300
|
+
];
|
|
16301
|
+
/**
|
|
16302
|
+
* storage-admin - the operator's maintenance reach into the settings database:
|
|
16303
|
+
* list its tables, drop one that nothing owns any more (D870).
|
|
16304
|
+
*
|
|
16305
|
+
* Hub-only, internal and `auth: 'admin'` explicitly (`internal` does not gate
|
|
16306
|
+
* the mount, see `data-store-provider`). Both methods are LOGGED by the engine
|
|
16307
|
+
* with the table and the counts. `dropCollection` is a ONE-SHOT of the D870
|
|
16308
|
+
* migration and is marked for removal once the last hub has run it.
|
|
16309
|
+
*
|
|
16310
|
+
* `listTables` is READ-ONLY: it never creates a table, which `count` and `get`
|
|
16311
|
+
* on an undeclared scoped name used to do.
|
|
16312
|
+
*/
|
|
16313
|
+
var storageAdminCapability = {
|
|
16314
|
+
name: "storage-admin",
|
|
16315
|
+
scope: "system",
|
|
16316
|
+
mode: "singleton",
|
|
16317
|
+
internal: true,
|
|
16318
|
+
methods: {
|
|
16319
|
+
/**
|
|
16320
|
+
* Every table of the settings database with its row count and size,
|
|
16321
|
+
* optionally only those owned by `ownerPrefix`. Reads only.
|
|
16322
|
+
*/
|
|
16323
|
+
listTables: method(z.object({ ownerPrefix: z.string().min(1).optional() }), z.object({ tables: z.array(StorageTableSchema) }), { auth: "admin" }),
|
|
16324
|
+
/**
|
|
16325
|
+
* Drop one table. REFUSES when an addon declared it since the engine
|
|
16326
|
+
* started (a running addon still owns it), when it is an engine or
|
|
16327
|
+
* canonical table, when it does not exist, or when its row count is not
|
|
16328
|
+
* `expectRows` - the caller states what it believes it is deleting. The
|
|
16329
|
+
* engine also refuses anything but `<owner>:(addon-settings|addon-devices|
|
|
16330
|
+
* sections)`, the retired collections by name, and tables of owners that
|
|
16331
|
+
* are not installed (and refuses when it cannot read the installed list).
|
|
16332
|
+
* Removed with the D870 migration script once the last hub ran it.
|
|
16333
|
+
*/
|
|
16334
|
+
dropCollection: method(z.object({
|
|
16335
|
+
collection: z.string().min(1),
|
|
16336
|
+
expectRows: z.number().int().nonnegative()
|
|
16337
|
+
}), z.object({
|
|
16338
|
+
dropped: z.literal(true),
|
|
16339
|
+
rows: z.number().int().nonnegative()
|
|
16340
|
+
}), {
|
|
16341
|
+
kind: "mutation",
|
|
16342
|
+
auth: "admin"
|
|
16343
|
+
})
|
|
16344
|
+
}
|
|
16345
|
+
};
|
|
16171
16346
|
/**
|
|
16172
16347
|
* `keychain` — the hub's encrypted store of secret values (D787).
|
|
16173
16348
|
*
|
|
@@ -16904,6 +17079,24 @@ var keychainAdminCapability = {
|
|
|
16904
17079
|
auth: "admin",
|
|
16905
17080
|
caller: "required"
|
|
16906
17081
|
}),
|
|
17082
|
+
/**
|
|
17083
|
+
* Store a value an operator tool carries over from a retired store at an
|
|
17084
|
+
* addon's own ref (`secret://<owner>/<scope>/<path>`) and answer the ref -
|
|
17085
|
+
* the D870 migration moves a camera's restream tokens this way, so they
|
|
17086
|
+
* never sit in a settings row as plaintext. Audited as the operator; the
|
|
17087
|
+
* caller then writes the MARKER of the ref where the value used to be.
|
|
17088
|
+
*/
|
|
17089
|
+
importSecret: method(z.object({
|
|
17090
|
+
ref: z.string().min(1),
|
|
17091
|
+
value: z.string().min(1)
|
|
17092
|
+
}), z.object({
|
|
17093
|
+
ref: z.string(),
|
|
17094
|
+
version: z.number().int()
|
|
17095
|
+
}), {
|
|
17096
|
+
kind: "mutation",
|
|
17097
|
+
auth: "admin",
|
|
17098
|
+
caller: "required"
|
|
17099
|
+
}),
|
|
16907
17100
|
/** Delete refs no owner points at any more. Re-checked here; `unknown` is kept. */
|
|
16908
17101
|
deleteOrphans: method(z.object({ refs: z.array(z.string().min(1)).max(1e3) }), z.object({
|
|
16909
17102
|
deleted: z.array(z.string()).readonly(),
|
|
@@ -76107,6 +76300,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
76107
76300
|
addonId: null,
|
|
76108
76301
|
access: "create"
|
|
76109
76302
|
},
|
|
76303
|
+
"keychainAdmin.importSecret": {
|
|
76304
|
+
capName: "keychain-admin",
|
|
76305
|
+
capScope: "system",
|
|
76306
|
+
addonId: null,
|
|
76307
|
+
access: "create"
|
|
76308
|
+
},
|
|
76110
76309
|
"keychainAdmin.listAudit": {
|
|
76111
76310
|
capName: "keychain-admin",
|
|
76112
76311
|
capScope: "system",
|
|
@@ -79893,6 +80092,18 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
79893
80092
|
addonId: null,
|
|
79894
80093
|
access: "create"
|
|
79895
80094
|
},
|
|
80095
|
+
"storageAdmin.dropCollection": {
|
|
80096
|
+
capName: "storage-admin",
|
|
80097
|
+
capScope: "system",
|
|
80098
|
+
addonId: null,
|
|
80099
|
+
access: "delete"
|
|
80100
|
+
},
|
|
80101
|
+
"storageAdmin.listTables": {
|
|
80102
|
+
capName: "storage-admin",
|
|
80103
|
+
capScope: "system",
|
|
80104
|
+
addonId: null,
|
|
80105
|
+
access: "view"
|
|
80106
|
+
},
|
|
79896
80107
|
"storageEvictable.evict": {
|
|
79897
80108
|
capName: "storage-evictable",
|
|
79898
80109
|
capScope: "system",
|
|
@@ -81537,6 +81748,7 @@ var ALL_CAPABILITY_DEFINITIONS = [
|
|
|
81537
81748
|
snapshotCapability,
|
|
81538
81749
|
ssoBridgeCapability,
|
|
81539
81750
|
storageCapability,
|
|
81751
|
+
storageAdminCapability,
|
|
81540
81752
|
storageEvictableCapability,
|
|
81541
81753
|
storageMigrationCapability,
|
|
81542
81754
|
storageOccupancyCapability,
|
|
@@ -85905,4 +86117,4 @@ function enumerateInferenceDevices(hw) {
|
|
|
85905
86117
|
return out;
|
|
85906
86118
|
}
|
|
85907
86119
|
//#endregion
|
|
85908
|
-
export {
|
|
86120
|
+
export { StorageCleanupJobSchema as $, splitTranslationRef as $n, formatSecretScope as $r, gbToBytes as $t, DeclaredDevices as A, pickAppLinkHub as An, errMsg as Ar, databaseSnapshotCapability as At, METHOD_ACCESS_MAP as B, resolveCoreBlockFiles as Bn, WELL_KNOWN_TAB_MAP as Br, deviceStatusCapability as Bt, DAY_NAMES as C, modeMayWrite as Cn, compositionSourceKey as Cr, coreBlockAddonId as Ct, DEVICE_SAN_CREDENTIAL_PREFIX as D, objectInputDeclaresAddonId as Dn, DeviceFeature as Dr, coreBlocksCapability as Dt, DEVICE_NONCE_TTL_MS as E, normalizeUnit as En, toExpressionValue as Er, coreBlockSourceKind as Et, HUB_MDNS_SERVICE_TYPE as F, reducePoints as Fn, REDACTED_SECRET as Fr, describeComposableCaps as Ft, RecordingStatusSchema as G, runtimeStatePolicyFor as Gn, collectSecretConfigKeys as Gr, evictionPolicyOfLocation as Gt, MOTION_CLOSE_AFTER_MS as H, resolveLocationMode as Hn, asNumber as Hr, enumerateItemArrayFields as Ht, HUB_MDNS_TXT_KEYS as I, replacedFieldKeys as In, RUNTIME_DEFAULTS as Ir, deviceCredentialsCapability as It, STORAGE_ADMIN_SCOPED_BASES as J, scoreRuntimes as Jn, customAction as Jr, extractNestedAddonId as Jt, STORAGE_ACCESS_FALLBACK as K, scopesAllowAddon as Kn, collectZodSecretPaths as Kr, expandContainer as Kt, KEYCHAIN_RESET_TRIGGER_ACTOR as L, resolveAppConnections as Ln, ReadinessRegistry as Lr, deviceExtensionCapability as Lt, FIRST_LEVEL_MACRO_CLASSES as M, platformProbeCapability as Mn, DATAPLANE_SECRET_HEADER as Mr, decodeVectorBase64 as Mt, FieldClaimModeSchema as N, procedureAuthKey as Nn, DEVICE_SETTINGS_CONTRIBUTION_METHODS as Nr, defineExtensionSlotProvider as Nt, DEVICE_SAN_USER_PREFIX as O, objectInputDeclaresRequiredDeviceId as On, DeviceRole as Or, createDeviceExtensionProvider as Ot, FieldClaimSchema as P, ptzAutotrackCapability as Pn, DEVICE_STATUS_METHOD as Pr, deriveBatteryPresence as Pt, SsoBridgeClaimsSchema as Q, snapshotCapability as Qn, expandCapMethods as Qr, formatMinutes as Qt, LOG_LEVEL_RANK as R, resolveBucketMs as Rn, ReadinessTimeoutError as Rr, deviceManagerCapability as Rt, DATA_STORE_DATABASES as S, EventCategory as Si, metricsProviderCapability as Sn, compositionSliceKey as Sr, compositionSourceRefs as St, DEVICE_ENROLLMENT_TTL_MS as T, normalizeCoreBlockWrite as Tn, disarmRoseMemory as Tr, coreBlockIdFromAddonId as Tt, NetworkTunnelStartedDataSchema as U, resolveMethodAuth as Un, asString$1 as Ur, enumerateSchemaFields as Ut, MINUTES_PER_DAY as V, resolveHubAddressRoles as Vn, asJsonObject as Vr, enumerateInferenceDevices as Vt, RECORDING_SOURCE_CAMSTACK_ADDON as W, resolveNotificationTapAddress as Wn, buildSecretRef as Wr, evaluateCompositionField as Wt, ScopedTokenSchema as X, shortHostname as Xn, emitDownForOwnedCaps as Xr, foldSnapshotByFunction as Xt, STREAM_PROFILE_META as Y, settingsStoreCapability as Yn, defineCustomActions as Yr, filesystemBrowseCapability as Yt, ServerNameSchema as Z, siteZoneKey as Zn, emitReadiness as Zr, formatDeviceRevoker as Zt, CatalogFileSchema as _, sleep as _i, logLevelAtMost as _n, cloneStatefulExpressionMemory as _r, cameraGridLayoutCapability as _t, ApiKeyRecordSchema as a, isSecretMarker as ai, isLocationEnabled as an, streamCatalogCapability as ar, addonSettingsCapability as at, DATABASE_SNAPSHOT_SUFFIX as b, transformSecretWrite as bi, mayWriteToLocation as bn, compositionFeatureEnabled as br, composerCapability as bt, CAMERA_SWITCH_ORDER as c, normalizeSecretOwner as ci, kebabToCamel as cn, userManagementCapability as cr, authProviderCapability as ct, CATALOG_LANGS as d, parseSecretRef as di, legacyAutoLinkIds as dn, vectorDimFromBase64 as dr, batteryCapability as dt, hydrateSchema as ei, interpolate as en, storageAdminCapability as er, StorageLocationModeSchema as et, COMPOSED_ITEM_FIXED_FIELDS as f, readinessKey as fi, legacyModeOf as fn, vectorIndexDimConflictError as fr, buildCapabilityLookup as ft, CalendarPreferencesSchema as g, secretTreeFromPaths as gi, logDestinationCapability as gn, buildFfmpegArgs as gr, calendarsCapability as gt, CORE_BLOCK_ADDON_PREFIX as h, scopeKey as hi, locationIconKey as hn, COMPOSER_ADDON_ID as hr, buildStreamParamsConfigSchema as ht, AlertSchema as i, isSecretClear as ii, isDefaultAppConnectionEndpoint as in, storageProviderCapability as ir, addonPagesCapability as it, DeviceStatusSchema as j, planComposition as jn, BaseAddon as jr, declarationOwnerNodeId as jt, DEVICE_TOMBSTONE_RETENTION_MS as k, parseStreamParamsFormPatch as kn, DeviceType as kr, dataStoreProviderCapability as kt, CAMSTACK_APP_LINK_ORIGIN as l, parseJsonObject as li, keychainAdminCapability as ln, validateComposition as lr, backupCapability as lt, CORE_BLOCKS_ADDON_ID as m, resolveSecretMarkers as mi, localNetworkCapability as mn, withLocationMode as mr, buildDeviceSignatureMessage as mt, AGENT_MDNS_TXT_KEYS as n, isEvent as ni, isArrayOutputSchema as nn, storageMigrationCapability as nr, StorageMigrationJobSchema as nt, BaseDevice as o, isSecretMarkerLike as oi, isObjectInput as on, streamQualityLabel as or, addonWidgetsCapability as ot, COMPOSER_RUNNER_ID as p, resolveCapMount as pi, lifecycleJobSchema as pn, vectorStoreCapability as pr, buildDeviceEnrollmentLink as pt, STORAGE_ADMIN_MOVED_COLLECTIONS as q, scopesAllowDeviceCap as qn, createEvent as qr, expressionContainsBuiltinCall as qt, ALL_CAPABILITY_DEFINITIONS as r, isKeychainStoredField as ri, isCollectionArrayMethod as rn, storageOccupancyCapability as rr, UserRecordSchema as rt, BatteryStatusSchema as s, nodePin as si, isVoidInput as sn, supportedRuntimes as sr, alertsCapability as st, AGENT_MDNS_SERVICE_TYPE as t, isDeviceConfigCap as ti, isAppLinkBase as tn, storageCapability as tr, StorageLocationTypeSchema as tt, CAP_NAMES_WITH_STATUS as u, parseJsonUnknown as ui, keychainCapability as un, validateCustomAddress as ur, bareAddonId as ut, CoreBlockSchema as v, toNodeId as vi, looseSchema as vn, composedDeviceRef as vr, canonicalIconKey as vt, DERIVED_CAMERA_SILENCED_CAP_NAMES as w, motionCapability as wn, createStatefulExpressionMemory as wr, coreBlockComposition as wt, DATABASE_SNAPSHOT_TIMEOUT_MS as x, userError as xi, memoizePinnedFfmpeg as xn, compositionItemFieldPath as xr, compositionFieldKey as xt, DATABASE_SNAPSHOT_PARTIAL_SUFFIX as y, toSecretFieldView as yi, mayReadLocation as yn, composedDeviceStableId as yr, checkRoleAddress as yt, LegacyStorageLocationDefaultSchema as z, resolveCoreBlockEntry as zn, SECRET_CLEAR as zr, deviceStateCapability as zt };
|