@camstack/types 1.2.46 → 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 +4 -3
- package/dist/addon.mjs +4 -3
- 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 +2 -2
- package/dist/capabilities/motion-detection.cap.d.ts +6 -1
- 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 +1 -0
- 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 +7 -7
- package/dist/generated/device-proxy.d.ts +1 -1
- package/dist/generated/system-proxy.d.ts +1 -1
- package/dist/index.d.ts +9 -8
- package/dist/index.js +2322 -2057
- package/dist/index.mjs +2297 -2043
- package/dist/node.js +7 -7
- package/dist/node.mjs +1 -1
- package/dist/{sleep-BbYwFLG6.mjs → sleep-7WqNZVcL.mjs} +0 -1
- package/dist/{sleep-CyN9nHr_.js → sleep-ocMLM2o5.js} +0 -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/addon.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_event_category = require("./event-category-BE4PDZ_3.js");
|
|
3
|
-
const require_sleep = require("./sleep-
|
|
3
|
+
const require_sleep = require("./sleep-ocMLM2o5.js");
|
|
4
4
|
const require_err_msg = require("./err-msg-COpsHMw2.js");
|
|
5
5
|
//#region src/generated/collection-array-methods.ts
|
|
6
6
|
/**
|
|
@@ -252,8 +252,9 @@ var CAP_INPUT_DEFAULTS = Object.freeze({
|
|
|
252
252
|
"postSeconds": 6,
|
|
253
253
|
"kinds": ["mp4"],
|
|
254
254
|
"gifMaxWidth": 640,
|
|
255
|
-
"gifFps":
|
|
256
|
-
"
|
|
255
|
+
"gifFps": 12,
|
|
256
|
+
"gifSpeed": 4,
|
|
257
|
+
"speed": 4
|
|
257
258
|
},
|
|
258
259
|
"pullAudioChunks": { "maxCount": 8 },
|
|
259
260
|
"pullFrameHandles": { "maxCount": 4 },
|
package/dist/addon.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as EventCategory } from "./event-category-41fKf-q9.mjs";
|
|
2
|
-
import { C as DeviceType, F as readNodePin, L as ReadinessRegistry, O as expandCapMethods, P as nodePin, R as ReadinessTimeoutError, V as scopeKey, a as asJsonObject, d as DEVICE_SCOPED_CAPS, f as isDeviceScopedCap, gt as normalizeAddonInitResult, ht as BaseAddon, mt as DisposerChain, p as createDeviceProxy, pt as DATAPLANE_SECRET_HEADER, s as asString, t as sleep, u as parseJsonUnknown, v as deviceOpsCapability, w as adminUiCapability, y as viewerUiCapability, yt as emitReadiness } from "./sleep-
|
|
2
|
+
import { C as DeviceType, F as readNodePin, L as ReadinessRegistry, O as expandCapMethods, P as nodePin, R as ReadinessTimeoutError, V as scopeKey, a as asJsonObject, d as DEVICE_SCOPED_CAPS, f as isDeviceScopedCap, gt as normalizeAddonInitResult, ht as BaseAddon, mt as DisposerChain, p as createDeviceProxy, pt as DATAPLANE_SECRET_HEADER, s as asString, t as sleep, u as parseJsonUnknown, v as deviceOpsCapability, w as adminUiCapability, y as viewerUiCapability, yt as emitReadiness } from "./sleep-7WqNZVcL.mjs";
|
|
3
3
|
import { t as errMsg } from "./err-msg-IQTHeDzc.mjs";
|
|
4
4
|
//#region src/generated/collection-array-methods.ts
|
|
5
5
|
/**
|
|
@@ -251,8 +251,9 @@ var CAP_INPUT_DEFAULTS = Object.freeze({
|
|
|
251
251
|
"postSeconds": 6,
|
|
252
252
|
"kinds": ["mp4"],
|
|
253
253
|
"gifMaxWidth": 640,
|
|
254
|
-
"gifFps":
|
|
255
|
-
"
|
|
254
|
+
"gifFps": 12,
|
|
255
|
+
"gifSpeed": 4,
|
|
256
|
+
"speed": 4
|
|
256
257
|
},
|
|
257
258
|
"pullAudioChunks": { "maxCount": 8 },
|
|
258
259
|
"pullFrameHandles": { "maxCount": 4 },
|
|
@@ -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 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,4 +579,37 @@ var Fmp4BoxSplitter = class {
|
|
|
612
579
|
}
|
|
613
580
|
};
|
|
614
581
|
//#endregion
|
|
615
|
-
|
|
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 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
|
+
export { buildAudioArgs as a, buildVideoArgs as c, logBannerArgs as d, pickVideoEncoder as f, audioPlanFromEncodeProfile as i, invocationFromEncodeProfile as l, Fmp4BoxSplitter as n, buildFfmpegArgs as o, AUDIO_PRESETS as r, buildInputArgs as s, canonicalHash as t, isSoftwareDecode as u };
|
|
@@ -19,6 +19,22 @@ import { type InferProvider } from './capability-definition.js';
|
|
|
19
19
|
* instead of taking the hub with it (D6). Every method here is admin-only, and
|
|
20
20
|
* must stay so.
|
|
21
21
|
*/
|
|
22
|
+
/**
|
|
23
|
+
* Prefix for a block's generated addon id AND its runner id — one addon, one
|
|
24
|
+
* process, so the two are the same string (D2).
|
|
25
|
+
*
|
|
26
|
+
* It lives on the CONTRACT rather than beside the code that materialises the
|
|
27
|
+
* package, because it is not an implementation detail: the operator surface
|
|
28
|
+
* reads a block's logs by asking `logs.query` for `addonId = core-block-<id>`,
|
|
29
|
+
* with no cap and no store of its own. Two copies of this string is one copy
|
|
30
|
+
* too many — a drift would show as a logs pane that is simply always empty.
|
|
31
|
+
*/
|
|
32
|
+
export declare const CORE_BLOCK_ADDON_PREFIX = "core-block-";
|
|
33
|
+
/** The addon/runner id a block's process runs under. */
|
|
34
|
+
export declare function coreBlockAddonId(blockId: string): string;
|
|
35
|
+
/** The block id behind a generated addon/runner id, or null when the id belongs
|
|
36
|
+
* to something else. The inverse of {@link coreBlockAddonId}. */
|
|
37
|
+
export declare function coreBlockIdFromAddonId(addonId: string): string | null;
|
|
22
38
|
/** Where a block runs. The operator chooses — a block driving a device on an
|
|
23
39
|
* agent is the reason placement is not fixed to the hub. */
|
|
24
40
|
export declare const CoreBlockPlacementSchema: z.ZodUnion<readonly [z.ZodLiteral<"hub">, z.ZodString]>;
|
|
@@ -216,6 +232,42 @@ export declare const coreBlocksCapability: {
|
|
|
216
232
|
lastChangedAt: z.ZodNumber;
|
|
217
233
|
}, z.core.$strip>;
|
|
218
234
|
}, z.core.$strip>, "mutation">;
|
|
235
|
+
/**
|
|
236
|
+
* Stop this block's runner and let the supervisor bring it back.
|
|
237
|
+
*
|
|
238
|
+
* **It stores nothing.** There is no "restart requested" flag and no second
|
|
239
|
+
* lifecycle field: the supervisor already stops and respawns a runner when
|
|
240
|
+
* the code hash changes, and this exposes that same path deliberately
|
|
241
|
+
* (D62 — a switch writes the authority that already owned the function).
|
|
242
|
+
* The next reconcile pass remains the authority, so a restart that lost a
|
|
243
|
+
* race is corrected within one pass rather than leaving a stale flag behind.
|
|
244
|
+
*
|
|
245
|
+
* Refused for a DISABLED block: nothing would come back, and a button that
|
|
246
|
+
* silently does nothing is worse than one that says why.
|
|
247
|
+
*/
|
|
248
|
+
readonly restart: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
249
|
+
blockId: z.ZodString;
|
|
250
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
251
|
+
block: z.ZodObject<{
|
|
252
|
+
name: z.ZodString;
|
|
253
|
+
code: z.ZodString;
|
|
254
|
+
enabled: z.ZodBoolean;
|
|
255
|
+
placement: z.ZodUnion<readonly [z.ZodLiteral<"hub">, z.ZodString]>;
|
|
256
|
+
integrationId: z.ZodOptional<z.ZodString>;
|
|
257
|
+
id: z.ZodString;
|
|
258
|
+
createdAt: z.ZodNumber;
|
|
259
|
+
updatedAt: z.ZodNumber;
|
|
260
|
+
createdBy: z.ZodString;
|
|
261
|
+
status: z.ZodEnum<{
|
|
262
|
+
failed: "failed";
|
|
263
|
+
running: "running";
|
|
264
|
+
stopped: "stopped";
|
|
265
|
+
starting: "starting";
|
|
266
|
+
}>;
|
|
267
|
+
lastError: z.ZodOptional<z.ZodString>;
|
|
268
|
+
lastChangedAt: z.ZodNumber;
|
|
269
|
+
}, z.core.$strip>;
|
|
270
|
+
}, z.core.$strip>, "mutation">;
|
|
219
271
|
/**
|
|
220
272
|
* Type-check without saving — what the editor calls as the author types, so
|
|
221
273
|
* the compiler's verdict is the same one the server will reach.
|