@camstack/addon-osd-manager 0.1.126 → 0.1.128
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/{MotionZonesSettings-k6Zzbfy9.mjs → MotionZonesSettings-DqRYIx3V.mjs} +2 -2
- package/dist/{PrivacyMaskSettings-DwhFoc16.mjs → PrivacyMaskSettings-tONTkkCF.mjs} +4 -4
- package/dist/{SceneMonitorEditor-DAqbVCgr.mjs → SceneMonitorEditor-DMfjQQfD.mjs} +3 -3
- package/dist/_stub.js +10 -10
- package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_osd_manager_page-Dy_PTg0V.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_osd_manager_page-D_49CiBy.mjs} +3 -3
- package/dist/_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-B9U0FY5V.mjs +26 -0
- package/dist/{cap-error-hton7JwR.mjs → cap-error-Cj2E3c0-.mjs} +1 -1
- package/dist/{hostInit-D_FWYfaI.mjs → hostInit-CE_Cq0Q6.mjs} +2 -2
- package/dist/index.js +328 -19
- package/dist/index.mjs +328 -19
- package/dist/{player-overlays-CEidmNyu.mjs → player-overlays-B1QNz7_H.mjs} +1 -1
- package/dist/remoteEntry.js +1 -1
- package/dist/{scene-monitor-copy-CLKtgPk1.mjs → scene-monitor-copy-DZan2tbo.mjs} +1 -1
- package/dist/{square-Dq8X76sM.mjs → square-B4Ae4SRW.mjs} +1 -1
- package/dist/{trash-2-BYTSgKQu.mjs → trash-2-DzFAgcKl.mjs} +1 -1
- package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_osd_manager_page__remoteEntry_js-B9gGFib0.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_osd_manager_page__remoteEntry_js-sRuVMTqE.mjs} +1 -1
- package/package.json +1 -1
- package/dist/_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-Ds-WCEP6.mjs +0 -26
package/dist/index.js
CHANGED
|
@@ -5363,7 +5363,7 @@ var ZodIssueCode = {
|
|
|
5363
5363
|
var ZodFirstPartyTypeKind;
|
|
5364
5364
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5365
5365
|
//#endregion
|
|
5366
|
-
//#region ../types/dist/sleep-
|
|
5366
|
+
//#region ../types/dist/sleep-BVhJDJka.mjs
|
|
5367
5367
|
/**
|
|
5368
5368
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5369
5369
|
* window to float samples (D455).
|
|
@@ -6934,6 +6934,18 @@ function systemMethod(input, output, options) {
|
|
|
6934
6934
|
systemOnly: true
|
|
6935
6935
|
};
|
|
6936
6936
|
}
|
|
6937
|
+
/**
|
|
6938
|
+
* A method a SOURCE of a collection cap may legitimately not serve — OPTIONAL
|
|
6939
|
+
* on `InferProvider`. The `providerOptional: true` literal is what
|
|
6940
|
+
* `InferProvider` keys on; see {@link CapabilityMethodSchema.providerOptional}
|
|
6941
|
+
* for when this is the honest answer and when it is a soft stub.
|
|
6942
|
+
*/
|
|
6943
|
+
function optionalMethod(input, output, options) {
|
|
6944
|
+
return {
|
|
6945
|
+
...method(input, output, options),
|
|
6946
|
+
providerOptional: true
|
|
6947
|
+
};
|
|
6948
|
+
}
|
|
6937
6949
|
/** Shorthand to define an event schema */
|
|
6938
6950
|
function event(data) {
|
|
6939
6951
|
return { data };
|
|
@@ -29217,6 +29229,59 @@ var ClipPlaybackSchema = object({
|
|
|
29217
29229
|
* which days it asked for and got nothing — "no clips" would be a lie about a
|
|
29218
29230
|
* card that is full of them.
|
|
29219
29231
|
*/
|
|
29232
|
+
/**
|
|
29233
|
+
* The operator's authorisation to WAKE a sleeping camera for one clip read.
|
|
29234
|
+
*
|
|
29235
|
+
* ONE value, absent by default, and it is a `force`-shaped operator signal in
|
|
29236
|
+
* exactly the sense `snapshot-wake-gate.ts` uses the word: *"`snapshot.getSnapshot`'s
|
|
29237
|
+
* `force` flag, and nothing else… a background caller must never set it…
|
|
29238
|
+
* Stale but honest beats woken"*. A scheduler, a retry, a reconcile and a
|
|
29239
|
+
* prefetch never set it; a surface sets it only behind the same confirm the
|
|
29240
|
+
* "Wake and refresh" gesture uses, and it is refused below 15 % battery
|
|
29241
|
+
* exactly as that gesture is.
|
|
29242
|
+
*
|
|
29243
|
+
* The gate is decided BEFORE `getApi()`, because on UDP the login IS the wake
|
|
29244
|
+
* (D549) — a read that opened a session and then checked would have woken the
|
|
29245
|
+
* camera to find out it was not allowed to.
|
|
29246
|
+
*
|
|
29247
|
+
* **One authorised yes is one wake.** `next-natural` — take the clip the next
|
|
29248
|
+
* time the camera is awake for its own reasons — is deliberately not a member:
|
|
29249
|
+
* it was proposed, it is free on the battery, and the operator declined it on
|
|
29250
|
+
* 2026-09-20 (*"Quando un export viene richiesto si sveglia la camera."*,
|
|
29251
|
+
* D558 "Considered and not taken").
|
|
29252
|
+
*/
|
|
29253
|
+
var ClipWakeSchema = _enum(["authorised"]);
|
|
29254
|
+
/**
|
|
29255
|
+
* A clip's finished bytes, inline — the twin of `recordingExport.readExportBytes`.
|
|
29256
|
+
*
|
|
29257
|
+
* `bytes` is the DECODED length, so nobody infers it from the base64 length,
|
|
29258
|
+
* and `served` says which twin the caller actually got.
|
|
29259
|
+
*/
|
|
29260
|
+
var ClipBytesSchema = object({
|
|
29261
|
+
base64: string(),
|
|
29262
|
+
contentType: string(),
|
|
29263
|
+
/** Suggested filename, extension included. */
|
|
29264
|
+
name: string(),
|
|
29265
|
+
bytes: number().int().nonnegative(),
|
|
29266
|
+
/**
|
|
29267
|
+
* Which twin was actually served — the same contract
|
|
29268
|
+
* {@link ClipPlaybackSchema.served} carries, and REQUIRED here because the
|
|
29269
|
+
* export record persists it: a row read a week later must say the same thing
|
|
29270
|
+
* the panel said at the moment of the tap. A missing main twin is never
|
|
29271
|
+
* served silently as if it were the asked-for quality (D549 15).
|
|
29272
|
+
*/
|
|
29273
|
+
served: CamProfileSchema,
|
|
29274
|
+
/**
|
|
29275
|
+
* The DECODED duration of the delivered file, when the fetch measured one.
|
|
29276
|
+
*
|
|
29277
|
+
* A clip fetch verifies its own completion against the catalog row and
|
|
29278
|
+
* retries a materially short pass (D568); this is that measurement, carried
|
|
29279
|
+
* so a consumer can say the same thing rather than re-deriving it. Absent
|
|
29280
|
+
* when the producer did not measure — never zero, which would say the file
|
|
29281
|
+
* is empty.
|
|
29282
|
+
*/
|
|
29283
|
+
durationMs: number().positive().optional()
|
|
29284
|
+
});
|
|
29220
29285
|
var ClipSourceAvailabilitySchema = object({
|
|
29221
29286
|
state: _enum([
|
|
29222
29287
|
"ok",
|
|
@@ -29318,22 +29383,40 @@ var videoclipsCapability = {
|
|
|
29318
29383
|
limit: number().int().positive().optional(),
|
|
29319
29384
|
/**
|
|
29320
29385
|
* WHICH provider to ask — the `addonId` a {@link ClipSourceSchema} row
|
|
29321
|
-
* carries, never a source id and never a list.
|
|
29386
|
+
* carries, never a source id and never a list. **Required** (D554 amended).
|
|
29387
|
+
*
|
|
29388
|
+
* A provider the device is not bound to is refused by name rather than
|
|
29389
|
+
* answered by another one (D552's `rejectUnresolvedAddonPin` rule).
|
|
29390
|
+
*
|
|
29391
|
+
* It was optional, documented as "absent means the device's BOUND
|
|
29392
|
+
* provider, which is CamStack on every camera". No code implemented
|
|
29393
|
+
* that. Measured on the live hub 2026-09-20 — device 592, bound to
|
|
29394
|
+
* `recorder` AND `provider-reolink` — a bare call with `limit: 3`
|
|
29395
|
+
* answered SIX rows, three from each source, merged newest-first:
|
|
29396
|
+
* `device-collection-dispatch.ts` simply left the fan-out un-narrowed,
|
|
29397
|
+
* so absence bought the union this method exists not to be, and
|
|
29398
|
+
* `limit` meant `limit × sources`.
|
|
29322
29399
|
*
|
|
29323
|
-
*
|
|
29324
|
-
*
|
|
29325
|
-
*
|
|
29326
|
-
*
|
|
29327
|
-
*
|
|
29400
|
+
* There is nothing to restore the default to. `getBindings` answers a
|
|
29401
|
+
* collection cap with a DERIVED, PLURAL set (D554 amended, step 0);
|
|
29402
|
+
* `setWrapperActive` — the singleton authority that could name one —
|
|
29403
|
+
* throws for a collection cap by design. Naming CamStack here instead
|
|
29404
|
+
* would privilege one addon by id inside a surface whose premise is
|
|
29405
|
+
* that sources are peers, and would be wrong on the first camera with
|
|
29406
|
+
* no recorder binding. So absence is REFUSED, in the schema, where the
|
|
29407
|
+
* generated types make it unomittable rather than merely discouraged.
|
|
29408
|
+
*
|
|
29409
|
+
* The default belongs to the SURFACE, which has the `listSources` rows
|
|
29410
|
+
* and can say which one it picked (D569 § 1–3; the viewer already
|
|
29411
|
+
* always sends this).
|
|
29328
29412
|
*
|
|
29329
29413
|
* It replaced `sources?: string[]`, a VIEW filter over source ids that
|
|
29330
29414
|
* assumed the answer was a fan-out over everything a camera has. The
|
|
29331
|
-
* operator settled otherwise on 2026-09-20 — *"
|
|
29332
|
-
*
|
|
29333
|
-
*
|
|
29334
|
-
* at a time and there is nothing to filter out of it.
|
|
29415
|
+
* operator settled otherwise on 2026-09-20 — *"l'utilizzatore è uno
|
|
29416
|
+
* solo"* — so the list is asked of one provider at a time and there is
|
|
29417
|
+
* nothing to filter out of it.
|
|
29335
29418
|
*/
|
|
29336
|
-
provider: string().
|
|
29419
|
+
provider: string().min(1)
|
|
29337
29420
|
}), array(ClipSchema).readonly(), {
|
|
29338
29421
|
kind: "query",
|
|
29339
29422
|
auth: "protected"
|
|
@@ -29370,6 +29453,68 @@ var videoclipsCapability = {
|
|
|
29370
29453
|
}), ClipPlaybackSchema, {
|
|
29371
29454
|
kind: "query",
|
|
29372
29455
|
auth: "protected"
|
|
29456
|
+
}),
|
|
29457
|
+
/**
|
|
29458
|
+
* This clip's BYTES, base64, bounded — the by-handle read a clip EXPORT
|
|
29459
|
+
* pulls once (D558).
|
|
29460
|
+
*
|
|
29461
|
+
* `getClipPlayback` is the right answer for a player: it hands back a URL
|
|
29462
|
+
* on a plane the hub serves `access:'authenticated'`, which a browser and a
|
|
29463
|
+
* viewer session satisfy. It is the wrong answer for another ADDON. There
|
|
29464
|
+
* is no addon→addon byte transport in this framework — `AddonDataPlane`
|
|
29465
|
+
* only lets an addon SERVE, on `127.0.0.1` behind a per-listener secret
|
|
29466
|
+
* only the hub may present — so a recorder that wants a camera's clip
|
|
29467
|
+
* cannot fetch that URL. This method is the one seam that exists for it,
|
|
29468
|
+
* and it is deliberately the same shape (and the same bound) as
|
|
29469
|
+
* `recordingExport.readExportBytes`, which exists for the mirror-image
|
|
29470
|
+
* reason.
|
|
29471
|
+
*
|
|
29472
|
+
* Routing needs no `provider` pin: the id is source-prefixed and
|
|
29473
|
+
* self-contained, so `device-collection-dispatch.ts` rule 3 hands the call
|
|
29474
|
+
* to the source that claims it — and an id nobody claims is REFUSED rather
|
|
29475
|
+
* than answered by another source.
|
|
29476
|
+
*
|
|
29477
|
+
* The producer reuses the fetch path it already has, completion rules
|
|
29478
|
+
* included: a clip is taken by cmd 5 and finished on a short idle window
|
|
29479
|
+
* whose result is PROVED against the catalog row's own span, retried once
|
|
29480
|
+
* when it comes up materially short, and served-and-named when it is still
|
|
29481
|
+
* short (D568). A second fetch with different completion rules is exactly
|
|
29482
|
+
* the second authority D558 refuses to create.
|
|
29483
|
+
*
|
|
29484
|
+
* Every refusal THROWS with its reason and none of them is silent — the
|
|
29485
|
+
* sleep gate (decided before `getApi()`, liftable only by
|
|
29486
|
+
* {@link ClipWakeSchema}), a catalog row nobody claims, a clip with no
|
|
29487
|
+
* bytes behind it, a mux that failed, and the size bound. The caller turns
|
|
29488
|
+
* that reason into an operator-facing one; a truncated file is never an
|
|
29489
|
+
* answer.
|
|
29490
|
+
*/
|
|
29491
|
+
readClipBytes: optionalMethod(object({
|
|
29492
|
+
deviceId: number(),
|
|
29493
|
+
clipId: string().min(1),
|
|
29494
|
+
/**
|
|
29495
|
+
* Which twin to fetch, on the mapping D549 15 already fixed:
|
|
29496
|
+
* `low | mid` → the sub file, `high` → the main twin. `auto` is not
|
|
29497
|
+
* accepted here for the same reason it is not accepted by
|
|
29498
|
+
* `getClipPlayback` — a stored file has no broker session, so the
|
|
29499
|
+
* adaptive tier cannot be resolved for it.
|
|
29500
|
+
*/
|
|
29501
|
+
profile: CamProfileSchema.optional(),
|
|
29502
|
+
/**
|
|
29503
|
+
* The CALLER's byte bound, so an over-size clip is refused before it is
|
|
29504
|
+
* read and encoded rather than after. Capped by
|
|
29505
|
+
* {@link VIDEOCLIPS_MAX_READ_BYTES} whatever is passed; absent means
|
|
29506
|
+
* that ceiling.
|
|
29507
|
+
*/
|
|
29508
|
+
maxBytes: number().int().positive().optional(),
|
|
29509
|
+
/**
|
|
29510
|
+
* The operator's authorisation to wake a sleeping camera for this
|
|
29511
|
+
* read. Absent — the default — means a sleeping standalone battery
|
|
29512
|
+
* camera is REFUSED by name, before any session is opened.
|
|
29513
|
+
*/
|
|
29514
|
+
wake: ClipWakeSchema.optional()
|
|
29515
|
+
}), ClipBytesSchema, {
|
|
29516
|
+
kind: "query",
|
|
29517
|
+
auth: "protected"
|
|
29373
29518
|
})
|
|
29374
29519
|
}
|
|
29375
29520
|
};
|
|
@@ -38306,13 +38451,101 @@ var ExportStateSchema = _enum([
|
|
|
38306
38451
|
"expired",
|
|
38307
38452
|
"deleted"
|
|
38308
38453
|
]);
|
|
38309
|
-
/**
|
|
38454
|
+
/**
|
|
38455
|
+
* WHAT an export is — the authority, as opposed to the four top-level fields
|
|
38456
|
+
* the Library sorts and labels on (D558 § 2.2).
|
|
38457
|
+
*
|
|
38458
|
+
* Read it through {@link exportSubjectOf}, never off the record directly: the
|
|
38459
|
+
* field is optional for the history rows written before it existed, and that
|
|
38460
|
+
* absence has exactly one interpreter.
|
|
38461
|
+
*/
|
|
38462
|
+
var ExportSubjectSchema = discriminatedUnion("kind", [object({
|
|
38463
|
+
kind: literal("footage"),
|
|
38464
|
+
deviceId: number(),
|
|
38465
|
+
profiles: array(string()).min(1),
|
|
38466
|
+
fromMs: number(),
|
|
38467
|
+
toMs: number()
|
|
38468
|
+
}), object({
|
|
38469
|
+
kind: literal("clip"),
|
|
38470
|
+
deviceId: number(),
|
|
38471
|
+
provider: string().min(1),
|
|
38472
|
+
source: string().min(1),
|
|
38473
|
+
sourceLabel: string().min(1),
|
|
38474
|
+
clipId: string().min(1),
|
|
38475
|
+
/**
|
|
38476
|
+
* WHERE IN THE CATALOG to confirm this clip — the day window the surface was
|
|
38477
|
+
* already listing when the operator picked the segment.
|
|
38478
|
+
*
|
|
38479
|
+
* It is **not** a time range control and it never becomes one: the record's
|
|
38480
|
+
* `fromMs`/`toMs` come from the catalog ROW and from nothing a caller
|
|
38481
|
+
* supplied (D558 § 5.4.3), and a window that does not contain the clip is a
|
|
38482
|
+
* `catalog-miss`, not a silently wider search. It exists because
|
|
38483
|
+
* `videoclips.listClips` takes `since`/`until` and has no by-handle twin:
|
|
38484
|
+
* the catalog check D558 asks for is literally that call, and a call needs a
|
|
38485
|
+
* window. The surface has one — `ClipsBrowser`'s `dayWindow`, one local
|
|
38486
|
+
* wall-clock day, which is also the only width measured to be cheap (one
|
|
38487
|
+
* day on 592 lists 171 clips in 712 ms, a busy day 546 in 2.0 s; twenty days
|
|
38488
|
+
* of one child's events took 3.6–5.4 s).
|
|
38489
|
+
*/
|
|
38490
|
+
catalogWindow: object({
|
|
38491
|
+
sinceMs: number(),
|
|
38492
|
+
untilMs: number()
|
|
38493
|
+
}),
|
|
38494
|
+
profile: _enum([
|
|
38495
|
+
"high",
|
|
38496
|
+
"mid",
|
|
38497
|
+
"low"
|
|
38498
|
+
]),
|
|
38499
|
+
/**
|
|
38500
|
+
* The operator's authorisation to wake a sleeping camera for this export.
|
|
38501
|
+
* ONE definition, in the cap that owns the clip read ({@link ClipWakeSchema}),
|
|
38502
|
+
* because the gate that honours it is the clip provider's sleep gate — a
|
|
38503
|
+
* second enum here would be a second contract. Absent by default; never
|
|
38504
|
+
* settable by a scheduler or a retry.
|
|
38505
|
+
*
|
|
38506
|
+
* **One authorised yes is ONE wake.** A failed clip export is retried only by
|
|
38507
|
+
* an operator act that asks again; a queued job that outlived its wake fails
|
|
38508
|
+
* with a reason rather than waking on its turn; and this subject carries
|
|
38509
|
+
* exactly one profile precisely so one tap is never two fetches (D558 § 5.2).
|
|
38510
|
+
*/
|
|
38511
|
+
wake: ClipWakeSchema.optional()
|
|
38512
|
+
})]);
|
|
38513
|
+
/**
|
|
38514
|
+
* One export job / history row.
|
|
38515
|
+
*
|
|
38516
|
+
* **`subject` is the AUTHORITY on what was exported. `deviceId`, `profile`,
|
|
38517
|
+
* `fromMs` and `toMs` are its PROJECTION** — kept top-level because the whole
|
|
38518
|
+
* Library sorts and labels on them (`library-items.ts` orders an export by
|
|
38519
|
+
* `fromMs`; `export-format.ts` draws `rangeLabel` from the pair), and a row
|
|
38520
|
+
* that did not fill them would sort under the epoch and render a blank range.
|
|
38521
|
+
* Write to the subject and read from the projection and the two will disagree;
|
|
38522
|
+
* the projection is derived at creation and never edited afterwards.
|
|
38523
|
+
*
|
|
38524
|
+
* And they mean DIFFERENT FACTS for the two kinds, which is the part a reader
|
|
38525
|
+
* who knows only the recording export will get wrong:
|
|
38526
|
+
*
|
|
38527
|
+
* | field | `kind:'footage'` | `kind:'clip'` |
|
|
38528
|
+
* | --- | --- | --- |
|
|
38529
|
+
* | `fromMs`/`toMs` | the stretch the operator ASKED for | the camera's own boundaries, always `clip.timeRange`, never anything a caller supplied |
|
|
38530
|
+
* | `profile` | the stream rendered | the twin actually SERVED (`subject.profile` is the one asked for) |
|
|
38531
|
+
*
|
|
38532
|
+
* Same type, different fact — the shape this repo keeps getting wrong (D385's
|
|
38533
|
+
* two authorities, D224's second copy).
|
|
38534
|
+
*/
|
|
38310
38535
|
var ExportRecordSchema = object({
|
|
38311
38536
|
id: string(),
|
|
38312
38537
|
deviceId: number(),
|
|
38313
38538
|
profile: string(),
|
|
38314
38539
|
fromMs: number(),
|
|
38315
38540
|
toMs: number(),
|
|
38541
|
+
/**
|
|
38542
|
+
* What this export IS. Optional ONLY for the rows written before D558: the
|
|
38543
|
+
* store parses every row through this schema on every read, so a required
|
|
38544
|
+
* field would make the export AUDIT — which is the whole reason rows survive
|
|
38545
|
+
* file deletion — unreadable in one release. Absence means `footage`, and
|
|
38546
|
+
* {@link exportSubjectOf} is the one place that says so.
|
|
38547
|
+
*/
|
|
38548
|
+
subject: ExportSubjectSchema.optional(),
|
|
38316
38549
|
options: ExportOptionsSchema,
|
|
38317
38550
|
state: ExportStateSchema,
|
|
38318
38551
|
/** 0–100 while rendering; null otherwise. */
|
|
@@ -38329,6 +38562,18 @@ var ExportRecordSchema = object({
|
|
|
38329
38562
|
/** Failure reason when state is 'failed'; null otherwise. */
|
|
38330
38563
|
error: string().nullable()
|
|
38331
38564
|
});
|
|
38565
|
+
_enum([
|
|
38566
|
+
"catalog-miss",
|
|
38567
|
+
"catalog-unreachable",
|
|
38568
|
+
"no-file-for-window",
|
|
38569
|
+
"clip-in-progress",
|
|
38570
|
+
"unsupported-option",
|
|
38571
|
+
"sleeping",
|
|
38572
|
+
"camera-refused",
|
|
38573
|
+
"fetch-failed",
|
|
38574
|
+
"too-large-to-transfer",
|
|
38575
|
+
"wake-expired"
|
|
38576
|
+
]);
|
|
38332
38577
|
/** Candidate download URLs (LAN first, then operator extra hosts). */
|
|
38333
38578
|
var ExportDownloadSchema = object({
|
|
38334
38579
|
url: string(),
|
|
@@ -38347,24 +38592,77 @@ var ExportBytesSchema = object({
|
|
|
38347
38592
|
name: string(),
|
|
38348
38593
|
bytes: number().int().nonnegative()
|
|
38349
38594
|
});
|
|
38595
|
+
/** Canonical `profiles[]`, falling back to the legacy singular `profile`. */
|
|
38596
|
+
function resolveExportProfiles(input) {
|
|
38597
|
+
if (input.profiles !== void 0 && input.profiles.length > 0) return [...input.profiles];
|
|
38598
|
+
if (typeof input.profile === "string" && input.profile.length > 0) return [input.profile];
|
|
38599
|
+
return [];
|
|
38600
|
+
}
|
|
38350
38601
|
var recordingExportCapability = {
|
|
38351
38602
|
name: "recording-export",
|
|
38352
38603
|
scope: "system",
|
|
38353
38604
|
mode: "singleton",
|
|
38354
38605
|
methods: {
|
|
38355
|
-
/**
|
|
38356
|
-
*
|
|
38357
|
-
*
|
|
38606
|
+
/**
|
|
38607
|
+
* Queue an export of {@link ExportSubjectSchema}.
|
|
38608
|
+
*
|
|
38609
|
+
* `kind:'footage'` — a render of `[fromMs,toMs)` for `deviceId`/`profiles`
|
|
38610
|
+
* (legacy flat input, singular `profile` included, still accepted and
|
|
38611
|
+
* rewritten). Fails fast when no footage covers the range. One job per
|
|
38612
|
+
* profile; **returns the first queued record and the others are reachable
|
|
38613
|
+
* only through `listExports`** — a defect named in D558 § 6.3 and the
|
|
38614
|
+
* reason a clip subject carries exactly ONE profile.
|
|
38615
|
+
*
|
|
38616
|
+
* `kind:'clip'` — a finished file the camera holds, validated against the
|
|
38617
|
+
* device's clip CATALOG (`videoclips.listClips`, at the subject's
|
|
38618
|
+
* `provider`) instead of the recording index, and fetched once by handle
|
|
38619
|
+
* under a bound. Its `fromMs`/`toMs` come from the catalog row and from
|
|
38620
|
+
* nowhere else; a caller supplying a range is refused.
|
|
38621
|
+
*
|
|
38622
|
+
* A clip export reuses the six {@link ExportStateSchema} members and adds
|
|
38623
|
+
* none: the viewer maps an unknown state string to `failed`, so a seventh
|
|
38624
|
+
* member renders every live export — of both kinds — as FAILED on every
|
|
38625
|
+
* installed app (D558 § 6.1, pinned by `export-state-members.spec.ts`).
|
|
38626
|
+
* `subject.kind` is what tells a surface what `rendering` means.
|
|
38627
|
+
*/
|
|
38358
38628
|
createExport: method(object({
|
|
38359
38629
|
deviceId: number(),
|
|
38360
38630
|
/** @deprecated Prefer `profiles`. Kept so timelapse/notifiers keep working. */
|
|
38361
38631
|
profile: string().optional(),
|
|
38362
38632
|
profiles: array(string()).min(1).optional(),
|
|
38363
|
-
|
|
38364
|
-
|
|
38633
|
+
/** Footage only — a clip's boundaries are the camera's. */
|
|
38634
|
+
fromMs: number().optional(),
|
|
38635
|
+
toMs: number().optional(),
|
|
38636
|
+
/** What to export. Absent means the legacy flat footage request. */
|
|
38637
|
+
subject: ExportSubjectSchema.optional(),
|
|
38365
38638
|
options: ExportOptionsSchema
|
|
38366
38639
|
}).superRefine((v, ctx) => {
|
|
38367
|
-
if (
|
|
38640
|
+
if (v.subject?.kind === "clip") {
|
|
38641
|
+
if (v.subject.deviceId !== v.deviceId) ctx.addIssue({
|
|
38642
|
+
code: ZodIssueCode.custom,
|
|
38643
|
+
message: `subject.deviceId (${v.subject.deviceId}) must equal deviceId (${v.deviceId}) — the top-level field is what per-device scope enforcement reads`,
|
|
38644
|
+
path: ["subject", "deviceId"]
|
|
38645
|
+
});
|
|
38646
|
+
if (v.fromMs !== void 0 || v.toMs !== void 0) ctx.addIssue({
|
|
38647
|
+
code: ZodIssueCode.custom,
|
|
38648
|
+
message: "a clip export asks for no time range: the camera chose the boundaries and they are read from the catalog row",
|
|
38649
|
+
path: ["fromMs"]
|
|
38650
|
+
});
|
|
38651
|
+
return;
|
|
38652
|
+
}
|
|
38653
|
+
if (v.subject?.kind === "footage" && v.subject.deviceId !== v.deviceId) ctx.addIssue({
|
|
38654
|
+
code: ZodIssueCode.custom,
|
|
38655
|
+
message: `subject.deviceId (${v.subject.deviceId}) must equal deviceId (${v.deviceId})`,
|
|
38656
|
+
path: ["subject", "deviceId"]
|
|
38657
|
+
});
|
|
38658
|
+
const fromMs = v.subject?.kind === "footage" ? v.subject.fromMs : v.fromMs;
|
|
38659
|
+
const toMs = v.subject?.kind === "footage" ? v.subject.toMs : v.toMs;
|
|
38660
|
+
if (typeof fromMs !== "number" || typeof toMs !== "number") ctx.addIssue({
|
|
38661
|
+
code: ZodIssueCode.custom,
|
|
38662
|
+
message: "a footage export needs fromMs and toMs",
|
|
38663
|
+
path: ["fromMs"]
|
|
38664
|
+
});
|
|
38665
|
+
if ((v.subject?.kind === "footage" ? [...v.subject.profiles] : resolveExportProfiles(v)).length < 1) ctx.addIssue({
|
|
38368
38666
|
code: ZodIssueCode.custom,
|
|
38369
38667
|
message: "pass profiles[] (min 1) or legacy profile",
|
|
38370
38668
|
path: ["profiles"]
|
|
@@ -47475,6 +47773,12 @@ Object.freeze({
|
|
|
47475
47773
|
addonId: null,
|
|
47476
47774
|
access: "view"
|
|
47477
47775
|
},
|
|
47776
|
+
"videoclips.readClipBytes": {
|
|
47777
|
+
capName: "videoclips",
|
|
47778
|
+
capScope: "device",
|
|
47779
|
+
addonId: null,
|
|
47780
|
+
access: "view"
|
|
47781
|
+
},
|
|
47478
47782
|
"viewerUi.getStaticDir": {
|
|
47479
47783
|
capName: "viewer-ui",
|
|
47480
47784
|
capScope: "system",
|
|
@@ -49493,6 +49797,11 @@ Object.freeze({
|
|
|
49493
49797
|
form: "single",
|
|
49494
49798
|
optional: false
|
|
49495
49799
|
}],
|
|
49800
|
+
"videoclips.readClipBytes": [{
|
|
49801
|
+
name: "deviceId",
|
|
49802
|
+
form: "single",
|
|
49803
|
+
optional: false
|
|
49804
|
+
}],
|
|
49496
49805
|
"waterHeater.setAway": [{
|
|
49497
49806
|
name: "deviceId",
|
|
49498
49807
|
form: "single",
|