@camstack/addon-provider-unifi 0.2.127 → 0.2.129
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/addon.js +1627 -134
- package/dist/addon.mjs +1627 -134
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
//#region ../types/dist/event-category-
|
|
2
|
+
//#region ../types/dist/event-category-DOl51-Ij.mjs
|
|
3
3
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
4
4
|
EventCategory["SystemBoot"] = "system.boot";
|
|
5
5
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -63,6 +63,33 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
63
63
|
* consumes this category and maps it to the `addon-crash-loop` kind.
|
|
64
64
|
*/
|
|
65
65
|
EventCategory["AddonRunnerFailed"] = "addon.runner-failed";
|
|
66
|
+
/**
|
|
67
|
+
* A runner whose addon refused to start with a typed reason (D877) - parked
|
|
68
|
+
* in `refused`, never counted by the crash breaker, retried on operator
|
|
69
|
+
* action. One event per refusal.
|
|
70
|
+
*/
|
|
71
|
+
EventCategory["AddonRunnerRefused"] = "addon.runner-refused";
|
|
72
|
+
/**
|
|
73
|
+
* A runner settled on a state (D877): `running` (READY), `crashed`, `failed` or
|
|
74
|
+
* `refused`. In-process telemetry for the boot check (re-evaluate while any
|
|
75
|
+
* runner is still pending) and the alert centre (close a recovered runner).
|
|
76
|
+
*/
|
|
77
|
+
EventCategory["ProcessStateChanged"] = "process.state-changed";
|
|
78
|
+
/**
|
|
79
|
+
* The node's one-shot runner boot check (D877): planned runners against the
|
|
80
|
+
* process service, `degraded` when any is failed, refused or missing. The
|
|
81
|
+
* alert centre turns it into one critical alert.
|
|
82
|
+
*/
|
|
83
|
+
EventCategory["SystemRunnerCheck"] = "system.runner-check";
|
|
84
|
+
/**
|
|
85
|
+
* An alert EPISODE opened or closed, emitted by the alert centre for alerts
|
|
86
|
+
* of severity `critical` or `error` (`AlertEpisodePayload`). The alert
|
|
87
|
+
* centre sends no notification of its own: Notification Center turns this
|
|
88
|
+
* into the `alert-critical` / `alert-error` / `alert-critical-resolved`
|
|
89
|
+
* system-event kinds, and reconciles from the alerts store because a bus
|
|
90
|
+
* event may be dropped (D8, D11).
|
|
91
|
+
*/
|
|
92
|
+
EventCategory["AlertEpisode"] = "alert.episode";
|
|
66
93
|
EventCategory["AddonError"] = "addon.error";
|
|
67
94
|
EventCategory["AddonPageReady"] = "addon.page-ready";
|
|
68
95
|
EventCategory["AddonWidgetReady"] = "addon.widget-ready";
|
|
@@ -5387,7 +5414,7 @@ var ZodIssueCode = {
|
|
|
5387
5414
|
var ZodFirstPartyTypeKind;
|
|
5388
5415
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5389
5416
|
//#endregion
|
|
5390
|
-
//#region ../types/dist/sleep-
|
|
5417
|
+
//#region ../types/dist/sleep-BxjU_fJM.mjs
|
|
5391
5418
|
/**
|
|
5392
5419
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5393
5420
|
* window to float samples (D455).
|
|
@@ -5504,7 +5531,7 @@ function isKeychainStoredField(field) {
|
|
|
5504
5531
|
var SECRET_CLEAR = { $secretClear: true };
|
|
5505
5532
|
/** The `'***'` token D634 redaction writes for non-admins. */
|
|
5506
5533
|
var LEGACY_DEVICE_REDACTION = "***";
|
|
5507
|
-
function isRecord$
|
|
5534
|
+
function isRecord$5(value) {
|
|
5508
5535
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
5509
5536
|
}
|
|
5510
5537
|
function makeSecretMarker(ref) {
|
|
@@ -5515,12 +5542,12 @@ function makeSecretMarker(ref) {
|
|
|
5515
5542
|
}
|
|
5516
5543
|
/** A stored marker: an object whose `$secret` is a non-empty string. */
|
|
5517
5544
|
function isSecretMarker(value) {
|
|
5518
|
-
if (!isRecord$
|
|
5545
|
+
if (!isRecord$5(value)) return false;
|
|
5519
5546
|
const ref = value["$secret"];
|
|
5520
5547
|
return typeof ref === "string" && ref.length > 0;
|
|
5521
5548
|
}
|
|
5522
5549
|
function isSecretClear(value) {
|
|
5523
|
-
return isRecord$
|
|
5550
|
+
return isRecord$5(value) && value["$secretClear"] === true;
|
|
5524
5551
|
}
|
|
5525
5552
|
/**
|
|
5526
5553
|
* The UI view of a stored secret field value: a marker becomes "set", inline
|
|
@@ -6130,7 +6157,7 @@ var KeychainWriteRefusedError = class extends Error {
|
|
|
6130
6157
|
}
|
|
6131
6158
|
};
|
|
6132
6159
|
var KEEP = { kind: "keep" };
|
|
6133
|
-
function isRecord$
|
|
6160
|
+
function isRecord$4(value) {
|
|
6134
6161
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
6135
6162
|
}
|
|
6136
6163
|
function defaultMintId() {
|
|
@@ -6143,7 +6170,7 @@ function collectSecretMarkerRefs(value, out = []) {
|
|
|
6143
6170
|
return out;
|
|
6144
6171
|
}
|
|
6145
6172
|
if (Array.isArray(value)) for (const item of value) collectSecretMarkerRefs(item, out);
|
|
6146
|
-
else if (isRecord$
|
|
6173
|
+
else if (isRecord$4(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
|
|
6147
6174
|
return out;
|
|
6148
6175
|
}
|
|
6149
6176
|
async function storedValueEquals(secrets, marker, candidate) {
|
|
@@ -6198,7 +6225,7 @@ function rowId(row, idKey) {
|
|
|
6198
6225
|
return null;
|
|
6199
6226
|
}
|
|
6200
6227
|
async function writeArray(ctx, node, incoming, stored, fieldPath) {
|
|
6201
|
-
const storedRows = Array.isArray(stored) ? stored.filter(isRecord$
|
|
6228
|
+
const storedRows = Array.isArray(stored) ? stored.filter(isRecord$4) : [];
|
|
6202
6229
|
if (!Array.isArray(incoming)) {
|
|
6203
6230
|
ctx.deletes.push(...collectSecretMarkerRefs(storedRows));
|
|
6204
6231
|
return {
|
|
@@ -6214,7 +6241,7 @@ async function writeArray(ctx, node, incoming, stored, fieldPath) {
|
|
|
6214
6241
|
const kept = /* @__PURE__ */ new Set();
|
|
6215
6242
|
const rows = [];
|
|
6216
6243
|
for (const row of incoming) {
|
|
6217
|
-
if (!isRecord$
|
|
6244
|
+
if (!isRecord$4(row)) {
|
|
6218
6245
|
rows.push(row);
|
|
6219
6246
|
continue;
|
|
6220
6247
|
}
|
|
@@ -6239,7 +6266,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
|
|
|
6239
6266
|
case "leaf": return writeLeaf(ctx, incoming, stored, fieldPath);
|
|
6240
6267
|
case "array": return writeArray(ctx, node, incoming, stored, fieldPath);
|
|
6241
6268
|
case "object": {
|
|
6242
|
-
if (!isRecord$
|
|
6269
|
+
if (!isRecord$4(incoming)) {
|
|
6243
6270
|
if (incoming === void 0) return KEEP;
|
|
6244
6271
|
ctx.deletes.push(...collectSecretMarkerRefs(stored));
|
|
6245
6272
|
return {
|
|
@@ -6247,7 +6274,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
|
|
|
6247
6274
|
value: incoming
|
|
6248
6275
|
};
|
|
6249
6276
|
}
|
|
6250
|
-
const storedObj = isRecord$
|
|
6277
|
+
const storedObj = isRecord$4(stored) ? stored : {};
|
|
6251
6278
|
return {
|
|
6252
6279
|
kind: "value",
|
|
6253
6280
|
value: await writeMembers(ctx, node.children, incoming, storedObj, (m) => `${fieldPath}.${m}`)
|
|
@@ -6370,7 +6397,7 @@ async function resolveSecretMarkers(value, secrets, options = {}) {
|
|
|
6370
6397
|
value: items
|
|
6371
6398
|
};
|
|
6372
6399
|
}
|
|
6373
|
-
if (isRecord$
|
|
6400
|
+
if (isRecord$4(v)) {
|
|
6374
6401
|
const out = {};
|
|
6375
6402
|
for (const [k, child] of Object.entries(v)) {
|
|
6376
6403
|
const s = substitute(child);
|
|
@@ -6402,7 +6429,7 @@ var SecretOverwriteRefusedError = class extends Error {
|
|
|
6402
6429
|
this.name = "SecretOverwriteRefusedError";
|
|
6403
6430
|
}
|
|
6404
6431
|
};
|
|
6405
|
-
function isRecord(value) {
|
|
6432
|
+
function isRecord$3(value) {
|
|
6406
6433
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
6407
6434
|
}
|
|
6408
6435
|
function resolvedValue(pass, marker) {
|
|
@@ -6431,7 +6458,7 @@ function inArray(pass, incoming, stored) {
|
|
|
6431
6458
|
return incoming.map((item, index) => {
|
|
6432
6459
|
const twin = stored[index];
|
|
6433
6460
|
if (isSecretMarker(twin)) return typeof item === "string" && item === resolvedValue(pass, twin) ? twin : item;
|
|
6434
|
-
if (isRecord(item) && isRecord(twin)) return inArrayRow(pass, item, twin);
|
|
6461
|
+
if (isRecord$3(item) && isRecord$3(twin)) return inArrayRow(pass, item, twin);
|
|
6435
6462
|
if (Array.isArray(item) && Array.isArray(twin)) return inArray(pass, item, twin);
|
|
6436
6463
|
return item;
|
|
6437
6464
|
});
|
|
@@ -6442,7 +6469,7 @@ function inArrayRow(pass, incoming, stored) {
|
|
|
6442
6469
|
const twin = stored[key];
|
|
6443
6470
|
if (isSecretMarker(twin)) {
|
|
6444
6471
|
if (typeof value === "string" && value === resolvedValue(pass, twin)) out[key] = twin;
|
|
6445
|
-
} else if (isRecord(value) && isRecord(twin)) out[key] = inArrayRow(pass, value, twin);
|
|
6472
|
+
} else if (isRecord$3(value) && isRecord$3(twin)) out[key] = inArrayRow(pass, value, twin);
|
|
6446
6473
|
else if (Array.isArray(value) && Array.isArray(twin)) out[key] = inArray(pass, value, twin);
|
|
6447
6474
|
}
|
|
6448
6475
|
return out;
|
|
@@ -6450,7 +6477,7 @@ function inArrayRow(pass, incoming, stored) {
|
|
|
6450
6477
|
async function walk(pass, incoming, stored) {
|
|
6451
6478
|
if (isSecretMarker(stored)) return atMarker(pass, incoming, stored);
|
|
6452
6479
|
if (Array.isArray(incoming) && Array.isArray(stored)) return inArray(pass, incoming, stored);
|
|
6453
|
-
if (!isRecord(incoming) || !isRecord(stored)) return incoming;
|
|
6480
|
+
if (!isRecord$3(incoming) || !isRecord$3(stored)) return incoming;
|
|
6454
6481
|
const out = { ...incoming };
|
|
6455
6482
|
for (const [key, value] of Object.entries(incoming)) out[key] = await walk(pass, value, stored[key]);
|
|
6456
6483
|
return out;
|
|
@@ -6481,7 +6508,7 @@ async function restoreUnchangedSecrets(input) {
|
|
|
6481
6508
|
function isJsonEqual(a, b) {
|
|
6482
6509
|
if (Object.is(a, b)) return true;
|
|
6483
6510
|
if (Array.isArray(a)) return Array.isArray(b) && a.length === b.length && a.every((v, i) => isJsonEqual(v, b[i]));
|
|
6484
|
-
if (isRecord(a) && isRecord(b)) {
|
|
6511
|
+
if (isRecord$3(a) && isRecord$3(b)) {
|
|
6485
6512
|
const keys = Object.keys(a);
|
|
6486
6513
|
if (keys.length !== Object.keys(b).length) return false;
|
|
6487
6514
|
return keys.every((k) => Object.prototype.hasOwnProperty.call(b, k) && isJsonEqual(a[k], b[k]));
|
|
@@ -6505,7 +6532,7 @@ function markerKeysOf(blob, owner) {
|
|
|
6505
6532
|
}
|
|
6506
6533
|
function nodeFromStored(value, owner) {
|
|
6507
6534
|
if (isSecretMarker(value)) return isSecretRefOwnedBy(value.$secret, owner) ? { kind: "leaf" } : null;
|
|
6508
|
-
if (!isRecord(value)) return null;
|
|
6535
|
+
if (!isRecord$3(value)) return null;
|
|
6509
6536
|
const children = /* @__PURE__ */ new Map();
|
|
6510
6537
|
for (const [key, child] of Object.entries(value)) {
|
|
6511
6538
|
const node = nodeFromStored(child, owner);
|
|
@@ -6638,7 +6665,6 @@ function createHandle(raw, opts) {
|
|
|
6638
6665
|
const writeAddon = (patch) => write("addon", opts.addonTree(), void 0, patch, () => readStoredAddonBlob(raw), (p) => raw.writeAddonStore(p));
|
|
6639
6666
|
const readAddonStoreResult = raw.readAddonStoreResult;
|
|
6640
6667
|
const readAddonStoreKeyResult = raw.readAddonStoreKeyResult;
|
|
6641
|
-
const readDeviceStoreBatch = raw.readDeviceStoreBatch;
|
|
6642
6668
|
const overrides = {
|
|
6643
6669
|
readAddonStore: async () => resolveRead("addon", await raw.readAddonStore()),
|
|
6644
6670
|
...readAddonStoreResult !== void 0 ? { readAddonStoreResult: async () => {
|
|
@@ -6662,12 +6688,12 @@ function createHandle(raw, opts) {
|
|
|
6662
6688
|
};
|
|
6663
6689
|
} } : {},
|
|
6664
6690
|
readDeviceStore: async (deviceId) => resolveRead(`device:${deviceId}`, await raw.readDeviceStore(deviceId)),
|
|
6665
|
-
|
|
6666
|
-
const rows = await readDeviceStoreBatch
|
|
6691
|
+
readDeviceStoreBatch: async (deviceIds) => {
|
|
6692
|
+
const rows = await raw.readDeviceStoreBatch(deviceIds);
|
|
6667
6693
|
const out = /* @__PURE__ */ new Map();
|
|
6668
6694
|
for (const [deviceId, blob] of rows) out.set(deviceId, await resolveRead(`device:${deviceId}`, blob));
|
|
6669
6695
|
return out;
|
|
6670
|
-
}
|
|
6696
|
+
},
|
|
6671
6697
|
writeAddonStore: async (patch) => {
|
|
6672
6698
|
await writeAddon(patch);
|
|
6673
6699
|
},
|
|
@@ -7294,7 +7320,7 @@ var BaseAddon = class {
|
|
|
7294
7320
|
if (!ctx) return;
|
|
7295
7321
|
const addonId = ctx.id;
|
|
7296
7322
|
setImmediate(() => {
|
|
7297
|
-
ctx.api.addons
|
|
7323
|
+
ctx.api.addons.restartAddon.mutate({ addonId }).then(() => {
|
|
7298
7324
|
ctx.logger.info("addon auto-restart triggered by restart-required setting change", { meta: { changedFields: patchKeys.filter((k) => restartKeys.has(k)) } });
|
|
7299
7325
|
}).catch((err) => {
|
|
7300
7326
|
ctx.logger.error("addon auto-restart failed", { meta: { error: err instanceof Error ? err.message : String(err) } });
|
|
@@ -7494,7 +7520,7 @@ var BaseAddon = class {
|
|
|
7494
7520
|
return this._addonSecretTree;
|
|
7495
7521
|
}
|
|
7496
7522
|
deviceSecretTree() {
|
|
7497
|
-
this._deviceSecretTree ??= secretTreeFromSchema(this.deviceSettingsSchema());
|
|
7523
|
+
this._deviceSecretTree ??= mergeSecretStatePaths(secretTreeFromSchema(this.deviceSettingsSchema()), this.secretStatePaths);
|
|
7498
7524
|
return this._deviceSecretTree;
|
|
7499
7525
|
}
|
|
7500
7526
|
/**
|
|
@@ -7570,42 +7596,135 @@ var BaseAddon = class {
|
|
|
7570
7596
|
this[timerOf] = timer;
|
|
7571
7597
|
}
|
|
7572
7598
|
/**
|
|
7573
|
-
* Wrap `ctx.settings.readAddonStore()` with a
|
|
7574
|
-
*
|
|
7575
|
-
* swap, or any race where the SqliteSettingsBackend is between shutdown and
|
|
7576
|
-
* re-initialize) doesn't propagate up into `initialize()` and leave the
|
|
7599
|
+
* Wrap `ctx.settings.readAddonStore()` with a retry budget so a transient
|
|
7600
|
+
* settings-store outage doesn't propagate up into `initialize()` and leave the
|
|
7577
7601
|
* addon permanently broken.
|
|
7578
7602
|
*
|
|
7579
|
-
*
|
|
7580
|
-
*
|
|
7581
|
-
* `
|
|
7603
|
+
* Two kinds of outage, two budgets:
|
|
7604
|
+
* - the store's own restart fingerprints (`SqliteSettingsBackend not
|
|
7605
|
+
* initialized`, `provider not available`): a short budget, then the addon
|
|
7606
|
+
* falls back to `{}` (defaults) - its first successful patch rehydrates;
|
|
7607
|
+
* - a TRANSPORT failure (the hub is restarting while this runner boots:
|
|
7608
|
+
* `discovery deadline exceeded`, `parent could not route`, a refused or
|
|
7609
|
+
* timed-out connection). Since D870 a runner's settings read THROWS instead
|
|
7610
|
+
* of answering `{}`, so without a budget a hub restart ends in a respawn
|
|
7611
|
+
* loop. A long, bounded budget; only after it the error propagates - the
|
|
7612
|
+
* addon never runs on defaults for a store it could not ask.
|
|
7613
|
+
* Anything else propagates immediately so real bugs surface.
|
|
7582
7614
|
*/
|
|
7583
7615
|
async readAddonStoreWithRetry() {
|
|
7584
7616
|
const settings = this.rawSettings();
|
|
7585
7617
|
if (!settings) return {};
|
|
7586
|
-
const delaysMs = [
|
|
7587
|
-
150,
|
|
7588
|
-
350,
|
|
7589
|
-
600,
|
|
7590
|
-
900
|
|
7591
|
-
];
|
|
7592
7618
|
let lastErr;
|
|
7593
|
-
for (let attempt = 0
|
|
7619
|
+
for (let attempt = 0;; attempt++) try {
|
|
7594
7620
|
const stored = await settings.readAddonStore() ?? {};
|
|
7595
7621
|
this.settingsStoreReady = true;
|
|
7596
7622
|
return stored;
|
|
7597
7623
|
} catch (err) {
|
|
7598
7624
|
lastErr = err;
|
|
7599
|
-
const
|
|
7600
|
-
if (
|
|
7601
|
-
|
|
7602
|
-
|
|
7625
|
+
const kind = classifyStoreError(err);
|
|
7626
|
+
if (kind === "permanent") throw err;
|
|
7627
|
+
const delay = (kind === "transport" ? TRANSPORT_RETRY_DELAYS_MS : RESTART_RETRY_DELAYS_MS)[attempt];
|
|
7628
|
+
if (delay === void 0) {
|
|
7629
|
+
if (kind === "transport") throw err;
|
|
7630
|
+
break;
|
|
7631
|
+
}
|
|
7632
|
+
await new Promise((r) => setTimeout(r, delay));
|
|
7603
7633
|
}
|
|
7604
7634
|
this.settingsStoreReady = false;
|
|
7605
7635
|
this._ctx?.logger?.warn?.("readAddonStore: settings-store unavailable after retries — using defaults", { meta: { error: lastErr instanceof Error ? lastErr.message : String(lastErr) } });
|
|
7606
7636
|
return {};
|
|
7607
7637
|
}
|
|
7608
7638
|
};
|
|
7639
|
+
/** The settings store's own restart fingerprints. */
|
|
7640
|
+
var RESTART_RETRY_DELAYS_MS = [
|
|
7641
|
+
150,
|
|
7642
|
+
350,
|
|
7643
|
+
600,
|
|
7644
|
+
900
|
|
7645
|
+
];
|
|
7646
|
+
/** A hub restarting under a booting runner: ~100 s in total. */
|
|
7647
|
+
var TRANSPORT_RETRY_DELAYS_MS = [
|
|
7648
|
+
150,
|
|
7649
|
+
350,
|
|
7650
|
+
600,
|
|
7651
|
+
900,
|
|
7652
|
+
2e3,
|
|
7653
|
+
5e3,
|
|
7654
|
+
1e4,
|
|
7655
|
+
2e4,
|
|
7656
|
+
3e4,
|
|
7657
|
+
3e4
|
|
7658
|
+
];
|
|
7659
|
+
var RESTART_FINGERPRINTS = ["SqliteSettingsBackend not initialized", "provider not available"];
|
|
7660
|
+
/** Node / socket error codes of a connection that did not happen or broke. */
|
|
7661
|
+
var TRANSPORT_CODES = new Set([
|
|
7662
|
+
"ECONNREFUSED",
|
|
7663
|
+
"ECONNRESET",
|
|
7664
|
+
"ETIMEDOUT",
|
|
7665
|
+
"EPIPE",
|
|
7666
|
+
"EHOSTUNREACH",
|
|
7667
|
+
"ENETUNREACH"
|
|
7668
|
+
]);
|
|
7669
|
+
/** tRPC error codes that mean "the other side is not answering now", not "your call is wrong". */
|
|
7670
|
+
var UNAVAILABLE_TRPC_CODES = new Set([
|
|
7671
|
+
"TIMEOUT",
|
|
7672
|
+
"SERVICE_UNAVAILABLE",
|
|
7673
|
+
"BAD_GATEWAY",
|
|
7674
|
+
"GATEWAY_TIMEOUT"
|
|
7675
|
+
]);
|
|
7676
|
+
/** The exact phrases OUR transport raises when it cannot reach the hub. */
|
|
7677
|
+
var TRANSPORT_PHRASES = [
|
|
7678
|
+
"discovery deadline exceeded",
|
|
7679
|
+
"parent could not route child unowned cap call",
|
|
7680
|
+
"UDS request timed out after",
|
|
7681
|
+
"channel closed"
|
|
7682
|
+
];
|
|
7683
|
+
/** Moleculer error `type`s of a call that could not be served right now. */
|
|
7684
|
+
var MOLECULER_TRANSIENT_TYPES = new Set([
|
|
7685
|
+
"REQUEST_TIMEOUT",
|
|
7686
|
+
"SERVICE_NOT_FOUND",
|
|
7687
|
+
"SERVICE_NOT_AVAILABLE",
|
|
7688
|
+
"REQUEST_REJECTED",
|
|
7689
|
+
"BROKER_DISCONNECTED"
|
|
7690
|
+
]);
|
|
7691
|
+
function stringProp(value, key) {
|
|
7692
|
+
if (typeof value !== "object" || value === null) return void 0;
|
|
7693
|
+
const found = Reflect.get(value, key);
|
|
7694
|
+
return typeof found === "string" ? found : void 0;
|
|
7695
|
+
}
|
|
7696
|
+
/** The code an error carries: its own, its cause's, or a tRPC `data.code`. */
|
|
7697
|
+
function errorCode(err) {
|
|
7698
|
+
const out = {};
|
|
7699
|
+
const cause = typeof err === "object" && err !== null ? Reflect.get(err, "cause") : void 0;
|
|
7700
|
+
const data = typeof err === "object" && err !== null ? Reflect.get(err, "data") : void 0;
|
|
7701
|
+
const node = stringProp(err, "code") ?? stringProp(cause, "code");
|
|
7702
|
+
if (node !== void 0) out.node = node;
|
|
7703
|
+
const trpc = stringProp(data, "code");
|
|
7704
|
+
if (trpc !== void 0) out.trpc = trpc;
|
|
7705
|
+
return out;
|
|
7706
|
+
}
|
|
7707
|
+
/**
|
|
7708
|
+
* Is a settings read failure worth retrying, and with which budget? Only
|
|
7709
|
+
* EXPLICIT signals count: a socket error code, a tRPC "unavailable" code, or
|
|
7710
|
+
* one of the exact phrases our own transport raises. A message that merely
|
|
7711
|
+
* contains "timed out" or "unreachable" is not evidence of anything, and
|
|
7712
|
+
* `settings store not wired` is a wiring bug that retrying cannot fix.
|
|
7713
|
+
*/
|
|
7714
|
+
function classifyStoreError(err) {
|
|
7715
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
7716
|
+
if (RESTART_FINGERPRINTS.some((f) => message.includes(f))) return "restart";
|
|
7717
|
+
const code = errorCode(err);
|
|
7718
|
+
if (code.node !== void 0 && TRANSPORT_CODES.has(code.node)) return "transport";
|
|
7719
|
+
if (code.trpc !== void 0 && UNAVAILABLE_TRPC_CODES.has(code.trpc)) return "transport";
|
|
7720
|
+
if (typeof err === "object" && err !== null) {
|
|
7721
|
+
if (Reflect.get(err, "retryable") === true) return "transport";
|
|
7722
|
+
const type = stringProp(err, "type");
|
|
7723
|
+
if (type !== void 0 && MOLECULER_TRANSIENT_TYPES.has(type)) return "transport";
|
|
7724
|
+
}
|
|
7725
|
+
if (TRANSPORT_PHRASES.some((f) => message.includes(f))) return "transport";
|
|
7726
|
+
return "permanent";
|
|
7727
|
+
}
|
|
7609
7728
|
/**
|
|
7610
7729
|
* Collect the keys of every field marked `perNode: true`, recursing into
|
|
7611
7730
|
* layout containers (`group` fields and `sub-tabs` tabs) the same way
|
|
@@ -7695,6 +7814,156 @@ var PeerBytesTicketSchema = object({
|
|
|
7695
7814
|
*/
|
|
7696
7815
|
declaredBytes: number().int().nonnegative().nullable()
|
|
7697
7816
|
});
|
|
7817
|
+
/** Limits and names of `ctx.records` (D881). One authority; the engine and the facade read it. */
|
|
7818
|
+
/** The files a kind may live in. `history` is device-history's (D850), never records. */
|
|
7819
|
+
var RECORD_DATABASES = ["settings", "events"];
|
|
7820
|
+
/** The classes of a kind: the `@durable` vocabulary, one authority (replaces the annotation). */
|
|
7821
|
+
var RECORD_CLASSES = [
|
|
7822
|
+
"config",
|
|
7823
|
+
"ledger",
|
|
7824
|
+
"audit",
|
|
7825
|
+
"mirror",
|
|
7826
|
+
"ephemeral"
|
|
7827
|
+
];
|
|
7828
|
+
var RECORD_DEFAULT_MAX_DATA_BYTES = 64 * 1024;
|
|
7829
|
+
var RECORD_MAX_DATA_BYTES = 1024 * 1024;
|
|
7830
|
+
var RECORD_BATCH_MAX = 1e3;
|
|
7831
|
+
var RECORD_QUERY_MAX = 1e3;
|
|
7832
|
+
function defOf(schema) {
|
|
7833
|
+
const zodBag = Reflect.get(schema, "_zod");
|
|
7834
|
+
if (typeof zodBag !== "object" || zodBag === null) return {};
|
|
7835
|
+
const def = Reflect.get(zodBag, "def");
|
|
7836
|
+
if (typeof def !== "object" || def === null) return {};
|
|
7837
|
+
return def;
|
|
7838
|
+
}
|
|
7839
|
+
function declaredHere(schema) {
|
|
7840
|
+
return globalRegistry.get(schema)?.secret === true;
|
|
7841
|
+
}
|
|
7842
|
+
/** Wrapper kinds whose `innerType` is the field itself. */
|
|
7843
|
+
var WRAPPERS = new Set([
|
|
7844
|
+
"optional",
|
|
7845
|
+
"nullable",
|
|
7846
|
+
"default",
|
|
7847
|
+
"prefault",
|
|
7848
|
+
"catch",
|
|
7849
|
+
"readonly",
|
|
7850
|
+
"nonoptional"
|
|
7851
|
+
]);
|
|
7852
|
+
/**
|
|
7853
|
+
* The schema layers that make up ONE field: the schema itself and every
|
|
7854
|
+
* wrapper below it (optional / default / nullable / readonly / catch), plus
|
|
7855
|
+
* both sides of a pipe (`z.preprocess` puts the real schema on `out`,
|
|
7856
|
+
* `.transform` on `in`).
|
|
7857
|
+
*/
|
|
7858
|
+
function layersOf(schema) {
|
|
7859
|
+
const out = [];
|
|
7860
|
+
const queue = [schema];
|
|
7861
|
+
while (queue.length > 0) {
|
|
7862
|
+
const s = queue.shift();
|
|
7863
|
+
if (!s || out.includes(s)) continue;
|
|
7864
|
+
out.push(s);
|
|
7865
|
+
const def = defOf(s);
|
|
7866
|
+
if (def.type !== void 0 && WRAPPERS.has(def.type) && def.innerType) queue.push(def.innerType);
|
|
7867
|
+
if (def.type === "pipe") {
|
|
7868
|
+
if (def.in) queue.push(def.in);
|
|
7869
|
+
if (def.out) queue.push(def.out);
|
|
7870
|
+
}
|
|
7871
|
+
}
|
|
7872
|
+
return out;
|
|
7873
|
+
}
|
|
7874
|
+
/** True when any layer of this field declares `.meta({ secret: true })`. */
|
|
7875
|
+
function isZodSecret(schema) {
|
|
7876
|
+
return layersOf(schema).some(declaredHere);
|
|
7877
|
+
}
|
|
7878
|
+
/**
|
|
7879
|
+
* Every declared secret path in a config schema: dotted keys, `[]` for "each
|
|
7880
|
+
* element of this array" (`connection.password`, `rows[].token`). A declared
|
|
7881
|
+
* object or array is reported as one path and not descended into — everything
|
|
7882
|
+
* under it is secret.
|
|
7883
|
+
*/
|
|
7884
|
+
function collectZodSecretPaths(schema, prefix = "") {
|
|
7885
|
+
if (isZodSecret(schema)) return prefix.length > 0 ? [prefix] : [];
|
|
7886
|
+
const paths = [];
|
|
7887
|
+
for (const layer of layersOf(schema)) {
|
|
7888
|
+
const def = defOf(layer);
|
|
7889
|
+
if (def.type === "object" && def.shape) for (const [key, child] of Object.entries(def.shape)) paths.push(...collectZodSecretPaths(child, prefix ? `${prefix}.${key}` : key));
|
|
7890
|
+
else if (def.type === "array" && def.element) paths.push(...collectZodSecretPaths(def.element, `${prefix}[]`));
|
|
7891
|
+
else if (def.type === "union" && def.options) for (const option of def.options) paths.push(...collectZodSecretPaths(option, prefix));
|
|
7892
|
+
else if (def.type === "intersection") {
|
|
7893
|
+
if (def.left) paths.push(...collectZodSecretPaths(def.left, prefix));
|
|
7894
|
+
if (def.right) paths.push(...collectZodSecretPaths(def.right, prefix));
|
|
7895
|
+
}
|
|
7896
|
+
}
|
|
7897
|
+
return [...new Set(paths)];
|
|
7898
|
+
}
|
|
7899
|
+
/**
|
|
7900
|
+
* Record kinds (D881): the declaration an addon makes of one kind of fact, the
|
|
7901
|
+
* Zod row schema that describes it, and the helper that turns the two into the
|
|
7902
|
+
* JSON the engine stores.
|
|
7903
|
+
*
|
|
7904
|
+
* A kind is declared ONCE, next to the code that owns it, and the engine's
|
|
7905
|
+
* reconciler creates its indexes - nothing creates DDL at runtime from a write.
|
|
7906
|
+
* Everything the generic machinery needs (secret fields, the entry descriptor)
|
|
7907
|
+
* is DERIVED from the Zod schema: `.meta({ secret: true })` marks a credential,
|
|
7908
|
+
* never a field name (D879).
|
|
7909
|
+
*/
|
|
7910
|
+
/** A JSON field path: `trackId`, `auth.accessToken`. Charset-restricted: it is rendered into DDL. */
|
|
7911
|
+
var RecordFieldPathSchema = string().regex(/^[A-Za-z_][A-Za-z0-9_]{0,63}(\.[A-Za-z_][A-Za-z0-9_]{0,63}){0,3}$/);
|
|
7912
|
+
var RecordIndexSchema = object({
|
|
7913
|
+
name: string().regex(/^[a-z][a-z0-9_]{0,31}$/),
|
|
7914
|
+
fields: array(RecordFieldPathSchema).min(1).max(4),
|
|
7915
|
+
unique: boolean().optional()
|
|
7916
|
+
}).strict();
|
|
7917
|
+
var RecordRetentionSchema = union([
|
|
7918
|
+
object({
|
|
7919
|
+
ttlMs: number().int().positive(),
|
|
7920
|
+
from: _enum(["at", "write"])
|
|
7921
|
+
}).strict(),
|
|
7922
|
+
object({
|
|
7923
|
+
maxRows: number().int().positive().optional(),
|
|
7924
|
+
maxRowsPerDevice: number().int().positive().optional()
|
|
7925
|
+
}).strict().refine((r) => r.maxRows !== void 0 || r.maxRowsPerDevice !== void 0, { message: "name maxRows, maxRowsPerDevice or both" }),
|
|
7926
|
+
object({
|
|
7927
|
+
owner: string().min(1),
|
|
7928
|
+
reason: string().min(1)
|
|
7929
|
+
}).strict(),
|
|
7930
|
+
object({ none: string().min(1) }).strict()
|
|
7931
|
+
]);
|
|
7932
|
+
/** The descriptor a generic entries UI reads (D881 "generic entries"). */
|
|
7933
|
+
var EntryDescriptorSchema = object({
|
|
7934
|
+
title: string().min(1),
|
|
7935
|
+
/** The record body field shown as the entry's name. */
|
|
7936
|
+
nameField: string().min(1),
|
|
7937
|
+
/** JSON Schema of the entry body; `secret: true` marks a password field. */
|
|
7938
|
+
fields: record(string(), unknown())
|
|
7939
|
+
}).strict();
|
|
7940
|
+
/** What crosses the wire and sits in the engine's catalog: JSON only, no Zod. */
|
|
7941
|
+
var RecordKindDeclarationSchema = object({
|
|
7942
|
+
database: _enum(RECORD_DATABASES).default("settings"),
|
|
7943
|
+
class: _enum(RECORD_CLASSES),
|
|
7944
|
+
writeTrigger: string().min(1),
|
|
7945
|
+
device: _enum([
|
|
7946
|
+
"required",
|
|
7947
|
+
"optional",
|
|
7948
|
+
"none"
|
|
7949
|
+
]).default("none"),
|
|
7950
|
+
at: _enum(["required", "none"]).default("none"),
|
|
7951
|
+
indexes: array(RecordIndexSchema).max(8).default([]),
|
|
7952
|
+
retention: RecordRetentionSchema,
|
|
7953
|
+
deviceRemoval: _enum(["delete", "none"]).default("none"),
|
|
7954
|
+
maxDataBytes: number().int().positive().max(RECORD_MAX_DATA_BYTES).default(RECORD_DEFAULT_MAX_DATA_BYTES),
|
|
7955
|
+
/** Derived from the Zod schema; never written by hand. */
|
|
7956
|
+
secretPaths: array(string().min(1)).default([]),
|
|
7957
|
+
/** The id key of each array that carries a secret (`{ headers: 'name' }`). */
|
|
7958
|
+
secretArrayKeys: record(string(), string()).default({}),
|
|
7959
|
+
/** The legacy table this kind adopts from; the boot guard reads it (D853: no migration code). */
|
|
7960
|
+
adoptsFrom: string().min(1).optional(),
|
|
7961
|
+
/** Kinds that must agree through `transact` sit in one file under one family name. */
|
|
7962
|
+
transactFamily: string().min(1).optional(),
|
|
7963
|
+
entry: EntryDescriptorSchema.optional()
|
|
7964
|
+
}).strict();
|
|
7965
|
+
/** The kind names: lower-case, dash separated, short enough for an index name. */
|
|
7966
|
+
var RecordKindNameSchema = string().regex(/^[a-z][a-z0-9-]{0,47}$/);
|
|
7698
7967
|
/** Shared Zod schemas used across streaming capabilities. */
|
|
7699
7968
|
var CamProfileSchema = _enum([
|
|
7700
7969
|
"high",
|
|
@@ -8159,69 +8428,6 @@ method(object({ deviceId: number() }), array(StreamSourceEntrySchema)), method(o
|
|
|
8159
8428
|
kind: "mutation",
|
|
8160
8429
|
auth: "admin"
|
|
8161
8430
|
}), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
|
|
8162
|
-
function defOf(schema) {
|
|
8163
|
-
return schema._zod?.def ?? {};
|
|
8164
|
-
}
|
|
8165
|
-
function declaredHere(schema) {
|
|
8166
|
-
return globalRegistry.get(schema)?.secret === true;
|
|
8167
|
-
}
|
|
8168
|
-
/** Wrapper kinds whose `innerType` is the field itself. */
|
|
8169
|
-
var WRAPPERS = new Set([
|
|
8170
|
-
"optional",
|
|
8171
|
-
"nullable",
|
|
8172
|
-
"default",
|
|
8173
|
-
"prefault",
|
|
8174
|
-
"catch",
|
|
8175
|
-
"readonly",
|
|
8176
|
-
"nonoptional"
|
|
8177
|
-
]);
|
|
8178
|
-
/**
|
|
8179
|
-
* The schema layers that make up ONE field: the schema itself and every
|
|
8180
|
-
* wrapper below it (optional / default / nullable / readonly / catch), plus
|
|
8181
|
-
* both sides of a pipe (`z.preprocess` puts the real schema on `out`,
|
|
8182
|
-
* `.transform` on `in`).
|
|
8183
|
-
*/
|
|
8184
|
-
function layersOf(schema) {
|
|
8185
|
-
const out = [];
|
|
8186
|
-
const queue = [schema];
|
|
8187
|
-
while (queue.length > 0) {
|
|
8188
|
-
const s = queue.shift();
|
|
8189
|
-
if (!s || out.includes(s)) continue;
|
|
8190
|
-
out.push(s);
|
|
8191
|
-
const def = defOf(s);
|
|
8192
|
-
if (def.type !== void 0 && WRAPPERS.has(def.type) && def.innerType) queue.push(def.innerType);
|
|
8193
|
-
if (def.type === "pipe") {
|
|
8194
|
-
if (def.in) queue.push(def.in);
|
|
8195
|
-
if (def.out) queue.push(def.out);
|
|
8196
|
-
}
|
|
8197
|
-
}
|
|
8198
|
-
return out;
|
|
8199
|
-
}
|
|
8200
|
-
/** True when any layer of this field declares `.meta({ secret: true })`. */
|
|
8201
|
-
function isZodSecret(schema) {
|
|
8202
|
-
return layersOf(schema).some(declaredHere);
|
|
8203
|
-
}
|
|
8204
|
-
/**
|
|
8205
|
-
* Every declared secret path in a config schema: dotted keys, `[]` for "each
|
|
8206
|
-
* element of this array" (`connection.password`, `rows[].token`). A declared
|
|
8207
|
-
* object or array is reported as one path and not descended into — everything
|
|
8208
|
-
* under it is secret.
|
|
8209
|
-
*/
|
|
8210
|
-
function collectZodSecretPaths(schema, prefix = "") {
|
|
8211
|
-
if (isZodSecret(schema)) return prefix.length > 0 ? [prefix] : [];
|
|
8212
|
-
const paths = [];
|
|
8213
|
-
for (const layer of layersOf(schema)) {
|
|
8214
|
-
const def = defOf(layer);
|
|
8215
|
-
if (def.type === "object" && def.shape) for (const [key, child] of Object.entries(def.shape)) paths.push(...collectZodSecretPaths(child, prefix ? `${prefix}.${key}` : key));
|
|
8216
|
-
else if (def.type === "array" && def.element) paths.push(...collectZodSecretPaths(def.element, `${prefix}[]`));
|
|
8217
|
-
else if (def.type === "union" && def.options) for (const option of def.options) paths.push(...collectZodSecretPaths(option, prefix));
|
|
8218
|
-
else if (def.type === "intersection") {
|
|
8219
|
-
if (def.left) paths.push(...collectZodSecretPaths(def.left, prefix));
|
|
8220
|
-
if (def.right) paths.push(...collectZodSecretPaths(def.right, prefix));
|
|
8221
|
-
}
|
|
8222
|
-
}
|
|
8223
|
-
return [...new Set(paths)];
|
|
8224
|
-
}
|
|
8225
8431
|
object({
|
|
8226
8432
|
code: string().regex(/^[a-z][a-z0-9-]*(\.[a-z0-9-]+)+$/),
|
|
8227
8433
|
params: record(string(), union([string(), number()])).optional()
|
|
@@ -8241,7 +8447,7 @@ function userError(code, params, englishFallback) {
|
|
|
8241
8447
|
return new CamstackError(code, params, englishFallback);
|
|
8242
8448
|
}
|
|
8243
8449
|
//#endregion
|
|
8244
|
-
//#region ../types/dist/err-msg-
|
|
8450
|
+
//#region ../types/dist/err-msg-BXKzRBwg.mjs
|
|
8245
8451
|
var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
8246
8452
|
DeviceType["Camera"] = "camera";
|
|
8247
8453
|
DeviceType["Hub"] = "hub";
|
|
@@ -8333,6 +8539,10 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
|
8333
8539
|
* native PetKit (`nodepetkit` `FeederDevice`), reusable by other feeder
|
|
8334
8540
|
* integrations sharing the same food/desiccant/hopper surface. */
|
|
8335
8541
|
DeviceType["PetFeeder"] = "pet-feeder";
|
|
8542
|
+
/** Built-in dishwasher — program lifecycle, door / remote-start gates,
|
|
8543
|
+
* salt and rinse-aid levels. Installed with the `dishwasher` cap.
|
|
8544
|
+
* Sources: native Bosch Home Connect, reusable by similar integrations. */
|
|
8545
|
+
DeviceType["Dishwasher"] = "dishwasher";
|
|
8336
8546
|
return DeviceType;
|
|
8337
8547
|
}({});
|
|
8338
8548
|
var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
|
|
@@ -8510,6 +8720,9 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
|
|
|
8510
8720
|
/** Virtual HA toggle (input_boolean.*) — distinguishable from a
|
|
8511
8721
|
* real Switch device for UI rendering / export adapters. */
|
|
8512
8722
|
DeviceRole["BinaryHelper"] = "binary-helper";
|
|
8723
|
+
/** A smart plug: a `switch` whose source says it is an outlet (HA
|
|
8724
|
+
* `device_class: outlet`). The Alexa export shows it as a SMARTPLUG. */
|
|
8725
|
+
DeviceRole["Outlet"] = "outlet";
|
|
8513
8726
|
/** Generic motion / occupancy / moving event source. Distinct from
|
|
8514
8727
|
* the camera accessory PirSensor role: that one is a camera child;
|
|
8515
8728
|
* this is a standalone HA / 3rd-party motion sensor. */
|
|
@@ -8587,7 +8800,7 @@ function errMsg(err) {
|
|
|
8587
8800
|
return String(err);
|
|
8588
8801
|
}
|
|
8589
8802
|
//#endregion
|
|
8590
|
-
//#region ../types/dist/composition-
|
|
8803
|
+
//#region ../types/dist/composition-CB6PMT9p.mjs
|
|
8591
8804
|
/**
|
|
8592
8805
|
* The ffmpeg build every CamStack node downloads, per platform and arch.
|
|
8593
8806
|
*
|
|
@@ -11791,11 +12004,10 @@ var ClipModelMetaSchema = object({
|
|
|
11791
12004
|
/**
|
|
11792
12005
|
* The `vector-store` index this model's vectors live in. ONE feature space
|
|
11793
12006
|
* per index: two models share an index only when their vectors are ranked
|
|
11794
|
-
* against each other, which for CLIP means never across families.
|
|
11795
|
-
*
|
|
11796
|
-
* `modelId`); any other model gets its own.
|
|
12007
|
+
* against each other, which for CLIP means never across families. Every
|
|
12008
|
+
* model gets its own.
|
|
11797
12009
|
*/
|
|
11798
|
-
vectorIndex: string().regex(/^object-clip
|
|
12010
|
+
vectorIndex: string().regex(/^object-clip-[a-z0-9][a-z0-9-]*$/),
|
|
11799
12011
|
/**
|
|
11800
12012
|
* The text encoder's tokenizer, a declared SIBLING file of its onnx. The name
|
|
11801
12013
|
* must be unique per tokenizer: every model's siblings land in ONE flat
|
|
@@ -12974,8 +13186,20 @@ var AlertSeveritySchema = _enum([
|
|
|
12974
13186
|
"info",
|
|
12975
13187
|
"success",
|
|
12976
13188
|
"warning",
|
|
12977
|
-
"error"
|
|
13189
|
+
"error",
|
|
13190
|
+
"critical"
|
|
12978
13191
|
]);
|
|
13192
|
+
var AlertActionSchema = object({
|
|
13193
|
+
label: string(),
|
|
13194
|
+
href: string().optional(),
|
|
13195
|
+
/**
|
|
13196
|
+
* How `href` is followed. Absent / `app`: an admin-ui route (client-side).
|
|
13197
|
+
* `server`: a route the HUB serves (an addon HTTP route such as an OAuth
|
|
13198
|
+
* start) — the browser must leave the SPA with a full navigation, because
|
|
13199
|
+
* the SPA has no such route and would bounce to the home page.
|
|
13200
|
+
*/
|
|
13201
|
+
navigation: _enum(["app", "server"]).optional()
|
|
13202
|
+
});
|
|
12979
13203
|
var AlertStatusSchema = _enum([
|
|
12980
13204
|
"active",
|
|
12981
13205
|
"in-progress",
|
|
@@ -12993,6 +13217,7 @@ var AlertSchema = object({
|
|
|
12993
13217
|
severity: AlertSeveritySchema,
|
|
12994
13218
|
title: string(),
|
|
12995
13219
|
message: string(),
|
|
13220
|
+
action: AlertActionSchema.optional(),
|
|
12996
13221
|
status: AlertStatusSchema,
|
|
12997
13222
|
progress: number().optional(),
|
|
12998
13223
|
read: boolean(),
|
|
@@ -15528,6 +15753,41 @@ var ComposableCapabilitiesSchema = object({ caps: array(object({
|
|
|
15528
15753
|
keyField: string()
|
|
15529
15754
|
}).optional()
|
|
15530
15755
|
})) });
|
|
15756
|
+
/**
|
|
15757
|
+
* The report of a one-shot "move this owner's plaintext secrets into the
|
|
15758
|
+
* keychain" run (D878). COUNTS only - never a value, never a ref.
|
|
15759
|
+
*
|
|
15760
|
+
* The owner runs it on its own rows, through its own write path; an operator
|
|
15761
|
+
* script (`scripts/hub/migrate-raw-secrets.ts`) calls the owner's cap method.
|
|
15762
|
+
* Dry run (`apply: false`) reports what WOULD move and changes nothing.
|
|
15763
|
+
*/
|
|
15764
|
+
var RawSecretMigrationInputSchema = object({
|
|
15765
|
+
/** `false` (the default of the script) = report only. */
|
|
15766
|
+
apply: boolean() });
|
|
15767
|
+
var RawSecretMigrationReportSchema = object({
|
|
15768
|
+
apply: boolean(),
|
|
15769
|
+
/** Rows that can carry a secret (a profile, an enrolment). */
|
|
15770
|
+
rows: number().int(),
|
|
15771
|
+
/** Rows whose secret was plaintext when the run started. */
|
|
15772
|
+
raw: number().int(),
|
|
15773
|
+
/** Rows that already held a keychain marker when the run started. */
|
|
15774
|
+
markers: number().int(),
|
|
15775
|
+
/** Plaintext rows moved by THIS run (always 0 on a dry run). */
|
|
15776
|
+
migrated: number().int(),
|
|
15777
|
+
/** Plaintext rows left in place because the move or its read-back failed. */
|
|
15778
|
+
failed: number().int(),
|
|
15779
|
+
/** After the run: rows still holding plaintext. */
|
|
15780
|
+
remainingRaw: number().int(),
|
|
15781
|
+
/** After the run: markers the keychain could not resolve right now. */
|
|
15782
|
+
unresolvedMarkers: number().int(),
|
|
15783
|
+
/**
|
|
15784
|
+
* A second, redundant copy of the secrets' rows that the run found (and, on
|
|
15785
|
+
* `apply`, deleted after verifying the first). Owners with a single copy omit it.
|
|
15786
|
+
*/
|
|
15787
|
+
redundantCopies: number().int().optional(),
|
|
15788
|
+
/** True when nothing is raw and every marker resolves. */
|
|
15789
|
+
verified: boolean()
|
|
15790
|
+
});
|
|
15531
15791
|
/** Where a block runs. The operator chooses — a block driving a device on an
|
|
15532
15792
|
* agent is the reason placement is not fixed to the hub. */
|
|
15533
15793
|
var CoreBlockPlacementSchema = union([literal("hub"), string().min(1)]);
|
|
@@ -15754,6 +16014,9 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
|
|
|
15754
16014
|
}), SettingsUpdateResultSchema, {
|
|
15755
16015
|
kind: "mutation",
|
|
15756
16016
|
auth: "admin"
|
|
16017
|
+
}), method(RawSecretMigrationInputSchema, RawSecretMigrationReportSchema, {
|
|
16018
|
+
kind: "mutation",
|
|
16019
|
+
auth: "admin"
|
|
15757
16020
|
}), method(object({}), object({ libs: array(object({
|
|
15758
16021
|
filePath: string(),
|
|
15759
16022
|
content: string()
|
|
@@ -16017,6 +16280,347 @@ id: union([string(), number()]) }), {
|
|
|
16017
16280
|
auth: "admin"
|
|
16018
16281
|
});
|
|
16019
16282
|
/**
|
|
16283
|
+
* records - an addon's own facts and documents (D881): ledgers, audit rows,
|
|
16284
|
+
* config documents, mirrors. The third storage API next to `ctx.settings`
|
|
16285
|
+
* (operator intent, D870) and device-history (numbers over time, D850).
|
|
16286
|
+
*
|
|
16287
|
+
* Who the OWNER is: `callerAddonId`, stamped by the transport on a call that
|
|
16288
|
+
* crossed a process and stated by a hub in-process caller (`ctx.records` does
|
|
16289
|
+
* that with the addon id closed over). It is deliberately NOT in any input
|
|
16290
|
+
* schema, so a session can never supply it, and a call with no stamp is refused
|
|
16291
|
+
* `records/no-caller`. A kind is readable and writable only by its owner; other
|
|
16292
|
+
* addons go through the owner's capability.
|
|
16293
|
+
*
|
|
16294
|
+
* Every read is three-way: a row, `null`, or the call THROWS. A failed read is
|
|
16295
|
+
* never `[]`. Secret fields are never on the wire: a read shows the
|
|
16296
|
+
* redaction token, `secretRefs` hands the owner's `ctx.secrets` the refs it
|
|
16297
|
+
* resolves itself, and a write may carry only a keychain marker bound to the
|
|
16298
|
+
* row's own ref.
|
|
16299
|
+
*
|
|
16300
|
+
* Internal: addons reach it through `ctx.records`, never directly.
|
|
16301
|
+
*/
|
|
16302
|
+
var RecordIdSchema = string().min(1).max(256);
|
|
16303
|
+
/** A JSON object body. Size is the engine's check (`maxDataBytes`), not a schema's. */
|
|
16304
|
+
var RecordBodySchema = record(string(), unknown());
|
|
16305
|
+
var RecordInputSchema = object({
|
|
16306
|
+
id: RecordIdSchema,
|
|
16307
|
+
/** The device this row belongs to (D865 removal, per-device reads). */
|
|
16308
|
+
deviceId: number().int().optional(),
|
|
16309
|
+
/** The domain clock, ms: observed / created / opened. */
|
|
16310
|
+
at: number().int().optional(),
|
|
16311
|
+
/** Producer-set expiry, ms. Refused on a kind whose retention is an engine TTL. */
|
|
16312
|
+
expiresAt: number().int().optional(),
|
|
16313
|
+
data: RecordBodySchema
|
|
16314
|
+
});
|
|
16315
|
+
var RecordViewSchema = object({
|
|
16316
|
+
id: string(),
|
|
16317
|
+
deviceId: number().int().nullable(),
|
|
16318
|
+
at: number().nullable(),
|
|
16319
|
+
expiresAt: number().nullable(),
|
|
16320
|
+
rev: number().int(),
|
|
16321
|
+
updatedAt: number(),
|
|
16322
|
+
data: RecordBodySchema
|
|
16323
|
+
});
|
|
16324
|
+
/** Declared index fields only. Anything else does not compile, by design. */
|
|
16325
|
+
var RecordWhereSchema = record(RecordFieldPathSchema, union([
|
|
16326
|
+
string(),
|
|
16327
|
+
number(),
|
|
16328
|
+
boolean(),
|
|
16329
|
+
object({ in: array(union([
|
|
16330
|
+
string(),
|
|
16331
|
+
number(),
|
|
16332
|
+
boolean()
|
|
16333
|
+
])).min(1).max(RECORD_BATCH_MAX) }),
|
|
16334
|
+
object({
|
|
16335
|
+
gt: union([string(), number()]).optional(),
|
|
16336
|
+
gte: union([string(), number()]).optional(),
|
|
16337
|
+
lt: union([string(), number()]).optional(),
|
|
16338
|
+
lte: union([string(), number()]).optional()
|
|
16339
|
+
}).refine((r) => Object.keys(r).length > 0, { message: "name at least one bound" })
|
|
16340
|
+
]));
|
|
16341
|
+
var KindShape = { kind: RecordKindNameSchema };
|
|
16342
|
+
var TimeWindowShape = {
|
|
16343
|
+
deviceId: number().int().optional(),
|
|
16344
|
+
atFrom: number().optional(),
|
|
16345
|
+
atTo: number().optional()
|
|
16346
|
+
};
|
|
16347
|
+
var RecordQueryInputSchema = object({
|
|
16348
|
+
...KindShape,
|
|
16349
|
+
...TimeWindowShape,
|
|
16350
|
+
where: RecordWhereSchema.optional(),
|
|
16351
|
+
/** Without `where`: `at` (default for a kind with a clock) or `id`. With `where` the order is the index's. */
|
|
16352
|
+
order: _enum(["at", "id"]).optional(),
|
|
16353
|
+
desc: boolean().optional(),
|
|
16354
|
+
limit: number().int().min(1).max(RECORD_QUERY_MAX).default(100),
|
|
16355
|
+
/** Opaque keyset cursor from a previous answer. There is no offset. */
|
|
16356
|
+
cursor: string().min(1).optional()
|
|
16357
|
+
});
|
|
16358
|
+
var RecordQueryResultSchema = object({
|
|
16359
|
+
records: array(RecordViewSchema),
|
|
16360
|
+
nextCursor: string().nullable()
|
|
16361
|
+
});
|
|
16362
|
+
var RecordKindStateSchema = _enum([
|
|
16363
|
+
"created",
|
|
16364
|
+
"unchanged",
|
|
16365
|
+
"updated"
|
|
16366
|
+
]);
|
|
16367
|
+
var DeclareKindResultSchema = object({
|
|
16368
|
+
kindId: number().int(),
|
|
16369
|
+
state: RecordKindStateSchema,
|
|
16370
|
+
createdIndexes: array(string()),
|
|
16371
|
+
/** The boot guard: the kind is empty while its legacy table still holds rows. */
|
|
16372
|
+
adoptionPending: object({
|
|
16373
|
+
legacyTable: string(),
|
|
16374
|
+
legacyRows: number().int()
|
|
16375
|
+
}).nullable()
|
|
16376
|
+
});
|
|
16377
|
+
/** Keychain refs a write released (the old marker is gone from the row): the owner deletes the values. */
|
|
16378
|
+
var SecretRefsList = array(string());
|
|
16379
|
+
var RecordSecretRefsSchema = record(string(), record(string(), string()));
|
|
16380
|
+
method(object({ kinds: record(RecordKindNameSchema, RecordKindDeclarationSchema) }), object({ kinds: record(string(), DeclareKindResultSchema) }), {
|
|
16381
|
+
kind: "mutation",
|
|
16382
|
+
auth: "admin"
|
|
16383
|
+
}), method(object({
|
|
16384
|
+
...KindShape,
|
|
16385
|
+
id: RecordIdSchema
|
|
16386
|
+
}), RecordViewSchema.nullable(), { auth: "admin" }), method(object({
|
|
16387
|
+
...KindShape,
|
|
16388
|
+
ids: array(RecordIdSchema).min(1).max(RECORD_BATCH_MAX)
|
|
16389
|
+
}), array(RecordViewSchema), { auth: "admin" }), method(object({
|
|
16390
|
+
...KindShape,
|
|
16391
|
+
ids: array(RecordIdSchema).min(1).max(RECORD_BATCH_MAX)
|
|
16392
|
+
}), RecordSecretRefsSchema, { auth: "admin" }), method(object({
|
|
16393
|
+
...KindShape,
|
|
16394
|
+
record: RecordInputSchema,
|
|
16395
|
+
/** Compare-and-set. `0` means "the row must not exist". */
|
|
16396
|
+
ifRev: number().int().min(0).optional()
|
|
16397
|
+
}), object({
|
|
16398
|
+
rev: number().int(),
|
|
16399
|
+
releasedRefs: SecretRefsList
|
|
16400
|
+
}), {
|
|
16401
|
+
kind: "mutation",
|
|
16402
|
+
auth: "admin"
|
|
16403
|
+
}), method(object({
|
|
16404
|
+
...KindShape,
|
|
16405
|
+
records: array(RecordInputSchema).min(1).max(RECORD_BATCH_MAX)
|
|
16406
|
+
}), object({
|
|
16407
|
+
count: number().int(),
|
|
16408
|
+
releasedRefs: SecretRefsList
|
|
16409
|
+
}), {
|
|
16410
|
+
kind: "mutation",
|
|
16411
|
+
auth: "admin"
|
|
16412
|
+
}), method(object({
|
|
16413
|
+
...KindShape,
|
|
16414
|
+
id: RecordIdSchema,
|
|
16415
|
+
data: RecordBodySchema,
|
|
16416
|
+
at: number().int().nullable().optional(),
|
|
16417
|
+
expiresAt: number().int().nullable().optional(),
|
|
16418
|
+
ifRev: number().int().min(1).optional()
|
|
16419
|
+
}), object({
|
|
16420
|
+
rev: number().int(),
|
|
16421
|
+
releasedRefs: SecretRefsList
|
|
16422
|
+
}), {
|
|
16423
|
+
kind: "mutation",
|
|
16424
|
+
auth: "admin"
|
|
16425
|
+
}), method(object({
|
|
16426
|
+
...KindShape,
|
|
16427
|
+
id: RecordIdSchema
|
|
16428
|
+
}), object({
|
|
16429
|
+
deleted: boolean(),
|
|
16430
|
+
secretRefs: SecretRefsList
|
|
16431
|
+
}), {
|
|
16432
|
+
kind: "mutation",
|
|
16433
|
+
auth: "admin"
|
|
16434
|
+
}), method(object({
|
|
16435
|
+
...KindShape,
|
|
16436
|
+
ids: array(RecordIdSchema).min(1).max(RECORD_BATCH_MAX)
|
|
16437
|
+
}), object({
|
|
16438
|
+
deleted: number().int(),
|
|
16439
|
+
secretRefs: SecretRefsList
|
|
16440
|
+
}), {
|
|
16441
|
+
kind: "mutation",
|
|
16442
|
+
auth: "admin"
|
|
16443
|
+
}), method(RecordQueryInputSchema, RecordQueryResultSchema, { auth: "admin" }), method(object({
|
|
16444
|
+
...KindShape,
|
|
16445
|
+
...TimeWindowShape,
|
|
16446
|
+
where: RecordWhereSchema.optional()
|
|
16447
|
+
}), object({ count: number().int() }), { auth: "admin" }), method(object({
|
|
16448
|
+
...KindShape,
|
|
16449
|
+
deviceId: number().int().optional(),
|
|
16450
|
+
from: number(),
|
|
16451
|
+
to: number(),
|
|
16452
|
+
bucketMs: number().int().positive()
|
|
16453
|
+
}), object({ buckets: array(object({
|
|
16454
|
+
bucketStart: number(),
|
|
16455
|
+
count: number().int()
|
|
16456
|
+
})) }), { auth: "admin" }), method(object({
|
|
16457
|
+
...KindShape,
|
|
16458
|
+
op: _enum([
|
|
16459
|
+
"sum",
|
|
16460
|
+
"min",
|
|
16461
|
+
"max",
|
|
16462
|
+
"count"
|
|
16463
|
+
]),
|
|
16464
|
+
field: RecordFieldPathSchema.optional(),
|
|
16465
|
+
groupBy: RecordFieldPathSchema.optional(),
|
|
16466
|
+
where: RecordWhereSchema.optional()
|
|
16467
|
+
}), object({ rows: array(object({
|
|
16468
|
+
group: union([
|
|
16469
|
+
string(),
|
|
16470
|
+
number(),
|
|
16471
|
+
_null()
|
|
16472
|
+
]),
|
|
16473
|
+
value: number().nullable()
|
|
16474
|
+
})) }), { auth: "admin" }), method(object({
|
|
16475
|
+
...KindShape,
|
|
16476
|
+
deviceId: number().int().optional(),
|
|
16477
|
+
atBefore: number().optional(),
|
|
16478
|
+
where: RecordWhereSchema.optional()
|
|
16479
|
+
}), object({
|
|
16480
|
+
deleted: number().int(),
|
|
16481
|
+
secretRefs: SecretRefsList
|
|
16482
|
+
}), {
|
|
16483
|
+
kind: "mutation",
|
|
16484
|
+
auth: "admin"
|
|
16485
|
+
}), method(object({
|
|
16486
|
+
deviceId: number().int(),
|
|
16487
|
+
kinds: array(RecordKindNameSchema).optional()
|
|
16488
|
+
}), object({
|
|
16489
|
+
deleted: record(string(), number().int()),
|
|
16490
|
+
secretRefs: SecretRefsList
|
|
16491
|
+
}), {
|
|
16492
|
+
kind: "mutation",
|
|
16493
|
+
auth: "admin"
|
|
16494
|
+
}), method(object(KindShape), object({ id: number().int() }), {
|
|
16495
|
+
kind: "mutation",
|
|
16496
|
+
auth: "admin"
|
|
16497
|
+
});
|
|
16498
|
+
/** One table of the settings database. */
|
|
16499
|
+
var StorageTableSchema = object({
|
|
16500
|
+
/** The table's full name, e.g. `recorder:addon-settings` or `addon-device-settings`. */
|
|
16501
|
+
name: string(),
|
|
16502
|
+
/** The owner prefix of a scoped name (`recorder` for `recorder:addon-settings`), else null. */
|
|
16503
|
+
owner: string().nullable(),
|
|
16504
|
+
rows: number().int().nonnegative(),
|
|
16505
|
+
/** Bytes the table's pages occupy (`dbstat`); null when the engine cannot measure. */
|
|
16506
|
+
bytes: number().int().nonnegative().nullable(),
|
|
16507
|
+
/** Declared by an addon since this engine process started (a running addon claims it). */
|
|
16508
|
+
declaredThisBoot: boolean()
|
|
16509
|
+
});
|
|
16510
|
+
/** One declared record kind (D881) as System -> Data shows it. */
|
|
16511
|
+
var StorageKindSchema = object({
|
|
16512
|
+
owner: string(),
|
|
16513
|
+
kind: string(),
|
|
16514
|
+
database: _enum(["settings", "events"]),
|
|
16515
|
+
class: string(),
|
|
16516
|
+
state: _enum([
|
|
16517
|
+
"declared",
|
|
16518
|
+
"orphaned",
|
|
16519
|
+
"dropped"
|
|
16520
|
+
]),
|
|
16521
|
+
/** `null` when the caller asked for no counts (`counts: false`). */
|
|
16522
|
+
rows: number().int().nonnegative().nullable(),
|
|
16523
|
+
/** Rows x the average size of a sample; null for an empty kind. */
|
|
16524
|
+
bytesEstimate: number().int().nonnegative().nullable(),
|
|
16525
|
+
writeTrigger: string(),
|
|
16526
|
+
retention: RecordRetentionSchema,
|
|
16527
|
+
/** `true` when the kind is an entry kind (the generic entries UI lists it). */
|
|
16528
|
+
entry: boolean(),
|
|
16529
|
+
/** The whole declaration, secret paths and entry descriptor included (the entries service builds its handle from it). */
|
|
16530
|
+
declaration: RecordKindDeclarationSchema
|
|
16531
|
+
});
|
|
16532
|
+
method(object({ ownerPrefix: string().min(1).optional() }), object({ tables: array(StorageTableSchema) }), { auth: "admin" }), method(object({
|
|
16533
|
+
collection: string().min(1),
|
|
16534
|
+
expectRows: number().int().nonnegative()
|
|
16535
|
+
}), object({
|
|
16536
|
+
dropped: literal(true),
|
|
16537
|
+
rows: number().int().nonnegative()
|
|
16538
|
+
}), {
|
|
16539
|
+
kind: "mutation",
|
|
16540
|
+
auth: "admin"
|
|
16541
|
+
}), method(object({
|
|
16542
|
+
owner: string().min(1).optional(),
|
|
16543
|
+
/** `false` skips the per-kind row count (a catalog read only). Default true. */
|
|
16544
|
+
counts: boolean().optional()
|
|
16545
|
+
}), object({ kinds: array(StorageKindSchema) }), { auth: "admin" }), method(RecordQueryInputSchema.extend({
|
|
16546
|
+
owner: string().min(1),
|
|
16547
|
+
kind: RecordKindNameSchema
|
|
16548
|
+
}), RecordQueryResultSchema, { auth: "admin" }), method(object({
|
|
16549
|
+
owner: string().min(1),
|
|
16550
|
+
kind: RecordKindNameSchema,
|
|
16551
|
+
records: array(RecordInputSchema).max(RECORD_BATCH_MAX),
|
|
16552
|
+
/** The LAST batch: the copy is complete, the boot guard stops asking. */
|
|
16553
|
+
complete: boolean().optional()
|
|
16554
|
+
}).refine((input) => input.records.length > 0 || input.complete === true, { message: "records must be non-empty unless complete is true" }), object({ adopted: number().int() }), {
|
|
16555
|
+
kind: "mutation",
|
|
16556
|
+
auth: "admin"
|
|
16557
|
+
}), method(object({
|
|
16558
|
+
collection: string().min(1),
|
|
16559
|
+
cursor: string().optional(),
|
|
16560
|
+
limit: number().int().min(1).max(1e3).optional()
|
|
16561
|
+
}), object({
|
|
16562
|
+
rows: array(object({
|
|
16563
|
+
id: string(),
|
|
16564
|
+
data: record(string(), unknown())
|
|
16565
|
+
})),
|
|
16566
|
+
nextCursor: string().nullable()
|
|
16567
|
+
}), { auth: "admin" }), method(object({ collection: string().min(1) }), object({ adopted: boolean() }), { auth: "admin" });
|
|
16568
|
+
/**
|
|
16569
|
+
* record-entries - the ONE admin surface for every list of user-created entries
|
|
16570
|
+
* (D881): notification targets, brokers, LLM profiles, anything an addon
|
|
16571
|
+
* declares as an ENTRY kind (`entry: { title }` in `defineRecordKinds`).
|
|
16572
|
+
*
|
|
16573
|
+
* The UI is generic. `listEntryKinds` hands it, per kind, the JSON Schema of
|
|
16574
|
+
* the entry body with `secret: true` on every credential field, so a password
|
|
16575
|
+
* field is derived from the schema and never from a name. `putEntry` takes the
|
|
16576
|
+
* redaction token for an untouched secret (the stored value is kept), a string
|
|
16577
|
+
* for a new one, and the clear instruction to remove one. A read never carries
|
|
16578
|
+
* a secret value, and a locked keychain refuses the write with
|
|
16579
|
+
* `records/secret-unavailable` instead of storing plaintext.
|
|
16580
|
+
*
|
|
16581
|
+
* Hub-only, served in-process (it acts for each entry's owner on the keychain).
|
|
16582
|
+
*/
|
|
16583
|
+
var EntryKindInfoSchema = object({
|
|
16584
|
+
owner: string(),
|
|
16585
|
+
kind: RecordKindNameSchema,
|
|
16586
|
+
title: string(),
|
|
16587
|
+
nameField: string(),
|
|
16588
|
+
/** JSON Schema of the body; `secret: true` marks a password field. */
|
|
16589
|
+
fields: record(string(), unknown()),
|
|
16590
|
+
secretPaths: array(string()),
|
|
16591
|
+
rows: number().int().nonnegative()
|
|
16592
|
+
});
|
|
16593
|
+
var EntryViewSchema = object({
|
|
16594
|
+
id: RecordIdSchema,
|
|
16595
|
+
name: string(),
|
|
16596
|
+
rev: number().int(),
|
|
16597
|
+
updatedAt: number(),
|
|
16598
|
+
/** Secret fields hold the redaction token. */
|
|
16599
|
+
data: RecordBodySchema
|
|
16600
|
+
});
|
|
16601
|
+
var EntryAddress = {
|
|
16602
|
+
owner: string().min(1),
|
|
16603
|
+
kind: RecordKindNameSchema
|
|
16604
|
+
};
|
|
16605
|
+
method(object({}), object({ kinds: array(EntryKindInfoSchema) }), { auth: "admin" }), method(object({ ...EntryAddress }), object({ entries: array(EntryViewSchema) }), { auth: "admin" }), method(object({
|
|
16606
|
+
...EntryAddress,
|
|
16607
|
+
id: RecordIdSchema.optional(),
|
|
16608
|
+
data: RecordBodySchema,
|
|
16609
|
+
ifRev: number().int().min(1).optional()
|
|
16610
|
+
}), object({
|
|
16611
|
+
id: string(),
|
|
16612
|
+
rev: number().int()
|
|
16613
|
+
}), {
|
|
16614
|
+
kind: "mutation",
|
|
16615
|
+
auth: "admin"
|
|
16616
|
+
}), method(object({
|
|
16617
|
+
...EntryAddress,
|
|
16618
|
+
id: RecordIdSchema
|
|
16619
|
+
}), object({ deleted: boolean() }), {
|
|
16620
|
+
kind: "mutation",
|
|
16621
|
+
auth: "admin"
|
|
16622
|
+
});
|
|
16623
|
+
/**
|
|
16020
16624
|
* `keychain` — the hub's encrypted store of secret values (D787).
|
|
16021
16625
|
*
|
|
16022
16626
|
* Settings blobs never hold a secret: they hold a marker
|
|
@@ -16557,6 +17161,16 @@ method(object({}), KeychainStatusSchema, { auth: "admin" }), method(object({}),
|
|
|
16557
17161
|
kind: "mutation",
|
|
16558
17162
|
auth: "admin",
|
|
16559
17163
|
caller: "required"
|
|
17164
|
+
}), method(object({
|
|
17165
|
+
ref: string().min(1),
|
|
17166
|
+
value: string().min(1)
|
|
17167
|
+
}), object({
|
|
17168
|
+
ref: string(),
|
|
17169
|
+
version: number().int()
|
|
17170
|
+
}), {
|
|
17171
|
+
kind: "mutation",
|
|
17172
|
+
auth: "admin",
|
|
17173
|
+
caller: "required"
|
|
16560
17174
|
}), method(object({ refs: array(string().min(1)).max(1e3) }), object({
|
|
16561
17175
|
deleted: array(string()).readonly(),
|
|
16562
17176
|
kept: array(object({
|
|
@@ -17078,7 +17692,11 @@ var deviceDiscoveryCapability = {
|
|
|
17078
17692
|
};
|
|
17079
17693
|
/**
|
|
17080
17694
|
* `device-adoption` — generic discovery + adoption surface,
|
|
17081
|
-
* system-scoped
|
|
17695
|
+
* system-scoped collection (one provider per integration addon), routed
|
|
17696
|
+
* by explicit `{ addonId }` on direct `deviceAdoption.*` calls — the same
|
|
17697
|
+
* pin model as `connection-test`. The admin UI keeps using
|
|
17698
|
+
* `deviceManager.adoption*` (which already threads `addonId`). The de-HA-ified
|
|
17699
|
+
* successor to `ha-discovery`:
|
|
17082
17700
|
* keyed by `integrationId` (the addon resolves integrationId → broker
|
|
17083
17701
|
* internally) rather than a connection-specific `brokerId`, and it
|
|
17084
17702
|
* REUSES the shared `DiscoveredChildDevice` candidate type from
|
|
@@ -39331,6 +39949,9 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, {
|
|
|
39331
39949
|
}), _void(), { kind: "mutation" }), method(object({}), array(LlmProfileKindDescriptorSchema)), method(object({}), array(LlmProfileSchema)), method(object({ profile: LlmProfileSchema }), LlmProfileSchema, {
|
|
39332
39950
|
kind: "mutation",
|
|
39333
39951
|
auth: "admin"
|
|
39952
|
+
}), method(RawSecretMigrationInputSchema, RawSecretMigrationReportSchema, {
|
|
39953
|
+
kind: "mutation",
|
|
39954
|
+
auth: "admin"
|
|
39334
39955
|
}), method(ProfileRefInputSchema, _void(), {
|
|
39335
39956
|
kind: "mutation",
|
|
39336
39957
|
auth: "admin"
|
|
@@ -41406,6 +42027,9 @@ var NcSystemEventKindSchema = _enum([
|
|
|
41406
42027
|
"server-updated",
|
|
41407
42028
|
"export-completed",
|
|
41408
42029
|
"backup-completed",
|
|
42030
|
+
"alert-critical",
|
|
42031
|
+
"alert-error",
|
|
42032
|
+
"alert-critical-resolved",
|
|
41409
42033
|
"camera-online",
|
|
41410
42034
|
"camera-offline",
|
|
41411
42035
|
"camera-disabled",
|
|
@@ -49840,6 +50464,41 @@ var ServerRollbackInfoSchema = object({
|
|
|
49840
50464
|
atMs: number(),
|
|
49841
50465
|
reason: string()
|
|
49842
50466
|
});
|
|
50467
|
+
/**
|
|
50468
|
+
* The runner boot check (D877): the runners this node PLANNED (hub: one per
|
|
50469
|
+
* `resolveRunnerId` over its forked addons; agent: the runners its process
|
|
50470
|
+
* service holds, because only the hub plans) against the states the process
|
|
50471
|
+
* service reports. Kept in memory, recomputed by the same one-shot check after
|
|
50472
|
+
* every boot, served on `getServerPackageStatus`.
|
|
50473
|
+
*
|
|
50474
|
+
* `failed` is the D6 breaker's terminal state, `refused` a deterministic Init
|
|
50475
|
+
* refusal (an addon that said "I will not start, and here is why"), `missing` a
|
|
50476
|
+
* planned runner the process service has no entry for.
|
|
50477
|
+
*/
|
|
50478
|
+
var RunnerRefusalSchema = object({
|
|
50479
|
+
runnerId: string(),
|
|
50480
|
+
addonIds: array(string()),
|
|
50481
|
+
reason: string()
|
|
50482
|
+
});
|
|
50483
|
+
var RunnerBootCheckSchema = object({
|
|
50484
|
+
checkedAtMs: number(),
|
|
50485
|
+
/** Runners planned for this node. */
|
|
50486
|
+
expected: number(),
|
|
50487
|
+
/** Planned runners whose process is `running`. */
|
|
50488
|
+
running: number(),
|
|
50489
|
+
failed: array(string()),
|
|
50490
|
+
refused: array(RunnerRefusalSchema),
|
|
50491
|
+
missing: array(string()),
|
|
50492
|
+
/**
|
|
50493
|
+
* Runners still on their way: `starting`, or `crashed` waiting on a backoff
|
|
50494
|
+
* respawn. The check is FINAL only when this is empty; until then nothing is
|
|
50495
|
+
* pushed and the verdict is re-evaluated on the next runner state change.
|
|
50496
|
+
* Optional for version skew (absent = settled).
|
|
50497
|
+
*/
|
|
50498
|
+
pending: array(string()).optional(),
|
|
50499
|
+
/** True when the plan is the hub's (`missing` is then meaningful); false on an agent. */
|
|
50500
|
+
planKnown: boolean()
|
|
50501
|
+
});
|
|
49843
50502
|
var ServerPackageStatusSchema = object({
|
|
49844
50503
|
/** Root package name (`@camstack/server` on the hub). */
|
|
49845
50504
|
packageName: string(),
|
|
@@ -49902,7 +50561,14 @@ var ServerPackageStatusSchema = object({
|
|
|
49902
50561
|
* for version skew: an older provider's payload simply omits it, and an
|
|
49903
50562
|
* absent wrapper is unknown — never `native`.
|
|
49904
50563
|
*/
|
|
49905
|
-
wrapper: WrapperIdentitySchema.optional()
|
|
50564
|
+
wrapper: WrapperIdentitySchema.optional(),
|
|
50565
|
+
/**
|
|
50566
|
+
* What this node PLANNED to run against what its process service reports
|
|
50567
|
+
* (D877). Absent until the one-shot boot check has run (~60 s after boot) and
|
|
50568
|
+
* on a provider that predates it. Absent is "not checked yet", never "all
|
|
50569
|
+
* well": a consumer that needs the answer treats it as pending.
|
|
50570
|
+
*/
|
|
50571
|
+
runners: RunnerBootCheckSchema.optional()
|
|
49906
50572
|
});
|
|
49907
50573
|
var ServerUpdateCheckResultSchema = object({
|
|
49908
50574
|
packageName: string(),
|
|
@@ -49953,6 +50619,13 @@ var ServerUpdateOutcomeSchema = _enum([
|
|
|
49953
50619
|
"refused",
|
|
49954
50620
|
"failed"
|
|
49955
50621
|
]);
|
|
50622
|
+
/** One addon the pre-flight found the target version would refuse (D877). */
|
|
50623
|
+
var UpdateBlockerSchema = object({
|
|
50624
|
+
addonId: string(),
|
|
50625
|
+
reason: string(),
|
|
50626
|
+
/** What the operator does about it. */
|
|
50627
|
+
remedy: string()
|
|
50628
|
+
});
|
|
49956
50629
|
var ServerUpdateActionResultSchema = object({
|
|
49957
50630
|
accepted: boolean(),
|
|
49958
50631
|
targetVersion: string().nullable(),
|
|
@@ -49970,14 +50643,27 @@ var ServerUpdateActionResultSchema = object({
|
|
|
49970
50643
|
* The failure itself, verbatim enough to act on (the npm output for a
|
|
49971
50644
|
* staging install). Non-null only for `failed`.
|
|
49972
50645
|
*/
|
|
49973
|
-
error: string().nullable().optional()
|
|
50646
|
+
error: string().nullable().optional(),
|
|
50647
|
+
/**
|
|
50648
|
+
* The addons the target version would refuse to start on this node's live
|
|
50649
|
+
* store (D877), present when the pre-flight refused the update
|
|
50650
|
+
* (`reason: 'addon-would-refuse'`). Optional for version skew.
|
|
50651
|
+
*/
|
|
50652
|
+
blockers: array(UpdateBlockerSchema).optional()
|
|
49974
50653
|
});
|
|
49975
50654
|
method(_void(), ServerPackageStatusSchema, { auth: "admin" }), method(_void(), ServerUpdateCheckResultSchema, {
|
|
49976
50655
|
kind: "mutation",
|
|
49977
50656
|
auth: "admin"
|
|
49978
|
-
}), method(object({
|
|
49979
|
-
/** Explicit target version; omitted = latest from the registry. */
|
|
49980
|
-
version: string().optional()
|
|
50657
|
+
}), method(object({
|
|
50658
|
+
/** Explicit target version; omitted = latest from the registry. */
|
|
50659
|
+
version: string().optional(),
|
|
50660
|
+
/**
|
|
50661
|
+
* Apply even though the pre-flight (D877) found addons the target would
|
|
50662
|
+
* refuse to start. Off by default: those addons stay down until the
|
|
50663
|
+
* remedy is run, which is the incident this gate exists to prevent.
|
|
50664
|
+
*/
|
|
50665
|
+
acknowledgeRefusals: boolean().optional()
|
|
50666
|
+
}), ServerUpdateActionResultSchema, {
|
|
49981
50667
|
kind: "mutation",
|
|
49982
50668
|
auth: "admin",
|
|
49983
50669
|
timeoutMs: 16 * 6e4
|
|
@@ -50420,7 +51106,10 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
|
|
|
50420
51106
|
}), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
50421
51107
|
kind: "mutation",
|
|
50422
51108
|
auth: "admin"
|
|
50423
|
-
}), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({
|
|
51109
|
+
}), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({ locationIds: array(string()).readonly() }), object({
|
|
51110
|
+
clear: boolean(),
|
|
51111
|
+
repointLocationId: string().optional()
|
|
51112
|
+
}), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
|
|
50424
51113
|
kind: "mutation",
|
|
50425
51114
|
auth: "admin"
|
|
50426
51115
|
}), method(StorageCleanupInputSchema, object({ jobId: string() }), {
|
|
@@ -52423,7 +53112,9 @@ var ManifestShapeSchema = object({
|
|
|
52423
53112
|
var AddonProcessSchema = object({
|
|
52424
53113
|
pid: number().optional(),
|
|
52425
53114
|
mode: string(),
|
|
52426
|
-
state: string()
|
|
53115
|
+
state: string(),
|
|
53116
|
+
/** Why the runner is `refused` (an addon's own words), when it is (D877). */
|
|
53117
|
+
reason: string().optional()
|
|
52427
53118
|
});
|
|
52428
53119
|
/**
|
|
52429
53120
|
* Per-addon health snapshot from the kernel's AddonHealthMonitor.
|
|
@@ -53191,7 +53882,8 @@ var batteryCapability = {
|
|
|
53191
53882
|
DeviceType.Button,
|
|
53192
53883
|
DeviceType.Switch,
|
|
53193
53884
|
DeviceType.PetFeeder,
|
|
53194
|
-
DeviceType.Container
|
|
53885
|
+
DeviceType.Container,
|
|
53886
|
+
DeviceType.Thermostat
|
|
53195
53887
|
],
|
|
53196
53888
|
methods: {
|
|
53197
53889
|
/**
|
|
@@ -53829,6 +54521,12 @@ var ClimateControlStatusSchema = object({
|
|
|
53829
54521
|
/** Horizontal louver swing on/off. Null when the device has no
|
|
53830
54522
|
* horizontal swing surface (gate with `DeviceFeature.ClimateSwingHorizontal`). */
|
|
53831
54523
|
swingHorizontal: boolean().nullable(),
|
|
54524
|
+
/** Lowest setpoint the device accepts, Celsius. Absent / null = not reported. */
|
|
54525
|
+
minTemp: number().nullable().optional(),
|
|
54526
|
+
/** Highest setpoint the device accepts, Celsius. Absent / null = not reported. */
|
|
54527
|
+
maxTemp: number().nullable().optional(),
|
|
54528
|
+
/** Setpoint granularity, Celsius (0.5, 1). Absent / null = not reported. */
|
|
54529
|
+
tempStep: number().positive().nullable().optional(),
|
|
53832
54530
|
/** Ms epoch when the slice was last updated (push or command). */
|
|
53833
54531
|
lastFetchedAt: number()
|
|
53834
54532
|
});
|
|
@@ -54675,6 +55373,294 @@ onStatusChanged: { data: object({
|
|
|
54675
55373
|
* whether persisting is worth a SQLite commit. */
|
|
54676
55374
|
volatileStateFields: ["lastChangedAt"]
|
|
54677
55375
|
};
|
|
55376
|
+
/**
|
|
55377
|
+
* Smart-dishwasher cap — program lifecycle, door / remote-start gates,
|
|
55378
|
+
* consumable levels (salt, rinse aid) and common program options.
|
|
55379
|
+
*
|
|
55380
|
+
* Sources: native Bosch Home Connect (`dishwasher` device type). Reusable
|
|
55381
|
+
* by any integration that exposes the same program / option surface.
|
|
55382
|
+
*
|
|
55383
|
+
* `kind: 'poll'` — cloud REST APIs typically have no push channel; the
|
|
55384
|
+
* provider refreshes the slice on an interval and eagerly after commands.
|
|
55385
|
+
*
|
|
55386
|
+
* UNKNOWN IS NOT OFF. Every field the appliance reports separately is
|
|
55387
|
+
* nullable: `null` means "not known right now" (the appliance has not said,
|
|
55388
|
+
* the link is down, or the description does not carry it) and is never
|
|
55389
|
+
* rendered or exported as `false` / `0`. `availability` says why.
|
|
55390
|
+
*/
|
|
55391
|
+
var DishwasherStateSchema = _enum([
|
|
55392
|
+
"idle",
|
|
55393
|
+
"running",
|
|
55394
|
+
"paused",
|
|
55395
|
+
"finished",
|
|
55396
|
+
"error",
|
|
55397
|
+
"unavailable"
|
|
55398
|
+
]);
|
|
55399
|
+
/**
|
|
55400
|
+
* The appliance's own operation state, uncollapsed. `state` above is the coarse
|
|
55401
|
+
* view for compact surfaces; this is what the appliance said.
|
|
55402
|
+
*/
|
|
55403
|
+
var DishwasherOperationStateSchema = _enum([
|
|
55404
|
+
"Inactive",
|
|
55405
|
+
"Ready",
|
|
55406
|
+
"DelayedStart",
|
|
55407
|
+
"Run",
|
|
55408
|
+
"Pause",
|
|
55409
|
+
"ActionRequired",
|
|
55410
|
+
"Finished",
|
|
55411
|
+
"Error",
|
|
55412
|
+
"Aborting"
|
|
55413
|
+
]);
|
|
55414
|
+
/**
|
|
55415
|
+
* Why fields may be `null`:
|
|
55416
|
+
* - `available` — the link is up and the description is loaded;
|
|
55417
|
+
* - `offline` — the local link is down (values are unknown, not last-known);
|
|
55418
|
+
* - `description-missing` — the link is up but the appliance's description could not
|
|
55419
|
+
* be loaded, so its values cannot be decoded.
|
|
55420
|
+
*/
|
|
55421
|
+
var DishwasherAvailabilitySchema = _enum([
|
|
55422
|
+
"available",
|
|
55423
|
+
"offline",
|
|
55424
|
+
"description-missing"
|
|
55425
|
+
]);
|
|
55426
|
+
var DishwasherConsumableLevelSchema = _enum([
|
|
55427
|
+
"ok",
|
|
55428
|
+
"low",
|
|
55429
|
+
"empty"
|
|
55430
|
+
]);
|
|
55431
|
+
var DishwasherStatusSchema = object({
|
|
55432
|
+
availability: DishwasherAvailabilitySchema,
|
|
55433
|
+
/** Coarse state for compact surfaces; `unavailable` whenever the appliance state is not known. */
|
|
55434
|
+
state: DishwasherStateSchema,
|
|
55435
|
+
/** The appliance's operation state as reported; null when not known. */
|
|
55436
|
+
operationState: DishwasherOperationStateSchema.nullable(),
|
|
55437
|
+
/** Feature key of the ACTIVE (running) program, or null when none runs / not known. */
|
|
55438
|
+
program: string().nullable(),
|
|
55439
|
+
/** Feature key of the SELECTED program (what Start would run), or null when none / not known. */
|
|
55440
|
+
selectedProgram: string().nullable(),
|
|
55441
|
+
/** Feature keys of the programs the appliance currently offers — drives the UI selector. */
|
|
55442
|
+
availablePrograms: array(string()),
|
|
55443
|
+
/** Seconds remaining on the active cycle, or null when not running / not known. */
|
|
55444
|
+
remainingSeconds: number().int().nonnegative().nullable(),
|
|
55445
|
+
/** Seconds the delayed start is set to (time until the cycle starts), or null. */
|
|
55446
|
+
delayedStartSeconds: number().int().nonnegative().nullable(),
|
|
55447
|
+
/** Cycle completion 0..100, or null when not applicable. */
|
|
55448
|
+
progressPercent: number().min(0).max(100).nullable(),
|
|
55449
|
+
/** True when the door is reported open; null when the door state is not known. */
|
|
55450
|
+
doorOpen: boolean().nullable(),
|
|
55451
|
+
/** True when the door is latched (locked) during a cycle; null when not reported. */
|
|
55452
|
+
doorLocked: boolean().nullable(),
|
|
55453
|
+
/** True when remote start is allowed (door closed, power on, etc.); null when not known. */
|
|
55454
|
+
remoteStartAllowed: boolean().nullable(),
|
|
55455
|
+
/** True when the appliance accepts remote control now; null when not known. */
|
|
55456
|
+
remoteControlActive: boolean().nullable(),
|
|
55457
|
+
/** True while somebody operates the appliance at its panel; null when not reported. */
|
|
55458
|
+
localControlActive: boolean().nullable(),
|
|
55459
|
+
/** Main power / switched-on state; null when not known. */
|
|
55460
|
+
powerOn: boolean().nullable(),
|
|
55461
|
+
/** The raw power state (`On`, `Off`, `Standby`, …); null when not known. */
|
|
55462
|
+
powerState: string().nullable(),
|
|
55463
|
+
saltLevel: DishwasherConsumableLevelSchema.nullable(),
|
|
55464
|
+
rinseAidLevel: DishwasherConsumableLevelSchema.nullable(),
|
|
55465
|
+
/** Option states: null when the appliance does not expose the option or has not said. */
|
|
55466
|
+
halfLoad: boolean().nullable(),
|
|
55467
|
+
hygienePlus: boolean().nullable(),
|
|
55468
|
+
/** Extra dry option when the appliance exposes it. */
|
|
55469
|
+
extraDry: boolean().nullable(),
|
|
55470
|
+
/** Intensive zone (lower basket) when the appliance exposes it. */
|
|
55471
|
+
intensiveZone: boolean().nullable(),
|
|
55472
|
+
/** VarioSpeed / VarioSpeed+ when the appliance exposes it. */
|
|
55473
|
+
varioSpeedPlus: boolean().nullable(),
|
|
55474
|
+
/** Child lock (controls disabled on the appliance); null when not known. */
|
|
55475
|
+
childLock: boolean().nullable(),
|
|
55476
|
+
/** Feature keys of the events currently raised (salt low, rinse aid low, program finished, …). */
|
|
55477
|
+
activeEvents: array(string()),
|
|
55478
|
+
/** Numeric error code when the appliance reports one; null otherwise. */
|
|
55479
|
+
errorCode: number().nullable(),
|
|
55480
|
+
/** Name of the raised alert-level event while the appliance is in error; null otherwise. */
|
|
55481
|
+
errorLabel: string().nullable(),
|
|
55482
|
+
/** Ms epoch of the last value received from the appliance; 0 = never. */
|
|
55483
|
+
lastFetchedAt: number()
|
|
55484
|
+
});
|
|
55485
|
+
var DeviceIdSchema = number().int().nonnegative();
|
|
55486
|
+
/** A value a program option or setting can take. */
|
|
55487
|
+
var DishwasherValueSchema = union([
|
|
55488
|
+
boolean(),
|
|
55489
|
+
string(),
|
|
55490
|
+
number()
|
|
55491
|
+
]);
|
|
55492
|
+
var DishwasherAccessSchema = _enum([
|
|
55493
|
+
"none",
|
|
55494
|
+
"read",
|
|
55495
|
+
"readWrite",
|
|
55496
|
+
"writeOnly",
|
|
55497
|
+
"readStatic"
|
|
55498
|
+
]);
|
|
55499
|
+
/**
|
|
55500
|
+
* One option or setting the appliance declares, with the constraints its description
|
|
55501
|
+
* gives. A `readWrite` descriptor that is `available` is what `setOption` accepts.
|
|
55502
|
+
*/
|
|
55503
|
+
var DishwasherOptionDescriptorSchema = object({
|
|
55504
|
+
/** Feature key (`Dishcare.Dishwasher.Option.ExtraDry`). */
|
|
55505
|
+
key: string(),
|
|
55506
|
+
/** Last segment of the key, for display. */
|
|
55507
|
+
name: string(),
|
|
55508
|
+
type: _enum([
|
|
55509
|
+
"boolean",
|
|
55510
|
+
"number",
|
|
55511
|
+
"enum",
|
|
55512
|
+
"string"
|
|
55513
|
+
]),
|
|
55514
|
+
access: DishwasherAccessSchema,
|
|
55515
|
+
/** The appliance reports this entity as currently available. */
|
|
55516
|
+
available: boolean(),
|
|
55517
|
+
/** Unit the description declares for a number; null when it declares none. */
|
|
55518
|
+
unit: string().nullable(),
|
|
55519
|
+
min: number().nullable(),
|
|
55520
|
+
max: number().nullable(),
|
|
55521
|
+
step: number().nullable(),
|
|
55522
|
+
/** Allowed members of an enum; null for other types. */
|
|
55523
|
+
enumValues: array(string()).nullable(),
|
|
55524
|
+
defaultValue: DishwasherValueSchema.nullable()
|
|
55525
|
+
});
|
|
55526
|
+
var DishwasherProgramSchema = object({
|
|
55527
|
+
/** Feature key (`Dishcare.Dishwasher.Program.Eco50`) — what `setProgram` / `start` take. */
|
|
55528
|
+
key: string(),
|
|
55529
|
+
name: string(),
|
|
55530
|
+
/** The appliance currently offers this program. */
|
|
55531
|
+
available: boolean(),
|
|
55532
|
+
/** The options this program lists, with the program-level access / availability / default. */
|
|
55533
|
+
options: array(DishwasherOptionDescriptorSchema)
|
|
55534
|
+
});
|
|
55535
|
+
var DishwasherOptionsSchema = object({
|
|
55536
|
+
availability: DishwasherAvailabilitySchema,
|
|
55537
|
+
/** What the appliance can be told to do, from the commands its description declares. */
|
|
55538
|
+
supportsStart: boolean(),
|
|
55539
|
+
supportsPause: boolean(),
|
|
55540
|
+
supportsResume: boolean(),
|
|
55541
|
+
supportsStop: boolean(),
|
|
55542
|
+
supportsPower: boolean(),
|
|
55543
|
+
/** Every program the description lists, with its options. */
|
|
55544
|
+
programs: array(DishwasherProgramSchema),
|
|
55545
|
+
/** Every option and setting entity the description lists (programs reference these by key). */
|
|
55546
|
+
options: array(DishwasherOptionDescriptorSchema)
|
|
55547
|
+
});
|
|
55548
|
+
var dishwasherCapability = {
|
|
55549
|
+
name: "dishwasher",
|
|
55550
|
+
scope: "device",
|
|
55551
|
+
deviceNative: true,
|
|
55552
|
+
mode: "singleton",
|
|
55553
|
+
deviceTypes: [DeviceType.Dishwasher],
|
|
55554
|
+
methods: {
|
|
55555
|
+
/**
|
|
55556
|
+
* Start a program. Without `program` the selected one starts. `options` are
|
|
55557
|
+
* option feature keys; each is checked against the program's constraints.
|
|
55558
|
+
*/
|
|
55559
|
+
start: method(object({
|
|
55560
|
+
deviceId: DeviceIdSchema,
|
|
55561
|
+
program: string().min(1).optional(),
|
|
55562
|
+
options: record(string(), DishwasherValueSchema).optional()
|
|
55563
|
+
}), _void(), {
|
|
55564
|
+
kind: "mutation",
|
|
55565
|
+
auth: "protected"
|
|
55566
|
+
}),
|
|
55567
|
+
pause: method(object({ deviceId: DeviceIdSchema }), _void(), {
|
|
55568
|
+
kind: "mutation",
|
|
55569
|
+
auth: "protected"
|
|
55570
|
+
}),
|
|
55571
|
+
resume: method(object({ deviceId: DeviceIdSchema }), _void(), {
|
|
55572
|
+
kind: "mutation",
|
|
55573
|
+
auth: "protected"
|
|
55574
|
+
}),
|
|
55575
|
+
stop: method(object({ deviceId: DeviceIdSchema }), _void(), {
|
|
55576
|
+
kind: "mutation",
|
|
55577
|
+
auth: "protected"
|
|
55578
|
+
}),
|
|
55579
|
+
/** Select (not start) a program; refused when the appliance does not offer it. */
|
|
55580
|
+
setProgram: method(object({
|
|
55581
|
+
deviceId: DeviceIdSchema,
|
|
55582
|
+
program: string().min(1)
|
|
55583
|
+
}), _void(), {
|
|
55584
|
+
kind: "mutation",
|
|
55585
|
+
auth: "protected"
|
|
55586
|
+
}),
|
|
55587
|
+
setPower: method(object({
|
|
55588
|
+
deviceId: DeviceIdSchema,
|
|
55589
|
+
on: boolean()
|
|
55590
|
+
}), _void(), {
|
|
55591
|
+
kind: "mutation",
|
|
55592
|
+
auth: "protected"
|
|
55593
|
+
}),
|
|
55594
|
+
setHalfLoad: method(object({
|
|
55595
|
+
deviceId: DeviceIdSchema,
|
|
55596
|
+
on: boolean()
|
|
55597
|
+
}), _void(), {
|
|
55598
|
+
kind: "mutation",
|
|
55599
|
+
auth: "protected"
|
|
55600
|
+
}),
|
|
55601
|
+
setHygienePlus: method(object({
|
|
55602
|
+
deviceId: DeviceIdSchema,
|
|
55603
|
+
on: boolean()
|
|
55604
|
+
}), _void(), {
|
|
55605
|
+
kind: "mutation",
|
|
55606
|
+
auth: "protected"
|
|
55607
|
+
}),
|
|
55608
|
+
setExtraDry: method(object({
|
|
55609
|
+
deviceId: DeviceIdSchema,
|
|
55610
|
+
on: boolean()
|
|
55611
|
+
}), _void(), {
|
|
55612
|
+
kind: "mutation",
|
|
55613
|
+
auth: "protected"
|
|
55614
|
+
}),
|
|
55615
|
+
setIntensiveZone: method(object({
|
|
55616
|
+
deviceId: DeviceIdSchema,
|
|
55617
|
+
on: boolean()
|
|
55618
|
+
}), _void(), {
|
|
55619
|
+
kind: "mutation",
|
|
55620
|
+
auth: "protected"
|
|
55621
|
+
}),
|
|
55622
|
+
setVarioSpeedPlus: method(object({
|
|
55623
|
+
deviceId: DeviceIdSchema,
|
|
55624
|
+
on: boolean()
|
|
55625
|
+
}), _void(), {
|
|
55626
|
+
kind: "mutation",
|
|
55627
|
+
auth: "protected"
|
|
55628
|
+
}),
|
|
55629
|
+
setChildLock: method(object({
|
|
55630
|
+
deviceId: DeviceIdSchema,
|
|
55631
|
+
on: boolean()
|
|
55632
|
+
}), _void(), {
|
|
55633
|
+
kind: "mutation",
|
|
55634
|
+
auth: "protected"
|
|
55635
|
+
}),
|
|
55636
|
+
/**
|
|
55637
|
+
* Write any option or setting by feature key. Refused when the description does
|
|
55638
|
+
* not list it, it is not writable or not available now, or the value is outside
|
|
55639
|
+
* its declared range / members.
|
|
55640
|
+
*/
|
|
55641
|
+
setOption: method(object({
|
|
55642
|
+
deviceId: DeviceIdSchema,
|
|
55643
|
+
key: string().min(1),
|
|
55644
|
+
value: DishwasherValueSchema
|
|
55645
|
+
}), _void(), {
|
|
55646
|
+
kind: "mutation",
|
|
55647
|
+
auth: "protected"
|
|
55648
|
+
}),
|
|
55649
|
+
/** What this appliance can do, from its own description — the UI is derived from it. */
|
|
55650
|
+
getOptions: method(object({ deviceId: DeviceIdSchema }), DishwasherOptionsSchema, { auth: "protected" })
|
|
55651
|
+
},
|
|
55652
|
+
status: {
|
|
55653
|
+
schema: DishwasherStatusSchema,
|
|
55654
|
+
kind: "poll"
|
|
55655
|
+
},
|
|
55656
|
+
runtimeState: DishwasherStatusSchema,
|
|
55657
|
+
durability: "session",
|
|
55658
|
+
history: { fields: { progressPercent: {
|
|
55659
|
+
kind: "gauge",
|
|
55660
|
+
unit: "%",
|
|
55661
|
+
deadband: 2
|
|
55662
|
+
} } }
|
|
55663
|
+
};
|
|
54678
55664
|
var DoorbellStatusSchema = object({
|
|
54679
55665
|
/** Ms epoch of the last press. null = never observed since this provider started. */
|
|
54680
55666
|
lastPressedAt: number().nullable(),
|
|
@@ -55477,6 +56463,32 @@ var gasCapability = {
|
|
|
55477
56463
|
* whether persisting is worth a SQLite commit. */
|
|
55478
56464
|
volatileStateFields: ["lastChangedAt"]
|
|
55479
56465
|
};
|
|
56466
|
+
var HeatingValveStatusSchema = object({
|
|
56467
|
+
/** Radiator valve opening 0 (closed) .. 100 (open). Null = not yet known. */
|
|
56468
|
+
position: number().min(0).max(100).nullable(),
|
|
56469
|
+
/** Ms epoch when the slice was last updated (push or poll). */
|
|
56470
|
+
lastFetchedAt: number()
|
|
56471
|
+
});
|
|
56472
|
+
var heatingValveCapability = {
|
|
56473
|
+
name: "heating-valve",
|
|
56474
|
+
scope: "device",
|
|
56475
|
+
deviceNative: true,
|
|
56476
|
+
mode: "singleton",
|
|
56477
|
+
deviceTypes: [DeviceType.Thermostat],
|
|
56478
|
+
methods: {},
|
|
56479
|
+
status: {
|
|
56480
|
+
schema: HeatingValveStatusSchema,
|
|
56481
|
+
kind: "push"
|
|
56482
|
+
},
|
|
56483
|
+
runtimeState: HeatingValveStatusSchema,
|
|
56484
|
+
durability: "session",
|
|
56485
|
+
history: { fields: { position: {
|
|
56486
|
+
kind: "gauge",
|
|
56487
|
+
unit: "%",
|
|
56488
|
+
deadband: 1
|
|
56489
|
+
} } },
|
|
56490
|
+
volatileStateFields: ["lastFetchedAt"]
|
|
56491
|
+
};
|
|
55480
56492
|
/**
|
|
55481
56493
|
* Humidifier / dehumidifier cap. Models HA `humidifier.*` entities —
|
|
55482
56494
|
* an on/off actuator with an optional target-humidity setpoint and an
|
|
@@ -56609,7 +57621,19 @@ var TlsStatusSchema = object({
|
|
|
56609
57621
|
sans: array(string()),
|
|
56610
57622
|
caCertPem: string().nullable(),
|
|
56611
57623
|
reissueError: string().nullable(),
|
|
56612
|
-
restartRequired: boolean()
|
|
57624
|
+
restartRequired: boolean(),
|
|
57625
|
+
/** An uploaded certificate is served but no CA is kept for it and it is not publicly signed (D873). */
|
|
57626
|
+
caMissing: boolean(),
|
|
57627
|
+
/** Does the hub's own generated CA carry a critical name constraint? `null` while it has none. */
|
|
57628
|
+
localCaConstrained: boolean().nullable(),
|
|
57629
|
+
/** ISO time the generated CA was replaced by a constrained one; devices must re-download it. */
|
|
57630
|
+
caReplacedAt: string().nullable(),
|
|
57631
|
+
/** The uploaded certificate kept on disk, selectable again after "Revert to generated". */
|
|
57632
|
+
storedUpload: object({
|
|
57633
|
+
leafFingerprintSha256: string(),
|
|
57634
|
+
validTo: string(),
|
|
57635
|
+
hasCa: boolean()
|
|
57636
|
+
}).nullable()
|
|
56613
57637
|
});
|
|
56614
57638
|
method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(object({
|
|
56615
57639
|
/**
|
|
@@ -56665,6 +57689,9 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
|
|
|
56665
57689
|
}), method(_void(), object({ pem: string() })), method(_void(), TlsStatusSchema, {
|
|
56666
57690
|
kind: "mutation",
|
|
56667
57691
|
auth: "admin"
|
|
57692
|
+
}), method(_void(), TlsStatusSchema, {
|
|
57693
|
+
kind: "mutation",
|
|
57694
|
+
auth: "admin"
|
|
56668
57695
|
});
|
|
56669
57696
|
var LockControlStatusSchema = object({
|
|
56670
57697
|
/** Lifecycle state of the lock. `jammed` means the motor reported
|
|
@@ -63158,7 +64185,11 @@ method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserI
|
|
|
63158
64185
|
kind: "mutation",
|
|
63159
64186
|
auth: "admin",
|
|
63160
64187
|
access: "delete"
|
|
63161
|
-
}), method(object({ userId: string() }), TotpStatusSchema, { auth: "admin" }), method(
|
|
64188
|
+
}), method(object({ userId: string() }), TotpStatusSchema, { auth: "admin" }), method(RawSecretMigrationInputSchema, RawSecretMigrationReportSchema, {
|
|
64189
|
+
kind: "mutation",
|
|
64190
|
+
auth: "admin",
|
|
64191
|
+
access: "create"
|
|
64192
|
+
}), method(object({
|
|
63162
64193
|
userId: string(),
|
|
63163
64194
|
code: string()
|
|
63164
64195
|
}), object({ valid: boolean() }), {
|
|
@@ -64878,6 +65909,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
|
|
|
64878
65909
|
dayNight: dayNightCapability,
|
|
64879
65910
|
deviceDiscovery: deviceDiscoveryCapability,
|
|
64880
65911
|
deviceStatus: deviceStatusCapability,
|
|
65912
|
+
dishwasher: dishwasherCapability,
|
|
64881
65913
|
doorbell: doorbellCapability,
|
|
64882
65914
|
enumSensor: enumSensorCapability,
|
|
64883
65915
|
eventEmitter: eventEmitterCapability,
|
|
@@ -64885,6 +65917,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
|
|
|
64885
65917
|
featureProbe: featureProbeCapability,
|
|
64886
65918
|
flood: floodCapability,
|
|
64887
65919
|
gas: gasCapability,
|
|
65920
|
+
heatingValve: heatingValveCapability,
|
|
64888
65921
|
humidifier: humidifierCapability,
|
|
64889
65922
|
humiditySensor: humiditySensorCapability,
|
|
64890
65923
|
image: imageCapability,
|
|
@@ -64970,13 +66003,14 @@ var BaseDevice = class {
|
|
|
64970
66003
|
get state() {
|
|
64971
66004
|
if (!this._stateProxyCache) {
|
|
64972
66005
|
const cache = {};
|
|
64973
|
-
const handler = { get: (
|
|
66006
|
+
const handler = { get: (target, key) => {
|
|
64974
66007
|
const k = key;
|
|
64975
|
-
|
|
66008
|
+
const existing = Reflect.get(target, k);
|
|
66009
|
+
if (existing !== void 0) return existing;
|
|
64976
66010
|
const cap = DEVICE_LOCAL_STATE_CAPS[k];
|
|
64977
66011
|
if (!cap) return void 0;
|
|
64978
66012
|
const proxy = this.sliceProxy(cap);
|
|
64979
|
-
|
|
66013
|
+
Reflect.set(target, k, proxy);
|
|
64980
66014
|
return proxy;
|
|
64981
66015
|
} };
|
|
64982
66016
|
this._stateProxyCache = new Proxy(cache, handler);
|
|
@@ -65175,7 +66209,7 @@ var BaseDevice = class {
|
|
|
65175
66209
|
async updateSourceInfo(patch) {
|
|
65176
66210
|
const next = mergeSourceInfo(this.sourceInfo, patch);
|
|
65177
66211
|
this._sourceInfoCache = Object.freeze({ ...next });
|
|
65178
|
-
const action = this.ctx.api
|
|
66212
|
+
const action = this.ctx.api.deviceManager?.setMetadata;
|
|
65179
66213
|
if (action) try {
|
|
65180
66214
|
await action.mutate({
|
|
65181
66215
|
deviceId: this.id,
|
|
@@ -65210,7 +66244,7 @@ var BaseDevice = class {
|
|
|
65210
66244
|
* device boot on a meta refresh.
|
|
65211
66245
|
*/
|
|
65212
66246
|
async refreshFeatures() {
|
|
65213
|
-
const action = this.ctx.api
|
|
66247
|
+
const action = this.ctx.api.deviceManager?.registerDevice;
|
|
65214
66248
|
if (!action) return;
|
|
65215
66249
|
try {
|
|
65216
66250
|
await action.mutate({
|
|
@@ -65609,6 +66643,12 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
65609
66643
|
provider: this
|
|
65610
66644
|
}];
|
|
65611
66645
|
}
|
|
66646
|
+
/** Flatten `super.onInitialize()` whether it returned an array or an envelope. */
|
|
66647
|
+
providerRegistrationsFromSuper(result) {
|
|
66648
|
+
if (Array.isArray(result)) return result;
|
|
66649
|
+
if (result !== void 0 && result.providers !== void 0) return [...result.providers];
|
|
66650
|
+
return [];
|
|
66651
|
+
}
|
|
65612
66652
|
async onShutdown() {
|
|
65613
66653
|
this._restoreShuttingDown = true;
|
|
65614
66654
|
this.cancelRestoreRetries();
|
|
@@ -66135,7 +67175,7 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
66135
67175
|
return toDeviceSummary(device, this.addonId);
|
|
66136
67176
|
}
|
|
66137
67177
|
};
|
|
66138
|
-
DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Camera, DeviceType.Hub, DeviceType.Switch, DeviceType.Siren, DeviceType.Light, DeviceType.Fan, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder;
|
|
67178
|
+
DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Camera, DeviceType.Hub, DeviceType.Switch, DeviceType.Siren, DeviceType.Light, DeviceType.Fan, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.Dishwasher;
|
|
66139
67179
|
new Set(Object.values(DeviceType));
|
|
66140
67180
|
Object.freeze({
|
|
66141
67181
|
"accessories.getStatus": {
|
|
@@ -67284,6 +68324,12 @@ Object.freeze({
|
|
|
67284
68324
|
addonId: null,
|
|
67285
68325
|
access: "view"
|
|
67286
68326
|
},
|
|
68327
|
+
"coreBlocks.migrateRawSecrets": {
|
|
68328
|
+
capName: "core-blocks",
|
|
68329
|
+
capScope: "system",
|
|
68330
|
+
addonId: null,
|
|
68331
|
+
access: "create"
|
|
68332
|
+
},
|
|
67287
68333
|
"coreBlocks.restart": {
|
|
67288
68334
|
capName: "core-blocks",
|
|
67289
68335
|
capScope: "system",
|
|
@@ -68550,6 +69596,96 @@ Object.freeze({
|
|
|
68550
69596
|
addonId: null,
|
|
68551
69597
|
access: "view"
|
|
68552
69598
|
},
|
|
69599
|
+
"dishwasher.getOptions": {
|
|
69600
|
+
capName: "dishwasher",
|
|
69601
|
+
capScope: "device",
|
|
69602
|
+
addonId: null,
|
|
69603
|
+
access: "view"
|
|
69604
|
+
},
|
|
69605
|
+
"dishwasher.getStatus": {
|
|
69606
|
+
capName: "dishwasher",
|
|
69607
|
+
capScope: "device",
|
|
69608
|
+
addonId: null,
|
|
69609
|
+
access: "view"
|
|
69610
|
+
},
|
|
69611
|
+
"dishwasher.pause": {
|
|
69612
|
+
capName: "dishwasher",
|
|
69613
|
+
capScope: "device",
|
|
69614
|
+
addonId: null,
|
|
69615
|
+
access: "create"
|
|
69616
|
+
},
|
|
69617
|
+
"dishwasher.resume": {
|
|
69618
|
+
capName: "dishwasher",
|
|
69619
|
+
capScope: "device",
|
|
69620
|
+
addonId: null,
|
|
69621
|
+
access: "create"
|
|
69622
|
+
},
|
|
69623
|
+
"dishwasher.setChildLock": {
|
|
69624
|
+
capName: "dishwasher",
|
|
69625
|
+
capScope: "device",
|
|
69626
|
+
addonId: null,
|
|
69627
|
+
access: "create"
|
|
69628
|
+
},
|
|
69629
|
+
"dishwasher.setExtraDry": {
|
|
69630
|
+
capName: "dishwasher",
|
|
69631
|
+
capScope: "device",
|
|
69632
|
+
addonId: null,
|
|
69633
|
+
access: "create"
|
|
69634
|
+
},
|
|
69635
|
+
"dishwasher.setHalfLoad": {
|
|
69636
|
+
capName: "dishwasher",
|
|
69637
|
+
capScope: "device",
|
|
69638
|
+
addonId: null,
|
|
69639
|
+
access: "create"
|
|
69640
|
+
},
|
|
69641
|
+
"dishwasher.setHygienePlus": {
|
|
69642
|
+
capName: "dishwasher",
|
|
69643
|
+
capScope: "device",
|
|
69644
|
+
addonId: null,
|
|
69645
|
+
access: "create"
|
|
69646
|
+
},
|
|
69647
|
+
"dishwasher.setIntensiveZone": {
|
|
69648
|
+
capName: "dishwasher",
|
|
69649
|
+
capScope: "device",
|
|
69650
|
+
addonId: null,
|
|
69651
|
+
access: "create"
|
|
69652
|
+
},
|
|
69653
|
+
"dishwasher.setOption": {
|
|
69654
|
+
capName: "dishwasher",
|
|
69655
|
+
capScope: "device",
|
|
69656
|
+
addonId: null,
|
|
69657
|
+
access: "create"
|
|
69658
|
+
},
|
|
69659
|
+
"dishwasher.setPower": {
|
|
69660
|
+
capName: "dishwasher",
|
|
69661
|
+
capScope: "device",
|
|
69662
|
+
addonId: null,
|
|
69663
|
+
access: "create"
|
|
69664
|
+
},
|
|
69665
|
+
"dishwasher.setProgram": {
|
|
69666
|
+
capName: "dishwasher",
|
|
69667
|
+
capScope: "device",
|
|
69668
|
+
addonId: null,
|
|
69669
|
+
access: "create"
|
|
69670
|
+
},
|
|
69671
|
+
"dishwasher.setVarioSpeedPlus": {
|
|
69672
|
+
capName: "dishwasher",
|
|
69673
|
+
capScope: "device",
|
|
69674
|
+
addonId: null,
|
|
69675
|
+
access: "create"
|
|
69676
|
+
},
|
|
69677
|
+
"dishwasher.start": {
|
|
69678
|
+
capName: "dishwasher",
|
|
69679
|
+
capScope: "device",
|
|
69680
|
+
addonId: null,
|
|
69681
|
+
access: "create"
|
|
69682
|
+
},
|
|
69683
|
+
"dishwasher.stop": {
|
|
69684
|
+
capName: "dishwasher",
|
|
69685
|
+
capScope: "device",
|
|
69686
|
+
addonId: null,
|
|
69687
|
+
access: "create"
|
|
69688
|
+
},
|
|
68553
69689
|
"doorbell.getStatus": {
|
|
68554
69690
|
capName: "doorbell",
|
|
68555
69691
|
capScope: "device",
|
|
@@ -68760,6 +69896,12 @@ Object.freeze({
|
|
|
68760
69896
|
addonId: null,
|
|
68761
69897
|
access: "view"
|
|
68762
69898
|
},
|
|
69899
|
+
"heatingValve.getStatus": {
|
|
69900
|
+
capName: "heating-valve",
|
|
69901
|
+
capScope: "device",
|
|
69902
|
+
addonId: null,
|
|
69903
|
+
access: "view"
|
|
69904
|
+
},
|
|
68763
69905
|
"humidifier.getStatus": {
|
|
68764
69906
|
capName: "humidifier",
|
|
68765
69907
|
capScope: "device",
|
|
@@ -68970,6 +70112,12 @@ Object.freeze({
|
|
|
68970
70112
|
addonId: null,
|
|
68971
70113
|
access: "create"
|
|
68972
70114
|
},
|
|
70115
|
+
"keychainAdmin.importSecret": {
|
|
70116
|
+
capName: "keychain-admin",
|
|
70117
|
+
capScope: "system",
|
|
70118
|
+
addonId: null,
|
|
70119
|
+
access: "create"
|
|
70120
|
+
},
|
|
68973
70121
|
"keychainAdmin.listAudit": {
|
|
68974
70122
|
capName: "keychain-admin",
|
|
68975
70123
|
capScope: "system",
|
|
@@ -69138,6 +70286,12 @@ Object.freeze({
|
|
|
69138
70286
|
addonId: null,
|
|
69139
70287
|
access: "view"
|
|
69140
70288
|
},
|
|
70289
|
+
"llm.migrateRawSecrets": {
|
|
70290
|
+
capName: "llm",
|
|
70291
|
+
capScope: "system",
|
|
70292
|
+
addonId: null,
|
|
70293
|
+
access: "create"
|
|
70294
|
+
},
|
|
69141
70295
|
"llm.resolveModelRef": {
|
|
69142
70296
|
capName: "llm",
|
|
69143
70297
|
capScope: "system",
|
|
@@ -69366,6 +70520,12 @@ Object.freeze({
|
|
|
69366
70520
|
addonId: null,
|
|
69367
70521
|
access: "create"
|
|
69368
70522
|
},
|
|
70523
|
+
"localNetwork.useStoredUploadedCertificate": {
|
|
70524
|
+
capName: "local-network",
|
|
70525
|
+
capScope: "system",
|
|
70526
|
+
addonId: null,
|
|
70527
|
+
access: "create"
|
|
70528
|
+
},
|
|
69369
70529
|
"lockControl.getStatus": {
|
|
69370
70530
|
capName: "lock-control",
|
|
69371
70531
|
capScope: "device",
|
|
@@ -72018,6 +73178,30 @@ Object.freeze({
|
|
|
72018
73178
|
addonId: null,
|
|
72019
73179
|
access: "create"
|
|
72020
73180
|
},
|
|
73181
|
+
"recordEntries.deleteEntry": {
|
|
73182
|
+
capName: "record-entries",
|
|
73183
|
+
capScope: "system",
|
|
73184
|
+
addonId: null,
|
|
73185
|
+
access: "delete"
|
|
73186
|
+
},
|
|
73187
|
+
"recordEntries.listEntries": {
|
|
73188
|
+
capName: "record-entries",
|
|
73189
|
+
capScope: "system",
|
|
73190
|
+
addonId: null,
|
|
73191
|
+
access: "view"
|
|
73192
|
+
},
|
|
73193
|
+
"recordEntries.listEntryKinds": {
|
|
73194
|
+
capName: "record-entries",
|
|
73195
|
+
capScope: "system",
|
|
73196
|
+
addonId: null,
|
|
73197
|
+
access: "view"
|
|
73198
|
+
},
|
|
73199
|
+
"recordEntries.putEntry": {
|
|
73200
|
+
capName: "record-entries",
|
|
73201
|
+
capScope: "system",
|
|
73202
|
+
addonId: null,
|
|
73203
|
+
access: "create"
|
|
73204
|
+
},
|
|
72021
73205
|
"recording.getAvailability": {
|
|
72022
73206
|
capName: "recording",
|
|
72023
73207
|
capScope: "device",
|
|
@@ -72318,6 +73502,102 @@ Object.freeze({
|
|
|
72318
73502
|
addonId: null,
|
|
72319
73503
|
access: "view"
|
|
72320
73504
|
},
|
|
73505
|
+
"records.aggregate": {
|
|
73506
|
+
capName: "records",
|
|
73507
|
+
capScope: "system",
|
|
73508
|
+
addonId: null,
|
|
73509
|
+
access: "view"
|
|
73510
|
+
},
|
|
73511
|
+
"records.allocateId": {
|
|
73512
|
+
capName: "records",
|
|
73513
|
+
capScope: "system",
|
|
73514
|
+
addonId: null,
|
|
73515
|
+
access: "create"
|
|
73516
|
+
},
|
|
73517
|
+
"records.count": {
|
|
73518
|
+
capName: "records",
|
|
73519
|
+
capScope: "system",
|
|
73520
|
+
addonId: null,
|
|
73521
|
+
access: "view"
|
|
73522
|
+
},
|
|
73523
|
+
"records.declareKinds": {
|
|
73524
|
+
capName: "records",
|
|
73525
|
+
capScope: "system",
|
|
73526
|
+
addonId: null,
|
|
73527
|
+
access: "create"
|
|
73528
|
+
},
|
|
73529
|
+
"records.delete": {
|
|
73530
|
+
capName: "records",
|
|
73531
|
+
capScope: "system",
|
|
73532
|
+
addonId: null,
|
|
73533
|
+
access: "delete"
|
|
73534
|
+
},
|
|
73535
|
+
"records.deleteDevice": {
|
|
73536
|
+
capName: "records",
|
|
73537
|
+
capScope: "system",
|
|
73538
|
+
addonId: null,
|
|
73539
|
+
access: "delete"
|
|
73540
|
+
},
|
|
73541
|
+
"records.deleteMany": {
|
|
73542
|
+
capName: "records",
|
|
73543
|
+
capScope: "system",
|
|
73544
|
+
addonId: null,
|
|
73545
|
+
access: "delete"
|
|
73546
|
+
},
|
|
73547
|
+
"records.deleteWhere": {
|
|
73548
|
+
capName: "records",
|
|
73549
|
+
capScope: "system",
|
|
73550
|
+
addonId: null,
|
|
73551
|
+
access: "delete"
|
|
73552
|
+
},
|
|
73553
|
+
"records.get": {
|
|
73554
|
+
capName: "records",
|
|
73555
|
+
capScope: "system",
|
|
73556
|
+
addonId: null,
|
|
73557
|
+
access: "view"
|
|
73558
|
+
},
|
|
73559
|
+
"records.getMany": {
|
|
73560
|
+
capName: "records",
|
|
73561
|
+
capScope: "system",
|
|
73562
|
+
addonId: null,
|
|
73563
|
+
access: "view"
|
|
73564
|
+
},
|
|
73565
|
+
"records.histogram": {
|
|
73566
|
+
capName: "records",
|
|
73567
|
+
capScope: "system",
|
|
73568
|
+
addonId: null,
|
|
73569
|
+
access: "view"
|
|
73570
|
+
},
|
|
73571
|
+
"records.patch": {
|
|
73572
|
+
capName: "records",
|
|
73573
|
+
capScope: "system",
|
|
73574
|
+
addonId: null,
|
|
73575
|
+
access: "create"
|
|
73576
|
+
},
|
|
73577
|
+
"records.put": {
|
|
73578
|
+
capName: "records",
|
|
73579
|
+
capScope: "system",
|
|
73580
|
+
addonId: null,
|
|
73581
|
+
access: "create"
|
|
73582
|
+
},
|
|
73583
|
+
"records.putMany": {
|
|
73584
|
+
capName: "records",
|
|
73585
|
+
capScope: "system",
|
|
73586
|
+
addonId: null,
|
|
73587
|
+
access: "create"
|
|
73588
|
+
},
|
|
73589
|
+
"records.query": {
|
|
73590
|
+
capName: "records",
|
|
73591
|
+
capScope: "system",
|
|
73592
|
+
addonId: null,
|
|
73593
|
+
access: "view"
|
|
73594
|
+
},
|
|
73595
|
+
"records.secretRefs": {
|
|
73596
|
+
capName: "records",
|
|
73597
|
+
capScope: "system",
|
|
73598
|
+
addonId: null,
|
|
73599
|
+
access: "view"
|
|
73600
|
+
},
|
|
72321
73601
|
"sceneMonitor.captureReference": {
|
|
72322
73602
|
capName: "scene-monitor",
|
|
72323
73603
|
capScope: "device",
|
|
@@ -72750,6 +74030,48 @@ Object.freeze({
|
|
|
72750
74030
|
addonId: null,
|
|
72751
74031
|
access: "create"
|
|
72752
74032
|
},
|
|
74033
|
+
"storageAdmin.adoptRecords": {
|
|
74034
|
+
capName: "storage-admin",
|
|
74035
|
+
capScope: "system",
|
|
74036
|
+
addonId: null,
|
|
74037
|
+
access: "create"
|
|
74038
|
+
},
|
|
74039
|
+
"storageAdmin.dropCollection": {
|
|
74040
|
+
capName: "storage-admin",
|
|
74041
|
+
capScope: "system",
|
|
74042
|
+
addonId: null,
|
|
74043
|
+
access: "delete"
|
|
74044
|
+
},
|
|
74045
|
+
"storageAdmin.isAdoptedLegacyTable": {
|
|
74046
|
+
capName: "storage-admin",
|
|
74047
|
+
capScope: "system",
|
|
74048
|
+
addonId: null,
|
|
74049
|
+
access: "view"
|
|
74050
|
+
},
|
|
74051
|
+
"storageAdmin.listKinds": {
|
|
74052
|
+
capName: "storage-admin",
|
|
74053
|
+
capScope: "system",
|
|
74054
|
+
addonId: null,
|
|
74055
|
+
access: "view"
|
|
74056
|
+
},
|
|
74057
|
+
"storageAdmin.listTables": {
|
|
74058
|
+
capName: "storage-admin",
|
|
74059
|
+
capScope: "system",
|
|
74060
|
+
addonId: null,
|
|
74061
|
+
access: "view"
|
|
74062
|
+
},
|
|
74063
|
+
"storageAdmin.readLegacyCollection": {
|
|
74064
|
+
capName: "storage-admin",
|
|
74065
|
+
capScope: "system",
|
|
74066
|
+
addonId: null,
|
|
74067
|
+
access: "view"
|
|
74068
|
+
},
|
|
74069
|
+
"storageAdmin.readRecords": {
|
|
74070
|
+
capName: "storage-admin",
|
|
74071
|
+
capScope: "system",
|
|
74072
|
+
addonId: null,
|
|
74073
|
+
access: "view"
|
|
74074
|
+
},
|
|
72753
74075
|
"storageEvictable.evict": {
|
|
72754
74076
|
capName: "storage-evictable",
|
|
72755
74077
|
capScope: "system",
|
|
@@ -72798,6 +74120,12 @@ Object.freeze({
|
|
|
72798
74120
|
addonId: null,
|
|
72799
74121
|
access: "view"
|
|
72800
74122
|
},
|
|
74123
|
+
"storageMigration.moverClearance": {
|
|
74124
|
+
capName: "storage-migration",
|
|
74125
|
+
capScope: "system",
|
|
74126
|
+
addonId: null,
|
|
74127
|
+
access: "view"
|
|
74128
|
+
},
|
|
72801
74129
|
"storageMigration.movers": {
|
|
72802
74130
|
capName: "storage-migration",
|
|
72803
74131
|
capScope: "system",
|
|
@@ -73662,6 +74990,12 @@ Object.freeze({
|
|
|
73662
74990
|
addonId: null,
|
|
73663
74991
|
access: "view"
|
|
73664
74992
|
},
|
|
74993
|
+
"userManagement.migrateRawSecrets": {
|
|
74994
|
+
capName: "user-management",
|
|
74995
|
+
capScope: "system",
|
|
74996
|
+
addonId: null,
|
|
74997
|
+
access: "create"
|
|
74998
|
+
},
|
|
73665
74999
|
"userManagement.oauthExchangeCode": {
|
|
73666
75000
|
capName: "user-management",
|
|
73667
75001
|
capScope: "system",
|
|
@@ -74161,7 +75495,7 @@ Object.freeze({
|
|
|
74161
75495
|
access: "create"
|
|
74162
75496
|
}
|
|
74163
75497
|
});
|
|
74164
|
-
DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder;
|
|
75498
|
+
DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.Dishwasher;
|
|
74165
75499
|
DeviceFeature.BatteryOperated;
|
|
74166
75500
|
Object.freeze({
|
|
74167
75501
|
"accessories.getStatus": [{
|
|
@@ -74985,6 +76319,81 @@ Object.freeze({
|
|
|
74985
76319
|
form: "single",
|
|
74986
76320
|
optional: false
|
|
74987
76321
|
}],
|
|
76322
|
+
"dishwasher.getOptions": [{
|
|
76323
|
+
name: "deviceId",
|
|
76324
|
+
form: "single",
|
|
76325
|
+
optional: false
|
|
76326
|
+
}],
|
|
76327
|
+
"dishwasher.getStatus": [{
|
|
76328
|
+
name: "deviceId",
|
|
76329
|
+
form: "single",
|
|
76330
|
+
optional: false
|
|
76331
|
+
}],
|
|
76332
|
+
"dishwasher.pause": [{
|
|
76333
|
+
name: "deviceId",
|
|
76334
|
+
form: "single",
|
|
76335
|
+
optional: false
|
|
76336
|
+
}],
|
|
76337
|
+
"dishwasher.resume": [{
|
|
76338
|
+
name: "deviceId",
|
|
76339
|
+
form: "single",
|
|
76340
|
+
optional: false
|
|
76341
|
+
}],
|
|
76342
|
+
"dishwasher.setChildLock": [{
|
|
76343
|
+
name: "deviceId",
|
|
76344
|
+
form: "single",
|
|
76345
|
+
optional: false
|
|
76346
|
+
}],
|
|
76347
|
+
"dishwasher.setExtraDry": [{
|
|
76348
|
+
name: "deviceId",
|
|
76349
|
+
form: "single",
|
|
76350
|
+
optional: false
|
|
76351
|
+
}],
|
|
76352
|
+
"dishwasher.setHalfLoad": [{
|
|
76353
|
+
name: "deviceId",
|
|
76354
|
+
form: "single",
|
|
76355
|
+
optional: false
|
|
76356
|
+
}],
|
|
76357
|
+
"dishwasher.setHygienePlus": [{
|
|
76358
|
+
name: "deviceId",
|
|
76359
|
+
form: "single",
|
|
76360
|
+
optional: false
|
|
76361
|
+
}],
|
|
76362
|
+
"dishwasher.setIntensiveZone": [{
|
|
76363
|
+
name: "deviceId",
|
|
76364
|
+
form: "single",
|
|
76365
|
+
optional: false
|
|
76366
|
+
}],
|
|
76367
|
+
"dishwasher.setOption": [{
|
|
76368
|
+
name: "deviceId",
|
|
76369
|
+
form: "single",
|
|
76370
|
+
optional: false
|
|
76371
|
+
}],
|
|
76372
|
+
"dishwasher.setPower": [{
|
|
76373
|
+
name: "deviceId",
|
|
76374
|
+
form: "single",
|
|
76375
|
+
optional: false
|
|
76376
|
+
}],
|
|
76377
|
+
"dishwasher.setProgram": [{
|
|
76378
|
+
name: "deviceId",
|
|
76379
|
+
form: "single",
|
|
76380
|
+
optional: false
|
|
76381
|
+
}],
|
|
76382
|
+
"dishwasher.setVarioSpeedPlus": [{
|
|
76383
|
+
name: "deviceId",
|
|
76384
|
+
form: "single",
|
|
76385
|
+
optional: false
|
|
76386
|
+
}],
|
|
76387
|
+
"dishwasher.start": [{
|
|
76388
|
+
name: "deviceId",
|
|
76389
|
+
form: "single",
|
|
76390
|
+
optional: false
|
|
76391
|
+
}],
|
|
76392
|
+
"dishwasher.stop": [{
|
|
76393
|
+
name: "deviceId",
|
|
76394
|
+
form: "single",
|
|
76395
|
+
optional: false
|
|
76396
|
+
}],
|
|
74988
76397
|
"doorbell.getStatus": [{
|
|
74989
76398
|
name: "deviceId",
|
|
74990
76399
|
form: "single",
|
|
@@ -75054,6 +76463,11 @@ Object.freeze({
|
|
|
75054
76463
|
form: "single",
|
|
75055
76464
|
optional: false
|
|
75056
76465
|
}],
|
|
76466
|
+
"heatingValve.getStatus": [{
|
|
76467
|
+
name: "deviceId",
|
|
76468
|
+
form: "single",
|
|
76469
|
+
optional: false
|
|
76470
|
+
}],
|
|
75057
76471
|
"humidifier.getStatus": [{
|
|
75058
76472
|
name: "deviceId",
|
|
75059
76473
|
form: "single",
|
|
@@ -76338,6 +77752,37 @@ Object.freeze({
|
|
|
76338
77752
|
form: "single",
|
|
76339
77753
|
optional: false
|
|
76340
77754
|
}],
|
|
77755
|
+
"records.count": [{
|
|
77756
|
+
name: "deviceId",
|
|
77757
|
+
form: "single",
|
|
77758
|
+
optional: true
|
|
77759
|
+
}],
|
|
77760
|
+
"records.deleteDevice": [{
|
|
77761
|
+
name: "deviceId",
|
|
77762
|
+
form: "single",
|
|
77763
|
+
optional: false
|
|
77764
|
+
}],
|
|
77765
|
+
"records.deleteWhere": [{
|
|
77766
|
+
name: "deviceId",
|
|
77767
|
+
form: "single",
|
|
77768
|
+
optional: true
|
|
77769
|
+
}],
|
|
77770
|
+
"records.histogram": [{
|
|
77771
|
+
name: "deviceId",
|
|
77772
|
+
form: "single",
|
|
77773
|
+
optional: true
|
|
77774
|
+
}],
|
|
77775
|
+
"records.putMany": [{
|
|
77776
|
+
name: "records",
|
|
77777
|
+
form: "object-array",
|
|
77778
|
+
optional: false,
|
|
77779
|
+
itemField: "deviceId"
|
|
77780
|
+
}],
|
|
77781
|
+
"records.query": [{
|
|
77782
|
+
name: "deviceId",
|
|
77783
|
+
form: "single",
|
|
77784
|
+
optional: true
|
|
77785
|
+
}],
|
|
76341
77786
|
"sceneMonitor.captureReference": [{
|
|
76342
77787
|
name: "deviceId",
|
|
76343
77788
|
form: "single",
|
|
@@ -76454,6 +77899,17 @@ Object.freeze({
|
|
|
76454
77899
|
form: "single",
|
|
76455
77900
|
optional: false
|
|
76456
77901
|
}],
|
|
77902
|
+
"storageAdmin.adoptRecords": [{
|
|
77903
|
+
name: "records",
|
|
77904
|
+
form: "object-array",
|
|
77905
|
+
optional: false,
|
|
77906
|
+
itemField: "deviceId"
|
|
77907
|
+
}],
|
|
77908
|
+
"storageAdmin.readRecords": [{
|
|
77909
|
+
name: "deviceId",
|
|
77910
|
+
form: "single",
|
|
77911
|
+
optional: true
|
|
77912
|
+
}],
|
|
76457
77913
|
"streamBroker.acquireEgressTranscode": [{
|
|
76458
77914
|
name: "deviceId",
|
|
76459
77915
|
form: "single",
|
|
@@ -76969,6 +78425,9 @@ new Map(Object.entries({
|
|
|
76969
78425
|
"wrapper-update-available": "system",
|
|
76970
78426
|
"backup-completed": "system",
|
|
76971
78427
|
"export-completed": "system",
|
|
78428
|
+
"alert-critical": "system",
|
|
78429
|
+
"alert-error": "system",
|
|
78430
|
+
"alert-critical-resolved": "system",
|
|
76972
78431
|
"storage-location-low": "system",
|
|
76973
78432
|
"storage-location-critical": "system",
|
|
76974
78433
|
"storage-location-ok": "system",
|
|
@@ -77093,6 +78552,16 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
|
|
|
77093
78552
|
"storage-location-ok"
|
|
77094
78553
|
]
|
|
77095
78554
|
},
|
|
78555
|
+
{
|
|
78556
|
+
id: "alerts",
|
|
78557
|
+
family: "system",
|
|
78558
|
+
label: "Alerts",
|
|
78559
|
+
kinds: [
|
|
78560
|
+
"alert-critical",
|
|
78561
|
+
"alert-error",
|
|
78562
|
+
"alert-critical-resolved"
|
|
78563
|
+
]
|
|
78564
|
+
},
|
|
77096
78565
|
{
|
|
77097
78566
|
id: "alarm",
|
|
77098
78567
|
family: "alarm",
|
|
@@ -77137,6 +78606,21 @@ var NC_SENSOR_RAISED_FIELD_BY_KIND = Object.freeze(Object.fromEntries(Object.ent
|
|
|
77137
78606
|
return [[descriptor.kind, field]];
|
|
77138
78607
|
})));
|
|
77139
78608
|
Object.freeze(Object.keys(NC_SENSOR_RAISED_FIELD_BY_KIND));
|
|
78609
|
+
object({
|
|
78610
|
+
phase: _enum(["raised", "resolved"]),
|
|
78611
|
+
episodeId: string().min(1),
|
|
78612
|
+
alertId: string().min(1),
|
|
78613
|
+
severity: AlertSeveritySchema,
|
|
78614
|
+
category: string(),
|
|
78615
|
+
title: string(),
|
|
78616
|
+
message: string(),
|
|
78617
|
+
sourceType: string().optional(),
|
|
78618
|
+
sourceId: string().optional(),
|
|
78619
|
+
nodeId: string().optional(),
|
|
78620
|
+
/** The alert's own action link (where the operator acts on it), when it has one. */
|
|
78621
|
+
actionUrl: string().optional(),
|
|
78622
|
+
at: number()
|
|
78623
|
+
});
|
|
77140
78624
|
var RULE_BODY_ONLY = ["body"];
|
|
77141
78625
|
var RULE_TEXT = ["title", "body"];
|
|
77142
78626
|
var BATTERY = ["device-battery-low", "device-battery-normal"];
|
|
@@ -77146,6 +78630,11 @@ var TANK = [
|
|
|
77146
78630
|
"device-tank-full",
|
|
77147
78631
|
"device-tank-normal"
|
|
77148
78632
|
];
|
|
78633
|
+
var ALERT_EPISODE = [
|
|
78634
|
+
"alert-critical",
|
|
78635
|
+
"alert-error",
|
|
78636
|
+
"alert-critical-resolved"
|
|
78637
|
+
];
|
|
77149
78638
|
var UPDATES = [
|
|
77150
78639
|
"addon-update-available",
|
|
77151
78640
|
"server-update-available",
|
|
@@ -77338,14 +78827,14 @@ var STATE_SUMMARY_VARS = [
|
|
|
77338
78827
|
([...RULE_TEXT], [...CONSUMABLE]),
|
|
77339
78828
|
([...RULE_TEXT], [...TANK]),
|
|
77340
78829
|
[...RULE_TEXT],
|
|
77341
|
-
([...RULE_TEXT], [...UPDATES]),
|
|
77342
|
-
([...RULE_TEXT], [...UPDATES]),
|
|
77343
|
-
[...RULE_TEXT],
|
|
78830
|
+
([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
|
|
78831
|
+
([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
|
|
77344
78832
|
[...RULE_TEXT],
|
|
77345
78833
|
[...RULE_TEXT],
|
|
77346
78834
|
[...RULE_TEXT],
|
|
77347
78835
|
[...RULE_TEXT],
|
|
77348
78836
|
[...RULE_TEXT],
|
|
78837
|
+
([...RULE_TEXT], [...ALERT_EPISODE]),
|
|
77349
78838
|
[...RULE_TEXT],
|
|
77350
78839
|
[...RULE_TEXT],
|
|
77351
78840
|
[...RULE_TEXT],
|
|
@@ -77363,7 +78852,11 @@ var STATE_SUMMARY_VARS = [
|
|
|
77363
78852
|
[...RULE_TEXT],
|
|
77364
78853
|
[...RULE_TEXT],
|
|
77365
78854
|
[...RULE_TEXT],
|
|
77366
|
-
[...RULE_TEXT],
|
|
78855
|
+
([...RULE_TEXT], [...ALERT_EPISODE]),
|
|
78856
|
+
([...RULE_TEXT], [...ALERT_EPISODE]),
|
|
78857
|
+
([...RULE_TEXT], [...ALERT_EPISODE]),
|
|
78858
|
+
([...RULE_TEXT], [...ALERT_EPISODE]),
|
|
78859
|
+
([...RULE_TEXT], [...ALERT_EPISODE]),
|
|
77367
78860
|
[...RULE_TEXT],
|
|
77368
78861
|
[...RULE_TEXT],
|
|
77369
78862
|
[...RULE_TEXT],
|