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