@camstack/addon-provider-hikvision 1.2.16 → 1.2.17
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 +643 -36
- package/dist/addon.mjs +643 -36
- package/package.json +1 -1
package/dist/addon.mjs
CHANGED
|
@@ -7201,8 +7201,31 @@ var AdoptionJobSchema = object({
|
|
|
7201
7201
|
error: string().nullable()
|
|
7202
7202
|
});
|
|
7203
7203
|
/**
|
|
7204
|
-
* Per-camera FUNCTION SWITCHES
|
|
7205
|
-
*
|
|
7204
|
+
* Per-camera FUNCTION SWITCHES.
|
|
7205
|
+
*
|
|
7206
|
+
* ## The aggregate group is being withdrawn — the BADGE is not (D113)
|
|
7207
|
+
*
|
|
7208
|
+
* This file shipped as "the one coherent on/off surface over the pipeline
|
|
7209
|
+
* functions an operator thinks in terms of". The operator's verdict on
|
|
7210
|
+
* 2026-08-12 was that the coherent surface bought complexity and no clarity:
|
|
7211
|
+
* every function already had a settings page of its own, and a second place to
|
|
7212
|
+
* turn it off is a second place to look. Each switch is going back to its own
|
|
7213
|
+
* component's original options — detection to the detection-pipeline wrapper
|
|
7214
|
+
* binding, audio analysis to its own, recording to `RecordingConfig.enabled`
|
|
7215
|
+
* (which was always first-class; the switch was a veneer over
|
|
7216
|
+
* `recording.setDeviceConfig`), notifications to a notification-center
|
|
7217
|
+
* per-device setting, the two camera planes to their own components.
|
|
7218
|
+
*
|
|
7219
|
+
* What survives is {@link composeSwitchedOff}: `CameraStatus.switchedOff`, the
|
|
7220
|
+
* thing that lets a status surface say DISABLED instead of BROKEN, recomposed
|
|
7221
|
+
* straight from the authorities with no group in the middle. That rule was
|
|
7222
|
+
* never about a control panel.
|
|
7223
|
+
*
|
|
7224
|
+
* Everything else here — {@link CAMERA_SWITCH_CATALOG}, {@link CameraSwitch},
|
|
7225
|
+
* {@link deriveCameraSwitches}, the `pipelineOrchestrator.getCameraSwitches` /
|
|
7226
|
+
* `setCameraSwitch` pair — is a COMPATIBILITY surface for as long as deployed
|
|
7227
|
+
* viewers (v1.0.305) and the admin UI still call it. It is deleted when they
|
|
7228
|
+
* stop; nothing new may be built on it.
|
|
7206
7229
|
*
|
|
7207
7230
|
* ## This file adds no state
|
|
7208
7231
|
*
|
|
@@ -7553,7 +7576,15 @@ var RecordingConfigSchema = object({
|
|
|
7553
7576
|
* Each completed/failed run also lands one durable ops-log row on its owning
|
|
7554
7577
|
* addon surface.
|
|
7555
7578
|
*/
|
|
7579
|
+
/**
|
|
7580
|
+
* `queued` exists because the recorder mover is SINGLE-FLIGHT and an operator
|
|
7581
|
+
* rebalance enqueues one job per (camera, profile). Refusing the second job —
|
|
7582
|
+
* what the engine did before — turned a fifteen-camera rebalance into fifteen
|
|
7583
|
+
* manual retries. Queued jobs run FIFO; a queued job that is cancelled never
|
|
7584
|
+
* runs at all.
|
|
7585
|
+
*/
|
|
7556
7586
|
var RelocateJobStateSchema = _enum([
|
|
7587
|
+
"queued",
|
|
7557
7588
|
"running",
|
|
7558
7589
|
"done",
|
|
7559
7590
|
"failed",
|
|
@@ -7588,6 +7619,15 @@ var RelocateFootageInputSchema = object({
|
|
|
7588
7619
|
/** Limits relocation to the logical profile class. Omit only for the
|
|
7589
7620
|
* pre-orchestration compatibility path. */
|
|
7590
7621
|
footageClass: RelocateFootageClassSchema.optional(),
|
|
7622
|
+
/** Scope the move to ONE camera. Absent = every camera on the source, which
|
|
7623
|
+
* is what a whole-disk drain means. The rebalance path always sets it: its
|
|
7624
|
+
* unit is a (camera, profile) pile, not a disk. */
|
|
7625
|
+
deviceId: number().int().optional(),
|
|
7626
|
+
/** Scope the move to specific segment profiles (`high` / `mid` / `low`).
|
|
7627
|
+
* Finer than `footageClass`, which cannot separate high from mid — and the
|
|
7628
|
+
* placement plan assigns those two independently, so a rebalance that could
|
|
7629
|
+
* only say "recordings" would move footage the plan never asked to move. */
|
|
7630
|
+
profiles: array(string()).optional(),
|
|
7591
7631
|
/** Copy throttle in MB/s (default 40) — the drain is a background chore,
|
|
7592
7632
|
* never allowed to starve live writers. */
|
|
7593
7633
|
throttleMbps: number().min(1).max(1e3).optional()
|
|
@@ -7723,6 +7763,21 @@ var StorageLocationSchema = object({
|
|
|
7723
7763
|
nodeId: string().optional(),
|
|
7724
7764
|
isDefault: boolean().default(false),
|
|
7725
7765
|
isSystem: boolean().default(false),
|
|
7766
|
+
/**
|
|
7767
|
+
* Operator opt-in: whether consumers that BALANCE across several locations
|
|
7768
|
+
* of a type may write here. Recordings reads it today; event media and
|
|
7769
|
+
* backups are the next consumers, which is why the flag lives on the
|
|
7770
|
+
* location rather than in any one addon's store — nothing has to be
|
|
7771
|
+
* extended to add the next consumer.
|
|
7772
|
+
*
|
|
7773
|
+
* OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
|
|
7774
|
+
* flag existed reads back with no flag and keeps working exactly as before;
|
|
7775
|
+
* that is the whole compat story, and it is why no migration ships with it.
|
|
7776
|
+
* A newly CREATED sibling is stamped `false` by the orchestrator (creating a
|
|
7777
|
+
* disk must not silently start writing to it); the default of a type is
|
|
7778
|
+
* always stamped `true`.
|
|
7779
|
+
*/
|
|
7780
|
+
enabled: boolean().optional(),
|
|
7726
7781
|
/** COMPUTED at read time by the orchestrator (statfs of the backing volume
|
|
7727
7782
|
* for node-local locations it can reach) — never persisted, absent when the
|
|
7728
7783
|
* volume is remote/unreachable. The single capacity truth every UI reads. */
|
|
@@ -12462,7 +12517,8 @@ method(object({
|
|
|
12462
12517
|
}), EmbeddingResultSchema), method(object({ text: string() }), EmbeddingResultSchema), method(_void(), EmbeddingInfoSchema);
|
|
12463
12518
|
/**
|
|
12464
12519
|
* filesystem-browse — per-node capability for browsing the node's local
|
|
12465
|
-
* filesystem
|
|
12520
|
+
* filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
|
|
12521
|
+
* are sandboxed to operator-configured allowed roots (D115). Used by the
|
|
12466
12522
|
* admin "Add filesystem location" flow to pick a node + path. `mode:'per-node'`
|
|
12467
12523
|
* (one provider per node); the hub calls it with `{nodeId}` so the codegen
|
|
12468
12524
|
* routes to that exact node (default `nodeIdMode:'routing'`).
|
|
@@ -14303,6 +14359,13 @@ var MaskGridDimsSchema = object({
|
|
|
14303
14359
|
* `package-event` are pure trigger kinds (no urgency dimension). Extending
|
|
14304
14360
|
* this one field keeps the schema additive — a rule still declares exactly
|
|
14305
14361
|
* one trigger.
|
|
14362
|
+
*
|
|
14363
|
+
* AUDIO rules add no member here, for the reason occupancy added none: the
|
|
14364
|
+
* enum is mirrored by hand in the viewer (`scripts/check-viewer-condition-
|
|
14365
|
+
* mirror.ts` fails the build on a member the app cannot render) and every
|
|
14366
|
+
* member costs a release train. A sustained-sound rule is therefore an
|
|
14367
|
+
* `immediate` rule carrying {@link NcConditions.audio} — the condition is the
|
|
14368
|
+
* trigger discriminator, exactly as `occupancy` is on `device-event`.
|
|
14306
14369
|
*/
|
|
14307
14370
|
var NcDeliverySchema = _enum([
|
|
14308
14371
|
"immediate",
|
|
@@ -14317,15 +14380,32 @@ var NcDeliverySchema = _enum([
|
|
|
14317
14380
|
* depend on a provider's raw event name or payload shape.
|
|
14318
14381
|
*/
|
|
14319
14382
|
var NcSystemEventKindSchema = _enum([
|
|
14320
|
-
"
|
|
14321
|
-
"
|
|
14383
|
+
"device-online",
|
|
14384
|
+
"device-offline",
|
|
14385
|
+
"device-disabled",
|
|
14386
|
+
"device-enabled",
|
|
14322
14387
|
"stream-online",
|
|
14323
14388
|
"stream-offline",
|
|
14324
14389
|
"node-online",
|
|
14325
14390
|
"node-offline",
|
|
14326
14391
|
"addon-update-available",
|
|
14327
|
-
"server-update-available"
|
|
14392
|
+
"server-update-available",
|
|
14393
|
+
"alarm-triggered",
|
|
14394
|
+
"alarm-armed",
|
|
14395
|
+
"alarm-disarmed",
|
|
14396
|
+
"camera-online",
|
|
14397
|
+
"camera-offline",
|
|
14398
|
+
"camera-disabled",
|
|
14399
|
+
"camera-enabled"
|
|
14400
|
+
]);
|
|
14401
|
+
/** The legacy tail of {@link NcSystemEventKindSchema} — see its docblock. */
|
|
14402
|
+
var NC_LEGACY_SYSTEM_EVENT_KINDS = new Set([
|
|
14403
|
+
"camera-online",
|
|
14404
|
+
"camera-offline",
|
|
14405
|
+
"camera-disabled",
|
|
14406
|
+
"camera-enabled"
|
|
14328
14407
|
]);
|
|
14408
|
+
NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
|
|
14329
14409
|
/**
|
|
14330
14410
|
* One coherent system-event condition. `kinds` is the required opt-in safety
|
|
14331
14411
|
* gate; the remaining lists are optional narrowing filters relevant to the
|
|
@@ -14334,6 +14414,18 @@ var NcSystemEventKindSchema = _enum([
|
|
|
14334
14414
|
var NcSystemEventConditionSchema = object({
|
|
14335
14415
|
kinds: array(NcSystemEventKindSchema).min(1),
|
|
14336
14416
|
deviceIds: array(number().int()).min(1).optional(),
|
|
14417
|
+
/**
|
|
14418
|
+
* Narrow a `device-*` kind to these device TYPES (`DeviceType` values —
|
|
14419
|
+
* `camera`, `switch`, `sensor`, `container`, …). Absent = every type, which
|
|
14420
|
+
* is what a liveness rule means when nobody said otherwise.
|
|
14421
|
+
*
|
|
14422
|
+
* This is where "only my cameras" is expressed, and it lives on the rule for
|
|
14423
|
+
* one reason: the intake cannot know which devices this household cares
|
|
14424
|
+
* about, and a producer-side filter is one no operator can change. Fails
|
|
14425
|
+
* CLOSED — a subject whose device type is unknown (an id the device mirror
|
|
14426
|
+
* does not carry) matches no `deviceTypes` list.
|
|
14427
|
+
*/
|
|
14428
|
+
deviceTypes: array(string().min(1)).min(1).optional(),
|
|
14337
14429
|
nodeIds: array(string().min(1)).min(1).optional(),
|
|
14338
14430
|
packageNames: array(string().min(1)).min(1).optional()
|
|
14339
14431
|
});
|
|
@@ -14384,6 +14476,47 @@ var NcOccupancyConditionSchema = object({
|
|
|
14384
14476
|
sustainSeconds: number().int().min(0).max(3600).default(15)
|
|
14385
14477
|
});
|
|
14386
14478
|
/**
|
|
14479
|
+
* Audio condition (IMMEDIATE trigger) — a rule on SOUND, not on a picture.
|
|
14480
|
+
*
|
|
14481
|
+
* Operator-approved vocabulary (2026-08-12, option A — the same one the
|
|
14482
|
+
* reference notifier uses, so an operator moving between them re-uses what
|
|
14483
|
+
* they already know): a rule matches when, over a sampling window of
|
|
14484
|
+
* `samplingSeconds`, at least `hitPercent`% of the audio samples in that
|
|
14485
|
+
* window are HITS. A sample is a hit when it satisfies BOTH present filters:
|
|
14486
|
+
*
|
|
14487
|
+
* - `dbThreshold` — its level is at or above this many dBFS (see
|
|
14488
|
+
* {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale);
|
|
14489
|
+
* - `labels` — the classifier put at least one of these labels on it.
|
|
14490
|
+
*
|
|
14491
|
+
* Both are OPTIONAL and independent, which is the point of the shape: a
|
|
14492
|
+
* loudness rule ("something loud at 3am") needs no model to be right, and a
|
|
14493
|
+
* label rule ("a dog barked") needs no threshold. **Fail-closed when NEITHER
|
|
14494
|
+
* is given** — a window in which every sample is trivially a hit would fire on
|
|
14495
|
+
* silence, so the engine refuses such a condition rather than notifying on
|
|
14496
|
+
* nothing (the schema cannot express "at least one of" without becoming a
|
|
14497
|
+
* ZodEffects the cap path would have to special-case).
|
|
14498
|
+
*
|
|
14499
|
+
* `hitPercent` is over the samples the window actually HOLDS, and the window
|
|
14500
|
+
* must be FULL before it can match — a window that has been open for two
|
|
14501
|
+
* seconds of its ten is 100% of nothing, and firing on it would make
|
|
14502
|
+
* `samplingSeconds` decorative.
|
|
14503
|
+
*
|
|
14504
|
+
* Labels are the audio macro classes (`AUDIO_MACRO_LABELS` / the NC taxonomy's
|
|
14505
|
+
* `audio-*` ids). Both spellings are accepted — the matcher normalizes the
|
|
14506
|
+
* `audio-` prefix away on both sides, so a picker that offers taxonomy ids and
|
|
14507
|
+
* an operator who typed `dog` mean the same thing.
|
|
14508
|
+
*/
|
|
14509
|
+
var NcAudioConditionSchema = object({
|
|
14510
|
+
/** Audio macro labels; absent = any sound (level-only rule). */
|
|
14511
|
+
labels: array(string().min(1)).min(1).optional(),
|
|
14512
|
+
/** Level floor in dBFS (negative-going, `0` = full scale); absent = any level. */
|
|
14513
|
+
dbThreshold: number().min(-96).max(0).optional(),
|
|
14514
|
+
/** Percentage of the window's samples that must be hits (1–100). */
|
|
14515
|
+
hitPercent: number().int().min(1).max(100).default(60),
|
|
14516
|
+
/** Length of the sampling window in seconds. */
|
|
14517
|
+
samplingSeconds: number().int().min(1).max(300).default(10)
|
|
14518
|
+
});
|
|
14519
|
+
/**
|
|
14387
14520
|
* Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
|
|
14388
14521
|
*
|
|
14389
14522
|
* The values are not symmetric, and deliberately so — the absent value has to
|
|
@@ -14656,7 +14789,33 @@ var NcConditionsSchema = object({
|
|
|
14656
14789
|
* threshold and holds for `sustainSeconds`. Fail-closed on missing
|
|
14657
14790
|
* substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
|
|
14658
14791
|
*/
|
|
14659
|
-
occupancy: NcOccupancyConditionSchema.optional()
|
|
14792
|
+
occupancy: NcOccupancyConditionSchema.optional(),
|
|
14793
|
+
/**
|
|
14794
|
+
* IMMEDIATE only. Sustained-sound matcher — `hitPercent` of the samples in a
|
|
14795
|
+
* `samplingSeconds` window clear the optional `dbThreshold` and carry one of
|
|
14796
|
+
* the optional `labels`. Fail-closed on missing substrate (no audio samples,
|
|
14797
|
+
* a window that is not full yet, neither filter given). See
|
|
14798
|
+
* {@link NcAudioCondition}.
|
|
14799
|
+
*
|
|
14800
|
+
* Presence of this key is what makes a rule an AUDIO rule: the engine fires
|
|
14801
|
+
* it ONLY on a confirmed audio window, and a rule carrying it never fires on
|
|
14802
|
+
* a detection, a track or a device event (the same fail-closed pairing
|
|
14803
|
+
* `occupancy` has with the `device-event` trigger). That is how audio labels
|
|
14804
|
+
* leave `classes`: an audio rule names its sounds HERE, and the legacy path
|
|
14805
|
+
* (an `immediate` rule naming an `audio-*` class, one notification per
|
|
14806
|
+
* classified sample) stays exactly as it was for rules that already use it.
|
|
14807
|
+
*
|
|
14808
|
+
* NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
|
|
14809
|
+
* rather than an oversight: the viewer mirrors the descriptor enums BY HAND
|
|
14810
|
+
* (`camstack/src/data/notification-center.ts`, guarded by
|
|
14811
|
+
* `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
|
|
14812
|
+
* condition fields it does not know when a rule is saved from the phone.
|
|
14813
|
+
* Publishing an editor for a condition the app cannot round-trip is how an
|
|
14814
|
+
* operator loses a rule's conditions by opening it — so the descriptor, the
|
|
14815
|
+
* admin widget and the viewer mirror land together (P2 + P3), and only then
|
|
14816
|
+
* does an audio rule become authorable.
|
|
14817
|
+
*/
|
|
14818
|
+
audio: NcAudioConditionSchema.optional()
|
|
14660
14819
|
});
|
|
14661
14820
|
/** One delivery target: a `notification-output` Target ref + passthrough params. */
|
|
14662
14821
|
var NcRuleTargetSchema = object({
|
|
@@ -14770,6 +14929,73 @@ var NcThrottleSchema = object({
|
|
|
14770
14929
|
*/
|
|
14771
14930
|
granularity: NcThrottleGranularitySchema.optional()
|
|
14772
14931
|
});
|
|
14932
|
+
/**
|
|
14933
|
+
* How long the confirm gate may hold ONE notification, and how big the picture
|
|
14934
|
+
* it judges may be.
|
|
14935
|
+
*
|
|
14936
|
+
* The clamp is the product decision, not a coincidence of the model: p50 was
|
|
14937
|
+
* 4.9 s warm and 15.3 s cold against qwen3-vl-8b, and a notification that
|
|
14938
|
+
* arrives after the visitor has gone is not a notification. 448 px was enough
|
|
14939
|
+
* to score 16/16 on the operator's parking scenario — bigger costs latency and
|
|
14940
|
+
* tokens for pixels the model pools away.
|
|
14941
|
+
*/
|
|
14942
|
+
var NC_CONFIRM_MIN_TIMEOUT_MS = 1e3;
|
|
14943
|
+
var NC_CONFIRM_MAX_TIMEOUT_MS = 2e4;
|
|
14944
|
+
var NC_CONFIRM_DEFAULT_TIMEOUT_MS = 8e3;
|
|
14945
|
+
/** Comparison the model's COUNT must satisfy for the notification to fire. */
|
|
14946
|
+
var NcConfirmExpectSchema = object({
|
|
14947
|
+
op: _enum([
|
|
14948
|
+
">=",
|
|
14949
|
+
">",
|
|
14950
|
+
"<=",
|
|
14951
|
+
"<",
|
|
14952
|
+
"=="
|
|
14953
|
+
]),
|
|
14954
|
+
count: number().int().min(0).max(1e3)
|
|
14955
|
+
});
|
|
14956
|
+
/**
|
|
14957
|
+
* AI CONFIRM — a vision model looks at the picture this notification is about
|
|
14958
|
+
* to ship and says whether it agrees with the rule.
|
|
14959
|
+
*
|
|
14960
|
+
* It runs AFTER the attachments resolve, deliberately: the crop JUDGED is the
|
|
14961
|
+
* crop SHIPPED (D52). A verdict about a different pixel rectangle than the one
|
|
14962
|
+
* on the operator's phone is not a verdict about this notification.
|
|
14963
|
+
*
|
|
14964
|
+
* FAIL-OPEN is the only safe default. A gate that cannot reach its model, or
|
|
14965
|
+
* whose model is cold, must not silence a camera — so `onTimeout: 'fire'` is
|
|
14966
|
+
* the default and every fail-open is COUNTED, because a gate that always fails
|
|
14967
|
+
* open looks in the log exactly like a gate that works.
|
|
14968
|
+
*
|
|
14969
|
+
* Every field is `.optional()` rather than relied on as a Zod default at the
|
|
14970
|
+
* runtime seam: a Zod default does NOT run on the addon→addon cap path (three
|
|
14971
|
+
* production failures in one day), so the gate reads absent as the constant
|
|
14972
|
+
* above rather than trusting a parse it may never have seen.
|
|
14973
|
+
*/
|
|
14974
|
+
var NcConfirmSchema = object({
|
|
14975
|
+
/** Off unless asked for. An absent `confirm` and `enabled:false` are the
|
|
14976
|
+
* same thing, and both mean "deliver exactly as before". */
|
|
14977
|
+
enabled: boolean().default(false),
|
|
14978
|
+
/** Explicit vision profile; absent = the `purpose:'vision'` cluster default. */
|
|
14979
|
+
profileId: string().optional(),
|
|
14980
|
+
/**
|
|
14981
|
+
* The operator's question, in his own words. Absent = a question derived
|
|
14982
|
+
* from the rule (its class and its expectation).
|
|
14983
|
+
*
|
|
14984
|
+
* NEVER composed with text READ OUT OF THE FRAME. The model reads OSD
|
|
14985
|
+
* banners, signage and plates as instructions if you let them reach the
|
|
14986
|
+
* prompt — proven live — so the authoritative contract stays in the system
|
|
14987
|
+
* turn and only rule-authored words land here.
|
|
14988
|
+
*/
|
|
14989
|
+
prompt: string().max(1e3).optional(),
|
|
14990
|
+
/** Fire only when the model's count satisfies this. Absent = the model's
|
|
14991
|
+
* own boolean verdict decides. */
|
|
14992
|
+
expect: NcConfirmExpectSchema.optional(),
|
|
14993
|
+
timeoutMs: number().int().min(NC_CONFIRM_MIN_TIMEOUT_MS).max(NC_CONFIRM_MAX_TIMEOUT_MS).default(NC_CONFIRM_DEFAULT_TIMEOUT_MS),
|
|
14994
|
+
/** What a timeout / unreachable model MEANS. `fire` (default) = fail-open. */
|
|
14995
|
+
onTimeout: _enum(["fire", "suppress"]).default("fire"),
|
|
14996
|
+
/** Longest edge the judged image is downscaled to before it is sent. */
|
|
14997
|
+
maxImagePx: number().int().min(64).max(2048).default(448)
|
|
14998
|
+
});
|
|
14773
14999
|
/** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
|
|
14774
15000
|
var NcRuleInputSchema = object({
|
|
14775
15001
|
name: string().min(1).max(200),
|
|
@@ -14830,7 +15056,13 @@ var NcRuleInputSchema = object({
|
|
|
14830
15056
|
* `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
|
|
14831
15057
|
* shape as every other actuation.
|
|
14832
15058
|
*/
|
|
14833
|
-
actions: NcRuleActionsSchema.optional()
|
|
15059
|
+
actions: NcRuleActionsSchema.optional(),
|
|
15060
|
+
/**
|
|
15061
|
+
* AI CONFIRM — see {@link NcConfirmSchema}. `.optional()`, never defaulted:
|
|
15062
|
+
* a rule that predates the gate must keep delivering byte-for-byte as it
|
|
15063
|
+
* did, and absent is the only way to say that without a migration.
|
|
15064
|
+
*/
|
|
15065
|
+
confirm: NcConfirmSchema.optional()
|
|
14834
15066
|
});
|
|
14835
15067
|
/**
|
|
14836
15068
|
* Partial patch for `updateRule` — any subset of the input fields, plus the
|
|
@@ -14841,7 +15073,37 @@ var NcRuleInputSchema = object({
|
|
|
14841
15073
|
* still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
|
|
14842
15074
|
* `updateRule` patch.
|
|
14843
15075
|
*/
|
|
14844
|
-
var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
|
|
15076
|
+
var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
|
|
15077
|
+
disabledTargetIds: array(string()).optional(),
|
|
15078
|
+
/**
|
|
15079
|
+
* `.partial()` DOES NOT REMOVE A FIELD'S `.default()`.
|
|
15080
|
+
*
|
|
15081
|
+
* It makes the key optional to SUPPLY; the parse still materialises the
|
|
15082
|
+
* default when the key is absent. And `NcRuleStore.update` merges with
|
|
15083
|
+
* `{ ...existing, ...patch }`, so a materialised key OVERWRITES the stored
|
|
15084
|
+
* one — which made every partial edit destructive:
|
|
15085
|
+
*
|
|
15086
|
+
* nc.updateRule({ throttle }) → conditions reset to `{}`
|
|
15087
|
+
* nc.setRuleTargetEnabled(...) → conditions reset to `{}`
|
|
15088
|
+
* setEnabled(ruleId, false) → conditions reset to `{}`
|
|
15089
|
+
*
|
|
15090
|
+
* A rule scoped to one camera and one zone silently became a rule that
|
|
15091
|
+
* matches EVERY event on EVERY camera, and lost its `media` policy
|
|
15092
|
+
* (zoneCrop / gif / clip / frame) and its `priority` at the same time. Seen
|
|
15093
|
+
* live on 2026-08-12: a rule scoped to device 617 fired on 590 and 615
|
|
15094
|
+
* within a minute of a two-field patch.
|
|
15095
|
+
*
|
|
15096
|
+
* So every defaulted field is re-declared here WITHOUT its default. The
|
|
15097
|
+
* inner defaults still apply when the caller DOES send the key — `{}` for
|
|
15098
|
+
* conditions remains a real instruction ("clear them") — and only the
|
|
15099
|
+
* absent key is now genuinely absent.
|
|
15100
|
+
*/
|
|
15101
|
+
enabled: boolean().optional(),
|
|
15102
|
+
conditions: NcConditionsSchema.optional(),
|
|
15103
|
+
media: NcMediaPolicySchema.optional(),
|
|
15104
|
+
throttle: NcThrottleSchema.optional(),
|
|
15105
|
+
priority: number().int().min(1).max(5).optional()
|
|
15106
|
+
});
|
|
14845
15107
|
/** A persisted rule. */
|
|
14846
15108
|
var NcRuleSchema = NcRuleInputSchema.extend({
|
|
14847
15109
|
id: string(),
|
|
@@ -15142,6 +15404,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
|
|
|
15142
15404
|
* Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
|
|
15143
15405
|
* copy would lie the first time a rule is disabled.
|
|
15144
15406
|
*/
|
|
15407
|
+
/**
|
|
15408
|
+
* Why a device a mode NAMES is nonetheless not armed by it.
|
|
15409
|
+
*
|
|
15410
|
+
* Each value is an existing authority, never a new flag (D62): `muted` is the
|
|
15411
|
+
* per-camera notification switch the Notification Center already owns,
|
|
15412
|
+
* `detection-off` is the device's own detection binding being inactive, and
|
|
15413
|
+
* `offline` is the device manager's liveness. A fourth reason would mean a
|
|
15414
|
+
* fourth authority, and inventing one here is how a panel starts disagreeing
|
|
15415
|
+
* with the switches the operator actually used.
|
|
15416
|
+
*/
|
|
15417
|
+
var NcAlarmSkipReasonSchema = _enum([
|
|
15418
|
+
"muted",
|
|
15419
|
+
"detection-off",
|
|
15420
|
+
"offline"
|
|
15421
|
+
]);
|
|
15422
|
+
var NcAlarmSkippedDeviceSchema = object({
|
|
15423
|
+
deviceId: number().int(),
|
|
15424
|
+
reason: NcAlarmSkipReasonSchema
|
|
15425
|
+
});
|
|
15145
15426
|
var NcAlarmModeCoverageSchema = object({
|
|
15146
15427
|
mode: AlarmArmModeSchema,
|
|
15147
15428
|
/** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
|
|
@@ -15149,7 +15430,18 @@ var NcAlarmModeCoverageSchema = object({
|
|
|
15149
15430
|
/** At least one covering rule has no device scope, so the mode covers all. */
|
|
15150
15431
|
allDevices: boolean(),
|
|
15151
15432
|
/** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
|
|
15152
|
-
deviceIds: array(number().int())
|
|
15433
|
+
deviceIds: array(number().int()),
|
|
15434
|
+
/**
|
|
15435
|
+
* Devices this mode NAMES but cannot actually arm, each with the switch that
|
|
15436
|
+
* excludes it.
|
|
15437
|
+
*
|
|
15438
|
+
* "Away armed — 12 cameras" is a promise, and a muted camera among those
|
|
15439
|
+
* twelve makes it false in exactly the way nobody notices until an incident.
|
|
15440
|
+
* Defaulted to `[]` so a coverage answer computed before this field existed
|
|
15441
|
+
* still parses as "nothing known to be skipped" rather than failing the whole
|
|
15442
|
+
* alarm tab.
|
|
15443
|
+
*/
|
|
15444
|
+
skippedDevices: array(NcAlarmSkippedDeviceSchema).default([])
|
|
15153
15445
|
});
|
|
15154
15446
|
var NcAlarmConfigSchema = object({
|
|
15155
15447
|
/**
|
|
@@ -17981,9 +18273,16 @@ var CameraStatusSchema = object({
|
|
|
17981
18273
|
audio: CameraAudioStatusSchema.nullable(),
|
|
17982
18274
|
recording: CameraRecordingStatusSchema.nullable(),
|
|
17983
18275
|
/**
|
|
17984
|
-
* Per-camera
|
|
18276
|
+
* Per-camera functions an OPERATOR has turned off
|
|
17985
18277
|
* ([D61](../../../../docs/decisions/adr-0067.md)).
|
|
17986
18278
|
*
|
|
18279
|
+
* Composed from the AUTHORITIES themselves — the wrapper bindings,
|
|
18280
|
+
* `RecordingConfig.enabled`, the notification mute, the broker's audio
|
|
18281
|
+
* policy, the camera's own microphone — via `composeSwitchedOff`, not from
|
|
18282
|
+
* the deprecated `getCameraSwitches` group ([D113](../../../../docs/decisions/adr-0113.md)).
|
|
18283
|
+
* The badge outlives the control panel: the panel was a convenience, this is
|
|
18284
|
+
* the difference between a camera being off and a camera being dead.
|
|
18285
|
+
*
|
|
17987
18286
|
* This is the difference between DISABLED and BROKEN. A camera whose
|
|
17988
18287
|
* `detection` block reports zero fps and whose `switchedOff` contains
|
|
17989
18288
|
* `'object-detection'` was switched off by a person; the same camera with an
|
|
@@ -18590,24 +18889,28 @@ var snapshotCapability = {
|
|
|
18590
18889
|
*
|
|
18591
18890
|
* `getSnapshotOverview` is cache-only by contract: it answers from whatever
|
|
18592
18891
|
* the wrapper happens to hold and never captures. Under D93 the client
|
|
18593
|
-
* versions its image URL on that answer, and an image REQUEST
|
|
18594
|
-
*
|
|
18595
|
-
*
|
|
18596
|
-
*
|
|
18597
|
-
*
|
|
18598
|
-
*
|
|
18599
|
-
*
|
|
18600
|
-
*
|
|
18892
|
+
* versions its image URL on that answer, and an image REQUEST was the only
|
|
18893
|
+
* demand signal. Both of those are satisfiable by the client's own image
|
|
18894
|
+
* cache — `expo-image` is URL-keyed and never revalidates — so a URL painted
|
|
18895
|
+
* in a previous session comes off disk with no network, no demand, and no
|
|
18896
|
+
* capture. Measured on the live hub: reopening after two minutes idle
|
|
18897
|
+
* painted 15 of 16 tiles at **168 s old** with zero HTTP requests, and the
|
|
18898
|
+
* fleet only recovered because a later poll happened to observe a different
|
|
18899
|
+
* identity.
|
|
18601
18900
|
*
|
|
18602
18901
|
* ## The two properties that fix it
|
|
18603
18902
|
*
|
|
18604
18903
|
* **It is an RPC, so no client cache can answer it.** The demand signal
|
|
18605
|
-
* always reaches the wrapper. This method therefore
|
|
18606
|
-
*
|
|
18607
|
-
*
|
|
18608
|
-
*
|
|
18609
|
-
*
|
|
18610
|
-
*
|
|
18904
|
+
* always reaches the wrapper. This method therefore CAPTURES, where
|
|
18905
|
+
* `getSnapshotOverview` must never (D93) — the distinction is not "one is
|
|
18906
|
+
* newer" but that the overview poll is app-wide (a capturing overview would
|
|
18907
|
+
* dial every camera on the install) while this is called by a rendered
|
|
18908
|
+
* surface naming the tiles it is actually painting, at the width it is
|
|
18909
|
+
* painting them.
|
|
18910
|
+
*
|
|
18911
|
+
* Since 2026-08-11 this is the ONLY thing that refreshes a snapshot: the
|
|
18912
|
+
* server-side keep-warm loop was removed (operator directive — on-demand,
|
|
18913
|
+
* always), so a camera nobody is looking at costs nothing at all.
|
|
18611
18914
|
*
|
|
18612
18915
|
* **It waits, briefly and boundedly, for the capture it triggered.** The
|
|
18613
18916
|
* returned `capturedAt` is the frame the link will serve, not the frame the
|
|
@@ -25000,7 +25303,19 @@ var RecordingManifestSchema = object({
|
|
|
25000
25303
|
* profiles/subtrees/locations on this node). */
|
|
25001
25304
|
var RecordingDeviceUsageSchema = object({
|
|
25002
25305
|
deviceId: number(),
|
|
25003
|
-
usedBytes: number()
|
|
25306
|
+
usedBytes: number(),
|
|
25307
|
+
/**
|
|
25308
|
+
* Start of this camera's OLDEST indexed segment, across every profile and
|
|
25309
|
+
* location — the "Oldest footage" column in Recordings → Storage, and the
|
|
25310
|
+
* only honest answer to "is retention actually holding?" per camera.
|
|
25311
|
+
*
|
|
25312
|
+
* `null` = the camera has no footage. OPTIONAL because a recorder that
|
|
25313
|
+
* predates this field omits it entirely, and a hub whose types carry the
|
|
25314
|
+
* field must keep validating that older provider's payload: the framework
|
|
25315
|
+
* (types) and the addon ship on different trains, and the addon is usually
|
|
25316
|
+
* the later of the two.
|
|
25317
|
+
*/
|
|
25318
|
+
oldestMs: number().nullable().optional()
|
|
25004
25319
|
});
|
|
25005
25320
|
/** Recording storage usage + capacity for one storage location. */
|
|
25006
25321
|
var RecordingLocationUsageSchema = object({
|
|
@@ -25028,6 +25343,57 @@ var RecordingStorageUsageSchema = object({
|
|
|
25028
25343
|
locations: array(RecordingLocationUsageSchema)
|
|
25029
25344
|
});
|
|
25030
25345
|
/**
|
|
25346
|
+
* The OPERATOR-ARMED half of multi-location recordings (D116).
|
|
25347
|
+
*
|
|
25348
|
+
* The placement plan decides where NEW writes go and moves nothing. A rebalance
|
|
25349
|
+
* is the operator asking for the EXISTING archive to be brought into line with
|
|
25350
|
+
* that plan: one relocate job per (camera, profile) pile that sits on the wrong
|
|
25351
|
+
* location, run FIFO behind the single-flight mover.
|
|
25352
|
+
*
|
|
25353
|
+
* `plan…` and `start…` return the SAME shape deliberately — what the operator
|
|
25354
|
+
* confirms is exactly what gets enqueued, and `jobIds` is the only difference
|
|
25355
|
+
* (empty on the plan).
|
|
25356
|
+
*/
|
|
25357
|
+
var RecordingRebalanceMoveSchema = object({
|
|
25358
|
+
deviceId: number(),
|
|
25359
|
+
profile: string(),
|
|
25360
|
+
fromLocationId: string(),
|
|
25361
|
+
toLocationId: string(),
|
|
25362
|
+
bytes: number(),
|
|
25363
|
+
files: number().int()
|
|
25364
|
+
});
|
|
25365
|
+
/** Why a pile that is out of place is staying there. Every refusal is
|
|
25366
|
+
* reported: a rebalance that silently drops a camera reads exactly like one
|
|
25367
|
+
* that had nothing to do. */
|
|
25368
|
+
var RecordingRebalanceSkipReasonSchema = _enum([
|
|
25369
|
+
"unassigned",
|
|
25370
|
+
"target-not-writable",
|
|
25371
|
+
"below-threshold",
|
|
25372
|
+
"no-headroom"
|
|
25373
|
+
]);
|
|
25374
|
+
var RecordingRebalanceSkipSchema = object({
|
|
25375
|
+
deviceId: number(),
|
|
25376
|
+
profile: string(),
|
|
25377
|
+
fromLocationId: string(),
|
|
25378
|
+
/** The location the plan wants; null when the camera has no assignment. */
|
|
25379
|
+
toLocationId: string().nullable(),
|
|
25380
|
+
bytes: number(),
|
|
25381
|
+
reason: RecordingRebalanceSkipReasonSchema
|
|
25382
|
+
});
|
|
25383
|
+
var RecordingRebalancePlanSchema = object({
|
|
25384
|
+
moves: array(RecordingRebalanceMoveSchema),
|
|
25385
|
+
skipped: array(RecordingRebalanceSkipSchema),
|
|
25386
|
+
bytesToMove: number(),
|
|
25387
|
+
/** Relocate job ids enqueued. Always empty for the plan (dry-run) call. */
|
|
25388
|
+
jobIds: array(string())
|
|
25389
|
+
});
|
|
25390
|
+
var RecordingRebalanceInputSchema = object({
|
|
25391
|
+
/** Copy throttle in MB/s (default 40) — a rebalance is a background chore. */
|
|
25392
|
+
throttleMbps: number().min(1).max(1e3).optional(),
|
|
25393
|
+
/** Ignore piles smaller than this (default 1 GB). */
|
|
25394
|
+
minMoveGb: number().min(0).optional()
|
|
25395
|
+
});
|
|
25396
|
+
/**
|
|
25031
25397
|
* Result of locating footage at a wall-clock instant for one device/profile.
|
|
25032
25398
|
* `segment` carries the covering segment's window; `gap` reports the forward
|
|
25033
25399
|
* nearest covered edge (`null` past the end of footage / when none exists)
|
|
@@ -25190,9 +25556,24 @@ method(object({
|
|
|
25190
25556
|
}), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
25191
25557
|
kind: "mutation",
|
|
25192
25558
|
auth: "admin"
|
|
25559
|
+
}), method(RelocateFootageInputSchema, object({ jobId: string() }), {
|
|
25560
|
+
kind: "mutation",
|
|
25561
|
+
auth: "admin"
|
|
25562
|
+
}), method(object({}), array(RelocateJobSchema).readonly(), {
|
|
25563
|
+
kind: "query",
|
|
25564
|
+
auth: "admin"
|
|
25565
|
+
}), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
25566
|
+
kind: "mutation",
|
|
25567
|
+
auth: "admin"
|
|
25568
|
+
}), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
|
|
25569
|
+
kind: "query",
|
|
25570
|
+
auth: "admin"
|
|
25571
|
+
}), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
|
|
25572
|
+
kind: "mutation",
|
|
25573
|
+
auth: "admin"
|
|
25193
25574
|
});
|
|
25194
25575
|
/**
|
|
25195
|
-
* `
|
|
25576
|
+
* `recording-export` cap — render a footage time range into a single downloadable
|
|
25196
25577
|
* MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
|
|
25197
25578
|
* bounded lifetime with a durable history, auto-expiry, and optional
|
|
25198
25579
|
* delete-after-download.
|
|
@@ -25207,10 +25588,42 @@ method(object({
|
|
|
25207
25588
|
*/
|
|
25208
25589
|
/** Playback-speed multiplier for the render (1 = realtime). */
|
|
25209
25590
|
var ExportSpeedSchema = number().min(.25).max(32);
|
|
25591
|
+
/**
|
|
25592
|
+
* One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
|
|
25593
|
+
*
|
|
25594
|
+
* Relative and not absolute epoch on purpose: the renderer's frame-select
|
|
25595
|
+
* expression sees ffmpeg's `t`, which starts at 0 for the export's source
|
|
25596
|
+
* playlist. Handing it absolute epochs would make every call site responsible
|
|
25597
|
+
* for the same subtraction, and the one that forgot would emit a filter that
|
|
25598
|
+
* selects nothing — silently, as a uniform timelapse.
|
|
25599
|
+
*/
|
|
25600
|
+
var ExportDenseRangeSchema = object({
|
|
25601
|
+
fromSec: number().nonnegative(),
|
|
25602
|
+
toSec: number().nonnegative()
|
|
25603
|
+
}).refine((r) => r.toSec > r.fromSec, { message: "dense range must have toSec > fromSec" });
|
|
25604
|
+
/**
|
|
25605
|
+
* Dense-interval overlay for a timelapse: sample at `dense.everyMs` INSIDE the
|
|
25606
|
+
* listed ranges and at the base `everyMs` everywhere else.
|
|
25607
|
+
*
|
|
25608
|
+
* `everyMs` must be strictly smaller than the base cadence — a dense rate that
|
|
25609
|
+
* is not denser renders a uniform timelapse the operator believes is two-rate.
|
|
25610
|
+
*/
|
|
25611
|
+
var ExportDenseSchema = object({
|
|
25612
|
+
everyMs: number().int().positive(),
|
|
25613
|
+
ranges: array(ExportDenseRangeSchema).min(1).max(200)
|
|
25614
|
+
});
|
|
25210
25615
|
/** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
|
|
25211
25616
|
var ExportTimelapseSchema = object({
|
|
25212
25617
|
everyMs: number().int().positive(),
|
|
25213
|
-
outputFps: number().int().min(1).max(60).optional()
|
|
25618
|
+
outputFps: number().int().min(1).max(60).optional(),
|
|
25619
|
+
/** Optional second, FASTER rate over the intervals that matter. */
|
|
25620
|
+
dense: ExportDenseSchema.optional()
|
|
25621
|
+
}).superRefine((v, ctx) => {
|
|
25622
|
+
if (v.dense !== void 0 && v.dense.everyMs >= v.everyMs) ctx.addIssue({
|
|
25623
|
+
code: ZodIssueCode.custom,
|
|
25624
|
+
message: "dense.everyMs must be strictly smaller than the base everyMs",
|
|
25625
|
+
path: ["dense", "everyMs"]
|
|
25626
|
+
});
|
|
25214
25627
|
});
|
|
25215
25628
|
/**
|
|
25216
25629
|
* Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
|
|
@@ -25268,6 +25681,19 @@ var ExportDownloadSchema = object({
|
|
|
25268
25681
|
url: string(),
|
|
25269
25682
|
endpoints: array(string())
|
|
25270
25683
|
});
|
|
25684
|
+
/**
|
|
25685
|
+
* A finished export's bytes, inline.
|
|
25686
|
+
*
|
|
25687
|
+
* `bytes` is the DECODED length — the number the caller bounds and logs
|
|
25688
|
+
* against, so nobody has to infer it from the base64 length.
|
|
25689
|
+
*/
|
|
25690
|
+
var ExportBytesSchema = object({
|
|
25691
|
+
base64: string(),
|
|
25692
|
+
contentType: string(),
|
|
25693
|
+
/** Suggested filename, extension included. */
|
|
25694
|
+
name: string(),
|
|
25695
|
+
bytes: number().int().nonnegative()
|
|
25696
|
+
});
|
|
25271
25697
|
method(object({
|
|
25272
25698
|
deviceId: number(),
|
|
25273
25699
|
profile: string(),
|
|
@@ -25292,6 +25718,9 @@ method(object({
|
|
|
25292
25718
|
}), method(object({ exportId: string() }), ExportDownloadSchema, {
|
|
25293
25719
|
kind: "query",
|
|
25294
25720
|
auth: "protected"
|
|
25721
|
+
}), method(object({ exportId: string() }), ExportBytesSchema, {
|
|
25722
|
+
kind: "query",
|
|
25723
|
+
auth: "protected"
|
|
25295
25724
|
});
|
|
25296
25725
|
/**
|
|
25297
25726
|
* scene-monitor — device-scoped reference-region state cap. An operator marks
|
|
@@ -32326,6 +32755,12 @@ Object.freeze({
|
|
|
32326
32755
|
addonId: null,
|
|
32327
32756
|
access: "create"
|
|
32328
32757
|
},
|
|
32758
|
+
"recording.cancelRelocateJob": {
|
|
32759
|
+
capName: "recording",
|
|
32760
|
+
capScope: "system",
|
|
32761
|
+
addonId: null,
|
|
32762
|
+
access: "create"
|
|
32763
|
+
},
|
|
32329
32764
|
"recording.cancelStorageMigrationMove": {
|
|
32330
32765
|
capName: "recording",
|
|
32331
32766
|
capScope: "system",
|
|
@@ -32380,6 +32815,12 @@ Object.freeze({
|
|
|
32380
32815
|
addonId: null,
|
|
32381
32816
|
access: "view"
|
|
32382
32817
|
},
|
|
32818
|
+
"recording.listRelocateJobs": {
|
|
32819
|
+
capName: "recording",
|
|
32820
|
+
capScope: "system",
|
|
32821
|
+
addonId: null,
|
|
32822
|
+
access: "view"
|
|
32823
|
+
},
|
|
32383
32824
|
"recording.locateSegment": {
|
|
32384
32825
|
capName: "recording",
|
|
32385
32826
|
capScope: "system",
|
|
@@ -32392,6 +32833,12 @@ Object.freeze({
|
|
|
32392
32833
|
addonId: null,
|
|
32393
32834
|
access: "create"
|
|
32394
32835
|
},
|
|
32836
|
+
"recording.planStorageRebalance": {
|
|
32837
|
+
capName: "recording",
|
|
32838
|
+
capScope: "system",
|
|
32839
|
+
addonId: null,
|
|
32840
|
+
access: "view"
|
|
32841
|
+
},
|
|
32395
32842
|
"recording.pruneFootage": {
|
|
32396
32843
|
capName: "recording",
|
|
32397
32844
|
capScope: "system",
|
|
@@ -32416,6 +32863,12 @@ Object.freeze({
|
|
|
32416
32863
|
addonId: null,
|
|
32417
32864
|
access: "create"
|
|
32418
32865
|
},
|
|
32866
|
+
"recording.relocateFootage": {
|
|
32867
|
+
capName: "recording",
|
|
32868
|
+
capScope: "system",
|
|
32869
|
+
addonId: null,
|
|
32870
|
+
access: "create"
|
|
32871
|
+
},
|
|
32419
32872
|
"recording.renderClip": {
|
|
32420
32873
|
capName: "recording",
|
|
32421
32874
|
capScope: "system",
|
|
@@ -32452,38 +32905,50 @@ Object.freeze({
|
|
|
32452
32905
|
addonId: null,
|
|
32453
32906
|
access: "create"
|
|
32454
32907
|
},
|
|
32908
|
+
"recording.startStorageRebalance": {
|
|
32909
|
+
capName: "recording",
|
|
32910
|
+
capScope: "system",
|
|
32911
|
+
addonId: null,
|
|
32912
|
+
access: "create"
|
|
32913
|
+
},
|
|
32455
32914
|
"recordingExport.cancelExport": {
|
|
32456
|
-
capName: "
|
|
32915
|
+
capName: "recording-export",
|
|
32457
32916
|
capScope: "system",
|
|
32458
32917
|
addonId: null,
|
|
32459
32918
|
access: "create"
|
|
32460
32919
|
},
|
|
32461
32920
|
"recordingExport.createExport": {
|
|
32462
|
-
capName: "
|
|
32921
|
+
capName: "recording-export",
|
|
32463
32922
|
capScope: "system",
|
|
32464
32923
|
addonId: null,
|
|
32465
32924
|
access: "create"
|
|
32466
32925
|
},
|
|
32467
32926
|
"recordingExport.deleteExport": {
|
|
32468
|
-
capName: "
|
|
32927
|
+
capName: "recording-export",
|
|
32469
32928
|
capScope: "system",
|
|
32470
32929
|
addonId: null,
|
|
32471
32930
|
access: "delete"
|
|
32472
32931
|
},
|
|
32473
32932
|
"recordingExport.getDownloadUrl": {
|
|
32474
|
-
capName: "
|
|
32933
|
+
capName: "recording-export",
|
|
32475
32934
|
capScope: "system",
|
|
32476
32935
|
addonId: null,
|
|
32477
32936
|
access: "view"
|
|
32478
32937
|
},
|
|
32479
32938
|
"recordingExport.getExport": {
|
|
32480
|
-
capName: "
|
|
32939
|
+
capName: "recording-export",
|
|
32481
32940
|
capScope: "system",
|
|
32482
32941
|
addonId: null,
|
|
32483
32942
|
access: "view"
|
|
32484
32943
|
},
|
|
32485
32944
|
"recordingExport.listExports": {
|
|
32486
|
-
capName: "
|
|
32945
|
+
capName: "recording-export",
|
|
32946
|
+
capScope: "system",
|
|
32947
|
+
addonId: null,
|
|
32948
|
+
access: "view"
|
|
32949
|
+
},
|
|
32950
|
+
"recordingExport.readExportBytes": {
|
|
32951
|
+
capName: "recording-export",
|
|
32487
32952
|
capScope: "system",
|
|
32488
32953
|
addonId: null,
|
|
32489
32954
|
access: "view"
|
|
@@ -33860,6 +34325,104 @@ var FramerateField = number().int().min(1).max(60);
|
|
|
33860
34325
|
var TargetsField = array(NcRuleTargetSchema).min(1);
|
|
33861
34326
|
var PriorityField = number().int().min(1).max(5);
|
|
33862
34327
|
/**
|
|
34328
|
+
* Explicit override of the DENSE sampling cadence, seconds.
|
|
34329
|
+
*
|
|
34330
|
+
* Absent ⇒ derived as `max(1s, cadenceSec / 30)` — a 30 s base samples every
|
|
34331
|
+
* 1 s inside a detection range. (It was `base / 10` until 2026-08-12, which
|
|
34332
|
+
* made that same base 3 s and rendered a person pass as two frames.)
|
|
34333
|
+
*
|
|
34334
|
+
* THE ARITHMETIC. A detection range of `rangeSec` seconds sampled every
|
|
34335
|
+
* `denseCadenceSec` and played at `framerate` occupies
|
|
34336
|
+
*
|
|
34337
|
+
* outputSeconds = (rangeSec / denseCadenceSec) / framerate
|
|
34338
|
+
*
|
|
34339
|
+
* so a 7 s pass at 1 s / 12 fps is 0.58 s of video, and at 0.5 s it is 1.17 s.
|
|
34340
|
+
* Halving this field doubles the frames INSIDE ranges only — the base cadence,
|
|
34341
|
+
* and therefore the length of a quiet night, does not move.
|
|
34342
|
+
*
|
|
34343
|
+
* Floored at {@link TIMELAPSE_DENSE_FLOOR_SEC}: asking for frames faster than
|
|
34344
|
+
* the recording has them returns the same frames, requested twice. Must be
|
|
34345
|
+
* STRICTLY smaller than `cadenceSec` — a dense rate that is not denser renders
|
|
34346
|
+
* a uniform video the operator believes is two-rate — and upsert refuses it
|
|
34347
|
+
* rather than letting the export cap reject the render hours after the window.
|
|
34348
|
+
*/
|
|
34349
|
+
var DenseCadenceSecField = number().min(.1).max(3600);
|
|
34350
|
+
/**
|
|
34351
|
+
* Minimum seconds of OUTPUT video each detection range must occupy.
|
|
34352
|
+
*
|
|
34353
|
+
* The operator-facing form of the arithmetic above: instead of solving for a
|
|
34354
|
+
* cadence, state the dwell and let the renderer solve. `minDwellSec: 1` on a
|
|
34355
|
+
* 30 s base at 12 fps turns a 7 s pass into a full second of video by sampling
|
|
34356
|
+
* that range every ~583 ms.
|
|
34357
|
+
*
|
|
34358
|
+
* ONE CADENCE SERVES EVERY RANGE. `ExportDenseSchema.everyMs` is global — the
|
|
34359
|
+
* ranges are terms of a single ffmpeg `select` expression that cannot vary rate
|
|
34360
|
+
* per term — so the MOST DEMANDING (shortest) range sets the rate and longer
|
|
34361
|
+
* ranges are sampled denser than they need. Per-range cadences require a cap
|
|
34362
|
+
* schema change and are the tracked follow-up.
|
|
34363
|
+
*
|
|
34364
|
+
* A range too short to reach the dwell even at {@link TIMELAPSE_DENSE_FLOOR_SEC}
|
|
34365
|
+
* is rendered with every frame that EXISTS and no more: the guarantee is capped
|
|
34366
|
+
* by real footage, never met by duplicating frames into motion that never
|
|
34367
|
+
* happened.
|
|
34368
|
+
*/
|
|
34369
|
+
var MinDwellSecField = number().min(0).max(60);
|
|
34370
|
+
/**
|
|
34371
|
+
* Caption burned into the notification's preview frame.
|
|
34372
|
+
*
|
|
34373
|
+
* Same `{{var}}` vocabulary as {@link TimelapseTemplateSchema} (`camera`,
|
|
34374
|
+
* `rule`, `from`, `to`) and rendered by the SAME renderer — a second
|
|
34375
|
+
* templating dialect for one field would be a second thing to explain.
|
|
34376
|
+
*
|
|
34377
|
+
* Absent ⇒ {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}. An EMPTY STRING is the
|
|
34378
|
+
* operator saying "the frame, no caption" — a distinct, reachable answer, and
|
|
34379
|
+
* the reason this is not `.min(1)`.
|
|
34380
|
+
*/
|
|
34381
|
+
var PreviewTextField = string().max(200);
|
|
34382
|
+
/**
|
|
34383
|
+
* Whether the notification's preview is a STILL or a short animation.
|
|
34384
|
+
*
|
|
34385
|
+
* The operator's ask, verbatim: *"inviato come gif o video (come per le altre
|
|
34386
|
+
* rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
|
|
34387
|
+
* night reads better as three seconds of motion than as one frame of it. Both
|
|
34388
|
+
* modes get the SAME treatment (blurred frame, large centred title); `'gif'`
|
|
34389
|
+
* simply applies it to a dozen frames sampled across the render and assembles
|
|
34390
|
+
* them.
|
|
34391
|
+
*
|
|
34392
|
+
* `'image'` is the default and stays the default: a GIF costs a dozen ffmpeg
|
|
34393
|
+
* seeks and a palette pass, and no rule that never asked for one should start
|
|
34394
|
+
* paying that on the deploy that shipped it.
|
|
34395
|
+
*
|
|
34396
|
+
* A GIF that cannot be assembled DEGRADES to the still — never to nothing.
|
|
34397
|
+
*/
|
|
34398
|
+
var PreviewModeField = _enum(["image", "gif"]);
|
|
34399
|
+
/**
|
|
34400
|
+
* Which detection classes the notification reports counts for.
|
|
34401
|
+
*
|
|
34402
|
+
* The counts come from the tracks the render ALREADY fetched for its dense-range
|
|
34403
|
+
* plan — no second query — aggregated per class. Absent or empty means "every
|
|
34404
|
+
* class the window actually contained", which is what an operator who never
|
|
34405
|
+
* opened the field wants; a list narrows it (`['person']` on a driveway that
|
|
34406
|
+
* counts cars all night).
|
|
34407
|
+
*
|
|
34408
|
+
* Class names are the tracker's own (`person`, `vehicle`, `animal`, `package`,
|
|
34409
|
+
* …). An unknown name simply never matches and reports nothing — it is not an
|
|
34410
|
+
* error, because a rule may legitimately name a class this camera's model does
|
|
34411
|
+
* not emit.
|
|
34412
|
+
*
|
|
34413
|
+
* The counts are exposed to {@link TimelapseTemplateSchema} as:
|
|
34414
|
+
* - `{{detections}}` — total over the reported classes
|
|
34415
|
+
* - `{{detectionSummary}}` — `2 persone, 1 veicolo`
|
|
34416
|
+
* - `{{count_person}}` / `{{count_vehicle}}` / `{{count_animal}}` / … —
|
|
34417
|
+
* one per class, `count_` + the class name
|
|
34418
|
+
*
|
|
34419
|
+
* With NO custom body template the summary is appended to the derived body, and
|
|
34420
|
+
* only when the total is non-zero: a nightly `0 rilevamenti` is a line nobody
|
|
34421
|
+
* reads. With a custom template the operator owns every word — nothing is
|
|
34422
|
+
* appended, so `{{detectionSummary}}` is how he asks for it.
|
|
34423
|
+
*/
|
|
34424
|
+
var ReportClassesField = array(string().min(1).max(40)).max(20);
|
|
34425
|
+
/**
|
|
33863
34426
|
* Client-supplied timelapse-rule fields. The server stamps id / createdBy /
|
|
33864
34427
|
* createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
|
|
33865
34428
|
* here (see the ownership note above).
|
|
@@ -33879,9 +34442,30 @@ var TimelapseRuleInputSchema = object({
|
|
|
33879
34442
|
cadenceSec: CadenceSecField.default(15),
|
|
33880
34443
|
/** Output frames per second of the assembled mp4 (predecessor parity). */
|
|
33881
34444
|
framerate: FramerateField.default(10),
|
|
34445
|
+
/**
|
|
34446
|
+
* Explicit dense cadence — see {@link DenseCadenceSecField}. Absent ⇒ derived
|
|
34447
|
+
* as `max(1s, cadenceSec / 30)`, which is what every rule written before this
|
|
34448
|
+
* field gets.
|
|
34449
|
+
*/
|
|
34450
|
+
denseCadenceSec: DenseCadenceSecField.optional(),
|
|
34451
|
+
/** Output-seconds guarantee per detection range — see {@link MinDwellSecField}. */
|
|
34452
|
+
minDwellSec: MinDwellSecField.optional(),
|
|
33882
34453
|
/** `notification-output` targets the finished video/thumbnail is sent to. */
|
|
33883
34454
|
targets: TargetsField,
|
|
33884
34455
|
template: TimelapseTemplateSchema.optional(),
|
|
34456
|
+
/**
|
|
34457
|
+
* Caption on the notification's PREVIEW FRAME — see {@link PreviewTextField}
|
|
34458
|
+
* and {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}.
|
|
34459
|
+
*
|
|
34460
|
+
* Deliberately NOT part of {@link TimelapseTemplateSchema}: that object is
|
|
34461
|
+
* the notification's title/body, and clearing it (`template: null`) must not
|
|
34462
|
+
* silently clear the caption too.
|
|
34463
|
+
*/
|
|
34464
|
+
previewText: PreviewTextField.optional(),
|
|
34465
|
+
/** Still or animation — see {@link PreviewModeField}. */
|
|
34466
|
+
previewMode: PreviewModeField.default("image"),
|
|
34467
|
+
/** Classes the notification counts — see {@link ReportClassesField}. */
|
|
34468
|
+
reportClasses: ReportClassesField.optional(),
|
|
33885
34469
|
/** Canonical notification priority ordinal (1..5); per-target overridable. */
|
|
33886
34470
|
priority: PriorityField.default(3)
|
|
33887
34471
|
});
|
|
@@ -33892,8 +34476,13 @@ object({
|
|
|
33892
34476
|
schedule: NcScheduleSchema.optional(),
|
|
33893
34477
|
cadenceSec: CadenceSecField.optional(),
|
|
33894
34478
|
framerate: FramerateField.optional(),
|
|
34479
|
+
denseCadenceSec: DenseCadenceSecField.optional(),
|
|
34480
|
+
minDwellSec: MinDwellSecField.optional(),
|
|
33895
34481
|
targets: TargetsField.optional(),
|
|
33896
34482
|
template: TimelapseTemplateSchema.nullable().optional(),
|
|
34483
|
+
previewText: PreviewTextField.optional(),
|
|
34484
|
+
previewMode: PreviewModeField.optional(),
|
|
34485
|
+
reportClasses: ReportClassesField.optional(),
|
|
33897
34486
|
priority: PriorityField.optional()
|
|
33898
34487
|
});
|
|
33899
34488
|
TimelapseRuleInputSchema.extend({
|
|
@@ -33905,10 +34494,28 @@ TimelapseRuleInputSchema.extend({
|
|
|
33905
34494
|
*/
|
|
33906
34495
|
ownerUserId: string().optional(),
|
|
33907
34496
|
/**
|
|
33908
|
-
* Epoch-ms of the
|
|
33909
|
-
*
|
|
34497
|
+
* Epoch-ms of the NEWEST successful generation across every camera of this
|
|
34498
|
+
* rule. What a UI shows, and the compatibility floor for
|
|
34499
|
+
* {@link readTimelapseGeneratedAt}. Absent = never generated.
|
|
33910
34500
|
*/
|
|
33911
34501
|
lastGeneratedAt: number().optional(),
|
|
34502
|
+
/**
|
|
34503
|
+
* PER-CAMERA generation state, keyed by `String(deviceId)` — the
|
|
34504
|
+
* re-generation guard's real durable state.
|
|
34505
|
+
*
|
|
34506
|
+
* One rule covers several cameras and each renders its own video, so a rule
|
|
34507
|
+
* -wide stamp is wrong in the direction that DESTROYS work: camera A
|
|
34508
|
+
* succeeding at 06:05 tells camera B, whose render failed, that it is
|
|
34509
|
+
* already done — and B's night is gone for good, because the window will not
|
|
34510
|
+
* come back.
|
|
34511
|
+
*
|
|
34512
|
+
* ADDITIVE, so the migration is free: a row written before this field simply
|
|
34513
|
+
* has no map, and {@link readTimelapseGeneratedAt} falls back to
|
|
34514
|
+
* {@link TimelapseRuleSchema.shape.lastGeneratedAt}. Reading an old row as
|
|
34515
|
+
* "never generated" would re-render and re-notify every camera of every rule
|
|
34516
|
+
* once, on the deploy that shipped the map.
|
|
34517
|
+
*/
|
|
34518
|
+
generatedByDevice: record(string(), number()).optional(),
|
|
33912
34519
|
/** userId of the caller who created the rule (server-stamped). */
|
|
33913
34520
|
createdBy: string(),
|
|
33914
34521
|
createdAt: number(),
|