@camstack/addon-provider-hikvision 1.2.7 → 1.2.9

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.
Files changed (3) hide show
  1. package/dist/addon.js +451 -76
  2. package/dist/addon.mjs +451 -76
  3. package/package.json +3 -2
package/dist/addon.mjs CHANGED
@@ -7,7 +7,7 @@ import { networkInterfaces } from "node:os";
7
7
  var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
8
8
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
9
9
  //#endregion
10
- //#region ../types/dist/event-category-BLcNejAE.mjs
10
+ //#region ../types/dist/event-category-Bz24uP1U.mjs
11
11
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
12
12
  EventCategory["SystemBoot"] = "system.boot";
13
13
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -278,6 +278,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
278
278
  */
279
279
  EventCategory["DeviceStateChanged"] = "device.state-changed";
280
280
  /**
281
+ * Frame occupancy for a camera CHANGED — a tracked object was gained or
282
+ * lost. Carries `{ deviceId, totalObjects, byClass, zones }`.
283
+ *
284
+ * Emitted only on a change, so a steady scene is silent. It exists so a
285
+ * client can stop polling `zoneAnalytics.getCurrentSnapshot`: that was the
286
+ * one live badge with no push signal at all, and it cost a request every
287
+ * four seconds per visible camera.
288
+ *
289
+ * Like every event it is telemetry and may be dropped ([D8]) — a consumer
290
+ * keeps a slow reconcile rather than trusting it alone.
291
+ */
292
+ EventCategory["ZoneAnalyticsOccupancyChanged"] = "zone-analytics.occupancy-changed";
293
+ /**
281
294
  * Cap event fired by every device that registers the `battery`
282
295
  * capability. Mirrors the cap definition's `onStatusChanged`. Carries
283
296
  * `{ deviceId, status: BatteryStatus }`. Subscribers (alert center,
@@ -7370,35 +7383,22 @@ function findTimezone(id) {
7370
7383
  */
7371
7384
  var RecordingWeekdaySchema = number().int().min(0).max(6);
7372
7385
  var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
7373
- var RecordingScheduleSchema = discriminatedUnion("kind", [object({ kind: literal("always") }), object({
7374
- kind: literal("timeOfDay"),
7375
- start: string().regex(HHMM),
7376
- end: string().regex(HHMM),
7377
- /** Restrict to these weekdays; omit = every day. */
7378
- days: array(RecordingWeekdaySchema).optional()
7379
- })]);
7380
- var RecordingModeSchema = _enum([
7381
- "continuous",
7382
- "onMotion",
7383
- "onAudioThreshold"
7384
- ]);
7385
7386
  /**
7386
- * First-class, authoritative per-camera storage mode — the explicit choice the
7387
- * UI reads directly (never inferred from `rules`):
7388
- * - `off` — not recording.
7389
- * - `events` — record only around triggers (motion / audio threshold),
7390
- * with pre/post-buffer.
7391
- * - `continuous` — record 24/7 within the schedule.
7387
+ * DERIVED per-camera storage summary — the single field cheap consumers read
7388
+ * (the viewer's status dot, the camera list) instead of walking `bands`:
7389
+ * - `off` — no band covers the camera (or it is disabled).
7390
+ * - `events` — every band records around triggers only.
7391
+ * - `continuous` — at least one band records continuously.
7392
7392
  *
7393
- * `mode` compiles one-way to the internal `rules[]` consumed by the policy
7394
- * engine (see `compileRules`); `rules[]` is never authored directly anymore.
7393
+ * NEVER authored: the recorder stamps it from the authoritative `bands` on
7394
+ * every save (`activeModeForConfig`). Writing it has no effect.
7395
7395
  */
7396
7396
  var RecordingStorageModeSchema = _enum([
7397
7397
  "off",
7398
7398
  "events",
7399
7399
  "continuous"
7400
7400
  ]);
7401
- /** Which detectors trigger an `events`-mode recording. */
7401
+ /** Which detectors trigger an `events`-mode band. */
7402
7402
  var RecordingTriggersSchema = object({
7403
7403
  motion: boolean().optional(),
7404
7404
  audioThresholdDbfs: number().optional()
@@ -7434,18 +7434,6 @@ var RecordingBandSchema = object({
7434
7434
  preBufferSec: number().min(0).optional(),
7435
7435
  postBufferSec: number().min(0).optional()
7436
7436
  });
7437
- var RecordingRuleSchema = object({
7438
- schedule: RecordingScheduleSchema,
7439
- mode: RecordingModeSchema,
7440
- /** Seconds of footage to retain BEFORE a trigger (applied at keep/discard). */
7441
- preBufferSec: number().min(0).default(0),
7442
- /** Keep recording until this many seconds after the last trigger. */
7443
- postBufferSec: number().min(0).default(0),
7444
- /** Each new trigger restarts the post-buffer window. */
7445
- resetTimeoutOnNewEvent: boolean().default(true),
7446
- /** onAudioThreshold only — dBFS level that counts as a trigger. */
7447
- thresholdDbfs: number().optional()
7448
- });
7449
7437
  /**
7450
7438
  * Per-device retention overrides. Every field is optional; an unset or `0`
7451
7439
  * value inherits the node-wide recorder default. Only footage-lifetime limits
@@ -7479,40 +7467,28 @@ var ScrubThumbnailPresetSchema = _enum([
7479
7467
  /**
7480
7468
  * The full per-camera recording intent — the wire shape of a RecordingTarget.
7481
7469
  *
7482
- * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
7483
- * are its mode-specific parameters. `rules` is a DEPRECATED authoring input kept
7484
- * only for transition + migration (`migrateRulesToMode`); the policy engine
7485
- * consumes the compiled output of `compileRules(config)`, never `rules` directly.
7470
+ * `bands` is the ONLY authored recording intent: what to record, when, and on
7471
+ * which trigger. `mode` is a derived summary the recorder stamps on save; every
7472
+ * other field is a storage knob (profiles, segment length, retention, scrub).
7473
+ *
7474
+ * STRICT on purpose: the legacy authoring surface (`schedule`/`schedules`/
7475
+ * `triggers`/`preBufferSec`/`postBufferSec`/`rules`) was retired 2026-07-30.
7476
+ * A stale caller must fail loudly — silently stripping its legacy intent would
7477
+ * persist a band-less config, i.e. silently stop recording the camera.
7486
7478
  */
7487
7479
  var RecordingConfigSchema = object({
7488
7480
  enabled: boolean(),
7489
- /** Authoritative storage mode. Absent on legacy targets derived once via
7490
- * `migrateRulesToMode`, then persisted. */
7481
+ /** DERIVED summary of `bands`, stamped by the recorder on every save.
7482
+ * Authoring it has no effect — see {@link RecordingStorageModeSchema}. */
7491
7483
  mode: RecordingStorageModeSchema.optional(),
7492
7484
  profiles: array(CamProfileSchema).optional(),
7493
7485
  segmentSeconds: number().int().positive().optional(),
7494
- /** Shared recording time-bands for `events` & `continuous` — record only when
7495
- * the wall-clock falls inside one of these windows. Omit or empty = always.
7496
- * `continuous` compiles to one rule per band; `events` to band × trigger. */
7497
- schedules: array(RecordingScheduleSchema).optional(),
7498
- /** Legacy single-band predecessor of `schedules`. Read-compat only — it is
7499
- * normalized into `schedules` on read and never written going forward. (Not
7500
- * tagged `@deprecated`: the normalization paths must read it cast-free.) */
7501
- schedule: RecordingScheduleSchema.optional(),
7502
- /** `events`-mode only — which detectors trigger a recording. */
7503
- triggers: RecordingTriggersSchema.optional(),
7504
- /** `events`-mode only — seconds retained before / after a trigger. */
7505
- preBufferSec: number().min(0).optional(),
7506
- postBufferSec: number().min(0).optional(),
7507
- /** DEPRECATED authoring input; retained for migration/transition. */
7508
- rules: array(RecordingRuleSchema).optional(),
7509
7486
  /**
7510
- * AUTHORITATIVE mode-per-band recording model (recorder). When present it
7511
- * is the single source of truth; the legacy `mode`/`schedules`/`schedule`/
7512
- * `triggers`/`rules` fields above are kept for READ-COMPAT only and are
7513
- * derived into bands once via `migrateConfigToBands`.
7487
+ * AUTHORITATIVE mode-per-band recording model the single source of truth
7488
+ * the recorder's band engine consumes. An empty array = record nothing;
7489
+ * "off" is the absence of a covering band, never a band value.
7514
7490
  */
7515
- bands: array(RecordingBandSchema).optional(),
7491
+ bands: array(RecordingBandSchema).default([]),
7516
7492
  retention: RecordingRetentionSchema.optional(),
7517
7493
  /**
7518
7494
  * Per-camera scrub-thumbnail fidelity preset (resolution + JPEG quality for
@@ -7520,8 +7496,15 @@ var RecordingConfigSchema = object({
7520
7496
  * windows only — existing sheets are immutable, and each window's index
7521
7497
  * carries its own tile dims so mixed-preset history renders correctly.
7522
7498
  */
7523
- scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7524
- });
7499
+ scrubThumbnails: ScrubThumbnailPresetSchema.optional(),
7500
+ /**
7501
+ * OPT-IN thumbnail-strip generation for this camera: every keyframe of the
7502
+ * low recording saved as a JPEG (the fast-drag scrub depth), a derived
7503
+ * cache that eviction reclaims with the footage. Absent/false = no strips
7504
+ * are written and scrub reads exact keyframes at every velocity.
7505
+ */
7506
+ stripsEnabled: boolean().optional()
7507
+ }).strict();
7525
7508
  /**
7526
7509
  * Ops-log — the durable, append-only operations audit shared by the
7527
7510
  * recordings and events management surfaces.
@@ -7540,7 +7523,8 @@ var OpsLogOpSchema = _enum([
7540
7523
  "prune",
7541
7524
  "manual-delete",
7542
7525
  "rescan",
7543
- "retention-run"
7526
+ "retention-run",
7527
+ "relocate"
7544
7528
  ]);
7545
7529
  /** Why the operation ran. */
7546
7530
  var OpsLogReasonSchema = _enum([
@@ -7579,6 +7563,55 @@ var OpsLogQueryInputSchema = object({
7579
7563
  limit: number().int().min(1).max(1e3).optional()
7580
7564
  });
7581
7565
  /**
7566
+ * Entity-relocation job state (storage entity-routing spec, Phase 4).
7567
+ *
7568
+ * One shape shared by the recorder's `relocateFootage` (segments + strips) and
7569
+ * pipeline-analytics' `relocateMedia` (event media blobs) so the admin Data
7570
+ * page renders both movers with one component. Jobs are in-RAM (a restart
7571
+ * forgets them — re-running is safe by construction: copy-if-absent, delete
7572
+ * after verify) and each completed/failed run also lands one durable ops-log
7573
+ * row on the owning addon's surface.
7574
+ */
7575
+ var RelocateJobStateSchema = _enum([
7576
+ "running",
7577
+ "done",
7578
+ "failed",
7579
+ "cancelled"
7580
+ ]);
7581
+ var RelocateJobSchema = object({
7582
+ jobId: string(),
7583
+ state: RelocateJobStateSchema,
7584
+ /** Source location — for media relocation this is informational ('*': rows
7585
+ * move from wherever they are to the target). */
7586
+ fromLocationId: string(),
7587
+ toLocationId: string(),
7588
+ /** Scoped device, or null = every device. */
7589
+ deviceId: number().nullable(),
7590
+ /** What the job moves (owner-addon specific: segments/strips or media). */
7591
+ entities: array(string()),
7592
+ filesMoved: number().int(),
7593
+ bytesMoved: number().int(),
7594
+ /** Total files discovered up front; null while (or when) unknown. */
7595
+ filesTotal: number().int().nullable(),
7596
+ startedAt: number(),
7597
+ finishedAt: number().nullable(),
7598
+ error: string().nullable()
7599
+ });
7600
+ var RelocateFootageInputSchema = object({
7601
+ deviceId: number().optional(),
7602
+ fromLocationId: string(),
7603
+ toLocationId: string(),
7604
+ entities: array(_enum(["segments", "strips"])).optional(),
7605
+ /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7606
+ * never allowed to starve live writers. */
7607
+ throttleMbps: number().min(1).max(1e3).optional()
7608
+ });
7609
+ var RelocateMediaInputSchema = object({
7610
+ deviceId: number().optional(),
7611
+ toLocationId: string(),
7612
+ throttleMbps: number().min(1).max(1e3).optional()
7613
+ });
7614
+ /**
7582
7615
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
7583
7616
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
7584
7617
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -7628,6 +7661,13 @@ var StorageLocationSchema = object({
7628
7661
  nodeId: string().optional(),
7629
7662
  isDefault: boolean().default(false),
7630
7663
  isSystem: boolean().default(false),
7664
+ /** COMPUTED at read time by the orchestrator (statfs of the backing volume
7665
+ * for node-local locations it can reach) — never persisted, absent when the
7666
+ * volume is remote/unreachable. The single capacity truth every UI reads. */
7667
+ capacity: object({
7668
+ totalBytes: number(),
7669
+ availableBytes: number()
7670
+ }).nullable().optional(),
7631
7671
  createdAt: number(),
7632
7672
  updatedAt: number()
7633
7673
  });
@@ -8395,7 +8435,8 @@ var NcTaxonomyEntrySchema = object({
8395
8435
  /** Macro/category parent for grouping ('car' → 'vehicle'); null for a top. */
8396
8436
  parentKind: string().nullable()
8397
8437
  });
8398
- object({
8438
+ /** The complete NC picker taxonomy — three grouped buckets. */
8439
+ var NcTaxonomySchema = object({
8399
8440
  videoClasses: array(NcTaxonomyEntrySchema),
8400
8441
  audioKinds: array(NcTaxonomyEntrySchema),
8401
8442
  labels: array(NcTaxonomyEntrySchema)
@@ -9403,6 +9444,7 @@ function startReachabilityPoll(options) {
9403
9444
  timer = void 0;
9404
9445
  } };
9405
9446
  }
9447
+ new Set(["devices", "classes"]);
9406
9448
  /**
9407
9449
  * Shared geometry vocabulary for on-frame shape caps — privacy-mask,
9408
9450
  * motion-zones, and the detection zones/lines editor all speak this one
@@ -9561,6 +9603,29 @@ var NcOccupancyConditionSchema = object({
9561
9603
  count: number().int().min(0).default(1),
9562
9604
  sustainSeconds: number().int().min(0).max(3600).default(15)
9563
9605
  });
9606
+ /**
9607
+ * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
9608
+ *
9609
+ * The values are not symmetric, and deliberately so — the absent value has to
9610
+ * mean exactly what every rule authored before this condition existed already
9611
+ * does:
9612
+ * - `enter` — entries and every NON-crossing record (movement state,
9613
+ * package, sensor). Exits are rejected. **This is the absent behaviour**:
9614
+ * an operator who never asked for exits must not start receiving them.
9615
+ * - `exit` — ONLY an exit crossing. A record that is not a crossing at all
9616
+ * fails closed, because "the car left the drive" is a question about a
9617
+ * boundary, not about a detection.
9618
+ * - `any` — no direction filter; entries, exits and non-crossings alike.
9619
+ *
9620
+ * A rule asking for a direction should normally also scope `zones`, which the
9621
+ * engine evaluates against the crossed zone as well as the current membership
9622
+ * (an exit's membership no longer contains the zone it just left).
9623
+ */
9624
+ var NcCrossingSchema = _enum([
9625
+ "enter",
9626
+ "exit",
9627
+ "any"
9628
+ ]);
9564
9629
  /** Admin-zone membership condition (zone IDs as stamped by the ZoneEngine). */
9565
9630
  var NcZoneConditionSchema = object({
9566
9631
  ids: array(string().min(1)).min(1),
@@ -9585,6 +9650,13 @@ var NcConditionsSchema = object({
9585
9650
  /** Veto zones — any hit fails the rule. */
9586
9651
  zonesExclude: array(string().min(1)).optional(),
9587
9652
  /**
9653
+ * Zone-crossing direction. IMMEDIATE only — a crossing is a per-event fact
9654
+ * and a closed track carries none, so a `track-end` rule asking for one
9655
+ * fails closed (use `zones`, which tests `zonesVisited`). ABSENT = `enter`,
9656
+ * which is exactly today's behaviour. See {@link NcCrossingSchema}.
9657
+ */
9658
+ crossing: NcCrossingSchema.optional(),
9659
+ /**
9588
9660
  * Exact (case-insensitive) match on the record's collapsed `label`
9589
9661
  * (identity name / plate text / subclass).
9590
9662
  */
@@ -9719,17 +9791,85 @@ var NcRuleTargetSchema = object({
9719
9791
  * - `keyFrame` — the clean scene frame (no subject box).
9720
9792
  * - `none` — no attachment.
9721
9793
  */
9722
- var NcMediaPolicySchema = object({ attach: _enum([
9723
- "best",
9724
- "best-matching",
9725
- "keyFrame",
9726
- "none"
9727
- ]).default("best") });
9794
+ /**
9795
+ * WHAT THE PICTURE SHOWS — chosen explicitly, because the implicit ladders
9796
+ * conflate it with the selection strategy and betray the request: asking for
9797
+ * the clean scene frame on an object-event owner used to start at
9798
+ * `fullFrameBoxed`, i.e. the annotated frame (2026-07-30).
9799
+ * - `cropped` — the subject, tight. What "who is at the door" wants.
9800
+ * - `full` — the clean scene, no annotation. What "what is going on" wants.
9801
+ * - `boxed` — the scene WITH the detection boxes drawn, for verifying what
9802
+ * the pipeline actually saw.
9803
+ */
9804
+ var NcMediaFrameSchema = _enum([
9805
+ "cropped",
9806
+ "full",
9807
+ "boxed"
9808
+ ]);
9809
+ var NcMediaPolicySchema = object({
9810
+ attach: _enum([
9811
+ "best",
9812
+ "best-matching",
9813
+ "keyFrame",
9814
+ "none"
9815
+ ]).default("best"),
9816
+ /** What the still shows. Absent = `cropped` (the historical `best` shape). */
9817
+ frame: NcMediaFrameSchema.optional(),
9818
+ /** Crop the attached still to the rule's condition-zone bbox (padded) —
9819
+ * "show me the ZONE", not the whole scene or the subject crop. */
9820
+ zoneCrop: boolean().optional(),
9821
+ /**
9822
+ * Also attach a short GIF cut from the stream broker's clip ring around the
9823
+ * event — NOT from the recording, so the camera does not have to be
9824
+ * recording, and the window sits AROUND the moment instead of a segment
9825
+ * behind it. Fail-closed: a window the ring does not cover contributes no
9826
+ * gif, never a failed notification.
9827
+ */
9828
+ gif: boolean().optional(),
9829
+ /**
9830
+ * Also attach a short MP4 CLIP of the same cut. Same source and the same
9831
+ * fail-closed rule as `gif`. Prefer it where the backend takes video
9832
+ * (telegram, discord, zentik, webhook); backends that do not are handled by
9833
+ * the degrade engine, which drops the video and keeps the still.
9834
+ */
9835
+ clip: boolean().optional(),
9836
+ /** Seconds of footage BEFORE / AFTER the event instant. Defaults 3 / 7. */
9837
+ clipPreRollSec: number().int().min(0).max(30).optional(),
9838
+ clipPostRollSec: number().int().min(0).max(30).optional(),
9839
+ /**
9840
+ * Which stream profile the footage is cut from. Absent = the CHEAPEST
9841
+ * assigned profile: a notification is watched on a phone, so the 4K
9842
+ * rendition would burn CPU to produce a file the client downscales anyway.
9843
+ * A profile that is not assigned falls back to the cheapest, and the render
9844
+ * reports which one actually ran.
9845
+ */
9846
+ profile: CamProfileSchema.optional()
9847
+ });
9848
+ /**
9849
+ * Cooldown GRANULARITY over the subject's class — how much a fired
9850
+ * notification suppresses.
9851
+ * - `shared` (default, and the absent value) — one window for the whole
9852
+ * rule/scope: a cat silences the next dog for `cooldownSec`.
9853
+ * - `per-class` — an independent window per detected class, so cat→dog fires
9854
+ * at once and cat→cat still waits.
9855
+ *
9856
+ * AUDIO subjects are ALWAYS per-class regardless of this setting: a scream
9857
+ * must not be swallowed by a bark's window (the precedent this generalizes —
9858
+ * see `cooldownKey` in the rule engine).
9859
+ */
9860
+ var NcThrottleGranularitySchema = _enum(["shared", "per-class"]);
9728
9861
  /** Throttle — cooldown survives restarts (rebuilt from the outbox on boot). */
9729
9862
  var NcThrottleSchema = object({
9730
9863
  cooldownSec: number().int().min(0).max(86400).default(60),
9731
9864
  /** `rule` = one shared cooldown; `rule-device` = per-camera cooldown. */
9732
- scope: _enum(["rule", "rule-device"]).default("rule-device")
9865
+ scope: _enum(["rule", "rule-device"]).default("rule-device"),
9866
+ /**
9867
+ * Class granularity of the cooldown key. Optional rather than defaulted:
9868
+ * a Zod default does NOT run on the addon→addon cap path, so a persisted
9869
+ * rule authored before this field simply carries none — and the engine
9870
+ * reads absent as `shared`, the pre-existing behaviour.
9871
+ */
9872
+ granularity: NcThrottleGranularitySchema.optional()
9733
9873
  });
9734
9874
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
9735
9875
  var NcRuleInputSchema = object({
@@ -9738,7 +9878,19 @@ var NcRuleInputSchema = object({
9738
9878
  delivery: NcDeliverySchema,
9739
9879
  conditions: NcConditionsSchema.default({}),
9740
9880
  schedule: NcScheduleSchema.optional(),
9741
- targets: array(NcRuleTargetSchema).min(1),
9881
+ /** May be empty when `targetUsers` addresses at least one user — the
9882
+ * "at least one addressee" invariant is enforced by the provider, because
9883
+ * a cross-field refine here would break `NcRulePatchSchema.partial()`. */
9884
+ targets: array(NcRuleTargetSchema),
9885
+ /**
9886
+ * USERS this rule addresses in addition to `targets` (Phase 4). At fire
9887
+ * time each user fans out to the personal targets they own
9888
+ * (`config.ownerUserId`), filtered by that user's `allowedDevices` for the
9889
+ * firing camera — a user is never notified about a device they cannot open.
9890
+ * Per-user opt-outs (`disabledTargetIds`) still apply to the fanned-out
9891
+ * targets.
9892
+ */
9893
+ targetUsers: array(string()).optional(),
9742
9894
  media: NcMediaPolicySchema.default({ attach: "best" }),
9743
9895
  throttle: NcThrottleSchema.default({
9744
9896
  cooldownSec: 60,
@@ -9825,6 +9977,7 @@ var NcConditionDescriptorSchema = object({
9825
9977
  "schedule",
9826
9978
  "plateMatcher",
9827
9979
  "packagePhase",
9980
+ "crossingSelect",
9828
9981
  "polygonDraw",
9829
9982
  "occupancy"
9830
9983
  ]),
@@ -9951,7 +10104,10 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
9951
10104
  }), object({ results: array(NcTestResultSchema) }), {
9952
10105
  kind: "mutation",
9953
10106
  auth: "admin"
9954
- }), method(object({}), object({ catalog: array(NcConditionDescriptorSchema) })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" });
10107
+ }), method(object({}), object({
10108
+ catalog: array(NcConditionDescriptorSchema),
10109
+ taxonomy: NcTaxonomySchema.optional()
10110
+ })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" });
9955
10111
  /**
9956
10112
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
9957
10113
  *
@@ -10960,6 +11116,28 @@ method(object({
10960
11116
  }), object({ success: literal(true) }), {
10961
11117
  kind: "mutation",
10962
11118
  auth: "admin"
11119
+ }), method(object({
11120
+ deviceId: number(),
11121
+ /** Absent = the LOWEST assigned profile — a notification attachment is
11122
+ * watched on a phone, and the cheap rendition is the right default. */
11123
+ profile: CamProfileSchema.optional(),
11124
+ aroundMs: number(),
11125
+ preRollSec: number().min(0).max(20).default(3),
11126
+ postRollSec: number().min(0).max(20).default(5),
11127
+ format: _enum(["gif", "mp4"]).default("gif"),
11128
+ maxWidth: number().int().min(120).max(1920).default(480),
11129
+ /** GIF only — MP4 keeps the source cadence. */
11130
+ fps: number().int().min(1).max(15).default(5)
11131
+ }), object({
11132
+ base64: string(),
11133
+ mime: string(),
11134
+ bytes: number().int(),
11135
+ /** The profile actually rendered (what the default resolved to). */
11136
+ profile: CamProfileSchema,
11137
+ durationMs: number()
11138
+ }), {
11139
+ kind: "mutation",
11140
+ auth: "admin"
10963
11141
  }), method(_void(), array(CameraStreamSchema).readonly()), method(_void(), array(ProfileSlotSchema).readonly()), method(object({ brokerId: string() }), BrokerStatsSchema), method(object({ brokerId: string() }), object({
10964
11142
  probed: boolean(),
10965
11143
  summary: string()
@@ -19034,7 +19212,10 @@ method(object({
19034
19212
  }), method(object({
19035
19213
  deviceId: number(),
19036
19214
  caps: array(string()).readonly().optional()
19037
- }), record(string(), unknown().nullable()));
19215
+ }), record(string(), unknown().nullable())), method(object({
19216
+ deviceIds: array(number()).readonly(),
19217
+ caps: array(string()).readonly().optional()
19218
+ }), record(string(), record(string(), unknown().nullable())));
19038
19219
  method(object({ deviceId: number() }), record(string(), record(string(), unknown()))), method(object({
19039
19220
  deviceId: number(),
19040
19221
  capName: string()
@@ -19965,6 +20146,36 @@ var TargetKindSchema = object({
19965
20146
  icon: string(),
19966
20147
  /** Stamped by each provider so the concat-fanned catalog stays routable. */
19967
20148
  addonId: string(),
20149
+ /**
20150
+ * URL of the kind's bundled BRAND icon, served by the providing addon over
20151
+ * its own `addon-routes` surface (`/addon/<addonId>/icons/<kind>`). Absent
20152
+ * when the addon bundles no icon for that kind — the client then falls back
20153
+ * to a neutral glyph rather than rendering the raw `icon` NAME as text.
20154
+ *
20155
+ * Root-relative on purpose: it resolves against whatever origin serves a web
20156
+ * client, and a native client joins it onto its own hub base.
20157
+ *
20158
+ * DECLARED here deliberately. It used to travel as an undeclared passthrough
20159
+ * field that survived only because the runtime cap-router forwards provider
20160
+ * output verbatim — so every consumer had to re-declare it by hand to stop
20161
+ * its own Zod parse from stripping it, and the whole arrangement would have
20162
+ * broken silently the moment output validation was tightened anywhere.
20163
+ */
20164
+ iconUrl: string().optional(),
20165
+ /**
20166
+ * Media type of {@link iconUrl} (`image/svg+xml`, `image/png`, …).
20167
+ *
20168
+ * The server knows this and therefore says it, because the client cannot
20169
+ * safely guess: a React-Native client renders SVG and raster through two
20170
+ * DIFFERENT components (`react-native-svg` vs `expo-image` — expo-image does
20171
+ * not decode SVG on iOS/Android), so without this it silently fell back to a
20172
+ * placeholder glyph for every vector icon while the web build looked fine.
20173
+ *
20174
+ * Absent when {@link iconUrl} is absent, or for a legacy provider that has
20175
+ * not been updated — a client that cannot determine the type should prefer
20176
+ * its raster path, which is the safe default for an unknown image.
20177
+ */
20178
+ iconMediaType: string().optional(),
19968
20179
  configSchema: ConfigSchemaPassthrough,
19969
20180
  supportsDiscovery: boolean(),
19970
20181
  caps: TargetKindCapsSchema
@@ -20412,6 +20623,29 @@ var MotionEventSchema = object({
20412
20623
  * Absent on legacy rows ⇒ treat as `pipeline`.
20413
20624
  */
20414
20625
  var DetectionSourceSchema = _enum(["pipeline", "onboard"]);
20626
+ /**
20627
+ * The confirmed zone crossing that produced an object event. Present ONLY on
20628
+ * an event emitted BY a crossing (`zone.enter` / `zone.exit`); a movement-state
20629
+ * event (`object.entering` / `leaving` / `stationary` / `loitering`) and an
20630
+ * appearance event carry none, so a rule asking for a direction fails closed
20631
+ * on them.
20632
+ *
20633
+ * Exactly ONE crossing per event: the emitter turns each confirmed crossing
20634
+ * into its own event, so a frame in which a track enters A while leaving B
20635
+ * produces two events with two directions — never one ambiguous row.
20636
+ *
20637
+ * `zoneId` is load-bearing for an EXIT: the event's `zones` list is the
20638
+ * membership the box has NOW, and by definition it no longer contains the zone
20639
+ * that was just left. Without the id here, a zone-scoped rule could never match
20640
+ * the exit it asked for.
20641
+ */
20642
+ var ZoneCrossingSchema = object({
20643
+ direction: _enum(["enter", "exit"]),
20644
+ /** Admin zone id crossed. */
20645
+ zoneId: string(),
20646
+ /** Zone display name at crossing time (falls back to the id). */
20647
+ zoneName: string().optional()
20648
+ });
20415
20649
  var ObjectEventSchema = object({
20416
20650
  ...BaseEventFields,
20417
20651
  kind: literal("object"),
@@ -20438,6 +20672,12 @@ var ObjectEventSchema = object({
20438
20672
  zones: array(string()).readonly().optional(),
20439
20673
  /** Omitted in slim projection. */
20440
20674
  state: TrackStateSchema.optional(),
20675
+ /**
20676
+ * The zone crossing this event IS, when it is one. Absent on every other
20677
+ * event kind (movement state, appearance, package) — see
20678
+ * {@link ZoneCrossingSchema}. Omitted in slim projection.
20679
+ */
20680
+ zoneCrossing: ZoneCrossingSchema.optional(),
20441
20681
  /** Detection-frame dimensions in pixels — let consumers normalize the
20442
20682
  * pixel-space `bbox` onto a displayed image. Omitted in slim projection. */
20443
20683
  frameWidth: number().optional(),
@@ -20696,6 +20936,15 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20696
20936
  }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
20697
20937
  kind: "mutation",
20698
20938
  auth: "admin"
20939
+ }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
20940
+ kind: "mutation",
20941
+ auth: "admin"
20942
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
20943
+ kind: "query",
20944
+ auth: "admin"
20945
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
20946
+ kind: "mutation",
20947
+ auth: "admin"
20699
20948
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
20700
20949
  kind: "query",
20701
20950
  auth: "admin"
@@ -23277,6 +23526,17 @@ var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
23277
23526
  */
23278
23527
  priority: number()
23279
23528
  })).readonly() });
23529
+ /**
23530
+ * The chosen outbound endpoint for notification artifacts. `baseUrl: null` =
23531
+ * AUTO (resolved from the candidate ranking at send time); `resolved` reports
23532
+ * what AUTO currently picks, so the UI can show the effective value either way.
23533
+ */
23534
+ var NotificationEndpointSchema = object({
23535
+ /** The operator's explicit choice, or null for AUTO. */
23536
+ baseUrl: string().nullable(),
23537
+ /** What the ranking currently resolves to (null when nothing is reachable). */
23538
+ resolved: string().nullable()
23539
+ });
23280
23540
  var AllowedAddressesSchema = object({
23281
23541
  /**
23282
23542
  * Allowlist of interface addresses operators have explicitly opted
@@ -23299,7 +23559,7 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
23299
23559
  * to avoid mixed-content blocks in the browser. The public
23300
23560
  * tunnel always emits `https://` regardless. */
23301
23561
  scheme: _enum(["http", "https"]).optional()
23302
- }), GetConnectionEndpointsResultSchema), method(_void(), AllowedAddressesSchema), method(AllowedAddressesSchema, object({ success: literal(true) }), { kind: "mutation" }), method(_void(), AllowedAddressesSchema, { kind: "mutation" });
23562
+ }), GetConnectionEndpointsResultSchema), method(_void(), NotificationEndpointSchema), method(object({ baseUrl: string().nullable() }), NotificationEndpointSchema, { kind: "mutation" }), method(_void(), AllowedAddressesSchema), method(AllowedAddressesSchema, object({ success: literal(true) }), { kind: "mutation" }), method(_void(), AllowedAddressesSchema, { kind: "mutation" });
23303
23563
  /**
23304
23564
  * mesh-network — collection cap for mesh-VPN providers.
23305
23565
  *
@@ -24211,7 +24471,12 @@ var RecordingDeviceUsageSchema = object({
24211
24471
  var RecordingLocationUsageSchema = object({
24212
24472
  /** StorageLocation id; null for the legacy/degraded single-root fallback. */
24213
24473
  locationId: string().nullable(),
24214
- /** Bytes of recordings stored on this location. */
24474
+ /** Every location id sharing this row's PHYSICAL volume (aliases). One row
24475
+ * is emitted per physical disk (2026-07-29): two locations on one root
24476
+ * previously rendered as two identical "disks" with a nonsensical used
24477
+ * split — hydrate attribution across aliases is arbitrary by nature. */
24478
+ locationIds: array(string()).optional(),
24479
+ /** Bytes of recordings stored on this PHYSICAL volume (all aliases). */
24215
24480
  usedBytes: number(),
24216
24481
  /** Free bytes on the location's volume; null when capacity is unknown (remote). */
24217
24482
  availableBytes: number().nullable(),
@@ -24323,6 +24588,44 @@ method(object({
24323
24588
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
24324
24589
  kind: "query",
24325
24590
  auth: "admin"
24591
+ }), method(object({
24592
+ deviceId: number(),
24593
+ aroundMs: number(),
24594
+ preRollSec: number().min(0).max(30).default(2),
24595
+ postRollSec: number().min(0).max(30).default(5),
24596
+ maxWidth: number().int().min(120).max(1280).default(480),
24597
+ fps: number().int().min(1).max(15).default(5)
24598
+ }), object({
24599
+ gifBase64: string(),
24600
+ fromMs: number(),
24601
+ toMs: number()
24602
+ }), {
24603
+ kind: "mutation",
24604
+ auth: "admin"
24605
+ }), method(object({
24606
+ deviceId: number(),
24607
+ aroundMs: number(),
24608
+ preRollSec: number().min(0).max(30).default(3),
24609
+ postRollSec: number().min(0).max(30).default(7),
24610
+ maxWidth: number().int().min(160).max(1920).default(640)
24611
+ }), object({
24612
+ clipBase64: string(),
24613
+ mime: string(),
24614
+ fromMs: number(),
24615
+ toMs: number(),
24616
+ bytes: number().int()
24617
+ }), {
24618
+ kind: "mutation",
24619
+ auth: "admin"
24620
+ }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
24621
+ kind: "mutation",
24622
+ auth: "admin"
24623
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
24624
+ kind: "query",
24625
+ auth: "admin"
24626
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
24627
+ kind: "mutation",
24628
+ auth: "admin"
24326
24629
  });
24327
24630
  /**
24328
24631
  * `recordingExport` cap — render a footage time range into a single downloadable
@@ -26125,6 +26428,12 @@ Object.freeze({
26125
26428
  addonId: null,
26126
26429
  access: "view"
26127
26430
  },
26431
+ "deviceManager.getDeviceStatusAggregateBatch": {
26432
+ capName: "device-manager",
26433
+ capScope: "system",
26434
+ addonId: null,
26435
+ access: "view"
26436
+ },
26128
26437
  "deviceManager.getLinkedDevices": {
26129
26438
  capName: "device-manager",
26130
26439
  capScope: "system",
@@ -27019,6 +27328,12 @@ Object.freeze({
27019
27328
  addonId: null,
27020
27329
  access: "view"
27021
27330
  },
27331
+ "localNetwork.getNotificationEndpoint": {
27332
+ capName: "local-network",
27333
+ capScope: "system",
27334
+ addonId: null,
27335
+ access: "view"
27336
+ },
27022
27337
  "localNetwork.getPreferred": {
27023
27338
  capName: "local-network",
27024
27339
  capScope: "system",
@@ -27043,6 +27358,12 @@ Object.freeze({
27043
27358
  addonId: null,
27044
27359
  access: "create"
27045
27360
  },
27361
+ "localNetwork.setNotificationEndpoint": {
27362
+ capName: "local-network",
27363
+ capScope: "system",
27364
+ addonId: null,
27365
+ access: "create"
27366
+ },
27046
27367
  "lockControl.lock": {
27047
27368
  capName: "lock-control",
27048
27369
  capScope: "device",
@@ -27685,6 +28006,12 @@ Object.freeze({
27685
28006
  addonId: null,
27686
28007
  access: "create"
27687
28008
  },
28009
+ "pipelineAnalytics.cancelMediaRelocate": {
28010
+ capName: "pipeline-analytics",
28011
+ capScope: "device",
28012
+ addonId: null,
28013
+ access: "create"
28014
+ },
27688
28015
  "pipelineAnalytics.clearTracks": {
27689
28016
  capName: "pipeline-analytics",
27690
28017
  capScope: "device",
@@ -27739,6 +28066,12 @@ Object.freeze({
27739
28066
  addonId: null,
27740
28067
  access: "view"
27741
28068
  },
28069
+ "pipelineAnalytics.getMediaRelocateStatus": {
28070
+ capName: "pipeline-analytics",
28071
+ capScope: "device",
28072
+ addonId: null,
28073
+ access: "view"
28074
+ },
27742
28075
  "pipelineAnalytics.getMotionEvents": {
27743
28076
  capName: "pipeline-analytics",
27744
28077
  capScope: "device",
@@ -27811,6 +28144,12 @@ Object.freeze({
27811
28144
  addonId: null,
27812
28145
  access: "create"
27813
28146
  },
28147
+ "pipelineAnalytics.relocateMedia": {
28148
+ capName: "pipeline-analytics",
28149
+ capScope: "device",
28150
+ addonId: null,
28151
+ access: "create"
28152
+ },
27814
28153
  "pipelineAnalytics.searchObjectEvents": {
27815
28154
  capName: "pipeline-analytics",
27816
28155
  capScope: "device",
@@ -28573,6 +28912,12 @@ Object.freeze({
28573
28912
  addonId: null,
28574
28913
  access: "create"
28575
28914
  },
28915
+ "recording.cancelRelocate": {
28916
+ capName: "recording",
28917
+ capScope: "system",
28918
+ addonId: null,
28919
+ access: "create"
28920
+ },
28576
28921
  "recording.deleteFootprint": {
28577
28922
  capName: "recording",
28578
28923
  capScope: "system",
@@ -28603,6 +28948,12 @@ Object.freeze({
28603
28948
  addonId: null,
28604
28949
  access: "view"
28605
28950
  },
28951
+ "recording.getRelocateStatus": {
28952
+ capName: "recording",
28953
+ capScope: "system",
28954
+ addonId: null,
28955
+ access: "view"
28956
+ },
28606
28957
  "recording.getStorageUsage": {
28607
28958
  capName: "recording",
28608
28959
  capScope: "system",
@@ -28633,6 +28984,24 @@ Object.freeze({
28633
28984
  addonId: null,
28634
28985
  access: "view"
28635
28986
  },
28987
+ "recording.relocateFootage": {
28988
+ capName: "recording",
28989
+ capScope: "system",
28990
+ addonId: null,
28991
+ access: "create"
28992
+ },
28993
+ "recording.renderClip": {
28994
+ capName: "recording",
28995
+ capScope: "system",
28996
+ addonId: null,
28997
+ access: "create"
28998
+ },
28999
+ "recording.renderGif": {
29000
+ capName: "recording",
29001
+ capScope: "system",
29002
+ addonId: null,
29003
+ access: "create"
29004
+ },
28636
29005
  "recording.rescanStorage": {
28637
29006
  capName: "recording",
28638
29007
  capScope: "system",
@@ -29227,6 +29596,12 @@ Object.freeze({
29227
29596
  addonId: null,
29228
29597
  access: "create"
29229
29598
  },
29599
+ "streamBroker.renderPreBufferClip": {
29600
+ capName: "stream-broker",
29601
+ capScope: "system",
29602
+ addonId: null,
29603
+ access: "create"
29604
+ },
29230
29605
  "streamBroker.restartProfile": {
29231
29606
  capName: "stream-broker",
29232
29607
  capScope: "system",