@camstack/server 1.2.778 → 1.2.780
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 +21 -0
- package/dist/agent/main.js +5 -1
- package/dist/agent/stale-addon-gate.js +52 -15
- package/dist/api/addon-upload.js +41 -0
- package/dist/api/core/cap-providers.js +19 -29
- package/dist/api/core/integration-role.js +15 -2
- package/dist/api/tarball-manifest.js +10 -1
- package/dist/api/trpc/generated-cap-mounts.js +1 -9
- package/dist/api/trpc/generated-cap-routers.js +9 -88
- package/dist/core/addon/addon-package.service.js +24 -8
- package/dist/core/addon/addon-registry.service.js +61 -10
- package/dist/core/addon/hub-spawn-gate.js +92 -0
- package/dist/core/addon/integration-instances-provider.js +22 -0
- package/dist/core/agent/agent-registry.service.js +6 -2
- package/dist/core/agent/delivery-requirements.js +22 -6
- package/dist/core/updates/required-addon-update.js +188 -0
- package/dist/launcher.js +4 -0
- package/dist/manual-boot.js +27 -0
- package/dist/server-root/index.js +74 -3
- package/package.json +33 -11
- package/system/dist/addon-runner.js +179 -4
- package/system/dist/addon-runner.mjs +180 -5
- package/system/dist/{agent-https-DnEHxqTM.js → agent-https-A9wsxVGn.js} +1 -1
- package/system/dist/{agent-https-DjiLJBkD.mjs → agent-https-DuxDC67S.mjs} +1 -1
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/system/dist/builtins/alerts/alerts.addon.js +1 -1
- package/system/dist/builtins/alerts/alerts.addon.mjs +1 -1
- package/system/dist/builtins/autotrack/index.js +1 -1
- package/system/dist/builtins/autotrack/index.mjs +1 -1
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
- package/system/dist/builtins/calendars/calendars.addon.js +1 -1
- package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
- package/system/dist/builtins/camera-grid/index.js +1 -1
- package/system/dist/builtins/camera-grid/index.mjs +1 -1
- package/system/dist/builtins/composer/composer.addon.js +3 -3
- package/system/dist/builtins/composer/composer.addon.mjs +3 -3
- package/system/dist/builtins/console-logging/index.js +1 -1
- package/system/dist/builtins/console-logging/index.mjs +1 -1
- package/system/dist/builtins/core-blocks/core-blocks.addon.js +3 -3
- package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +3 -3
- package/system/dist/builtins/device-history/device-history.addon.js +2 -2
- package/system/dist/builtins/device-history/device-history.addon.mjs +2 -2
- package/system/dist/builtins/device-manager/device-manager.addon.js +6 -3
- package/system/dist/builtins/device-manager/device-manager.addon.mjs +6 -3
- package/system/dist/builtins/hub-forwarder/index.js +1 -1
- package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/system/dist/builtins/keychain/index.js +4 -4
- package/system/dist/builtins/keychain/index.mjs +4 -4
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
- package/system/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
- package/system/dist/builtins/local-network/local-network.addon.js +2 -2
- package/system/dist/builtins/local-network/local-network.addon.mjs +2 -2
- package/system/dist/builtins/loki-logging/index.js +1 -1
- package/system/dist/builtins/loki-logging/index.mjs +1 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
- package/system/dist/builtins/platform-probe/index.js +1 -1
- package/system/dist/builtins/platform-probe/index.mjs +1 -1
- package/system/dist/builtins/record-entries/index.js +1 -1
- package/system/dist/builtins/record-entries/index.mjs +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/snapshot/index.js +1 -1
- package/system/dist/builtins/snapshot/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
- 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/migrations/installed-runner-resolver.d.ts +7 -0
- package/system/dist/builtins/sqlite-storage/migrations/migrations-provider.d.ts +10 -3
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +38 -9
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +38 -9
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/system-config/system-config.addon.js +3 -3
- package/system/dist/builtins/system-config/system-config.addon.mjs +3 -3
- package/system/dist/builtins/winston-logging/index.js +1 -1
- package/system/dist/builtins/winston-logging/index.mjs +1 -1
- package/system/dist/{capture-engine-dY1enbrF.mjs → capture-engine-CEChNpAD.mjs} +1 -1
- package/system/dist/{capture-engine-DW3Tts4M.js → capture-engine-D6mXfLFQ.js} +1 -1
- package/system/dist/{composition-sources-Ckz1nky_.mjs → composition-sources-6XYW86Kw.mjs} +1 -1
- package/system/dist/{composition-sources-Y_vIrdLy.js → composition-sources-cVWKVph4.js} +1 -1
- package/system/dist/{constants-Bbu5TQF_.js → constants-B5Yg02ii.js} +1 -1
- package/system/dist/{constants-9sQvihXt.mjs → constants-DqwDEYfb.mjs} +1 -1
- package/system/dist/{device-ca-CbuTkPXx.js → device-ca-BVz14dRd.js} +1 -1
- package/system/dist/{device-ca-2dQqY2z0.mjs → device-ca-oY4Xqd7s.mjs} +1 -1
- package/system/dist/{dist-D3StiAs2.js → dist-B4wrqheM.js} +850 -635
- package/system/dist/{dist-CV4RPML4.mjs → dist-BX8nZeXV.mjs} +821 -636
- package/system/dist/file-host-worker.js +1 -1
- package/system/dist/file-host-worker.mjs +1 -1
- package/system/dist/{hub-mdns-ciao-BlxgXzRs.mjs → hub-mdns-ciao-BDPMfOgq.mjs} +2 -2
- package/system/dist/{hub-mdns-ciao-BJaeVvId.js → hub-mdns-ciao-CiMMA0rT.js} +2 -2
- package/system/dist/index.js +418 -16
- package/system/dist/index.mjs +413 -18
- package/system/dist/kernel/addon-installer.d.ts +44 -1
- package/system/dist/kernel/held-installs.d.ts +21 -0
- package/system/dist/kernel/index.d.ts +6 -0
- package/system/dist/kernel/moleculer/migration-api-facade.d.ts +73 -0
- package/system/dist/kernel/requires-registry.d.ts +31 -0
- package/system/dist/kernel/transport/acting-addon.d.ts +1 -1
- package/system/dist/{legacy-integration-rows-door-CUeUZHro.mjs → legacy-integration-rows-door-DDA3YOxL.mjs} +1 -1
- package/system/dist/{legacy-integration-rows-door-BqtcbHNX.js → legacy-integration-rows-door-YuWqHZW4.js} +1 -1
- package/system/dist/migrations/hub/__fixtures__/seed.d.ts +23 -0
- package/system/dist/{restore-archive-C4r-C6Hj.mjs → restore-archive-BrtpgNCt.mjs} +1 -1
- package/system/dist/{restore-archive-DM-QSOiY.js → restore-archive-Cn9OShm4.js} +1 -1
- package/system/dist/{wal-maintenance-1dP8IFlA.js → wal-maintenance-BTzu3s-6.js} +0 -0
- package/system/dist/{wal-maintenance-sPn0MLRB.mjs → wal-maintenance-jgyV9NbL.mjs} +0 -0
- package/system/package.json +1 -1
|
@@ -1171,7 +1171,7 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
|
|
|
1171
1171
|
return DeviceRole;
|
|
1172
1172
|
}({});
|
|
1173
1173
|
//#endregion
|
|
1174
|
-
//#region ../types/dist/sleep-
|
|
1174
|
+
//#region ../types/dist/sleep-BX_MqzUe.mjs
|
|
1175
1175
|
/**
|
|
1176
1176
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
1177
1177
|
* window to float samples (D455).
|
|
@@ -2888,6 +2888,28 @@ var SECRET_RETRY_MAX_MS = 5 * 6e4;
|
|
|
2888
2888
|
/** Coalesces a burst of `keychain.changed` events into one re-resolve. */
|
|
2889
2889
|
var SECRET_CHANGE_DEBOUNCE_MS = 250;
|
|
2890
2890
|
/**
|
|
2891
|
+
* Pair a catalogue with the function that builds its ports FROM THE MIGRATION API. The one
|
|
2892
|
+
* place a catalogue is bound: a migration reaches nothing a ports binder cannot reach
|
|
2893
|
+
* through `api` (guard `check-migration-ports-surface`).
|
|
2894
|
+
*/
|
|
2895
|
+
function migrationSet(catalogue, bindPorts) {
|
|
2896
|
+
return { bind: (api) => defineAddonMigrations(catalogue, bindPorts(api)) };
|
|
2897
|
+
}
|
|
2898
|
+
/** A mixed array is a mistake: the other kind would be dropped without a word. */
|
|
2899
|
+
function refuseMixed(form, kept, dropped) {
|
|
2900
|
+
if (dropped > 0) throw new Error(`runMigrations(${form}): ${dropped} of ${kept + dropped} entries are of the other kind and would be dropped; pass one kind per call`);
|
|
2901
|
+
}
|
|
2902
|
+
function catalogueOf(list) {
|
|
2903
|
+
const kept = list.filter((entry) => !("execute" in entry));
|
|
2904
|
+
refuseMixed("catalogue, (api) => ports", kept.length, list.length - kept.length);
|
|
2905
|
+
return kept;
|
|
2906
|
+
}
|
|
2907
|
+
function boundOf(list) {
|
|
2908
|
+
const kept = list.filter((entry) => "execute" in entry);
|
|
2909
|
+
refuseMixed("bound migrations", kept.length, list.length - kept.length);
|
|
2910
|
+
return kept;
|
|
2911
|
+
}
|
|
2912
|
+
/**
|
|
2891
2913
|
* Base class for CamStack addons. Eliminates settings boilerplate:
|
|
2892
2914
|
*
|
|
2893
2915
|
* - Typed `config` property with automatic resolution from store + defaults
|
|
@@ -3054,23 +3076,21 @@ var BaseAddon = class {
|
|
|
3054
3076
|
await this.loadScopedSchemas();
|
|
3055
3077
|
return normalized;
|
|
3056
3078
|
}
|
|
3079
|
+
async runMigrations(first, second, third) {
|
|
3080
|
+
if (typeof second === "function") return this.runMigrationSets([migrationSet(catalogueOf(first), second)], third);
|
|
3081
|
+
return this.runBound(boundOf(first), second);
|
|
3082
|
+
}
|
|
3057
3083
|
/**
|
|
3058
|
-
*
|
|
3059
|
-
*
|
|
3060
|
-
*
|
|
3061
|
-
* restored devices — with the catalogue bound to the addon's ports
|
|
3062
|
-
* (`defineAddonMigrations(ADDON_MIGRATIONS, ports)`).
|
|
3063
|
-
*
|
|
3064
|
-
* An engine that cannot be reached or refuses the catalogue is logged and runs
|
|
3065
|
-
* nothing; the boot continues. A migration that FAILED (or was blocked by one)
|
|
3066
|
-
* and declares `onFailure: 'block-owner'` makes this throw, so the addon does not
|
|
3067
|
-
* serve data whose shape it cannot trust; `tolerate` migrations never do.
|
|
3068
|
-
*
|
|
3069
|
-
* ALWAYS pass the whole catalogue; a phase that must run only some of it passes
|
|
3070
|
-
* `{ only: [ids] }` — never a filtered catalogue (the engine would judge the
|
|
3071
|
-
* omitted applied ids "newer").
|
|
3084
|
+
* Several catalogues of ONE owner in one declaration (the engine replaces an owner's
|
|
3085
|
+
* catalogue on every declare, so two calls would each judge the other's ids "newer").
|
|
3086
|
+
* Build each entry with `migrationSet(catalogue, (api) => ports)`.
|
|
3072
3087
|
*/
|
|
3073
|
-
async
|
|
3088
|
+
async runMigrationSets(sets, options) {
|
|
3089
|
+
const api = this.ctx.migrationApi;
|
|
3090
|
+
if (api === void 0) throw new Error(`${this.ctx.id}: the migration API is not available on this context`);
|
|
3091
|
+
return this.runBound(sets.flatMap((set) => set.bind(api)), options);
|
|
3092
|
+
}
|
|
3093
|
+
async runBound(migrations, options) {
|
|
3074
3094
|
const api = this.ctx.api.migrations;
|
|
3075
3095
|
const report = await runAddonMigrations({
|
|
3076
3096
|
declareOwner: (input) => api.declareOwner.mutate(input),
|
|
@@ -4737,6 +4757,20 @@ function assertTransactScope(members) {
|
|
|
4737
4757
|
if (new Set(kinds.map((m) => m.declaration.transactFamily)).size > 1) throw new TransactRefusedError(`cross-family: the ops span more than one transactFamily (${kinds.map((m) => `${m.kind}=${String(m.declaration.transactFamily)}`).join(", ")})`);
|
|
4738
4758
|
}
|
|
4739
4759
|
/**
|
|
4760
|
+
* Entry kinds (D881): every list of user-created entries (notification
|
|
4761
|
+
* targets, brokers, LLM profiles) is ONE record kind with an id, a name and a
|
|
4762
|
+
* kind-specific body, and the admin UI lists/adds/edits/deletes all of them
|
|
4763
|
+
* through the `record-entries` capability with password fields derived from
|
|
4764
|
+
* the schema (`.meta({ secret: true })`).
|
|
4765
|
+
*/
|
|
4766
|
+
/** The body of a plain entry: a name and the fields the kind adds. */
|
|
4767
|
+
function entryBody(shape) {
|
|
4768
|
+
return zod.z.object({
|
|
4769
|
+
name: zod.z.string().min(1),
|
|
4770
|
+
...shape
|
|
4771
|
+
});
|
|
4772
|
+
}
|
|
4773
|
+
/**
|
|
4740
4774
|
* Declare one entry kind. An entry is configuration: never trimmed by the
|
|
4741
4775
|
* engine, never aged, belonging to no device.
|
|
4742
4776
|
*/
|
|
@@ -11149,7 +11183,7 @@ new Set(EVENT_OWNER_TYPES);
|
|
|
11149
11183
|
*/
|
|
11150
11184
|
/** `>=MAJOR.MINOR.PATCH[-prerelease]` — the only range shape a requirement uses. */
|
|
11151
11185
|
var MinVersionSchema = zod.z.string().regex(/^>=\d+\.\d+\.\d+(-[0-9A-Za-z.-]+)?$/, "a minimum is written \">=X.Y.Z\"");
|
|
11152
|
-
zod.z.object({
|
|
11186
|
+
var PackageRequiresSchema = zod.z.object({
|
|
11153
11187
|
/** The oldest `@camstack/server` this package runs on. */
|
|
11154
11188
|
server: MinVersionSchema.optional(),
|
|
11155
11189
|
/** The oldest installed version of each named addon package. */
|
|
@@ -11160,6 +11194,34 @@ zod.z.object({
|
|
|
11160
11194
|
image: MinVersionSchema.optional()
|
|
11161
11195
|
}).optional()
|
|
11162
11196
|
});
|
|
11197
|
+
/** `>=1.2.3` to `1.2.3`; `null` when the text is not a minimum. */
|
|
11198
|
+
function minimumOf(range) {
|
|
11199
|
+
return MinVersionSchema.safeParse(range).success ? range.slice(2) : null;
|
|
11200
|
+
}
|
|
11201
|
+
function parts(version) {
|
|
11202
|
+
const dash = version.indexOf("-");
|
|
11203
|
+
return {
|
|
11204
|
+
nums: (dash === -1 ? version : version.slice(0, dash)).split(".").map((s) => {
|
|
11205
|
+
const n = Number.parseInt(s, 10);
|
|
11206
|
+
return Number.isNaN(n) ? 0 : n;
|
|
11207
|
+
}),
|
|
11208
|
+
pre: dash === -1 ? null : version.slice(dash + 1)
|
|
11209
|
+
};
|
|
11210
|
+
}
|
|
11211
|
+
/** -1 | 0 | 1; a prerelease sorts below its release. Never throws. */
|
|
11212
|
+
function compareVersions(a, b) {
|
|
11213
|
+
const pa = parts(a);
|
|
11214
|
+
const pb = parts(b);
|
|
11215
|
+
for (let i = 0; i < Math.max(pa.nums.length, pb.nums.length); i++) {
|
|
11216
|
+
const x = pa.nums[i] ?? 0;
|
|
11217
|
+
const y = pb.nums[i] ?? 0;
|
|
11218
|
+
if (x !== y) return x < y ? -1 : 1;
|
|
11219
|
+
}
|
|
11220
|
+
if (pa.pre === pb.pre) return 0;
|
|
11221
|
+
if (pa.pre === null) return 1;
|
|
11222
|
+
if (pb.pre === null) return -1;
|
|
11223
|
+
return pa.pre < pb.pre ? -1 : 1;
|
|
11224
|
+
}
|
|
11163
11225
|
/** One unmet requirement; each names the versions on both sides. */
|
|
11164
11226
|
var UnmetRequirementSchema = zod.z.discriminatedUnion("kind", [
|
|
11165
11227
|
zod.z.object({
|
|
@@ -11190,6 +11252,51 @@ var RequiredAddonUpdateSchema = zod.z.object({
|
|
|
11190
11252
|
/** What this node has; `null` when the addon is not installed. */
|
|
11191
11253
|
installed: zod.z.string().nullable()
|
|
11192
11254
|
});
|
|
11255
|
+
function meets(running, minimum) {
|
|
11256
|
+
return typeof running === "string" && running.length > 0 && compareVersions(running, minimum) >= 0;
|
|
11257
|
+
}
|
|
11258
|
+
/** Every requirement of `requires` that `running` does not meet. Empty means "fine". */
|
|
11259
|
+
function unmetRequirements(requires, running) {
|
|
11260
|
+
if (requires === void 0) return [];
|
|
11261
|
+
const unmet = [];
|
|
11262
|
+
const server = requires.server === void 0 ? null : minimumOf(requires.server);
|
|
11263
|
+
if (server !== null && !meets(running.server, server)) unmet.push({
|
|
11264
|
+
kind: "server-too-old",
|
|
11265
|
+
required: server,
|
|
11266
|
+
running: running.server
|
|
11267
|
+
});
|
|
11268
|
+
for (const [packageName, range] of Object.entries(requires.addons ?? {})) {
|
|
11269
|
+
const minimum = minimumOf(range);
|
|
11270
|
+
const have = running.addons[packageName] ?? null;
|
|
11271
|
+
if (minimum !== null && !meets(have, minimum)) unmet.push({
|
|
11272
|
+
kind: "addon-too-old",
|
|
11273
|
+
packageName,
|
|
11274
|
+
required: minimum,
|
|
11275
|
+
running: have
|
|
11276
|
+
});
|
|
11277
|
+
}
|
|
11278
|
+
for (const kind of ["desktop", "image"]) {
|
|
11279
|
+
const range = requires.wrapper?.[kind];
|
|
11280
|
+
const minimum = range === void 0 ? null : minimumOf(range);
|
|
11281
|
+
if (minimum === null || running.wrapper?.kind !== kind) continue;
|
|
11282
|
+
if (!meets(running.wrapper.version, minimum)) unmet.push({
|
|
11283
|
+
kind: "wrapper-too-old",
|
|
11284
|
+
wrapper: kind,
|
|
11285
|
+
required: minimum,
|
|
11286
|
+
running: running.wrapper.version
|
|
11287
|
+
});
|
|
11288
|
+
}
|
|
11289
|
+
return unmet;
|
|
11290
|
+
}
|
|
11291
|
+
/** One line, naming both versions — the text an operator reads. */
|
|
11292
|
+
function describeUnmet(unmet) {
|
|
11293
|
+
const have = (v, none) => v === null ? none : v;
|
|
11294
|
+
switch (unmet.kind) {
|
|
11295
|
+
case "server-too-old": return `requires server >= ${unmet.required}, running ${have(unmet.running, "unknown")}`;
|
|
11296
|
+
case "addon-too-old": return `requires ${unmet.packageName} >= ${unmet.required}, installed ${have(unmet.running, "none")}`;
|
|
11297
|
+
case "wrapper-too-old": return `requires the ${unmet.wrapper} wrapper >= ${unmet.required}, it reports ${have(unmet.running, "no version")}`;
|
|
11298
|
+
}
|
|
11299
|
+
}
|
|
11193
11300
|
/**
|
|
11194
11301
|
* Which integration instance a settings form is for. An addon that serves several instances
|
|
11195
11302
|
* (`instanceMode: multiple`) can show a different form per instance — an NVR integration
|
|
@@ -11334,26 +11441,16 @@ var RecordIntegrationInstances = class {
|
|
|
11334
11441
|
...this.hooks.description,
|
|
11335
11442
|
mintsId: true
|
|
11336
11443
|
};
|
|
11337
|
-
|
|
11338
|
-
* The record an id names. A caller holding the `integrations` registry id (the Integrations
|
|
11339
|
-
* page) reaches a kind whose body links to it through `integrationId`; an id that is itself a
|
|
11340
|
-
* record id answers as it is. An id that names nothing comes back unchanged.
|
|
11341
|
-
*/
|
|
11342
|
-
async resolveRecordId(id) {
|
|
11343
|
-
if (await this.handle.get(id) !== null) return id;
|
|
11344
|
-
const linked = (await this.handle.query({ limit: INSTANCES_LIST_MAX })).records.find((record) => record.data["integrationId"] === id);
|
|
11345
|
-
return linked === void 0 ? id : linked.id;
|
|
11346
|
-
}
|
|
11347
|
-
instanceFormSchema = async ({ id }) => this.hooks.formSchema(id === null ? null : await this.resolveRecordId(id));
|
|
11444
|
+
instanceFormSchema = async ({ id }) => this.hooks.formSchema(id);
|
|
11348
11445
|
listInstances = async () => {
|
|
11349
11446
|
return (await this.handle.query({ limit: INSTANCES_LIST_MAX })).records.map((record) => this.viewOf(record));
|
|
11350
11447
|
};
|
|
11351
11448
|
getInstance = async ({ id }) => {
|
|
11352
|
-
const record = await this.handle.get(
|
|
11449
|
+
const record = await this.handle.get(id);
|
|
11353
11450
|
return record === null ? null : this.viewOf(record);
|
|
11354
11451
|
};
|
|
11355
11452
|
/** Insert ONE row (`ifRev: 0`: an existing id is refused, never overwritten). */
|
|
11356
|
-
createInstance = async ({ id, name, kind }) => {
|
|
11453
|
+
createInstance = async ({ id, name, kind, values }) => {
|
|
11357
11454
|
const minted = id ?? this.hooks.mintId?.({
|
|
11358
11455
|
name,
|
|
11359
11456
|
...kind !== void 0 ? { kind } : {}
|
|
@@ -11363,11 +11460,20 @@ var RecordIntegrationInstances = class {
|
|
|
11363
11460
|
id: minted,
|
|
11364
11461
|
data: this.hooks.initialBody(name, kind)
|
|
11365
11462
|
}, { ifRev: 0 });
|
|
11463
|
+
const patch = this.patchOf(values ?? {});
|
|
11464
|
+
if (Object.keys(patch).length > 0) await this.handle.patch(minted, patch);
|
|
11366
11465
|
await this.hooks.onChanged?.(minted, "created");
|
|
11367
11466
|
return { id: minted };
|
|
11368
11467
|
};
|
|
11369
|
-
updateInstance = async ({ id
|
|
11370
|
-
const
|
|
11468
|
+
updateInstance = async ({ id, name, values }) => {
|
|
11469
|
+
const patch = this.patchOf(values);
|
|
11470
|
+
if (name !== void 0) patch[this.nameField] = name;
|
|
11471
|
+
await this.handle.patch(id, patch);
|
|
11472
|
+
await this.hooks.onChanged?.(id, "updated");
|
|
11473
|
+
return { ok: true };
|
|
11474
|
+
};
|
|
11475
|
+
/** The record patch a form `values` object means: secrets kept, cleared or replaced. */
|
|
11476
|
+
patchOf(values) {
|
|
11371
11477
|
const patch = {};
|
|
11372
11478
|
for (const [key, value] of Object.entries(values)) {
|
|
11373
11479
|
if (value === void 0) continue;
|
|
@@ -11378,11 +11484,8 @@ var RecordIntegrationInstances = class {
|
|
|
11378
11484
|
else if (isSecretClear(value)) patch[key] = null;
|
|
11379
11485
|
else if (typeof value === "string" && value !== "" && value !== "__camstack_redacted__" && !isSecretFieldView(value)) patch[key] = value;
|
|
11380
11486
|
}
|
|
11381
|
-
|
|
11382
|
-
|
|
11383
|
-
await this.hooks.onChanged?.(id, "updated");
|
|
11384
|
-
return { ok: true };
|
|
11385
|
-
};
|
|
11487
|
+
return patch;
|
|
11488
|
+
}
|
|
11386
11489
|
/** The switch lives in the record body; the addon is told so it applies it (D996). */
|
|
11387
11490
|
setInstanceEnabled = async ({ id, enabled }) => {
|
|
11388
11491
|
if (this.registryOwnsEnabled) throw new Error(`instance "${id}": the integrations registry owns the on/off switch of this addon; set it with integrations.update`);
|
|
@@ -11402,10 +11505,7 @@ var RecordIntegrationInstances = class {
|
|
|
11402
11505
|
status: "unsupported",
|
|
11403
11506
|
error: "This integration declares no connection test"
|
|
11404
11507
|
};
|
|
11405
|
-
return this.hooks.test(input
|
|
11406
|
-
...input,
|
|
11407
|
-
id: await this.resolveRecordId(input.id)
|
|
11408
|
-
});
|
|
11508
|
+
return this.hooks.test(input);
|
|
11409
11509
|
};
|
|
11410
11510
|
/** The flat provider object to hand to `registerProvider`. */
|
|
11411
11511
|
toProvider() {
|
|
@@ -13970,6 +14070,40 @@ var UnstampedEventMediaCountSchema = zod.z.object({
|
|
|
13970
14070
|
/** Sum across both, or `null` when either lane could not be counted. */
|
|
13971
14071
|
total: zod.z.number().int().nonnegative().nullable()
|
|
13972
14072
|
}).nullable();
|
|
14073
|
+
/**
|
|
14074
|
+
* Where the stored event media sits, per storage location: how many media rows
|
|
14075
|
+
* and how many bytes carry each location id, how many carry none (legacy,
|
|
14076
|
+
* resolved to the default `eventMedia` location), and how many name a location
|
|
14077
|
+
* that was not asked about (a deleted or never-listed one).
|
|
14078
|
+
*
|
|
14079
|
+
* One covering-index aggregate per asked location plus the NULL one, and one
|
|
14080
|
+
* unfiltered total that scans the covering index: O(rows), not a walk of the
|
|
14081
|
+
* rows themselves. `unlisted` is total minus the ASKED locations minus NULL, so
|
|
14082
|
+
* it is a deleted location only when every location id was asked.
|
|
14083
|
+
* `null` is "could not be measured", never zero.
|
|
14084
|
+
*/
|
|
14085
|
+
var MediaLocationCensusInputSchema = zod.z.object({ locationIds: zod.z.array(zod.z.string().min(1)).max(50).readonly() });
|
|
14086
|
+
var MediaLocationCensusRowSchema = zod.z.object({
|
|
14087
|
+
locationId: zod.z.string(),
|
|
14088
|
+
rows: zod.z.number().int().nonnegative(),
|
|
14089
|
+
bytes: zod.z.number().nonnegative()
|
|
14090
|
+
});
|
|
14091
|
+
var MediaLocationCensusSchema = zod.z.object({
|
|
14092
|
+
locations: zod.z.array(MediaLocationCensusRowSchema).readonly(),
|
|
14093
|
+
unstamped: zod.z.object({
|
|
14094
|
+
rows: zod.z.number().int().nonnegative(),
|
|
14095
|
+
bytes: zod.z.number().nonnegative()
|
|
14096
|
+
}),
|
|
14097
|
+
/** Rows stamped with a location id that was not in the asked list. */
|
|
14098
|
+
unlisted: zod.z.object({
|
|
14099
|
+
rows: zod.z.number().int().nonnegative(),
|
|
14100
|
+
bytes: zod.z.number().nonnegative()
|
|
14101
|
+
}),
|
|
14102
|
+
total: zod.z.object({
|
|
14103
|
+
rows: zod.z.number().int().nonnegative(),
|
|
14104
|
+
bytes: zod.z.number().nonnegative()
|
|
14105
|
+
})
|
|
14106
|
+
});
|
|
13973
14107
|
var StorageMigrationMediaMoveInputSchema = RelocateMediaInputSchema.extend({ leaseId: zod.z.string().min(1) });
|
|
13974
14108
|
/** The independently selectable logical storage classes — every class
|
|
13975
14109
|
* `storage.listLocationDeclarations` reports, so an operator never meets a
|
|
@@ -47932,52 +48066,7 @@ onBrightnessChanged: { data: zod.z.object({
|
|
|
47932
48066
|
minIntervalMs: 0
|
|
47933
48067
|
} } }
|
|
47934
48068
|
};
|
|
47935
|
-
|
|
47936
|
-
* `broker` — unified pub/sub broker registry, system-scoped collection.
|
|
47937
|
-
*
|
|
47938
|
-
* The cap models any kind-tagged message broker the user wants to
|
|
47939
|
-
* register and that other addons might consume. The first two kinds
|
|
47940
|
-
* are MQTT (mosquitto / aedes embedded / cloud bridge) and
|
|
47941
|
-
* Home Assistant (HA WebSocket — subscribe_entities + call_service).
|
|
47942
|
-
* Future kinds (Zigbee2MQTT bridge, ZHA, KNX, Telegram, …) plug in
|
|
47943
|
-
* the same surface.
|
|
47944
|
-
*
|
|
47945
|
-
* Why one cap, not one cap per kind:
|
|
47946
|
-
* - The integrations page wants a single table of "every broker"
|
|
47947
|
-
* across kinds; a unified cap drives it without join logic.
|
|
47948
|
-
* - Generic admin operations (add / remove / test / status) are
|
|
47949
|
-
* identical across kinds — duplicating them per cap was busywork.
|
|
47950
|
-
* - The `network-access` cap precedent: same interface, many
|
|
47951
|
-
* `providerKind: 'ingress'` implementations (Tailscale, ngrok, …).
|
|
47952
|
-
*
|
|
47953
|
-
* What stays kind-specific:
|
|
47954
|
-
* - `getBrokerConfig` payload (kind decides whether it returns
|
|
47955
|
-
* mqtt URL+creds, HA baseUrl+token, …) — typed as
|
|
47956
|
-
* `Record<string, unknown>` at the wire; consumers narrow.
|
|
47957
|
-
* - `publish` / `subscribe` / `getState` arguments (target / filter /
|
|
47958
|
-
* key) — also typed as `Record<string, unknown>` so each kind can
|
|
47959
|
-
* evolve its surface (MQTT topic+qos vs HA entity_id+domain)
|
|
47960
|
-
* without rebreaking the cap signature.
|
|
47961
|
-
* - `add` `settings` payload (different fields per kind, validated by
|
|
47962
|
-
* the kind-specific provider).
|
|
47963
|
-
*
|
|
47964
|
-
* Bidirectionality:
|
|
47965
|
-
* - `publish` is RPC — synchronous result (provider-defined).
|
|
47966
|
-
* - `subscribe` returns a subscription handle; the actual message
|
|
47967
|
-
* stream flows over the typed event-bus as `broker.message` events
|
|
47968
|
-
* keyed by `(brokerId, subscriptionId)`. Consumers filter in their
|
|
47969
|
-
* event handler. Subscriptions persist across reconnects — the
|
|
47970
|
-
* provider re-subscribes upstream after a transport drop.
|
|
47971
|
-
*
|
|
47972
|
-
* Why event-bus push (not a subscription RPC stream):
|
|
47973
|
-
* - Matches the rest of CamStack's D8 contract — events for telemetry,
|
|
47974
|
-
* RPC for loss-is-a-bug. Broker messages are telemetry (a single
|
|
47975
|
-
* drop is recoverable via `getState({key})`).
|
|
47976
|
-
* - Frees `broker.subscribe` from holding a long-lived RPC channel.
|
|
47977
|
-
* - Cross-process: events already route through `$event-bus`; no
|
|
47978
|
-
* per-broker wire-shaping needed.
|
|
47979
|
-
*/
|
|
47980
|
-
var BrokerStatusEnum = zod.z.enum([
|
|
48069
|
+
zod.z.enum([
|
|
47981
48070
|
"connected",
|
|
47982
48071
|
"disconnected",
|
|
47983
48072
|
"connecting",
|
|
@@ -47985,141 +48074,12 @@ var BrokerStatusEnum = zod.z.enum([
|
|
|
47985
48074
|
"unreachable",
|
|
47986
48075
|
"error"
|
|
47987
48076
|
]);
|
|
47988
|
-
var BrokerInfoSchema = zod.z.object({
|
|
47989
|
-
/** Stable broker id. Persisted; survives addon restarts. */
|
|
47990
|
-
id: zod.z.string(),
|
|
47991
|
-
/** Addon id of the provider that OWNS this broker.
|
|
47992
|
-
*
|
|
47993
|
-
* The `broker` cap is a system-scoped collection: several addons
|
|
47994
|
-
* register a `broker` provider, each owning a DISJOINT set of
|
|
47995
|
-
* brokers (mqtt-broker owns `mqtt_*`, provider-homeassistant owns
|
|
47996
|
-
* `ha_*`). A broker therefore belongs to exactly one addon — like a
|
|
47997
|
-
* device belongs to one integration. The admin UI threads this id
|
|
47998
|
-
* back as the `{ addonId }` system-collection selector on every
|
|
47999
|
-
* id-keyed call (`get` / `getSettings` / `setSettings` / `remove` /
|
|
48000
|
-
* `testConnection`), so the call routes to the OWNING provider
|
|
48001
|
-
* instead of defaulting to the first-registered one. */
|
|
48002
|
-
addonId: zod.z.string(),
|
|
48003
|
-
/** Human-readable name (operator-chosen at add-time). */
|
|
48004
|
-
name: zod.z.string(),
|
|
48005
|
-
/** Provider-defined kind tag — `mqtt` / `home-assistant` / future. */
|
|
48006
|
-
kind: zod.z.string(),
|
|
48007
|
-
status: BrokerStatusEnum,
|
|
48008
|
-
/** Free-form provider-specific info (HA version, MQTT broker
|
|
48009
|
-
* flavour, latency, mTLS active, …). */
|
|
48010
|
-
info: zod.z.record(zod.z.string(), zod.z.unknown()),
|
|
48011
|
-
/** Ms epoch of the last connection probe / status update. */
|
|
48012
|
-
lastCheckedAt: zod.z.number().nullable(),
|
|
48013
|
-
/** Last error message, when `status` indicates failure. */
|
|
48014
|
-
error: zod.z.string().nullable()
|
|
48015
|
-
});
|
|
48016
48077
|
var RegistryStatusSchema = zod.z.object({
|
|
48017
48078
|
brokerCount: zod.z.number().int().nonnegative(),
|
|
48018
48079
|
connectedCount: zod.z.number().int().nonnegative()
|
|
48019
48080
|
});
|
|
48020
|
-
/**
|
|
48021
|
-
* One entry per `broker` provider — which addon provides which broker
|
|
48022
|
-
* kind(s). The unified create picker reads this to know, for each
|
|
48023
|
-
* (addonId, kind) pair the operator can pick, where to route the
|
|
48024
|
-
* follow-up `getSettingsSchema` / `testSettings` / `add` calls (via the
|
|
48025
|
-
* `{ addonId }` selector). A provider only advertises a kind here when
|
|
48026
|
-
* it implements `getSettingsSchema` for that kind (so the picker never
|
|
48027
|
-
* offers a kind whose creation form can't be rendered).
|
|
48028
|
-
*/
|
|
48029
|
-
var BrokerProviderInfoSchema = zod.z.object({
|
|
48030
|
-
/** Addon id of the `broker` provider this entry describes. */
|
|
48031
|
-
addonId: zod.z.string(),
|
|
48032
|
-
/** Broker kinds this provider can create, with a display label. */
|
|
48033
|
-
kinds: zod.z.array(zod.z.object({
|
|
48034
|
-
kind: zod.z.string(),
|
|
48035
|
-
label: zod.z.string(),
|
|
48036
|
-
/**
|
|
48037
|
-
* Relative hub path to start an interactive account link (OAuth popup).
|
|
48038
|
-
* May include `{{brokerId}}`; admin-ui substitutes and appends `?popup=1`.
|
|
48039
|
-
*/
|
|
48040
|
-
interactiveConnectPath: zod.z.string().min(1).optional(),
|
|
48041
|
-
/** Relative hub path to disconnect the linked account (same popup pattern). */
|
|
48042
|
-
interactiveDisconnectPath: zod.z.string().min(1).optional(),
|
|
48043
|
-
/**
|
|
48044
|
-
* The kind signs in through a server-held interactive session instead of
|
|
48045
|
-
* (or before) typed credentials. `basePath` is a hub-relative route set
|
|
48046
|
-
* served by the owning addon (`/addon/<id>/...`) speaking the sign-in
|
|
48047
|
-
* contract: `POST {basePath}/start` (body: the form's settings) answers
|
|
48048
|
-
* `{ sessionId, loginUrl }`; `GET {basePath}/status?sessionId=` answers
|
|
48049
|
-
* `{ phase: 'starting' | 'awaiting-login' | 'captured' | 'error' |
|
|
48050
|
-
* 'cancelled', loginUrl, error }`; `POST {basePath}/commit`
|
|
48051
|
-
* (`{ sessionId, name, brokerId? }`) stores the credentials on a new or
|
|
48052
|
-
* existing broker and answers `{ brokerId }`; `POST {basePath}/cancel`
|
|
48053
|
-
* (`{ sessionId }`) drops the session. The dialog that edits a broker
|
|
48054
|
-
* offers it as the default path; the fields the session fills are
|
|
48055
|
-
* marked `filledBySignIn` in the kind's settings schema.
|
|
48056
|
-
*
|
|
48057
|
-
* `methods` lists the ways the session can sign in, recommended first:
|
|
48058
|
-
* `'device-code'` adds `POST {basePath}/code/start` (body: the form's
|
|
48059
|
-
* settings) answering `{ sessionId, userCode, verificationUrl,
|
|
48060
|
-
* expiresAt }` — the operator types `userCode` at `verificationUrl` on
|
|
48061
|
-
* any device, and the same `status` / `commit` / `cancel` routes follow
|
|
48062
|
-
* (status then carries `method`, `userCode`, `verificationUrl`,
|
|
48063
|
-
* `expiresAt` and the phases `'awaiting-code'` / `'expired'`);
|
|
48064
|
-
* `'proxy'` is the `{basePath}/start` flow above. Absent means
|
|
48065
|
-
* `['proxy']`.
|
|
48066
|
-
*/
|
|
48067
|
-
signIn: zod.z.object({
|
|
48068
|
-
basePath: zod.z.string().min(1),
|
|
48069
|
-
methods: zod.z.array(zod.z.enum(["device-code", "proxy"])).optional()
|
|
48070
|
-
}).optional()
|
|
48071
|
-
}))
|
|
48072
|
-
});
|
|
48073
|
-
var ListInputSchema = zod.z.object({
|
|
48074
|
-
/** Optional kind filter — `list({kind:'home-assistant'})` returns
|
|
48075
|
-
* only HA brokers. Omit to list every broker. */
|
|
48076
|
-
kind: zod.z.string().optional() });
|
|
48077
48081
|
var GetInputSchema = zod.z.object({ id: zod.z.string() });
|
|
48078
|
-
var AddInputSchema = zod.z.object({
|
|
48079
|
-
kind: zod.z.string().min(1),
|
|
48080
|
-
name: zod.z.string().min(1),
|
|
48081
|
-
/**
|
|
48082
|
-
* ADOPT an existing id instead of minting a new one.
|
|
48083
|
-
*
|
|
48084
|
-
* Written the day this cost an outage. A broker's id is not a detail: HA
|
|
48085
|
-
* devices carry it inside their `stableId` (`ha:ha_004:dev:…`), so a broker
|
|
48086
|
-
* lost from config and re-added as `ha_001` leaves every one of its devices
|
|
48087
|
-
* bound to a broker that no longer exists. Re-entering the password under the
|
|
48088
|
-
* ORIGINAL id turns a multi-step device migration back into re-entering a
|
|
48089
|
-
* password.
|
|
48090
|
-
*
|
|
48091
|
-
* A provider MUST refuse an id that is already in use — adopting a live
|
|
48092
|
-
* broker's id would silently take it over.
|
|
48093
|
-
*/
|
|
48094
|
-
id: zod.z.string().min(1).optional(),
|
|
48095
|
-
/** Kind-specific settings (e.g. MQTT `{url,username,password}` or HA
|
|
48096
|
-
* `{baseUrl,accessToken}`). Validated by the kind-specific provider
|
|
48097
|
-
* branch on receipt — invalid shape rejects the add. */
|
|
48098
|
-
settings: zod.z.record(zod.z.string(), zod.z.unknown())
|
|
48099
|
-
});
|
|
48100
|
-
var AddResultSchema = zod.z.object({ id: zod.z.string() });
|
|
48101
|
-
var RemoveInputSchema = zod.z.object({ id: zod.z.string() });
|
|
48102
|
-
var TestConnectionResultSchema = zod.z.discriminatedUnion("ok", [zod.z.object({
|
|
48103
|
-
ok: zod.z.literal(true),
|
|
48104
|
-
latencyMs: zod.z.number().nonnegative()
|
|
48105
|
-
}), zod.z.object({
|
|
48106
|
-
ok: zod.z.literal(false),
|
|
48107
|
-
error: zod.z.string()
|
|
48108
|
-
})]);
|
|
48109
48082
|
var SettingsRecordSchema$1 = zod.z.record(zod.z.string(), zod.z.unknown());
|
|
48110
|
-
var SettingsSchemaInputSchema = zod.z.object({ kind: zod.z.string() });
|
|
48111
|
-
var TestSettingsInputSchema = zod.z.object({
|
|
48112
|
-
kind: zod.z.string(),
|
|
48113
|
-
settings: SettingsRecordSchema$1
|
|
48114
|
-
});
|
|
48115
|
-
var TestSettingsResultSchema = zod.z.discriminatedUnion("ok", [zod.z.object({
|
|
48116
|
-
ok: zod.z.literal(true),
|
|
48117
|
-
latencyMs: zod.z.number().nonnegative().optional()
|
|
48118
|
-
}).strict(), zod.z.object({
|
|
48119
|
-
ok: zod.z.literal(false),
|
|
48120
|
-
error: zod.z.string()
|
|
48121
|
-
})]);
|
|
48122
|
-
var SettingsSchemaResultSchema = zod.z.unknown().nullable();
|
|
48123
48083
|
var PublishInputSchema = zod.z.object({
|
|
48124
48084
|
brokerId: zod.z.string(),
|
|
48125
48085
|
/** Kind-specific routing target.
|
|
@@ -48163,51 +48123,12 @@ var brokerCapability = {
|
|
|
48163
48123
|
kind: "poll"
|
|
48164
48124
|
},
|
|
48165
48125
|
methods: {
|
|
48166
|
-
list: method(ListInputSchema, zod.z.array(BrokerInfoSchema)),
|
|
48167
|
-
get: method(GetInputSchema, BrokerInfoSchema.nullable()),
|
|
48168
|
-
/** Enumerate which addon provides which broker kind(s) for the
|
|
48169
|
-
* unified create picker. The auto-mount fans this array across
|
|
48170
|
-
* every registered `broker` provider (array-output method), so the
|
|
48171
|
-
* picker sees every kind from every provider in one call. */
|
|
48172
|
-
listProviders: method(zod.z.void(), zod.z.array(BrokerProviderInfoSchema), { auth: "admin" }),
|
|
48173
|
-
add: method(AddInputSchema, AddResultSchema, {
|
|
48174
|
-
kind: "mutation",
|
|
48175
|
-
auth: "admin"
|
|
48176
|
-
}),
|
|
48177
|
-
remove: method(RemoveInputSchema, zod.z.void(), {
|
|
48178
|
-
kind: "mutation",
|
|
48179
|
-
auth: "admin"
|
|
48180
|
-
}),
|
|
48181
|
-
testConnection: method(GetInputSchema, TestConnectionResultSchema, {
|
|
48182
|
-
kind: "mutation",
|
|
48183
|
-
auth: "admin"
|
|
48184
|
-
}),
|
|
48185
|
-
/** Read the persisted settings record for a broker (kind-specific
|
|
48186
|
-
* shape). Admin-only — settings may contain secrets. Returns `null`
|
|
48187
|
-
* when the broker id is unknown to the provider (the collection
|
|
48188
|
-
* fallback may route a foreign id to the first provider). */
|
|
48189
|
-
getSettings: method(GetInputSchema, SettingsRecordSchema$1.nullable(), { auth: "admin" }),
|
|
48190
|
-
/** Overwrite the persisted settings record. The kind-specific
|
|
48191
|
-
* provider validates the shape and applies the change (reconnects
|
|
48192
|
-
* if credentials changed). */
|
|
48193
|
-
setSettings: method(zod.z.object({
|
|
48194
|
-
id: zod.z.string(),
|
|
48195
|
-
settings: SettingsRecordSchema$1
|
|
48196
|
-
}), zod.z.void(), {
|
|
48197
|
-
kind: "mutation",
|
|
48198
|
-
auth: "admin"
|
|
48199
|
-
}),
|
|
48200
48126
|
/** Returns the kind-specific connection config the consumer needs
|
|
48201
48127
|
* to open its own client (MQTT pattern: `{url, username, password,
|
|
48202
48128
|
* clientIdPrefix}`). HA providers MAY return the auth envelope
|
|
48203
48129
|
* but typical HA consumers use `publish` / `subscribe` instead.
|
|
48204
48130
|
* Returns `null` when the broker id is unknown to the provider. */
|
|
48205
48131
|
getBrokerConfig: method(GetInputSchema, SettingsRecordSchema$1.nullable(), { auth: "admin" }),
|
|
48206
|
-
getSettingsSchema: method(SettingsSchemaInputSchema, SettingsSchemaResultSchema, { auth: "admin" }),
|
|
48207
|
-
testSettings: method(TestSettingsInputSchema, TestSettingsResultSchema, {
|
|
48208
|
-
kind: "mutation",
|
|
48209
|
-
auth: "admin"
|
|
48210
|
-
}),
|
|
48211
48132
|
publish: method(PublishInputSchema, zod.z.unknown(), {
|
|
48212
48133
|
kind: "mutation",
|
|
48213
48134
|
auth: "admin"
|
|
@@ -57074,7 +56995,9 @@ var deviceProviderCapability = {
|
|
|
57074
56995
|
* provider does not support manual creation. Lets the Add-Device dialog
|
|
57075
56996
|
* pick the right type instead of assuming Camera.
|
|
57076
56997
|
*/
|
|
57077
|
-
getManualCreationType: method(zod.z.object({
|
|
56998
|
+
getManualCreationType: method(zod.z.object({
|
|
56999
|
+
/** The integration asked about; a provider whose integrations differ answers per one. */
|
|
57000
|
+
integrationId: zod.z.string().optional() }), zod.z.object({ deviceType: zod.z.enum(DeviceType).nullable() })),
|
|
57078
57001
|
adoptDiscoveredDevice: method(zod.z.object({
|
|
57079
57002
|
candidate: DiscoveryCandidateSchema,
|
|
57080
57003
|
/** The integration the operator adopts into; a provider with several instances needs it. */
|
|
@@ -57090,7 +57013,11 @@ var deviceProviderCapability = {
|
|
|
57090
57013
|
* devices of that type. The output is a `ConfigUISchema` — the
|
|
57091
57014
|
* router type-asserts it at the boundary.
|
|
57092
57015
|
*/
|
|
57093
|
-
getChildCreationSchema: method(zod.z.object({
|
|
57016
|
+
getChildCreationSchema: method(zod.z.object({
|
|
57017
|
+
type: zod.z.enum(DeviceType),
|
|
57018
|
+
/** The integration asked about; a provider whose integrations differ answers per one. */
|
|
57019
|
+
integrationId: zod.z.string().optional()
|
|
57020
|
+
}), CreationSchemaOutputSchema),
|
|
57094
57021
|
createDevice: method(zod.z.object({
|
|
57095
57022
|
type: zod.z.enum(DeviceType),
|
|
57096
57023
|
config: zod.z.record(zod.z.string(), zod.z.unknown()),
|
|
@@ -58362,7 +58289,10 @@ var deviceManagerCapability = {
|
|
|
58362
58289
|
*/
|
|
58363
58290
|
getCreationSchema: method(zod.z.object({
|
|
58364
58291
|
addonId: zod.z.string(),
|
|
58365
|
-
type: zod.z.enum(DeviceType)
|
|
58292
|
+
type: zod.z.enum(DeviceType),
|
|
58293
|
+
/** The integration the form is for; a provider whose integrations differ (a hub
|
|
58294
|
+
* integration takes no manual add) answers per integration. Absent = the addon's own. */
|
|
58295
|
+
integrationId: zod.z.string().optional()
|
|
58366
58296
|
}), zod.z.unknown().nullable()),
|
|
58367
58297
|
/** Create a new device via the device-provider capability. */
|
|
58368
58298
|
createDevice: method(zod.z.object({
|
|
@@ -58509,7 +58439,11 @@ var deviceManagerCapability = {
|
|
|
58509
58439
|
}),
|
|
58510
58440
|
/** The device type a provider creates via manual add (Camera/Container/Hub),
|
|
58511
58441
|
* so the Add-Device dialog uses the right type instead of assuming Camera. */
|
|
58512
|
-
providerCreationType: method(zod.z.object({
|
|
58442
|
+
providerCreationType: method(zod.z.object({
|
|
58443
|
+
addonId: zod.z.string(),
|
|
58444
|
+
/** The integration the Add-Device dialog is open on; absent = the addon's own. */
|
|
58445
|
+
integrationId: zod.z.string().optional()
|
|
58446
|
+
}), zod.z.object({ deviceType: zod.z.enum(DeviceType).nullable() }), { auth: "admin" }),
|
|
58513
58447
|
/** A provider's extra per-scan param form (ConfigUISchema) for the
|
|
58514
58448
|
* per-integration scan, or null when it takes none. */
|
|
58515
58449
|
providerDiscoveryParamsSchema: method(zod.z.object({ addonId: zod.z.string() }), zod.z.unknown(), { auth: "admin" }),
|
|
@@ -62269,7 +62203,7 @@ var TestConnectionStatusEnum = zod.z.enum([
|
|
|
62269
62203
|
"inconclusive",
|
|
62270
62204
|
"unsupported"
|
|
62271
62205
|
]);
|
|
62272
|
-
var TestConnectionResultSchema
|
|
62206
|
+
var TestConnectionResultSchema = zod.z.object({
|
|
62273
62207
|
/** True ONLY for `validated`. Never true for a test that did not run. */
|
|
62274
62208
|
success: zod.z.boolean(),
|
|
62275
62209
|
error: zod.z.string().optional(),
|
|
@@ -62326,7 +62260,7 @@ var integrationsCapability = {
|
|
|
62326
62260
|
testConnection: method(zod.z.object({
|
|
62327
62261
|
addonId: zod.z.string(),
|
|
62328
62262
|
settings: zod.z.record(zod.z.string(), zod.z.unknown())
|
|
62329
|
-
}), TestConnectionResultSchema
|
|
62263
|
+
}), TestConnectionResultSchema, {
|
|
62330
62264
|
kind: "mutation",
|
|
62331
62265
|
auth: "admin"
|
|
62332
62266
|
})
|
|
@@ -62357,6 +62291,14 @@ var ConfigSchemaPassthrough$3 = zod.z.custom();
|
|
|
62357
62291
|
var IntegrationInstanceIdSchema = zod.z.string().min(1);
|
|
62358
62292
|
var IntegrationInstanceModeSchema = zod.z.enum(["single", "multiple"]);
|
|
62359
62293
|
/**
|
|
62294
|
+
* What the addon's instances ARE for the Integrations page (planning#416). `devices`: each
|
|
62295
|
+
* instance is an integration that brings devices (the registry owns its on/off switch);
|
|
62296
|
+
* `services`: a connection configured from the addon's own function page, never listed on
|
|
62297
|
+
* Integrations.
|
|
62298
|
+
* It is the same vocabulary as the manifest's `integrationRole`, which stays as an override.
|
|
62299
|
+
*/
|
|
62300
|
+
var IntegrationInstanceRoleSchema = zod.z.enum(["devices", "services"]);
|
|
62301
|
+
/**
|
|
62360
62302
|
* One kind of instance a provider can create (an adapter, an account type). The sign-in and
|
|
62361
62303
|
* connect fields follow the `broker` contract (`broker.cap.ts`): `signIn.basePath` is a
|
|
62362
62304
|
* hub-relative route set speaking the sign-in contract, `connectPath` / `disconnectPath` open an
|
|
@@ -62367,6 +62309,22 @@ var IntegrationInstanceKindSchema = zod.z.object({
|
|
|
62367
62309
|
/** Stable id of the kind, sent back as `createInstance.kind`. */
|
|
62368
62310
|
id: zod.z.string().min(1),
|
|
62369
62311
|
label: zod.z.string().min(1),
|
|
62312
|
+
/**
|
|
62313
|
+
* The function capability this kind is configured for (`broker`, `smtp-provider`,
|
|
62314
|
+
* `device-provider`, ...). A page section is the kinds whose `functionCap` it names (D1013); a
|
|
62315
|
+
* provider with more than one section must name it on every kind.
|
|
62316
|
+
*/
|
|
62317
|
+
functionCap: zod.z.string().min(1),
|
|
62318
|
+
/**
|
|
62319
|
+
* For `functionCap: 'broker'`: the registry kind of the broker an instance of this kind is
|
|
62320
|
+
* (`matter`, `home-assistant`, ...). A caller that needs a broker of one kind (a link field)
|
|
62321
|
+
* finds the instances whose kind names it; absent takes the kind `id`.
|
|
62322
|
+
*/
|
|
62323
|
+
brokerKind: zod.z.string().min(1).optional(),
|
|
62324
|
+
/** What instances of this kind are for the Integrations page; absent takes the provider's `role`. */
|
|
62325
|
+
role: IntegrationInstanceRoleSchema.optional(),
|
|
62326
|
+
/** `testInstance` really probes the remote for this kind; absent takes the provider's `canTest`. */
|
|
62327
|
+
canTest: zod.z.boolean().optional(),
|
|
62370
62328
|
/** The kind signs in through a server-held interactive session. */
|
|
62371
62329
|
signIn: zod.z.object({
|
|
62372
62330
|
basePath: zod.z.string().min(1),
|
|
@@ -62378,18 +62336,6 @@ var IntegrationInstanceKindSchema = zod.z.object({
|
|
|
62378
62336
|
disconnectPath: zod.z.string().min(1).optional()
|
|
62379
62337
|
});
|
|
62380
62338
|
/**
|
|
62381
|
-
* What the addon's instances ARE for the Integrations page (planning#416). `devices`: each
|
|
62382
|
-
* instance is an integration that brings devices (the registry owns its on/off switch);
|
|
62383
|
-
* `services`: a connection configured from the addon's own function page, never listed on
|
|
62384
|
-
* Integrations; `both`: a dual entry listed for its devices that also keeps service connections.
|
|
62385
|
-
* It is the same vocabulary as the manifest's `integrationRole`, which stays as an override.
|
|
62386
|
-
*/
|
|
62387
|
-
var IntegrationInstanceRoleSchema = zod.z.enum([
|
|
62388
|
-
"devices",
|
|
62389
|
-
"services",
|
|
62390
|
-
"both"
|
|
62391
|
-
]);
|
|
62392
|
-
/**
|
|
62393
62339
|
* How devices of an instance are found. `none`: the operator adds them by hand; `lan`: the addon
|
|
62394
62340
|
* scans the network before any instance exists (the wizard offers the candidates); `account`: the
|
|
62395
62341
|
* devices appear after the instance signs in. `scopedToInstance`: a discovery run belongs to ONE
|
|
@@ -62473,7 +62419,11 @@ var integrationInstancesCapability = {
|
|
|
62473
62419
|
methods: {
|
|
62474
62420
|
describe: method(zod.z.void(), IntegrationInstanceDescriptionSchema, { auth: "admin" }),
|
|
62475
62421
|
/** The form; `id: null` is the create form. */
|
|
62476
|
-
instanceFormSchema: method(zod.z.object({
|
|
62422
|
+
instanceFormSchema: method(zod.z.object({
|
|
62423
|
+
id: IntegrationInstanceIdSchema.nullable(),
|
|
62424
|
+
/** The kind of the create form (`id: null`) of a provider with several. */
|
|
62425
|
+
kind: zod.z.string().min(1).optional()
|
|
62426
|
+
}), ConfigSchemaPassthrough$3, { auth: "admin" }),
|
|
62477
62427
|
listInstances: method(zod.z.void(), zod.z.array(IntegrationInstanceSchema).readonly(), { auth: "admin" }),
|
|
62478
62428
|
getInstance: method(zod.z.object({ id: IntegrationInstanceIdSchema }), IntegrationInstanceSchema.nullable(), { auth: "admin" }),
|
|
62479
62429
|
/**
|
|
@@ -62483,7 +62433,9 @@ var integrationInstancesCapability = {
|
|
|
62483
62433
|
createInstance: method(zod.z.object({
|
|
62484
62434
|
id: IntegrationInstanceIdSchema.optional(),
|
|
62485
62435
|
name: zod.z.string().min(1),
|
|
62486
|
-
kind: zod.z.string().min(1).optional()
|
|
62436
|
+
kind: zod.z.string().min(1).optional(),
|
|
62437
|
+
/** Form values written with the record (a link picked in the create dialog). */
|
|
62438
|
+
values: zod.z.record(zod.z.string(), zod.z.unknown()).optional()
|
|
62487
62439
|
}), zod.z.object({ id: zod.z.string() }), {
|
|
62488
62440
|
kind: "mutation",
|
|
62489
62441
|
auth: "admin"
|
|
@@ -62510,8 +62462,10 @@ var integrationInstancesCapability = {
|
|
|
62510
62462
|
}),
|
|
62511
62463
|
testInstance: optionalMethod(zod.z.object({
|
|
62512
62464
|
id: IntegrationInstanceIdSchema.nullable(),
|
|
62513
|
-
values: zod.z.record(zod.z.string(), zod.z.unknown())
|
|
62514
|
-
|
|
62465
|
+
values: zod.z.record(zod.z.string(), zod.z.unknown()),
|
|
62466
|
+
/** The kind to test when `id` is null and the provider has several. */
|
|
62467
|
+
kind: zod.z.string().min(1).optional()
|
|
62468
|
+
}), TestConnectionResultSchema, {
|
|
62515
62469
|
kind: "mutation",
|
|
62516
62470
|
auth: "admin"
|
|
62517
62471
|
})
|
|
@@ -66252,6 +66206,568 @@ var metricsProviderCapability = {
|
|
|
66252
66206
|
}
|
|
66253
66207
|
};
|
|
66254
66208
|
/**
|
|
66209
|
+
* records - an addon's own facts and documents (D881): ledgers, audit rows,
|
|
66210
|
+
* config documents, mirrors. The third storage API next to `ctx.settings`
|
|
66211
|
+
* (operator intent, D870) and device-history (numbers over time, D850).
|
|
66212
|
+
*
|
|
66213
|
+
* Who the OWNER is: `callerAddonId`, stamped by the transport on a call that
|
|
66214
|
+
* crossed a process and stated by a hub in-process caller (`ctx.records` does
|
|
66215
|
+
* that with the addon id closed over). It is deliberately NOT in any input
|
|
66216
|
+
* schema, so a session can never supply it, and a call with no stamp is refused
|
|
66217
|
+
* `records/no-caller`. A kind is readable and writable only by its owner; other
|
|
66218
|
+
* addons go through the owner's capability.
|
|
66219
|
+
*
|
|
66220
|
+
* Every read is three-way: a row, `null`, or the call THROWS. A failed read is
|
|
66221
|
+
* never `[]`. Secret fields are never on the wire: a read shows the
|
|
66222
|
+
* redaction token, `secretRefs` hands the owner's `ctx.secrets` the refs it
|
|
66223
|
+
* resolves itself, and a write may carry only a keychain marker bound to the
|
|
66224
|
+
* row's own ref.
|
|
66225
|
+
*
|
|
66226
|
+
* Internal: addons reach it through `ctx.records`, never directly.
|
|
66227
|
+
*/
|
|
66228
|
+
var RecordIdSchema = zod.z.string().min(1).max(256);
|
|
66229
|
+
/** A JSON object body. Size is the engine's check (`maxDataBytes`), not a schema's. */
|
|
66230
|
+
var RecordBodySchema = zod.z.record(zod.z.string(), zod.z.unknown());
|
|
66231
|
+
var RecordInputSchema = zod.z.object({
|
|
66232
|
+
id: RecordIdSchema,
|
|
66233
|
+
/** The device this row belongs to (D865 removal, per-device reads). */
|
|
66234
|
+
deviceId: zod.z.number().int().optional(),
|
|
66235
|
+
/** The domain clock, ms: observed / created / opened. */
|
|
66236
|
+
at: zod.z.number().int().optional(),
|
|
66237
|
+
/** Producer-set expiry, ms. Refused on a kind whose retention is an engine TTL. */
|
|
66238
|
+
expiresAt: zod.z.number().int().optional(),
|
|
66239
|
+
data: RecordBodySchema
|
|
66240
|
+
});
|
|
66241
|
+
var RecordViewSchema = zod.z.object({
|
|
66242
|
+
id: zod.z.string(),
|
|
66243
|
+
deviceId: zod.z.number().int().nullable(),
|
|
66244
|
+
at: zod.z.number().nullable(),
|
|
66245
|
+
expiresAt: zod.z.number().nullable(),
|
|
66246
|
+
rev: zod.z.number().int(),
|
|
66247
|
+
updatedAt: zod.z.number(),
|
|
66248
|
+
data: RecordBodySchema
|
|
66249
|
+
});
|
|
66250
|
+
/** One predicate on a declared index field: equality, a set, or a range. */
|
|
66251
|
+
var RecordWhereValueSchema = zod.z.union([
|
|
66252
|
+
zod.z.string(),
|
|
66253
|
+
zod.z.number(),
|
|
66254
|
+
zod.z.boolean(),
|
|
66255
|
+
zod.z.object({ in: zod.z.array(zod.z.union([
|
|
66256
|
+
zod.z.string(),
|
|
66257
|
+
zod.z.number(),
|
|
66258
|
+
zod.z.boolean()
|
|
66259
|
+
])).min(1).max(RECORD_BATCH_MAX) }),
|
|
66260
|
+
zod.z.object({
|
|
66261
|
+
gt: zod.z.union([zod.z.string(), zod.z.number()]).optional(),
|
|
66262
|
+
gte: zod.z.union([zod.z.string(), zod.z.number()]).optional(),
|
|
66263
|
+
lt: zod.z.union([zod.z.string(), zod.z.number()]).optional(),
|
|
66264
|
+
lte: zod.z.union([zod.z.string(), zod.z.number()]).optional()
|
|
66265
|
+
}).refine((r) => Object.keys(r).length > 0, { message: "name at least one bound" })
|
|
66266
|
+
]);
|
|
66267
|
+
/** Declared index fields only. Anything else does not compile, by design. */
|
|
66268
|
+
var RecordWhereSchema = zod.z.record(RecordFieldPathSchema, RecordWhereValueSchema);
|
|
66269
|
+
var KindShape = { kind: RecordKindNameSchema };
|
|
66270
|
+
var TimeWindowShape = {
|
|
66271
|
+
deviceId: zod.z.number().int().optional(),
|
|
66272
|
+
atFrom: zod.z.number().optional(),
|
|
66273
|
+
atTo: zod.z.number().optional()
|
|
66274
|
+
};
|
|
66275
|
+
var RecordQueryInputSchema = zod.z.object({
|
|
66276
|
+
...KindShape,
|
|
66277
|
+
...TimeWindowShape,
|
|
66278
|
+
where: RecordWhereSchema.optional(),
|
|
66279
|
+
/** Without `where`: `at` (default for a kind with a clock) or `id`. With `where` the order is the index's. */
|
|
66280
|
+
order: zod.z.enum(["at", "id"]).optional(),
|
|
66281
|
+
desc: zod.z.boolean().optional(),
|
|
66282
|
+
limit: zod.z.number().int().min(1).max(RECORD_QUERY_MAX).default(100),
|
|
66283
|
+
/** Opaque keyset cursor from a previous answer. There is no offset. */
|
|
66284
|
+
cursor: zod.z.string().min(1).optional()
|
|
66285
|
+
});
|
|
66286
|
+
var RecordQueryResultSchema = zod.z.object({
|
|
66287
|
+
records: zod.z.array(RecordViewSchema),
|
|
66288
|
+
nextCursor: zod.z.string().nullable()
|
|
66289
|
+
});
|
|
66290
|
+
var RecordKindStateSchema = zod.z.enum([
|
|
66291
|
+
"created",
|
|
66292
|
+
"unchanged",
|
|
66293
|
+
"updated"
|
|
66294
|
+
]);
|
|
66295
|
+
var DeclareKindResultSchema = zod.z.object({
|
|
66296
|
+
kindId: zod.z.number().int(),
|
|
66297
|
+
state: RecordKindStateSchema,
|
|
66298
|
+
createdIndexes: zod.z.array(zod.z.string())
|
|
66299
|
+
});
|
|
66300
|
+
/** Keychain refs a write released (the old marker is gone from the row): the owner deletes the values. */
|
|
66301
|
+
var SecretRefsList = zod.z.array(zod.z.string());
|
|
66302
|
+
/**
|
|
66303
|
+
* One op of a `transact`: the single-row writes, each on a kind of the caller.
|
|
66304
|
+
* All ops of one call share ONE database file and ONE `transactFamily`.
|
|
66305
|
+
*/
|
|
66306
|
+
var RecordTransactOpSchema = zod.z.discriminatedUnion("op", [
|
|
66307
|
+
zod.z.object({
|
|
66308
|
+
op: zod.z.literal("put"),
|
|
66309
|
+
kind: RecordKindNameSchema,
|
|
66310
|
+
record: RecordInputSchema,
|
|
66311
|
+
ifRev: zod.z.number().int().min(0).optional()
|
|
66312
|
+
}),
|
|
66313
|
+
zod.z.object({
|
|
66314
|
+
op: zod.z.literal("patch"),
|
|
66315
|
+
kind: RecordKindNameSchema,
|
|
66316
|
+
id: RecordIdSchema,
|
|
66317
|
+
data: RecordBodySchema,
|
|
66318
|
+
at: zod.z.number().int().nullable().optional(),
|
|
66319
|
+
expiresAt: zod.z.number().int().nullable().optional(),
|
|
66320
|
+
ifRev: zod.z.number().int().min(1).optional()
|
|
66321
|
+
}),
|
|
66322
|
+
zod.z.object({
|
|
66323
|
+
op: zod.z.literal("delete"),
|
|
66324
|
+
kind: RecordKindNameSchema,
|
|
66325
|
+
id: RecordIdSchema
|
|
66326
|
+
})
|
|
66327
|
+
]);
|
|
66328
|
+
var RecordSecretRefsSchema = zod.z.record(zod.z.string(), zod.z.record(zod.z.string(), zod.z.string()));
|
|
66329
|
+
var recordsCapability = {
|
|
66330
|
+
name: "records",
|
|
66331
|
+
scope: "system",
|
|
66332
|
+
mode: "singleton",
|
|
66333
|
+
internal: true,
|
|
66334
|
+
methods: {
|
|
66335
|
+
/** Reconcile this addon's kinds: create the catalog rows and the declared indexes. Additive only. */
|
|
66336
|
+
declareKinds: method(zod.z.object({ kinds: zod.z.record(RecordKindNameSchema, RecordKindDeclarationSchema) }), zod.z.object({ kinds: zod.z.record(zod.z.string(), DeclareKindResultSchema) }), {
|
|
66337
|
+
kind: "mutation",
|
|
66338
|
+
auth: "admin"
|
|
66339
|
+
}),
|
|
66340
|
+
get: method(zod.z.object({
|
|
66341
|
+
...KindShape,
|
|
66342
|
+
id: RecordIdSchema
|
|
66343
|
+
}), RecordViewSchema.nullable(), { auth: "admin" }),
|
|
66344
|
+
getMany: method(zod.z.object({
|
|
66345
|
+
...KindShape,
|
|
66346
|
+
ids: zod.z.array(RecordIdSchema).min(1).max(RECORD_BATCH_MAX)
|
|
66347
|
+
}), zod.z.array(RecordViewSchema), { auth: "admin" }),
|
|
66348
|
+
/** The keychain refs of the rows' secret fields, by id and concrete path. For the owner's `ctx.secrets`. */
|
|
66349
|
+
secretRefs: method(zod.z.object({
|
|
66350
|
+
...KindShape,
|
|
66351
|
+
ids: zod.z.array(RecordIdSchema).min(1).max(RECORD_BATCH_MAX)
|
|
66352
|
+
}), RecordSecretRefsSchema, { auth: "admin" }),
|
|
66353
|
+
put: method(zod.z.object({
|
|
66354
|
+
...KindShape,
|
|
66355
|
+
record: RecordInputSchema,
|
|
66356
|
+
/** Compare-and-set. `0` means "the row must not exist". */
|
|
66357
|
+
ifRev: zod.z.number().int().min(0).optional()
|
|
66358
|
+
}), zod.z.object({
|
|
66359
|
+
rev: zod.z.number().int(),
|
|
66360
|
+
releasedRefs: SecretRefsList
|
|
66361
|
+
}), {
|
|
66362
|
+
kind: "mutation",
|
|
66363
|
+
auth: "admin"
|
|
66364
|
+
}),
|
|
66365
|
+
putMany: method(zod.z.object({
|
|
66366
|
+
...KindShape,
|
|
66367
|
+
records: zod.z.array(RecordInputSchema).min(1).max(RECORD_BATCH_MAX)
|
|
66368
|
+
}), zod.z.object({
|
|
66369
|
+
count: zod.z.number().int(),
|
|
66370
|
+
releasedRefs: SecretRefsList
|
|
66371
|
+
}), {
|
|
66372
|
+
kind: "mutation",
|
|
66373
|
+
auth: "admin"
|
|
66374
|
+
}),
|
|
66375
|
+
/** One-statement RFC 7396 merge: `null` removes a field; a merge never reads. */
|
|
66376
|
+
patch: method(zod.z.object({
|
|
66377
|
+
...KindShape,
|
|
66378
|
+
id: RecordIdSchema,
|
|
66379
|
+
data: RecordBodySchema,
|
|
66380
|
+
at: zod.z.number().int().nullable().optional(),
|
|
66381
|
+
expiresAt: zod.z.number().int().nullable().optional(),
|
|
66382
|
+
ifRev: zod.z.number().int().min(1).optional()
|
|
66383
|
+
}), zod.z.object({
|
|
66384
|
+
rev: zod.z.number().int(),
|
|
66385
|
+
releasedRefs: SecretRefsList
|
|
66386
|
+
}), {
|
|
66387
|
+
kind: "mutation",
|
|
66388
|
+
auth: "admin"
|
|
66389
|
+
}),
|
|
66390
|
+
delete: method(zod.z.object({
|
|
66391
|
+
...KindShape,
|
|
66392
|
+
id: RecordIdSchema
|
|
66393
|
+
}), zod.z.object({
|
|
66394
|
+
deleted: zod.z.boolean(),
|
|
66395
|
+
secretRefs: SecretRefsList
|
|
66396
|
+
}), {
|
|
66397
|
+
kind: "mutation",
|
|
66398
|
+
auth: "admin"
|
|
66399
|
+
}),
|
|
66400
|
+
deleteMany: method(zod.z.object({
|
|
66401
|
+
...KindShape,
|
|
66402
|
+
ids: zod.z.array(RecordIdSchema).min(1).max(RECORD_BATCH_MAX)
|
|
66403
|
+
}), zod.z.object({
|
|
66404
|
+
deleted: zod.z.number().int(),
|
|
66405
|
+
secretRefs: SecretRefsList
|
|
66406
|
+
}), {
|
|
66407
|
+
kind: "mutation",
|
|
66408
|
+
auth: "admin"
|
|
66409
|
+
}),
|
|
66410
|
+
query: method(RecordQueryInputSchema, RecordQueryResultSchema, { auth: "admin" }),
|
|
66411
|
+
count: method(zod.z.object({
|
|
66412
|
+
...KindShape,
|
|
66413
|
+
...TimeWindowShape,
|
|
66414
|
+
where: RecordWhereSchema.optional()
|
|
66415
|
+
}), zod.z.object({ count: zod.z.number().int() }), { auth: "admin" }),
|
|
66416
|
+
histogram: method(zod.z.object({
|
|
66417
|
+
...KindShape,
|
|
66418
|
+
deviceId: zod.z.number().int().optional(),
|
|
66419
|
+
from: zod.z.number(),
|
|
66420
|
+
to: zod.z.number(),
|
|
66421
|
+
bucketMs: zod.z.number().int().positive()
|
|
66422
|
+
}), zod.z.object({ buckets: zod.z.array(zod.z.object({
|
|
66423
|
+
bucketStart: zod.z.number(),
|
|
66424
|
+
count: zod.z.number().int()
|
|
66425
|
+
})) }), { auth: "admin" }),
|
|
66426
|
+
/** Index-served only: every field must belong to ONE declared index. */
|
|
66427
|
+
aggregate: method(zod.z.object({
|
|
66428
|
+
...KindShape,
|
|
66429
|
+
op: zod.z.enum([
|
|
66430
|
+
"sum",
|
|
66431
|
+
"min",
|
|
66432
|
+
"max",
|
|
66433
|
+
"count"
|
|
66434
|
+
]),
|
|
66435
|
+
field: RecordFieldPathSchema.optional(),
|
|
66436
|
+
groupBy: RecordFieldPathSchema.optional(),
|
|
66437
|
+
where: RecordWhereSchema.optional()
|
|
66438
|
+
}), zod.z.object({ rows: zod.z.array(zod.z.object({
|
|
66439
|
+
group: zod.z.union([
|
|
66440
|
+
zod.z.string(),
|
|
66441
|
+
zod.z.number(),
|
|
66442
|
+
zod.z.null()
|
|
66443
|
+
]),
|
|
66444
|
+
value: zod.z.number().nullable()
|
|
66445
|
+
})) }), { auth: "admin" }),
|
|
66446
|
+
/** Batched (5 000 rows per statement, yielding between). Needs a predicate: there is no "delete all". */
|
|
66447
|
+
deleteWhere: method(zod.z.object({
|
|
66448
|
+
...KindShape,
|
|
66449
|
+
deviceId: zod.z.number().int().optional(),
|
|
66450
|
+
atBefore: zod.z.number().optional(),
|
|
66451
|
+
where: RecordWhereSchema.optional()
|
|
66452
|
+
}), zod.z.object({
|
|
66453
|
+
deleted: zod.z.number().int(),
|
|
66454
|
+
secretRefs: SecretRefsList
|
|
66455
|
+
}), {
|
|
66456
|
+
kind: "mutation",
|
|
66457
|
+
auth: "admin"
|
|
66458
|
+
}),
|
|
66459
|
+
/**
|
|
66460
|
+
* Several single-row writes (put / patch / delete) in ONE SQLite transaction:
|
|
66461
|
+
* all land or none does. Every op's kind must sit in one file and share one
|
|
66462
|
+
* `transactFamily` (`records/transact-refused` otherwise). Results are in op order.
|
|
66463
|
+
*/
|
|
66464
|
+
transact: method(zod.z.object({ ops: zod.z.array(RecordTransactOpSchema).min(1).max(RECORD_BATCH_MAX) }), zod.z.object({
|
|
66465
|
+
results: zod.z.array(zod.z.object({
|
|
66466
|
+
rev: zod.z.number().int().nullable(),
|
|
66467
|
+
deleted: zod.z.boolean()
|
|
66468
|
+
})),
|
|
66469
|
+
releasedRefs: SecretRefsList,
|
|
66470
|
+
secretRefs: SecretRefsList
|
|
66471
|
+
}), {
|
|
66472
|
+
kind: "mutation",
|
|
66473
|
+
auth: "admin"
|
|
66474
|
+
}),
|
|
66475
|
+
/** The D865 hook body: every kind of this addon declared `deviceRemoval: 'delete'`. */
|
|
66476
|
+
deleteDevice: method(zod.z.object({
|
|
66477
|
+
deviceId: zod.z.number().int(),
|
|
66478
|
+
kinds: zod.z.array(RecordKindNameSchema).optional()
|
|
66479
|
+
}), zod.z.object({
|
|
66480
|
+
deleted: zod.z.record(zod.z.string(), zod.z.number().int()),
|
|
66481
|
+
secretRefs: SecretRefsList
|
|
66482
|
+
}), {
|
|
66483
|
+
kind: "mutation",
|
|
66484
|
+
auth: "admin"
|
|
66485
|
+
}),
|
|
66486
|
+
/** A monotonically increasing integer per kind (replaces "resume from the highest"). */
|
|
66487
|
+
allocateId: method(zod.z.object(KindShape), zod.z.object({ id: zod.z.number().int() }), {
|
|
66488
|
+
kind: "mutation",
|
|
66489
|
+
auth: "admin"
|
|
66490
|
+
})
|
|
66491
|
+
}
|
|
66492
|
+
};
|
|
66493
|
+
/**
|
|
66494
|
+
* The wire shapes of the migration API, version 1 (planning#447).
|
|
66495
|
+
*
|
|
66496
|
+
* A migration is code that outlives the server it was written against: an addon at
|
|
66497
|
+
* version 1.4 that is brought to 1.9 in one jump still runs its 1.4 catalogue, against
|
|
66498
|
+
* the 1.9 kernel. The only thing that code may call is {@link MigrationApiV1}; this file
|
|
66499
|
+
* is the contract of every method of it, one Zod pair per method.
|
|
66500
|
+
*
|
|
66501
|
+
* APPEND-ONLY. A released method is never removed and never changes meaning: an input
|
|
66502
|
+
* field is never removed or made required, an enum never narrows, an output field is
|
|
66503
|
+
* never removed. A change that cannot be expressed that way is `migration-api.v2`, next
|
|
66504
|
+
* to this file. `scripts/check-migration-api-append-only.ts` holds the line against
|
|
66505
|
+
* `scripts/migration-api-contract.json`, and every `behaviours` id below must have an
|
|
66506
|
+
* `it('<id>'` in `migration-api.contract.spec.ts`.
|
|
66507
|
+
*/
|
|
66508
|
+
var Rows = zod.z.record(zod.z.string(), zod.z.unknown());
|
|
66509
|
+
var IntegrationId = zod.z.object({ integrationId: zod.z.string().min(1) });
|
|
66510
|
+
var RecordId = zod.z.object({ id: zod.z.string().min(1) });
|
|
66511
|
+
var RecordRowSchema = zod.z.object({
|
|
66512
|
+
id: zod.z.string(),
|
|
66513
|
+
deviceId: zod.z.number().int().nullable(),
|
|
66514
|
+
at: zod.z.number().nullable(),
|
|
66515
|
+
expiresAt: zod.z.number().nullable(),
|
|
66516
|
+
rev: zod.z.number().int(),
|
|
66517
|
+
updatedAt: zod.z.number(),
|
|
66518
|
+
data: Rows
|
|
66519
|
+
});
|
|
66520
|
+
var RecordPutShape = {
|
|
66521
|
+
id: zod.z.string().min(1),
|
|
66522
|
+
deviceId: zod.z.number().int().optional(),
|
|
66523
|
+
at: zod.z.number().int().optional(),
|
|
66524
|
+
expiresAt: zod.z.number().int().optional(),
|
|
66525
|
+
data: Rows
|
|
66526
|
+
};
|
|
66527
|
+
var MigrationIntegrationSchema = zod.z.object({
|
|
66528
|
+
id: zod.z.string(),
|
|
66529
|
+
addonId: zod.z.string(),
|
|
66530
|
+
name: zod.z.string(),
|
|
66531
|
+
info: Rows,
|
|
66532
|
+
originStableId: zod.z.string().optional()
|
|
66533
|
+
});
|
|
66534
|
+
var MigrationDeviceSchema = zod.z.object({
|
|
66535
|
+
id: zod.z.number().int(),
|
|
66536
|
+
integrationId: zod.z.string().nullable().optional(),
|
|
66537
|
+
/** The owning device; null or absent for a root. */
|
|
66538
|
+
parentDeviceId: zod.z.number().int().nullable().optional(),
|
|
66539
|
+
type: zod.z.string().optional(),
|
|
66540
|
+
name: zod.z.string().optional(),
|
|
66541
|
+
stableId: zod.z.string().optional()
|
|
66542
|
+
});
|
|
66543
|
+
/** What the engine says about the migration API it serves: lets an addon notice an older server. */
|
|
66544
|
+
var MigrationApiInfoSchema = zod.z.object({
|
|
66545
|
+
version: zod.z.number().int(),
|
|
66546
|
+
methods: zod.z.array(zod.z.string())
|
|
66547
|
+
});
|
|
66548
|
+
var LogInput = zod.z.object({
|
|
66549
|
+
message: zod.z.string(),
|
|
66550
|
+
meta: Rows.optional(),
|
|
66551
|
+
/** Grouping tags of the line; a line about a device carries `{ deviceId }`. */
|
|
66552
|
+
tags: zod.z.object({ deviceId: zod.z.number().int().optional() }).optional()
|
|
66553
|
+
});
|
|
66554
|
+
var MIGRATION_API_V1_METHODS = {
|
|
66555
|
+
"ledger.declare": {
|
|
66556
|
+
input: zod.z.object({
|
|
66557
|
+
owner: zod.z.string().min(1),
|
|
66558
|
+
metas: zod.z.array(MigrationMetaSchema)
|
|
66559
|
+
}),
|
|
66560
|
+
output: zod.z.object({
|
|
66561
|
+
bootId: zod.z.string(),
|
|
66562
|
+
snapshot: zod.z.enum([
|
|
66563
|
+
"none",
|
|
66564
|
+
"written",
|
|
66565
|
+
"refused"
|
|
66566
|
+
]),
|
|
66567
|
+
steps: zod.z.array(MigrationOwnerStepSchema),
|
|
66568
|
+
/** The migration API the engine serves; absent from a server that predates it. */
|
|
66569
|
+
migrationApi: MigrationApiInfoSchema.optional()
|
|
66570
|
+
}),
|
|
66571
|
+
behaviours: ["ledger.declare.answers-steps-in-engine-order", "ledger.declare.answers-the-migration-api"]
|
|
66572
|
+
},
|
|
66573
|
+
"ledger.start": {
|
|
66574
|
+
input: zod.z.object({ id: zod.z.string().min(1) }),
|
|
66575
|
+
output: zod.z.object({
|
|
66576
|
+
proceed: zod.z.boolean(),
|
|
66577
|
+
state: zod.z.union([zod.z.literal("pending"), MigrationStatusSchema]),
|
|
66578
|
+
reason: zod.z.string().nullable()
|
|
66579
|
+
}),
|
|
66580
|
+
behaviours: ["ledger.start.proceeds-when-predecessors-applied"]
|
|
66581
|
+
},
|
|
66582
|
+
"ledger.finish": {
|
|
66583
|
+
input: zod.z.object({
|
|
66584
|
+
id: zod.z.string().min(1),
|
|
66585
|
+
result: MigrationOwnerResultSchema
|
|
66586
|
+
}),
|
|
66587
|
+
output: zod.z.object({
|
|
66588
|
+
status: MigrationStatusSchema,
|
|
66589
|
+
error: zod.z.string().nullable(),
|
|
66590
|
+
rowsChanged: zod.z.number().int().nonnegative()
|
|
66591
|
+
}),
|
|
66592
|
+
behaviours: ["ledger.finish.records-the-outcome"]
|
|
66593
|
+
},
|
|
66594
|
+
"legacyRows.read": {
|
|
66595
|
+
input: IntegrationId,
|
|
66596
|
+
output: Rows,
|
|
66597
|
+
behaviours: [
|
|
66598
|
+
"legacyRows.read.returns-stored-rows",
|
|
66599
|
+
"legacyRows.read.absent-store-is-empty",
|
|
66600
|
+
"legacyRows.caller.sibling-package"
|
|
66601
|
+
]
|
|
66602
|
+
},
|
|
66603
|
+
"legacyRows.clear": {
|
|
66604
|
+
input: IntegrationId,
|
|
66605
|
+
output: zod.z.object({
|
|
66606
|
+
rows: zod.z.number().int().nonnegative(),
|
|
66607
|
+
secrets: zod.z.number().int().nonnegative()
|
|
66608
|
+
}),
|
|
66609
|
+
behaviours: ["legacyRows.clear.deletes-the-rows", "legacyRows.clear.absent-store-is-noop"]
|
|
66610
|
+
},
|
|
66611
|
+
"legacyRows.patch": {
|
|
66612
|
+
input: IntegrationId.extend({ patch: Rows }),
|
|
66613
|
+
output: zod.z.object({ written: zod.z.boolean() }),
|
|
66614
|
+
behaviours: ["legacyRows.patch.upserts-keys-and-keeps-the-rest", "legacyRows.patch.absent-store-writes-nothing"]
|
|
66615
|
+
},
|
|
66616
|
+
"legacyRows.deleteKeys": {
|
|
66617
|
+
input: IntegrationId.extend({ keys: zod.z.array(zod.z.string().min(1)) }),
|
|
66618
|
+
output: zod.z.object({
|
|
66619
|
+
present: zod.z.boolean(),
|
|
66620
|
+
removed: Rows
|
|
66621
|
+
}),
|
|
66622
|
+
behaviours: ["legacyRows.deleteKeys.removes-the-named-keys", "legacyRows.deleteKeys.absent-store-reports-not-present"]
|
|
66623
|
+
},
|
|
66624
|
+
"records.get": {
|
|
66625
|
+
input: RecordId,
|
|
66626
|
+
output: RecordRowSchema.nullable(),
|
|
66627
|
+
behaviours: ["records.get.returns-the-row-or-null"]
|
|
66628
|
+
},
|
|
66629
|
+
"records.getResolved": {
|
|
66630
|
+
input: RecordId,
|
|
66631
|
+
output: RecordRowSchema.nullable(),
|
|
66632
|
+
behaviours: ["records.getResolved.resolves-secret-fields"]
|
|
66633
|
+
},
|
|
66634
|
+
"records.put": {
|
|
66635
|
+
input: zod.z.object({
|
|
66636
|
+
...RecordPutShape,
|
|
66637
|
+
ifRev: zod.z.number().int().optional()
|
|
66638
|
+
}),
|
|
66639
|
+
output: zod.z.object({ rev: zod.z.number().int() }),
|
|
66640
|
+
behaviours: ["records.put.creates-and-replaces", "records.put.if-rev-conflict-throws"]
|
|
66641
|
+
},
|
|
66642
|
+
"records.putMany": {
|
|
66643
|
+
input: zod.z.object({ records: zod.z.array(zod.z.object(RecordPutShape)) }),
|
|
66644
|
+
output: zod.z.object({ count: zod.z.number().int().nonnegative() }),
|
|
66645
|
+
behaviours: ["records.putMany.writes-every-row"]
|
|
66646
|
+
},
|
|
66647
|
+
"records.patch": {
|
|
66648
|
+
input: RecordId.extend({
|
|
66649
|
+
partial: Rows,
|
|
66650
|
+
ifRev: zod.z.number().int().optional()
|
|
66651
|
+
}),
|
|
66652
|
+
output: zod.z.object({ rev: zod.z.number().int() }),
|
|
66653
|
+
behaviours: ["records.patch.merges-and-null-removes"]
|
|
66654
|
+
},
|
|
66655
|
+
"records.delete": {
|
|
66656
|
+
input: RecordId,
|
|
66657
|
+
output: zod.z.object({ deleted: zod.z.boolean() }),
|
|
66658
|
+
behaviours: ["records.delete.reports-whether-a-row-went"]
|
|
66659
|
+
},
|
|
66660
|
+
"records.query": {
|
|
66661
|
+
input: zod.z.object({
|
|
66662
|
+
deviceId: zod.z.number().int().optional(),
|
|
66663
|
+
atFrom: zod.z.number().optional(),
|
|
66664
|
+
atTo: zod.z.number().optional(),
|
|
66665
|
+
where: RecordWhereSchema.optional(),
|
|
66666
|
+
limit: zod.z.number().int().min(1).optional(),
|
|
66667
|
+
cursor: zod.z.string().min(1).optional(),
|
|
66668
|
+
resolveSecrets: zod.z.boolean().optional()
|
|
66669
|
+
}),
|
|
66670
|
+
output: zod.z.object({
|
|
66671
|
+
records: zod.z.array(RecordRowSchema),
|
|
66672
|
+
nextCursor: zod.z.string().nullable()
|
|
66673
|
+
}),
|
|
66674
|
+
behaviours: ["records.query.pages-with-a-cursor", "records.query.filters-on-a-declared-index"]
|
|
66675
|
+
},
|
|
66676
|
+
"records.deleteWhere": {
|
|
66677
|
+
input: zod.z.object({
|
|
66678
|
+
deviceId: zod.z.number().int().optional(),
|
|
66679
|
+
atBefore: zod.z.number().optional(),
|
|
66680
|
+
where: RecordWhereSchema.optional()
|
|
66681
|
+
}),
|
|
66682
|
+
output: zod.z.object({ count: zod.z.number().int().nonnegative() }),
|
|
66683
|
+
behaviours: ["records.deleteWhere.deletes-the-matching-rows"]
|
|
66684
|
+
},
|
|
66685
|
+
"settings.read": {
|
|
66686
|
+
input: zod.z.object({}),
|
|
66687
|
+
output: zod.z.object({ store: Rows }),
|
|
66688
|
+
behaviours: ["settings.read.returns-the-addon-store"]
|
|
66689
|
+
},
|
|
66690
|
+
"settings.write": {
|
|
66691
|
+
input: zod.z.object({ patch: Rows }),
|
|
66692
|
+
output: zod.z.object({}),
|
|
66693
|
+
behaviours: ["settings.write.merges-and-keeps-other-keys"]
|
|
66694
|
+
},
|
|
66695
|
+
"settings.deleteKeys": {
|
|
66696
|
+
input: zod.z.object({ keys: zod.z.array(zod.z.string().min(1)) }),
|
|
66697
|
+
output: zod.z.object({ removed: zod.z.array(zod.z.string()) }),
|
|
66698
|
+
behaviours: ["settings.deleteKeys.removes-only-the-named-keys"]
|
|
66699
|
+
},
|
|
66700
|
+
"secrets.resolve": {
|
|
66701
|
+
input: zod.z.object({ refs: zod.z.array(zod.z.string()) }),
|
|
66702
|
+
output: zod.z.object({ values: zod.z.record(zod.z.string(), zod.z.string().nullable()) }),
|
|
66703
|
+
behaviours: ["secrets.resolve.answers-null-for-a-missing-ref"]
|
|
66704
|
+
},
|
|
66705
|
+
"secrets.put": {
|
|
66706
|
+
input: zod.z.object({
|
|
66707
|
+
ref: zod.z.string().min(1),
|
|
66708
|
+
value: zod.z.string()
|
|
66709
|
+
}),
|
|
66710
|
+
output: zod.z.object({}),
|
|
66711
|
+
behaviours: ["secrets.put.stores-under-the-owner"]
|
|
66712
|
+
},
|
|
66713
|
+
"secrets.delete": {
|
|
66714
|
+
input: zod.z.object({ refs: zod.z.array(zod.z.string()) }),
|
|
66715
|
+
output: zod.z.object({ deleted: zod.z.number().int().nonnegative() }),
|
|
66716
|
+
behaviours: ["secrets.delete.ignores-unknown-refs"]
|
|
66717
|
+
},
|
|
66718
|
+
"integrations.list": {
|
|
66719
|
+
input: zod.z.object({}),
|
|
66720
|
+
output: zod.z.object({ integrations: zod.z.array(MigrationIntegrationSchema) }),
|
|
66721
|
+
behaviours: ["integrations.list.lists-every-integration"]
|
|
66722
|
+
},
|
|
66723
|
+
"integrations.get": {
|
|
66724
|
+
input: zod.z.object({ id: zod.z.string().min(1) }),
|
|
66725
|
+
output: MigrationIntegrationSchema.nullable(),
|
|
66726
|
+
behaviours: ["integrations.get.null-for-an-unknown-id"]
|
|
66727
|
+
},
|
|
66728
|
+
"devices.list": {
|
|
66729
|
+
input: zod.z.object({
|
|
66730
|
+
addonId: zod.z.string().min(1),
|
|
66731
|
+
integrationId: zod.z.string().min(1).optional()
|
|
66732
|
+
}),
|
|
66733
|
+
output: zod.z.object({ devices: zod.z.array(MigrationDeviceSchema) }),
|
|
66734
|
+
behaviours: ["devices.list.scoped-to-the-addon", "devices.list.filters-by-integration"]
|
|
66735
|
+
},
|
|
66736
|
+
"devices.get": {
|
|
66737
|
+
input: zod.z.object({ deviceId: zod.z.number().int() }),
|
|
66738
|
+
output: zod.z.object({
|
|
66739
|
+
id: zod.z.number().int(),
|
|
66740
|
+
integrationId: zod.z.string().nullable(),
|
|
66741
|
+
/** Whether the device carries any stored config; its content is not offered. */
|
|
66742
|
+
hasConfig: zod.z.boolean()
|
|
66743
|
+
}).nullable(),
|
|
66744
|
+
behaviours: ["devices.get.null-for-an-unknown-id", "devices.get.reports-link-and-config"]
|
|
66745
|
+
},
|
|
66746
|
+
"devices.setIntegrationId": {
|
|
66747
|
+
input: zod.z.object({
|
|
66748
|
+
deviceId: zod.z.number().int(),
|
|
66749
|
+
integrationId: zod.z.string().min(1)
|
|
66750
|
+
}),
|
|
66751
|
+
output: zod.z.object({}),
|
|
66752
|
+
behaviours: ["devices.setIntegrationId.links-the-device"]
|
|
66753
|
+
},
|
|
66754
|
+
"node.localNodeId": {
|
|
66755
|
+
input: zod.z.object({}),
|
|
66756
|
+
output: zod.z.object({ nodeId: zod.z.string() }),
|
|
66757
|
+
behaviours: ["node.localNodeId.names-this-node"]
|
|
66758
|
+
},
|
|
66759
|
+
"log.info": {
|
|
66760
|
+
input: LogInput,
|
|
66761
|
+
output: zod.z.object({}),
|
|
66762
|
+
behaviours: ["log.info.writes-a-line"]
|
|
66763
|
+
},
|
|
66764
|
+
"log.warn": {
|
|
66765
|
+
input: LogInput,
|
|
66766
|
+
output: zod.z.object({}),
|
|
66767
|
+
behaviours: ["log.warn.writes-a-line"]
|
|
66768
|
+
}
|
|
66769
|
+
};
|
|
66770
|
+
/**
|
|
66255
66771
|
* migrations — the ledger and the controls of the boot-time migration engine
|
|
66256
66772
|
* (D987). Hub-only and internal: `sqlite-settings` is the registrant, because the
|
|
66257
66773
|
* ledger lives INSIDE the database files it serves (`camstack.db`, `events.db`,
|
|
@@ -66326,7 +66842,9 @@ var migrationsCapability = {
|
|
|
66326
66842
|
"written",
|
|
66327
66843
|
"refused"
|
|
66328
66844
|
]),
|
|
66329
|
-
steps: zod.z.array(MigrationOwnerStepSchema)
|
|
66845
|
+
steps: zod.z.array(MigrationOwnerStepSchema),
|
|
66846
|
+
/** The migration API this engine serves (additive: a server that predates it omits it). */
|
|
66847
|
+
migrationApi: MigrationApiInfoSchema.optional()
|
|
66330
66848
|
}), {
|
|
66331
66849
|
kind: "mutation",
|
|
66332
66850
|
auth: "admin"
|
|
@@ -69447,6 +69965,20 @@ var pipelineAnalyticsCapability = {
|
|
|
69447
69965
|
*/
|
|
69448
69966
|
countUnstampedEventMedia: method(zod.z.object({}), UnstampedEventMediaCountSchema, { auth: "admin" }),
|
|
69449
69967
|
/**
|
|
69968
|
+
* Stored media per storage location: rows and bytes stamped with each asked
|
|
69969
|
+
* location id, the rows with none, and the rows naming a location that was
|
|
69970
|
+
* not asked about. One indexed aggregate per location (`idx_media_location_size`,
|
|
69971
|
+
* a covering index) plus the NULL one, and one unfiltered total that is a
|
|
69972
|
+
* covering-index scan: O(rows), cheap per row but not constant, so a hub with
|
|
69973
|
+
* millions of rows pays for it once per call. `unlisted` is relative to the
|
|
69974
|
+
* ids ASKED: it means "gone" only when every location id was asked. A failed
|
|
69975
|
+
* read throws; it never reads as zero.
|
|
69976
|
+
*/
|
|
69977
|
+
getMediaLocationCensus: method(MediaLocationCensusInputSchema, MediaLocationCensusSchema, {
|
|
69978
|
+
kind: "query",
|
|
69979
|
+
auth: "admin"
|
|
69980
|
+
}),
|
|
69981
|
+
/**
|
|
69450
69982
|
* How many rows a pass would STILL act on against `toLocationId`.
|
|
69451
69983
|
*
|
|
69452
69984
|
* One derivation, two consumers: it is the media lane's denominator (the
|
|
@@ -72912,7 +73444,7 @@ var BrokerStatusSchema$1 = zod.z.enum([
|
|
|
72912
73444
|
"unreachable",
|
|
72913
73445
|
"tls-error"
|
|
72914
73446
|
]);
|
|
72915
|
-
var BrokerInfoSchema
|
|
73447
|
+
var BrokerInfoSchema = zod.z.object({
|
|
72916
73448
|
id: zod.z.string(),
|
|
72917
73449
|
name: zod.z.string(),
|
|
72918
73450
|
url: zod.z.string(),
|
|
@@ -72985,7 +73517,7 @@ var mqttBrokerCapability = {
|
|
|
72985
73517
|
kind: "poll"
|
|
72986
73518
|
},
|
|
72987
73519
|
methods: {
|
|
72988
|
-
listBrokers: method(zod.z.void(), zod.z.array(BrokerInfoSchema
|
|
73520
|
+
listBrokers: method(zod.z.void(), zod.z.array(BrokerInfoSchema)),
|
|
72989
73521
|
getBrokerConfig: method(IdInputSchema, BrokerConnectionDetailsSchema, { auth: "admin" }),
|
|
72990
73522
|
addBroker: method(AddBrokerInputSchema, AddBrokerResultSchema, {
|
|
72991
73523
|
kind: "mutation",
|
|
@@ -81372,291 +81904,6 @@ var rebootCapability = {
|
|
|
81372
81904
|
}) }
|
|
81373
81905
|
};
|
|
81374
81906
|
/**
|
|
81375
|
-
* records - an addon's own facts and documents (D881): ledgers, audit rows,
|
|
81376
|
-
* config documents, mirrors. The third storage API next to `ctx.settings`
|
|
81377
|
-
* (operator intent, D870) and device-history (numbers over time, D850).
|
|
81378
|
-
*
|
|
81379
|
-
* Who the OWNER is: `callerAddonId`, stamped by the transport on a call that
|
|
81380
|
-
* crossed a process and stated by a hub in-process caller (`ctx.records` does
|
|
81381
|
-
* that with the addon id closed over). It is deliberately NOT in any input
|
|
81382
|
-
* schema, so a session can never supply it, and a call with no stamp is refused
|
|
81383
|
-
* `records/no-caller`. A kind is readable and writable only by its owner; other
|
|
81384
|
-
* addons go through the owner's capability.
|
|
81385
|
-
*
|
|
81386
|
-
* Every read is three-way: a row, `null`, or the call THROWS. A failed read is
|
|
81387
|
-
* never `[]`. Secret fields are never on the wire: a read shows the
|
|
81388
|
-
* redaction token, `secretRefs` hands the owner's `ctx.secrets` the refs it
|
|
81389
|
-
* resolves itself, and a write may carry only a keychain marker bound to the
|
|
81390
|
-
* row's own ref.
|
|
81391
|
-
*
|
|
81392
|
-
* Internal: addons reach it through `ctx.records`, never directly.
|
|
81393
|
-
*/
|
|
81394
|
-
var RecordIdSchema = zod.z.string().min(1).max(256);
|
|
81395
|
-
/** A JSON object body. Size is the engine's check (`maxDataBytes`), not a schema's. */
|
|
81396
|
-
var RecordBodySchema = zod.z.record(zod.z.string(), zod.z.unknown());
|
|
81397
|
-
var RecordInputSchema = zod.z.object({
|
|
81398
|
-
id: RecordIdSchema,
|
|
81399
|
-
/** The device this row belongs to (D865 removal, per-device reads). */
|
|
81400
|
-
deviceId: zod.z.number().int().optional(),
|
|
81401
|
-
/** The domain clock, ms: observed / created / opened. */
|
|
81402
|
-
at: zod.z.number().int().optional(),
|
|
81403
|
-
/** Producer-set expiry, ms. Refused on a kind whose retention is an engine TTL. */
|
|
81404
|
-
expiresAt: zod.z.number().int().optional(),
|
|
81405
|
-
data: RecordBodySchema
|
|
81406
|
-
});
|
|
81407
|
-
var RecordViewSchema = zod.z.object({
|
|
81408
|
-
id: zod.z.string(),
|
|
81409
|
-
deviceId: zod.z.number().int().nullable(),
|
|
81410
|
-
at: zod.z.number().nullable(),
|
|
81411
|
-
expiresAt: zod.z.number().nullable(),
|
|
81412
|
-
rev: zod.z.number().int(),
|
|
81413
|
-
updatedAt: zod.z.number(),
|
|
81414
|
-
data: RecordBodySchema
|
|
81415
|
-
});
|
|
81416
|
-
/** One predicate on a declared index field: equality, a set, or a range. */
|
|
81417
|
-
var RecordWhereValueSchema = zod.z.union([
|
|
81418
|
-
zod.z.string(),
|
|
81419
|
-
zod.z.number(),
|
|
81420
|
-
zod.z.boolean(),
|
|
81421
|
-
zod.z.object({ in: zod.z.array(zod.z.union([
|
|
81422
|
-
zod.z.string(),
|
|
81423
|
-
zod.z.number(),
|
|
81424
|
-
zod.z.boolean()
|
|
81425
|
-
])).min(1).max(RECORD_BATCH_MAX) }),
|
|
81426
|
-
zod.z.object({
|
|
81427
|
-
gt: zod.z.union([zod.z.string(), zod.z.number()]).optional(),
|
|
81428
|
-
gte: zod.z.union([zod.z.string(), zod.z.number()]).optional(),
|
|
81429
|
-
lt: zod.z.union([zod.z.string(), zod.z.number()]).optional(),
|
|
81430
|
-
lte: zod.z.union([zod.z.string(), zod.z.number()]).optional()
|
|
81431
|
-
}).refine((r) => Object.keys(r).length > 0, { message: "name at least one bound" })
|
|
81432
|
-
]);
|
|
81433
|
-
/** Declared index fields only. Anything else does not compile, by design. */
|
|
81434
|
-
var RecordWhereSchema = zod.z.record(RecordFieldPathSchema, RecordWhereValueSchema);
|
|
81435
|
-
var KindShape = { kind: RecordKindNameSchema };
|
|
81436
|
-
var TimeWindowShape = {
|
|
81437
|
-
deviceId: zod.z.number().int().optional(),
|
|
81438
|
-
atFrom: zod.z.number().optional(),
|
|
81439
|
-
atTo: zod.z.number().optional()
|
|
81440
|
-
};
|
|
81441
|
-
var RecordQueryInputSchema = zod.z.object({
|
|
81442
|
-
...KindShape,
|
|
81443
|
-
...TimeWindowShape,
|
|
81444
|
-
where: RecordWhereSchema.optional(),
|
|
81445
|
-
/** Without `where`: `at` (default for a kind with a clock) or `id`. With `where` the order is the index's. */
|
|
81446
|
-
order: zod.z.enum(["at", "id"]).optional(),
|
|
81447
|
-
desc: zod.z.boolean().optional(),
|
|
81448
|
-
limit: zod.z.number().int().min(1).max(RECORD_QUERY_MAX).default(100),
|
|
81449
|
-
/** Opaque keyset cursor from a previous answer. There is no offset. */
|
|
81450
|
-
cursor: zod.z.string().min(1).optional()
|
|
81451
|
-
});
|
|
81452
|
-
var RecordQueryResultSchema = zod.z.object({
|
|
81453
|
-
records: zod.z.array(RecordViewSchema),
|
|
81454
|
-
nextCursor: zod.z.string().nullable()
|
|
81455
|
-
});
|
|
81456
|
-
var RecordKindStateSchema = zod.z.enum([
|
|
81457
|
-
"created",
|
|
81458
|
-
"unchanged",
|
|
81459
|
-
"updated"
|
|
81460
|
-
]);
|
|
81461
|
-
var DeclareKindResultSchema = zod.z.object({
|
|
81462
|
-
kindId: zod.z.number().int(),
|
|
81463
|
-
state: RecordKindStateSchema,
|
|
81464
|
-
createdIndexes: zod.z.array(zod.z.string())
|
|
81465
|
-
});
|
|
81466
|
-
/** Keychain refs a write released (the old marker is gone from the row): the owner deletes the values. */
|
|
81467
|
-
var SecretRefsList = zod.z.array(zod.z.string());
|
|
81468
|
-
/**
|
|
81469
|
-
* One op of a `transact`: the single-row writes, each on a kind of the caller.
|
|
81470
|
-
* All ops of one call share ONE database file and ONE `transactFamily`.
|
|
81471
|
-
*/
|
|
81472
|
-
var RecordTransactOpSchema = zod.z.discriminatedUnion("op", [
|
|
81473
|
-
zod.z.object({
|
|
81474
|
-
op: zod.z.literal("put"),
|
|
81475
|
-
kind: RecordKindNameSchema,
|
|
81476
|
-
record: RecordInputSchema,
|
|
81477
|
-
ifRev: zod.z.number().int().min(0).optional()
|
|
81478
|
-
}),
|
|
81479
|
-
zod.z.object({
|
|
81480
|
-
op: zod.z.literal("patch"),
|
|
81481
|
-
kind: RecordKindNameSchema,
|
|
81482
|
-
id: RecordIdSchema,
|
|
81483
|
-
data: RecordBodySchema,
|
|
81484
|
-
at: zod.z.number().int().nullable().optional(),
|
|
81485
|
-
expiresAt: zod.z.number().int().nullable().optional(),
|
|
81486
|
-
ifRev: zod.z.number().int().min(1).optional()
|
|
81487
|
-
}),
|
|
81488
|
-
zod.z.object({
|
|
81489
|
-
op: zod.z.literal("delete"),
|
|
81490
|
-
kind: RecordKindNameSchema,
|
|
81491
|
-
id: RecordIdSchema
|
|
81492
|
-
})
|
|
81493
|
-
]);
|
|
81494
|
-
var RecordSecretRefsSchema = zod.z.record(zod.z.string(), zod.z.record(zod.z.string(), zod.z.string()));
|
|
81495
|
-
var recordsCapability = {
|
|
81496
|
-
name: "records",
|
|
81497
|
-
scope: "system",
|
|
81498
|
-
mode: "singleton",
|
|
81499
|
-
internal: true,
|
|
81500
|
-
methods: {
|
|
81501
|
-
/** Reconcile this addon's kinds: create the catalog rows and the declared indexes. Additive only. */
|
|
81502
|
-
declareKinds: method(zod.z.object({ kinds: zod.z.record(RecordKindNameSchema, RecordKindDeclarationSchema) }), zod.z.object({ kinds: zod.z.record(zod.z.string(), DeclareKindResultSchema) }), {
|
|
81503
|
-
kind: "mutation",
|
|
81504
|
-
auth: "admin"
|
|
81505
|
-
}),
|
|
81506
|
-
get: method(zod.z.object({
|
|
81507
|
-
...KindShape,
|
|
81508
|
-
id: RecordIdSchema
|
|
81509
|
-
}), RecordViewSchema.nullable(), { auth: "admin" }),
|
|
81510
|
-
getMany: method(zod.z.object({
|
|
81511
|
-
...KindShape,
|
|
81512
|
-
ids: zod.z.array(RecordIdSchema).min(1).max(RECORD_BATCH_MAX)
|
|
81513
|
-
}), zod.z.array(RecordViewSchema), { auth: "admin" }),
|
|
81514
|
-
/** The keychain refs of the rows' secret fields, by id and concrete path. For the owner's `ctx.secrets`. */
|
|
81515
|
-
secretRefs: method(zod.z.object({
|
|
81516
|
-
...KindShape,
|
|
81517
|
-
ids: zod.z.array(RecordIdSchema).min(1).max(RECORD_BATCH_MAX)
|
|
81518
|
-
}), RecordSecretRefsSchema, { auth: "admin" }),
|
|
81519
|
-
put: method(zod.z.object({
|
|
81520
|
-
...KindShape,
|
|
81521
|
-
record: RecordInputSchema,
|
|
81522
|
-
/** Compare-and-set. `0` means "the row must not exist". */
|
|
81523
|
-
ifRev: zod.z.number().int().min(0).optional()
|
|
81524
|
-
}), zod.z.object({
|
|
81525
|
-
rev: zod.z.number().int(),
|
|
81526
|
-
releasedRefs: SecretRefsList
|
|
81527
|
-
}), {
|
|
81528
|
-
kind: "mutation",
|
|
81529
|
-
auth: "admin"
|
|
81530
|
-
}),
|
|
81531
|
-
putMany: method(zod.z.object({
|
|
81532
|
-
...KindShape,
|
|
81533
|
-
records: zod.z.array(RecordInputSchema).min(1).max(RECORD_BATCH_MAX)
|
|
81534
|
-
}), zod.z.object({
|
|
81535
|
-
count: zod.z.number().int(),
|
|
81536
|
-
releasedRefs: SecretRefsList
|
|
81537
|
-
}), {
|
|
81538
|
-
kind: "mutation",
|
|
81539
|
-
auth: "admin"
|
|
81540
|
-
}),
|
|
81541
|
-
/** One-statement RFC 7396 merge: `null` removes a field; a merge never reads. */
|
|
81542
|
-
patch: method(zod.z.object({
|
|
81543
|
-
...KindShape,
|
|
81544
|
-
id: RecordIdSchema,
|
|
81545
|
-
data: RecordBodySchema,
|
|
81546
|
-
at: zod.z.number().int().nullable().optional(),
|
|
81547
|
-
expiresAt: zod.z.number().int().nullable().optional(),
|
|
81548
|
-
ifRev: zod.z.number().int().min(1).optional()
|
|
81549
|
-
}), zod.z.object({
|
|
81550
|
-
rev: zod.z.number().int(),
|
|
81551
|
-
releasedRefs: SecretRefsList
|
|
81552
|
-
}), {
|
|
81553
|
-
kind: "mutation",
|
|
81554
|
-
auth: "admin"
|
|
81555
|
-
}),
|
|
81556
|
-
delete: method(zod.z.object({
|
|
81557
|
-
...KindShape,
|
|
81558
|
-
id: RecordIdSchema
|
|
81559
|
-
}), zod.z.object({
|
|
81560
|
-
deleted: zod.z.boolean(),
|
|
81561
|
-
secretRefs: SecretRefsList
|
|
81562
|
-
}), {
|
|
81563
|
-
kind: "mutation",
|
|
81564
|
-
auth: "admin"
|
|
81565
|
-
}),
|
|
81566
|
-
deleteMany: method(zod.z.object({
|
|
81567
|
-
...KindShape,
|
|
81568
|
-
ids: zod.z.array(RecordIdSchema).min(1).max(RECORD_BATCH_MAX)
|
|
81569
|
-
}), zod.z.object({
|
|
81570
|
-
deleted: zod.z.number().int(),
|
|
81571
|
-
secretRefs: SecretRefsList
|
|
81572
|
-
}), {
|
|
81573
|
-
kind: "mutation",
|
|
81574
|
-
auth: "admin"
|
|
81575
|
-
}),
|
|
81576
|
-
query: method(RecordQueryInputSchema, RecordQueryResultSchema, { auth: "admin" }),
|
|
81577
|
-
count: method(zod.z.object({
|
|
81578
|
-
...KindShape,
|
|
81579
|
-
...TimeWindowShape,
|
|
81580
|
-
where: RecordWhereSchema.optional()
|
|
81581
|
-
}), zod.z.object({ count: zod.z.number().int() }), { auth: "admin" }),
|
|
81582
|
-
histogram: method(zod.z.object({
|
|
81583
|
-
...KindShape,
|
|
81584
|
-
deviceId: zod.z.number().int().optional(),
|
|
81585
|
-
from: zod.z.number(),
|
|
81586
|
-
to: zod.z.number(),
|
|
81587
|
-
bucketMs: zod.z.number().int().positive()
|
|
81588
|
-
}), zod.z.object({ buckets: zod.z.array(zod.z.object({
|
|
81589
|
-
bucketStart: zod.z.number(),
|
|
81590
|
-
count: zod.z.number().int()
|
|
81591
|
-
})) }), { auth: "admin" }),
|
|
81592
|
-
/** Index-served only: every field must belong to ONE declared index. */
|
|
81593
|
-
aggregate: method(zod.z.object({
|
|
81594
|
-
...KindShape,
|
|
81595
|
-
op: zod.z.enum([
|
|
81596
|
-
"sum",
|
|
81597
|
-
"min",
|
|
81598
|
-
"max",
|
|
81599
|
-
"count"
|
|
81600
|
-
]),
|
|
81601
|
-
field: RecordFieldPathSchema.optional(),
|
|
81602
|
-
groupBy: RecordFieldPathSchema.optional(),
|
|
81603
|
-
where: RecordWhereSchema.optional()
|
|
81604
|
-
}), zod.z.object({ rows: zod.z.array(zod.z.object({
|
|
81605
|
-
group: zod.z.union([
|
|
81606
|
-
zod.z.string(),
|
|
81607
|
-
zod.z.number(),
|
|
81608
|
-
zod.z.null()
|
|
81609
|
-
]),
|
|
81610
|
-
value: zod.z.number().nullable()
|
|
81611
|
-
})) }), { auth: "admin" }),
|
|
81612
|
-
/** Batched (5 000 rows per statement, yielding between). Needs a predicate: there is no "delete all". */
|
|
81613
|
-
deleteWhere: method(zod.z.object({
|
|
81614
|
-
...KindShape,
|
|
81615
|
-
deviceId: zod.z.number().int().optional(),
|
|
81616
|
-
atBefore: zod.z.number().optional(),
|
|
81617
|
-
where: RecordWhereSchema.optional()
|
|
81618
|
-
}), zod.z.object({
|
|
81619
|
-
deleted: zod.z.number().int(),
|
|
81620
|
-
secretRefs: SecretRefsList
|
|
81621
|
-
}), {
|
|
81622
|
-
kind: "mutation",
|
|
81623
|
-
auth: "admin"
|
|
81624
|
-
}),
|
|
81625
|
-
/**
|
|
81626
|
-
* Several single-row writes (put / patch / delete) in ONE SQLite transaction:
|
|
81627
|
-
* all land or none does. Every op's kind must sit in one file and share one
|
|
81628
|
-
* `transactFamily` (`records/transact-refused` otherwise). Results are in op order.
|
|
81629
|
-
*/
|
|
81630
|
-
transact: method(zod.z.object({ ops: zod.z.array(RecordTransactOpSchema).min(1).max(RECORD_BATCH_MAX) }), zod.z.object({
|
|
81631
|
-
results: zod.z.array(zod.z.object({
|
|
81632
|
-
rev: zod.z.number().int().nullable(),
|
|
81633
|
-
deleted: zod.z.boolean()
|
|
81634
|
-
})),
|
|
81635
|
-
releasedRefs: SecretRefsList,
|
|
81636
|
-
secretRefs: SecretRefsList
|
|
81637
|
-
}), {
|
|
81638
|
-
kind: "mutation",
|
|
81639
|
-
auth: "admin"
|
|
81640
|
-
}),
|
|
81641
|
-
/** The D865 hook body: every kind of this addon declared `deviceRemoval: 'delete'`. */
|
|
81642
|
-
deleteDevice: method(zod.z.object({
|
|
81643
|
-
deviceId: zod.z.number().int(),
|
|
81644
|
-
kinds: zod.z.array(RecordKindNameSchema).optional()
|
|
81645
|
-
}), zod.z.object({
|
|
81646
|
-
deleted: zod.z.record(zod.z.string(), zod.z.number().int()),
|
|
81647
|
-
secretRefs: SecretRefsList
|
|
81648
|
-
}), {
|
|
81649
|
-
kind: "mutation",
|
|
81650
|
-
auth: "admin"
|
|
81651
|
-
}),
|
|
81652
|
-
/** A monotonically increasing integer per kind (replaces "resume from the highest"). */
|
|
81653
|
-
allocateId: method(zod.z.object(KindShape), zod.z.object({ id: zod.z.number().int() }), {
|
|
81654
|
-
kind: "mutation",
|
|
81655
|
-
auth: "admin"
|
|
81656
|
-
})
|
|
81657
|
-
}
|
|
81658
|
-
};
|
|
81659
|
-
/**
|
|
81660
81907
|
* record-entries - the ONE admin surface for every list of user-created entries
|
|
81661
81908
|
* (D881): notification targets, brokers, LLM profiles, anything an addon
|
|
81662
81909
|
* declares as an ENTRY kind (`entry: { title }` in `defineRecordKinds`).
|
|
@@ -96378,20 +96625,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
96378
96625
|
access: "create",
|
|
96379
96626
|
role: "viewer"
|
|
96380
96627
|
},
|
|
96381
|
-
"broker.add": {
|
|
96382
|
-
capName: "broker",
|
|
96383
|
-
capScope: "system",
|
|
96384
|
-
addonId: null,
|
|
96385
|
-
access: "create",
|
|
96386
|
-
role: "admin"
|
|
96387
|
-
},
|
|
96388
|
-
"broker.get": {
|
|
96389
|
-
capName: "broker",
|
|
96390
|
-
capScope: "system",
|
|
96391
|
-
addonId: null,
|
|
96392
|
-
access: "view",
|
|
96393
|
-
role: "admin"
|
|
96394
|
-
},
|
|
96395
96628
|
"broker.getBrokerConfig": {
|
|
96396
96629
|
capName: "broker",
|
|
96397
96630
|
capScope: "system",
|
|
@@ -96399,20 +96632,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
96399
96632
|
access: "view",
|
|
96400
96633
|
role: "admin"
|
|
96401
96634
|
},
|
|
96402
|
-
"broker.getSettings": {
|
|
96403
|
-
capName: "broker",
|
|
96404
|
-
capScope: "system",
|
|
96405
|
-
addonId: null,
|
|
96406
|
-
access: "view",
|
|
96407
|
-
role: "admin"
|
|
96408
|
-
},
|
|
96409
|
-
"broker.getSettingsSchema": {
|
|
96410
|
-
capName: "broker",
|
|
96411
|
-
capScope: "system",
|
|
96412
|
-
addonId: null,
|
|
96413
|
-
access: "view",
|
|
96414
|
-
role: "admin"
|
|
96415
|
-
},
|
|
96416
96635
|
"broker.getState": {
|
|
96417
96636
|
capName: "broker",
|
|
96418
96637
|
capScope: "system",
|
|
@@ -96427,20 +96646,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
96427
96646
|
access: "view",
|
|
96428
96647
|
role: "admin"
|
|
96429
96648
|
},
|
|
96430
|
-
"broker.list": {
|
|
96431
|
-
capName: "broker",
|
|
96432
|
-
capScope: "system",
|
|
96433
|
-
addonId: null,
|
|
96434
|
-
access: "view",
|
|
96435
|
-
role: "admin"
|
|
96436
|
-
},
|
|
96437
|
-
"broker.listProviders": {
|
|
96438
|
-
capName: "broker",
|
|
96439
|
-
capScope: "system",
|
|
96440
|
-
addonId: null,
|
|
96441
|
-
access: "view",
|
|
96442
|
-
role: "admin"
|
|
96443
|
-
},
|
|
96444
96649
|
"broker.publish": {
|
|
96445
96650
|
capName: "broker",
|
|
96446
96651
|
capScope: "system",
|
|
@@ -96448,20 +96653,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
96448
96653
|
access: "create",
|
|
96449
96654
|
role: "admin"
|
|
96450
96655
|
},
|
|
96451
|
-
"broker.remove": {
|
|
96452
|
-
capName: "broker",
|
|
96453
|
-
capScope: "system",
|
|
96454
|
-
addonId: null,
|
|
96455
|
-
access: "delete",
|
|
96456
|
-
role: "admin"
|
|
96457
|
-
},
|
|
96458
|
-
"broker.setSettings": {
|
|
96459
|
-
capName: "broker",
|
|
96460
|
-
capScope: "system",
|
|
96461
|
-
addonId: null,
|
|
96462
|
-
access: "create",
|
|
96463
|
-
role: "admin"
|
|
96464
|
-
},
|
|
96465
96656
|
"broker.subscribe": {
|
|
96466
96657
|
capName: "broker",
|
|
96467
96658
|
capScope: "system",
|
|
@@ -96469,20 +96660,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
96469
96660
|
access: "create",
|
|
96470
96661
|
role: "admin"
|
|
96471
96662
|
},
|
|
96472
|
-
"broker.testConnection": {
|
|
96473
|
-
capName: "broker",
|
|
96474
|
-
capScope: "system",
|
|
96475
|
-
addonId: null,
|
|
96476
|
-
access: "create",
|
|
96477
|
-
role: "admin"
|
|
96478
|
-
},
|
|
96479
|
-
"broker.testSettings": {
|
|
96480
|
-
capName: "broker",
|
|
96481
|
-
capScope: "system",
|
|
96482
|
-
addonId: null,
|
|
96483
|
-
access: "create",
|
|
96484
|
-
role: "admin"
|
|
96485
|
-
},
|
|
96486
96663
|
"broker.unsubscribe": {
|
|
96487
96664
|
capName: "broker",
|
|
96488
96665
|
capScope: "system",
|
|
@@ -101446,6 +101623,13 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
101446
101623
|
access: "view",
|
|
101447
101624
|
role: "viewer"
|
|
101448
101625
|
},
|
|
101626
|
+
"pipelineAnalytics.getMediaLocationCensus": {
|
|
101627
|
+
capName: "pipeline-analytics",
|
|
101628
|
+
capScope: "device",
|
|
101629
|
+
addonId: null,
|
|
101630
|
+
access: "view",
|
|
101631
|
+
role: "admin"
|
|
101632
|
+
},
|
|
101449
101633
|
"pipelineAnalytics.getMediaReclaimStatus": {
|
|
101450
101634
|
capName: "pipeline-analytics",
|
|
101451
101635
|
capScope: "device",
|
|
@@ -111296,6 +111480,7 @@ zod.z.object({
|
|
|
111296
111480
|
delay: zod.z.number().nonnegative().optional(),
|
|
111297
111481
|
commands: zod.z.record(zod.z.string(), zod.z.unknown())
|
|
111298
111482
|
});
|
|
111483
|
+
entryBody({ brokerId: zod.z.string() });
|
|
111299
111484
|
//#endregion
|
|
111300
111485
|
Object.defineProperty(exports, "ACTION_TARGET_INVALIDATION_EVENTS", {
|
|
111301
111486
|
enumerable: true,
|
|
@@ -111879,6 +112064,12 @@ Object.defineProperty(exports, "METHOD_ACCESS_MAP", {
|
|
|
111879
112064
|
return METHOD_ACCESS_MAP;
|
|
111880
112065
|
}
|
|
111881
112066
|
});
|
|
112067
|
+
Object.defineProperty(exports, "MIGRATION_API_V1_METHODS", {
|
|
112068
|
+
enumerable: true,
|
|
112069
|
+
get: function() {
|
|
112070
|
+
return MIGRATION_API_V1_METHODS;
|
|
112071
|
+
}
|
|
112072
|
+
});
|
|
111882
112073
|
Object.defineProperty(exports, "MINUTES_PER_DAY", {
|
|
111883
112074
|
enumerable: true,
|
|
111884
112075
|
get: function() {
|
|
@@ -111939,6 +112130,12 @@ Object.defineProperty(exports, "PROPOSAL_MIN_SPAN_MS", {
|
|
|
111939
112130
|
return PROPOSAL_MIN_SPAN_MS;
|
|
111940
112131
|
}
|
|
111941
112132
|
});
|
|
112133
|
+
Object.defineProperty(exports, "PackageRequiresSchema", {
|
|
112134
|
+
enumerable: true,
|
|
112135
|
+
get: function() {
|
|
112136
|
+
return PackageRequiresSchema;
|
|
112137
|
+
}
|
|
112138
|
+
});
|
|
111942
112139
|
Object.defineProperty(exports, "PlaintextSecretError", {
|
|
111943
112140
|
enumerable: true,
|
|
111944
112141
|
get: function() {
|
|
@@ -112509,6 +112706,12 @@ Object.defineProperty(exports, "colorCapability", {
|
|
|
112509
112706
|
return colorCapability;
|
|
112510
112707
|
}
|
|
112511
112708
|
});
|
|
112709
|
+
Object.defineProperty(exports, "compareVersions", {
|
|
112710
|
+
enumerable: true,
|
|
112711
|
+
get: function() {
|
|
112712
|
+
return compareVersions;
|
|
112713
|
+
}
|
|
112714
|
+
});
|
|
112512
112715
|
Object.defineProperty(exports, "compileScalarOverride", {
|
|
112513
112716
|
enumerable: true,
|
|
112514
112717
|
get: function() {
|
|
@@ -112713,6 +112916,12 @@ Object.defineProperty(exports, "describeComposableCaps", {
|
|
|
112713
112916
|
return describeComposableCaps;
|
|
112714
112917
|
}
|
|
112715
112918
|
});
|
|
112919
|
+
Object.defineProperty(exports, "describeUnmet", {
|
|
112920
|
+
enumerable: true,
|
|
112921
|
+
get: function() {
|
|
112922
|
+
return describeUnmet;
|
|
112923
|
+
}
|
|
112924
|
+
});
|
|
112716
112925
|
Object.defineProperty(exports, "deviceCredentialsCapability", {
|
|
112717
112926
|
enumerable: true,
|
|
112718
112927
|
get: function() {
|
|
@@ -113871,6 +114080,12 @@ Object.defineProperty(exports, "transformSecretWrite", {
|
|
|
113871
114080
|
return transformSecretWrite;
|
|
113872
114081
|
}
|
|
113873
114082
|
});
|
|
114083
|
+
Object.defineProperty(exports, "unmetRequirements", {
|
|
114084
|
+
enumerable: true,
|
|
114085
|
+
get: function() {
|
|
114086
|
+
return unmetRequirements;
|
|
114087
|
+
}
|
|
114088
|
+
});
|
|
113874
114089
|
Object.defineProperty(exports, "userError", {
|
|
113875
114090
|
enumerable: true,
|
|
113876
114091
|
get: function() {
|