@camstack/types 1.2.45 → 1.2.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/addon.js +11 -2
- package/dist/addon.mjs +11 -2
- package/dist/{fmp4-box-splitter-B53u9-Nu.mjs → canonical-hash-rO1sRmEK.mjs} +34 -34
- package/dist/capabilities/core-blocks.cap.d.ts +52 -0
- package/dist/capabilities/device-manager.cap.d.ts +11 -427
- package/dist/capabilities/index.d.ts +3 -3
- package/dist/capabilities/motion-detection.cap.d.ts +6 -1
- package/dist/capabilities/notification-output.cap.d.ts +4 -4
- package/dist/capabilities/notification-rules.cap.d.ts +24 -24
- package/dist/capabilities/oauth-integration.cap.d.ts +4 -0
- package/dist/capabilities/osd-manager.cap.d.ts +12 -12
- package/dist/capabilities/pipeline-analytics.cap.d.ts +7 -1
- package/dist/capabilities/sso-bridge.cap.d.ts +3 -0
- package/dist/capabilities/stream-broker.cap.d.ts +165 -1
- package/dist/capabilities/user-management.cap.d.ts +3 -1
- package/dist/capabilities/videoclips.cap.d.ts +5 -0
- package/dist/device/declared-device.d.ts +197 -0
- package/dist/device/device-binding.d.ts +15 -9
- package/dist/device/device-management.d.ts +1 -83
- package/dist/device/index.d.ts +20 -19
- package/dist/expression/binding-source.d.ts +85 -0
- package/dist/expression/{link-expression.d.ts → expression-source.d.ts} +22 -13
- package/dist/expression/index.d.ts +17 -14
- package/dist/expression/limits.d.ts +1 -1
- package/dist/generated/addon-api.d.ts +21 -7
- package/dist/generated/cap-input-defaults.d.ts +1 -1
- package/dist/generated/device-proxy.d.ts +2 -2
- package/dist/generated/method-access-map.d.ts +1 -1
- package/dist/generated/system-proxy.d.ts +2 -2
- package/dist/index.d.ts +9 -8
- package/dist/index.js +10224 -9819
- package/dist/index.mjs +10195 -9805
- package/dist/node.js +7 -7
- package/dist/node.mjs +1 -1
- package/dist/{sleep-Bf5fBs7u.mjs → sleep-7WqNZVcL.mjs} +1 -1
- package/dist/{sleep-BOI-sVEA.js → sleep-ocMLM2o5.js} +1 -1
- package/package.json +1 -1
- package/dist/device/device-link-transform.d.ts +0 -5
- package/dist/{fmp4-box-splitter-BkWH7O3L.js → canonical-hash-DNV8S5ET.js} +33 -33
package/dist/node.js
CHANGED
|
@@ -21,7 +21,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
21
21
|
enumerable: true
|
|
22
22
|
}) : target, mod));
|
|
23
23
|
//#endregion
|
|
24
|
-
const
|
|
24
|
+
const require_canonical_hash = require("./canonical-hash-DNV8S5ET.js");
|
|
25
25
|
const require_err_msg = require("./err-msg-COpsHMw2.js");
|
|
26
26
|
let node_crypto = require("node:crypto");
|
|
27
27
|
let node_fs = require("node:fs");
|
|
@@ -609,7 +609,7 @@ var FilesystemStorageProvider = class {
|
|
|
609
609
|
*/
|
|
610
610
|
function canonicalDeviceFingerprint(shape) {
|
|
611
611
|
const features = [...new Set(shape.features)].toSorted();
|
|
612
|
-
return
|
|
612
|
+
return require_canonical_hash.canonicalHash({
|
|
613
613
|
deviceType: shape.deviceType,
|
|
614
614
|
features
|
|
615
615
|
});
|
|
@@ -1217,7 +1217,7 @@ var Fmp4FragmentChild = class {
|
|
|
1217
1217
|
deps;
|
|
1218
1218
|
args;
|
|
1219
1219
|
child = null;
|
|
1220
|
-
splitter = new
|
|
1220
|
+
splitter = new require_canonical_hash.Fmp4BoxSplitter();
|
|
1221
1221
|
stopped = false;
|
|
1222
1222
|
unitsOut = 0;
|
|
1223
1223
|
activeHwAccel = null;
|
|
@@ -1234,7 +1234,7 @@ var Fmp4FragmentChild = class {
|
|
|
1234
1234
|
return;
|
|
1235
1235
|
} catch (err) {
|
|
1236
1236
|
if (this.stopped) throw err;
|
|
1237
|
-
if (requested === null ||
|
|
1237
|
+
if (requested === null || require_canonical_hash.isSoftwareDecode(requested)) throw err;
|
|
1238
1238
|
this.deps.logger.warn("fmp4 fragment child: hardware decode produced NO fragment — retrying in SOFTWARE", {
|
|
1239
1239
|
tags: { deviceId: this.args.deviceId },
|
|
1240
1240
|
meta: {
|
|
@@ -1244,7 +1244,7 @@ var Fmp4FragmentChild = class {
|
|
|
1244
1244
|
}
|
|
1245
1245
|
});
|
|
1246
1246
|
this.killChild();
|
|
1247
|
-
this.splitter = new
|
|
1247
|
+
this.splitter = new require_canonical_hash.Fmp4BoxSplitter();
|
|
1248
1248
|
this.activeHwAccel = null;
|
|
1249
1249
|
await this.spawnAttempt(null);
|
|
1250
1250
|
}
|
|
@@ -1262,7 +1262,7 @@ var Fmp4FragmentChild = class {
|
|
|
1262
1262
|
this.args.plane.end("the fragment child stopped");
|
|
1263
1263
|
}
|
|
1264
1264
|
spawnAttempt(decodeHwAccel) {
|
|
1265
|
-
const args =
|
|
1265
|
+
const args = require_canonical_hash.buildFfmpegArgs({
|
|
1266
1266
|
...this.args.invocation,
|
|
1267
1267
|
decodeHwAccel,
|
|
1268
1268
|
sink: {
|
|
@@ -1433,7 +1433,7 @@ exports.Fmp4FragmentPlane = Fmp4FragmentPlane;
|
|
|
1433
1433
|
exports.PYTHON_VERSION = PYTHON_VERSION;
|
|
1434
1434
|
exports.buildBinaryPath = buildBinaryPath;
|
|
1435
1435
|
exports.canonicalDeviceFingerprint = canonicalDeviceFingerprint;
|
|
1436
|
-
exports.canonicalHash =
|
|
1436
|
+
exports.canonicalHash = require_canonical_hash.canonicalHash;
|
|
1437
1437
|
exports.diffExportTargets = diffExportTargets;
|
|
1438
1438
|
exports.downloadBinary = downloadBinary;
|
|
1439
1439
|
exports.ensureBinary = ensureBinary;
|
package/dist/node.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as
|
|
1
|
+
import { n as Fmp4BoxSplitter, o as buildFfmpegArgs, t as canonicalHash, u as isSoftwareDecode } from "./canonical-hash-rO1sRmEK.mjs";
|
|
2
2
|
import { t as errMsg } from "./err-msg-IQTHeDzc.mjs";
|
|
3
3
|
import { createHash, randomUUID } from "node:crypto";
|
|
4
4
|
import * as fs from "node:fs";
|
|
@@ -3382,7 +3382,6 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
3382
3382
|
setLinkDeviceId: (input) => dispatchSystem("deviceManager", "setLinkDeviceId", "mutation", input),
|
|
3383
3383
|
setPrimaryChildEntityId: (input) => dispatchSystem("deviceManager", "setPrimaryChildEntityId", "mutation", input),
|
|
3384
3384
|
setChildLayout: (input) => dispatchSystem("deviceManager", "setChildLayout", "mutation", input),
|
|
3385
|
-
setDeviceLinks: (input) => dispatchSystem("deviceManager", "setDeviceLinks", "mutation", input),
|
|
3386
3385
|
setDisplay: (input) => dispatchSystem("deviceManager", "setDisplay", "mutation", input),
|
|
3387
3386
|
getWireableFields: (input) => dispatchSystem("deviceManager", "getWireableFields", "query", input),
|
|
3388
3387
|
setRole: (input) => dispatchSystem("deviceManager", "setRole", "mutation", input),
|
|
@@ -3500,6 +3499,7 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
3500
3499
|
assignProfile: (input) => dispatchSystem("streamBroker", "assignProfile", "mutation", input),
|
|
3501
3500
|
unassignProfile: (input) => dispatchSystem("streamBroker", "unassignProfile", "mutation", input),
|
|
3502
3501
|
renderPreBufferClip: (input) => dispatchSystem("streamBroker", "renderPreBufferClip", "mutation", input),
|
|
3502
|
+
produceEventMedia: (input) => dispatchSystem("streamBroker", "produceEventMedia", "mutation", input),
|
|
3503
3503
|
restartProfile: (input) => dispatchSystem("streamBroker", "restartProfile", "mutation", input),
|
|
3504
3504
|
getDeviceAudioMute: (input) => dispatchSystem("streamBroker", "getDeviceAudioMute", "query", input),
|
|
3505
3505
|
setDeviceAudioMute: (input) => dispatchSystem("streamBroker", "setDeviceAudioMute", "mutation", input),
|
|
@@ -3382,7 +3382,6 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
3382
3382
|
setLinkDeviceId: (input) => dispatchSystem("deviceManager", "setLinkDeviceId", "mutation", input),
|
|
3383
3383
|
setPrimaryChildEntityId: (input) => dispatchSystem("deviceManager", "setPrimaryChildEntityId", "mutation", input),
|
|
3384
3384
|
setChildLayout: (input) => dispatchSystem("deviceManager", "setChildLayout", "mutation", input),
|
|
3385
|
-
setDeviceLinks: (input) => dispatchSystem("deviceManager", "setDeviceLinks", "mutation", input),
|
|
3386
3385
|
setDisplay: (input) => dispatchSystem("deviceManager", "setDisplay", "mutation", input),
|
|
3387
3386
|
getWireableFields: (input) => dispatchSystem("deviceManager", "getWireableFields", "query", input),
|
|
3388
3387
|
setRole: (input) => dispatchSystem("deviceManager", "setRole", "mutation", input),
|
|
@@ -3500,6 +3499,7 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
3500
3499
|
assignProfile: (input) => dispatchSystem("streamBroker", "assignProfile", "mutation", input),
|
|
3501
3500
|
unassignProfile: (input) => dispatchSystem("streamBroker", "unassignProfile", "mutation", input),
|
|
3502
3501
|
renderPreBufferClip: (input) => dispatchSystem("streamBroker", "renderPreBufferClip", "mutation", input),
|
|
3502
|
+
produceEventMedia: (input) => dispatchSystem("streamBroker", "produceEventMedia", "mutation", input),
|
|
3503
3503
|
restartProfile: (input) => dispatchSystem("streamBroker", "restartProfile", "mutation", input),
|
|
3504
3504
|
getDeviceAudioMute: (input) => dispatchSystem("streamBroker", "getDeviceAudioMute", "query", input),
|
|
3505
3505
|
setDeviceAudioMute: (input) => dispatchSystem("streamBroker", "setDeviceAudioMute", "mutation", input),
|
package/package.json
CHANGED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { DeviceLinkTransform } from './device-management.js';
|
|
2
|
-
/** Apply a link transform to a resolved source value. `identity`/undefined
|
|
3
|
-
* pass through; `enum-map` remaps strings (fallback or null when unknown);
|
|
4
|
-
* `linear` does scale*x+offset with optional clamp (null for non-numbers). */
|
|
5
|
-
export declare function applyTransform(value: unknown, transform: DeviceLinkTransform | undefined): unknown;
|
|
@@ -405,39 +405,6 @@ function invocationFromEncodeProfile(input) {
|
|
|
405
405
|
};
|
|
406
406
|
}
|
|
407
407
|
//#endregion
|
|
408
|
-
//#region src/utils/canonical-hash.ts
|
|
409
|
-
/**
|
|
410
|
-
* Deterministic SHA-256 hash of an arbitrary serialisable value. The
|
|
411
|
-
* canonical form sorts object keys alphabetically at every depth so two
|
|
412
|
-
* structurally-equal inputs with different key insertion orders produce
|
|
413
|
-
* the same hash. Returns a 64-char lowercase hex digest.
|
|
414
|
-
*
|
|
415
|
-
* Used by export adapters (Alexa, HAP) to short-circuit re-discovery /
|
|
416
|
-
* accessory-rebuild work when the upstream shape is byte-identical to
|
|
417
|
-
* the last applied state — preventing user-visible "re-discovery"
|
|
418
|
-
* notifications on every addon-runner respawn. Each respawn re-fires
|
|
419
|
-
* `DeviceBindingsChanged` for every cap registration, which without
|
|
420
|
-
* this guard would propagate redundant pushes.
|
|
421
|
-
*
|
|
422
|
-
* Note: this is a SYMPTOMATIC fix layered on top of the binding-change
|
|
423
|
-
* subscription. The proper fix is a single "device ready" lifecycle
|
|
424
|
-
* barrier so exports react only when the full cap set has landed —
|
|
425
|
-
* tracked separately for post-HA-integration work.
|
|
426
|
-
*/
|
|
427
|
-
function canonicalHash(value) {
|
|
428
|
-
const canonical = JSON.stringify(value, replaceWithSortedKeys);
|
|
429
|
-
return (0, node_crypto.createHash)("sha256").update(canonical ?? "").digest("hex");
|
|
430
|
-
}
|
|
431
|
-
function replaceWithSortedKeys(_key, value) {
|
|
432
|
-
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
433
|
-
const obj = value;
|
|
434
|
-
const out = {};
|
|
435
|
-
for (const k of Object.keys(obj).toSorted()) out[k] = obj[k];
|
|
436
|
-
return out;
|
|
437
|
-
}
|
|
438
|
-
return value;
|
|
439
|
-
}
|
|
440
|
-
//#endregion
|
|
441
408
|
//#region src/ffmpeg/fmp4-box-splitter.ts
|
|
442
409
|
var DEFAULT_MAX_UNIT_BYTES = 16 * 1024 * 1024;
|
|
443
410
|
/** Header size for a normal box, and for one carrying a 64-bit `largesize`. */
|
|
@@ -612,6 +579,39 @@ var Fmp4BoxSplitter = class {
|
|
|
612
579
|
}
|
|
613
580
|
};
|
|
614
581
|
//#endregion
|
|
582
|
+
//#region src/utils/canonical-hash.ts
|
|
583
|
+
/**
|
|
584
|
+
* Deterministic SHA-256 hash of an arbitrary serialisable value. The
|
|
585
|
+
* canonical form sorts object keys alphabetically at every depth so two
|
|
586
|
+
* structurally-equal inputs with different key insertion orders produce
|
|
587
|
+
* the same hash. Returns a 64-char lowercase hex digest.
|
|
588
|
+
*
|
|
589
|
+
* Used by export adapters (Alexa, HAP) to short-circuit re-discovery /
|
|
590
|
+
* accessory-rebuild work when the upstream shape is byte-identical to
|
|
591
|
+
* the last applied state — preventing user-visible "re-discovery"
|
|
592
|
+
* notifications on every addon-runner respawn. Each respawn re-fires
|
|
593
|
+
* `DeviceBindingsChanged` for every cap registration, which without
|
|
594
|
+
* this guard would propagate redundant pushes.
|
|
595
|
+
*
|
|
596
|
+
* Note: this is a SYMPTOMATIC fix layered on top of the binding-change
|
|
597
|
+
* subscription. The proper fix is a single "device ready" lifecycle
|
|
598
|
+
* barrier so exports react only when the full cap set has landed —
|
|
599
|
+
* tracked separately for post-HA-integration work.
|
|
600
|
+
*/
|
|
601
|
+
function canonicalHash(value) {
|
|
602
|
+
const canonical = JSON.stringify(value, replaceWithSortedKeys);
|
|
603
|
+
return (0, node_crypto.createHash)("sha256").update(canonical ?? "").digest("hex");
|
|
604
|
+
}
|
|
605
|
+
function replaceWithSortedKeys(_key, value) {
|
|
606
|
+
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
607
|
+
const obj = value;
|
|
608
|
+
const out = {};
|
|
609
|
+
for (const k of Object.keys(obj).toSorted()) out[k] = obj[k];
|
|
610
|
+
return out;
|
|
611
|
+
}
|
|
612
|
+
return value;
|
|
613
|
+
}
|
|
614
|
+
//#endregion
|
|
615
615
|
Object.defineProperty(exports, "AUDIO_PRESETS", {
|
|
616
616
|
enumerable: true,
|
|
617
617
|
get: function() {
|