@camstack/addon-provider-hikvision 1.2.184 → 1.2.186
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/addon.js +1595 -1759
- package/dist/addon.mjs +1595 -1759
- package/package.json +2 -2
package/dist/addon.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import "node:zlib";
|
|
|
7
7
|
import { connect } from "node:net";
|
|
8
8
|
import { Agent, createServer, request } from "node:http";
|
|
9
9
|
import { Agent as Agent$1, request as request$1 } from "node:https";
|
|
10
|
-
//#region ../types/dist/event-category-
|
|
10
|
+
//#region ../types/dist/event-category-78tcBemo.mjs
|
|
11
11
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
12
12
|
EventCategory["SystemBoot"] = "system.boot";
|
|
13
13
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -128,6 +128,23 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
128
128
|
*/
|
|
129
129
|
EventCategory["AddonLoadRecovered"] = "addon.load-recovered";
|
|
130
130
|
/**
|
|
131
|
+
* An addon is RUNNING although its installed package is below what the
|
|
132
|
+
* running server requires (`camstack.requires.addons` of the server, or the
|
|
133
|
+
* addon's own `requires.server`). Raised once per streak by the unsupported-
|
|
134
|
+
* addon tracker, on the hub and on agents; AlertCenter turns it into one
|
|
135
|
+
* operator alert per node and package. The addon is never held back for it.
|
|
136
|
+
*
|
|
137
|
+
* Payload: `{ packageName, addonId, nodeId, installedVersion, requiredMinimum, serverVersion, unmet }`.
|
|
138
|
+
*/
|
|
139
|
+
EventCategory["AddonUnsupportedVersion"] = "addon.unsupported-version";
|
|
140
|
+
/**
|
|
141
|
+
* The package of an {@link AddonUnsupportedVersion} alert reached a supported
|
|
142
|
+
* version, or is no longer installed on the node. AlertCenter dismisses the matching alert.
|
|
143
|
+
*
|
|
144
|
+
* Payload: `{ packageName, addonId, nodeId }`.
|
|
145
|
+
*/
|
|
146
|
+
EventCategory["AddonUnsupportedResolved"] = "addon.unsupported-resolved";
|
|
147
|
+
/**
|
|
131
148
|
* Monitor scheduled the next retry for a failed addon. Transient —
|
|
132
149
|
* surfaced to the UI for live-updating the "next retry in Ns"
|
|
133
150
|
* countdown on the Addons page row, NOT persisted as an alert.
|
|
@@ -238,7 +255,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
238
255
|
EventCategory["ProcessRestarted"] = "process.restarted";
|
|
239
256
|
/**
|
|
240
257
|
* The SET of storage locations changed — one was created, edited, enabled,
|
|
241
|
-
* disabled or deleted through
|
|
258
|
+
* disabled or deleted through the location instances or the forced-delete action.
|
|
242
259
|
*
|
|
243
260
|
* Telemetry, not a transaction (D8/D11): every consumer that re-resolves on
|
|
244
261
|
* it must also converge on its own periodic path, because a dropped event
|
|
@@ -793,7 +810,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
793
810
|
return EventCategory;
|
|
794
811
|
}({});
|
|
795
812
|
//#endregion
|
|
796
|
-
//#region ../types/dist/device-type-
|
|
813
|
+
//#region ../types/dist/device-type-DxCT0krO.mjs
|
|
797
814
|
/**
|
|
798
815
|
import { errMsg } from '@camstack/types'
|
|
799
816
|
* Extract a human-readable message from an unknown error value.
|
|
@@ -955,6 +972,13 @@ var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
|
|
|
955
972
|
* filters that want "all devices with on-motion behaviour".
|
|
956
973
|
*/
|
|
957
974
|
DeviceFeature["MotionTrigger"] = "motion-trigger";
|
|
975
|
+
/**
|
|
976
|
+
* Device can be run for a chosen time and then stopped. Mirrors the
|
|
977
|
+
* `timed-run` wrapper cap — the cap is bound by the core-blocks addon, not by
|
|
978
|
+
* a driver, so the flag is derived from the device's bindings
|
|
979
|
+
* (`featuresOfBoundCaps`). Gates the quick-run control in the viewer.
|
|
980
|
+
*/
|
|
981
|
+
DeviceFeature["TimedRun"] = "timed-run";
|
|
958
982
|
/** Light supports rgb-triplet color via `color` cap. */
|
|
959
983
|
DeviceFeature["LightColorRgb"] = "light-color-rgb";
|
|
960
984
|
/** Light supports HSV color via `color` cap. */
|
|
@@ -5989,7 +6013,7 @@ var ZodIssueCode = {
|
|
|
5989
6013
|
var ZodFirstPartyTypeKind;
|
|
5990
6014
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5991
6015
|
//#endregion
|
|
5992
|
-
//#region ../types/dist/sleep-
|
|
6016
|
+
//#region ../types/dist/sleep-CGPZyzB5.mjs
|
|
5993
6017
|
/**
|
|
5994
6018
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5995
6019
|
* window to float samples (D455).
|
|
@@ -6353,6 +6377,59 @@ Object.fromEntries([
|
|
|
6353
6377
|
function isValuelessField(field) {
|
|
6354
6378
|
return field.type === "separator" || field.type === "info" || field.type === "qr-code" || field.type === "button" || field.type === "object-array" || field.type === "widget" || field.type === "addon-action-button" || field.type === "device-action-button" || field.type === "account-sign-in" || field.type === "secret-presence";
|
|
6355
6379
|
}
|
|
6380
|
+
/**
|
|
6381
|
+
* Base collector: flatten a hydrated `ConfigUISchemaWithValues` into
|
|
6382
|
+
* `key → { value, default }`, recursing through `group` and `sub-tabs`
|
|
6383
|
+
* layout fields. Keeping `value` and `default` SEPARATE (rather than
|
|
6384
|
+
* pre-resolving) lets callers both read the effective value AND detect
|
|
6385
|
+
* overrides (`value` differs from `default`). Structural over `unknown`;
|
|
6386
|
+
* malformed input yields an empty map, never throws.
|
|
6387
|
+
*/
|
|
6388
|
+
function collectHydratedFieldEntries(schema) {
|
|
6389
|
+
const out = /* @__PURE__ */ new Map();
|
|
6390
|
+
if (typeof schema !== "object" || schema === null) return out;
|
|
6391
|
+
const sections = schema.sections;
|
|
6392
|
+
if (!Array.isArray(sections)) return out;
|
|
6393
|
+
for (const section of sections) if (typeof section === "object" && section !== null) collectFieldEntriesInto(section.fields, out);
|
|
6394
|
+
return out;
|
|
6395
|
+
}
|
|
6396
|
+
/** Recursive field walker for {@link collectHydratedFieldEntries}. */
|
|
6397
|
+
function collectFieldEntriesInto(fields, into) {
|
|
6398
|
+
if (!Array.isArray(fields)) return;
|
|
6399
|
+
for (const field of fields) {
|
|
6400
|
+
if (typeof field !== "object" || field === null) continue;
|
|
6401
|
+
const type = field.type;
|
|
6402
|
+
if (type === "group") {
|
|
6403
|
+
collectFieldEntriesInto(field.fields, into);
|
|
6404
|
+
continue;
|
|
6405
|
+
}
|
|
6406
|
+
if (type === "sub-tabs") {
|
|
6407
|
+
const tabs = field.tabs;
|
|
6408
|
+
if (Array.isArray(tabs)) {
|
|
6409
|
+
for (const tab of tabs) if (typeof tab === "object" && tab !== null) collectFieldEntriesInto(tab.fields, into);
|
|
6410
|
+
}
|
|
6411
|
+
continue;
|
|
6412
|
+
}
|
|
6413
|
+
const key = field.key;
|
|
6414
|
+
if (typeof key !== "string" || key.length === 0) continue;
|
|
6415
|
+
if (!("value" in field)) continue;
|
|
6416
|
+
into.set(key, {
|
|
6417
|
+
value: field.value,
|
|
6418
|
+
default: field.default
|
|
6419
|
+
});
|
|
6420
|
+
}
|
|
6421
|
+
}
|
|
6422
|
+
/**
|
|
6423
|
+
* Flatten a hydrated settings payload into `key → EFFECTIVE value`
|
|
6424
|
+
* (`value ?? default`). The read-side inverse of `hydrateSchema` for the
|
|
6425
|
+
* common "just give me the resolved values" case. Built on
|
|
6426
|
+
* {@link collectHydratedFieldEntries}.
|
|
6427
|
+
*/
|
|
6428
|
+
function collectHydratedFieldValues(schema) {
|
|
6429
|
+
const out = /* @__PURE__ */ new Map();
|
|
6430
|
+
for (const [key, entry] of collectHydratedFieldEntries(schema)) out.set(key, entry.value ?? entry.default);
|
|
6431
|
+
return out;
|
|
6432
|
+
}
|
|
6356
6433
|
function hydrateSchema(schema, values, options = {}) {
|
|
6357
6434
|
return {
|
|
6358
6435
|
...schema.tabs ? { tabs: [...schema.tabs] } : {},
|
|
@@ -6784,10 +6861,33 @@ function defaultIntegrationDepsOver(api) {
|
|
|
6784
6861
|
};
|
|
6785
6862
|
}
|
|
6786
6863
|
var PREFIX = "records/";
|
|
6864
|
+
/**
|
|
6865
|
+
* Cross-realm brand. An addon bundles its own copy of this module (D15) while
|
|
6866
|
+
* `ctx.records` is the HOST's door, so an error thrown by the host is an
|
|
6867
|
+
* instance of the host's classes, not of the addon's. The brand plus the code
|
|
6868
|
+
* make `instanceof` answer by identity of the failure, not of the copy.
|
|
6869
|
+
*/
|
|
6870
|
+
var RECORDS_ERROR_BRAND = Symbol.for("camstack.records-error");
|
|
6871
|
+
function carriesBrand(value) {
|
|
6872
|
+
return typeof value === "object" && value !== null && Reflect.get(value, RECORDS_ERROR_BRAND) === true;
|
|
6873
|
+
}
|
|
6787
6874
|
/** The base of every records failure. `detail` is the human part of the message. */
|
|
6788
6875
|
var RecordsError = class extends Error {
|
|
6876
|
+
/** The code a subclass stands for; the base stands for every code. */
|
|
6877
|
+
static code = void 0;
|
|
6878
|
+
/**
|
|
6879
|
+
* `instanceof` across copies of this module: any branded error is a
|
|
6880
|
+
* `RecordsError`, and is an instance of a subclass only when its code is the
|
|
6881
|
+
* subclass's code. Same-copy answers are unchanged.
|
|
6882
|
+
*/
|
|
6883
|
+
static [Symbol.hasInstance](value) {
|
|
6884
|
+
if (Function.prototype[Symbol.hasInstance].call(this, value)) return true;
|
|
6885
|
+
if (!carriesBrand(value)) return false;
|
|
6886
|
+
return this.code === void 0 || value.code === this.code;
|
|
6887
|
+
}
|
|
6789
6888
|
code;
|
|
6790
6889
|
detail;
|
|
6890
|
+
[RECORDS_ERROR_BRAND] = true;
|
|
6791
6891
|
constructor(code, detail) {
|
|
6792
6892
|
super(`${PREFIX}${code}: ${detail}`);
|
|
6793
6893
|
this.name = "RecordsError";
|
|
@@ -6796,29 +6896,33 @@ var RecordsError = class extends Error {
|
|
|
6796
6896
|
}
|
|
6797
6897
|
};
|
|
6798
6898
|
/** A write guarded by `ifRev` found another revision (or an existing row for `ifRev: 0`). */
|
|
6799
|
-
var RevConflictError = class extends RecordsError {
|
|
6899
|
+
var RevConflictError = class RevConflictError extends RecordsError {
|
|
6900
|
+
static code = "rev-conflict";
|
|
6800
6901
|
constructor(detail) {
|
|
6801
|
-
super(
|
|
6902
|
+
super(RevConflictError.code, detail);
|
|
6802
6903
|
this.name = "RevConflictError";
|
|
6803
6904
|
}
|
|
6804
6905
|
};
|
|
6805
6906
|
/** The keychain could not store or serve a value: explicit, never an empty string. */
|
|
6806
|
-
var RecordSecretUnavailableError = class extends RecordsError {
|
|
6907
|
+
var RecordSecretUnavailableError = class RecordSecretUnavailableError extends RecordsError {
|
|
6908
|
+
static code = "secret-unavailable";
|
|
6807
6909
|
constructor(detail) {
|
|
6808
|
-
super(
|
|
6910
|
+
super(RecordSecretUnavailableError.code, detail);
|
|
6809
6911
|
this.name = "RecordSecretUnavailableError";
|
|
6810
6912
|
}
|
|
6811
6913
|
};
|
|
6812
|
-
var InvalidRecordError = class extends RecordsError {
|
|
6914
|
+
var InvalidRecordError = class InvalidRecordError extends RecordsError {
|
|
6915
|
+
static code = "invalid-record";
|
|
6813
6916
|
constructor(detail) {
|
|
6814
|
-
super(
|
|
6917
|
+
super(InvalidRecordError.code, detail);
|
|
6815
6918
|
this.name = "InvalidRecordError";
|
|
6816
6919
|
}
|
|
6817
6920
|
};
|
|
6818
6921
|
/** A kind declaration the engine refuses (non-additive change, bad shape, wrong file). */
|
|
6819
|
-
var DeclarationRefusedError = class extends RecordsError {
|
|
6922
|
+
var DeclarationRefusedError = class DeclarationRefusedError extends RecordsError {
|
|
6923
|
+
static code = "declaration-refused";
|
|
6820
6924
|
constructor(detail) {
|
|
6821
|
-
super(
|
|
6925
|
+
super(DeclarationRefusedError.code, detail);
|
|
6822
6926
|
this.name = "DeclarationRefusedError";
|
|
6823
6927
|
}
|
|
6824
6928
|
};
|
|
@@ -7220,6 +7324,7 @@ var RecordIntegrationInstances = class {
|
|
|
7220
7324
|
this.secretKeys = topLevelSecretKeys(kind.declaration.secretPaths);
|
|
7221
7325
|
this.secretMaps = secretMapKeys(kind.declaration.secretPaths);
|
|
7222
7326
|
this.nameField = kind.declaration.entry?.nameField ?? "name";
|
|
7327
|
+
if (hooks.kindOf === void 0 && hooks.description.kinds.length !== 1) throw new Error(`record kind '${kind.name}': describe().kinds has ${hooks.description.kinds.length} entries, so kindOf is required to say which one an instance is`);
|
|
7223
7328
|
}
|
|
7224
7329
|
/**
|
|
7225
7330
|
* One instance read for the addon's own runtime; null when absent. When the keychain is
|
|
@@ -7261,10 +7366,21 @@ var RecordIntegrationInstances = class {
|
|
|
7261
7366
|
}
|
|
7262
7367
|
return out;
|
|
7263
7368
|
}
|
|
7369
|
+
/** The kind an instance body is of: the provider's `kindOf`, else its one declared kind. */
|
|
7370
|
+
kindOfBody(body) {
|
|
7371
|
+
if (this.hooks.kindOf !== void 0) {
|
|
7372
|
+
const id = this.hooks.kindOf(body);
|
|
7373
|
+
if (!this.hooks.description.kinds.some((declared) => declared.id === id)) throw new Error(`record kind '${this.kind.name}': kindOf returned '${id}', which describe().kinds does not declare (D1013)`);
|
|
7374
|
+
return id;
|
|
7375
|
+
}
|
|
7376
|
+
const only = this.hooks.description.kinds[0];
|
|
7377
|
+
if (only === void 0) throw new Error(`record kind '${this.kind.name}' declares no kinds`);
|
|
7378
|
+
return only.id;
|
|
7379
|
+
}
|
|
7264
7380
|
viewOf(record) {
|
|
7265
7381
|
const shown = secretViewsOf(this.records.owner, this.kind.name, record.id, this.kind.declaration, record.data);
|
|
7266
7382
|
const rawName = record.data[this.nameField];
|
|
7267
|
-
const kind = this.
|
|
7383
|
+
const kind = this.kindOfBody(record.data);
|
|
7268
7384
|
const health = this.hooks.health?.(record.data, record.id);
|
|
7269
7385
|
return {
|
|
7270
7386
|
id: record.id,
|
|
@@ -7272,7 +7388,7 @@ var RecordIntegrationInstances = class {
|
|
|
7272
7388
|
configured: this.hooks.configured(record.data),
|
|
7273
7389
|
enabled: isInstanceEnabled(record.data),
|
|
7274
7390
|
formValues: shown,
|
|
7275
|
-
|
|
7391
|
+
kind,
|
|
7276
7392
|
...health?.status !== void 0 ? { status: health.status } : {},
|
|
7277
7393
|
...health?.lastCheckedAt !== void 0 ? { lastCheckedAt: health.lastCheckedAt } : {}
|
|
7278
7394
|
};
|
|
@@ -7305,17 +7421,35 @@ var RecordIntegrationInstances = class {
|
|
|
7305
7421
|
...kind !== void 0 ? { kind } : {}
|
|
7306
7422
|
});
|
|
7307
7423
|
if (minted === void 0) throw new Error("createInstance needs an id: this provider does not mint one");
|
|
7424
|
+
const initial = this.hooks.initialBody(name, kind);
|
|
7425
|
+
const patch = this.patchOf(values ?? {});
|
|
7426
|
+
if (Object.keys(patch).length > 0) Object.assign(patch, await this.hooks.validateWrite?.({
|
|
7427
|
+
kind,
|
|
7428
|
+
body: {
|
|
7429
|
+
...initial,
|
|
7430
|
+
...patch
|
|
7431
|
+
}
|
|
7432
|
+
}));
|
|
7308
7433
|
await this.handle.put({
|
|
7309
7434
|
id: minted,
|
|
7310
|
-
data:
|
|
7435
|
+
data: initial
|
|
7311
7436
|
}, { ifRev: 0 });
|
|
7312
|
-
const patch = this.patchOf(values ?? {});
|
|
7313
7437
|
if (Object.keys(patch).length > 0) await this.handle.patch(minted, patch);
|
|
7314
7438
|
await this.hooks.onChanged?.(minted, "created");
|
|
7315
7439
|
return { id: minted };
|
|
7316
7440
|
};
|
|
7317
7441
|
updateInstance = async ({ id, name, values }) => {
|
|
7318
7442
|
const patch = this.patchOf(values);
|
|
7443
|
+
if (this.hooks.validateWrite !== void 0 && Object.keys(patch).length > 0) {
|
|
7444
|
+
const stored = await this.handle.get(id);
|
|
7445
|
+
if (stored !== null) Object.assign(patch, await this.hooks.validateWrite({
|
|
7446
|
+
kind: void 0,
|
|
7447
|
+
body: {
|
|
7448
|
+
...stored.data,
|
|
7449
|
+
...patch
|
|
7450
|
+
}
|
|
7451
|
+
}));
|
|
7452
|
+
}
|
|
7319
7453
|
if (name !== void 0) patch[this.nameField] = name;
|
|
7320
7454
|
await this.handle.patch(id, patch);
|
|
7321
7455
|
await this.hooks.onChanged?.(id, "updated");
|
|
@@ -7626,6 +7760,21 @@ var SCOPED_SETTINGS_SCOPES = [
|
|
|
7626
7760
|
"device-defaults",
|
|
7627
7761
|
"node"
|
|
7628
7762
|
];
|
|
7763
|
+
/** The one refusal of a key a scope did not declare. */
|
|
7764
|
+
function assertDeclaredKeys(keys, declared) {
|
|
7765
|
+
const undeclared = keys.filter((key) => !declared.has(key));
|
|
7766
|
+
if (undeclared.length > 0) throw new Error(`scoped settings: [${undeclared.join(", ")}] not declared for this scope (declared: [${[...declared].join(", ")}])`);
|
|
7767
|
+
}
|
|
7768
|
+
/** Build the handle over an addon's scoped read, write and unset. */
|
|
7769
|
+
function createScopedSettings(deps) {
|
|
7770
|
+
return {
|
|
7771
|
+
async get() {
|
|
7772
|
+
return deps.schema.parse(await deps.read());
|
|
7773
|
+
},
|
|
7774
|
+
patch: (patch) => deps.write(Object.fromEntries(Object.entries(patch))),
|
|
7775
|
+
unset: (keys) => deps.unset(keys)
|
|
7776
|
+
};
|
|
7777
|
+
}
|
|
7629
7778
|
/** A write to a secret path could not be stored in the keychain, so it was refused. */
|
|
7630
7779
|
var KeychainWriteRefusedError = class extends Error {
|
|
7631
7780
|
fieldPath;
|
|
@@ -8201,7 +8350,16 @@ function createHandle(raw, opts) {
|
|
|
8201
8350
|
return blob;
|
|
8202
8351
|
}
|
|
8203
8352
|
},
|
|
8204
|
-
writeAddonStore: writeAddon
|
|
8353
|
+
writeAddonStore: writeAddon,
|
|
8354
|
+
removeClearedKeys: (keys) => serialize("addon", async () => {
|
|
8355
|
+
const stored = await readStoredAddonBlob(raw);
|
|
8356
|
+
index.seen("addon", stored);
|
|
8357
|
+
const removable = keys.filter((key) => collectSecretMarkerRefs(stored[key]).length === 0);
|
|
8358
|
+
if (removable.length === 0) return;
|
|
8359
|
+
const patch = Object.fromEntries(removable.map((key) => [key, void 0]));
|
|
8360
|
+
await raw.writeAddonStore(patch);
|
|
8361
|
+
index.wrote("addon", patch);
|
|
8362
|
+
})
|
|
8205
8363
|
};
|
|
8206
8364
|
}
|
|
8207
8365
|
/** The context the addon sees, plus the private raw view and write outcome. */
|
|
@@ -8331,7 +8489,7 @@ function boundOf(list) {
|
|
|
8331
8489
|
* Base class for CamStack addons. Eliminates settings boilerplate:
|
|
8332
8490
|
*
|
|
8333
8491
|
* - Typed `config` property with automatic resolution from store + defaults
|
|
8334
|
-
* -
|
|
8492
|
+
* - the scoped settings API (`clusterSettings` / `nodeSettings` / `deviceDefaults`) auto-implemented
|
|
8335
8493
|
* - `getAddonSettings()` / `updateAddonSettings()` auto-implemented
|
|
8336
8494
|
* - `getDeviceSettings()` / `updateDeviceSettings()` auto-implemented
|
|
8337
8495
|
* - `ctx` accessor for the AddonContext (no manual `this.ctxRef` storage)
|
|
@@ -8341,7 +8499,7 @@ function boundOf(list) {
|
|
|
8341
8499
|
* Subclasses override:
|
|
8342
8500
|
* - `onInitialize()` — addon-specific init logic, return ProviderRegistration[]
|
|
8343
8501
|
* - `onShutdown()` — cleanup
|
|
8344
|
-
* - `
|
|
8502
|
+
* - `clusterSettingsSchema()` / `nodeSettingsSchema()` / `deviceSettingsSchema()` — UI schemas
|
|
8345
8503
|
*
|
|
8346
8504
|
* @example
|
|
8347
8505
|
* ```ts
|
|
@@ -8355,7 +8513,7 @@ function boundOf(list) {
|
|
|
8355
8513
|
* super({ maxRetries: 3, endpoint: 'http://localhost' })
|
|
8356
8514
|
* }
|
|
8357
8515
|
*
|
|
8358
|
-
* protected
|
|
8516
|
+
* protected clusterSettingsSchema() {
|
|
8359
8517
|
* return this.schema({
|
|
8360
8518
|
* sections: [{
|
|
8361
8519
|
* id: 'main', title: 'Settings',
|
|
@@ -8398,7 +8556,7 @@ var BaseAddon = class {
|
|
|
8398
8556
|
defaults;
|
|
8399
8557
|
/**
|
|
8400
8558
|
* Hidden-state paths that hold secrets (D787) — values the addon writes
|
|
8401
|
-
* itself (`
|
|
8559
|
+
* itself (`state()`, the scoped writers) that no form field declares.
|
|
8402
8560
|
* Stored in the keychain exactly like a `password` field. Syntax:
|
|
8403
8561
|
* `'snapshotSigningKey'`, `'identity.pincode'`, `'tokens[userId].accessToken'`
|
|
8404
8562
|
* (`key[<id field>]` addresses array items by id, never by index).
|
|
@@ -8408,7 +8566,7 @@ var BaseAddon = class {
|
|
|
8408
8566
|
/**
|
|
8409
8567
|
* D986 M4: the scoped schemas this addon declared, resolved once per capability
|
|
8410
8568
|
* (`loadScopedSchemas`) so the sync readers (`perNodeKeys`, the secret tree, the restart check)
|
|
8411
|
-
* see them. Empty until loaded
|
|
8569
|
+
* see them. Empty until loaded.
|
|
8412
8570
|
*/
|
|
8413
8571
|
_scopedByCap = /* @__PURE__ */ new Map();
|
|
8414
8572
|
_nodeKeysByCap = /* @__PURE__ */ new Map();
|
|
@@ -8594,7 +8752,7 @@ var BaseAddon = class {
|
|
|
8594
8752
|
/** Addon-specific cleanup. Override if needed. */
|
|
8595
8753
|
async onShutdown() {}
|
|
8596
8754
|
/**
|
|
8597
|
-
* Called after config is resolved during
|
|
8755
|
+
* Called after config is resolved during a settings write.
|
|
8598
8756
|
* Override to react to config changes (e.g. restart a sampler, reconnect a service).
|
|
8599
8757
|
* Not called during initialize() — use onInitialize() for initial setup.
|
|
8600
8758
|
*/
|
|
@@ -8623,82 +8781,12 @@ var BaseAddon = class {
|
|
|
8623
8781
|
scopedSettingsCapabilities() {
|
|
8624
8782
|
return [];
|
|
8625
8783
|
}
|
|
8626
|
-
/** Override to provide global-level settings UI schema. */
|
|
8627
|
-
globalSettingsSchema(_cap) {
|
|
8628
|
-
return null;
|
|
8629
|
-
}
|
|
8630
8784
|
/** Override to provide device-level settings UI schema. */
|
|
8631
8785
|
deviceSettingsSchema() {
|
|
8632
8786
|
return null;
|
|
8633
8787
|
}
|
|
8634
8788
|
/**
|
|
8635
|
-
*
|
|
8636
|
-
* ARE the configuration of its integration.
|
|
8637
|
-
*
|
|
8638
|
-
* Return the `ConfigSection.id`s, from {@link globalSettingsSchema}, that an
|
|
8639
|
-
* operator should find on the addon's integration page (System →
|
|
8640
|
-
* Integrations → <name>) rather than only in the cluster-wide list of every
|
|
8641
|
-
* addon. Empty (the default) means the addon has no integration-level
|
|
8642
|
-
* settings and no such surface is offered — this is opt-in, because whether
|
|
8643
|
-
* an addon's configuration IS its integration's configuration depends on the
|
|
8644
|
-
* nature of the integration.
|
|
8645
|
-
*
|
|
8646
|
-
* WHAT THIS IS NOT. It is not a scope. The selected sections keep living in
|
|
8647
|
-
* the ONE global schema, in the ONE addon store, written by the ONE
|
|
8648
|
-
* `updateGlobalSettings` path. There is deliberately no
|
|
8649
|
-
* `updateIntegrationSettings`: a second write path is how a surface acquires
|
|
8650
|
-
* a second store key, and this repo has shipped that twice (`btmPath@hub`,
|
|
8651
|
-
* D266). Selecting sections cannot introduce a key that selecting cannot.
|
|
8652
|
-
*
|
|
8653
|
-
* WHY IT IS A LIST OF SECTION IDS AND NOT A MARKER ON THE SECTION.
|
|
8654
|
-
* `ConfigFieldBase` used to carry `scope?: 'device' | 'global'` and it was
|
|
8655
|
-
* removed with the reason recorded at
|
|
8656
|
-
* `packages/types/src/interfaces/config-ui.ts:249` — *"a field's scope is
|
|
8657
|
-
* determined by WHICH schema it lives in, not by a field-level marker."* A
|
|
8658
|
-
* marker sprinkled across sections also has to borrow a field that already
|
|
8659
|
-
* means something else; borrowing `section.tab` put the literal word
|
|
8660
|
-
* "integration" into an operator-facing tab bar, because `tab` means "how to
|
|
8661
|
-
* GROUP this visually" and cannot also mean "where this lives" (D269
|
|
8662
|
-
* supersedes D268). One declaration, in one place, next to the schema whose
|
|
8663
|
-
* ids it names.
|
|
8664
|
-
*/
|
|
8665
|
-
integrationSettingSections() {
|
|
8666
|
-
return [];
|
|
8667
|
-
}
|
|
8668
|
-
async getGlobalSettings(overlay, cap, nodeId) {
|
|
8669
|
-
await this.loadScopedSchemas(cap);
|
|
8670
|
-
const schema = this.globalSettingsSchema(cap) ?? this.scopedFormSchema(cap);
|
|
8671
|
-
if (!schema) return { sections: [] };
|
|
8672
|
-
const projected = await this.readRawProjectedStore(nodeId, cap);
|
|
8673
|
-
return hydrateSchema(schema, overlay ? await this.overlayKeepingMarkers(projected, overlay) : projected, { inlineSecretsAsViews: true });
|
|
8674
|
-
}
|
|
8675
|
-
/**
|
|
8676
|
-
* The integration-level view of this addon's settings: exactly the sections
|
|
8677
|
-
* named by {@link integrationSettingSections}, hydrated from the SAME store
|
|
8678
|
-
* `getGlobalSettings` reads, and narrowed to cluster-scoped fields.
|
|
8679
|
-
*
|
|
8680
|
-
* Returns `null` when the addon declared nothing — an addon that opts out has
|
|
8681
|
-
* no integration settings surface at all, rather than an empty one that reads
|
|
8682
|
-
* as a failed load.
|
|
8683
|
-
*
|
|
8684
|
-
* Three properties hold BY CONSTRUCTION, which is why they are here in core
|
|
8685
|
-
* and not in whichever UI happens to render this:
|
|
8686
|
-
*
|
|
8687
|
-
* 1. **One key.** The payload is a SUBSET of the global schema, so a field
|
|
8688
|
-
* shown here is the same field, with the same bare key, that the addon's
|
|
8689
|
-
* own page shows. There is no integration-specific writer — callers save
|
|
8690
|
-
* through `updateGlobalSettings` — so a second store key is unreachable,
|
|
8691
|
-
* not merely discouraged.
|
|
8692
|
-
* 2. **No node scope.** `perNode: true` fields are DROPPED. Their store key
|
|
8693
|
-
* is `<key>@<nodeId>` and an integration is not a node; whichever node
|
|
8694
|
-
* such a field silently picked would be a wrong answer for the operator
|
|
8695
|
-
* who opened the page (D266).
|
|
8696
|
-
* 3. **No silent typo.** A declared id that names no section throws. The
|
|
8697
|
-
* alternative — skip it — turns a rename into a surface that quietly
|
|
8698
|
-
* empties, which looks exactly like an addon with nothing to configure.
|
|
8699
|
-
*/
|
|
8700
|
-
/**
|
|
8701
|
-
* The form schema of ONE integration instance, or `null` to use {@link globalSettingsSchema}.
|
|
8789
|
+
* The form schema of ONE integration instance, or `null` to use the scoped form.
|
|
8702
8790
|
*
|
|
8703
8791
|
* Override it only when an `instanceMode: multiple` addon's instances differ: an NVR integration
|
|
8704
8792
|
* needs its connection fields, the default integration the addon's own sections. It is the
|
|
@@ -8746,37 +8834,178 @@ var BaseAddon = class {
|
|
|
8746
8834
|
}
|
|
8747
8835
|
}
|
|
8748
8836
|
/**
|
|
8837
|
+
* Hook: values layered over the stored ones when the FORM of one scope is served
|
|
8838
|
+
* ({@link getScopedSettings}) — a preview that derives dependent options without writing.
|
|
8839
|
+
* Never applied to {@link ScopedSettings.get} or to a write. `null` ⇒ no overlay.
|
|
8840
|
+
*/
|
|
8841
|
+
async scopedSettingsOverlay(_scope, _cap, _nodeId) {
|
|
8842
|
+
return null;
|
|
8843
|
+
}
|
|
8844
|
+
/**
|
|
8845
|
+
* Hook: a write of one scope changed stored values (not called when the store reports no change,
|
|
8846
|
+
* e.g. the write-back of a stored secret). `keys` are the bare field keys of the write, node keys included.
|
|
8847
|
+
*/
|
|
8848
|
+
async onScopedSettingsChanged(_scope, _cap, _keys) {}
|
|
8849
|
+
/** Typed handle over the CLUSTER settings `cap` declares (`clusterSettingsSchema`). */
|
|
8850
|
+
clusterSettings(cap, schema) {
|
|
8851
|
+
return this.scopedHandle("cluster", cap, schema);
|
|
8852
|
+
}
|
|
8853
|
+
/** Typed handle over the fleet defaults of the per-device settings `cap` declares. */
|
|
8854
|
+
deviceDefaults(cap, schema) {
|
|
8855
|
+
return this.scopedHandle("device-defaults", cap, schema);
|
|
8856
|
+
}
|
|
8857
|
+
/**
|
|
8858
|
+
* Typed handle over the settings `cap` owns PER NODE. `nodeId` omitted ⇒ the local node. A node
|
|
8859
|
+
* with no row yields the schema defaults — never a bare-key fallback.
|
|
8860
|
+
*/
|
|
8861
|
+
nodeSettings(cap, schema, nodeId) {
|
|
8862
|
+
return this.scopedHandle("node", cap, schema, nodeId);
|
|
8863
|
+
}
|
|
8864
|
+
/**
|
|
8865
|
+
* {@link state} for a value that is kept per node: stored under `<key>@<nodeId>`, and the
|
|
8866
|
+
* settings store carries `nodeId` in the row data (D986 §1), so a forgotten node's rows go in one
|
|
8867
|
+
* central delete. `nodeId` omitted ⇒ the local node.
|
|
8868
|
+
*/
|
|
8869
|
+
nodeState(key, schema, fallback, nodeId) {
|
|
8870
|
+
this._declaredStateKeys.add(key);
|
|
8871
|
+
return createDurableState({
|
|
8872
|
+
key: nodeScopedKey(key, nodeId ?? this._ctx?.kernel?.localNodeId ?? ""),
|
|
8873
|
+
schema,
|
|
8874
|
+
fallback,
|
|
8875
|
+
read: async () => this.resolveStoredSecrets(await this.readAddonStoreWithRetry()),
|
|
8876
|
+
write: async (patch) => {
|
|
8877
|
+
await this._ctx?.settings?.writeAddonStore(patch);
|
|
8878
|
+
},
|
|
8879
|
+
onParseError: (k, e) => this._ctx?.logger?.warn?.(`durable-state: stored "${k}" failed validation — using fallback`, { meta: {
|
|
8880
|
+
addonId: this._ctx?.id,
|
|
8881
|
+
key: k,
|
|
8882
|
+
error: String(e)
|
|
8883
|
+
} })
|
|
8884
|
+
});
|
|
8885
|
+
}
|
|
8886
|
+
/** The loaded schema `cap` declares for `scope`, or `null`. */
|
|
8887
|
+
async declaredScopedSchema(scope, cap) {
|
|
8888
|
+
await this.loadScopedSchemas(cap);
|
|
8889
|
+
return this.loadedScopedSchemas(cap).find((entry) => entry.scope === scope)?.schema ?? null;
|
|
8890
|
+
}
|
|
8891
|
+
async requireScopedSchema(scope, cap) {
|
|
8892
|
+
const schema = await this.declaredScopedSchema(scope, cap);
|
|
8893
|
+
if (schema === null) throw new Error(`${this.constructor.name}: cap "${cap}" declares no ${scope} settings`);
|
|
8894
|
+
return schema;
|
|
8895
|
+
}
|
|
8896
|
+
scopedKeys(schema) {
|
|
8897
|
+
return new Set(schema.sections.flatMap((section) => collectValueFieldKeys(section.fields)));
|
|
8898
|
+
}
|
|
8899
|
+
/** `store` narrowed to the keys `schema` declares. */
|
|
8900
|
+
narrowToScope(store, schema) {
|
|
8901
|
+
const keys = this.scopedKeys(schema);
|
|
8902
|
+
return Object.fromEntries(Object.entries(store).filter(([key]) => keys.has(key)));
|
|
8903
|
+
}
|
|
8904
|
+
scopedHandle(scope, cap, schema, nodeId) {
|
|
8905
|
+
return createScopedSettings({
|
|
8906
|
+
schema,
|
|
8907
|
+
read: async () => {
|
|
8908
|
+
const declared = await this.requireScopedSchema(scope, cap);
|
|
8909
|
+
const stored = this.narrowToScope(await this.resolveGlobalStore(nodeId, cap), declared);
|
|
8910
|
+
const effective = collectHydratedFieldValues(hydrateSchema(declared, stored));
|
|
8911
|
+
return {
|
|
8912
|
+
...Object.fromEntries([...effective].filter(([, value]) => value !== void 0)),
|
|
8913
|
+
...stored
|
|
8914
|
+
};
|
|
8915
|
+
},
|
|
8916
|
+
write: (patch) => this.writeScoped(scope, cap, patch, nodeId),
|
|
8917
|
+
unset: (keys) => this.unsetScoped(scope, cap, keys, nodeId)
|
|
8918
|
+
});
|
|
8919
|
+
}
|
|
8920
|
+
/** The one write path of the scoped API: declared keys only, then the global patch. */
|
|
8921
|
+
async writeScoped(scope, cap, patch, nodeId) {
|
|
8922
|
+
assertDeclaredKeys(Object.keys(patch), this.scopedKeys(await this.requireScopedSchema(scope, cap)));
|
|
8923
|
+
if (await this.applyGlobalPatch(patch, scope === "node" ? nodeId : void 0, cap)) await this.onScopedSettingsChanged(scope, cap, Object.keys(patch));
|
|
8924
|
+
}
|
|
8925
|
+
/**
|
|
8926
|
+
* Remove declared keys of one scope. A secret goes through {@link clearSecrets} — its keychain
|
|
8927
|
+
* value is released exactly as there — and the emptied row is then removed; every other key is
|
|
8928
|
+
* removed by an `undefined` patch (which a secret transform would read as "keep").
|
|
8929
|
+
*/
|
|
8930
|
+
async unsetScoped(scope, cap, keys, nodeId) {
|
|
8931
|
+
assertDeclaredKeys(keys, this.scopedKeys(await this.requireScopedSchema(scope, cap)));
|
|
8932
|
+
const target = scope === "node" ? nodeId : void 0;
|
|
8933
|
+
const tree = this.addonSecretTree();
|
|
8934
|
+
const secretKeys = keys.filter((key) => tree.has(key));
|
|
8935
|
+
const plainKeys = keys.filter((key) => !tree.has(key));
|
|
8936
|
+
let changed = false;
|
|
8937
|
+
if (plainKeys.length > 0) {
|
|
8938
|
+
const patch = Object.fromEntries(plainKeys.map((key) => [key, void 0]));
|
|
8939
|
+
changed = await this.applyGlobalPatch(patch, target, cap) || changed;
|
|
8940
|
+
}
|
|
8941
|
+
if (secretKeys.length > 0) {
|
|
8942
|
+
await this.clearSecretKeys(secretKeys, target, cap);
|
|
8943
|
+
const node = normalizeNodeId(target ?? this._ctx?.kernel?.localNodeId);
|
|
8944
|
+
const rows = secretKeys.map((key) => scope === "node" ? nodeScopedKey(key, node) : key);
|
|
8945
|
+
if (this._secretSettings !== null) await this._secretSettings.removeClearedKeys(rows);
|
|
8946
|
+
else await this._ctx?.settings?.writeAddonStore(Object.fromEntries(rows.map((row) => [row, void 0])));
|
|
8947
|
+
changed = true;
|
|
8948
|
+
}
|
|
8949
|
+
if (changed) await this.onScopedSettingsChanged(scope, cap, [...keys]);
|
|
8950
|
+
}
|
|
8951
|
+
/**
|
|
8952
|
+
* The hydrated form of one scope of one capability's settings (any
|
|
8953
|
+
* {@link scopedSettingsOverlay} applied), or `null` when the capability declares nothing there.
|
|
8954
|
+
*/
|
|
8955
|
+
async getScopedSettings(scope, cap, nodeId) {
|
|
8956
|
+
const schema = await this.declaredScopedSchema(scope, cap);
|
|
8957
|
+
if (schema === null) return null;
|
|
8958
|
+
const stored = this.narrowToScope(await this.readRawProjectedStore(nodeId, cap), schema);
|
|
8959
|
+
const overlay = await this.scopedSettingsOverlay(scope, cap, nodeId);
|
|
8960
|
+
return hydrateSchema(schema, overlay ? await this.overlayKeepingMarkers(stored, overlay) : stored, { inlineSecretsAsViews: true });
|
|
8961
|
+
}
|
|
8962
|
+
/**
|
|
8963
|
+
* The scoped schemas this addon serves: one entry per loaded (capability, scope), capabilities
|
|
8964
|
+
* in declaration order, scopes in {@link SCOPED_SETTINGS_SCOPES} order. `[]` when it declares
|
|
8965
|
+
* nothing.
|
|
8966
|
+
*/
|
|
8967
|
+
async listScopedSettings() {
|
|
8968
|
+
await this.loadScopedSchemas();
|
|
8969
|
+
return [...this._scopedByCap].flatMap(([cap, entries]) => entries.map((entry) => ({
|
|
8970
|
+
cap,
|
|
8971
|
+
scope: entry.scope,
|
|
8972
|
+
sectionIds: entry.schema.sections.map((section) => section.id)
|
|
8973
|
+
})));
|
|
8974
|
+
}
|
|
8975
|
+
/** The OPERATOR's write of declared keys of one scope (D787 secret semantics). */
|
|
8976
|
+
async updateScopedSettings(scope, cap, patch, nodeId) {
|
|
8977
|
+
this._operatorWriteDepth++;
|
|
8978
|
+
try {
|
|
8979
|
+
await this.writeScoped(scope, cap, patch, nodeId);
|
|
8980
|
+
} finally {
|
|
8981
|
+
this._operatorWriteDepth--;
|
|
8982
|
+
}
|
|
8983
|
+
}
|
|
8984
|
+
/**
|
|
8985
|
+
* The effective values (`stored ?? default`) of one scope, a secret as its `set` view — never
|
|
8986
|
+
* its value. `null` when the capability declares nothing for the scope.
|
|
8987
|
+
*/
|
|
8988
|
+
async readScopedValues(scope, cap, nodeId) {
|
|
8989
|
+
const schema = await this.declaredScopedSchema(scope, cap);
|
|
8990
|
+
if (schema === null) return null;
|
|
8991
|
+
const form = hydrateSchema(schema, this.narrowToScope(await this.readRawProjectedStore(nodeId, cap), schema), { inlineSecretsAsViews: true });
|
|
8992
|
+
return Object.fromEntries([...collectHydratedFieldValues(form)].filter(([, value]) => value !== void 0));
|
|
8993
|
+
}
|
|
8994
|
+
/**
|
|
8749
8995
|
* What the create wizard and the integration edit page render for one instance: the addon's
|
|
8750
8996
|
* per-instance schema when it declares one, else its global schema (what they always showed).
|
|
8751
8997
|
*/
|
|
8752
8998
|
async getIntegrationFormSchema(instance, nodeId) {
|
|
8753
8999
|
const scoped = await this.integrationFormSchema(instance);
|
|
8754
|
-
if (scoped === null) return this.
|
|
9000
|
+
if (scoped === null) return this.scopedForm(nodeId);
|
|
8755
9001
|
return hydrateSchema(scoped, {}, { inlineSecretsAsViews: true });
|
|
8756
9002
|
}
|
|
8757
|
-
|
|
8758
|
-
|
|
8759
|
-
|
|
8760
|
-
const schema = this.
|
|
8761
|
-
if (!schema)
|
|
8762
|
-
|
|
8763
|
-
const sections = [];
|
|
8764
|
-
for (const id of declared) {
|
|
8765
|
-
const section = byId.get(id);
|
|
8766
|
-
if (!section) throw new Error(`${this.constructor.name}: integrationSettingSections() names unknown section "${id}". Known sections: [${[...byId.keys()].join(", ")}].`);
|
|
8767
|
-
const fields = dropPerNodeFields(section.fields);
|
|
8768
|
-
if (fields.length === 0) continue;
|
|
8769
|
-
sections.push({
|
|
8770
|
-
...section,
|
|
8771
|
-
fields
|
|
8772
|
-
});
|
|
8773
|
-
}
|
|
8774
|
-
if (sections.length === 0) return null;
|
|
8775
|
-
const projected = await this.readRawProjectedStore(nodeId);
|
|
8776
|
-
return hydrateSchema({
|
|
8777
|
-
...schema,
|
|
8778
|
-
sections
|
|
8779
|
-
}, projected, { inlineSecretsAsViews: true });
|
|
9003
|
+
/** The form of the scoped schemas this addon declared, hydrated from its store. */
|
|
9004
|
+
async scopedForm(nodeId) {
|
|
9005
|
+
await this.loadScopedSchemas();
|
|
9006
|
+
const schema = this.scopedFormSchema();
|
|
9007
|
+
if (!schema) return { sections: [] };
|
|
9008
|
+
return hydrateSchema(schema, await this.readRawProjectedStore(nodeId), { inlineSecretsAsViews: true });
|
|
8780
9009
|
}
|
|
8781
9010
|
/**
|
|
8782
9011
|
* The raw addon store PROJECTED onto the target node's bare per-node keys:
|
|
@@ -8785,8 +9014,8 @@ var BaseAddon = class {
|
|
|
8785
9014
|
* bare fallback), all `@`-scoped and stray bare per-node keys are dropped.
|
|
8786
9015
|
* A no-op passthrough when the schema declares no `perNode` field.
|
|
8787
9016
|
*
|
|
8788
|
-
* This is the sanctioned way for
|
|
8789
|
-
* the store for custom
|
|
9017
|
+
* This is the sanctioned way for an addon that needs
|
|
9018
|
+
* the store for custom logic (option narrowing, value snapping) to
|
|
8790
9019
|
* read it per-node — never `ctx.settings.readAddonStore()` directly.
|
|
8791
9020
|
* `nodeId` omitted ⇒ the local node (node-blind injection from ctx).
|
|
8792
9021
|
*
|
|
@@ -8838,7 +9067,7 @@ var BaseAddon = class {
|
|
|
8838
9067
|
}
|
|
8839
9068
|
/**
|
|
8840
9069
|
* Whether ONE global key of this addon's store was written, read three-way
|
|
8841
|
-
* (D651). For a question a hydrated view cannot answer:
|
|
9070
|
+
* (D651). For a question a hydrated view cannot answer: a hydrated form
|
|
8842
9071
|
* reports `value ?? default`, so "the operator chose the default" and "nobody
|
|
8843
9072
|
* chose" look the same, and a failed read looks like both. A `perNode` key is
|
|
8844
9073
|
* not supported here: its stored name is scoped.
|
|
@@ -8872,7 +9101,7 @@ var BaseAddon = class {
|
|
|
8872
9101
|
}
|
|
8873
9102
|
/**
|
|
8874
9103
|
* The OPERATOR's write — a settings form or an admin API call, dispatched by
|
|
8875
|
-
* the kernel.
|
|
9104
|
+
* the kernel. The one in-process write of the addon blob that is not a scoped write; a secret
|
|
8876
9105
|
* the operator sends is stored as sent even when it equals a pre-keychain
|
|
8877
9106
|
* inline value: the operator re-entering a password is a change, an addon
|
|
8878
9107
|
* writing back what it read is not (D787).
|
|
@@ -8885,9 +9114,6 @@ var BaseAddon = class {
|
|
|
8885
9114
|
this._operatorWriteDepth--;
|
|
8886
9115
|
}
|
|
8887
9116
|
}
|
|
8888
|
-
async updateGlobalSettings(patch, nodeId) {
|
|
8889
|
-
await this.applyGlobalPatch(patch, nodeId);
|
|
8890
|
-
}
|
|
8891
9117
|
/**
|
|
8892
9118
|
* REMOVE stored secrets — their keychain values and their markers (D787).
|
|
8893
9119
|
*
|
|
@@ -8897,6 +9123,9 @@ var BaseAddon = class {
|
|
|
8897
9123
|
* a keychain (an older kernel) it writes `''`, as such code always did.
|
|
8898
9124
|
*/
|
|
8899
9125
|
async clearSecrets(keys, nodeId) {
|
|
9126
|
+
await this.clearSecretKeys(keys, nodeId);
|
|
9127
|
+
}
|
|
9128
|
+
async clearSecretKeys(keys, nodeId, cap) {
|
|
8900
9129
|
const tree = this.addonSecretTree();
|
|
8901
9130
|
const keychain = this._ctx?.secrets !== void 0;
|
|
8902
9131
|
const stored = keychain ? await this.readAddonStoreWithRetry() : {};
|
|
@@ -8909,25 +9138,26 @@ var BaseAddon = class {
|
|
|
8909
9138
|
const keychainStored = tree.has(key) || collectSecretMarkerRefs(stored[key]).length > 0;
|
|
8910
9139
|
patch[key] = keychain && keychainStored ? SECRET_CLEAR : "";
|
|
8911
9140
|
}
|
|
8912
|
-
await this.applyGlobalPatch(patch, nodeId);
|
|
9141
|
+
await this.applyGlobalPatch(patch, nodeId, cap);
|
|
8913
9142
|
}
|
|
8914
|
-
|
|
8915
|
-
|
|
8916
|
-
|
|
9143
|
+
/** Resolves `true` when the write changed stored values. */
|
|
9144
|
+
async applyGlobalPatch(barePatch, nodeId, cap) {
|
|
9145
|
+
await this.loadScopedSchemas(cap);
|
|
9146
|
+
const keys = this.perNodeKeys(cap);
|
|
8917
9147
|
const localNode = normalizeNodeId(this._ctx?.kernel?.localNodeId);
|
|
8918
9148
|
const target = normalizeNodeId(nodeId ?? this._ctx?.kernel?.localNodeId);
|
|
8919
9149
|
const scoped = keys.size > 0 ? scopePatch(barePatch, keys, target) : barePatch;
|
|
8920
9150
|
const handle = this._secretSettings;
|
|
8921
9151
|
if (handle !== null) {
|
|
8922
9152
|
const { changed } = await handle.writeAddonStore(scoped);
|
|
8923
|
-
if (!changed) return;
|
|
9153
|
+
if (!changed) return false;
|
|
8924
9154
|
} else await this._ctx?.settings?.writeAddonStore(scoped);
|
|
8925
|
-
if (target !== localNode) return;
|
|
9155
|
+
if (target !== localNode) return true;
|
|
8926
9156
|
await this.resolveConfig();
|
|
8927
9157
|
await this.onConfigChanged();
|
|
8928
9158
|
this.emitLifecycle(EventCategory.AddonUpdated, { level: "global" });
|
|
8929
|
-
|
|
8930
|
-
|
|
9159
|
+
this.maybeAutoRestart(Object.keys(barePatch), this.loadedScopedSchemas().map((entry) => entry.schema));
|
|
9160
|
+
return true;
|
|
8931
9161
|
}
|
|
8932
9162
|
/**
|
|
8933
9163
|
* The set of field keys the global settings schema declares `perNode: true`
|
|
@@ -8964,10 +9194,7 @@ var BaseAddon = class {
|
|
|
8964
9194
|
this._nodeKeysByCap = /* @__PURE__ */ new Map();
|
|
8965
9195
|
this._addonSecretTree = null;
|
|
8966
9196
|
}
|
|
8967
|
-
/**
|
|
8968
|
-
* The form the settings API serves while an addon declares no {@link globalSettingsSchema}: the
|
|
8969
|
-
* sections of its scoped schemas, so dropping the old hook does not blank the form.
|
|
8970
|
-
*/
|
|
9197
|
+
/** The form of an addon's scoped schemas: their sections, each shown once. */
|
|
8971
9198
|
scopedFormSchema(cap) {
|
|
8972
9199
|
const byId = /* @__PURE__ */ new Map();
|
|
8973
9200
|
for (const entry of this.loadedScopedSchemas(cap)) for (const section of entry.schema.sections) if (!byId.has(section.id)) byId.set(section.id, section);
|
|
@@ -8979,8 +9206,7 @@ var BaseAddon = class {
|
|
|
8979
9206
|
return [...this._scopedByCap.values()].flat();
|
|
8980
9207
|
}
|
|
8981
9208
|
/**
|
|
8982
|
-
* The field keys that are stored per node: every field of a {@link nodeSettingsSchema}
|
|
8983
|
-
* the fields the legacy {@link globalSettingsSchema} still marks `perNode: true`. Derived once
|
|
9209
|
+
* The field keys that are stored per node: every field of a {@link nodeSettingsSchema}. Derived once
|
|
8984
9210
|
* per `cap` argument and memoized (schemas are static declarations). Empty set ⇒ every
|
|
8985
9211
|
* per-node code path is bypassed and the settings API behaves like the node-agnostic one.
|
|
8986
9212
|
* Call {@link loadScopedSchemas} first (the async seams do).
|
|
@@ -8989,8 +9215,7 @@ var BaseAddon = class {
|
|
|
8989
9215
|
const cacheKey = cap ?? "";
|
|
8990
9216
|
const cached = this._nodeKeysByCap.get(cacheKey);
|
|
8991
9217
|
if (cached) return cached;
|
|
8992
|
-
const
|
|
8993
|
-
const keys = new Set(legacy ? legacy.sections.flatMap((section) => collectPerNodeFieldKeys(section.fields)) : []);
|
|
9218
|
+
const keys = /* @__PURE__ */ new Set();
|
|
8994
9219
|
for (const { scope, schema } of this.loadedScopedSchemas(cap)) {
|
|
8995
9220
|
if (scope !== "node") continue;
|
|
8996
9221
|
for (const section of schema.sections) for (const key of collectValueFieldKeys(section.fields)) keys.add(key);
|
|
@@ -9208,8 +9433,6 @@ var BaseAddon = class {
|
|
|
9208
9433
|
}
|
|
9209
9434
|
declaredKeySet() {
|
|
9210
9435
|
const keys = new Set(Object.keys(this.defaults));
|
|
9211
|
-
const schema = this.globalSettingsSchema();
|
|
9212
|
-
if (schema) for (const section of schema.sections) for (const key of collectFieldKeys(section.fields)) keys.add(key);
|
|
9213
9436
|
for (const { schema: scoped } of this.loadedScopedSchemas()) for (const section of scoped.sections) for (const key of collectFieldKeys(section.fields)) keys.add(key);
|
|
9214
9437
|
for (const key of this._declaredStateKeys) keys.add(key);
|
|
9215
9438
|
for (const path of this.secretStatePaths) {
|
|
@@ -9307,7 +9530,7 @@ var BaseAddon = class {
|
|
|
9307
9530
|
/** The addon store's secret tree: schema fields by TYPE, plus `secretStatePaths`. */
|
|
9308
9531
|
addonSecretTree() {
|
|
9309
9532
|
if (this._addonSecretTree === null) {
|
|
9310
|
-
const tree = new Map(
|
|
9533
|
+
const tree = /* @__PURE__ */ new Map();
|
|
9311
9534
|
for (const { schema } of this.loadedScopedSchemas()) for (const [key, node] of secretTreeFromSchema(schema)) tree.set(key, node);
|
|
9312
9535
|
this._addonSecretTree = mergeSecretStatePaths(tree, this.secretStatePaths);
|
|
9313
9536
|
}
|
|
@@ -9519,47 +9742,6 @@ function classifyStoreError(err) {
|
|
|
9519
9742
|
if (TRANSPORT_PHRASES.some((f) => message.includes(f))) return "transport";
|
|
9520
9743
|
return "permanent";
|
|
9521
9744
|
}
|
|
9522
|
-
/**
|
|
9523
|
-
* Collect the keys of every field marked `perNode: true`, recursing into
|
|
9524
|
-
* layout containers (`group` fields and `sub-tabs` tabs) the same way
|
|
9525
|
-
* `hydrateSchema` does. Valueless structural fields (separator/info/…)
|
|
9526
|
-
* don't declare `perNode` and are excluded by the `in` narrowing.
|
|
9527
|
-
*/
|
|
9528
|
-
/**
|
|
9529
|
-
* The same fields with every `perNode: true` one removed, recursing into layout
|
|
9530
|
-
* containers exactly as {@link collectPerNodeFieldKeys} does. A container left
|
|
9531
|
-
* with no child is dropped rather than rendered empty.
|
|
9532
|
-
*
|
|
9533
|
-
* Used by `getIntegrationSettings`: an integration is not a node, so a field
|
|
9534
|
-
* whose store key is `<key>@<nodeId>` has no node to belong to there.
|
|
9535
|
-
*/
|
|
9536
|
-
function dropPerNodeFields(fields) {
|
|
9537
|
-
const kept = [];
|
|
9538
|
-
for (const field of fields) {
|
|
9539
|
-
if (field.type === "group") {
|
|
9540
|
-
const inner = dropPerNodeFields(field.fields);
|
|
9541
|
-
if (inner.length > 0) kept.push({
|
|
9542
|
-
...field,
|
|
9543
|
-
fields: inner
|
|
9544
|
-
});
|
|
9545
|
-
continue;
|
|
9546
|
-
}
|
|
9547
|
-
if (field.type === "sub-tabs") {
|
|
9548
|
-
const tabs = field.tabs.map((tab) => ({
|
|
9549
|
-
...tab,
|
|
9550
|
-
fields: dropPerNodeFields(tab.fields)
|
|
9551
|
-
})).filter((tab) => tab.fields.length > 0);
|
|
9552
|
-
if (tabs.length > 0) kept.push({
|
|
9553
|
-
...field,
|
|
9554
|
-
tabs
|
|
9555
|
-
});
|
|
9556
|
-
continue;
|
|
9557
|
-
}
|
|
9558
|
-
if ("perNode" in field && field.perNode === true) continue;
|
|
9559
|
-
kept.push(field);
|
|
9560
|
-
}
|
|
9561
|
-
return kept;
|
|
9562
|
-
}
|
|
9563
9745
|
/** The keys of the value-holding fields, recursing into layout containers. */
|
|
9564
9746
|
function collectValueFieldKeys(fields) {
|
|
9565
9747
|
const collected = [];
|
|
@@ -9592,21 +9774,6 @@ function collectFieldKeys(fields) {
|
|
|
9592
9774
|
}
|
|
9593
9775
|
return collected;
|
|
9594
9776
|
}
|
|
9595
|
-
function collectPerNodeFieldKeys(fields) {
|
|
9596
|
-
const collected = [];
|
|
9597
|
-
for (const field of fields) {
|
|
9598
|
-
if (field.type === "group") {
|
|
9599
|
-
collected.push(...collectPerNodeFieldKeys(field.fields));
|
|
9600
|
-
continue;
|
|
9601
|
-
}
|
|
9602
|
-
if (field.type === "sub-tabs") {
|
|
9603
|
-
for (const tab of field.tabs) collected.push(...collectPerNodeFieldKeys(tab.fields));
|
|
9604
|
-
continue;
|
|
9605
|
-
}
|
|
9606
|
-
if ("perNode" in field && field.perNode === true) collected.push(field.key);
|
|
9607
|
-
}
|
|
9608
|
-
return collected;
|
|
9609
|
-
}
|
|
9610
9777
|
/**
|
|
9611
9778
|
* Normalize an `ICamstackAddon.initialize()` return value into the
|
|
9612
9779
|
* `AddonInitResult` envelope. Arrays are wrapped into `{ providers }`;
|
|
@@ -9622,30 +9789,98 @@ function normalizeAddonInitResult(result) {
|
|
|
9622
9789
|
if (Array.isArray(result)) return { providers: result };
|
|
9623
9790
|
return result;
|
|
9624
9791
|
}
|
|
9792
|
+
object({
|
|
9793
|
+
field: string().min(1),
|
|
9794
|
+
on: literal("advance")
|
|
9795
|
+
});
|
|
9625
9796
|
/**
|
|
9626
|
-
*
|
|
9627
|
-
*
|
|
9628
|
-
*
|
|
9797
|
+
* Output schema shared by the contribution + live methods.
|
|
9798
|
+
*
|
|
9799
|
+
* Mirrors the `ConfigUISchemaWithValues` shape (sections[] + optional
|
|
9800
|
+
* tabs[]) without importing from `../interfaces/config-ui.js` — a
|
|
9801
|
+
* concrete-but-lenient Zod object keeps tRPC output inference happy
|
|
9802
|
+
* (using `z.unknown()` here collapses unrelated router branches to
|
|
9803
|
+
* `unknown` when the generator re-inlines the huge AppRouter type).
|
|
9804
|
+
*
|
|
9805
|
+
* `.passthrough()` on sections/fields accepts whatever FormBuilder
|
|
9806
|
+
* extensions the caller adds (showWhen, displayScale, …) without
|
|
9807
|
+
* rebuilding every time a new field kind is introduced.
|
|
9629
9808
|
*/
|
|
9630
|
-
var
|
|
9631
|
-
|
|
9632
|
-
|
|
9633
|
-
|
|
9634
|
-
|
|
9635
|
-
|
|
9636
|
-
|
|
9637
|
-
|
|
9638
|
-
|
|
9639
|
-
|
|
9640
|
-
|
|
9641
|
-
|
|
9642
|
-
|
|
9643
|
-
|
|
9644
|
-
|
|
9645
|
-
|
|
9646
|
-
|
|
9647
|
-
|
|
9809
|
+
var ContributionSectionSchema = object({
|
|
9810
|
+
id: string(),
|
|
9811
|
+
title: string(),
|
|
9812
|
+
description: string().optional(),
|
|
9813
|
+
style: _enum(["card", "accordion"]).optional(),
|
|
9814
|
+
defaultCollapsed: boolean().optional(),
|
|
9815
|
+
columns: union([
|
|
9816
|
+
literal(1),
|
|
9817
|
+
literal(2),
|
|
9818
|
+
literal(3),
|
|
9819
|
+
literal(4)
|
|
9820
|
+
]).optional(),
|
|
9821
|
+
tab: string().optional(),
|
|
9822
|
+
location: _enum([
|
|
9823
|
+
"settings",
|
|
9824
|
+
"top-tab",
|
|
9825
|
+
"hero"
|
|
9826
|
+
]).optional(),
|
|
9827
|
+
order: number().optional(),
|
|
9828
|
+
fields: array(any())
|
|
9648
9829
|
});
|
|
9830
|
+
object({
|
|
9831
|
+
tabs: array(object({
|
|
9832
|
+
id: string(),
|
|
9833
|
+
label: string(),
|
|
9834
|
+
icon: string(),
|
|
9835
|
+
order: number().optional()
|
|
9836
|
+
})).optional(),
|
|
9837
|
+
sections: array(ContributionSectionSchema)
|
|
9838
|
+
}).nullable();
|
|
9839
|
+
object({ deviceId: number() }), object({ deviceId: number() }), object({
|
|
9840
|
+
deviceId: number(),
|
|
9841
|
+
patch: record(string(), unknown())
|
|
9842
|
+
}), object({ success: literal(true) });
|
|
9843
|
+
object({ deviceId: number() }), unknown().nullable();
|
|
9844
|
+
function method(input, output, options) {
|
|
9845
|
+
return {
|
|
9846
|
+
input,
|
|
9847
|
+
output,
|
|
9848
|
+
kind: options?.kind ?? "query",
|
|
9849
|
+
...options?.auth !== void 0 ? { auth: options.auth } : {},
|
|
9850
|
+
...options?.access !== void 0 ? { access: options.access } : {},
|
|
9851
|
+
...options?.role !== void 0 ? { role: options.role } : {},
|
|
9852
|
+
...options?.caller !== void 0 ? { caller: options.caller } : {},
|
|
9853
|
+
timeoutMs: options?.timeoutMs
|
|
9854
|
+
};
|
|
9855
|
+
}
|
|
9856
|
+
/**
|
|
9857
|
+
* A wrapper/system-only method: served exclusively by the cap's system-level
|
|
9858
|
+
* provider (`InferProvider`), and OPTIONAL on `InferNativeProvider` so per-device
|
|
9859
|
+
* driver natives don't stub out a wrapper concern (e.g. a cross-device cache
|
|
9860
|
+
* overview). The `systemOnly: true` literal is what `InferNativeProvider` keys on.
|
|
9861
|
+
*/
|
|
9862
|
+
function systemMethod(input, output, options) {
|
|
9863
|
+
return {
|
|
9864
|
+
...method(input, output, options),
|
|
9865
|
+
systemOnly: true
|
|
9866
|
+
};
|
|
9867
|
+
}
|
|
9868
|
+
/**
|
|
9869
|
+
* A method a SOURCE of a collection cap may legitimately not serve — OPTIONAL
|
|
9870
|
+
* on `InferProvider`. The `providerOptional: true` literal is what
|
|
9871
|
+
* `InferProvider` keys on; see {@link CapabilityMethodSchema.providerOptional}
|
|
9872
|
+
* for when this is the honest answer and when it is a soft stub.
|
|
9873
|
+
*/
|
|
9874
|
+
function optionalMethod(input, output, options) {
|
|
9875
|
+
return {
|
|
9876
|
+
...method(input, output, options),
|
|
9877
|
+
providerOptional: true
|
|
9878
|
+
};
|
|
9879
|
+
}
|
|
9880
|
+
/** Shorthand to define an event schema */
|
|
9881
|
+
function event(data) {
|
|
9882
|
+
return { data };
|
|
9883
|
+
}
|
|
9649
9884
|
function defOf(schema) {
|
|
9650
9885
|
const zodBag = Reflect.get(schema, "_zod");
|
|
9651
9886
|
if (typeof zodBag !== "object" || zodBag === null) return {};
|
|
@@ -9902,98 +10137,30 @@ function defineEntryKind(name, spec) {
|
|
|
9902
10137
|
if (defined === void 0) throw new DeclarationRefusedError(`entry kind "${name}" was not built`);
|
|
9903
10138
|
return defined;
|
|
9904
10139
|
}
|
|
9905
|
-
object({
|
|
9906
|
-
field: string().min(1),
|
|
9907
|
-
on: literal("advance")
|
|
9908
|
-
});
|
|
9909
10140
|
/**
|
|
9910
|
-
*
|
|
9911
|
-
*
|
|
9912
|
-
*
|
|
9913
|
-
* tabs[]) without importing from `../interfaces/config-ui.js` — a
|
|
9914
|
-
* concrete-but-lenient Zod object keeps tRPC output inference happy
|
|
9915
|
-
* (using `z.unknown()` here collapses unrelated router branches to
|
|
9916
|
-
* `unknown` when the generator re-inlines the huge AppRouter type).
|
|
9917
|
-
*
|
|
9918
|
-
* `.passthrough()` on sections/fields accepts whatever FormBuilder
|
|
9919
|
-
* extensions the caller adds (showWhen, displayScale, …) without
|
|
9920
|
-
* rebuilding every time a new field kind is introduced.
|
|
10141
|
+
* The share-view scope kinds a share-link token can carry. The hub mints
|
|
10142
|
+
* and validates them (`ShareViewGrantSchema` builds its
|
|
10143
|
+
* enum from this list); a data plane names the kinds it ACCEPTS in `share`.
|
|
9921
10144
|
*/
|
|
9922
|
-
var
|
|
9923
|
-
|
|
9924
|
-
|
|
9925
|
-
|
|
9926
|
-
|
|
9927
|
-
|
|
9928
|
-
|
|
9929
|
-
|
|
9930
|
-
|
|
9931
|
-
|
|
9932
|
-
|
|
9933
|
-
|
|
9934
|
-
|
|
9935
|
-
|
|
9936
|
-
|
|
9937
|
-
|
|
9938
|
-
|
|
9939
|
-
|
|
9940
|
-
order: number().optional(),
|
|
9941
|
-
fields: array(any())
|
|
10145
|
+
var SHARE_VIEW_KINDS = ["grid-view", "events-view"];
|
|
10146
|
+
/** The wire shape of {@link PeerBytesTicket} — see the type for what it is. */
|
|
10147
|
+
var PeerBytesTicketSchema = object({
|
|
10148
|
+
/** `http://127.0.0.1:<port>/<token>`. One `GET` takes it. */
|
|
10149
|
+
url: string().min(1),
|
|
10150
|
+
/**
|
|
10151
|
+
* The HOST node this URL means something on — the hub or a named agent,
|
|
10152
|
+
* never a runner. {@link AddonPeerBytes.open} compares it to its own and
|
|
10153
|
+
* refuses `cross-node` by name when they differ, without dialling.
|
|
10154
|
+
*/
|
|
10155
|
+
hostNodeId: string().min(1),
|
|
10156
|
+
expiresAtMs: number().int().nonnegative(),
|
|
10157
|
+
/**
|
|
10158
|
+
* What the producer DECLARED the body to be, when it knows — `null` when it
|
|
10159
|
+
* does not. Never `0` for unknown (D393): a consumer sizing a bound off this
|
|
10160
|
+
* must be able to tell "the producer did not say" from "the body is empty".
|
|
10161
|
+
*/
|
|
10162
|
+
declaredBytes: number().int().nonnegative().nullable()
|
|
9942
10163
|
});
|
|
9943
|
-
object({
|
|
9944
|
-
tabs: array(object({
|
|
9945
|
-
id: string(),
|
|
9946
|
-
label: string(),
|
|
9947
|
-
icon: string(),
|
|
9948
|
-
order: number().optional()
|
|
9949
|
-
})).optional(),
|
|
9950
|
-
sections: array(ContributionSectionSchema)
|
|
9951
|
-
}).nullable();
|
|
9952
|
-
object({ deviceId: number() }), object({ deviceId: number() }), object({
|
|
9953
|
-
deviceId: number(),
|
|
9954
|
-
patch: record(string(), unknown())
|
|
9955
|
-
}), object({ success: literal(true) });
|
|
9956
|
-
object({ deviceId: number() }), unknown().nullable();
|
|
9957
|
-
function method(input, output, options) {
|
|
9958
|
-
return {
|
|
9959
|
-
input,
|
|
9960
|
-
output,
|
|
9961
|
-
kind: options?.kind ?? "query",
|
|
9962
|
-
...options?.auth !== void 0 ? { auth: options.auth } : {},
|
|
9963
|
-
...options?.access !== void 0 ? { access: options.access } : {},
|
|
9964
|
-
...options?.role !== void 0 ? { role: options.role } : {},
|
|
9965
|
-
...options?.caller !== void 0 ? { caller: options.caller } : {},
|
|
9966
|
-
timeoutMs: options?.timeoutMs
|
|
9967
|
-
};
|
|
9968
|
-
}
|
|
9969
|
-
/**
|
|
9970
|
-
* A wrapper/system-only method: served exclusively by the cap's system-level
|
|
9971
|
-
* provider (`InferProvider`), and OPTIONAL on `InferNativeProvider` so per-device
|
|
9972
|
-
* driver natives don't stub out a wrapper concern (e.g. a cross-device cache
|
|
9973
|
-
* overview). The `systemOnly: true` literal is what `InferNativeProvider` keys on.
|
|
9974
|
-
*/
|
|
9975
|
-
function systemMethod(input, output, options) {
|
|
9976
|
-
return {
|
|
9977
|
-
...method(input, output, options),
|
|
9978
|
-
systemOnly: true
|
|
9979
|
-
};
|
|
9980
|
-
}
|
|
9981
|
-
/**
|
|
9982
|
-
* A method a SOURCE of a collection cap may legitimately not serve — OPTIONAL
|
|
9983
|
-
* on `InferProvider`. The `providerOptional: true` literal is what
|
|
9984
|
-
* `InferProvider` keys on; see {@link CapabilityMethodSchema.providerOptional}
|
|
9985
|
-
* for when this is the honest answer and when it is a soft stub.
|
|
9986
|
-
*/
|
|
9987
|
-
function optionalMethod(input, output, options) {
|
|
9988
|
-
return {
|
|
9989
|
-
...method(input, output, options),
|
|
9990
|
-
providerOptional: true
|
|
9991
|
-
};
|
|
9992
|
-
}
|
|
9993
|
-
/** Shorthand to define an event schema */
|
|
9994
|
-
function event(data) {
|
|
9995
|
-
return { data };
|
|
9996
|
-
}
|
|
9997
10164
|
var READING_QUANTITIES = [
|
|
9998
10165
|
"temperature",
|
|
9999
10166
|
"pressure",
|
|
@@ -10584,7 +10751,6 @@ var CAP_NAMES = Object.freeze([
|
|
|
10584
10751
|
"climate-control",
|
|
10585
10752
|
"color",
|
|
10586
10753
|
"composer",
|
|
10587
|
-
"connection-test",
|
|
10588
10754
|
"connectivity",
|
|
10589
10755
|
"consumables",
|
|
10590
10756
|
"contact",
|
|
@@ -10674,7 +10840,6 @@ var CAP_NAMES = Object.freeze([
|
|
|
10674
10840
|
"notifier",
|
|
10675
10841
|
"numeric-sensor",
|
|
10676
10842
|
"oauth-integration",
|
|
10677
|
-
"oidc-connections",
|
|
10678
10843
|
"osd",
|
|
10679
10844
|
"osd-manager",
|
|
10680
10845
|
"pet-feeder",
|
|
@@ -12381,13 +12546,25 @@ Object.freeze({
|
|
|
12381
12546
|
"path": "temperature",
|
|
12382
12547
|
"valueType": "number"
|
|
12383
12548
|
}],
|
|
12384
|
-
"timed-run": [
|
|
12385
|
-
|
|
12386
|
-
|
|
12387
|
-
|
|
12388
|
-
|
|
12389
|
-
|
|
12390
|
-
|
|
12549
|
+
"timed-run": [
|
|
12550
|
+
{
|
|
12551
|
+
"path": "activeUntil",
|
|
12552
|
+
"valueType": "number"
|
|
12553
|
+
},
|
|
12554
|
+
{
|
|
12555
|
+
"path": "requestedBy",
|
|
12556
|
+
"valueType": "string"
|
|
12557
|
+
},
|
|
12558
|
+
{
|
|
12559
|
+
"path": "quickRun.duration",
|
|
12560
|
+
"valueType": "number"
|
|
12561
|
+
},
|
|
12562
|
+
{
|
|
12563
|
+
"path": "quickRun.unit",
|
|
12564
|
+
"valueType": "enum",
|
|
12565
|
+
"enumValues": ["s", "min"]
|
|
12566
|
+
}
|
|
12567
|
+
],
|
|
12391
12568
|
"update": [
|
|
12392
12569
|
{
|
|
12393
12570
|
"path": "currentVersion",
|
|
@@ -12566,8 +12743,7 @@ Object.freeze({
|
|
|
12566
12743
|
"device-provider": { "reloadDevice": 18e4 },
|
|
12567
12744
|
"llm": {
|
|
12568
12745
|
"generate": 6e5,
|
|
12569
|
-
"generateVision": 6e5
|
|
12570
|
-
"testProfile": 6e5
|
|
12746
|
+
"generateVision": 6e5
|
|
12571
12747
|
},
|
|
12572
12748
|
"llm-runtime": {
|
|
12573
12749
|
"complete": 6e5,
|
|
@@ -12604,8 +12780,7 @@ Object.freeze({
|
|
|
12604
12780
|
"offerArtifact": 3e5,
|
|
12605
12781
|
"readResult": 3e5,
|
|
12606
12782
|
"submitJob": 18e5,
|
|
12607
|
-
"uploadDataset": 72e5
|
|
12608
|
-
"validateCredentials": 3e4
|
|
12783
|
+
"uploadDataset": 72e5
|
|
12609
12784
|
}
|
|
12610
12785
|
});
|
|
12611
12786
|
object({
|
|
@@ -12627,7 +12802,7 @@ function userError(code, params, englishFallback) {
|
|
|
12627
12802
|
return new CamstackError(code, params, englishFallback);
|
|
12628
12803
|
}
|
|
12629
12804
|
//#endregion
|
|
12630
|
-
//#region ../types/dist/composition-
|
|
12805
|
+
//#region ../types/dist/composition-Bx0JvKUU.mjs
|
|
12631
12806
|
/**
|
|
12632
12807
|
* The ffmpeg build every CamStack node downloads, per platform and arch.
|
|
12633
12808
|
*
|
|
@@ -13789,6 +13964,387 @@ var NodeColorIdSchema = _enum([
|
|
|
13789
13964
|
"node-h"
|
|
13790
13965
|
]);
|
|
13791
13966
|
//#endregion
|
|
13967
|
+
//#region ../types/dist/convert-BAzH15HU.mjs
|
|
13968
|
+
/**
|
|
13969
|
+
* Frozen unit → spec table. `•` in the doc marks each dimension's canonical
|
|
13970
|
+
* unit (`factor: 1, offset: 0`). °F derives from `°C = (°F − 32) × 5/9` ⇒
|
|
13971
|
+
* `factor = 5/9`, `offset = -160/9` (kept as exact expressions, not rounded
|
|
13972
|
+
* decimals). K derives from `°C = K − 273.15`.
|
|
13973
|
+
*/
|
|
13974
|
+
var UNIT_TABLE = {
|
|
13975
|
+
"°C": {
|
|
13976
|
+
dimension: "temperature",
|
|
13977
|
+
factor: 1,
|
|
13978
|
+
offset: 0
|
|
13979
|
+
},
|
|
13980
|
+
"°F": {
|
|
13981
|
+
dimension: "temperature",
|
|
13982
|
+
factor: 5 / 9,
|
|
13983
|
+
offset: -160 / 9
|
|
13984
|
+
},
|
|
13985
|
+
K: {
|
|
13986
|
+
dimension: "temperature",
|
|
13987
|
+
factor: 1,
|
|
13988
|
+
offset: -273.15
|
|
13989
|
+
},
|
|
13990
|
+
hPa: {
|
|
13991
|
+
dimension: "pressure",
|
|
13992
|
+
factor: 1,
|
|
13993
|
+
offset: 0
|
|
13994
|
+
},
|
|
13995
|
+
kPa: {
|
|
13996
|
+
dimension: "pressure",
|
|
13997
|
+
factor: 10,
|
|
13998
|
+
offset: 0
|
|
13999
|
+
},
|
|
14000
|
+
Pa: {
|
|
14001
|
+
dimension: "pressure",
|
|
14002
|
+
factor: .01,
|
|
14003
|
+
offset: 0
|
|
14004
|
+
},
|
|
14005
|
+
mbar: {
|
|
14006
|
+
dimension: "pressure",
|
|
14007
|
+
factor: 1,
|
|
14008
|
+
offset: 0
|
|
14009
|
+
},
|
|
14010
|
+
bar: {
|
|
14011
|
+
dimension: "pressure",
|
|
14012
|
+
factor: 1e3,
|
|
14013
|
+
offset: 0
|
|
14014
|
+
},
|
|
14015
|
+
inHg: {
|
|
14016
|
+
dimension: "pressure",
|
|
14017
|
+
factor: 33.8639,
|
|
14018
|
+
offset: 0
|
|
14019
|
+
},
|
|
14020
|
+
mmHg: {
|
|
14021
|
+
dimension: "pressure",
|
|
14022
|
+
factor: 1.33322,
|
|
14023
|
+
offset: 0
|
|
14024
|
+
},
|
|
14025
|
+
psi: {
|
|
14026
|
+
dimension: "pressure",
|
|
14027
|
+
factor: 68.9476,
|
|
14028
|
+
offset: 0
|
|
14029
|
+
},
|
|
14030
|
+
"m/s": {
|
|
14031
|
+
dimension: "speed",
|
|
14032
|
+
factor: 1,
|
|
14033
|
+
offset: 0
|
|
14034
|
+
},
|
|
14035
|
+
"km/h": {
|
|
14036
|
+
dimension: "speed",
|
|
14037
|
+
factor: 1 / 3.6,
|
|
14038
|
+
offset: 0
|
|
14039
|
+
},
|
|
14040
|
+
mph: {
|
|
14041
|
+
dimension: "speed",
|
|
14042
|
+
factor: .44704,
|
|
14043
|
+
offset: 0
|
|
14044
|
+
},
|
|
14045
|
+
kn: {
|
|
14046
|
+
dimension: "speed",
|
|
14047
|
+
factor: .514444,
|
|
14048
|
+
offset: 0
|
|
14049
|
+
},
|
|
14050
|
+
"mm/h": {
|
|
14051
|
+
dimension: "precipitation-rate",
|
|
14052
|
+
factor: 1,
|
|
14053
|
+
offset: 0
|
|
14054
|
+
},
|
|
14055
|
+
"in/h": {
|
|
14056
|
+
dimension: "precipitation-rate",
|
|
14057
|
+
factor: 25.4,
|
|
14058
|
+
offset: 0
|
|
14059
|
+
},
|
|
14060
|
+
m: {
|
|
14061
|
+
dimension: "length",
|
|
14062
|
+
factor: 1,
|
|
14063
|
+
offset: 0
|
|
14064
|
+
},
|
|
14065
|
+
mm: {
|
|
14066
|
+
dimension: "length",
|
|
14067
|
+
factor: .001,
|
|
14068
|
+
offset: 0
|
|
14069
|
+
},
|
|
14070
|
+
cm: {
|
|
14071
|
+
dimension: "length",
|
|
14072
|
+
factor: .01,
|
|
14073
|
+
offset: 0
|
|
14074
|
+
},
|
|
14075
|
+
km: {
|
|
14076
|
+
dimension: "length",
|
|
14077
|
+
factor: 1e3,
|
|
14078
|
+
offset: 0
|
|
14079
|
+
},
|
|
14080
|
+
in: {
|
|
14081
|
+
dimension: "length",
|
|
14082
|
+
factor: .0254,
|
|
14083
|
+
offset: 0
|
|
14084
|
+
},
|
|
14085
|
+
ft: {
|
|
14086
|
+
dimension: "length",
|
|
14087
|
+
factor: .3048,
|
|
14088
|
+
offset: 0
|
|
14089
|
+
},
|
|
14090
|
+
mi: {
|
|
14091
|
+
dimension: "length",
|
|
14092
|
+
factor: 1609.344,
|
|
14093
|
+
offset: 0
|
|
14094
|
+
},
|
|
14095
|
+
"m²": {
|
|
14096
|
+
dimension: "area",
|
|
14097
|
+
factor: 1,
|
|
14098
|
+
offset: 0
|
|
14099
|
+
},
|
|
14100
|
+
lx: {
|
|
14101
|
+
dimension: "illuminance",
|
|
14102
|
+
factor: 1,
|
|
14103
|
+
offset: 0
|
|
14104
|
+
},
|
|
14105
|
+
"W/m²": {
|
|
14106
|
+
dimension: "irradiance",
|
|
14107
|
+
factor: 1,
|
|
14108
|
+
offset: 0
|
|
14109
|
+
},
|
|
14110
|
+
W: {
|
|
14111
|
+
dimension: "power",
|
|
14112
|
+
factor: 1,
|
|
14113
|
+
offset: 0
|
|
14114
|
+
},
|
|
14115
|
+
kW: {
|
|
14116
|
+
dimension: "power",
|
|
14117
|
+
factor: 1e3,
|
|
14118
|
+
offset: 0
|
|
14119
|
+
},
|
|
14120
|
+
VA: {
|
|
14121
|
+
dimension: "apparent-power",
|
|
14122
|
+
factor: 1,
|
|
14123
|
+
offset: 0
|
|
14124
|
+
},
|
|
14125
|
+
Wh: {
|
|
14126
|
+
dimension: "energy",
|
|
14127
|
+
factor: 1,
|
|
14128
|
+
offset: 0
|
|
14129
|
+
},
|
|
14130
|
+
kWh: {
|
|
14131
|
+
dimension: "energy",
|
|
14132
|
+
factor: 1e3,
|
|
14133
|
+
offset: 0
|
|
14134
|
+
},
|
|
14135
|
+
MWh: {
|
|
14136
|
+
dimension: "energy",
|
|
14137
|
+
factor: 1e6,
|
|
14138
|
+
offset: 0
|
|
14139
|
+
},
|
|
14140
|
+
V: {
|
|
14141
|
+
dimension: "voltage",
|
|
14142
|
+
factor: 1,
|
|
14143
|
+
offset: 0
|
|
14144
|
+
},
|
|
14145
|
+
mV: {
|
|
14146
|
+
dimension: "voltage",
|
|
14147
|
+
factor: .001,
|
|
14148
|
+
offset: 0
|
|
14149
|
+
},
|
|
14150
|
+
A: {
|
|
14151
|
+
dimension: "current",
|
|
14152
|
+
factor: 1,
|
|
14153
|
+
offset: 0
|
|
14154
|
+
},
|
|
14155
|
+
mA: {
|
|
14156
|
+
dimension: "current",
|
|
14157
|
+
factor: .001,
|
|
14158
|
+
offset: 0
|
|
14159
|
+
},
|
|
14160
|
+
ppm: {
|
|
14161
|
+
dimension: "concentration-volume",
|
|
14162
|
+
factor: 1,
|
|
14163
|
+
offset: 0
|
|
14164
|
+
},
|
|
14165
|
+
ppb: {
|
|
14166
|
+
dimension: "concentration-volume",
|
|
14167
|
+
factor: .001,
|
|
14168
|
+
offset: 0
|
|
14169
|
+
},
|
|
14170
|
+
"µg/m³": {
|
|
14171
|
+
dimension: "concentration-mass",
|
|
14172
|
+
factor: 1,
|
|
14173
|
+
offset: 0
|
|
14174
|
+
},
|
|
14175
|
+
"mg/m³": {
|
|
14176
|
+
dimension: "concentration-mass",
|
|
14177
|
+
factor: 1e3,
|
|
14178
|
+
offset: 0
|
|
14179
|
+
},
|
|
14180
|
+
kg: {
|
|
14181
|
+
dimension: "mass",
|
|
14182
|
+
factor: 1,
|
|
14183
|
+
offset: 0
|
|
14184
|
+
},
|
|
14185
|
+
g: {
|
|
14186
|
+
dimension: "mass",
|
|
14187
|
+
factor: .001,
|
|
14188
|
+
offset: 0
|
|
14189
|
+
},
|
|
14190
|
+
lb: {
|
|
14191
|
+
dimension: "mass",
|
|
14192
|
+
factor: .453592,
|
|
14193
|
+
offset: 0
|
|
14194
|
+
},
|
|
14195
|
+
oz: {
|
|
14196
|
+
dimension: "mass",
|
|
14197
|
+
factor: .0283495,
|
|
14198
|
+
offset: 0
|
|
14199
|
+
},
|
|
14200
|
+
"%": {
|
|
14201
|
+
dimension: "percentage",
|
|
14202
|
+
factor: 1,
|
|
14203
|
+
offset: 0
|
|
14204
|
+
},
|
|
14205
|
+
L: {
|
|
14206
|
+
dimension: "volume",
|
|
14207
|
+
factor: 1,
|
|
14208
|
+
offset: 0
|
|
14209
|
+
},
|
|
14210
|
+
mL: {
|
|
14211
|
+
dimension: "volume",
|
|
14212
|
+
factor: .001,
|
|
14213
|
+
offset: 0
|
|
14214
|
+
},
|
|
14215
|
+
gal: {
|
|
14216
|
+
dimension: "volume",
|
|
14217
|
+
factor: 3.785411784,
|
|
14218
|
+
offset: 0
|
|
14219
|
+
},
|
|
14220
|
+
s: {
|
|
14221
|
+
dimension: "duration",
|
|
14222
|
+
factor: 1,
|
|
14223
|
+
offset: 0
|
|
14224
|
+
},
|
|
14225
|
+
ms: {
|
|
14226
|
+
dimension: "duration",
|
|
14227
|
+
factor: .001,
|
|
14228
|
+
offset: 0
|
|
14229
|
+
},
|
|
14230
|
+
min: {
|
|
14231
|
+
dimension: "duration",
|
|
14232
|
+
factor: 60,
|
|
14233
|
+
offset: 0
|
|
14234
|
+
},
|
|
14235
|
+
h: {
|
|
14236
|
+
dimension: "duration",
|
|
14237
|
+
factor: 3600,
|
|
14238
|
+
offset: 0
|
|
14239
|
+
},
|
|
14240
|
+
d: {
|
|
14241
|
+
dimension: "duration",
|
|
14242
|
+
factor: 86400,
|
|
14243
|
+
offset: 0
|
|
14244
|
+
},
|
|
14245
|
+
B: {
|
|
14246
|
+
dimension: "information",
|
|
14247
|
+
factor: 1,
|
|
14248
|
+
offset: 0
|
|
14249
|
+
},
|
|
14250
|
+
KiB: {
|
|
14251
|
+
dimension: "information",
|
|
14252
|
+
factor: 1024,
|
|
14253
|
+
offset: 0
|
|
14254
|
+
},
|
|
14255
|
+
MiB: {
|
|
14256
|
+
dimension: "information",
|
|
14257
|
+
factor: 1024 ** 2,
|
|
14258
|
+
offset: 0
|
|
14259
|
+
},
|
|
14260
|
+
GiB: {
|
|
14261
|
+
dimension: "information",
|
|
14262
|
+
factor: 1024 ** 3,
|
|
14263
|
+
offset: 0
|
|
14264
|
+
},
|
|
14265
|
+
TiB: {
|
|
14266
|
+
dimension: "information",
|
|
14267
|
+
factor: 1024 ** 4,
|
|
14268
|
+
offset: 0
|
|
14269
|
+
},
|
|
14270
|
+
kB: {
|
|
14271
|
+
dimension: "information",
|
|
14272
|
+
factor: 1e3,
|
|
14273
|
+
offset: 0
|
|
14274
|
+
},
|
|
14275
|
+
MB: {
|
|
14276
|
+
dimension: "information",
|
|
14277
|
+
factor: 1e6,
|
|
14278
|
+
offset: 0
|
|
14279
|
+
},
|
|
14280
|
+
GB: {
|
|
14281
|
+
dimension: "information",
|
|
14282
|
+
factor: 1e9,
|
|
14283
|
+
offset: 0
|
|
14284
|
+
},
|
|
14285
|
+
"°": {
|
|
14286
|
+
dimension: "angle",
|
|
14287
|
+
factor: 1,
|
|
14288
|
+
offset: 0
|
|
14289
|
+
},
|
|
14290
|
+
dBFS: {
|
|
14291
|
+
dimension: "sound-level",
|
|
14292
|
+
factor: 1,
|
|
14293
|
+
offset: 0
|
|
14294
|
+
},
|
|
14295
|
+
dBm: {
|
|
14296
|
+
dimension: "signal-level",
|
|
14297
|
+
factor: 1,
|
|
14298
|
+
offset: 0
|
|
14299
|
+
},
|
|
14300
|
+
mired: {
|
|
14301
|
+
dimension: "colour-temperature",
|
|
14302
|
+
factor: 1,
|
|
14303
|
+
offset: 0
|
|
14304
|
+
},
|
|
14305
|
+
kbps: {
|
|
14306
|
+
dimension: "bitrate",
|
|
14307
|
+
factor: 1,
|
|
14308
|
+
offset: 0
|
|
14309
|
+
},
|
|
14310
|
+
Mbps: {
|
|
14311
|
+
dimension: "bitrate",
|
|
14312
|
+
factor: 1e3,
|
|
14313
|
+
offset: 0
|
|
14314
|
+
},
|
|
14315
|
+
fps: {
|
|
14316
|
+
dimension: "rate",
|
|
14317
|
+
factor: 1,
|
|
14318
|
+
offset: 0
|
|
14319
|
+
}
|
|
14320
|
+
};
|
|
14321
|
+
/** Resolve a unit's `UnitSpec`, or `undefined` when the spelling is unknown. */
|
|
14322
|
+
function specFor(unit) {
|
|
14323
|
+
return Object.hasOwn(UNIT_TABLE, unit) ? UNIT_TABLE[unit] : void 0;
|
|
14324
|
+
}
|
|
14325
|
+
/** Value in `spec`'s unit → its dimension's canonical unit. */
|
|
14326
|
+
function toCanonical(value, spec) {
|
|
14327
|
+
return value * spec.factor + spec.offset;
|
|
14328
|
+
}
|
|
14329
|
+
/** Canonical-unit value → the unit described by `spec`. */
|
|
14330
|
+
function fromCanonical(canonical, spec) {
|
|
14331
|
+
return (canonical - spec.offset) / spec.factor;
|
|
14332
|
+
}
|
|
14333
|
+
/**
|
|
14334
|
+
* Graceful variant for the render path: returns the converted value, or
|
|
14335
|
+
* `undefined` when the conversion is refused (unknown unit / cross-dimension).
|
|
14336
|
+
* Never throws — a render caller falls back to the raw value + source unit.
|
|
14337
|
+
*/
|
|
14338
|
+
function tryConvertUnit(value, from, to) {
|
|
14339
|
+
if (from === to) return value;
|
|
14340
|
+
const fromSpec = specFor(from);
|
|
14341
|
+
if (!fromSpec) return void 0;
|
|
14342
|
+
const toSpec = specFor(to);
|
|
14343
|
+
if (!toSpec) return void 0;
|
|
14344
|
+
if (fromSpec.dimension !== toSpec.dimension) return void 0;
|
|
14345
|
+
return fromCanonical(toCanonical(value, fromSpec), toSpec);
|
|
14346
|
+
}
|
|
14347
|
+
//#endregion
|
|
13792
14348
|
//#region ../types/dist/index.mjs
|
|
13793
14349
|
var SMTP_INBOUND_DEFAULT_PORT = 2525;
|
|
13794
14350
|
var SMTP_INBOUND_DEFAULT_DOMAIN = "camstack.local";
|
|
@@ -13974,6 +14530,414 @@ var IntegrationInstanceRefSchema = object({
|
|
|
13974
14530
|
]),
|
|
13975
14531
|
candidateStableId: string().optional()
|
|
13976
14532
|
});
|
|
14533
|
+
/**
|
|
14534
|
+
* notification-output — canonical, capability-gated notification delivery.
|
|
14535
|
+
*
|
|
14536
|
+
* Apprise-derived model (see
|
|
14537
|
+
* `docs/superpowers/specs/2026-07-03-notification-output-notifier-matrix.md`):
|
|
14538
|
+
* callers emit ONE canonical `Notification`; each provider declares a
|
|
14539
|
+
* per-kind capability descriptor (`TargetKind`), and the pure degrade
|
|
14540
|
+
* engine (`@camstack/types` `prepareNotification`) transcodes / degrades the
|
|
14541
|
+
* message to what the kind supports — callers never special-case a service.
|
|
14542
|
+
*
|
|
14543
|
+
* DESIGN DECISIONS (locked):
|
|
14544
|
+
* - A target is an INSTANCE of this function cap (epic #440, step 6): the
|
|
14545
|
+
* providers serve their targets as `integration-instances` records, one
|
|
14546
|
+
* record kind per target kind, and the admin lists, adds, edits, switches
|
|
14547
|
+
* and deletes them through that cap. This cap keeps what an instance cannot
|
|
14548
|
+
* say: the kind catalogue (`listTargetKinds`: capabilities, delivery
|
|
14549
|
+
* parameters, brand icon), dispatch (`send`, `testTarget`) and the form
|
|
14550
|
+
* helpers (`discoverTargets`, `probeTargetConfig`).
|
|
14551
|
+
* - `listTargetKinds` / `discoverTargets` return arrays → the generated
|
|
14552
|
+
* cap-mount auto-`concatCollection`-fans them across every registered
|
|
14553
|
+
* provider so one catalog is routable. `send` / `testTarget` /
|
|
14554
|
+
* `probeTargetConfig` route to ONE provider by the `addonId` the generated
|
|
14555
|
+
* collection router extracts from the call input.
|
|
14556
|
+
* - `Attachment.bytes` is `Uint8Array`. Transport-safe: superjson (the tRPC
|
|
14557
|
+
* transformer) + UDS MsgPack both round-trip typed arrays — already used by
|
|
14558
|
+
* `storage` / `storage-provider` / `recording` caps over the same path. No
|
|
14559
|
+
* base64 fallback needed.
|
|
14560
|
+
*
|
|
14561
|
+
* TODO (deferred, closed-set change — separate decision): add
|
|
14562
|
+
* `providerKind: 'notify'` so notification providers surface on the unified
|
|
14563
|
+
* admin "Integrations" page.
|
|
14564
|
+
*/
|
|
14565
|
+
/**
|
|
14566
|
+
* Zentik-derived typed-media enum — the superset across every kind. Each
|
|
14567
|
+
* adapter picks what it supports and the degrade engine filters the rest.
|
|
14568
|
+
*/
|
|
14569
|
+
var AttachmentMediaTypeSchema = _enum([
|
|
14570
|
+
"image",
|
|
14571
|
+
"video",
|
|
14572
|
+
"gif",
|
|
14573
|
+
"audio",
|
|
14574
|
+
"icon"
|
|
14575
|
+
]);
|
|
14576
|
+
/**
|
|
14577
|
+
* A single attachment. Exactly one of `url` (remote source, most adapters
|
|
14578
|
+
* prefer this) or `bytes` (inline source; required for Pushover-style
|
|
14579
|
+
* bytes-only kinds) MUST be present — the degrade engine expresses a
|
|
14580
|
+
* url→bytes fetch as a `needsFetch` directive the adapter executes.
|
|
14581
|
+
*/
|
|
14582
|
+
var AttachmentSchema = object({
|
|
14583
|
+
mediaType: AttachmentMediaTypeSchema,
|
|
14584
|
+
url: string().optional(),
|
|
14585
|
+
bytes: _instanceof(Uint8Array).optional(),
|
|
14586
|
+
mime: string().optional(),
|
|
14587
|
+
name: string().optional()
|
|
14588
|
+
}).refine((a) => a.url !== void 0 || a.bytes !== void 0, { message: "Attachment requires either `url` or `bytes`" });
|
|
14589
|
+
var NotificationFormatSchema = _enum([
|
|
14590
|
+
"text",
|
|
14591
|
+
"markdown",
|
|
14592
|
+
"html"
|
|
14593
|
+
]);
|
|
14594
|
+
/**
|
|
14595
|
+
* The CLOSED icon vocabulary an action button may use.
|
|
14596
|
+
*
|
|
14597
|
+
* A closed set, not a free string, and that is the whole point: an arbitrary
|
|
14598
|
+
* icon name is one that ntfy renders, zentik silently drops, and nobody
|
|
14599
|
+
* notices — the same class of gap as a zone vocabulary nothing produced
|
|
14600
|
+
* ([D35](../../../docs/decisions/adr-0035.md)). Every adapter maps this set or
|
|
14601
|
+
* declares `actionIcons: false` and the degrade engine strips the field.
|
|
14602
|
+
*
|
|
14603
|
+
* Named by INTENT, never by glyph. "check" would tie the vocabulary to one
|
|
14604
|
+
* renderer's icon set; "acknowledge" survives an adapter that draws it
|
|
14605
|
+
* differently.
|
|
14606
|
+
*
|
|
14607
|
+
* ── A TOKEN IS NOT A WIRE VALUE ─────────────────────────────────────
|
|
14608
|
+
*
|
|
14609
|
+
* These names are for US. **No adapter may forward one verbatim.** Each maps
|
|
14610
|
+
* the whole set onto its own renderer's vocabulary through a
|
|
14611
|
+
* `Record<NotificationActionIcon, string>` — a Record, never a lookup with a
|
|
14612
|
+
* fallback, so adding a member here fails every adapter's build until someone
|
|
14613
|
+
* decides its glyph, which is the only place that decision can be made
|
|
14614
|
+
* honestly.
|
|
14615
|
+
*
|
|
14616
|
+
* This paragraph is the bug. Zentik declared `actionIcons: true` and passed
|
|
14617
|
+
* `disarm` straight through; iOS feeds that string to
|
|
14618
|
+
* `UNNotificationActionIcon(systemImageName:)`, `disarm` is not an SF Symbol,
|
|
14619
|
+
* and every snooze and alarm button arrived BLANK. A pass-through is not a
|
|
14620
|
+
* mapping, and "the field is documented" is not "the value renders".
|
|
14621
|
+
*
|
|
14622
|
+
* Adding a member is TRAIN-BOUND. The enum lives in the published
|
|
14623
|
+
* `@camstack/server` closure and the cap seam validates against the HUB's copy,
|
|
14624
|
+
* so an addon that emits a token the running hub does not know does not lose an
|
|
14625
|
+
* icon — its whole `send` fails Zod validation and the notification never
|
|
14626
|
+
* arrives. Never emit a new token from an addon before the train carrying it.
|
|
14627
|
+
*/
|
|
14628
|
+
var NotificationActionIconSchema = _enum([
|
|
14629
|
+
"acknowledge",
|
|
14630
|
+
"dismiss",
|
|
14631
|
+
"silence",
|
|
14632
|
+
"snooze",
|
|
14633
|
+
"view",
|
|
14634
|
+
"play",
|
|
14635
|
+
"open",
|
|
14636
|
+
"close",
|
|
14637
|
+
"lock",
|
|
14638
|
+
"unlock",
|
|
14639
|
+
"arm",
|
|
14640
|
+
"arm-home",
|
|
14641
|
+
"arm-away",
|
|
14642
|
+
"arm-night",
|
|
14643
|
+
"disarm",
|
|
14644
|
+
"light",
|
|
14645
|
+
"alert",
|
|
14646
|
+
"camera"
|
|
14647
|
+
]);
|
|
14648
|
+
/** A single tap-through action button. */
|
|
14649
|
+
var NotificationActionSchema = object({
|
|
14650
|
+
id: string(),
|
|
14651
|
+
label: string(),
|
|
14652
|
+
url: string().optional(),
|
|
14653
|
+
/** Dropped by the degrade engine for a kind with `caps.actionIcons: false`. */
|
|
14654
|
+
icon: NotificationActionIconSchema.optional(),
|
|
14655
|
+
/**
|
|
14656
|
+
* Renders in a warning style where the notifier supports it.
|
|
14657
|
+
*
|
|
14658
|
+
* A HINT, never a gate. The callback's authority is its token and nothing
|
|
14659
|
+
* else — see `notification-center/action-token.ts` for what that does and
|
|
14660
|
+
* does not buy.
|
|
14661
|
+
*/
|
|
14662
|
+
destructive: boolean().optional(),
|
|
14663
|
+
/**
|
|
14664
|
+
* How the tap should REACH the url.
|
|
14665
|
+
*
|
|
14666
|
+
* `navigate` (absent, and every button authored before this field) opens it:
|
|
14667
|
+
* the phone leaves the notification and shows whatever the callback returns.
|
|
14668
|
+
* That is right for a button whose answer the operator wants to read.
|
|
14669
|
+
*
|
|
14670
|
+
* `background` fires it as a POST and stays put. It exists for the buttons
|
|
14671
|
+
* whose whole point is not to interrupt — "silence this for 30 minutes" is
|
|
14672
|
+
* an answer to the notification, and being thrown into a browser tab to
|
|
14673
|
+
* confirm it costs more attention than the notification did. A backend that
|
|
14674
|
+
* cannot do a background call renders it as an ordinary link (the adapters
|
|
14675
|
+
* fall back rather than dropping the button), so this is a preference, never
|
|
14676
|
+
* a requirement.
|
|
14677
|
+
*/
|
|
14678
|
+
mode: _enum(["navigate", "background"]).optional()
|
|
14679
|
+
});
|
|
14680
|
+
/** A delivery parameter value: what a notifier declared it takes. */
|
|
14681
|
+
var DeliveryParamValueSchema = union([
|
|
14682
|
+
string(),
|
|
14683
|
+
number(),
|
|
14684
|
+
boolean()
|
|
14685
|
+
]);
|
|
14686
|
+
/**
|
|
14687
|
+
* One extra delivery parameter a notifier KIND declares (D938). A rule that
|
|
14688
|
+
* addresses a target of that kind may set it; a kind that declares nothing is
|
|
14689
|
+
* never handed one. The admin UI derives its control from this descriptor —
|
|
14690
|
+
* no editor knows a service by name.
|
|
14691
|
+
*
|
|
14692
|
+
* Optional fields are `.optional()`, never `.default()` (a Zod default does not
|
|
14693
|
+
* run on the addon cap path).
|
|
14694
|
+
*/
|
|
14695
|
+
var DeliveryParamSchema = object({
|
|
14696
|
+
key: string().min(1),
|
|
14697
|
+
label: string(),
|
|
14698
|
+
/** i18n key of the label, resolved by the declaring addon's namespace. */
|
|
14699
|
+
labelKey: string().optional(),
|
|
14700
|
+
type: _enum([
|
|
14701
|
+
"enum",
|
|
14702
|
+
"number",
|
|
14703
|
+
"boolean",
|
|
14704
|
+
"string"
|
|
14705
|
+
]),
|
|
14706
|
+
/** `enum` only: the closed set of accepted values. */
|
|
14707
|
+
options: array(object({
|
|
14708
|
+
value: string(),
|
|
14709
|
+
label: string()
|
|
14710
|
+
})).optional(),
|
|
14711
|
+
/** `number` only. */
|
|
14712
|
+
min: number().optional(),
|
|
14713
|
+
max: number().optional(),
|
|
14714
|
+
/** What the notifier does when the rule sets nothing; shown as the placeholder. */
|
|
14715
|
+
default: DeliveryParamValueSchema.optional()
|
|
14716
|
+
});
|
|
14717
|
+
/**
|
|
14718
|
+
* The canonical notification. `body` is the only hard field (Apprise model).
|
|
14719
|
+
* `priority` is a 5-level ORDINAL (1=lowest … 3=normal(default) … 5=urgent),
|
|
14720
|
+
* NOT a fixed severity enum — each kind declares its own `caps.levels` and
|
|
14721
|
+
* the adapter maps this ordinal onto its native level. `level?` is an
|
|
14722
|
+
* optional kind-native level id (`emergency`, `silent`, …) that overrides
|
|
14723
|
+
* `priority` for that one target.
|
|
14724
|
+
*/
|
|
14725
|
+
var NotificationSchema = object({
|
|
14726
|
+
body: string(),
|
|
14727
|
+
title: string().optional(),
|
|
14728
|
+
format: NotificationFormatSchema.default("text"),
|
|
14729
|
+
priority: number().int().min(1).max(5).default(3),
|
|
14730
|
+
level: string().optional(),
|
|
14731
|
+
attachments: array(AttachmentSchema).optional(),
|
|
14732
|
+
clickUrl: string().optional(),
|
|
14733
|
+
actions: array(NotificationActionSchema).optional(),
|
|
14734
|
+
sound: string().optional(),
|
|
14735
|
+
ttl: number().optional(),
|
|
14736
|
+
tag: string().optional(),
|
|
14737
|
+
deviceId: number().optional(),
|
|
14738
|
+
eventId: string().optional(),
|
|
14739
|
+
metadata: record(string(), unknown()).optional(),
|
|
14740
|
+
/**
|
|
14741
|
+
* Values for the parameters the target's kind DECLARES in
|
|
14742
|
+
* {@link TargetKindSchema} `deliveryParams`. Already validated against the
|
|
14743
|
+
* declaration by the sender; a notifier reads only the keys it declared.
|
|
14744
|
+
*/
|
|
14745
|
+
delivery: record(string(), DeliveryParamValueSchema).optional()
|
|
14746
|
+
});
|
|
14747
|
+
/** One declared native severity/priority level for a kind. */
|
|
14748
|
+
var TargetKindLevelSchema = object({
|
|
14749
|
+
id: string(),
|
|
14750
|
+
label: string(),
|
|
14751
|
+
/** Which canonical priority (1..5) this level maps to. `null` = qualitative-only. */
|
|
14752
|
+
ordinal: number().int().min(1).max(5).nullable(),
|
|
14753
|
+
flags: object({
|
|
14754
|
+
critical: boolean().optional(),
|
|
14755
|
+
silent: boolean().optional(),
|
|
14756
|
+
noPush: boolean().optional()
|
|
14757
|
+
}).optional(),
|
|
14758
|
+
/** e.g. Pushover `emergency` requires `retry` / `expire`. */
|
|
14759
|
+
requires: array(string()).optional(),
|
|
14760
|
+
description: string().optional()
|
|
14761
|
+
});
|
|
14762
|
+
/** The full capability block consulted before dispatch. */
|
|
14763
|
+
var TargetKindCapsSchema = object({
|
|
14764
|
+
attachments: object({
|
|
14765
|
+
mediaTypes: array(AttachmentMediaTypeSchema),
|
|
14766
|
+
mode: _enum([
|
|
14767
|
+
"url",
|
|
14768
|
+
"bytes",
|
|
14769
|
+
"both"
|
|
14770
|
+
]),
|
|
14771
|
+
max: number().int().nonnegative(),
|
|
14772
|
+
maxBytes: number().int().positive().optional()
|
|
14773
|
+
}),
|
|
14774
|
+
/** Max action buttons (0 = none). */
|
|
14775
|
+
actions: number().int().nonnegative(),
|
|
14776
|
+
/**
|
|
14777
|
+
* Whether this kind renders a per-action ICON.
|
|
14778
|
+
*
|
|
14779
|
+
* `.optional()`, deliberately NOT `.default(false)`: a Zod default does not
|
|
14780
|
+
* run on the addon cap path — three production failures in one day taught
|
|
14781
|
+
* this repo that once. Absent is read as false by the degrade engine, which
|
|
14782
|
+
* is the safe direction: an icon that is not rendered costs nothing, an icon
|
|
14783
|
+
* assumed and dropped costs the operator's trust in the field.
|
|
14784
|
+
*/
|
|
14785
|
+
actionIcons: boolean().optional(),
|
|
14786
|
+
levels: array(TargetKindLevelSchema),
|
|
14787
|
+
format: array(NotificationFormatSchema),
|
|
14788
|
+
clickUrl: boolean(),
|
|
14789
|
+
sound: boolean(),
|
|
14790
|
+
ttl: boolean(),
|
|
14791
|
+
bodyMaxLen: number().int().positive()
|
|
14792
|
+
});
|
|
14793
|
+
/**
|
|
14794
|
+
* `configSchema` is a `ConfigUISchema` tree passed through to the admin
|
|
14795
|
+
* FormBuilder. Stored as `z.unknown()` at the cap seam (mirrors
|
|
14796
|
+
* `device-provider.getChildCreationSchema` `CreationSchemaOutputSchema`) —
|
|
14797
|
+
* the union is large and not meant for runtime validation here; the exported
|
|
14798
|
+
* `TargetKind` type re-tightens `configSchema` to `ConfigUISchema`.
|
|
14799
|
+
*/
|
|
14800
|
+
var ConfigSchemaPassthrough$3 = unknown();
|
|
14801
|
+
var TargetKindSchema = object({
|
|
14802
|
+
kind: string(),
|
|
14803
|
+
label: string(),
|
|
14804
|
+
icon: string(),
|
|
14805
|
+
/** Stamped by each provider so the concat-fanned catalog stays routable. */
|
|
14806
|
+
addonId: string(),
|
|
14807
|
+
/**
|
|
14808
|
+
* URL of the kind's bundled BRAND icon, served by the providing addon over
|
|
14809
|
+
* its own `addon-routes` surface (`/addon/<addonId>/icons/<kind>`). Absent
|
|
14810
|
+
* when the addon bundles no icon for that kind — the client then falls back
|
|
14811
|
+
* to a neutral glyph rather than rendering the raw `icon` NAME as text.
|
|
14812
|
+
*
|
|
14813
|
+
* Root-relative on purpose: it resolves against whatever origin serves a web
|
|
14814
|
+
* client, and a native client joins it onto its own hub base.
|
|
14815
|
+
*
|
|
14816
|
+
* DECLARED here deliberately. It used to travel as an undeclared passthrough
|
|
14817
|
+
* field that survived only because the runtime cap-router forwards provider
|
|
14818
|
+
* output verbatim — so every consumer had to re-declare it by hand to stop
|
|
14819
|
+
* its own Zod parse from stripping it, and the whole arrangement would have
|
|
14820
|
+
* broken silently the moment output validation was tightened anywhere.
|
|
14821
|
+
*/
|
|
14822
|
+
iconUrl: string().optional(),
|
|
14823
|
+
/**
|
|
14824
|
+
* Media type of {@link iconUrl} (`image/svg+xml`, `image/png`, …).
|
|
14825
|
+
*
|
|
14826
|
+
* The server knows this and therefore says it, because the client cannot
|
|
14827
|
+
* safely guess: a React-Native client renders SVG and raster through two
|
|
14828
|
+
* DIFFERENT components (`react-native-svg` vs `expo-image` — expo-image does
|
|
14829
|
+
* not decode SVG on iOS/Android), so without this it silently fell back to a
|
|
14830
|
+
* placeholder glyph for every vector icon while the web build looked fine.
|
|
14831
|
+
*
|
|
14832
|
+
* Absent when {@link iconUrl} is absent, or for a legacy provider that has
|
|
14833
|
+
* not been updated — a client that cannot determine the type should prefer
|
|
14834
|
+
* its raster path, which is the safe default for an unknown image.
|
|
14835
|
+
*/
|
|
14836
|
+
iconMediaType: string().optional(),
|
|
14837
|
+
configSchema: ConfigSchemaPassthrough$3,
|
|
14838
|
+
/**
|
|
14839
|
+
* The config keys that decide WHERE this kind's secrets are sent (server,
|
|
14840
|
+
* base URL, instance, chat, recipient). A save that changes any of them
|
|
14841
|
+
* while leaving a secret redacted is refused by the provider (D634), so an
|
|
14842
|
+
* editor uses this to ask for the secret on exactly those edits instead of
|
|
14843
|
+
* on every edit.
|
|
14844
|
+
*
|
|
14845
|
+
* Optional: absent from a provider that holds no secret (the Home Assistant
|
|
14846
|
+
* kinds) and from a provider older than this field — an editor that finds
|
|
14847
|
+
* it absent must assume ANY edit may need the secret.
|
|
14848
|
+
*/
|
|
14849
|
+
destinationKeys: array(string()).optional(),
|
|
14850
|
+
supportsDiscovery: boolean(),
|
|
14851
|
+
/**
|
|
14852
|
+
* Extra delivery parameters a rule may set for a target of this kind (D938).
|
|
14853
|
+
* Absent = none; the rule editor then offers nothing.
|
|
14854
|
+
*/
|
|
14855
|
+
deliveryParams: array(DeliveryParamSchema).optional(),
|
|
14856
|
+
caps: TargetKindCapsSchema
|
|
14857
|
+
});
|
|
14858
|
+
/**
|
|
14859
|
+
* A target as a provider's own code sees it (the notification-center bridge, the
|
|
14860
|
+
* send path): the flat record body split into the name, the switch and the
|
|
14861
|
+
* kind's fields. `config` holds secrets; a reader that serves it to a client
|
|
14862
|
+
* REDACTS secret fields (a presence marker only) — never round-trip a stored
|
|
14863
|
+
* secret to the UI.
|
|
14864
|
+
*/
|
|
14865
|
+
var TargetSchema = object({
|
|
14866
|
+
id: string(),
|
|
14867
|
+
name: string(),
|
|
14868
|
+
kind: string(),
|
|
14869
|
+
addonId: string(),
|
|
14870
|
+
enabled: boolean(),
|
|
14871
|
+
config: record(string(), unknown())
|
|
14872
|
+
});
|
|
14873
|
+
/** A discovery-surfaced candidate (config is partial + non-secret). */
|
|
14874
|
+
var DiscoveredTargetSchema = object({
|
|
14875
|
+
kind: string(),
|
|
14876
|
+
suggestedName: string(),
|
|
14877
|
+
config: record(string(), unknown())
|
|
14878
|
+
});
|
|
14879
|
+
/** The degrade engine's report — what was resolved / dropped / degraded. */
|
|
14880
|
+
var RenderedAsSchema = object({
|
|
14881
|
+
level: string(),
|
|
14882
|
+
format: NotificationFormatSchema,
|
|
14883
|
+
attachmentsSent: number().int().nonnegative(),
|
|
14884
|
+
actionsSent: number().int().nonnegative(),
|
|
14885
|
+
truncated: boolean(),
|
|
14886
|
+
dropped: array(string())
|
|
14887
|
+
});
|
|
14888
|
+
var SendResultSchema = object({
|
|
14889
|
+
success: boolean(),
|
|
14890
|
+
error: string().optional(),
|
|
14891
|
+
renderedAs: RenderedAsSchema.optional()
|
|
14892
|
+
});
|
|
14893
|
+
/** Same shape as SendResult — kept as a distinct name for the test panel. */
|
|
14894
|
+
var TestResultSchema = SendResultSchema;
|
|
14895
|
+
/**
|
|
14896
|
+
* Pre-save credential probe against a partial (unsaved) target config.
|
|
14897
|
+
* `resolvedUrl` never includes secrets (token stripped from path).
|
|
14898
|
+
*/
|
|
14899
|
+
var ProbeTargetConfigResultSchema = object({
|
|
14900
|
+
ok: boolean(),
|
|
14901
|
+
resolvedUrl: string(),
|
|
14902
|
+
httpStatus: number().int().optional(),
|
|
14903
|
+
stateInstance: string().optional(),
|
|
14904
|
+
error: string().optional()
|
|
14905
|
+
});
|
|
14906
|
+
method(object({}), array(TargetKindSchema)), method(object({
|
|
14907
|
+
kind: string(),
|
|
14908
|
+
config: record(string(), unknown()).optional(),
|
|
14909
|
+
/**
|
|
14910
|
+
* When editing / duplicating, the blank password field never round-trips
|
|
14911
|
+
* the stored token. Pass the source target id so the provider can restore
|
|
14912
|
+
* secrets server-side before dialling.
|
|
14913
|
+
*/
|
|
14914
|
+
targetId: string().optional()
|
|
14915
|
+
}), array(DiscoveredTargetSchema), { auth: "admin" }), method(object({
|
|
14916
|
+
kind: string(),
|
|
14917
|
+
config: record(string(), unknown()),
|
|
14918
|
+
/** See `discoverTargets.targetId` — restore stored secrets for a blank password. */
|
|
14919
|
+
targetId: string().optional()
|
|
14920
|
+
}), ProbeTargetConfigResultSchema, {
|
|
14921
|
+
kind: "mutation",
|
|
14922
|
+
auth: "admin"
|
|
14923
|
+
}), method(object({
|
|
14924
|
+
targetId: string(),
|
|
14925
|
+
notification: NotificationSchema
|
|
14926
|
+
}), SendResultSchema, {
|
|
14927
|
+
kind: "mutation",
|
|
14928
|
+
auth: "admin"
|
|
14929
|
+
}), method(object({
|
|
14930
|
+
targetId: string(),
|
|
14931
|
+
sample: NotificationSchema.optional()
|
|
14932
|
+
}), TestResultSchema, {
|
|
14933
|
+
kind: "mutation",
|
|
14934
|
+
auth: "admin"
|
|
14935
|
+
});
|
|
14936
|
+
looseObject({
|
|
14937
|
+
name: string().min(1),
|
|
14938
|
+
enabled: boolean().optional()
|
|
14939
|
+
});
|
|
14940
|
+
TargetSchema.omit({ id: true });
|
|
13977
14941
|
var EncodeProfileSchema = object({
|
|
13978
14942
|
video: object({
|
|
13979
14943
|
codec: _enum([
|
|
@@ -22824,7 +23788,6 @@ var SYSTEM_CAP_VOCABULARY = {
|
|
|
22824
23788
|
"calendar-source": system(INTERNAL),
|
|
22825
23789
|
calendars: system("calendars feed schedules and conditions, not device actions"),
|
|
22826
23790
|
composer: system("device composition — an authoring tool, not an action"),
|
|
22827
|
-
"connection-test": system(INTERNAL),
|
|
22828
23791
|
"core-blocks": system(INTERNAL),
|
|
22829
23792
|
"custom-model-registry": system(ML),
|
|
22830
23793
|
"data-store-provider": system(INTERNAL),
|
|
@@ -22869,7 +23832,6 @@ var SYSTEM_CAP_VOCABULARY = {
|
|
|
22869
23832
|
"notification-output": system("notification delivery — reached through notifier devices and rules"),
|
|
22870
23833
|
"notification-rules": system("notification rules — authored on their own page"),
|
|
22871
23834
|
"oauth-integration": system(IDENTITY),
|
|
22872
|
-
"oidc-connections": system(IDENTITY),
|
|
22873
23835
|
"osd-manager": system(PIPELINE),
|
|
22874
23836
|
"pipeline-executor": system(PIPELINE),
|
|
22875
23837
|
"pipeline-orchestrator": system(PIPELINE),
|
|
@@ -42890,6 +43852,7 @@ var ExpressionBindingSourceSchema = union([
|
|
|
42890
43852
|
object({
|
|
42891
43853
|
kind: literal("global"),
|
|
42892
43854
|
sourceStableId: string(),
|
|
43855
|
+
addonId: string().optional(),
|
|
42893
43856
|
cap: string(),
|
|
42894
43857
|
fieldPath: string()
|
|
42895
43858
|
})
|
|
@@ -43016,385 +43979,6 @@ function extractSourceInfoFromMetadata(metadata) {
|
|
|
43016
43979
|
return parsed.data;
|
|
43017
43980
|
}
|
|
43018
43981
|
/**
|
|
43019
|
-
* Frozen unit → spec table. `•` in the doc marks each dimension's canonical
|
|
43020
|
-
* unit (`factor: 1, offset: 0`). °F derives from `°C = (°F − 32) × 5/9` ⇒
|
|
43021
|
-
* `factor = 5/9`, `offset = -160/9` (kept as exact expressions, not rounded
|
|
43022
|
-
* decimals). K derives from `°C = K − 273.15`.
|
|
43023
|
-
*/
|
|
43024
|
-
var UNIT_TABLE = {
|
|
43025
|
-
"°C": {
|
|
43026
|
-
dimension: "temperature",
|
|
43027
|
-
factor: 1,
|
|
43028
|
-
offset: 0
|
|
43029
|
-
},
|
|
43030
|
-
"°F": {
|
|
43031
|
-
dimension: "temperature",
|
|
43032
|
-
factor: 5 / 9,
|
|
43033
|
-
offset: -160 / 9
|
|
43034
|
-
},
|
|
43035
|
-
K: {
|
|
43036
|
-
dimension: "temperature",
|
|
43037
|
-
factor: 1,
|
|
43038
|
-
offset: -273.15
|
|
43039
|
-
},
|
|
43040
|
-
hPa: {
|
|
43041
|
-
dimension: "pressure",
|
|
43042
|
-
factor: 1,
|
|
43043
|
-
offset: 0
|
|
43044
|
-
},
|
|
43045
|
-
kPa: {
|
|
43046
|
-
dimension: "pressure",
|
|
43047
|
-
factor: 10,
|
|
43048
|
-
offset: 0
|
|
43049
|
-
},
|
|
43050
|
-
Pa: {
|
|
43051
|
-
dimension: "pressure",
|
|
43052
|
-
factor: .01,
|
|
43053
|
-
offset: 0
|
|
43054
|
-
},
|
|
43055
|
-
mbar: {
|
|
43056
|
-
dimension: "pressure",
|
|
43057
|
-
factor: 1,
|
|
43058
|
-
offset: 0
|
|
43059
|
-
},
|
|
43060
|
-
bar: {
|
|
43061
|
-
dimension: "pressure",
|
|
43062
|
-
factor: 1e3,
|
|
43063
|
-
offset: 0
|
|
43064
|
-
},
|
|
43065
|
-
inHg: {
|
|
43066
|
-
dimension: "pressure",
|
|
43067
|
-
factor: 33.8639,
|
|
43068
|
-
offset: 0
|
|
43069
|
-
},
|
|
43070
|
-
mmHg: {
|
|
43071
|
-
dimension: "pressure",
|
|
43072
|
-
factor: 1.33322,
|
|
43073
|
-
offset: 0
|
|
43074
|
-
},
|
|
43075
|
-
psi: {
|
|
43076
|
-
dimension: "pressure",
|
|
43077
|
-
factor: 68.9476,
|
|
43078
|
-
offset: 0
|
|
43079
|
-
},
|
|
43080
|
-
"m/s": {
|
|
43081
|
-
dimension: "speed",
|
|
43082
|
-
factor: 1,
|
|
43083
|
-
offset: 0
|
|
43084
|
-
},
|
|
43085
|
-
"km/h": {
|
|
43086
|
-
dimension: "speed",
|
|
43087
|
-
factor: 1 / 3.6,
|
|
43088
|
-
offset: 0
|
|
43089
|
-
},
|
|
43090
|
-
mph: {
|
|
43091
|
-
dimension: "speed",
|
|
43092
|
-
factor: .44704,
|
|
43093
|
-
offset: 0
|
|
43094
|
-
},
|
|
43095
|
-
kn: {
|
|
43096
|
-
dimension: "speed",
|
|
43097
|
-
factor: .514444,
|
|
43098
|
-
offset: 0
|
|
43099
|
-
},
|
|
43100
|
-
"mm/h": {
|
|
43101
|
-
dimension: "precipitation-rate",
|
|
43102
|
-
factor: 1,
|
|
43103
|
-
offset: 0
|
|
43104
|
-
},
|
|
43105
|
-
"in/h": {
|
|
43106
|
-
dimension: "precipitation-rate",
|
|
43107
|
-
factor: 25.4,
|
|
43108
|
-
offset: 0
|
|
43109
|
-
},
|
|
43110
|
-
m: {
|
|
43111
|
-
dimension: "length",
|
|
43112
|
-
factor: 1,
|
|
43113
|
-
offset: 0
|
|
43114
|
-
},
|
|
43115
|
-
mm: {
|
|
43116
|
-
dimension: "length",
|
|
43117
|
-
factor: .001,
|
|
43118
|
-
offset: 0
|
|
43119
|
-
},
|
|
43120
|
-
cm: {
|
|
43121
|
-
dimension: "length",
|
|
43122
|
-
factor: .01,
|
|
43123
|
-
offset: 0
|
|
43124
|
-
},
|
|
43125
|
-
km: {
|
|
43126
|
-
dimension: "length",
|
|
43127
|
-
factor: 1e3,
|
|
43128
|
-
offset: 0
|
|
43129
|
-
},
|
|
43130
|
-
in: {
|
|
43131
|
-
dimension: "length",
|
|
43132
|
-
factor: .0254,
|
|
43133
|
-
offset: 0
|
|
43134
|
-
},
|
|
43135
|
-
ft: {
|
|
43136
|
-
dimension: "length",
|
|
43137
|
-
factor: .3048,
|
|
43138
|
-
offset: 0
|
|
43139
|
-
},
|
|
43140
|
-
mi: {
|
|
43141
|
-
dimension: "length",
|
|
43142
|
-
factor: 1609.344,
|
|
43143
|
-
offset: 0
|
|
43144
|
-
},
|
|
43145
|
-
"m²": {
|
|
43146
|
-
dimension: "area",
|
|
43147
|
-
factor: 1,
|
|
43148
|
-
offset: 0
|
|
43149
|
-
},
|
|
43150
|
-
lx: {
|
|
43151
|
-
dimension: "illuminance",
|
|
43152
|
-
factor: 1,
|
|
43153
|
-
offset: 0
|
|
43154
|
-
},
|
|
43155
|
-
"W/m²": {
|
|
43156
|
-
dimension: "irradiance",
|
|
43157
|
-
factor: 1,
|
|
43158
|
-
offset: 0
|
|
43159
|
-
},
|
|
43160
|
-
W: {
|
|
43161
|
-
dimension: "power",
|
|
43162
|
-
factor: 1,
|
|
43163
|
-
offset: 0
|
|
43164
|
-
},
|
|
43165
|
-
kW: {
|
|
43166
|
-
dimension: "power",
|
|
43167
|
-
factor: 1e3,
|
|
43168
|
-
offset: 0
|
|
43169
|
-
},
|
|
43170
|
-
VA: {
|
|
43171
|
-
dimension: "apparent-power",
|
|
43172
|
-
factor: 1,
|
|
43173
|
-
offset: 0
|
|
43174
|
-
},
|
|
43175
|
-
Wh: {
|
|
43176
|
-
dimension: "energy",
|
|
43177
|
-
factor: 1,
|
|
43178
|
-
offset: 0
|
|
43179
|
-
},
|
|
43180
|
-
kWh: {
|
|
43181
|
-
dimension: "energy",
|
|
43182
|
-
factor: 1e3,
|
|
43183
|
-
offset: 0
|
|
43184
|
-
},
|
|
43185
|
-
MWh: {
|
|
43186
|
-
dimension: "energy",
|
|
43187
|
-
factor: 1e6,
|
|
43188
|
-
offset: 0
|
|
43189
|
-
},
|
|
43190
|
-
V: {
|
|
43191
|
-
dimension: "voltage",
|
|
43192
|
-
factor: 1,
|
|
43193
|
-
offset: 0
|
|
43194
|
-
},
|
|
43195
|
-
mV: {
|
|
43196
|
-
dimension: "voltage",
|
|
43197
|
-
factor: .001,
|
|
43198
|
-
offset: 0
|
|
43199
|
-
},
|
|
43200
|
-
A: {
|
|
43201
|
-
dimension: "current",
|
|
43202
|
-
factor: 1,
|
|
43203
|
-
offset: 0
|
|
43204
|
-
},
|
|
43205
|
-
mA: {
|
|
43206
|
-
dimension: "current",
|
|
43207
|
-
factor: .001,
|
|
43208
|
-
offset: 0
|
|
43209
|
-
},
|
|
43210
|
-
ppm: {
|
|
43211
|
-
dimension: "concentration-volume",
|
|
43212
|
-
factor: 1,
|
|
43213
|
-
offset: 0
|
|
43214
|
-
},
|
|
43215
|
-
ppb: {
|
|
43216
|
-
dimension: "concentration-volume",
|
|
43217
|
-
factor: .001,
|
|
43218
|
-
offset: 0
|
|
43219
|
-
},
|
|
43220
|
-
"µg/m³": {
|
|
43221
|
-
dimension: "concentration-mass",
|
|
43222
|
-
factor: 1,
|
|
43223
|
-
offset: 0
|
|
43224
|
-
},
|
|
43225
|
-
"mg/m³": {
|
|
43226
|
-
dimension: "concentration-mass",
|
|
43227
|
-
factor: 1e3,
|
|
43228
|
-
offset: 0
|
|
43229
|
-
},
|
|
43230
|
-
kg: {
|
|
43231
|
-
dimension: "mass",
|
|
43232
|
-
factor: 1,
|
|
43233
|
-
offset: 0
|
|
43234
|
-
},
|
|
43235
|
-
g: {
|
|
43236
|
-
dimension: "mass",
|
|
43237
|
-
factor: .001,
|
|
43238
|
-
offset: 0
|
|
43239
|
-
},
|
|
43240
|
-
lb: {
|
|
43241
|
-
dimension: "mass",
|
|
43242
|
-
factor: .453592,
|
|
43243
|
-
offset: 0
|
|
43244
|
-
},
|
|
43245
|
-
oz: {
|
|
43246
|
-
dimension: "mass",
|
|
43247
|
-
factor: .0283495,
|
|
43248
|
-
offset: 0
|
|
43249
|
-
},
|
|
43250
|
-
"%": {
|
|
43251
|
-
dimension: "percentage",
|
|
43252
|
-
factor: 1,
|
|
43253
|
-
offset: 0
|
|
43254
|
-
},
|
|
43255
|
-
L: {
|
|
43256
|
-
dimension: "volume",
|
|
43257
|
-
factor: 1,
|
|
43258
|
-
offset: 0
|
|
43259
|
-
},
|
|
43260
|
-
mL: {
|
|
43261
|
-
dimension: "volume",
|
|
43262
|
-
factor: .001,
|
|
43263
|
-
offset: 0
|
|
43264
|
-
},
|
|
43265
|
-
gal: {
|
|
43266
|
-
dimension: "volume",
|
|
43267
|
-
factor: 3.785411784,
|
|
43268
|
-
offset: 0
|
|
43269
|
-
},
|
|
43270
|
-
s: {
|
|
43271
|
-
dimension: "duration",
|
|
43272
|
-
factor: 1,
|
|
43273
|
-
offset: 0
|
|
43274
|
-
},
|
|
43275
|
-
ms: {
|
|
43276
|
-
dimension: "duration",
|
|
43277
|
-
factor: .001,
|
|
43278
|
-
offset: 0
|
|
43279
|
-
},
|
|
43280
|
-
min: {
|
|
43281
|
-
dimension: "duration",
|
|
43282
|
-
factor: 60,
|
|
43283
|
-
offset: 0
|
|
43284
|
-
},
|
|
43285
|
-
h: {
|
|
43286
|
-
dimension: "duration",
|
|
43287
|
-
factor: 3600,
|
|
43288
|
-
offset: 0
|
|
43289
|
-
},
|
|
43290
|
-
d: {
|
|
43291
|
-
dimension: "duration",
|
|
43292
|
-
factor: 86400,
|
|
43293
|
-
offset: 0
|
|
43294
|
-
},
|
|
43295
|
-
B: {
|
|
43296
|
-
dimension: "information",
|
|
43297
|
-
factor: 1,
|
|
43298
|
-
offset: 0
|
|
43299
|
-
},
|
|
43300
|
-
KiB: {
|
|
43301
|
-
dimension: "information",
|
|
43302
|
-
factor: 1024,
|
|
43303
|
-
offset: 0
|
|
43304
|
-
},
|
|
43305
|
-
MiB: {
|
|
43306
|
-
dimension: "information",
|
|
43307
|
-
factor: 1024 ** 2,
|
|
43308
|
-
offset: 0
|
|
43309
|
-
},
|
|
43310
|
-
GiB: {
|
|
43311
|
-
dimension: "information",
|
|
43312
|
-
factor: 1024 ** 3,
|
|
43313
|
-
offset: 0
|
|
43314
|
-
},
|
|
43315
|
-
TiB: {
|
|
43316
|
-
dimension: "information",
|
|
43317
|
-
factor: 1024 ** 4,
|
|
43318
|
-
offset: 0
|
|
43319
|
-
},
|
|
43320
|
-
kB: {
|
|
43321
|
-
dimension: "information",
|
|
43322
|
-
factor: 1e3,
|
|
43323
|
-
offset: 0
|
|
43324
|
-
},
|
|
43325
|
-
MB: {
|
|
43326
|
-
dimension: "information",
|
|
43327
|
-
factor: 1e6,
|
|
43328
|
-
offset: 0
|
|
43329
|
-
},
|
|
43330
|
-
GB: {
|
|
43331
|
-
dimension: "information",
|
|
43332
|
-
factor: 1e9,
|
|
43333
|
-
offset: 0
|
|
43334
|
-
},
|
|
43335
|
-
"°": {
|
|
43336
|
-
dimension: "angle",
|
|
43337
|
-
factor: 1,
|
|
43338
|
-
offset: 0
|
|
43339
|
-
},
|
|
43340
|
-
dBFS: {
|
|
43341
|
-
dimension: "sound-level",
|
|
43342
|
-
factor: 1,
|
|
43343
|
-
offset: 0
|
|
43344
|
-
},
|
|
43345
|
-
dBm: {
|
|
43346
|
-
dimension: "signal-level",
|
|
43347
|
-
factor: 1,
|
|
43348
|
-
offset: 0
|
|
43349
|
-
},
|
|
43350
|
-
mired: {
|
|
43351
|
-
dimension: "colour-temperature",
|
|
43352
|
-
factor: 1,
|
|
43353
|
-
offset: 0
|
|
43354
|
-
},
|
|
43355
|
-
kbps: {
|
|
43356
|
-
dimension: "bitrate",
|
|
43357
|
-
factor: 1,
|
|
43358
|
-
offset: 0
|
|
43359
|
-
},
|
|
43360
|
-
Mbps: {
|
|
43361
|
-
dimension: "bitrate",
|
|
43362
|
-
factor: 1e3,
|
|
43363
|
-
offset: 0
|
|
43364
|
-
},
|
|
43365
|
-
fps: {
|
|
43366
|
-
dimension: "rate",
|
|
43367
|
-
factor: 1,
|
|
43368
|
-
offset: 0
|
|
43369
|
-
}
|
|
43370
|
-
};
|
|
43371
|
-
/** Resolve a unit's `UnitSpec`, or `undefined` when the spelling is unknown. */
|
|
43372
|
-
function specFor(unit) {
|
|
43373
|
-
return Object.hasOwn(UNIT_TABLE, unit) ? UNIT_TABLE[unit] : void 0;
|
|
43374
|
-
}
|
|
43375
|
-
/** Value in `spec`'s unit → its dimension's canonical unit. */
|
|
43376
|
-
function toCanonical(value, spec) {
|
|
43377
|
-
return value * spec.factor + spec.offset;
|
|
43378
|
-
}
|
|
43379
|
-
/** Canonical-unit value → the unit described by `spec`. */
|
|
43380
|
-
function fromCanonical(canonical, spec) {
|
|
43381
|
-
return (canonical - spec.offset) / spec.factor;
|
|
43382
|
-
}
|
|
43383
|
-
/**
|
|
43384
|
-
* Graceful variant for the render path: returns the converted value, or
|
|
43385
|
-
* `undefined` when the conversion is refused (unknown unit / cross-dimension).
|
|
43386
|
-
* Never throws — a render caller falls back to the raw value + source unit.
|
|
43387
|
-
*/
|
|
43388
|
-
function tryConvertUnit(value, from, to) {
|
|
43389
|
-
if (from === to) return value;
|
|
43390
|
-
const fromSpec = specFor(from);
|
|
43391
|
-
if (!fromSpec) return void 0;
|
|
43392
|
-
const toSpec = specFor(to);
|
|
43393
|
-
if (!toSpec) return void 0;
|
|
43394
|
-
if (fromSpec.dimension !== toSpec.dimension) return void 0;
|
|
43395
|
-
return fromCanonical(toCanonical(value, fromSpec), toSpec);
|
|
43396
|
-
}
|
|
43397
|
-
/**
|
|
43398
43982
|
* A number a person types for a physical quantity — the input side of the
|
|
43399
43983
|
* value + unit contract (D972).
|
|
43400
43984
|
*
|
|
@@ -44801,427 +45385,6 @@ var UnitWarningSchema = object({
|
|
|
44801
45385
|
assumedUnit: string(),
|
|
44802
45386
|
message: string()
|
|
44803
45387
|
});
|
|
44804
|
-
/**
|
|
44805
|
-
* notification-output — canonical, capability-gated notification delivery.
|
|
44806
|
-
*
|
|
44807
|
-
* Apprise-derived model (see
|
|
44808
|
-
* `docs/superpowers/specs/2026-07-03-notification-output-notifier-matrix.md`):
|
|
44809
|
-
* callers emit ONE canonical `Notification`; each provider declares a
|
|
44810
|
-
* per-kind capability descriptor (`TargetKind`), and the pure degrade
|
|
44811
|
-
* engine (`@camstack/types` `prepareNotification`) transcodes / degrades the
|
|
44812
|
-
* message to what the kind supports — callers never special-case a service.
|
|
44813
|
-
*
|
|
44814
|
-
* DESIGN DECISIONS (locked):
|
|
44815
|
-
* - Target CRUD lives on THIS cap (`upsertTarget` / `deleteTarget` /
|
|
44816
|
-
* `setTargetEnabled`), each provider persisting via the `settings-store`
|
|
44817
|
-
* cap. Rationale: the admin UI needs one uniform surface across the
|
|
44818
|
-
* notifiers addon AND the HA addon; the addon-`globalSettingsSchema`-array
|
|
44819
|
-
* alternative would fork the UI per addon and cannot host the
|
|
44820
|
-
* discovery→adopt flow.
|
|
44821
|
-
* - `listTargetKinds` / `listTargets` / `discoverTargets` return arrays →
|
|
44822
|
-
* the generated cap-mount auto-`concatCollection`-fans them across every
|
|
44823
|
-
* registered provider (notifiers addon + HA addon) so one catalog is
|
|
44824
|
-
* routable. `send` / `testTarget` / CRUD route to ONE provider by the
|
|
44825
|
-
* `addonId` the generated collection router extracts from the call input.
|
|
44826
|
-
* - `Attachment.bytes` is `Uint8Array`. Transport-safe: superjson (the tRPC
|
|
44827
|
-
* transformer) + UDS MsgPack both round-trip typed arrays — already used by
|
|
44828
|
-
* `storage` / `storage-provider` / `recording` caps over the same path. No
|
|
44829
|
-
* base64 fallback needed.
|
|
44830
|
-
*
|
|
44831
|
-
* TODO (deferred, closed-set change — separate decision): add
|
|
44832
|
-
* `providerKind: 'notify'` so notification providers surface on the unified
|
|
44833
|
-
* admin "Integrations" page.
|
|
44834
|
-
*/
|
|
44835
|
-
/**
|
|
44836
|
-
* Zentik-derived typed-media enum — the superset across every kind. Each
|
|
44837
|
-
* adapter picks what it supports and the degrade engine filters the rest.
|
|
44838
|
-
*/
|
|
44839
|
-
var AttachmentMediaTypeSchema = _enum([
|
|
44840
|
-
"image",
|
|
44841
|
-
"video",
|
|
44842
|
-
"gif",
|
|
44843
|
-
"audio",
|
|
44844
|
-
"icon"
|
|
44845
|
-
]);
|
|
44846
|
-
/**
|
|
44847
|
-
* A single attachment. Exactly one of `url` (remote source, most adapters
|
|
44848
|
-
* prefer this) or `bytes` (inline source; required for Pushover-style
|
|
44849
|
-
* bytes-only kinds) MUST be present — the degrade engine expresses a
|
|
44850
|
-
* url→bytes fetch as a `needsFetch` directive the adapter executes.
|
|
44851
|
-
*/
|
|
44852
|
-
var AttachmentSchema = object({
|
|
44853
|
-
mediaType: AttachmentMediaTypeSchema,
|
|
44854
|
-
url: string().optional(),
|
|
44855
|
-
bytes: _instanceof(Uint8Array).optional(),
|
|
44856
|
-
mime: string().optional(),
|
|
44857
|
-
name: string().optional()
|
|
44858
|
-
}).refine((a) => a.url !== void 0 || a.bytes !== void 0, { message: "Attachment requires either `url` or `bytes`" });
|
|
44859
|
-
var NotificationFormatSchema = _enum([
|
|
44860
|
-
"text",
|
|
44861
|
-
"markdown",
|
|
44862
|
-
"html"
|
|
44863
|
-
]);
|
|
44864
|
-
/**
|
|
44865
|
-
* The CLOSED icon vocabulary an action button may use.
|
|
44866
|
-
*
|
|
44867
|
-
* A closed set, not a free string, and that is the whole point: an arbitrary
|
|
44868
|
-
* icon name is one that ntfy renders, zentik silently drops, and nobody
|
|
44869
|
-
* notices — the same class of gap as a zone vocabulary nothing produced
|
|
44870
|
-
* ([D35](../../../docs/decisions/adr-0035.md)). Every adapter maps this set or
|
|
44871
|
-
* declares `actionIcons: false` and the degrade engine strips the field.
|
|
44872
|
-
*
|
|
44873
|
-
* Named by INTENT, never by glyph. "check" would tie the vocabulary to one
|
|
44874
|
-
* renderer's icon set; "acknowledge" survives an adapter that draws it
|
|
44875
|
-
* differently.
|
|
44876
|
-
*
|
|
44877
|
-
* ── A TOKEN IS NOT A WIRE VALUE ─────────────────────────────────────
|
|
44878
|
-
*
|
|
44879
|
-
* These names are for US. **No adapter may forward one verbatim.** Each maps
|
|
44880
|
-
* the whole set onto its own renderer's vocabulary through a
|
|
44881
|
-
* `Record<NotificationActionIcon, string>` — a Record, never a lookup with a
|
|
44882
|
-
* fallback, so adding a member here fails every adapter's build until someone
|
|
44883
|
-
* decides its glyph, which is the only place that decision can be made
|
|
44884
|
-
* honestly.
|
|
44885
|
-
*
|
|
44886
|
-
* This paragraph is the bug. Zentik declared `actionIcons: true` and passed
|
|
44887
|
-
* `disarm` straight through; iOS feeds that string to
|
|
44888
|
-
* `UNNotificationActionIcon(systemImageName:)`, `disarm` is not an SF Symbol,
|
|
44889
|
-
* and every snooze and alarm button arrived BLANK. A pass-through is not a
|
|
44890
|
-
* mapping, and "the field is documented" is not "the value renders".
|
|
44891
|
-
*
|
|
44892
|
-
* Adding a member is TRAIN-BOUND. The enum lives in the published
|
|
44893
|
-
* `@camstack/server` closure and the cap seam validates against the HUB's copy,
|
|
44894
|
-
* so an addon that emits a token the running hub does not know does not lose an
|
|
44895
|
-
* icon — its whole `send` fails Zod validation and the notification never
|
|
44896
|
-
* arrives. Never emit a new token from an addon before the train carrying it.
|
|
44897
|
-
*/
|
|
44898
|
-
var NotificationActionIconSchema = _enum([
|
|
44899
|
-
"acknowledge",
|
|
44900
|
-
"dismiss",
|
|
44901
|
-
"silence",
|
|
44902
|
-
"snooze",
|
|
44903
|
-
"view",
|
|
44904
|
-
"play",
|
|
44905
|
-
"open",
|
|
44906
|
-
"close",
|
|
44907
|
-
"lock",
|
|
44908
|
-
"unlock",
|
|
44909
|
-
"arm",
|
|
44910
|
-
"arm-home",
|
|
44911
|
-
"arm-away",
|
|
44912
|
-
"arm-night",
|
|
44913
|
-
"disarm",
|
|
44914
|
-
"light",
|
|
44915
|
-
"alert",
|
|
44916
|
-
"camera"
|
|
44917
|
-
]);
|
|
44918
|
-
/** A single tap-through action button. */
|
|
44919
|
-
var NotificationActionSchema = object({
|
|
44920
|
-
id: string(),
|
|
44921
|
-
label: string(),
|
|
44922
|
-
url: string().optional(),
|
|
44923
|
-
/** Dropped by the degrade engine for a kind with `caps.actionIcons: false`. */
|
|
44924
|
-
icon: NotificationActionIconSchema.optional(),
|
|
44925
|
-
/**
|
|
44926
|
-
* Renders in a warning style where the notifier supports it.
|
|
44927
|
-
*
|
|
44928
|
-
* A HINT, never a gate. The callback's authority is its token and nothing
|
|
44929
|
-
* else — see `notification-center/action-token.ts` for what that does and
|
|
44930
|
-
* does not buy.
|
|
44931
|
-
*/
|
|
44932
|
-
destructive: boolean().optional(),
|
|
44933
|
-
/**
|
|
44934
|
-
* How the tap should REACH the url.
|
|
44935
|
-
*
|
|
44936
|
-
* `navigate` (absent, and every button authored before this field) opens it:
|
|
44937
|
-
* the phone leaves the notification and shows whatever the callback returns.
|
|
44938
|
-
* That is right for a button whose answer the operator wants to read.
|
|
44939
|
-
*
|
|
44940
|
-
* `background` fires it as a POST and stays put. It exists for the buttons
|
|
44941
|
-
* whose whole point is not to interrupt — "silence this for 30 minutes" is
|
|
44942
|
-
* an answer to the notification, and being thrown into a browser tab to
|
|
44943
|
-
* confirm it costs more attention than the notification did. A backend that
|
|
44944
|
-
* cannot do a background call renders it as an ordinary link (the adapters
|
|
44945
|
-
* fall back rather than dropping the button), so this is a preference, never
|
|
44946
|
-
* a requirement.
|
|
44947
|
-
*/
|
|
44948
|
-
mode: _enum(["navigate", "background"]).optional()
|
|
44949
|
-
});
|
|
44950
|
-
/** A delivery parameter value: what a notifier declared it takes. */
|
|
44951
|
-
var DeliveryParamValueSchema = union([
|
|
44952
|
-
string(),
|
|
44953
|
-
number(),
|
|
44954
|
-
boolean()
|
|
44955
|
-
]);
|
|
44956
|
-
/**
|
|
44957
|
-
* One extra delivery parameter a notifier KIND declares (D938). A rule that
|
|
44958
|
-
* addresses a target of that kind may set it; a kind that declares nothing is
|
|
44959
|
-
* never handed one. The admin UI derives its control from this descriptor —
|
|
44960
|
-
* no editor knows a service by name.
|
|
44961
|
-
*
|
|
44962
|
-
* Optional fields are `.optional()`, never `.default()` (a Zod default does not
|
|
44963
|
-
* run on the addon cap path).
|
|
44964
|
-
*/
|
|
44965
|
-
var DeliveryParamSchema = object({
|
|
44966
|
-
key: string().min(1),
|
|
44967
|
-
label: string(),
|
|
44968
|
-
/** i18n key of the label, resolved by the declaring addon's namespace. */
|
|
44969
|
-
labelKey: string().optional(),
|
|
44970
|
-
type: _enum([
|
|
44971
|
-
"enum",
|
|
44972
|
-
"number",
|
|
44973
|
-
"boolean",
|
|
44974
|
-
"string"
|
|
44975
|
-
]),
|
|
44976
|
-
/** `enum` only: the closed set of accepted values. */
|
|
44977
|
-
options: array(object({
|
|
44978
|
-
value: string(),
|
|
44979
|
-
label: string()
|
|
44980
|
-
})).optional(),
|
|
44981
|
-
/** `number` only. */
|
|
44982
|
-
min: number().optional(),
|
|
44983
|
-
max: number().optional(),
|
|
44984
|
-
/** What the notifier does when the rule sets nothing; shown as the placeholder. */
|
|
44985
|
-
default: DeliveryParamValueSchema.optional()
|
|
44986
|
-
});
|
|
44987
|
-
/**
|
|
44988
|
-
* The canonical notification. `body` is the only hard field (Apprise model).
|
|
44989
|
-
* `priority` is a 5-level ORDINAL (1=lowest … 3=normal(default) … 5=urgent),
|
|
44990
|
-
* NOT a fixed severity enum — each kind declares its own `caps.levels` and
|
|
44991
|
-
* the adapter maps this ordinal onto its native level. `level?` is an
|
|
44992
|
-
* optional kind-native level id (`emergency`, `silent`, …) that overrides
|
|
44993
|
-
* `priority` for that one target.
|
|
44994
|
-
*/
|
|
44995
|
-
var NotificationSchema = object({
|
|
44996
|
-
body: string(),
|
|
44997
|
-
title: string().optional(),
|
|
44998
|
-
format: NotificationFormatSchema.default("text"),
|
|
44999
|
-
priority: number().int().min(1).max(5).default(3),
|
|
45000
|
-
level: string().optional(),
|
|
45001
|
-
attachments: array(AttachmentSchema).optional(),
|
|
45002
|
-
clickUrl: string().optional(),
|
|
45003
|
-
actions: array(NotificationActionSchema).optional(),
|
|
45004
|
-
sound: string().optional(),
|
|
45005
|
-
ttl: number().optional(),
|
|
45006
|
-
tag: string().optional(),
|
|
45007
|
-
deviceId: number().optional(),
|
|
45008
|
-
eventId: string().optional(),
|
|
45009
|
-
metadata: record(string(), unknown()).optional(),
|
|
45010
|
-
/**
|
|
45011
|
-
* Values for the parameters the target's kind DECLARES in
|
|
45012
|
-
* {@link TargetKindSchema} `deliveryParams`. Already validated against the
|
|
45013
|
-
* declaration by the sender; a notifier reads only the keys it declared.
|
|
45014
|
-
*/
|
|
45015
|
-
delivery: record(string(), DeliveryParamValueSchema).optional()
|
|
45016
|
-
});
|
|
45017
|
-
/** One declared native severity/priority level for a kind. */
|
|
45018
|
-
var TargetKindLevelSchema = object({
|
|
45019
|
-
id: string(),
|
|
45020
|
-
label: string(),
|
|
45021
|
-
/** Which canonical priority (1..5) this level maps to. `null` = qualitative-only. */
|
|
45022
|
-
ordinal: number().int().min(1).max(5).nullable(),
|
|
45023
|
-
flags: object({
|
|
45024
|
-
critical: boolean().optional(),
|
|
45025
|
-
silent: boolean().optional(),
|
|
45026
|
-
noPush: boolean().optional()
|
|
45027
|
-
}).optional(),
|
|
45028
|
-
/** e.g. Pushover `emergency` requires `retry` / `expire`. */
|
|
45029
|
-
requires: array(string()).optional(),
|
|
45030
|
-
description: string().optional()
|
|
45031
|
-
});
|
|
45032
|
-
/** The full capability block consulted before dispatch. */
|
|
45033
|
-
var TargetKindCapsSchema = object({
|
|
45034
|
-
attachments: object({
|
|
45035
|
-
mediaTypes: array(AttachmentMediaTypeSchema),
|
|
45036
|
-
mode: _enum([
|
|
45037
|
-
"url",
|
|
45038
|
-
"bytes",
|
|
45039
|
-
"both"
|
|
45040
|
-
]),
|
|
45041
|
-
max: number().int().nonnegative(),
|
|
45042
|
-
maxBytes: number().int().positive().optional()
|
|
45043
|
-
}),
|
|
45044
|
-
/** Max action buttons (0 = none). */
|
|
45045
|
-
actions: number().int().nonnegative(),
|
|
45046
|
-
/**
|
|
45047
|
-
* Whether this kind renders a per-action ICON.
|
|
45048
|
-
*
|
|
45049
|
-
* `.optional()`, deliberately NOT `.default(false)`: a Zod default does not
|
|
45050
|
-
* run on the addon cap path — three production failures in one day taught
|
|
45051
|
-
* this repo that once. Absent is read as false by the degrade engine, which
|
|
45052
|
-
* is the safe direction: an icon that is not rendered costs nothing, an icon
|
|
45053
|
-
* assumed and dropped costs the operator's trust in the field.
|
|
45054
|
-
*/
|
|
45055
|
-
actionIcons: boolean().optional(),
|
|
45056
|
-
levels: array(TargetKindLevelSchema),
|
|
45057
|
-
format: array(NotificationFormatSchema),
|
|
45058
|
-
clickUrl: boolean(),
|
|
45059
|
-
sound: boolean(),
|
|
45060
|
-
ttl: boolean(),
|
|
45061
|
-
bodyMaxLen: number().int().positive()
|
|
45062
|
-
});
|
|
45063
|
-
/**
|
|
45064
|
-
* `configSchema` is a `ConfigUISchema` tree passed through to the admin
|
|
45065
|
-
* FormBuilder. Stored as `z.unknown()` at the cap seam (mirrors
|
|
45066
|
-
* `device-provider.getChildCreationSchema` `CreationSchemaOutputSchema`) —
|
|
45067
|
-
* the union is large and not meant for runtime validation here; the exported
|
|
45068
|
-
* `TargetKind` type re-tightens `configSchema` to `ConfigUISchema`.
|
|
45069
|
-
*/
|
|
45070
|
-
var ConfigSchemaPassthrough$4 = unknown();
|
|
45071
|
-
var TargetKindSchema = object({
|
|
45072
|
-
kind: string(),
|
|
45073
|
-
label: string(),
|
|
45074
|
-
icon: string(),
|
|
45075
|
-
/** Stamped by each provider so the concat-fanned catalog stays routable. */
|
|
45076
|
-
addonId: string(),
|
|
45077
|
-
/**
|
|
45078
|
-
* URL of the kind's bundled BRAND icon, served by the providing addon over
|
|
45079
|
-
* its own `addon-routes` surface (`/addon/<addonId>/icons/<kind>`). Absent
|
|
45080
|
-
* when the addon bundles no icon for that kind — the client then falls back
|
|
45081
|
-
* to a neutral glyph rather than rendering the raw `icon` NAME as text.
|
|
45082
|
-
*
|
|
45083
|
-
* Root-relative on purpose: it resolves against whatever origin serves a web
|
|
45084
|
-
* client, and a native client joins it onto its own hub base.
|
|
45085
|
-
*
|
|
45086
|
-
* DECLARED here deliberately. It used to travel as an undeclared passthrough
|
|
45087
|
-
* field that survived only because the runtime cap-router forwards provider
|
|
45088
|
-
* output verbatim — so every consumer had to re-declare it by hand to stop
|
|
45089
|
-
* its own Zod parse from stripping it, and the whole arrangement would have
|
|
45090
|
-
* broken silently the moment output validation was tightened anywhere.
|
|
45091
|
-
*/
|
|
45092
|
-
iconUrl: string().optional(),
|
|
45093
|
-
/**
|
|
45094
|
-
* Media type of {@link iconUrl} (`image/svg+xml`, `image/png`, …).
|
|
45095
|
-
*
|
|
45096
|
-
* The server knows this and therefore says it, because the client cannot
|
|
45097
|
-
* safely guess: a React-Native client renders SVG and raster through two
|
|
45098
|
-
* DIFFERENT components (`react-native-svg` vs `expo-image` — expo-image does
|
|
45099
|
-
* not decode SVG on iOS/Android), so without this it silently fell back to a
|
|
45100
|
-
* placeholder glyph for every vector icon while the web build looked fine.
|
|
45101
|
-
*
|
|
45102
|
-
* Absent when {@link iconUrl} is absent, or for a legacy provider that has
|
|
45103
|
-
* not been updated — a client that cannot determine the type should prefer
|
|
45104
|
-
* its raster path, which is the safe default for an unknown image.
|
|
45105
|
-
*/
|
|
45106
|
-
iconMediaType: string().optional(),
|
|
45107
|
-
configSchema: ConfigSchemaPassthrough$4,
|
|
45108
|
-
/**
|
|
45109
|
-
* The config keys that decide WHERE this kind's secrets are sent (server,
|
|
45110
|
-
* base URL, instance, chat, recipient). A save that changes any of them
|
|
45111
|
-
* while leaving a secret redacted is refused by the provider (D634), so an
|
|
45112
|
-
* editor uses this to ask for the secret on exactly those edits instead of
|
|
45113
|
-
* on every edit.
|
|
45114
|
-
*
|
|
45115
|
-
* Optional: absent from a provider that holds no secret (the Home Assistant
|
|
45116
|
-
* kinds) and from a provider older than this field — an editor that finds
|
|
45117
|
-
* it absent must assume ANY edit may need the secret.
|
|
45118
|
-
*/
|
|
45119
|
-
destinationKeys: array(string()).optional(),
|
|
45120
|
-
supportsDiscovery: boolean(),
|
|
45121
|
-
/**
|
|
45122
|
-
* Extra delivery parameters a rule may set for a target of this kind (D938).
|
|
45123
|
-
* Absent = none; the rule editor then offers nothing.
|
|
45124
|
-
*/
|
|
45125
|
-
deliveryParams: array(DeliveryParamSchema).optional(),
|
|
45126
|
-
caps: TargetKindCapsSchema
|
|
45127
|
-
});
|
|
45128
|
-
/**
|
|
45129
|
-
* A persisted target. `config` holds secrets; providers REDACT secret fields
|
|
45130
|
-
* (return a presence marker only) when serving `listTargets` — never
|
|
45131
|
-
* round-trip a stored secret to the UI.
|
|
45132
|
-
*/
|
|
45133
|
-
var TargetSchema = object({
|
|
45134
|
-
id: string(),
|
|
45135
|
-
name: string(),
|
|
45136
|
-
kind: string(),
|
|
45137
|
-
addonId: string(),
|
|
45138
|
-
enabled: boolean(),
|
|
45139
|
-
config: record(string(), unknown())
|
|
45140
|
-
});
|
|
45141
|
-
/** A discovery-surfaced candidate (config is partial + non-secret). */
|
|
45142
|
-
var DiscoveredTargetSchema = object({
|
|
45143
|
-
kind: string(),
|
|
45144
|
-
suggestedName: string(),
|
|
45145
|
-
config: record(string(), unknown())
|
|
45146
|
-
});
|
|
45147
|
-
/** The degrade engine's report — what was resolved / dropped / degraded. */
|
|
45148
|
-
var RenderedAsSchema = object({
|
|
45149
|
-
level: string(),
|
|
45150
|
-
format: NotificationFormatSchema,
|
|
45151
|
-
attachmentsSent: number().int().nonnegative(),
|
|
45152
|
-
actionsSent: number().int().nonnegative(),
|
|
45153
|
-
truncated: boolean(),
|
|
45154
|
-
dropped: array(string())
|
|
45155
|
-
});
|
|
45156
|
-
var SendResultSchema = object({
|
|
45157
|
-
success: boolean(),
|
|
45158
|
-
error: string().optional(),
|
|
45159
|
-
renderedAs: RenderedAsSchema.optional()
|
|
45160
|
-
});
|
|
45161
|
-
/** Same shape as SendResult — kept as a distinct name for the test panel. */
|
|
45162
|
-
var TestResultSchema = SendResultSchema;
|
|
45163
|
-
/**
|
|
45164
|
-
* Pre-save credential probe against a partial (unsaved) target config.
|
|
45165
|
-
* `resolvedUrl` never includes secrets (token stripped from path).
|
|
45166
|
-
*/
|
|
45167
|
-
var ProbeTargetConfigResultSchema = object({
|
|
45168
|
-
ok: boolean(),
|
|
45169
|
-
resolvedUrl: string(),
|
|
45170
|
-
httpStatus: number().int().optional(),
|
|
45171
|
-
stateInstance: string().optional(),
|
|
45172
|
-
error: string().optional()
|
|
45173
|
-
});
|
|
45174
|
-
method(object({}), array(TargetKindSchema)), method(object({}), array(TargetSchema), { auth: "admin" }), method(object({ targetId: string() }), TargetSchema, { auth: "admin" }), method(object({
|
|
45175
|
-
kind: string(),
|
|
45176
|
-
config: record(string(), unknown()).optional(),
|
|
45177
|
-
/**
|
|
45178
|
-
* When editing / duplicating, the blank password field never round-trips
|
|
45179
|
-
* the stored token. Pass the source target id so the provider can restore
|
|
45180
|
-
* secrets server-side before dialling (same merge as upsert).
|
|
45181
|
-
*/
|
|
45182
|
-
targetId: string().optional()
|
|
45183
|
-
}), array(DiscoveredTargetSchema), { auth: "admin" }), method(object({
|
|
45184
|
-
kind: string(),
|
|
45185
|
-
config: record(string(), unknown()),
|
|
45186
|
-
/** See `discoverTargets.targetId` — restore stored secrets for a blank password. */
|
|
45187
|
-
targetId: string().optional()
|
|
45188
|
-
}), ProbeTargetConfigResultSchema, {
|
|
45189
|
-
kind: "mutation",
|
|
45190
|
-
auth: "admin"
|
|
45191
|
-
}), method(object({
|
|
45192
|
-
targetId: string(),
|
|
45193
|
-
notification: NotificationSchema
|
|
45194
|
-
}), SendResultSchema, {
|
|
45195
|
-
kind: "mutation",
|
|
45196
|
-
auth: "admin"
|
|
45197
|
-
}), method(object({
|
|
45198
|
-
targetId: string(),
|
|
45199
|
-
sample: NotificationSchema.optional()
|
|
45200
|
-
}), TestResultSchema, {
|
|
45201
|
-
kind: "mutation",
|
|
45202
|
-
auth: "admin"
|
|
45203
|
-
}), method(object({
|
|
45204
|
-
target: TargetSchema,
|
|
45205
|
-
/**
|
|
45206
|
-
* Duplicate flow: create a NEW target id while copying secrets from an
|
|
45207
|
-
* existing row. The UI never holds the stored token; blank / redacted
|
|
45208
|
-
* password fields are restored from this source (D634 still applies if
|
|
45209
|
-
* destinations diverge without a re-typed secret).
|
|
45210
|
-
*/
|
|
45211
|
-
cloneSecretsFrom: string().optional()
|
|
45212
|
-
}), TargetSchema, {
|
|
45213
|
-
kind: "mutation",
|
|
45214
|
-
auth: "admin"
|
|
45215
|
-
}), method(object({ targetId: string() }), _void(), {
|
|
45216
|
-
kind: "mutation",
|
|
45217
|
-
auth: "admin"
|
|
45218
|
-
}), method(object({
|
|
45219
|
-
targetId: string(),
|
|
45220
|
-
enabled: boolean()
|
|
45221
|
-
}), _void(), {
|
|
45222
|
-
kind: "mutation",
|
|
45223
|
-
auth: "admin"
|
|
45224
|
-
});
|
|
45225
45388
|
_enum([
|
|
45226
45389
|
"automation",
|
|
45227
45390
|
"action",
|
|
@@ -45492,15 +45655,28 @@ var SettingsSchemaWithValuesSchema = object({
|
|
|
45492
45655
|
});
|
|
45493
45656
|
/** Patch object — keys are field names, values are the new field values. */
|
|
45494
45657
|
var SettingsPatchSchema = record(string(), unknown());
|
|
45658
|
+
/** The scope of a scoped-settings call (D986): where the capability declared the values. */
|
|
45659
|
+
var ScopedSettingsScopeSchema = _enum(SCOPED_SETTINGS_SCOPES);
|
|
45660
|
+
/** One scoped schema an addon serves: its capability, scope and section ids. */
|
|
45661
|
+
var ScopedSettingsDeclarationSchema = object({
|
|
45662
|
+
cap: string(),
|
|
45663
|
+
scope: ScopedSettingsScopeSchema,
|
|
45664
|
+
sectionIds: array(string())
|
|
45665
|
+
});
|
|
45495
45666
|
/** Standard success response for update operations. */
|
|
45496
45667
|
var SettingsUpdateResultSchema = object({ success: literal(true) });
|
|
45497
45668
|
method(object({
|
|
45498
45669
|
addonId: string(),
|
|
45499
|
-
|
|
45500
|
-
|
|
45501
|
-
|
|
45670
|
+
cap: string(),
|
|
45671
|
+
scope: ScopedSettingsScopeSchema,
|
|
45672
|
+
nodeId: string().optional()
|
|
45502
45673
|
}), SettingsSchemaWithValuesSchema.nullable()), method(object({
|
|
45503
45674
|
addonId: string(),
|
|
45675
|
+
nodeId: string().optional()
|
|
45676
|
+
}), array(ScopedSettingsDeclarationSchema).nullable()), method(object({
|
|
45677
|
+
addonId: string(),
|
|
45678
|
+
cap: string(),
|
|
45679
|
+
scope: ScopedSettingsScopeSchema,
|
|
45504
45680
|
nodeId: string().optional(),
|
|
45505
45681
|
patch: SettingsPatchSchema
|
|
45506
45682
|
}), SettingsUpdateResultSchema, {
|
|
@@ -45508,8 +45684,10 @@ method(object({
|
|
|
45508
45684
|
auth: "admin"
|
|
45509
45685
|
}), method(object({
|
|
45510
45686
|
addonId: string(),
|
|
45687
|
+
cap: string(),
|
|
45688
|
+
scope: ScopedSettingsScopeSchema,
|
|
45511
45689
|
nodeId: string().optional()
|
|
45512
|
-
}),
|
|
45690
|
+
}), record(string(), unknown()).nullable()), method(object({
|
|
45513
45691
|
addonId: string(),
|
|
45514
45692
|
nodeId: string().optional(),
|
|
45515
45693
|
instance: IntegrationInstanceRefSchema
|
|
@@ -47072,7 +47250,7 @@ var BackupDestinationInfoSchema = object({
|
|
|
47072
47250
|
id: string(),
|
|
47073
47251
|
/**
|
|
47074
47252
|
* Manifest id of the owning addon. The Settings button on the
|
|
47075
|
-
* destination card opens that addon's
|
|
47253
|
+
* destination card opens that addon's scoped settings panel.
|
|
47076
47254
|
*/
|
|
47077
47255
|
addonId: string(),
|
|
47078
47256
|
/** Operator-toggled enable flag from the destination-policy table. */
|
|
@@ -49761,37 +49939,6 @@ method(object({
|
|
|
49761
49939
|
kind: "mutation",
|
|
49762
49940
|
auth: "admin"
|
|
49763
49941
|
}), method(object({ blockIds: array(string()) }), object({ states: array(CompositionBlockStateSchema) }), { auth: "admin" });
|
|
49764
|
-
var ConnectionTestOutcomeSchema = discriminatedUnion("outcome", [
|
|
49765
|
-
object({
|
|
49766
|
-
outcome: literal("validated"),
|
|
49767
|
-
/** Round-trip of the sign-in, when the provider measured it. */
|
|
49768
|
-
latencyMs: number().nonnegative().optional(),
|
|
49769
|
-
/** Optional human detail worth showing next to the tick
|
|
49770
|
-
* ("3 devices visible on this account"). */
|
|
49771
|
-
detail: string().optional()
|
|
49772
|
-
}).strict(),
|
|
49773
|
-
object({
|
|
49774
|
-
outcome: literal("rejected"),
|
|
49775
|
-
error: string()
|
|
49776
|
-
}).strict(),
|
|
49777
|
-
object({
|
|
49778
|
-
outcome: literal("inconclusive"),
|
|
49779
|
-
error: string()
|
|
49780
|
-
}).strict()
|
|
49781
|
-
]);
|
|
49782
|
-
var ConnectionTestInputSchema = object({
|
|
49783
|
-
/** Candidate integration settings, exactly as the create form collected them. */
|
|
49784
|
-
settings: record(string(), unknown()) });
|
|
49785
|
-
/**
|
|
49786
|
-
* What the provider's test actually DOES, so the UI can say it in words before
|
|
49787
|
-
* the operator presses the button ("Signs in to the Dreo cloud"). Purely
|
|
49788
|
-
* descriptive — it never changes routing.
|
|
49789
|
-
*/
|
|
49790
|
-
var ConnectionTestDescriptorSchema = object({ label: string() });
|
|
49791
|
-
method(ConnectionTestInputSchema, ConnectionTestOutcomeSchema, {
|
|
49792
|
-
kind: "mutation",
|
|
49793
|
-
auth: "admin"
|
|
49794
|
-
}), method(_void(), ConnectionTestDescriptorSchema, { auth: "admin" });
|
|
49795
49942
|
/**
|
|
49796
49943
|
* Upstream-system connectivity sensor — distinct from `device-status`,
|
|
49797
49944
|
* which is the kernel-managed online/offline flag for the device's
|
|
@@ -50517,7 +50664,7 @@ var mediaPlayerCapability = {
|
|
|
50517
50664
|
isMuted: { kind: "boolean" }
|
|
50518
50665
|
} }
|
|
50519
50666
|
};
|
|
50520
|
-
DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Thermostat, DeviceType.EventEmitter, 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.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Heater, DeviceType.Dryer, DeviceType.Gateway, DeviceType.Camera, DeviceType.Fan, DeviceType.Lock, DeviceType.Camera, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Gateway, DeviceType.Hub, DeviceType.Camera, DeviceType.Sensor, DeviceType.MediaPlayer, DeviceType.Vacuum, DeviceType.Generic, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.PetFountain, DeviceType.Fan, DeviceType.Humidifier, DeviceType.Climate, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder, DeviceType.Heater;
|
|
50667
|
+
DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Thermostat, DeviceType.EventEmitter, 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.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Heater, DeviceType.Dryer, DeviceType.Gateway, DeviceType.Camera, DeviceType.Fan, DeviceType.Lock, DeviceType.Camera, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Gateway, DeviceType.Hub, DeviceType.Camera, DeviceType.Sensor, DeviceType.MediaPlayer, DeviceType.Vacuum, DeviceType.Generic, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.PetFountain, DeviceType.Fan, DeviceType.Humidifier, DeviceType.Climate, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.MediaPlayer;
|
|
50521
50668
|
var NUMBER = {
|
|
50522
50669
|
kind: "fixed",
|
|
50523
50670
|
result: ["number"]
|
|
@@ -52539,6 +52686,7 @@ method(InstancePinSchema, DeviceExportStatusSchema), method(_void(), array(Expor
|
|
|
52539
52686
|
kind: "mutation",
|
|
52540
52687
|
auth: "admin"
|
|
52541
52688
|
});
|
|
52689
|
+
var DeviceAliasSchema = string().max(64).regex(/^[a-z][a-z0-9_]*$/);
|
|
52542
52690
|
/**
|
|
52543
52691
|
* A SITE ZONE — a named part of the property that several locations belong to.
|
|
52544
52692
|
*
|
|
@@ -53025,6 +53173,12 @@ var DeviceInfoSchema = object({
|
|
|
53025
53173
|
addonId: string(),
|
|
53026
53174
|
type: _enum(DeviceType),
|
|
53027
53175
|
name: string(),
|
|
53176
|
+
/** The name a value template uses for this device (`{{ stufa_veranda.temperature }}`),
|
|
53177
|
+
* entity_id style. Generated once from the name at first registration, unique
|
|
53178
|
+
* cluster-wide, editable through `setAlias`, NOT changed by a rename (D1021).
|
|
53179
|
+
* Optional: a record produced by an older build omits it until the boot
|
|
53180
|
+
* backfill has run. */
|
|
53181
|
+
alias: DeviceAliasSchema.optional(),
|
|
53028
53182
|
/** Operator-organisational location label. `null` when unset. */
|
|
53029
53183
|
location: string().nullable(),
|
|
53030
53184
|
/** Soft-disabled flag. */
|
|
@@ -53344,6 +53498,25 @@ method(object({
|
|
|
53344
53498
|
}), _void(), {
|
|
53345
53499
|
kind: "mutation",
|
|
53346
53500
|
auth: "admin"
|
|
53501
|
+
}), method(object({
|
|
53502
|
+
deviceId: number(),
|
|
53503
|
+
alias: string()
|
|
53504
|
+
}), discriminatedUnion("ok", [object({
|
|
53505
|
+
ok: literal(true),
|
|
53506
|
+
alias: DeviceAliasSchema
|
|
53507
|
+
}), object({
|
|
53508
|
+
ok: literal(false),
|
|
53509
|
+
reason: _enum([
|
|
53510
|
+
"empty",
|
|
53511
|
+
"too-long",
|
|
53512
|
+
"grammar",
|
|
53513
|
+
"reserved",
|
|
53514
|
+
"taken"
|
|
53515
|
+
]),
|
|
53516
|
+
takenBy: number().optional()
|
|
53517
|
+
})]), {
|
|
53518
|
+
kind: "mutation",
|
|
53519
|
+
auth: "admin"
|
|
53347
53520
|
}), method(object({
|
|
53348
53521
|
deviceId: number(),
|
|
53349
53522
|
location: string().nullable()
|
|
@@ -56968,10 +57141,9 @@ var AvailableIntegrationTypeSchema = object({
|
|
|
56968
57141
|
* locations" checkbox. Provider-declared in the addon manifest. */
|
|
56969
57142
|
supportsLocationImport: boolean(),
|
|
56970
57143
|
/**
|
|
56971
|
-
* True when this integration
|
|
56972
|
-
*
|
|
56973
|
-
*
|
|
56974
|
-
* rather than offering a button that always answers the same nonsense.
|
|
57144
|
+
* True when this integration's instances declare a Test (`integration-instances.describe().canTest`,
|
|
57145
|
+
* D1016). An integration that cannot be tested must say so up front rather than offering a
|
|
57146
|
+
* button that always answers the same nonsense.
|
|
56975
57147
|
*/
|
|
56976
57148
|
canTest: boolean(),
|
|
56977
57149
|
existingInstances: array(object({
|
|
@@ -57025,7 +57197,9 @@ var CreateIntegrationInputSchema = object({
|
|
|
57025
57197
|
info: record(string(), unknown()).optional(),
|
|
57026
57198
|
/** `stableId` of the discovery candidate the form was seeded from (D984). */
|
|
57027
57199
|
originStableId: string().optional(),
|
|
57028
|
-
settings: record(string(), unknown()).optional()
|
|
57200
|
+
settings: record(string(), unknown()).optional(),
|
|
57201
|
+
/** The instance kind being created, for a provider with several; omitted = its only testable kind. */
|
|
57202
|
+
kind: string().min(1).optional()
|
|
57029
57203
|
});
|
|
57030
57204
|
var UpdateIntegrationInputSchema = object({
|
|
57031
57205
|
id: string(),
|
|
@@ -57051,13 +57225,7 @@ method(_void(), array(IntegrationWithStateSchema)), method(object({ id: string()
|
|
|
57051
57225
|
}), method(object({ id: string() }), DeleteIntegrationResultSchema, {
|
|
57052
57226
|
kind: "mutation",
|
|
57053
57227
|
auth: "admin"
|
|
57054
|
-
}), method(_void(), array(AvailableIntegrationTypeSchema), { auth: "admin" })
|
|
57055
|
-
addonId: string(),
|
|
57056
|
-
settings: record(string(), unknown())
|
|
57057
|
-
}), TestConnectionResultSchema, {
|
|
57058
|
-
kind: "mutation",
|
|
57059
|
-
auth: "admin"
|
|
57060
|
-
});
|
|
57228
|
+
}), method(_void(), array(AvailableIntegrationTypeSchema), { auth: "admin" });
|
|
57061
57229
|
/**
|
|
57062
57230
|
* `integration-instances` - the connection of an addon that holds ONE or SEVERAL
|
|
57063
57231
|
* (an account, a relay, a destination) as typed records (D985, D986). The addon's
|
|
@@ -57077,7 +57245,7 @@ method(_void(), array(IntegrationWithStateSchema)), method(object({ id: string()
|
|
|
57077
57245
|
* or the redaction token KEEPS the stored secret; `{ $secretClear: true }`
|
|
57078
57246
|
* clears it.
|
|
57079
57247
|
*/
|
|
57080
|
-
var ConfigSchemaPassthrough$
|
|
57248
|
+
var ConfigSchemaPassthrough$2 = custom();
|
|
57081
57249
|
var IntegrationInstanceIdSchema = string().min(1);
|
|
57082
57250
|
var IntegrationInstanceModeSchema = _enum(["single", "multiple"]);
|
|
57083
57251
|
/**
|
|
@@ -57123,7 +57291,16 @@ var IntegrationInstanceKindSchema = object({
|
|
|
57123
57291
|
/** Relative hub path to start an interactive account link of an instance of this kind. */
|
|
57124
57292
|
connectPath: string().min(1).optional(),
|
|
57125
57293
|
/** Relative hub path to disconnect that account. */
|
|
57126
|
-
disconnectPath: string().min(1).optional()
|
|
57294
|
+
disconnectPath: string().min(1).optional(),
|
|
57295
|
+
/**
|
|
57296
|
+
* Parts of the edit dialog the flat form cannot draw (a node picker, a model source), named by a
|
|
57297
|
+
* GENERIC widget id the client maps to a component; a client that knows none of them shows none.
|
|
57298
|
+
* `connection` widgets write connection values, `model` widgets own the model choice.
|
|
57299
|
+
*/
|
|
57300
|
+
widgets: array(object({
|
|
57301
|
+
id: string().min(1),
|
|
57302
|
+
placement: _enum(["connection", "model"])
|
|
57303
|
+
})).optional()
|
|
57127
57304
|
});
|
|
57128
57305
|
/**
|
|
57129
57306
|
* How devices of an instance are found. `none`: the operator adds them by hand; `lan`: the addon
|
|
@@ -57164,10 +57341,11 @@ var IntegrationInstanceDescriptionSchema = object({
|
|
|
57164
57341
|
/** True when `testInstance` really probes the remote. */
|
|
57165
57342
|
canTest: boolean(),
|
|
57166
57343
|
/**
|
|
57167
|
-
* The kinds an instance can be of
|
|
57168
|
-
* Add flow asks which first and sends it as
|
|
57344
|
+
* The kinds an instance can be of (D1013 rule 1), each naming its `functionCap`. One entry:
|
|
57345
|
+
* nothing to choose; more than one: the Add flow asks which first and sends it as
|
|
57346
|
+
* `createInstance.kind`. Never empty: every instance belongs to exactly one kind.
|
|
57169
57347
|
*/
|
|
57170
|
-
kinds: array(IntegrationInstanceKindSchema).
|
|
57348
|
+
kinds: array(IntegrationInstanceKindSchema).min(1),
|
|
57171
57349
|
/**
|
|
57172
57350
|
* The provider accepts `createInstance.id` for an id that once existed (an adopted id, because
|
|
57173
57351
|
* devices carry it). The UI then offers "restore under its old id" on Add. Absent means no.
|
|
@@ -57203,8 +57381,8 @@ var IntegrationInstanceSchema = object({
|
|
|
57203
57381
|
* the body is the one store, `setInstanceEnabled` the one writer (epic #440, step 3).
|
|
57204
57382
|
*/
|
|
57205
57383
|
enabled: boolean().optional(),
|
|
57206
|
-
/** The kind of this instance
|
|
57207
|
-
kind: string().
|
|
57384
|
+
/** The kind of this instance: exactly one of `describe().kinds[].id` (D1013 rule 2). */
|
|
57385
|
+
kind: string().min(1),
|
|
57208
57386
|
/** Values for the instance form; a secret is a `SecretFieldView`, never text. */
|
|
57209
57387
|
formValues: record(string(), unknown()),
|
|
57210
57388
|
status: IntegrationInstanceStatusSchema.optional(),
|
|
@@ -57228,7 +57406,7 @@ var integrationInstancesCapability = {
|
|
|
57228
57406
|
id: IntegrationInstanceIdSchema.nullable(),
|
|
57229
57407
|
/** The kind of the create form (`id: null`) of a provider with several. */
|
|
57230
57408
|
kind: string().min(1).optional()
|
|
57231
|
-
}), ConfigSchemaPassthrough$
|
|
57409
|
+
}), ConfigSchemaPassthrough$2, { auth: "admin" }),
|
|
57232
57410
|
listInstances: method(_void(), array(IntegrationInstanceSchema).readonly(), { auth: "admin" }),
|
|
57233
57411
|
getInstance: method(object({ id: IntegrationInstanceIdSchema }), IntegrationInstanceSchema.nullable(), { auth: "admin" }),
|
|
57234
57412
|
/**
|
|
@@ -58330,12 +58508,12 @@ var LlmModelInfoSchema = object({
|
|
|
58330
58508
|
});
|
|
58331
58509
|
/**
|
|
58332
58510
|
* The provider-specific part of a profile, validated by the provider that owns
|
|
58333
|
-
* the kind (
|
|
58511
|
+
* the kind (saving an instance refuses what it does not accept). A field its
|
|
58334
58512
|
* `connectionSchema` declares `type: 'password'` is a secret: it is held in the
|
|
58335
58513
|
* keychain, never in the row, and reads back as the redaction marker.
|
|
58336
58514
|
*/
|
|
58337
58515
|
var LlmProviderConfigSchema = record(string(), unknown());
|
|
58338
|
-
|
|
58516
|
+
object({
|
|
58339
58517
|
id: string(),
|
|
58340
58518
|
name: string(),
|
|
58341
58519
|
/** The provider-declared kind (`LlmProfileKindDescriptor.kind`). */
|
|
@@ -58429,8 +58607,8 @@ var LlmProviderWidgetSchema = object({
|
|
|
58429
58607
|
/** ConfigUISchema tree passed through untyped on the wire (the
|
|
58430
58608
|
* notification-output `ConfigSchemaPassthrough` precedent at
|
|
58431
58609
|
* notification-output.cap.ts:151); the exported TS type re-tightens it. */
|
|
58432
|
-
var ConfigSchemaPassthrough$
|
|
58433
|
-
|
|
58610
|
+
var ConfigSchemaPassthrough$1 = unknown();
|
|
58611
|
+
object({
|
|
58434
58612
|
kind: LlmProfileKindSchema,
|
|
58435
58613
|
label: string(),
|
|
58436
58614
|
/** A generic icon name (`cloud`, `plug`, `cpu`) — never a glyph or a logo. */
|
|
@@ -58438,9 +58616,9 @@ var LlmProfileKindDescriptorSchema = object({
|
|
|
58438
58616
|
/** Stamped by each provider so the concat-fanned catalog stays routable. */
|
|
58439
58617
|
addonId: string(),
|
|
58440
58618
|
/** The provider's own fields (`providerConfig`); `password` fields are keychain-held. */
|
|
58441
|
-
connectionSchema: ConfigSchemaPassthrough$
|
|
58619
|
+
connectionSchema: ConfigSchemaPassthrough$1,
|
|
58442
58620
|
/** Provider fields that belong under "Advanced" (extra headers, runtime tuning). */
|
|
58443
|
-
advancedSchema: ConfigSchemaPassthrough$
|
|
58621
|
+
advancedSchema: ConfigSchemaPassthrough$1.optional(),
|
|
58444
58622
|
/** The kind's defaults; a model from `listModels` may override any of them. */
|
|
58445
58623
|
features: LlmModelFeaturesSchema,
|
|
58446
58624
|
/** `false` = the provider stamps `supportsVision` itself (from what a node reports). */
|
|
@@ -58569,20 +58747,7 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, {
|
|
|
58569
58747
|
}), method(object({
|
|
58570
58748
|
addonId: string().optional(),
|
|
58571
58749
|
requestId: string()
|
|
58572
|
-
}), _void(), { kind: "mutation" }), method(
|
|
58573
|
-
kind: "mutation",
|
|
58574
|
-
auth: "admin"
|
|
58575
|
-
}), method(RawSecretMigrationInputSchema, RawSecretMigrationReportSchema, {
|
|
58576
|
-
kind: "mutation",
|
|
58577
|
-
auth: "admin"
|
|
58578
|
-
}), method(ProfileRefInputSchema, _void(), {
|
|
58579
|
-
kind: "mutation",
|
|
58580
|
-
auth: "admin"
|
|
58581
|
-
}), method(ProfileRefInputSchema, LlmGenerateResultSchema, {
|
|
58582
|
-
kind: "mutation",
|
|
58583
|
-
auth: "admin",
|
|
58584
|
-
timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
|
|
58585
|
-
}), method(LlmListModelsInputSchema, LlmListModelsResultSchema, {
|
|
58750
|
+
}), _void(), { kind: "mutation" }), method(LlmListModelsInputSchema, LlmListModelsResultSchema, {
|
|
58586
58751
|
kind: "mutation",
|
|
58587
58752
|
auth: "admin"
|
|
58588
58753
|
}), method(object({}), array(LlmDefaultSchema)), method(object({
|
|
@@ -59645,20 +59810,7 @@ method(_void(), MeshStatusSchema), method(object({
|
|
|
59645
59810
|
/** Optional hostname override the host should advertise once joined. */
|
|
59646
59811
|
hostname: string().optional() }), object({
|
|
59647
59812
|
/** Authentication URL the operator should open in a browser. */
|
|
59648
|
-
loginUrl: string() }), { kind: "mutation" }), method(_void(), object({ left: literal(true) }), { kind: "mutation" }), method(_void(), object({ loggedOut: literal(true) }), { kind: "mutation" }), method(_void(), object({ peers: array(MeshPeerSchema).readonly() }))
|
|
59649
|
-
/** Optional auth key — when provided, probes the key validity
|
|
59650
|
-
* against the provider's API. Omit when already joined to
|
|
59651
|
-
* just ping the daemon. */
|
|
59652
|
-
authKey: string().optional() }), object({
|
|
59653
|
-
ok: boolean(),
|
|
59654
|
-
/** Provider-side identifier resolved by the probe (tailnet
|
|
59655
|
-
* name for Tailscale, network id for ZeroTier, etc.). */
|
|
59656
|
-
tenant: string().optional(),
|
|
59657
|
-
/** Daemon binary version, when reachable. */
|
|
59658
|
-
daemonVersion: string().optional(),
|
|
59659
|
-
/** Human-readable error when `ok: false`. */
|
|
59660
|
-
error: string().optional()
|
|
59661
|
-
}), { kind: "mutation" });
|
|
59813
|
+
loginUrl: string() }), { kind: "mutation" }), method(_void(), object({ left: literal(true) }), { kind: "mutation" }), method(_void(), object({ loggedOut: literal(true) }), { kind: "mutation" }), method(_void(), object({ peers: array(MeshPeerSchema).readonly() }));
|
|
59662
59814
|
/**
|
|
59663
59815
|
* A monotonic total between resets (D944). Energy uses `power-meter.energy`
|
|
59664
59816
|
* so dashboards keep one series; every other instantaneous reading lands here.
|
|
@@ -65800,13 +65952,6 @@ var AddBrokerInputSchema = object({
|
|
|
65800
65952
|
});
|
|
65801
65953
|
var AddBrokerResultSchema = object({ id: string() });
|
|
65802
65954
|
var IdInputSchema = object({ id: string() });
|
|
65803
|
-
var TestResultSchema$1 = discriminatedUnion("ok", [object({
|
|
65804
|
-
ok: literal(true),
|
|
65805
|
-
latencyMs: number()
|
|
65806
|
-
}), object({
|
|
65807
|
-
ok: literal(false),
|
|
65808
|
-
error: string()
|
|
65809
|
-
})]);
|
|
65810
65955
|
var StartEmbeddedInputSchema = object({
|
|
65811
65956
|
port: number().int().min(1).max(65535).default(1883),
|
|
65812
65957
|
/** Allow anonymous connect (no username/password). Default: false. */
|
|
@@ -65829,9 +65974,6 @@ method(_void(), array(BrokerInfoSchema)), method(IdInputSchema, BrokerConnection
|
|
|
65829
65974
|
}), method(IdInputSchema, _void(), {
|
|
65830
65975
|
kind: "mutation",
|
|
65831
65976
|
auth: "admin"
|
|
65832
|
-
}), method(IdInputSchema, TestResultSchema$1, {
|
|
65833
|
-
kind: "mutation",
|
|
65834
|
-
auth: "admin"
|
|
65835
65977
|
}), method(StartEmbeddedInputSchema, StartEmbeddedResultSchema, {
|
|
65836
65978
|
kind: "mutation",
|
|
65837
65979
|
auth: "admin"
|
|
@@ -67495,6 +67637,11 @@ var NcScheduleSchema = object({
|
|
|
67495
67637
|
* as a STATE SUMMARY at the end of each window of `schedule`.
|
|
67496
67638
|
*/
|
|
67497
67639
|
var NcSystemEventDeliveryModeSchema = _enum(["instant", "summary"]);
|
|
67640
|
+
_enum([
|
|
67641
|
+
"activation",
|
|
67642
|
+
"deactivation",
|
|
67643
|
+
"schedule"
|
|
67644
|
+
]);
|
|
67498
67645
|
/**
|
|
67499
67646
|
* How a summary window is SENT (D698): `rule` (absent) = ONE notification with
|
|
67500
67647
|
* every section; `section` = one notification per section with something to
|
|
@@ -67511,11 +67658,26 @@ var NcStateSummarySplitSchema = _enum(["rule", "section"]);
|
|
|
67511
67658
|
* midnight crossing); the send time is each window's END. Refused on the
|
|
67512
67659
|
* `alarm` family, which stays instant (`systemEventDeliveryProblems`).
|
|
67513
67660
|
*/
|
|
67514
|
-
var NcSystemEventDeliverySchema = discriminatedUnion("mode", [
|
|
67515
|
-
mode: literal("
|
|
67516
|
-
|
|
67517
|
-
|
|
67518
|
-
|
|
67661
|
+
var NcSystemEventDeliverySchema = discriminatedUnion("mode", [
|
|
67662
|
+
object({ mode: literal("instant") }),
|
|
67663
|
+
object({
|
|
67664
|
+
mode: literal("summary"),
|
|
67665
|
+
schedule: NcScheduleSchema,
|
|
67666
|
+
split: NcStateSummarySplitSchema.optional()
|
|
67667
|
+
}),
|
|
67668
|
+
object({
|
|
67669
|
+
mode: literal("modes"),
|
|
67670
|
+
/** The bad edge, and every kind that has a single edge. */
|
|
67671
|
+
onActivation: boolean(),
|
|
67672
|
+
/** The recovery edges of the classes of the selected kinds (derived, never stored per kind). */
|
|
67673
|
+
onDeactivation: boolean(),
|
|
67674
|
+
/** A state summary at the end of each window; absent = no summary. */
|
|
67675
|
+
onSchedule: object({
|
|
67676
|
+
schedule: NcScheduleSchema,
|
|
67677
|
+
grouping: NcStateSummarySplitSchema
|
|
67678
|
+
}).optional()
|
|
67679
|
+
})
|
|
67680
|
+
]);
|
|
67519
67681
|
/** Fuzzy plate matcher — OCR noise makes exact match useless (spec row 12/13). */
|
|
67520
67682
|
var NcPlateMatcherSchema = object({
|
|
67521
67683
|
/**
|
|
@@ -69875,61 +70037,6 @@ var OauthIntegrationDescriptorSchema = object({
|
|
|
69875
70037
|
});
|
|
69876
70038
|
method(_void(), OauthIntegrationDescriptorSchema, { auth: "admin" });
|
|
69877
70039
|
/**
|
|
69878
|
-
* `oidc-connections` — CRUD for IdP rows under `auth-oidc` (D828 sibling).
|
|
69879
|
-
*
|
|
69880
|
-
* One hub-only singleton (`auth-oidc`). The Settings UI is a DataTable +
|
|
69881
|
-
* ItemFormDialog; there is no `editable-array` in `globalSettingsSchema`.
|
|
69882
|
-
* Operator-chosen `id` is the URL slug (`/addon/auth-oidc/<id>/…`) and is
|
|
69883
|
-
* immutable after create.
|
|
69884
|
-
*/
|
|
69885
|
-
var ConfigSchemaPassthrough$1 = unknown();
|
|
69886
|
-
var OidcConnectionSchema = object({
|
|
69887
|
-
id: string().min(1),
|
|
69888
|
-
displayName: string(),
|
|
69889
|
-
icon: string(),
|
|
69890
|
-
issuerUrl: string(),
|
|
69891
|
-
clientId: string(),
|
|
69892
|
-
/** Client id + secret present — never the secret value. */
|
|
69893
|
-
configured: boolean(),
|
|
69894
|
-
/**
|
|
69895
|
-
* Values for the connection form schema. `clientSecret` is a keychain
|
|
69896
|
-
* {@link SecretFieldView} or `null` / `''`, never plaintext (D789).
|
|
69897
|
-
*/
|
|
69898
|
-
formValues: record(string(), unknown()).optional()
|
|
69899
|
-
});
|
|
69900
|
-
/**
|
|
69901
|
-
* Patch one connection. Omitted or empty `clientSecret` keeps the stored
|
|
69902
|
-
* secret (D787). `{ $secretClear: true }` clears it. `id` is never renamed.
|
|
69903
|
-
*/
|
|
69904
|
-
var OidcConnectionUpdateInputSchema = object({
|
|
69905
|
-
id: string().min(1),
|
|
69906
|
-
displayName: string().min(1),
|
|
69907
|
-
icon: string().optional(),
|
|
69908
|
-
issuerUrl: string().optional(),
|
|
69909
|
-
clientId: string().optional(),
|
|
69910
|
-
clientSecret: union([string(), object({ $secretClear: literal(true) })]).optional(),
|
|
69911
|
-
redirectUri: string().optional(),
|
|
69912
|
-
scopes: string().optional(),
|
|
69913
|
-
usernameClaim: _enum([
|
|
69914
|
-
"preferred_username",
|
|
69915
|
-
"email",
|
|
69916
|
-
"sub"
|
|
69917
|
-
]).optional()
|
|
69918
|
-
});
|
|
69919
|
-
method(object({}), ConfigSchemaPassthrough$1, { auth: "admin" }), method(object({}), array(OidcConnectionSchema).readonly(), { auth: "admin" }), method(object({
|
|
69920
|
-
id: string().min(1).regex(/^[a-z0-9][a-z0-9-]{0,63}$/, "id must be a lowercase slug"),
|
|
69921
|
-
displayName: string().min(1)
|
|
69922
|
-
}), object({ id: string() }), {
|
|
69923
|
-
kind: "mutation",
|
|
69924
|
-
auth: "admin"
|
|
69925
|
-
}), method(OidcConnectionUpdateInputSchema, object({ ok: literal(true) }), {
|
|
69926
|
-
kind: "mutation",
|
|
69927
|
-
auth: "admin"
|
|
69928
|
-
}), method(object({ id: string().min(1) }), object({ ok: literal(true) }), {
|
|
69929
|
-
kind: "mutation",
|
|
69930
|
-
auth: "admin"
|
|
69931
|
-
});
|
|
69932
|
-
/**
|
|
69933
70040
|
* Generic on-screen-display (video overlay) cap. Each camera exposes
|
|
69934
70041
|
* a firmware-defined list of overlays (channel name, timestamp,
|
|
69935
70042
|
* watermark, logo, …); the cap models them as a homogeneous array of
|
|
@@ -76250,6 +76357,16 @@ var RemoteLayoutComponentSchema = object({
|
|
|
76250
76357
|
method(object({}), array(RemoteLayoutComponentSchema), { auth: "protected" });
|
|
76251
76358
|
var RUNNING_POWER_START_DELAY_MS = 3e4;
|
|
76252
76359
|
var RUNNING_POWER_STOP_DELAY_MS = 18e4;
|
|
76360
|
+
/**
|
|
76361
|
+
* Per-type overrides of the dwell defaults. A media player draws power the
|
|
76362
|
+
* moment it is on and stops drawing the moment it is off, so it needs neither
|
|
76363
|
+
* a long dwell nor a second sample. A type absent here keeps the global values.
|
|
76364
|
+
*/
|
|
76365
|
+
var RUNNING_POWER_DEFAULTS_BY_TYPE = { [DeviceType.MediaPlayer]: {
|
|
76366
|
+
startDwellMs: 1e4,
|
|
76367
|
+
stopDwellMs: 1e4,
|
|
76368
|
+
minSamples: 1
|
|
76369
|
+
} };
|
|
76253
76370
|
var RunningStateSourceSchema = _enum(["native", "assigned"]);
|
|
76254
76371
|
var RunningStateStatusSchema = object({
|
|
76255
76372
|
/** null = unknown — never coerced to false (D393). */
|
|
@@ -76267,93 +76384,27 @@ var RunningFlipEventDataSchema = object({
|
|
|
76267
76384
|
phase: string().nullable()
|
|
76268
76385
|
});
|
|
76269
76386
|
var RUNNING_DEVICE_TYPES = Object.values(DeviceType);
|
|
76270
|
-
/**
|
|
76271
|
-
|
|
76272
|
-
|
|
76273
|
-
|
|
76274
|
-
|
|
76275
|
-
|
|
76276
|
-
|
|
76277
|
-
|
|
76278
|
-
|
|
76279
|
-
|
|
76280
|
-
|
|
76281
|
-
|
|
76282
|
-
|
|
76283
|
-
|
|
76284
|
-
|
|
76285
|
-
|
|
76286
|
-
|
|
76287
|
-
|
|
76288
|
-
|
|
76289
|
-
|
|
76290
|
-
|
|
76291
|
-
DeviceType.WaterHeater,
|
|
76292
|
-
DeviceType.Humidifier,
|
|
76293
|
-
DeviceType.Fan,
|
|
76294
|
-
DeviceType.Climate,
|
|
76295
|
-
DeviceType.Thermostat,
|
|
76296
|
-
DeviceType.PetFeeder,
|
|
76297
|
-
DeviceType.Heater
|
|
76298
|
-
],
|
|
76299
|
-
apply: "add",
|
|
76300
|
-
path: "running",
|
|
76301
|
-
sources: [
|
|
76302
|
-
{
|
|
76303
|
-
kind: "switch",
|
|
76304
|
-
transforms: [{ kind: "identity" }]
|
|
76305
|
-
},
|
|
76306
|
-
{
|
|
76307
|
-
kind: "binary",
|
|
76308
|
-
transforms: [{ kind: "identity" }, { kind: "invert" }]
|
|
76309
|
-
},
|
|
76310
|
-
{
|
|
76311
|
-
kind: "numeric",
|
|
76312
|
-
requiredUnit: "W",
|
|
76313
|
-
transforms: [{
|
|
76314
|
-
kind: "threshold",
|
|
76315
|
-
comparisons: ["gte", "lte"],
|
|
76316
|
-
comparison: "gte",
|
|
76317
|
-
defaultThreshold: 5,
|
|
76318
|
-
defaultStartDwellMs: RUNNING_POWER_START_DELAY_MS,
|
|
76319
|
-
defaultStopDwellMs: RUNNING_POWER_STOP_DELAY_MS,
|
|
76320
|
-
thresholdUnit: "W"
|
|
76321
|
-
}]
|
|
76322
|
-
}
|
|
76323
|
-
],
|
|
76324
|
-
companions: [
|
|
76325
|
-
{
|
|
76326
|
-
kind: "constant",
|
|
76327
|
-
path: "source",
|
|
76328
|
-
value: "assigned",
|
|
76329
|
-
when: "always"
|
|
76330
|
-
},
|
|
76331
|
-
{
|
|
76332
|
-
kind: "constant",
|
|
76333
|
-
path: "phase",
|
|
76334
|
-
value: null,
|
|
76335
|
-
when: "add"
|
|
76336
|
-
},
|
|
76337
|
-
{
|
|
76338
|
-
kind: "clock",
|
|
76339
|
-
path: "lastFetchedAt",
|
|
76340
|
-
when: "always"
|
|
76341
|
-
},
|
|
76342
|
-
{
|
|
76343
|
-
kind: "transition-time",
|
|
76344
|
-
path: "since",
|
|
76345
|
-
sourceChangedAt: "prefer"
|
|
76346
|
-
}
|
|
76347
|
-
],
|
|
76348
|
-
sourceReport: {
|
|
76349
|
-
status: "assignment-status",
|
|
76350
|
-
runtimeField: "source",
|
|
76351
|
-
nativeValue: "native",
|
|
76352
|
-
assignedValue: "assigned"
|
|
76353
|
-
},
|
|
76354
|
-
advancedExpression: true
|
|
76355
|
-
}]
|
|
76356
|
-
};
|
|
76387
|
+
/**
|
|
76388
|
+
* Customize offers "running" only where a job makes sense (D933): a cycle,
|
|
76389
|
+
* a clean, a mow, playback, or another appliance that is on and working.
|
|
76390
|
+
* The cap itself stays on every type — a camera can still report running
|
|
76391
|
+
* natively; it just has no card.
|
|
76392
|
+
*/
|
|
76393
|
+
var RUNNING_CUSTOMIZE_DEVICE_TYPES = [
|
|
76394
|
+
DeviceType.Washer,
|
|
76395
|
+
DeviceType.Dryer,
|
|
76396
|
+
DeviceType.Dishwasher,
|
|
76397
|
+
DeviceType.Vacuum,
|
|
76398
|
+
DeviceType.LawnMower,
|
|
76399
|
+
DeviceType.MediaPlayer,
|
|
76400
|
+
DeviceType.WaterHeater,
|
|
76401
|
+
DeviceType.Humidifier,
|
|
76402
|
+
DeviceType.Fan,
|
|
76403
|
+
DeviceType.Climate,
|
|
76404
|
+
DeviceType.Thermostat,
|
|
76405
|
+
DeviceType.PetFeeder,
|
|
76406
|
+
DeviceType.Heater
|
|
76407
|
+
];
|
|
76357
76408
|
var runningStateCapability = {
|
|
76358
76409
|
name: "running-state",
|
|
76359
76410
|
scope: "device",
|
|
@@ -76373,7 +76424,79 @@ var runningStateCapability = {
|
|
|
76373
76424
|
durability: "restored",
|
|
76374
76425
|
history: { fields: { running: { kind: "boolean" } } },
|
|
76375
76426
|
volatileStateFields: ["lastFetchedAt"],
|
|
76376
|
-
customize:
|
|
76427
|
+
customize: {
|
|
76428
|
+
version: 1,
|
|
76429
|
+
overridable: [{
|
|
76430
|
+
path: "running",
|
|
76431
|
+
by: "running"
|
|
76432
|
+
}],
|
|
76433
|
+
targets: [{
|
|
76434
|
+
id: "running",
|
|
76435
|
+
cardinality: "scalar",
|
|
76436
|
+
vocabulary: {
|
|
76437
|
+
cap: "running-state",
|
|
76438
|
+
stateField: "running"
|
|
76439
|
+
},
|
|
76440
|
+
deviceTypes: RUNNING_CUSTOMIZE_DEVICE_TYPES,
|
|
76441
|
+
apply: "add",
|
|
76442
|
+
path: "running",
|
|
76443
|
+
sources: [
|
|
76444
|
+
{
|
|
76445
|
+
kind: "switch",
|
|
76446
|
+
transforms: [{ kind: "identity" }]
|
|
76447
|
+
},
|
|
76448
|
+
{
|
|
76449
|
+
kind: "binary",
|
|
76450
|
+
transforms: [{ kind: "identity" }, { kind: "invert" }]
|
|
76451
|
+
},
|
|
76452
|
+
{
|
|
76453
|
+
kind: "numeric",
|
|
76454
|
+
requiredUnit: "W",
|
|
76455
|
+
transforms: [{
|
|
76456
|
+
kind: "threshold",
|
|
76457
|
+
comparisons: ["gte", "lte"],
|
|
76458
|
+
comparison: "gte",
|
|
76459
|
+
defaultThreshold: 5,
|
|
76460
|
+
defaultStartDwellMs: RUNNING_POWER_START_DELAY_MS,
|
|
76461
|
+
defaultStopDwellMs: RUNNING_POWER_STOP_DELAY_MS,
|
|
76462
|
+
deviceTypeDefaults: RUNNING_POWER_DEFAULTS_BY_TYPE,
|
|
76463
|
+
thresholdUnit: "W"
|
|
76464
|
+
}]
|
|
76465
|
+
}
|
|
76466
|
+
],
|
|
76467
|
+
companions: [
|
|
76468
|
+
{
|
|
76469
|
+
kind: "constant",
|
|
76470
|
+
path: "source",
|
|
76471
|
+
value: "assigned",
|
|
76472
|
+
when: "always"
|
|
76473
|
+
},
|
|
76474
|
+
{
|
|
76475
|
+
kind: "constant",
|
|
76476
|
+
path: "phase",
|
|
76477
|
+
value: null,
|
|
76478
|
+
when: "add"
|
|
76479
|
+
},
|
|
76480
|
+
{
|
|
76481
|
+
kind: "clock",
|
|
76482
|
+
path: "lastFetchedAt",
|
|
76483
|
+
when: "always"
|
|
76484
|
+
},
|
|
76485
|
+
{
|
|
76486
|
+
kind: "transition-time",
|
|
76487
|
+
path: "since",
|
|
76488
|
+
sourceChangedAt: "prefer"
|
|
76489
|
+
}
|
|
76490
|
+
],
|
|
76491
|
+
sourceReport: {
|
|
76492
|
+
status: "assignment-status",
|
|
76493
|
+
runtimeField: "source",
|
|
76494
|
+
nativeValue: "native",
|
|
76495
|
+
assignedValue: "assigned"
|
|
76496
|
+
},
|
|
76497
|
+
advancedExpression: true
|
|
76498
|
+
}]
|
|
76499
|
+
}
|
|
76377
76500
|
};
|
|
76378
76501
|
/**
|
|
76379
76502
|
* scene-monitor — device-scoped reference-region state cap. An operator marks
|
|
@@ -77721,21 +77844,6 @@ method(object({
|
|
|
77721
77844
|
*/
|
|
77722
77845
|
ttlSec: union([number().int().positive(), literal("never")]).optional()
|
|
77723
77846
|
}), object({ token: string() }), { auth: "admin" }), method(object({ token: string() }), SsoBridgeClaimsSchema.nullable(), { auth: "admin" });
|
|
77724
|
-
var ProviderListEntrySchema = discriminatedUnion("shouldSaveDiskSpace", [object({
|
|
77725
|
-
providerId: string().min(1),
|
|
77726
|
-
displayName: string().min(1),
|
|
77727
|
-
configSchema: unknown(),
|
|
77728
|
-
nodeLocal: boolean(),
|
|
77729
|
-
shouldSaveDiskSpace: literal(true),
|
|
77730
|
-
minFreePercent: number().min(0).max(100)
|
|
77731
|
-
}), object({
|
|
77732
|
-
providerId: string().min(1),
|
|
77733
|
-
displayName: string().min(1),
|
|
77734
|
-
configSchema: unknown(),
|
|
77735
|
-
nodeLocal: boolean(),
|
|
77736
|
-
shouldSaveDiskSpace: literal(false),
|
|
77737
|
-
minFreePercent: literal(null)
|
|
77738
|
-
})]);
|
|
77739
77847
|
method(object({
|
|
77740
77848
|
location: StorageLocationRefSchema,
|
|
77741
77849
|
relativePath: string()
|
|
@@ -77797,42 +77905,7 @@ method(object({
|
|
|
77797
77905
|
}), _instanceof(Uint8Array), { auth: "admin" }), method(object({ downloadId: string() }), _void(), {
|
|
77798
77906
|
kind: "mutation",
|
|
77799
77907
|
auth: "admin"
|
|
77800
|
-
}), method(object({ type: StorageLocationTypeSchema.optional() }), array(StorageLocationSchema).readonly()), method(_void(), array(StorageLocationDeclarationSchema).readonly()), method(
|
|
77801
|
-
createdAt: true,
|
|
77802
|
-
updatedAt: true
|
|
77803
|
-
}), StorageLocationSchema, {
|
|
77804
|
-
kind: "mutation",
|
|
77805
|
-
auth: "admin"
|
|
77806
|
-
}), method(object({
|
|
77807
|
-
id: string(),
|
|
77808
|
-
force: boolean().optional()
|
|
77809
|
-
}), _void(), {
|
|
77810
|
-
kind: "mutation",
|
|
77811
|
-
auth: "admin"
|
|
77812
|
-
}), method(_void(), array(StorageDrainProgressSchema).readonly()), method(object({ id: string() }), object({
|
|
77813
|
-
ok: boolean(),
|
|
77814
|
-
error: string().optional()
|
|
77815
|
-
}), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
|
|
77816
|
-
providerId: string(),
|
|
77817
|
-
/**
|
|
77818
|
-
* The location this config is an UNSAVED edit of, when there is one.
|
|
77819
|
-
*
|
|
77820
|
-
* `listLocations` replaces every declared secret with the redaction
|
|
77821
|
-
* sentinel, so the edit modal's form state holds the sentinel for any
|
|
77822
|
-
* credential the operator did not retype — and posting that here
|
|
77823
|
-
* without a way to resolve it makes the provider try to authenticate
|
|
77824
|
-
* as `__camstack_redacted__` and report the operator's own working
|
|
77825
|
-
* password as wrong. Given this id, the orchestrator restores each
|
|
77826
|
-
* sentinel from the stored config (same rule as `upsertLocation`)
|
|
77827
|
-
* before dispatching. Omitted by the "Add location" wizard, where
|
|
77828
|
-
* every value was typed just now and nothing is stored yet.
|
|
77829
|
-
*/
|
|
77830
|
-
locationId: string().optional(),
|
|
77831
|
-
config: record(string(), unknown())
|
|
77832
|
-
}), object({
|
|
77833
|
-
ok: boolean(),
|
|
77834
|
-
error: string().optional()
|
|
77835
|
-
}), { auth: "admin" });
|
|
77908
|
+
}), method(object({ type: StorageLocationTypeSchema.optional() }), array(StorageLocationSchema).readonly()), method(_void(), array(StorageLocationDeclarationSchema).readonly()), method(_void(), array(StorageDrainProgressSchema).readonly());
|
|
77836
77909
|
/** One table of the settings database. */
|
|
77837
77910
|
var StorageTableSchema = object({
|
|
77838
77911
|
/** The table's full name, e.g. `recorder:addon-settings` or `addon-device-settings`. */
|
|
@@ -79354,7 +79427,7 @@ var TerminalInstanceInfoSchema = object({
|
|
|
79354
79427
|
/**
|
|
79355
79428
|
* False while the node the instance is bound to is not in the cluster
|
|
79356
79429
|
* topology (forgotten, renamed, re-paired). The instance is kept; the
|
|
79357
|
-
* operator re-points it
|
|
79430
|
+
* operator re-points it on the Terminal page.
|
|
79358
79431
|
*/
|
|
79359
79432
|
nodeInCluster: boolean(),
|
|
79360
79433
|
profileId: string(),
|
|
@@ -79392,41 +79465,7 @@ var TerminalOutputBatchSchema = object({
|
|
|
79392
79465
|
snapshot: string().optional(),
|
|
79393
79466
|
events: array(TerminalOutputEventSchema).readonly()
|
|
79394
79467
|
});
|
|
79395
|
-
method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(
|
|
79396
|
-
targetNodeId: string().min(1),
|
|
79397
|
-
profileId: string().min(1),
|
|
79398
|
-
name: string().trim().min(1).max(160).optional(),
|
|
79399
|
-
executable: string().max(1024).optional(),
|
|
79400
|
-
args: array(string().max(2048)).max(64).optional(),
|
|
79401
|
-
cwd: string().max(1024).optional(),
|
|
79402
|
-
environment: array(string().max(4096)).max(64).optional(),
|
|
79403
|
-
profileSettings: ProfileSettingsBagSchema.optional()
|
|
79404
|
-
}), TerminalInstanceInfoSchema, {
|
|
79405
|
-
kind: "mutation",
|
|
79406
|
-
auth: "admin"
|
|
79407
|
-
}), method(object({
|
|
79408
|
-
instanceId: string().min(1),
|
|
79409
|
-
/** Re-point the instance to another node; the profile must exist there. */
|
|
79410
|
-
targetNodeId: string().min(1).max(256).optional(),
|
|
79411
|
-
name: string().trim().min(1).max(160).optional(),
|
|
79412
|
-
executable: string().max(1024).optional(),
|
|
79413
|
-
args: array(string().max(2048)).max(64).optional(),
|
|
79414
|
-
cwd: string().max(1024).optional(),
|
|
79415
|
-
environment: array(string().max(4096)).max(64).optional(),
|
|
79416
|
-
profileSettings: ProfileSettingsBagSchema.optional()
|
|
79417
|
-
}), TerminalInstanceInfoSchema, {
|
|
79418
|
-
kind: "mutation",
|
|
79419
|
-
auth: "admin"
|
|
79420
|
-
}), method(object({ instanceId: string().min(1) }), _void(), {
|
|
79421
|
-
kind: "mutation",
|
|
79422
|
-
auth: "admin"
|
|
79423
|
-
}), method(object({
|
|
79424
|
-
instanceId: string().min(1),
|
|
79425
|
-
enabled: boolean()
|
|
79426
|
-
}), TerminalInstanceInfoSchema, {
|
|
79427
|
-
kind: "mutation",
|
|
79428
|
-
auth: "admin"
|
|
79429
|
-
}), method(_void(), array(TerminalLegacyCameraSchema).readonly(), { auth: "admin" }), method(object({
|
|
79468
|
+
method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalLegacyCameraSchema).readonly(), { auth: "admin" }), method(object({
|
|
79430
79469
|
stableId: string().min(1),
|
|
79431
79470
|
name: string().trim().min(1).max(160).optional()
|
|
79432
79471
|
}), TerminalInstanceInfoSchema, {
|
|
@@ -79495,6 +79534,11 @@ var TimedRunUnitSchema = _enum(["s", "min"]);
|
|
|
79495
79534
|
_enum(["switch", "pet-fountain"]);
|
|
79496
79535
|
DeviceType.Heater, DeviceType.PetFountain;
|
|
79497
79536
|
var TIMED_RUN_DEVICE_TYPES = [DeviceType.Heater, DeviceType.PetFountain];
|
|
79537
|
+
/** One duration, as the one-tap run asks for it. */
|
|
79538
|
+
var TimedRunQuickRunSchema = object({
|
|
79539
|
+
duration: number().positive().finite(),
|
|
79540
|
+
unit: TimedRunUnitSchema
|
|
79541
|
+
});
|
|
79498
79542
|
/** Why a request was not carried out. Typed, so a caller can say it in words. */
|
|
79499
79543
|
var TimedRunRefusalSchema = _enum([
|
|
79500
79544
|
"unsupported-device",
|
|
@@ -79515,8 +79559,23 @@ var TimedRunStatusSchema = object({
|
|
|
79515
79559
|
activeUntil: number().nullable(),
|
|
79516
79560
|
/** Who asked for the run (a user id or an addon id); `null` when nothing is armed or it did not say. */
|
|
79517
79561
|
requestedBy: string().nullable(),
|
|
79562
|
+
/**
|
|
79563
|
+
* The one-tap run of THIS device: what a "Run" button on any surface starts. `null` when
|
|
79564
|
+
* the device is gone or its type has no timed run; a status from before this field
|
|
79565
|
+
* existed has none, and a surface falls back to the type's default.
|
|
79566
|
+
*/
|
|
79567
|
+
quickRun: TimedRunQuickRunSchema.nullable(),
|
|
79518
79568
|
lastFetchedAt: number()
|
|
79519
79569
|
});
|
|
79570
|
+
/** What the settings form needs: the unit, the bounds and the type's default. */
|
|
79571
|
+
var TimedRunOptionsSchema = object({
|
|
79572
|
+
unit: TimedRunUnitSchema,
|
|
79573
|
+
/** The longest run, in `unit`. */
|
|
79574
|
+
maxDuration: number(),
|
|
79575
|
+
defaultDuration: number()
|
|
79576
|
+
});
|
|
79577
|
+
/** The one-tap run duration, in the type's unit; `null` returns to the type's default. */
|
|
79578
|
+
var TimedRunSettingsPatchSchema = object({ quickRunDuration: number().positive().finite().nullable().optional() });
|
|
79520
79579
|
var timedRunCapability = {
|
|
79521
79580
|
name: "timed-run",
|
|
79522
79581
|
scope: "device",
|
|
@@ -79524,7 +79583,24 @@ var timedRunCapability = {
|
|
|
79524
79583
|
kind: "wrapper",
|
|
79525
79584
|
defaultActive: true,
|
|
79526
79585
|
deviceTypes: TIMED_RUN_DEVICE_TYPES,
|
|
79586
|
+
deviceConfig: { ui: {
|
|
79587
|
+
kind: "derived-form",
|
|
79588
|
+
builderId: "timed-run",
|
|
79589
|
+
tab: "general"
|
|
79590
|
+
} },
|
|
79527
79591
|
methods: {
|
|
79592
|
+
getOptions: method(object({ deviceId: number().int() }), TimedRunOptionsSchema),
|
|
79593
|
+
/**
|
|
79594
|
+
* The one-tap run of this device. A duration above the type's maximum is
|
|
79595
|
+
* REFUSED (thrown), like `runFor`: the maximum is a safety bound.
|
|
79596
|
+
*/
|
|
79597
|
+
setSettings: method(object({
|
|
79598
|
+
deviceId: number().int(),
|
|
79599
|
+
settings: TimedRunSettingsPatchSchema
|
|
79600
|
+
}), _void(), {
|
|
79601
|
+
kind: "mutation",
|
|
79602
|
+
auth: "admin"
|
|
79603
|
+
}),
|
|
79528
79604
|
/**
|
|
79529
79605
|
* Turn the device on and arm its off. A run already armed is replaced (the
|
|
79530
79606
|
* new deadline wins). Refuses with a typed reason above the type's maximum.
|
|
@@ -79648,7 +79724,7 @@ var TrainingProviderTypeSchema = object({
|
|
|
79648
79724
|
label: string(),
|
|
79649
79725
|
/** Path under the addon package (e.g. `assets/training-modal/icon.svg`). */
|
|
79650
79726
|
iconAsset: string(),
|
|
79651
|
-
/** Owning `training-provider` addon
|
|
79727
|
+
/** Owning `training-provider` addon. */
|
|
79652
79728
|
addonId: string(),
|
|
79653
79729
|
/**
|
|
79654
79730
|
* Fields for one entry of this type (credentials + defaults). Absent on a
|
|
@@ -79693,36 +79769,6 @@ var TrainingProviderDescriptorSchema = object({
|
|
|
79693
79769
|
*/
|
|
79694
79770
|
formValues: record(string(), unknown()).optional()
|
|
79695
79771
|
});
|
|
79696
|
-
/**
|
|
79697
|
-
* Patch one entry's name, credentials and defaults. Pin with owning `{ addonId }`.
|
|
79698
|
-
* An omitted or empty `tokenSecret` means KEEP the stored secret (D787).
|
|
79699
|
-
* `{ $secretClear: true }` clears it.
|
|
79700
|
-
*/
|
|
79701
|
-
var TrainingProviderUpdateEntryInputSchema = object({
|
|
79702
|
-
entryId: string().min(1),
|
|
79703
|
-
name: string().min(1),
|
|
79704
|
-
tokenId: string().optional(),
|
|
79705
|
-
tokenSecret: union([string(), object({ $secretClear: literal(true) })]).optional(),
|
|
79706
|
-
environment: string().optional(),
|
|
79707
|
-
gpuType: string().optional(),
|
|
79708
|
-
region: string().optional(),
|
|
79709
|
-
costCapUsd: number().nonnegative().optional(),
|
|
79710
|
-
maxRuntimeSec: number().int().positive().optional(),
|
|
79711
|
-
failedDatasetGraceHours: number().nonnegative().optional()
|
|
79712
|
-
});
|
|
79713
|
-
var TrainingCredentialCheckSchema = object({
|
|
79714
|
-
ok: boolean(),
|
|
79715
|
-
/** Workspace / account name, when the provider says. */
|
|
79716
|
-
account: string().optional(),
|
|
79717
|
-
reason: _enum([
|
|
79718
|
-
"missing",
|
|
79719
|
-
"invalid",
|
|
79720
|
-
"forbidden",
|
|
79721
|
-
"network",
|
|
79722
|
-
"quota"
|
|
79723
|
-
]).optional(),
|
|
79724
|
-
detail: string().optional()
|
|
79725
|
-
});
|
|
79726
79772
|
var ProviderJobStateSchema = _enum([
|
|
79727
79773
|
"pending",
|
|
79728
79774
|
"starting",
|
|
@@ -79770,22 +79816,6 @@ var TrainingLogLineSchema = object({
|
|
|
79770
79816
|
text: string()
|
|
79771
79817
|
});
|
|
79772
79818
|
method(object({}), array(TrainingProviderDescriptorSchema).readonly(), { auth: "admin" }), method(object({}), array(TrainingProviderTypeSchema).readonly(), { auth: "admin" }), method(object({}), array(TrainingProviderEntrySchema).readonly(), { auth: "admin" }), method(object({
|
|
79773
|
-
typeId: string().min(1),
|
|
79774
|
-
name: string().min(1)
|
|
79775
|
-
}), object({ entryId: string() }), {
|
|
79776
|
-
kind: "mutation",
|
|
79777
|
-
auth: "admin"
|
|
79778
|
-
}), method(object({ entryId: string().min(1) }), object({ ok: literal(true) }), {
|
|
79779
|
-
kind: "mutation",
|
|
79780
|
-
auth: "admin"
|
|
79781
|
-
}), method(TrainingProviderUpdateEntryInputSchema, object({ ok: literal(true) }), {
|
|
79782
|
-
kind: "mutation",
|
|
79783
|
-
auth: "admin"
|
|
79784
|
-
}), method(object({ entryId: string().min(1) }), TrainingCredentialCheckSchema, {
|
|
79785
|
-
kind: "mutation",
|
|
79786
|
-
auth: "admin",
|
|
79787
|
-
timeoutMs: 3e4
|
|
79788
|
-
}), method(object({
|
|
79789
79819
|
entryId: string().min(1),
|
|
79790
79820
|
gpuType: string(),
|
|
79791
79821
|
region: string(),
|
|
@@ -84889,21 +84919,28 @@ Object.freeze({
|
|
|
84889
84919
|
access: "view",
|
|
84890
84920
|
role: "admin"
|
|
84891
84921
|
},
|
|
84892
|
-
"addonSettings.
|
|
84922
|
+
"addonSettings.getIntegrationFormSchema": {
|
|
84893
84923
|
capName: "addon-settings",
|
|
84894
84924
|
capScope: "system",
|
|
84895
84925
|
addonId: null,
|
|
84896
84926
|
access: "view",
|
|
84897
84927
|
role: "admin"
|
|
84898
84928
|
},
|
|
84899
|
-
"addonSettings.
|
|
84929
|
+
"addonSettings.getScopedSettings": {
|
|
84900
84930
|
capName: "addon-settings",
|
|
84901
84931
|
capScope: "system",
|
|
84902
84932
|
addonId: null,
|
|
84903
84933
|
access: "view",
|
|
84904
84934
|
role: "admin"
|
|
84905
84935
|
},
|
|
84906
|
-
"addonSettings.
|
|
84936
|
+
"addonSettings.listScopedSettings": {
|
|
84937
|
+
capName: "addon-settings",
|
|
84938
|
+
capScope: "system",
|
|
84939
|
+
addonId: null,
|
|
84940
|
+
access: "view",
|
|
84941
|
+
role: "admin"
|
|
84942
|
+
},
|
|
84943
|
+
"addonSettings.readScopedValues": {
|
|
84907
84944
|
capName: "addon-settings",
|
|
84908
84945
|
capScope: "system",
|
|
84909
84946
|
addonId: null,
|
|
@@ -84924,7 +84961,7 @@ Object.freeze({
|
|
|
84924
84961
|
access: "create",
|
|
84925
84962
|
role: "admin"
|
|
84926
84963
|
},
|
|
84927
|
-
"addonSettings.
|
|
84964
|
+
"addonSettings.updateScopedSettings": {
|
|
84928
84965
|
capName: "addon-settings",
|
|
84929
84966
|
capScope: "system",
|
|
84930
84967
|
addonId: null,
|
|
@@ -85764,20 +85801,6 @@ Object.freeze({
|
|
|
85764
85801
|
access: "view",
|
|
85765
85802
|
role: "admin"
|
|
85766
85803
|
},
|
|
85767
|
-
"connectionTest.describeTest": {
|
|
85768
|
-
capName: "connection-test",
|
|
85769
|
-
capScope: "system",
|
|
85770
|
-
addonId: null,
|
|
85771
|
-
access: "view",
|
|
85772
|
-
role: "admin"
|
|
85773
|
-
},
|
|
85774
|
-
"connectionTest.testSettings": {
|
|
85775
|
-
capName: "connection-test",
|
|
85776
|
-
capScope: "system",
|
|
85777
|
-
addonId: null,
|
|
85778
|
-
access: "create",
|
|
85779
|
-
role: "admin"
|
|
85780
|
-
},
|
|
85781
85804
|
"connectivity.getStatus": {
|
|
85782
85805
|
capName: "connectivity",
|
|
85783
85806
|
capScope: "device",
|
|
@@ -87108,6 +87131,13 @@ Object.freeze({
|
|
|
87108
87131
|
access: "create",
|
|
87109
87132
|
role: "admin"
|
|
87110
87133
|
},
|
|
87134
|
+
"deviceManager.setAlias": {
|
|
87135
|
+
capName: "device-manager",
|
|
87136
|
+
capScope: "system",
|
|
87137
|
+
addonId: null,
|
|
87138
|
+
access: "create",
|
|
87139
|
+
role: "admin"
|
|
87140
|
+
},
|
|
87111
87141
|
"deviceManager.setChildLayout": {
|
|
87112
87142
|
capName: "device-manager",
|
|
87113
87143
|
capScope: "system",
|
|
@@ -88144,13 +88174,6 @@ Object.freeze({
|
|
|
88144
88174
|
access: "view",
|
|
88145
88175
|
role: "admin"
|
|
88146
88176
|
},
|
|
88147
|
-
"integrations.testConnection": {
|
|
88148
|
-
capName: "integrations",
|
|
88149
|
-
capScope: "system",
|
|
88150
|
-
addonId: null,
|
|
88151
|
-
access: "create",
|
|
88152
|
-
role: "admin"
|
|
88153
|
-
},
|
|
88154
88177
|
"integrations.update": {
|
|
88155
88178
|
capName: "integrations",
|
|
88156
88179
|
capScope: "system",
|
|
@@ -88403,13 +88426,6 @@ Object.freeze({
|
|
|
88403
88426
|
access: "delete",
|
|
88404
88427
|
role: "admin"
|
|
88405
88428
|
},
|
|
88406
|
-
"llm.deleteProfile": {
|
|
88407
|
-
capName: "llm",
|
|
88408
|
-
capScope: "system",
|
|
88409
|
-
addonId: null,
|
|
88410
|
-
access: "delete",
|
|
88411
|
-
role: "admin"
|
|
88412
|
-
},
|
|
88413
88429
|
"llm.generate": {
|
|
88414
88430
|
capName: "llm",
|
|
88415
88431
|
capScope: "system",
|
|
@@ -88473,20 +88489,6 @@ Object.freeze({
|
|
|
88473
88489
|
access: "view",
|
|
88474
88490
|
role: "admin"
|
|
88475
88491
|
},
|
|
88476
|
-
"llm.listProfileKinds": {
|
|
88477
|
-
capName: "llm",
|
|
88478
|
-
capScope: "system",
|
|
88479
|
-
addonId: null,
|
|
88480
|
-
access: "view",
|
|
88481
|
-
role: "admin"
|
|
88482
|
-
},
|
|
88483
|
-
"llm.listProfiles": {
|
|
88484
|
-
capName: "llm",
|
|
88485
|
-
capScope: "system",
|
|
88486
|
-
addonId: null,
|
|
88487
|
-
access: "view",
|
|
88488
|
-
role: "admin"
|
|
88489
|
-
},
|
|
88490
88492
|
"llm.listRuntimeNodes": {
|
|
88491
88493
|
capName: "llm",
|
|
88492
88494
|
capScope: "system",
|
|
@@ -88494,13 +88496,6 @@ Object.freeze({
|
|
|
88494
88496
|
access: "view",
|
|
88495
88497
|
role: "admin"
|
|
88496
88498
|
},
|
|
88497
|
-
"llm.migrateRawSecrets": {
|
|
88498
|
-
capName: "llm",
|
|
88499
|
-
capScope: "system",
|
|
88500
|
-
addonId: null,
|
|
88501
|
-
access: "create",
|
|
88502
|
-
role: "admin"
|
|
88503
|
-
},
|
|
88504
88499
|
"llm.resolveModelRef": {
|
|
88505
88500
|
capName: "llm",
|
|
88506
88501
|
capScope: "system",
|
|
@@ -88529,20 +88524,6 @@ Object.freeze({
|
|
|
88529
88524
|
access: "create",
|
|
88530
88525
|
role: "admin"
|
|
88531
88526
|
},
|
|
88532
|
-
"llm.testProfile": {
|
|
88533
|
-
capName: "llm",
|
|
88534
|
-
capScope: "system",
|
|
88535
|
-
addonId: null,
|
|
88536
|
-
access: "create",
|
|
88537
|
-
role: "admin"
|
|
88538
|
-
},
|
|
88539
|
-
"llm.upsertProfile": {
|
|
88540
|
-
capName: "llm",
|
|
88541
|
-
capScope: "system",
|
|
88542
|
-
addonId: null,
|
|
88543
|
-
access: "create",
|
|
88544
|
-
role: "admin"
|
|
88545
|
-
},
|
|
88546
88527
|
"llmRuntime.appleAvailability": {
|
|
88547
88528
|
capName: "llm-runtime",
|
|
88548
88529
|
capScope: "system",
|
|
@@ -89047,13 +89028,6 @@ Object.freeze({
|
|
|
89047
89028
|
access: "create",
|
|
89048
89029
|
role: "admin"
|
|
89049
89030
|
},
|
|
89050
|
-
"meshNetwork.testConnection": {
|
|
89051
|
-
capName: "mesh-network",
|
|
89052
|
-
capScope: "system",
|
|
89053
|
-
addonId: null,
|
|
89054
|
-
access: "create",
|
|
89055
|
-
role: "admin"
|
|
89056
|
-
},
|
|
89057
89031
|
"meter.getStatus": {
|
|
89058
89032
|
capName: "meter",
|
|
89059
89033
|
capScope: "device",
|
|
@@ -89383,13 +89357,6 @@ Object.freeze({
|
|
|
89383
89357
|
access: "create",
|
|
89384
89358
|
role: "admin"
|
|
89385
89359
|
},
|
|
89386
|
-
"mqttBroker.testConnection": {
|
|
89387
|
-
capName: "mqtt-broker",
|
|
89388
|
-
capScope: "system",
|
|
89389
|
-
addonId: null,
|
|
89390
|
-
access: "create",
|
|
89391
|
-
role: "admin"
|
|
89392
|
-
},
|
|
89393
89360
|
"nativeObjectDetection.getOptions": {
|
|
89394
89361
|
capName: "native-object-detection",
|
|
89395
89362
|
capScope: "device",
|
|
@@ -89719,13 +89686,6 @@ Object.freeze({
|
|
|
89719
89686
|
access: "create",
|
|
89720
89687
|
role: "admin"
|
|
89721
89688
|
},
|
|
89722
|
-
"notificationOutput.deleteTarget": {
|
|
89723
|
-
capName: "notification-output",
|
|
89724
|
-
capScope: "system",
|
|
89725
|
-
addonId: null,
|
|
89726
|
-
access: "delete",
|
|
89727
|
-
role: "admin"
|
|
89728
|
-
},
|
|
89729
89689
|
"notificationOutput.discoverTargets": {
|
|
89730
89690
|
capName: "notification-output",
|
|
89731
89691
|
capScope: "system",
|
|
@@ -89733,13 +89693,6 @@ Object.freeze({
|
|
|
89733
89693
|
access: "view",
|
|
89734
89694
|
role: "admin"
|
|
89735
89695
|
},
|
|
89736
|
-
"notificationOutput.getTarget": {
|
|
89737
|
-
capName: "notification-output",
|
|
89738
|
-
capScope: "system",
|
|
89739
|
-
addonId: null,
|
|
89740
|
-
access: "view",
|
|
89741
|
-
role: "admin"
|
|
89742
|
-
},
|
|
89743
89696
|
"notificationOutput.listTargetKinds": {
|
|
89744
89697
|
capName: "notification-output",
|
|
89745
89698
|
capScope: "system",
|
|
@@ -89747,13 +89700,6 @@ Object.freeze({
|
|
|
89747
89700
|
access: "view",
|
|
89748
89701
|
role: "admin"
|
|
89749
89702
|
},
|
|
89750
|
-
"notificationOutput.listTargets": {
|
|
89751
|
-
capName: "notification-output",
|
|
89752
|
-
capScope: "system",
|
|
89753
|
-
addonId: null,
|
|
89754
|
-
access: "view",
|
|
89755
|
-
role: "admin"
|
|
89756
|
-
},
|
|
89757
89703
|
"notificationOutput.probeTargetConfig": {
|
|
89758
89704
|
capName: "notification-output",
|
|
89759
89705
|
capScope: "system",
|
|
@@ -89768,13 +89714,6 @@ Object.freeze({
|
|
|
89768
89714
|
access: "create",
|
|
89769
89715
|
role: "admin"
|
|
89770
89716
|
},
|
|
89771
|
-
"notificationOutput.setTargetEnabled": {
|
|
89772
|
-
capName: "notification-output",
|
|
89773
|
-
capScope: "system",
|
|
89774
|
-
addonId: null,
|
|
89775
|
-
access: "create",
|
|
89776
|
-
role: "admin"
|
|
89777
|
-
},
|
|
89778
89717
|
"notificationOutput.testTarget": {
|
|
89779
89718
|
capName: "notification-output",
|
|
89780
89719
|
capScope: "system",
|
|
@@ -89782,13 +89721,6 @@ Object.freeze({
|
|
|
89782
89721
|
access: "create",
|
|
89783
89722
|
role: "admin"
|
|
89784
89723
|
},
|
|
89785
|
-
"notificationOutput.upsertTarget": {
|
|
89786
|
-
capName: "notification-output",
|
|
89787
|
-
capScope: "system",
|
|
89788
|
-
addonId: null,
|
|
89789
|
-
access: "create",
|
|
89790
|
-
role: "admin"
|
|
89791
|
-
},
|
|
89792
89724
|
"notificationRules.activateAlarmProfile": {
|
|
89793
89725
|
capName: "notification-rules",
|
|
89794
89726
|
capScope: "system",
|
|
@@ -90048,41 +89980,6 @@ Object.freeze({
|
|
|
90048
89980
|
access: "view",
|
|
90049
89981
|
role: "admin"
|
|
90050
89982
|
},
|
|
90051
|
-
"oidcConnections.connectionFormSchema": {
|
|
90052
|
-
capName: "oidc-connections",
|
|
90053
|
-
capScope: "system",
|
|
90054
|
-
addonId: null,
|
|
90055
|
-
access: "view",
|
|
90056
|
-
role: "admin"
|
|
90057
|
-
},
|
|
90058
|
-
"oidcConnections.createConnection": {
|
|
90059
|
-
capName: "oidc-connections",
|
|
90060
|
-
capScope: "system",
|
|
90061
|
-
addonId: null,
|
|
90062
|
-
access: "create",
|
|
90063
|
-
role: "admin"
|
|
90064
|
-
},
|
|
90065
|
-
"oidcConnections.deleteConnection": {
|
|
90066
|
-
capName: "oidc-connections",
|
|
90067
|
-
capScope: "system",
|
|
90068
|
-
addonId: null,
|
|
90069
|
-
access: "delete",
|
|
90070
|
-
role: "admin"
|
|
90071
|
-
},
|
|
90072
|
-
"oidcConnections.listConnections": {
|
|
90073
|
-
capName: "oidc-connections",
|
|
90074
|
-
capScope: "system",
|
|
90075
|
-
addonId: null,
|
|
90076
|
-
access: "view",
|
|
90077
|
-
role: "admin"
|
|
90078
|
-
},
|
|
90079
|
-
"oidcConnections.updateConnection": {
|
|
90080
|
-
capName: "oidc-connections",
|
|
90081
|
-
capScope: "system",
|
|
90082
|
-
addonId: null,
|
|
90083
|
-
access: "create",
|
|
90084
|
-
role: "admin"
|
|
90085
|
-
},
|
|
90086
89983
|
"osd.getStatus": {
|
|
90087
89984
|
capName: "osd",
|
|
90088
89985
|
capScope: "device",
|
|
@@ -93114,13 +93011,6 @@ Object.freeze({
|
|
|
93114
93011
|
access: "delete",
|
|
93115
93012
|
role: "admin"
|
|
93116
93013
|
},
|
|
93117
|
-
"storage.deleteLocation": {
|
|
93118
|
-
capName: "storage",
|
|
93119
|
-
capScope: "system",
|
|
93120
|
-
addonId: null,
|
|
93121
|
-
access: "delete",
|
|
93122
|
-
role: "admin"
|
|
93123
|
-
},
|
|
93124
93014
|
"storage.endDownload": {
|
|
93125
93015
|
capName: "storage",
|
|
93126
93016
|
capScope: "system",
|
|
@@ -93177,13 +93067,6 @@ Object.freeze({
|
|
|
93177
93067
|
access: "view",
|
|
93178
93068
|
role: "admin"
|
|
93179
93069
|
},
|
|
93180
|
-
"storage.listProviders": {
|
|
93181
|
-
capName: "storage",
|
|
93182
|
-
capScope: "system",
|
|
93183
|
-
addonId: null,
|
|
93184
|
-
access: "view",
|
|
93185
|
-
role: "admin"
|
|
93186
|
-
},
|
|
93187
93070
|
"storage.read": {
|
|
93188
93071
|
capName: "storage",
|
|
93189
93072
|
capScope: "system",
|
|
@@ -93205,27 +93088,6 @@ Object.freeze({
|
|
|
93205
93088
|
access: "view",
|
|
93206
93089
|
role: "admin"
|
|
93207
93090
|
},
|
|
93208
|
-
"storage.testConfig": {
|
|
93209
|
-
capName: "storage",
|
|
93210
|
-
capScope: "system",
|
|
93211
|
-
addonId: null,
|
|
93212
|
-
access: "view",
|
|
93213
|
-
role: "admin"
|
|
93214
|
-
},
|
|
93215
|
-
"storage.testLocation": {
|
|
93216
|
-
capName: "storage",
|
|
93217
|
-
capScope: "system",
|
|
93218
|
-
addonId: null,
|
|
93219
|
-
access: "view",
|
|
93220
|
-
role: "admin"
|
|
93221
|
-
},
|
|
93222
|
-
"storage.upsertLocation": {
|
|
93223
|
-
capName: "storage",
|
|
93224
|
-
capScope: "system",
|
|
93225
|
-
addonId: null,
|
|
93226
|
-
access: "create",
|
|
93227
|
-
role: "admin"
|
|
93228
|
-
},
|
|
93229
93091
|
"storage.write": {
|
|
93230
93092
|
capName: "storage",
|
|
93231
93093
|
capScope: "system",
|
|
@@ -94003,27 +93865,6 @@ Object.freeze({
|
|
|
94003
93865
|
access: "create",
|
|
94004
93866
|
role: "admin"
|
|
94005
93867
|
},
|
|
94006
|
-
"terminalSession.createInstance": {
|
|
94007
|
-
capName: "terminal-session",
|
|
94008
|
-
capScope: "system",
|
|
94009
|
-
addonId: null,
|
|
94010
|
-
access: "create",
|
|
94011
|
-
role: "admin"
|
|
94012
|
-
},
|
|
94013
|
-
"terminalSession.deleteInstance": {
|
|
94014
|
-
capName: "terminal-session",
|
|
94015
|
-
capScope: "system",
|
|
94016
|
-
addonId: null,
|
|
94017
|
-
access: "delete",
|
|
94018
|
-
role: "admin"
|
|
94019
|
-
},
|
|
94020
|
-
"terminalSession.listInstances": {
|
|
94021
|
-
capName: "terminal-session",
|
|
94022
|
-
capScope: "system",
|
|
94023
|
-
addonId: null,
|
|
94024
|
-
access: "view",
|
|
94025
|
-
role: "admin"
|
|
94026
|
-
},
|
|
94027
93868
|
"terminalSession.listLegacyCameras": {
|
|
94028
93869
|
capName: "terminal-session",
|
|
94029
93870
|
capScope: "system",
|
|
@@ -94066,20 +93907,6 @@ Object.freeze({
|
|
|
94066
93907
|
access: "create",
|
|
94067
93908
|
role: "admin"
|
|
94068
93909
|
},
|
|
94069
|
-
"terminalSession.setInstanceEnabled": {
|
|
94070
|
-
capName: "terminal-session",
|
|
94071
|
-
capScope: "system",
|
|
94072
|
-
addonId: null,
|
|
94073
|
-
access: "create",
|
|
94074
|
-
role: "admin"
|
|
94075
|
-
},
|
|
94076
|
-
"terminalSession.updateInstance": {
|
|
94077
|
-
capName: "terminal-session",
|
|
94078
|
-
capScope: "system",
|
|
94079
|
-
addonId: null,
|
|
94080
|
-
access: "create",
|
|
94081
|
-
role: "admin"
|
|
94082
|
-
},
|
|
94083
93910
|
"terminalSession.writeInput": {
|
|
94084
93911
|
capName: "terminal-session",
|
|
94085
93912
|
capScope: "system",
|
|
@@ -94094,6 +93921,13 @@ Object.freeze({
|
|
|
94094
93921
|
access: "create",
|
|
94095
93922
|
role: "viewer"
|
|
94096
93923
|
},
|
|
93924
|
+
"timedRun.getOptions": {
|
|
93925
|
+
capName: "timed-run",
|
|
93926
|
+
capScope: "device",
|
|
93927
|
+
addonId: null,
|
|
93928
|
+
access: "view",
|
|
93929
|
+
role: "viewer"
|
|
93930
|
+
},
|
|
94097
93931
|
"timedRun.getStatus": {
|
|
94098
93932
|
capName: "timed-run",
|
|
94099
93933
|
capScope: "device",
|
|
@@ -94108,6 +93942,13 @@ Object.freeze({
|
|
|
94108
93942
|
access: "create",
|
|
94109
93943
|
role: "viewer"
|
|
94110
93944
|
},
|
|
93945
|
+
"timedRun.setSettings": {
|
|
93946
|
+
capName: "timed-run",
|
|
93947
|
+
capScope: "device",
|
|
93948
|
+
addonId: null,
|
|
93949
|
+
access: "create",
|
|
93950
|
+
role: "admin"
|
|
93951
|
+
},
|
|
94111
93952
|
"toast.onToast": {
|
|
94112
93953
|
capName: "toast",
|
|
94113
93954
|
capScope: "system",
|
|
@@ -94220,20 +94061,6 @@ Object.freeze({
|
|
|
94220
94061
|
access: "create",
|
|
94221
94062
|
role: "admin"
|
|
94222
94063
|
},
|
|
94223
|
-
"trainingProvider.createEntry": {
|
|
94224
|
-
capName: "training-provider",
|
|
94225
|
-
capScope: "system",
|
|
94226
|
-
addonId: null,
|
|
94227
|
-
access: "create",
|
|
94228
|
-
role: "admin"
|
|
94229
|
-
},
|
|
94230
|
-
"trainingProvider.deleteEntry": {
|
|
94231
|
-
capName: "training-provider",
|
|
94232
|
-
capScope: "system",
|
|
94233
|
-
addonId: null,
|
|
94234
|
-
access: "delete",
|
|
94235
|
-
role: "admin"
|
|
94236
|
-
},
|
|
94237
94064
|
"trainingProvider.describe": {
|
|
94238
94065
|
capName: "training-provider",
|
|
94239
94066
|
capScope: "system",
|
|
@@ -94304,13 +94131,6 @@ Object.freeze({
|
|
|
94304
94131
|
access: "create",
|
|
94305
94132
|
role: "admin"
|
|
94306
94133
|
},
|
|
94307
|
-
"trainingProvider.updateEntry": {
|
|
94308
|
-
capName: "training-provider",
|
|
94309
|
-
capScope: "system",
|
|
94310
|
-
addonId: null,
|
|
94311
|
-
access: "create",
|
|
94312
|
-
role: "admin"
|
|
94313
|
-
},
|
|
94314
94134
|
"trainingProvider.uploadDataset": {
|
|
94315
94135
|
capName: "training-provider",
|
|
94316
94136
|
capScope: "system",
|
|
@@ -94318,13 +94138,6 @@ Object.freeze({
|
|
|
94318
94138
|
access: "create",
|
|
94319
94139
|
role: "admin"
|
|
94320
94140
|
},
|
|
94321
|
-
"trainingProvider.validateCredentials": {
|
|
94322
|
-
capName: "training-provider",
|
|
94323
|
-
capScope: "system",
|
|
94324
|
-
addonId: null,
|
|
94325
|
-
access: "create",
|
|
94326
|
-
role: "admin"
|
|
94327
|
-
},
|
|
94328
94141
|
"turnProvider.getTurnServers": {
|
|
94329
94142
|
capName: "turn-provider",
|
|
94330
94143
|
capScope: "system",
|
|
@@ -95284,6 +95097,7 @@ function createRuntimeStateBridge(params) {
|
|
|
95284
95097
|
getStatus
|
|
95285
95098
|
};
|
|
95286
95099
|
}
|
|
95100
|
+
string().min(1).max(4096);
|
|
95287
95101
|
Object.freeze({
|
|
95288
95102
|
"accessories.getStatus": [{
|
|
95289
95103
|
name: "deviceId",
|
|
@@ -95967,6 +95781,11 @@ Object.freeze({
|
|
|
95967
95781
|
form: "single",
|
|
95968
95782
|
optional: false
|
|
95969
95783
|
}],
|
|
95784
|
+
"deviceManager.setAlias": [{
|
|
95785
|
+
name: "deviceId",
|
|
95786
|
+
form: "single",
|
|
95787
|
+
optional: false
|
|
95788
|
+
}],
|
|
95970
95789
|
"deviceManager.setChildLayout": [{
|
|
95971
95790
|
name: "deviceId",
|
|
95972
95791
|
form: "single",
|
|
@@ -98031,6 +97850,11 @@ Object.freeze({
|
|
|
98031
97850
|
form: "single",
|
|
98032
97851
|
optional: false
|
|
98033
97852
|
}],
|
|
97853
|
+
"timedRun.getOptions": [{
|
|
97854
|
+
name: "deviceId",
|
|
97855
|
+
form: "single",
|
|
97856
|
+
optional: false
|
|
97857
|
+
}],
|
|
98034
97858
|
"timedRun.getStatus": [{
|
|
98035
97859
|
name: "deviceId",
|
|
98036
97860
|
form: "single",
|
|
@@ -98041,6 +97865,11 @@ Object.freeze({
|
|
|
98041
97865
|
form: "single",
|
|
98042
97866
|
optional: false
|
|
98043
97867
|
}],
|
|
97868
|
+
"timedRun.setSettings": [{
|
|
97869
|
+
name: "deviceId",
|
|
97870
|
+
form: "single",
|
|
97871
|
+
optional: false
|
|
97872
|
+
}],
|
|
98044
97873
|
"update.getStatus": [{
|
|
98045
97874
|
name: "deviceId",
|
|
98046
97875
|
form: "single",
|
|
@@ -98903,6 +98732,7 @@ var STATE_SUMMARY_VARS = [
|
|
|
98903
98732
|
[...RULE_TEXT],
|
|
98904
98733
|
[...RULE_TEXT],
|
|
98905
98734
|
[...RULE_TEXT],
|
|
98735
|
+
[...RULE_TEXT],
|
|
98906
98736
|
[...RULE_BODY_ONLY],
|
|
98907
98737
|
[...RULE_TEXT],
|
|
98908
98738
|
([...RULE_TEXT], [...DEVICE_EVENTS]),
|
|
@@ -113198,7 +113028,13 @@ function buildHikvisionInstances(records) {
|
|
|
113198
113028
|
},
|
|
113199
113029
|
instanceMode: "single",
|
|
113200
113030
|
kind: "connection",
|
|
113201
|
-
canTest: false
|
|
113031
|
+
canTest: false,
|
|
113032
|
+
kinds: [{
|
|
113033
|
+
id: "connection",
|
|
113034
|
+
label: "Hikvision",
|
|
113035
|
+
functionCap: "device-provider",
|
|
113036
|
+
role: "devices"
|
|
113037
|
+
}]
|
|
113202
113038
|
},
|
|
113203
113039
|
formSchema: () => ({ sections: [] }),
|
|
113204
113040
|
initialBody: (name) => ({ name }),
|