@camstack/addon-export-hap 1.2.193 → 1.2.194
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/hap-export.addon.js +178 -75
- package/dist/hap-export.addon.mjs +178 -75
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.2.194] - 2026-11-05
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- HomeKit export keeps interfaceName on its node hook only; the settings form and stored values are unchanged.
|
|
15
|
+
|
|
10
16
|
## [1.2.193] - 2026-11-05
|
|
11
17
|
|
|
12
18
|
### Changed
|
package/dist/hap-export.addon.js
CHANGED
|
@@ -6031,7 +6031,7 @@ var ZodIssueCode = {
|
|
|
6031
6031
|
var ZodFirstPartyTypeKind;
|
|
6032
6032
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
6033
6033
|
//#endregion
|
|
6034
|
-
//#region ../types/dist/sleep-
|
|
6034
|
+
//#region ../types/dist/sleep-DEZaLbiu.mjs
|
|
6035
6035
|
/**
|
|
6036
6036
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
6037
6037
|
* window to float samples (D455).
|
|
@@ -6840,6 +6840,12 @@ function projectStore(store, perNodeKeys, nodeId) {
|
|
|
6840
6840
|
}
|
|
6841
6841
|
return out;
|
|
6842
6842
|
}
|
|
6843
|
+
/** Every scope, in the order the guard and the docs list them. */
|
|
6844
|
+
var SCOPED_SETTINGS_SCOPES = [
|
|
6845
|
+
"cluster",
|
|
6846
|
+
"device-defaults",
|
|
6847
|
+
"node"
|
|
6848
|
+
];
|
|
6843
6849
|
/**
|
|
6844
6850
|
* The address of one keychain value: `secret://<owner>/<scope>/<fieldPath>`.
|
|
6845
6851
|
*
|
|
@@ -7731,6 +7737,13 @@ var BaseAddon = class {
|
|
|
7731
7737
|
*/
|
|
7732
7738
|
secretStatePaths = [];
|
|
7733
7739
|
_addonSecretTree = null;
|
|
7740
|
+
/**
|
|
7741
|
+
* D986 M4: the scoped schemas this addon declared, resolved once per capability
|
|
7742
|
+
* (`loadScopedSchemas`) so the sync readers (`perNodeKeys`, the secret tree, the restart check)
|
|
7743
|
+
* see them. Empty until loaded: the readers then fall back to {@link globalSettingsSchema}.
|
|
7744
|
+
*/
|
|
7745
|
+
_scopedByCap = /* @__PURE__ */ new Map();
|
|
7746
|
+
_nodeKeysByCap = /* @__PURE__ */ new Map();
|
|
7734
7747
|
_deviceSecretTree = null;
|
|
7735
7748
|
/** Refs the last resolved config pointed at — a change to one re-resolves. */
|
|
7736
7749
|
_configSecretRefs = /* @__PURE__ */ new Set();
|
|
@@ -7800,6 +7813,7 @@ var BaseAddon = class {
|
|
|
7800
7813
|
this._ctx = context;
|
|
7801
7814
|
this._secretSettings = null;
|
|
7802
7815
|
}
|
|
7816
|
+
await this.loadScopedSchemas();
|
|
7803
7817
|
await this.resolveConfig();
|
|
7804
7818
|
if (secrets !== void 0) this._secretChangeUnsub = secrets.onChange((ref) => {
|
|
7805
7819
|
if (this._configSecretRefs.has(ref)) this.scheduleSecretReresolve(SECRET_CHANGE_DEBOUNCE_MS);
|
|
@@ -7809,6 +7823,7 @@ var BaseAddon = class {
|
|
|
7809
7823
|
const normalized = normalizeAddonInitResult(result);
|
|
7810
7824
|
const providers = normalized && "providers" in normalized && normalized.providers ? normalized.providers : [];
|
|
7811
7825
|
this._registeredCapNames = providers.map((p) => p.capability.name);
|
|
7826
|
+
await this.loadScopedSchemas();
|
|
7812
7827
|
return normalized;
|
|
7813
7828
|
}
|
|
7814
7829
|
/**
|
|
@@ -7897,6 +7912,16 @@ var BaseAddon = class {
|
|
|
7897
7912
|
schema(schema) {
|
|
7898
7913
|
return schema;
|
|
7899
7914
|
}
|
|
7915
|
+
/**
|
|
7916
|
+
* The capability names whose scoped settings schemas ({@link clusterSettingsSchema},
|
|
7917
|
+
* {@link nodeSettingsSchema}, {@link deviceDefaultsSchema}) this addon declares. Read BEFORE
|
|
7918
|
+
* `onInitialize`, when the providers it registers are not known yet: the first config resolve
|
|
7919
|
+
* must already know which keys are per node. Names the providers register at init are added
|
|
7920
|
+
* once known.
|
|
7921
|
+
*/
|
|
7922
|
+
scopedSettingsCapabilities() {
|
|
7923
|
+
return [];
|
|
7924
|
+
}
|
|
7900
7925
|
/** Override to provide global-level settings UI schema. */
|
|
7901
7926
|
globalSettingsSchema(_cap) {
|
|
7902
7927
|
return null;
|
|
@@ -7940,7 +7965,8 @@ var BaseAddon = class {
|
|
|
7940
7965
|
return [];
|
|
7941
7966
|
}
|
|
7942
7967
|
async getGlobalSettings(overlay, cap, nodeId) {
|
|
7943
|
-
|
|
7968
|
+
await this.loadScopedSchemas(cap);
|
|
7969
|
+
const schema = this.globalSettingsSchema(cap) ?? this.scopedFormSchema(cap);
|
|
7944
7970
|
if (!schema) return { sections: [] };
|
|
7945
7971
|
const projected = await this.readRawProjectedStore(nodeId, cap);
|
|
7946
7972
|
return hydrateSchema(schema, overlay ? await this.overlayKeepingMarkers(projected, overlay) : projected, { inlineSecretsAsViews: true });
|
|
@@ -7975,10 +8001,9 @@ var BaseAddon = class {
|
|
|
7975
8001
|
*
|
|
7976
8002
|
* Override it only when an `instanceMode: multiple` addon's instances differ: an NVR integration
|
|
7977
8003
|
* needs its connection fields, the default integration the addon's own sections. It is the
|
|
7978
|
-
* SHAPE of the form only — the values live
|
|
7979
|
-
* unchanged (`integrations.setSettings` for an account integration).
|
|
8004
|
+
* SHAPE of the form only — the values live on the instance record.
|
|
7980
8005
|
*/
|
|
7981
|
-
async
|
|
8006
|
+
async integrationFormSchema(_instance) {
|
|
7982
8007
|
return null;
|
|
7983
8008
|
}
|
|
7984
8009
|
/**
|
|
@@ -8024,7 +8049,7 @@ var BaseAddon = class {
|
|
|
8024
8049
|
* per-instance schema when it declares one, else its global schema (what they always showed).
|
|
8025
8050
|
*/
|
|
8026
8051
|
async getIntegrationFormSchema(instance, nodeId) {
|
|
8027
|
-
const scoped = await this.
|
|
8052
|
+
const scoped = await this.integrationFormSchema(instance);
|
|
8028
8053
|
if (scoped === null) return this.getGlobalSettings(void 0, void 0, nodeId);
|
|
8029
8054
|
return hydrateSchema(scoped, {}, { inlineSecretsAsViews: true });
|
|
8030
8055
|
}
|
|
@@ -8072,6 +8097,7 @@ var BaseAddon = class {
|
|
|
8072
8097
|
* resolved blob back is a no-op for every unchanged secret.
|
|
8073
8098
|
*/
|
|
8074
8099
|
async resolveGlobalStore(nodeId, cap) {
|
|
8100
|
+
await this.loadScopedSchemas(cap);
|
|
8075
8101
|
const raw = await this._ctx?.settings?.readAddonStore() ?? {};
|
|
8076
8102
|
return this.projectForNode(raw, nodeId, cap);
|
|
8077
8103
|
}
|
|
@@ -8082,6 +8108,7 @@ var BaseAddon = class {
|
|
|
8082
8108
|
}
|
|
8083
8109
|
/** The PROJECTED store with its markers — the form hydrate only (D798). */
|
|
8084
8110
|
async readRawProjectedStore(nodeId, cap) {
|
|
8111
|
+
await this.loadScopedSchemas(cap);
|
|
8085
8112
|
const raw = await this.rawSettings()?.readAddonStore() ?? {};
|
|
8086
8113
|
return this.projectForNode(raw, nodeId, cap);
|
|
8087
8114
|
}
|
|
@@ -8184,6 +8211,7 @@ var BaseAddon = class {
|
|
|
8184
8211
|
await this.applyGlobalPatch(patch, nodeId);
|
|
8185
8212
|
}
|
|
8186
8213
|
async applyGlobalPatch(barePatch, nodeId) {
|
|
8214
|
+
await this.loadScopedSchemas();
|
|
8187
8215
|
const keys = this.perNodeKeys();
|
|
8188
8216
|
const localNode = normalizeNodeId(this._ctx?.kernel?.localNodeId);
|
|
8189
8217
|
const target = normalizeNodeId(nodeId ?? this._ctx?.kernel?.localNodeId);
|
|
@@ -8197,7 +8225,8 @@ var BaseAddon = class {
|
|
|
8197
8225
|
await this.resolveConfig();
|
|
8198
8226
|
await this.onConfigChanged();
|
|
8199
8227
|
this.emitLifecycle(EventCategory.AddonUpdated, { level: "global" });
|
|
8200
|
-
|
|
8228
|
+
const legacy = this.globalSettingsSchema();
|
|
8229
|
+
this.maybeAutoRestart(Object.keys(barePatch), [...legacy === null ? [] : [legacy], ...this.loadedScopedSchemas().map((entry) => entry.schema)]);
|
|
8201
8230
|
}
|
|
8202
8231
|
/**
|
|
8203
8232
|
* The set of field keys the global settings schema declares `perNode: true`
|
|
@@ -8205,14 +8234,67 @@ var BaseAddon = class {
|
|
|
8205
8234
|
* declarations). Empty set ⇒ every per-node code path is bypassed and the
|
|
8206
8235
|
* settings API behaves exactly like the legacy node-agnostic one.
|
|
8207
8236
|
*/
|
|
8208
|
-
|
|
8237
|
+
/**
|
|
8238
|
+
* Load the scoped schemas of every capability this addon declares (the override and the
|
|
8239
|
+
* providers registered at init, plus `extraCap`) that is not loaded yet, then drop what was
|
|
8240
|
+
* derived from the previous set. Idempotent.
|
|
8241
|
+
*/
|
|
8242
|
+
async loadScopedSchemas(extraCap) {
|
|
8243
|
+
const caps = new Set([
|
|
8244
|
+
...this.scopedSettingsCapabilities(),
|
|
8245
|
+
...this._registeredCapNames,
|
|
8246
|
+
...extraCap === void 0 ? [] : [extraCap]
|
|
8247
|
+
]);
|
|
8248
|
+
let added = false;
|
|
8249
|
+
for (const cap of caps) {
|
|
8250
|
+
if (this._scopedByCap.has(cap)) continue;
|
|
8251
|
+
const loaded = [];
|
|
8252
|
+
for (const scope of SCOPED_SETTINGS_SCOPES) {
|
|
8253
|
+
const schema = await this.getScopedSettingsSchema(scope, cap);
|
|
8254
|
+
if (schema !== null) loaded.push({
|
|
8255
|
+
scope,
|
|
8256
|
+
schema
|
|
8257
|
+
});
|
|
8258
|
+
}
|
|
8259
|
+
this._scopedByCap.set(cap, loaded);
|
|
8260
|
+
added = true;
|
|
8261
|
+
}
|
|
8262
|
+
if (!added) return;
|
|
8263
|
+
this._nodeKeysByCap = /* @__PURE__ */ new Map();
|
|
8264
|
+
this._addonSecretTree = null;
|
|
8265
|
+
}
|
|
8266
|
+
/**
|
|
8267
|
+
* The form the settings API serves while an addon declares no {@link globalSettingsSchema}: the
|
|
8268
|
+
* sections of its scoped schemas, so dropping the old hook does not blank the form.
|
|
8269
|
+
*/
|
|
8270
|
+
scopedFormSchema(cap) {
|
|
8271
|
+
const byId = /* @__PURE__ */ new Map();
|
|
8272
|
+
for (const entry of this.loadedScopedSchemas(cap)) for (const section of entry.schema.sections) if (!byId.has(section.id)) byId.set(section.id, section);
|
|
8273
|
+
return byId.size === 0 ? null : { sections: [...byId.values()] };
|
|
8274
|
+
}
|
|
8275
|
+
/** Every loaded scoped schema of `cap`, or of every loaded capability. */
|
|
8276
|
+
loadedScopedSchemas(cap) {
|
|
8277
|
+
if (cap !== void 0) return this._scopedByCap.get(cap) ?? [];
|
|
8278
|
+
return [...this._scopedByCap.values()].flat();
|
|
8279
|
+
}
|
|
8280
|
+
/**
|
|
8281
|
+
* The field keys that are stored per node: every field of a {@link nodeSettingsSchema}, plus
|
|
8282
|
+
* the fields the legacy {@link globalSettingsSchema} still marks `perNode: true`. Derived once
|
|
8283
|
+
* per `cap` argument and memoized (schemas are static declarations). Empty set ⇒ every
|
|
8284
|
+
* per-node code path is bypassed and the settings API behaves like the node-agnostic one.
|
|
8285
|
+
* Call {@link loadScopedSchemas} first (the async seams do).
|
|
8286
|
+
*/
|
|
8209
8287
|
perNodeKeys(cap) {
|
|
8210
8288
|
const cacheKey = cap ?? "";
|
|
8211
|
-
const cached = this.
|
|
8289
|
+
const cached = this._nodeKeysByCap.get(cacheKey);
|
|
8212
8290
|
if (cached) return cached;
|
|
8213
|
-
const
|
|
8214
|
-
const keys = new Set(
|
|
8215
|
-
this.
|
|
8291
|
+
const legacy = this.globalSettingsSchema(cap);
|
|
8292
|
+
const keys = new Set(legacy ? legacy.sections.flatMap((section) => collectPerNodeFieldKeys(section.fields)) : []);
|
|
8293
|
+
for (const { scope, schema } of this.loadedScopedSchemas(cap)) {
|
|
8294
|
+
if (scope !== "node") continue;
|
|
8295
|
+
for (const section of schema.sections) for (const key of collectValueFieldKeys(section.fields)) keys.add(key);
|
|
8296
|
+
}
|
|
8297
|
+
this._nodeKeysByCap.set(cacheKey, keys);
|
|
8216
8298
|
return keys;
|
|
8217
8299
|
}
|
|
8218
8300
|
/**
|
|
@@ -8222,10 +8304,9 @@ var BaseAddon = class {
|
|
|
8222
8304
|
* time to return its response before the addon is torn down and
|
|
8223
8305
|
* re-initialised by `AddonRegistryService.restartAddon`.
|
|
8224
8306
|
*/
|
|
8225
|
-
maybeAutoRestart(patchKeys,
|
|
8226
|
-
if (!schema) return;
|
|
8307
|
+
maybeAutoRestart(patchKeys, schemas) {
|
|
8227
8308
|
const restartKeys = /* @__PURE__ */ new Set();
|
|
8228
|
-
for (const section of schema.sections) for (const field of section.fields) {
|
|
8309
|
+
for (const schema of schemas) for (const section of schema.sections) for (const field of section.fields) {
|
|
8229
8310
|
if (field.type === "separator" || field.type === "info") continue;
|
|
8230
8311
|
if (field.requiresRestart) restartKeys.add(field.key);
|
|
8231
8312
|
}
|
|
@@ -8421,12 +8502,14 @@ var BaseAddon = class {
|
|
|
8421
8502
|
* here, in the addon's own process, so the hub keeps no copy of it.
|
|
8422
8503
|
*/
|
|
8423
8504
|
async getDeclaredSettingsKeys() {
|
|
8505
|
+
await this.loadScopedSchemas();
|
|
8424
8506
|
return { keys: [...this.declaredKeySet()].toSorted() };
|
|
8425
8507
|
}
|
|
8426
8508
|
declaredKeySet() {
|
|
8427
8509
|
const keys = new Set(Object.keys(this.defaults));
|
|
8428
8510
|
const schema = this.globalSettingsSchema();
|
|
8429
8511
|
if (schema) for (const section of schema.sections) for (const key of collectFieldKeys(section.fields)) keys.add(key);
|
|
8512
|
+
for (const { schema: scoped } of this.loadedScopedSchemas()) for (const section of scoped.sections) for (const key of collectFieldKeys(section.fields)) keys.add(key);
|
|
8430
8513
|
for (const key of this._declaredStateKeys) keys.add(key);
|
|
8431
8514
|
for (const path of this.secretStatePaths) {
|
|
8432
8515
|
const root = path.split(/[.[]/, 1)[0];
|
|
@@ -8522,7 +8605,11 @@ var BaseAddon = class {
|
|
|
8522
8605
|
}
|
|
8523
8606
|
/** The addon store's secret tree: schema fields by TYPE, plus `secretStatePaths`. */
|
|
8524
8607
|
addonSecretTree() {
|
|
8525
|
-
this._addonSecretTree
|
|
8608
|
+
if (this._addonSecretTree === null) {
|
|
8609
|
+
const tree = new Map(secretTreeFromSchema(this.globalSettingsSchema()));
|
|
8610
|
+
for (const { schema } of this.loadedScopedSchemas()) for (const [key, node] of secretTreeFromSchema(schema)) tree.set(key, node);
|
|
8611
|
+
this._addonSecretTree = mergeSecretStatePaths(tree, this.secretStatePaths);
|
|
8612
|
+
}
|
|
8526
8613
|
return this._addonSecretTree;
|
|
8527
8614
|
}
|
|
8528
8615
|
deviceSecretTree() {
|
|
@@ -8772,6 +8859,23 @@ function dropPerNodeFields(fields) {
|
|
|
8772
8859
|
}
|
|
8773
8860
|
return kept;
|
|
8774
8861
|
}
|
|
8862
|
+
/** The keys of the value-holding fields, recursing into layout containers. */
|
|
8863
|
+
function collectValueFieldKeys(fields) {
|
|
8864
|
+
const collected = [];
|
|
8865
|
+
for (const field of fields) {
|
|
8866
|
+
if (field.type === "group") {
|
|
8867
|
+
collected.push(...collectValueFieldKeys(field.fields));
|
|
8868
|
+
continue;
|
|
8869
|
+
}
|
|
8870
|
+
if (field.type === "sub-tabs") {
|
|
8871
|
+
for (const tab of field.tabs) collected.push(...collectValueFieldKeys(tab.fields));
|
|
8872
|
+
continue;
|
|
8873
|
+
}
|
|
8874
|
+
if (field.type === "separator" || field.type === "info") continue;
|
|
8875
|
+
if ("key" in field && typeof field.key === "string") collected.push(field.key);
|
|
8876
|
+
}
|
|
8877
|
+
return collected;
|
|
8878
|
+
}
|
|
8775
8879
|
function collectFieldKeys(fields) {
|
|
8776
8880
|
const collected = [];
|
|
8777
8881
|
for (const field of fields) {
|
|
@@ -51382,12 +51486,12 @@ var deviceExportCapability = {
|
|
|
51382
51486
|
kind: "poll"
|
|
51383
51487
|
},
|
|
51384
51488
|
/**
|
|
51385
|
-
* Each export provider
|
|
51386
|
-
* (enabled toggle, preferred stream, addon-specific knobs
|
|
51387
|
-
*
|
|
51388
|
-
* `
|
|
51389
|
-
* `
|
|
51390
|
-
*
|
|
51489
|
+
* Each export provider MAY contribute its own per-device "Export" panel
|
|
51490
|
+
* (enabled toggle, preferred stream, addon-specific knobs). The three
|
|
51491
|
+
* framework methods are mounted on the cap router when present.
|
|
51492
|
+
* `IDeviceExportProvider` leaves them optional: an exporter with no
|
|
51493
|
+
* per-device panel omits them (a `deviceConfig` cap's UI is derived and
|
|
51494
|
+
* never hand-written — D14 — and an exporter is not one of those).
|
|
51391
51495
|
*/
|
|
51392
51496
|
exposesDeviceSettings: true,
|
|
51393
51497
|
methods: {
|
|
@@ -55094,11 +55198,7 @@ var CreateIntegrationInputSchema = object({
|
|
|
55094
55198
|
info: record(string(), unknown()).optional(),
|
|
55095
55199
|
/** `stableId` of the discovery candidate the form was seeded from (D984). */
|
|
55096
55200
|
originStableId: string().optional(),
|
|
55097
|
-
settings: record(string(), unknown()).optional()
|
|
55098
|
-
/** Keys of `settings` the form's schema declares secret (by type) — kept in
|
|
55099
|
-
* the keychain, not the table (D787). */
|
|
55100
|
-
secretKeys: array(string()).optional(),
|
|
55101
|
-
skipRestart: boolean().optional()
|
|
55201
|
+
settings: record(string(), unknown()).optional()
|
|
55102
55202
|
});
|
|
55103
55203
|
var UpdateIntegrationInputSchema = object({
|
|
55104
55204
|
id: string(),
|
|
@@ -55119,22 +55219,6 @@ method(_void(), array(IntegrationWithStateSchema)), method(object({ id: string()
|
|
|
55119
55219
|
}), method(object({ id: string() }), DeleteIntegrationResultSchema, {
|
|
55120
55220
|
kind: "mutation",
|
|
55121
55221
|
auth: "admin"
|
|
55122
|
-
}), method(object({ id: string() }), record(string(), unknown()), { auth: "admin" }), method(object({
|
|
55123
|
-
id: string(),
|
|
55124
|
-
settings: record(string(), unknown()),
|
|
55125
|
-
/** Keys the form's schema declares secret (by type) — keychain-stored (D787). */
|
|
55126
|
-
secretKeys: array(string()).optional(),
|
|
55127
|
-
/** The integration's own addon applies the change in-process and asks the hub not to respawn it. */
|
|
55128
|
-
skipRestart: boolean().optional()
|
|
55129
|
-
}), object({ success: boolean() }), {
|
|
55130
|
-
kind: "mutation",
|
|
55131
|
-
auth: "admin"
|
|
55132
|
-
}), method(object({ id: string() }), object({
|
|
55133
|
-
rows: number().int().nonnegative(),
|
|
55134
|
-
secrets: number().int().nonnegative()
|
|
55135
|
-
}), {
|
|
55136
|
-
kind: "mutation",
|
|
55137
|
-
auth: "admin"
|
|
55138
55222
|
}), method(_void(), array(AvailableIntegrationTypeSchema), { auth: "admin" }), method(object({
|
|
55139
55223
|
addonId: string(),
|
|
55140
55224
|
settings: record(string(), unknown())
|
|
@@ -57859,6 +57943,27 @@ method(object({}), object({ entries: array(MigrationLedgerEntrySchema) }), { aut
|
|
|
57859
57943
|
}), {
|
|
57860
57944
|
kind: "mutation",
|
|
57861
57945
|
auth: "admin"
|
|
57946
|
+
}), method(object({ integrationId: string().min(1) }), record(string(), unknown()), { auth: "admin" }), method(object({ integrationId: string().min(1) }), object({
|
|
57947
|
+
rows: number().int().nonnegative(),
|
|
57948
|
+
secrets: number().int().nonnegative()
|
|
57949
|
+
}), {
|
|
57950
|
+
kind: "mutation",
|
|
57951
|
+
auth: "admin"
|
|
57952
|
+
}), method(object({
|
|
57953
|
+
integrationId: string().min(1),
|
|
57954
|
+
patch: record(string(), unknown())
|
|
57955
|
+
}), object({ written: boolean() }), {
|
|
57956
|
+
kind: "mutation",
|
|
57957
|
+
auth: "admin"
|
|
57958
|
+
}), method(object({
|
|
57959
|
+
integrationId: string().min(1),
|
|
57960
|
+
keys: array(string().min(1))
|
|
57961
|
+
}), object({
|
|
57962
|
+
present: boolean(),
|
|
57963
|
+
removed: record(string(), unknown())
|
|
57964
|
+
}), {
|
|
57965
|
+
kind: "mutation",
|
|
57966
|
+
auth: "admin"
|
|
57862
57967
|
});
|
|
57863
57968
|
method(object({
|
|
57864
57969
|
sourceUrl: string(),
|
|
@@ -80977,13 +81082,6 @@ Object.freeze({
|
|
|
80977
81082
|
access: "create",
|
|
80978
81083
|
role: "admin"
|
|
80979
81084
|
},
|
|
80980
|
-
"integrations.clearSettings": {
|
|
80981
|
-
capName: "integrations",
|
|
80982
|
-
capScope: "system",
|
|
80983
|
-
addonId: null,
|
|
80984
|
-
access: "delete",
|
|
80985
|
-
role: "admin"
|
|
80986
|
-
},
|
|
80987
81085
|
"integrations.create": {
|
|
80988
81086
|
capName: "integrations",
|
|
80989
81087
|
capScope: "system",
|
|
@@ -81019,13 +81117,6 @@ Object.freeze({
|
|
|
81019
81117
|
access: "view",
|
|
81020
81118
|
role: "admin"
|
|
81021
81119
|
},
|
|
81022
|
-
"integrations.getSettings": {
|
|
81023
|
-
capName: "integrations",
|
|
81024
|
-
capScope: "system",
|
|
81025
|
-
addonId: null,
|
|
81026
|
-
access: "view",
|
|
81027
|
-
role: "admin"
|
|
81028
|
-
},
|
|
81029
81120
|
"integrations.list": {
|
|
81030
81121
|
capName: "integrations",
|
|
81031
81122
|
capScope: "system",
|
|
@@ -81033,13 +81124,6 @@ Object.freeze({
|
|
|
81033
81124
|
access: "view",
|
|
81034
81125
|
role: "admin"
|
|
81035
81126
|
},
|
|
81036
|
-
"integrations.setSettings": {
|
|
81037
|
-
capName: "integrations",
|
|
81038
|
-
capScope: "system",
|
|
81039
|
-
addonId: null,
|
|
81040
|
-
access: "create",
|
|
81041
|
-
role: "admin"
|
|
81042
|
-
},
|
|
81043
81127
|
"integrations.testConnection": {
|
|
81044
81128
|
capName: "integrations",
|
|
81045
81129
|
capScope: "system",
|
|
@@ -82034,6 +82118,13 @@ Object.freeze({
|
|
|
82034
82118
|
access: "view",
|
|
82035
82119
|
role: "admin"
|
|
82036
82120
|
},
|
|
82121
|
+
"migrations.clearLegacyIntegrationRows": {
|
|
82122
|
+
capName: "migrations",
|
|
82123
|
+
capScope: "system",
|
|
82124
|
+
addonId: null,
|
|
82125
|
+
access: "delete",
|
|
82126
|
+
role: "admin"
|
|
82127
|
+
},
|
|
82037
82128
|
"migrations.declareOwner": {
|
|
82038
82129
|
capName: "migrations",
|
|
82039
82130
|
capScope: "system",
|
|
@@ -82041,6 +82132,13 @@ Object.freeze({
|
|
|
82041
82132
|
access: "create",
|
|
82042
82133
|
role: "admin"
|
|
82043
82134
|
},
|
|
82135
|
+
"migrations.deleteLegacyIntegrationRowKeys": {
|
|
82136
|
+
capName: "migrations",
|
|
82137
|
+
capScope: "system",
|
|
82138
|
+
addonId: null,
|
|
82139
|
+
access: "delete",
|
|
82140
|
+
role: "admin"
|
|
82141
|
+
},
|
|
82044
82142
|
"migrations.dryRun": {
|
|
82045
82143
|
capName: "migrations",
|
|
82046
82144
|
capScope: "system",
|
|
@@ -82076,6 +82174,20 @@ Object.freeze({
|
|
|
82076
82174
|
access: "create",
|
|
82077
82175
|
role: "admin"
|
|
82078
82176
|
},
|
|
82177
|
+
"migrations.patchLegacyIntegrationRows": {
|
|
82178
|
+
capName: "migrations",
|
|
82179
|
+
capScope: "system",
|
|
82180
|
+
addonId: null,
|
|
82181
|
+
access: "create",
|
|
82182
|
+
role: "admin"
|
|
82183
|
+
},
|
|
82184
|
+
"migrations.readLegacyIntegrationRows": {
|
|
82185
|
+
capName: "migrations",
|
|
82186
|
+
capScope: "system",
|
|
82187
|
+
addonId: null,
|
|
82188
|
+
access: "view",
|
|
82189
|
+
role: "admin"
|
|
82190
|
+
},
|
|
82079
82191
|
"migrations.restorePreMigration": {
|
|
82080
82192
|
capName: "migrations",
|
|
82081
82193
|
capScope: "system",
|
|
@@ -160477,17 +160589,8 @@ var ExportHapAddon = class extends BaseAddon {
|
|
|
160477
160589
|
...this.exposureMigrationPorts()
|
|
160478
160590
|
}))).applied.length > 0) await this.resolveConfig();
|
|
160479
160591
|
}
|
|
160480
|
-
|
|
160481
|
-
|
|
160482
|
-
* fact of one node, and the settings machinery reads a per-node key through this schema. The
|
|
160483
|
-
* editable surfaces are the node form, the device defaults and each bridge's own form.
|
|
160484
|
-
*/
|
|
160485
|
-
globalSettingsSchema() {
|
|
160486
|
-
return this.schema({ sections: [{
|
|
160487
|
-
id: "export-hap",
|
|
160488
|
-
title: "HomeKit Export",
|
|
160489
|
-
fields: [this.interfaceNameField()]
|
|
160490
|
-
}] });
|
|
160592
|
+
scopedSettingsCapabilities() {
|
|
160593
|
+
return ["device-export"];
|
|
160491
160594
|
}
|
|
160492
160595
|
async buildDeviceSettingsContribution(deviceId) {
|
|
160493
160596
|
const kind = await this.resolveExportKind(deviceId);
|
|
@@ -6021,7 +6021,7 @@ var ZodIssueCode = {
|
|
|
6021
6021
|
var ZodFirstPartyTypeKind;
|
|
6022
6022
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
6023
6023
|
//#endregion
|
|
6024
|
-
//#region ../types/dist/sleep-
|
|
6024
|
+
//#region ../types/dist/sleep-DEZaLbiu.mjs
|
|
6025
6025
|
/**
|
|
6026
6026
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
6027
6027
|
* window to float samples (D455).
|
|
@@ -6830,6 +6830,12 @@ function projectStore(store, perNodeKeys, nodeId) {
|
|
|
6830
6830
|
}
|
|
6831
6831
|
return out;
|
|
6832
6832
|
}
|
|
6833
|
+
/** Every scope, in the order the guard and the docs list them. */
|
|
6834
|
+
var SCOPED_SETTINGS_SCOPES = [
|
|
6835
|
+
"cluster",
|
|
6836
|
+
"device-defaults",
|
|
6837
|
+
"node"
|
|
6838
|
+
];
|
|
6833
6839
|
/**
|
|
6834
6840
|
* The address of one keychain value: `secret://<owner>/<scope>/<fieldPath>`.
|
|
6835
6841
|
*
|
|
@@ -7721,6 +7727,13 @@ var BaseAddon = class {
|
|
|
7721
7727
|
*/
|
|
7722
7728
|
secretStatePaths = [];
|
|
7723
7729
|
_addonSecretTree = null;
|
|
7730
|
+
/**
|
|
7731
|
+
* D986 M4: the scoped schemas this addon declared, resolved once per capability
|
|
7732
|
+
* (`loadScopedSchemas`) so the sync readers (`perNodeKeys`, the secret tree, the restart check)
|
|
7733
|
+
* see them. Empty until loaded: the readers then fall back to {@link globalSettingsSchema}.
|
|
7734
|
+
*/
|
|
7735
|
+
_scopedByCap = /* @__PURE__ */ new Map();
|
|
7736
|
+
_nodeKeysByCap = /* @__PURE__ */ new Map();
|
|
7724
7737
|
_deviceSecretTree = null;
|
|
7725
7738
|
/** Refs the last resolved config pointed at — a change to one re-resolves. */
|
|
7726
7739
|
_configSecretRefs = /* @__PURE__ */ new Set();
|
|
@@ -7790,6 +7803,7 @@ var BaseAddon = class {
|
|
|
7790
7803
|
this._ctx = context;
|
|
7791
7804
|
this._secretSettings = null;
|
|
7792
7805
|
}
|
|
7806
|
+
await this.loadScopedSchemas();
|
|
7793
7807
|
await this.resolveConfig();
|
|
7794
7808
|
if (secrets !== void 0) this._secretChangeUnsub = secrets.onChange((ref) => {
|
|
7795
7809
|
if (this._configSecretRefs.has(ref)) this.scheduleSecretReresolve(SECRET_CHANGE_DEBOUNCE_MS);
|
|
@@ -7799,6 +7813,7 @@ var BaseAddon = class {
|
|
|
7799
7813
|
const normalized = normalizeAddonInitResult(result);
|
|
7800
7814
|
const providers = normalized && "providers" in normalized && normalized.providers ? normalized.providers : [];
|
|
7801
7815
|
this._registeredCapNames = providers.map((p) => p.capability.name);
|
|
7816
|
+
await this.loadScopedSchemas();
|
|
7802
7817
|
return normalized;
|
|
7803
7818
|
}
|
|
7804
7819
|
/**
|
|
@@ -7887,6 +7902,16 @@ var BaseAddon = class {
|
|
|
7887
7902
|
schema(schema) {
|
|
7888
7903
|
return schema;
|
|
7889
7904
|
}
|
|
7905
|
+
/**
|
|
7906
|
+
* The capability names whose scoped settings schemas ({@link clusterSettingsSchema},
|
|
7907
|
+
* {@link nodeSettingsSchema}, {@link deviceDefaultsSchema}) this addon declares. Read BEFORE
|
|
7908
|
+
* `onInitialize`, when the providers it registers are not known yet: the first config resolve
|
|
7909
|
+
* must already know which keys are per node. Names the providers register at init are added
|
|
7910
|
+
* once known.
|
|
7911
|
+
*/
|
|
7912
|
+
scopedSettingsCapabilities() {
|
|
7913
|
+
return [];
|
|
7914
|
+
}
|
|
7890
7915
|
/** Override to provide global-level settings UI schema. */
|
|
7891
7916
|
globalSettingsSchema(_cap) {
|
|
7892
7917
|
return null;
|
|
@@ -7930,7 +7955,8 @@ var BaseAddon = class {
|
|
|
7930
7955
|
return [];
|
|
7931
7956
|
}
|
|
7932
7957
|
async getGlobalSettings(overlay, cap, nodeId) {
|
|
7933
|
-
|
|
7958
|
+
await this.loadScopedSchemas(cap);
|
|
7959
|
+
const schema = this.globalSettingsSchema(cap) ?? this.scopedFormSchema(cap);
|
|
7934
7960
|
if (!schema) return { sections: [] };
|
|
7935
7961
|
const projected = await this.readRawProjectedStore(nodeId, cap);
|
|
7936
7962
|
return hydrateSchema(schema, overlay ? await this.overlayKeepingMarkers(projected, overlay) : projected, { inlineSecretsAsViews: true });
|
|
@@ -7965,10 +7991,9 @@ var BaseAddon = class {
|
|
|
7965
7991
|
*
|
|
7966
7992
|
* Override it only when an `instanceMode: multiple` addon's instances differ: an NVR integration
|
|
7967
7993
|
* needs its connection fields, the default integration the addon's own sections. It is the
|
|
7968
|
-
* SHAPE of the form only — the values live
|
|
7969
|
-
* unchanged (`integrations.setSettings` for an account integration).
|
|
7994
|
+
* SHAPE of the form only — the values live on the instance record.
|
|
7970
7995
|
*/
|
|
7971
|
-
async
|
|
7996
|
+
async integrationFormSchema(_instance) {
|
|
7972
7997
|
return null;
|
|
7973
7998
|
}
|
|
7974
7999
|
/**
|
|
@@ -8014,7 +8039,7 @@ var BaseAddon = class {
|
|
|
8014
8039
|
* per-instance schema when it declares one, else its global schema (what they always showed).
|
|
8015
8040
|
*/
|
|
8016
8041
|
async getIntegrationFormSchema(instance, nodeId) {
|
|
8017
|
-
const scoped = await this.
|
|
8042
|
+
const scoped = await this.integrationFormSchema(instance);
|
|
8018
8043
|
if (scoped === null) return this.getGlobalSettings(void 0, void 0, nodeId);
|
|
8019
8044
|
return hydrateSchema(scoped, {}, { inlineSecretsAsViews: true });
|
|
8020
8045
|
}
|
|
@@ -8062,6 +8087,7 @@ var BaseAddon = class {
|
|
|
8062
8087
|
* resolved blob back is a no-op for every unchanged secret.
|
|
8063
8088
|
*/
|
|
8064
8089
|
async resolveGlobalStore(nodeId, cap) {
|
|
8090
|
+
await this.loadScopedSchemas(cap);
|
|
8065
8091
|
const raw = await this._ctx?.settings?.readAddonStore() ?? {};
|
|
8066
8092
|
return this.projectForNode(raw, nodeId, cap);
|
|
8067
8093
|
}
|
|
@@ -8072,6 +8098,7 @@ var BaseAddon = class {
|
|
|
8072
8098
|
}
|
|
8073
8099
|
/** The PROJECTED store with its markers — the form hydrate only (D798). */
|
|
8074
8100
|
async readRawProjectedStore(nodeId, cap) {
|
|
8101
|
+
await this.loadScopedSchemas(cap);
|
|
8075
8102
|
const raw = await this.rawSettings()?.readAddonStore() ?? {};
|
|
8076
8103
|
return this.projectForNode(raw, nodeId, cap);
|
|
8077
8104
|
}
|
|
@@ -8174,6 +8201,7 @@ var BaseAddon = class {
|
|
|
8174
8201
|
await this.applyGlobalPatch(patch, nodeId);
|
|
8175
8202
|
}
|
|
8176
8203
|
async applyGlobalPatch(barePatch, nodeId) {
|
|
8204
|
+
await this.loadScopedSchemas();
|
|
8177
8205
|
const keys = this.perNodeKeys();
|
|
8178
8206
|
const localNode = normalizeNodeId(this._ctx?.kernel?.localNodeId);
|
|
8179
8207
|
const target = normalizeNodeId(nodeId ?? this._ctx?.kernel?.localNodeId);
|
|
@@ -8187,7 +8215,8 @@ var BaseAddon = class {
|
|
|
8187
8215
|
await this.resolveConfig();
|
|
8188
8216
|
await this.onConfigChanged();
|
|
8189
8217
|
this.emitLifecycle(EventCategory.AddonUpdated, { level: "global" });
|
|
8190
|
-
|
|
8218
|
+
const legacy = this.globalSettingsSchema();
|
|
8219
|
+
this.maybeAutoRestart(Object.keys(barePatch), [...legacy === null ? [] : [legacy], ...this.loadedScopedSchemas().map((entry) => entry.schema)]);
|
|
8191
8220
|
}
|
|
8192
8221
|
/**
|
|
8193
8222
|
* The set of field keys the global settings schema declares `perNode: true`
|
|
@@ -8195,14 +8224,67 @@ var BaseAddon = class {
|
|
|
8195
8224
|
* declarations). Empty set ⇒ every per-node code path is bypassed and the
|
|
8196
8225
|
* settings API behaves exactly like the legacy node-agnostic one.
|
|
8197
8226
|
*/
|
|
8198
|
-
|
|
8227
|
+
/**
|
|
8228
|
+
* Load the scoped schemas of every capability this addon declares (the override and the
|
|
8229
|
+
* providers registered at init, plus `extraCap`) that is not loaded yet, then drop what was
|
|
8230
|
+
* derived from the previous set. Idempotent.
|
|
8231
|
+
*/
|
|
8232
|
+
async loadScopedSchemas(extraCap) {
|
|
8233
|
+
const caps = new Set([
|
|
8234
|
+
...this.scopedSettingsCapabilities(),
|
|
8235
|
+
...this._registeredCapNames,
|
|
8236
|
+
...extraCap === void 0 ? [] : [extraCap]
|
|
8237
|
+
]);
|
|
8238
|
+
let added = false;
|
|
8239
|
+
for (const cap of caps) {
|
|
8240
|
+
if (this._scopedByCap.has(cap)) continue;
|
|
8241
|
+
const loaded = [];
|
|
8242
|
+
for (const scope of SCOPED_SETTINGS_SCOPES) {
|
|
8243
|
+
const schema = await this.getScopedSettingsSchema(scope, cap);
|
|
8244
|
+
if (schema !== null) loaded.push({
|
|
8245
|
+
scope,
|
|
8246
|
+
schema
|
|
8247
|
+
});
|
|
8248
|
+
}
|
|
8249
|
+
this._scopedByCap.set(cap, loaded);
|
|
8250
|
+
added = true;
|
|
8251
|
+
}
|
|
8252
|
+
if (!added) return;
|
|
8253
|
+
this._nodeKeysByCap = /* @__PURE__ */ new Map();
|
|
8254
|
+
this._addonSecretTree = null;
|
|
8255
|
+
}
|
|
8256
|
+
/**
|
|
8257
|
+
* The form the settings API serves while an addon declares no {@link globalSettingsSchema}: the
|
|
8258
|
+
* sections of its scoped schemas, so dropping the old hook does not blank the form.
|
|
8259
|
+
*/
|
|
8260
|
+
scopedFormSchema(cap) {
|
|
8261
|
+
const byId = /* @__PURE__ */ new Map();
|
|
8262
|
+
for (const entry of this.loadedScopedSchemas(cap)) for (const section of entry.schema.sections) if (!byId.has(section.id)) byId.set(section.id, section);
|
|
8263
|
+
return byId.size === 0 ? null : { sections: [...byId.values()] };
|
|
8264
|
+
}
|
|
8265
|
+
/** Every loaded scoped schema of `cap`, or of every loaded capability. */
|
|
8266
|
+
loadedScopedSchemas(cap) {
|
|
8267
|
+
if (cap !== void 0) return this._scopedByCap.get(cap) ?? [];
|
|
8268
|
+
return [...this._scopedByCap.values()].flat();
|
|
8269
|
+
}
|
|
8270
|
+
/**
|
|
8271
|
+
* The field keys that are stored per node: every field of a {@link nodeSettingsSchema}, plus
|
|
8272
|
+
* the fields the legacy {@link globalSettingsSchema} still marks `perNode: true`. Derived once
|
|
8273
|
+
* per `cap` argument and memoized (schemas are static declarations). Empty set ⇒ every
|
|
8274
|
+
* per-node code path is bypassed and the settings API behaves like the node-agnostic one.
|
|
8275
|
+
* Call {@link loadScopedSchemas} first (the async seams do).
|
|
8276
|
+
*/
|
|
8199
8277
|
perNodeKeys(cap) {
|
|
8200
8278
|
const cacheKey = cap ?? "";
|
|
8201
|
-
const cached = this.
|
|
8279
|
+
const cached = this._nodeKeysByCap.get(cacheKey);
|
|
8202
8280
|
if (cached) return cached;
|
|
8203
|
-
const
|
|
8204
|
-
const keys = new Set(
|
|
8205
|
-
this.
|
|
8281
|
+
const legacy = this.globalSettingsSchema(cap);
|
|
8282
|
+
const keys = new Set(legacy ? legacy.sections.flatMap((section) => collectPerNodeFieldKeys(section.fields)) : []);
|
|
8283
|
+
for (const { scope, schema } of this.loadedScopedSchemas(cap)) {
|
|
8284
|
+
if (scope !== "node") continue;
|
|
8285
|
+
for (const section of schema.sections) for (const key of collectValueFieldKeys(section.fields)) keys.add(key);
|
|
8286
|
+
}
|
|
8287
|
+
this._nodeKeysByCap.set(cacheKey, keys);
|
|
8206
8288
|
return keys;
|
|
8207
8289
|
}
|
|
8208
8290
|
/**
|
|
@@ -8212,10 +8294,9 @@ var BaseAddon = class {
|
|
|
8212
8294
|
* time to return its response before the addon is torn down and
|
|
8213
8295
|
* re-initialised by `AddonRegistryService.restartAddon`.
|
|
8214
8296
|
*/
|
|
8215
|
-
maybeAutoRestart(patchKeys,
|
|
8216
|
-
if (!schema) return;
|
|
8297
|
+
maybeAutoRestart(patchKeys, schemas) {
|
|
8217
8298
|
const restartKeys = /* @__PURE__ */ new Set();
|
|
8218
|
-
for (const section of schema.sections) for (const field of section.fields) {
|
|
8299
|
+
for (const schema of schemas) for (const section of schema.sections) for (const field of section.fields) {
|
|
8219
8300
|
if (field.type === "separator" || field.type === "info") continue;
|
|
8220
8301
|
if (field.requiresRestart) restartKeys.add(field.key);
|
|
8221
8302
|
}
|
|
@@ -8411,12 +8492,14 @@ var BaseAddon = class {
|
|
|
8411
8492
|
* here, in the addon's own process, so the hub keeps no copy of it.
|
|
8412
8493
|
*/
|
|
8413
8494
|
async getDeclaredSettingsKeys() {
|
|
8495
|
+
await this.loadScopedSchemas();
|
|
8414
8496
|
return { keys: [...this.declaredKeySet()].toSorted() };
|
|
8415
8497
|
}
|
|
8416
8498
|
declaredKeySet() {
|
|
8417
8499
|
const keys = new Set(Object.keys(this.defaults));
|
|
8418
8500
|
const schema = this.globalSettingsSchema();
|
|
8419
8501
|
if (schema) for (const section of schema.sections) for (const key of collectFieldKeys(section.fields)) keys.add(key);
|
|
8502
|
+
for (const { schema: scoped } of this.loadedScopedSchemas()) for (const section of scoped.sections) for (const key of collectFieldKeys(section.fields)) keys.add(key);
|
|
8420
8503
|
for (const key of this._declaredStateKeys) keys.add(key);
|
|
8421
8504
|
for (const path of this.secretStatePaths) {
|
|
8422
8505
|
const root = path.split(/[.[]/, 1)[0];
|
|
@@ -8512,7 +8595,11 @@ var BaseAddon = class {
|
|
|
8512
8595
|
}
|
|
8513
8596
|
/** The addon store's secret tree: schema fields by TYPE, plus `secretStatePaths`. */
|
|
8514
8597
|
addonSecretTree() {
|
|
8515
|
-
this._addonSecretTree
|
|
8598
|
+
if (this._addonSecretTree === null) {
|
|
8599
|
+
const tree = new Map(secretTreeFromSchema(this.globalSettingsSchema()));
|
|
8600
|
+
for (const { schema } of this.loadedScopedSchemas()) for (const [key, node] of secretTreeFromSchema(schema)) tree.set(key, node);
|
|
8601
|
+
this._addonSecretTree = mergeSecretStatePaths(tree, this.secretStatePaths);
|
|
8602
|
+
}
|
|
8516
8603
|
return this._addonSecretTree;
|
|
8517
8604
|
}
|
|
8518
8605
|
deviceSecretTree() {
|
|
@@ -8762,6 +8849,23 @@ function dropPerNodeFields(fields) {
|
|
|
8762
8849
|
}
|
|
8763
8850
|
return kept;
|
|
8764
8851
|
}
|
|
8852
|
+
/** The keys of the value-holding fields, recursing into layout containers. */
|
|
8853
|
+
function collectValueFieldKeys(fields) {
|
|
8854
|
+
const collected = [];
|
|
8855
|
+
for (const field of fields) {
|
|
8856
|
+
if (field.type === "group") {
|
|
8857
|
+
collected.push(...collectValueFieldKeys(field.fields));
|
|
8858
|
+
continue;
|
|
8859
|
+
}
|
|
8860
|
+
if (field.type === "sub-tabs") {
|
|
8861
|
+
for (const tab of field.tabs) collected.push(...collectValueFieldKeys(tab.fields));
|
|
8862
|
+
continue;
|
|
8863
|
+
}
|
|
8864
|
+
if (field.type === "separator" || field.type === "info") continue;
|
|
8865
|
+
if ("key" in field && typeof field.key === "string") collected.push(field.key);
|
|
8866
|
+
}
|
|
8867
|
+
return collected;
|
|
8868
|
+
}
|
|
8765
8869
|
function collectFieldKeys(fields) {
|
|
8766
8870
|
const collected = [];
|
|
8767
8871
|
for (const field of fields) {
|
|
@@ -51372,12 +51476,12 @@ var deviceExportCapability = {
|
|
|
51372
51476
|
kind: "poll"
|
|
51373
51477
|
},
|
|
51374
51478
|
/**
|
|
51375
|
-
* Each export provider
|
|
51376
|
-
* (enabled toggle, preferred stream, addon-specific knobs
|
|
51377
|
-
*
|
|
51378
|
-
* `
|
|
51379
|
-
* `
|
|
51380
|
-
*
|
|
51479
|
+
* Each export provider MAY contribute its own per-device "Export" panel
|
|
51480
|
+
* (enabled toggle, preferred stream, addon-specific knobs). The three
|
|
51481
|
+
* framework methods are mounted on the cap router when present.
|
|
51482
|
+
* `IDeviceExportProvider` leaves them optional: an exporter with no
|
|
51483
|
+
* per-device panel omits them (a `deviceConfig` cap's UI is derived and
|
|
51484
|
+
* never hand-written — D14 — and an exporter is not one of those).
|
|
51381
51485
|
*/
|
|
51382
51486
|
exposesDeviceSettings: true,
|
|
51383
51487
|
methods: {
|
|
@@ -55084,11 +55188,7 @@ var CreateIntegrationInputSchema = object({
|
|
|
55084
55188
|
info: record(string(), unknown()).optional(),
|
|
55085
55189
|
/** `stableId` of the discovery candidate the form was seeded from (D984). */
|
|
55086
55190
|
originStableId: string().optional(),
|
|
55087
|
-
settings: record(string(), unknown()).optional()
|
|
55088
|
-
/** Keys of `settings` the form's schema declares secret (by type) — kept in
|
|
55089
|
-
* the keychain, not the table (D787). */
|
|
55090
|
-
secretKeys: array(string()).optional(),
|
|
55091
|
-
skipRestart: boolean().optional()
|
|
55191
|
+
settings: record(string(), unknown()).optional()
|
|
55092
55192
|
});
|
|
55093
55193
|
var UpdateIntegrationInputSchema = object({
|
|
55094
55194
|
id: string(),
|
|
@@ -55109,22 +55209,6 @@ method(_void(), array(IntegrationWithStateSchema)), method(object({ id: string()
|
|
|
55109
55209
|
}), method(object({ id: string() }), DeleteIntegrationResultSchema, {
|
|
55110
55210
|
kind: "mutation",
|
|
55111
55211
|
auth: "admin"
|
|
55112
|
-
}), method(object({ id: string() }), record(string(), unknown()), { auth: "admin" }), method(object({
|
|
55113
|
-
id: string(),
|
|
55114
|
-
settings: record(string(), unknown()),
|
|
55115
|
-
/** Keys the form's schema declares secret (by type) — keychain-stored (D787). */
|
|
55116
|
-
secretKeys: array(string()).optional(),
|
|
55117
|
-
/** The integration's own addon applies the change in-process and asks the hub not to respawn it. */
|
|
55118
|
-
skipRestart: boolean().optional()
|
|
55119
|
-
}), object({ success: boolean() }), {
|
|
55120
|
-
kind: "mutation",
|
|
55121
|
-
auth: "admin"
|
|
55122
|
-
}), method(object({ id: string() }), object({
|
|
55123
|
-
rows: number().int().nonnegative(),
|
|
55124
|
-
secrets: number().int().nonnegative()
|
|
55125
|
-
}), {
|
|
55126
|
-
kind: "mutation",
|
|
55127
|
-
auth: "admin"
|
|
55128
55212
|
}), method(_void(), array(AvailableIntegrationTypeSchema), { auth: "admin" }), method(object({
|
|
55129
55213
|
addonId: string(),
|
|
55130
55214
|
settings: record(string(), unknown())
|
|
@@ -57849,6 +57933,27 @@ method(object({}), object({ entries: array(MigrationLedgerEntrySchema) }), { aut
|
|
|
57849
57933
|
}), {
|
|
57850
57934
|
kind: "mutation",
|
|
57851
57935
|
auth: "admin"
|
|
57936
|
+
}), method(object({ integrationId: string().min(1) }), record(string(), unknown()), { auth: "admin" }), method(object({ integrationId: string().min(1) }), object({
|
|
57937
|
+
rows: number().int().nonnegative(),
|
|
57938
|
+
secrets: number().int().nonnegative()
|
|
57939
|
+
}), {
|
|
57940
|
+
kind: "mutation",
|
|
57941
|
+
auth: "admin"
|
|
57942
|
+
}), method(object({
|
|
57943
|
+
integrationId: string().min(1),
|
|
57944
|
+
patch: record(string(), unknown())
|
|
57945
|
+
}), object({ written: boolean() }), {
|
|
57946
|
+
kind: "mutation",
|
|
57947
|
+
auth: "admin"
|
|
57948
|
+
}), method(object({
|
|
57949
|
+
integrationId: string().min(1),
|
|
57950
|
+
keys: array(string().min(1))
|
|
57951
|
+
}), object({
|
|
57952
|
+
present: boolean(),
|
|
57953
|
+
removed: record(string(), unknown())
|
|
57954
|
+
}), {
|
|
57955
|
+
kind: "mutation",
|
|
57956
|
+
auth: "admin"
|
|
57852
57957
|
});
|
|
57853
57958
|
method(object({
|
|
57854
57959
|
sourceUrl: string(),
|
|
@@ -80967,13 +81072,6 @@ Object.freeze({
|
|
|
80967
81072
|
access: "create",
|
|
80968
81073
|
role: "admin"
|
|
80969
81074
|
},
|
|
80970
|
-
"integrations.clearSettings": {
|
|
80971
|
-
capName: "integrations",
|
|
80972
|
-
capScope: "system",
|
|
80973
|
-
addonId: null,
|
|
80974
|
-
access: "delete",
|
|
80975
|
-
role: "admin"
|
|
80976
|
-
},
|
|
80977
81075
|
"integrations.create": {
|
|
80978
81076
|
capName: "integrations",
|
|
80979
81077
|
capScope: "system",
|
|
@@ -81009,13 +81107,6 @@ Object.freeze({
|
|
|
81009
81107
|
access: "view",
|
|
81010
81108
|
role: "admin"
|
|
81011
81109
|
},
|
|
81012
|
-
"integrations.getSettings": {
|
|
81013
|
-
capName: "integrations",
|
|
81014
|
-
capScope: "system",
|
|
81015
|
-
addonId: null,
|
|
81016
|
-
access: "view",
|
|
81017
|
-
role: "admin"
|
|
81018
|
-
},
|
|
81019
81110
|
"integrations.list": {
|
|
81020
81111
|
capName: "integrations",
|
|
81021
81112
|
capScope: "system",
|
|
@@ -81023,13 +81114,6 @@ Object.freeze({
|
|
|
81023
81114
|
access: "view",
|
|
81024
81115
|
role: "admin"
|
|
81025
81116
|
},
|
|
81026
|
-
"integrations.setSettings": {
|
|
81027
|
-
capName: "integrations",
|
|
81028
|
-
capScope: "system",
|
|
81029
|
-
addonId: null,
|
|
81030
|
-
access: "create",
|
|
81031
|
-
role: "admin"
|
|
81032
|
-
},
|
|
81033
81117
|
"integrations.testConnection": {
|
|
81034
81118
|
capName: "integrations",
|
|
81035
81119
|
capScope: "system",
|
|
@@ -82024,6 +82108,13 @@ Object.freeze({
|
|
|
82024
82108
|
access: "view",
|
|
82025
82109
|
role: "admin"
|
|
82026
82110
|
},
|
|
82111
|
+
"migrations.clearLegacyIntegrationRows": {
|
|
82112
|
+
capName: "migrations",
|
|
82113
|
+
capScope: "system",
|
|
82114
|
+
addonId: null,
|
|
82115
|
+
access: "delete",
|
|
82116
|
+
role: "admin"
|
|
82117
|
+
},
|
|
82027
82118
|
"migrations.declareOwner": {
|
|
82028
82119
|
capName: "migrations",
|
|
82029
82120
|
capScope: "system",
|
|
@@ -82031,6 +82122,13 @@ Object.freeze({
|
|
|
82031
82122
|
access: "create",
|
|
82032
82123
|
role: "admin"
|
|
82033
82124
|
},
|
|
82125
|
+
"migrations.deleteLegacyIntegrationRowKeys": {
|
|
82126
|
+
capName: "migrations",
|
|
82127
|
+
capScope: "system",
|
|
82128
|
+
addonId: null,
|
|
82129
|
+
access: "delete",
|
|
82130
|
+
role: "admin"
|
|
82131
|
+
},
|
|
82034
82132
|
"migrations.dryRun": {
|
|
82035
82133
|
capName: "migrations",
|
|
82036
82134
|
capScope: "system",
|
|
@@ -82066,6 +82164,20 @@ Object.freeze({
|
|
|
82066
82164
|
access: "create",
|
|
82067
82165
|
role: "admin"
|
|
82068
82166
|
},
|
|
82167
|
+
"migrations.patchLegacyIntegrationRows": {
|
|
82168
|
+
capName: "migrations",
|
|
82169
|
+
capScope: "system",
|
|
82170
|
+
addonId: null,
|
|
82171
|
+
access: "create",
|
|
82172
|
+
role: "admin"
|
|
82173
|
+
},
|
|
82174
|
+
"migrations.readLegacyIntegrationRows": {
|
|
82175
|
+
capName: "migrations",
|
|
82176
|
+
capScope: "system",
|
|
82177
|
+
addonId: null,
|
|
82178
|
+
access: "view",
|
|
82179
|
+
role: "admin"
|
|
82180
|
+
},
|
|
82069
82181
|
"migrations.restorePreMigration": {
|
|
82070
82182
|
capName: "migrations",
|
|
82071
82183
|
capScope: "system",
|
|
@@ -160467,17 +160579,8 @@ var ExportHapAddon = class extends BaseAddon {
|
|
|
160467
160579
|
...this.exposureMigrationPorts()
|
|
160468
160580
|
}))).applied.length > 0) await this.resolveConfig();
|
|
160469
160581
|
}
|
|
160470
|
-
|
|
160471
|
-
|
|
160472
|
-
* fact of one node, and the settings machinery reads a per-node key through this schema. The
|
|
160473
|
-
* editable surfaces are the node form, the device defaults and each bridge's own form.
|
|
160474
|
-
*/
|
|
160475
|
-
globalSettingsSchema() {
|
|
160476
|
-
return this.schema({ sections: [{
|
|
160477
|
-
id: "export-hap",
|
|
160478
|
-
title: "HomeKit Export",
|
|
160479
|
-
fields: [this.interfaceNameField()]
|
|
160480
|
-
}] });
|
|
160582
|
+
scopedSettingsCapabilities() {
|
|
160583
|
+
return ["device-export"];
|
|
160481
160584
|
}
|
|
160482
160585
|
async buildDeviceSettingsContribution(deviceId) {
|
|
160483
160586
|
const kind = await this.resolveExportKind(deviceId);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-export-hap",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.194",
|
|
4
4
|
"description": "HomeKit (HAP) exporter for CamStack devices. Publishes each exposed device as its own HomeKit accessory: cameras and doorbells with SRTP streaming, HomeKit Secure Video, motion, two-way audio, PTZ and battery; switches, lights, locks and sensors through a capability→service table.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
}
|
|
68
68
|
],
|
|
69
69
|
"requires": {
|
|
70
|
-
"server": ">=1.2.
|
|
70
|
+
"server": ">=1.2.775"
|
|
71
71
|
}
|
|
72
72
|
},
|
|
73
73
|
"files": [
|