@camstack/addon-provider-onvif 1.2.6 → 1.2.8

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 +1 -1
package/dist/addon.mjs CHANGED
@@ -3,7 +3,7 @@ import { createRequire } from "node:module";
3
3
  var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
4
4
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
5
5
  //#endregion
6
- //#region ../types/dist/event-category-BLcNejAE.mjs
6
+ //#region ../types/dist/event-category-Bz24uP1U.mjs
7
7
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
8
8
  EventCategory["SystemBoot"] = "system.boot";
9
9
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -274,6 +274,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
274
274
  */
275
275
  EventCategory["DeviceStateChanged"] = "device.state-changed";
276
276
  /**
277
+ * Frame occupancy for a camera CHANGED — a tracked object was gained or
278
+ * lost. Carries `{ deviceId, totalObjects, byClass, zones }`.
279
+ *
280
+ * Emitted only on a change, so a steady scene is silent. It exists so a
281
+ * client can stop polling `zoneAnalytics.getCurrentSnapshot`: that was the
282
+ * one live badge with no push signal at all, and it cost a request every
283
+ * four seconds per visible camera.
284
+ *
285
+ * Like every event it is telemetry and may be dropped ([D8]) — a consumer
286
+ * keeps a slow reconcile rather than trusting it alone.
287
+ */
288
+ EventCategory["ZoneAnalyticsOccupancyChanged"] = "zone-analytics.occupancy-changed";
289
+ /**
277
290
  * Cap event fired by every device that registers the `battery`
278
291
  * capability. Mirrors the cap definition's `onStatusChanged`. Carries
279
292
  * `{ deviceId, status: BatteryStatus }`. Subscribers (alert center,
@@ -7199,35 +7212,22 @@ var ConvertResultSchema = object({
7199
7212
  */
7200
7213
  var RecordingWeekdaySchema = number().int().min(0).max(6);
7201
7214
  var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
7202
- var RecordingScheduleSchema = discriminatedUnion("kind", [object({ kind: literal("always") }), object({
7203
- kind: literal("timeOfDay"),
7204
- start: string().regex(HHMM),
7205
- end: string().regex(HHMM),
7206
- /** Restrict to these weekdays; omit = every day. */
7207
- days: array(RecordingWeekdaySchema).optional()
7208
- })]);
7209
- var RecordingModeSchema = _enum([
7210
- "continuous",
7211
- "onMotion",
7212
- "onAudioThreshold"
7213
- ]);
7214
7215
  /**
7215
- * First-class, authoritative per-camera storage mode — the explicit choice the
7216
- * UI reads directly (never inferred from `rules`):
7217
- * - `off` — not recording.
7218
- * - `events` — record only around triggers (motion / audio threshold),
7219
- * with pre/post-buffer.
7220
- * - `continuous` — record 24/7 within the schedule.
7216
+ * DERIVED per-camera storage summary — the single field cheap consumers read
7217
+ * (the viewer's status dot, the camera list) instead of walking `bands`:
7218
+ * - `off` — no band covers the camera (or it is disabled).
7219
+ * - `events` — every band records around triggers only.
7220
+ * - `continuous` — at least one band records continuously.
7221
7221
  *
7222
- * `mode` compiles one-way to the internal `rules[]` consumed by the policy
7223
- * engine (see `compileRules`); `rules[]` is never authored directly anymore.
7222
+ * NEVER authored: the recorder stamps it from the authoritative `bands` on
7223
+ * every save (`activeModeForConfig`). Writing it has no effect.
7224
7224
  */
7225
7225
  var RecordingStorageModeSchema = _enum([
7226
7226
  "off",
7227
7227
  "events",
7228
7228
  "continuous"
7229
7229
  ]);
7230
- /** Which detectors trigger an `events`-mode recording. */
7230
+ /** Which detectors trigger an `events`-mode band. */
7231
7231
  var RecordingTriggersSchema = object({
7232
7232
  motion: boolean().optional(),
7233
7233
  audioThresholdDbfs: number().optional()
@@ -7263,18 +7263,6 @@ var RecordingBandSchema = object({
7263
7263
  preBufferSec: number().min(0).optional(),
7264
7264
  postBufferSec: number().min(0).optional()
7265
7265
  });
7266
- var RecordingRuleSchema = object({
7267
- schedule: RecordingScheduleSchema,
7268
- mode: RecordingModeSchema,
7269
- /** Seconds of footage to retain BEFORE a trigger (applied at keep/discard). */
7270
- preBufferSec: number().min(0).default(0),
7271
- /** Keep recording until this many seconds after the last trigger. */
7272
- postBufferSec: number().min(0).default(0),
7273
- /** Each new trigger restarts the post-buffer window. */
7274
- resetTimeoutOnNewEvent: boolean().default(true),
7275
- /** onAudioThreshold only — dBFS level that counts as a trigger. */
7276
- thresholdDbfs: number().optional()
7277
- });
7278
7266
  /**
7279
7267
  * Per-device retention overrides. Every field is optional; an unset or `0`
7280
7268
  * value inherits the node-wide recorder default. Only footage-lifetime limits
@@ -7308,40 +7296,28 @@ var ScrubThumbnailPresetSchema = _enum([
7308
7296
  /**
7309
7297
  * The full per-camera recording intent — the wire shape of a RecordingTarget.
7310
7298
  *
7311
- * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
7312
- * are its mode-specific parameters. `rules` is a DEPRECATED authoring input kept
7313
- * only for transition + migration (`migrateRulesToMode`); the policy engine
7314
- * consumes the compiled output of `compileRules(config)`, never `rules` directly.
7299
+ * `bands` is the ONLY authored recording intent: what to record, when, and on
7300
+ * which trigger. `mode` is a derived summary the recorder stamps on save; every
7301
+ * other field is a storage knob (profiles, segment length, retention, scrub).
7302
+ *
7303
+ * STRICT on purpose: the legacy authoring surface (`schedule`/`schedules`/
7304
+ * `triggers`/`preBufferSec`/`postBufferSec`/`rules`) was retired 2026-07-30.
7305
+ * A stale caller must fail loudly — silently stripping its legacy intent would
7306
+ * persist a band-less config, i.e. silently stop recording the camera.
7315
7307
  */
7316
7308
  var RecordingConfigSchema = object({
7317
7309
  enabled: boolean(),
7318
- /** Authoritative storage mode. Absent on legacy targets derived once via
7319
- * `migrateRulesToMode`, then persisted. */
7310
+ /** DERIVED summary of `bands`, stamped by the recorder on every save.
7311
+ * Authoring it has no effect — see {@link RecordingStorageModeSchema}. */
7320
7312
  mode: RecordingStorageModeSchema.optional(),
7321
7313
  profiles: array(CamProfileSchema).optional(),
7322
7314
  segmentSeconds: number().int().positive().optional(),
7323
- /** Shared recording time-bands for `events` & `continuous` — record only when
7324
- * the wall-clock falls inside one of these windows. Omit or empty = always.
7325
- * `continuous` compiles to one rule per band; `events` to band × trigger. */
7326
- schedules: array(RecordingScheduleSchema).optional(),
7327
- /** Legacy single-band predecessor of `schedules`. Read-compat only — it is
7328
- * normalized into `schedules` on read and never written going forward. (Not
7329
- * tagged `@deprecated`: the normalization paths must read it cast-free.) */
7330
- schedule: RecordingScheduleSchema.optional(),
7331
- /** `events`-mode only — which detectors trigger a recording. */
7332
- triggers: RecordingTriggersSchema.optional(),
7333
- /** `events`-mode only — seconds retained before / after a trigger. */
7334
- preBufferSec: number().min(0).optional(),
7335
- postBufferSec: number().min(0).optional(),
7336
- /** DEPRECATED authoring input; retained for migration/transition. */
7337
- rules: array(RecordingRuleSchema).optional(),
7338
7315
  /**
7339
- * AUTHORITATIVE mode-per-band recording model (recorder). When present it
7340
- * is the single source of truth; the legacy `mode`/`schedules`/`schedule`/
7341
- * `triggers`/`rules` fields above are kept for READ-COMPAT only and are
7342
- * derived into bands once via `migrateConfigToBands`.
7316
+ * AUTHORITATIVE mode-per-band recording model the single source of truth
7317
+ * the recorder's band engine consumes. An empty array = record nothing;
7318
+ * "off" is the absence of a covering band, never a band value.
7343
7319
  */
7344
- bands: array(RecordingBandSchema).optional(),
7320
+ bands: array(RecordingBandSchema).default([]),
7345
7321
  retention: RecordingRetentionSchema.optional(),
7346
7322
  /**
7347
7323
  * Per-camera scrub-thumbnail fidelity preset (resolution + JPEG quality for
@@ -7349,8 +7325,15 @@ var RecordingConfigSchema = object({
7349
7325
  * windows only — existing sheets are immutable, and each window's index
7350
7326
  * carries its own tile dims so mixed-preset history renders correctly.
7351
7327
  */
7352
- scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7353
- });
7328
+ scrubThumbnails: ScrubThumbnailPresetSchema.optional(),
7329
+ /**
7330
+ * OPT-IN thumbnail-strip generation for this camera: every keyframe of the
7331
+ * low recording saved as a JPEG (the fast-drag scrub depth), a derived
7332
+ * cache that eviction reclaims with the footage. Absent/false = no strips
7333
+ * are written and scrub reads exact keyframes at every velocity.
7334
+ */
7335
+ stripsEnabled: boolean().optional()
7336
+ }).strict();
7354
7337
  /**
7355
7338
  * Ops-log — the durable, append-only operations audit shared by the
7356
7339
  * recordings and events management surfaces.
@@ -7369,7 +7352,8 @@ var OpsLogOpSchema = _enum([
7369
7352
  "prune",
7370
7353
  "manual-delete",
7371
7354
  "rescan",
7372
- "retention-run"
7355
+ "retention-run",
7356
+ "relocate"
7373
7357
  ]);
7374
7358
  /** Why the operation ran. */
7375
7359
  var OpsLogReasonSchema = _enum([
@@ -7408,6 +7392,55 @@ var OpsLogQueryInputSchema = object({
7408
7392
  limit: number().int().min(1).max(1e3).optional()
7409
7393
  });
7410
7394
  /**
7395
+ * Entity-relocation job state (storage entity-routing spec, Phase 4).
7396
+ *
7397
+ * One shape shared by the recorder's `relocateFootage` (segments + strips) and
7398
+ * pipeline-analytics' `relocateMedia` (event media blobs) so the admin Data
7399
+ * page renders both movers with one component. Jobs are in-RAM (a restart
7400
+ * forgets them — re-running is safe by construction: copy-if-absent, delete
7401
+ * after verify) and each completed/failed run also lands one durable ops-log
7402
+ * row on the owning addon's surface.
7403
+ */
7404
+ var RelocateJobStateSchema = _enum([
7405
+ "running",
7406
+ "done",
7407
+ "failed",
7408
+ "cancelled"
7409
+ ]);
7410
+ var RelocateJobSchema = object({
7411
+ jobId: string(),
7412
+ state: RelocateJobStateSchema,
7413
+ /** Source location — for media relocation this is informational ('*': rows
7414
+ * move from wherever they are to the target). */
7415
+ fromLocationId: string(),
7416
+ toLocationId: string(),
7417
+ /** Scoped device, or null = every device. */
7418
+ deviceId: number().nullable(),
7419
+ /** What the job moves (owner-addon specific: segments/strips or media). */
7420
+ entities: array(string()),
7421
+ filesMoved: number().int(),
7422
+ bytesMoved: number().int(),
7423
+ /** Total files discovered up front; null while (or when) unknown. */
7424
+ filesTotal: number().int().nullable(),
7425
+ startedAt: number(),
7426
+ finishedAt: number().nullable(),
7427
+ error: string().nullable()
7428
+ });
7429
+ var RelocateFootageInputSchema = object({
7430
+ deviceId: number().optional(),
7431
+ fromLocationId: string(),
7432
+ toLocationId: string(),
7433
+ entities: array(_enum(["segments", "strips"])).optional(),
7434
+ /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7435
+ * never allowed to starve live writers. */
7436
+ throttleMbps: number().min(1).max(1e3).optional()
7437
+ });
7438
+ var RelocateMediaInputSchema = object({
7439
+ deviceId: number().optional(),
7440
+ toLocationId: string(),
7441
+ throttleMbps: number().min(1).max(1e3).optional()
7442
+ });
7443
+ /**
7411
7444
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
7412
7445
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
7413
7446
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -7457,6 +7490,13 @@ var StorageLocationSchema = object({
7457
7490
  nodeId: string().optional(),
7458
7491
  isDefault: boolean().default(false),
7459
7492
  isSystem: boolean().default(false),
7493
+ /** COMPUTED at read time by the orchestrator (statfs of the backing volume
7494
+ * for node-local locations it can reach) — never persisted, absent when the
7495
+ * volume is remote/unreachable. The single capacity truth every UI reads. */
7496
+ capacity: object({
7497
+ totalBytes: number(),
7498
+ availableBytes: number()
7499
+ }).nullable().optional(),
7460
7500
  createdAt: number(),
7461
7501
  updatedAt: number()
7462
7502
  });
@@ -8224,7 +8264,8 @@ var NcTaxonomyEntrySchema = object({
8224
8264
  /** Macro/category parent for grouping ('car' → 'vehicle'); null for a top. */
8225
8265
  parentKind: string().nullable()
8226
8266
  });
8227
- object({
8267
+ /** The complete NC picker taxonomy — three grouped buckets. */
8268
+ var NcTaxonomySchema = object({
8228
8269
  videoClasses: array(NcTaxonomyEntrySchema),
8229
8270
  audioKinds: array(NcTaxonomyEntrySchema),
8230
8271
  labels: array(NcTaxonomyEntrySchema)
@@ -9054,6 +9095,7 @@ function startReachabilityPoll(options) {
9054
9095
  timer = void 0;
9055
9096
  } };
9056
9097
  }
9098
+ new Set(["devices", "classes"]);
9057
9099
  /**
9058
9100
  * Shared geometry vocabulary for on-frame shape caps — privacy-mask,
9059
9101
  * motion-zones, and the detection zones/lines editor all speak this one
@@ -9212,6 +9254,29 @@ var NcOccupancyConditionSchema = object({
9212
9254
  count: number().int().min(0).default(1),
9213
9255
  sustainSeconds: number().int().min(0).max(3600).default(15)
9214
9256
  });
9257
+ /**
9258
+ * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
9259
+ *
9260
+ * The values are not symmetric, and deliberately so — the absent value has to
9261
+ * mean exactly what every rule authored before this condition existed already
9262
+ * does:
9263
+ * - `enter` — entries and every NON-crossing record (movement state,
9264
+ * package, sensor). Exits are rejected. **This is the absent behaviour**:
9265
+ * an operator who never asked for exits must not start receiving them.
9266
+ * - `exit` — ONLY an exit crossing. A record that is not a crossing at all
9267
+ * fails closed, because "the car left the drive" is a question about a
9268
+ * boundary, not about a detection.
9269
+ * - `any` — no direction filter; entries, exits and non-crossings alike.
9270
+ *
9271
+ * A rule asking for a direction should normally also scope `zones`, which the
9272
+ * engine evaluates against the crossed zone as well as the current membership
9273
+ * (an exit's membership no longer contains the zone it just left).
9274
+ */
9275
+ var NcCrossingSchema = _enum([
9276
+ "enter",
9277
+ "exit",
9278
+ "any"
9279
+ ]);
9215
9280
  /** Admin-zone membership condition (zone IDs as stamped by the ZoneEngine). */
9216
9281
  var NcZoneConditionSchema = object({
9217
9282
  ids: array(string().min(1)).min(1),
@@ -9236,6 +9301,13 @@ var NcConditionsSchema = object({
9236
9301
  /** Veto zones — any hit fails the rule. */
9237
9302
  zonesExclude: array(string().min(1)).optional(),
9238
9303
  /**
9304
+ * Zone-crossing direction. IMMEDIATE only — a crossing is a per-event fact
9305
+ * and a closed track carries none, so a `track-end` rule asking for one
9306
+ * fails closed (use `zones`, which tests `zonesVisited`). ABSENT = `enter`,
9307
+ * which is exactly today's behaviour. See {@link NcCrossingSchema}.
9308
+ */
9309
+ crossing: NcCrossingSchema.optional(),
9310
+ /**
9239
9311
  * Exact (case-insensitive) match on the record's collapsed `label`
9240
9312
  * (identity name / plate text / subclass).
9241
9313
  */
@@ -9370,17 +9442,85 @@ var NcRuleTargetSchema = object({
9370
9442
  * - `keyFrame` — the clean scene frame (no subject box).
9371
9443
  * - `none` — no attachment.
9372
9444
  */
9373
- var NcMediaPolicySchema = object({ attach: _enum([
9374
- "best",
9375
- "best-matching",
9376
- "keyFrame",
9377
- "none"
9378
- ]).default("best") });
9445
+ /**
9446
+ * WHAT THE PICTURE SHOWS — chosen explicitly, because the implicit ladders
9447
+ * conflate it with the selection strategy and betray the request: asking for
9448
+ * the clean scene frame on an object-event owner used to start at
9449
+ * `fullFrameBoxed`, i.e. the annotated frame (2026-07-30).
9450
+ * - `cropped` — the subject, tight. What "who is at the door" wants.
9451
+ * - `full` — the clean scene, no annotation. What "what is going on" wants.
9452
+ * - `boxed` — the scene WITH the detection boxes drawn, for verifying what
9453
+ * the pipeline actually saw.
9454
+ */
9455
+ var NcMediaFrameSchema = _enum([
9456
+ "cropped",
9457
+ "full",
9458
+ "boxed"
9459
+ ]);
9460
+ var NcMediaPolicySchema = object({
9461
+ attach: _enum([
9462
+ "best",
9463
+ "best-matching",
9464
+ "keyFrame",
9465
+ "none"
9466
+ ]).default("best"),
9467
+ /** What the still shows. Absent = `cropped` (the historical `best` shape). */
9468
+ frame: NcMediaFrameSchema.optional(),
9469
+ /** Crop the attached still to the rule's condition-zone bbox (padded) —
9470
+ * "show me the ZONE", not the whole scene or the subject crop. */
9471
+ zoneCrop: boolean().optional(),
9472
+ /**
9473
+ * Also attach a short GIF cut from the stream broker's clip ring around the
9474
+ * event — NOT from the recording, so the camera does not have to be
9475
+ * recording, and the window sits AROUND the moment instead of a segment
9476
+ * behind it. Fail-closed: a window the ring does not cover contributes no
9477
+ * gif, never a failed notification.
9478
+ */
9479
+ gif: boolean().optional(),
9480
+ /**
9481
+ * Also attach a short MP4 CLIP of the same cut. Same source and the same
9482
+ * fail-closed rule as `gif`. Prefer it where the backend takes video
9483
+ * (telegram, discord, zentik, webhook); backends that do not are handled by
9484
+ * the degrade engine, which drops the video and keeps the still.
9485
+ */
9486
+ clip: boolean().optional(),
9487
+ /** Seconds of footage BEFORE / AFTER the event instant. Defaults 3 / 7. */
9488
+ clipPreRollSec: number().int().min(0).max(30).optional(),
9489
+ clipPostRollSec: number().int().min(0).max(30).optional(),
9490
+ /**
9491
+ * Which stream profile the footage is cut from. Absent = the CHEAPEST
9492
+ * assigned profile: a notification is watched on a phone, so the 4K
9493
+ * rendition would burn CPU to produce a file the client downscales anyway.
9494
+ * A profile that is not assigned falls back to the cheapest, and the render
9495
+ * reports which one actually ran.
9496
+ */
9497
+ profile: CamProfileSchema.optional()
9498
+ });
9499
+ /**
9500
+ * Cooldown GRANULARITY over the subject's class — how much a fired
9501
+ * notification suppresses.
9502
+ * - `shared` (default, and the absent value) — one window for the whole
9503
+ * rule/scope: a cat silences the next dog for `cooldownSec`.
9504
+ * - `per-class` — an independent window per detected class, so cat→dog fires
9505
+ * at once and cat→cat still waits.
9506
+ *
9507
+ * AUDIO subjects are ALWAYS per-class regardless of this setting: a scream
9508
+ * must not be swallowed by a bark's window (the precedent this generalizes —
9509
+ * see `cooldownKey` in the rule engine).
9510
+ */
9511
+ var NcThrottleGranularitySchema = _enum(["shared", "per-class"]);
9379
9512
  /** Throttle — cooldown survives restarts (rebuilt from the outbox on boot). */
9380
9513
  var NcThrottleSchema = object({
9381
9514
  cooldownSec: number().int().min(0).max(86400).default(60),
9382
9515
  /** `rule` = one shared cooldown; `rule-device` = per-camera cooldown. */
9383
- scope: _enum(["rule", "rule-device"]).default("rule-device")
9516
+ scope: _enum(["rule", "rule-device"]).default("rule-device"),
9517
+ /**
9518
+ * Class granularity of the cooldown key. Optional rather than defaulted:
9519
+ * a Zod default does NOT run on the addon→addon cap path, so a persisted
9520
+ * rule authored before this field simply carries none — and the engine
9521
+ * reads absent as `shared`, the pre-existing behaviour.
9522
+ */
9523
+ granularity: NcThrottleGranularitySchema.optional()
9384
9524
  });
9385
9525
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
9386
9526
  var NcRuleInputSchema = object({
@@ -9389,7 +9529,19 @@ var NcRuleInputSchema = object({
9389
9529
  delivery: NcDeliverySchema,
9390
9530
  conditions: NcConditionsSchema.default({}),
9391
9531
  schedule: NcScheduleSchema.optional(),
9392
- targets: array(NcRuleTargetSchema).min(1),
9532
+ /** May be empty when `targetUsers` addresses at least one user — the
9533
+ * "at least one addressee" invariant is enforced by the provider, because
9534
+ * a cross-field refine here would break `NcRulePatchSchema.partial()`. */
9535
+ targets: array(NcRuleTargetSchema),
9536
+ /**
9537
+ * USERS this rule addresses in addition to `targets` (Phase 4). At fire
9538
+ * time each user fans out to the personal targets they own
9539
+ * (`config.ownerUserId`), filtered by that user's `allowedDevices` for the
9540
+ * firing camera — a user is never notified about a device they cannot open.
9541
+ * Per-user opt-outs (`disabledTargetIds`) still apply to the fanned-out
9542
+ * targets.
9543
+ */
9544
+ targetUsers: array(string()).optional(),
9393
9545
  media: NcMediaPolicySchema.default({ attach: "best" }),
9394
9546
  throttle: NcThrottleSchema.default({
9395
9547
  cooldownSec: 60,
@@ -9476,6 +9628,7 @@ var NcConditionDescriptorSchema = object({
9476
9628
  "schedule",
9477
9629
  "plateMatcher",
9478
9630
  "packagePhase",
9631
+ "crossingSelect",
9479
9632
  "polygonDraw",
9480
9633
  "occupancy"
9481
9634
  ]),
@@ -9602,7 +9755,10 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
9602
9755
  }), object({ results: array(NcTestResultSchema) }), {
9603
9756
  kind: "mutation",
9604
9757
  auth: "admin"
9605
- }), method(object({}), object({ catalog: array(NcConditionDescriptorSchema) })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" });
9758
+ }), method(object({}), object({
9759
+ catalog: array(NcConditionDescriptorSchema),
9760
+ taxonomy: NcTaxonomySchema.optional()
9761
+ })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" });
9606
9762
  /**
9607
9763
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
9608
9764
  *
@@ -10339,6 +10495,28 @@ method(object({
10339
10495
  }), object({ success: literal(true) }), {
10340
10496
  kind: "mutation",
10341
10497
  auth: "admin"
10498
+ }), method(object({
10499
+ deviceId: number(),
10500
+ /** Absent = the LOWEST assigned profile — a notification attachment is
10501
+ * watched on a phone, and the cheap rendition is the right default. */
10502
+ profile: CamProfileSchema.optional(),
10503
+ aroundMs: number(),
10504
+ preRollSec: number().min(0).max(20).default(3),
10505
+ postRollSec: number().min(0).max(20).default(5),
10506
+ format: _enum(["gif", "mp4"]).default("gif"),
10507
+ maxWidth: number().int().min(120).max(1920).default(480),
10508
+ /** GIF only — MP4 keeps the source cadence. */
10509
+ fps: number().int().min(1).max(15).default(5)
10510
+ }), object({
10511
+ base64: string(),
10512
+ mime: string(),
10513
+ bytes: number().int(),
10514
+ /** The profile actually rendered (what the default resolved to). */
10515
+ profile: CamProfileSchema,
10516
+ durationMs: number()
10517
+ }), {
10518
+ kind: "mutation",
10519
+ auth: "admin"
10342
10520
  }), method(_void(), array(CameraStreamSchema).readonly()), method(_void(), array(ProfileSlotSchema).readonly()), method(object({ brokerId: string() }), BrokerStatsSchema), method(object({ brokerId: string() }), object({
10343
10521
  probed: boolean(),
10344
10522
  summary: string()
@@ -16227,7 +16405,10 @@ method(object({
16227
16405
  }), method(object({
16228
16406
  deviceId: number(),
16229
16407
  caps: array(string()).readonly().optional()
16230
- }), record(string(), unknown().nullable()));
16408
+ }), record(string(), unknown().nullable())), method(object({
16409
+ deviceIds: array(number()).readonly(),
16410
+ caps: array(string()).readonly().optional()
16411
+ }), record(string(), record(string(), unknown().nullable())));
16231
16412
  method(object({ deviceId: number() }), record(string(), record(string(), unknown()))), method(object({
16232
16413
  deviceId: number(),
16233
16414
  capName: string()
@@ -17158,6 +17339,36 @@ var TargetKindSchema = object({
17158
17339
  icon: string(),
17159
17340
  /** Stamped by each provider so the concat-fanned catalog stays routable. */
17160
17341
  addonId: string(),
17342
+ /**
17343
+ * URL of the kind's bundled BRAND icon, served by the providing addon over
17344
+ * its own `addon-routes` surface (`/addon/<addonId>/icons/<kind>`). Absent
17345
+ * when the addon bundles no icon for that kind — the client then falls back
17346
+ * to a neutral glyph rather than rendering the raw `icon` NAME as text.
17347
+ *
17348
+ * Root-relative on purpose: it resolves against whatever origin serves a web
17349
+ * client, and a native client joins it onto its own hub base.
17350
+ *
17351
+ * DECLARED here deliberately. It used to travel as an undeclared passthrough
17352
+ * field that survived only because the runtime cap-router forwards provider
17353
+ * output verbatim — so every consumer had to re-declare it by hand to stop
17354
+ * its own Zod parse from stripping it, and the whole arrangement would have
17355
+ * broken silently the moment output validation was tightened anywhere.
17356
+ */
17357
+ iconUrl: string().optional(),
17358
+ /**
17359
+ * Media type of {@link iconUrl} (`image/svg+xml`, `image/png`, …).
17360
+ *
17361
+ * The server knows this and therefore says it, because the client cannot
17362
+ * safely guess: a React-Native client renders SVG and raster through two
17363
+ * DIFFERENT components (`react-native-svg` vs `expo-image` — expo-image does
17364
+ * not decode SVG on iOS/Android), so without this it silently fell back to a
17365
+ * placeholder glyph for every vector icon while the web build looked fine.
17366
+ *
17367
+ * Absent when {@link iconUrl} is absent, or for a legacy provider that has
17368
+ * not been updated — a client that cannot determine the type should prefer
17369
+ * its raster path, which is the safe default for an unknown image.
17370
+ */
17371
+ iconMediaType: string().optional(),
17161
17372
  configSchema: ConfigSchemaPassthrough,
17162
17373
  supportsDiscovery: boolean(),
17163
17374
  caps: TargetKindCapsSchema
@@ -17605,6 +17816,29 @@ var MotionEventSchema = object({
17605
17816
  * Absent on legacy rows ⇒ treat as `pipeline`.
17606
17817
  */
17607
17818
  var DetectionSourceSchema = _enum(["pipeline", "onboard"]);
17819
+ /**
17820
+ * The confirmed zone crossing that produced an object event. Present ONLY on
17821
+ * an event emitted BY a crossing (`zone.enter` / `zone.exit`); a movement-state
17822
+ * event (`object.entering` / `leaving` / `stationary` / `loitering`) and an
17823
+ * appearance event carry none, so a rule asking for a direction fails closed
17824
+ * on them.
17825
+ *
17826
+ * Exactly ONE crossing per event: the emitter turns each confirmed crossing
17827
+ * into its own event, so a frame in which a track enters A while leaving B
17828
+ * produces two events with two directions — never one ambiguous row.
17829
+ *
17830
+ * `zoneId` is load-bearing for an EXIT: the event's `zones` list is the
17831
+ * membership the box has NOW, and by definition it no longer contains the zone
17832
+ * that was just left. Without the id here, a zone-scoped rule could never match
17833
+ * the exit it asked for.
17834
+ */
17835
+ var ZoneCrossingSchema = object({
17836
+ direction: _enum(["enter", "exit"]),
17837
+ /** Admin zone id crossed. */
17838
+ zoneId: string(),
17839
+ /** Zone display name at crossing time (falls back to the id). */
17840
+ zoneName: string().optional()
17841
+ });
17608
17842
  var ObjectEventSchema = object({
17609
17843
  ...BaseEventFields,
17610
17844
  kind: literal("object"),
@@ -17631,6 +17865,12 @@ var ObjectEventSchema = object({
17631
17865
  zones: array(string()).readonly().optional(),
17632
17866
  /** Omitted in slim projection. */
17633
17867
  state: TrackStateSchema.optional(),
17868
+ /**
17869
+ * The zone crossing this event IS, when it is one. Absent on every other
17870
+ * event kind (movement state, appearance, package) — see
17871
+ * {@link ZoneCrossingSchema}. Omitted in slim projection.
17872
+ */
17873
+ zoneCrossing: ZoneCrossingSchema.optional(),
17634
17874
  /** Detection-frame dimensions in pixels — let consumers normalize the
17635
17875
  * pixel-space `bbox` onto a displayed image. Omitted in slim projection. */
17636
17876
  frameWidth: number().optional(),
@@ -17889,6 +18129,15 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
17889
18129
  }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
17890
18130
  kind: "mutation",
17891
18131
  auth: "admin"
18132
+ }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
18133
+ kind: "mutation",
18134
+ auth: "admin"
18135
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
18136
+ kind: "query",
18137
+ auth: "admin"
18138
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
18139
+ kind: "mutation",
18140
+ auth: "admin"
17892
18141
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
17893
18142
  kind: "query",
17894
18143
  auth: "admin"
@@ -20419,6 +20668,17 @@ var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
20419
20668
  */
20420
20669
  priority: number()
20421
20670
  })).readonly() });
20671
+ /**
20672
+ * The chosen outbound endpoint for notification artifacts. `baseUrl: null` =
20673
+ * AUTO (resolved from the candidate ranking at send time); `resolved` reports
20674
+ * what AUTO currently picks, so the UI can show the effective value either way.
20675
+ */
20676
+ var NotificationEndpointSchema = object({
20677
+ /** The operator's explicit choice, or null for AUTO. */
20678
+ baseUrl: string().nullable(),
20679
+ /** What the ranking currently resolves to (null when nothing is reachable). */
20680
+ resolved: string().nullable()
20681
+ });
20422
20682
  var AllowedAddressesSchema = object({
20423
20683
  /**
20424
20684
  * Allowlist of interface addresses operators have explicitly opted
@@ -20441,7 +20701,7 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
20441
20701
  * to avoid mixed-content blocks in the browser. The public
20442
20702
  * tunnel always emits `https://` regardless. */
20443
20703
  scheme: _enum(["http", "https"]).optional()
20444
- }), GetConnectionEndpointsResultSchema), method(_void(), AllowedAddressesSchema), method(AllowedAddressesSchema, object({ success: literal(true) }), { kind: "mutation" }), method(_void(), AllowedAddressesSchema, { kind: "mutation" });
20704
+ }), 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" });
20445
20705
  /**
20446
20706
  * mesh-network — collection cap for mesh-VPN providers.
20447
20707
  *
@@ -21282,7 +21542,12 @@ var RecordingDeviceUsageSchema = object({
21282
21542
  var RecordingLocationUsageSchema = object({
21283
21543
  /** StorageLocation id; null for the legacy/degraded single-root fallback. */
21284
21544
  locationId: string().nullable(),
21285
- /** Bytes of recordings stored on this location. */
21545
+ /** Every location id sharing this row's PHYSICAL volume (aliases). One row
21546
+ * is emitted per physical disk (2026-07-29): two locations on one root
21547
+ * previously rendered as two identical "disks" with a nonsensical used
21548
+ * split — hydrate attribution across aliases is arbitrary by nature. */
21549
+ locationIds: array(string()).optional(),
21550
+ /** Bytes of recordings stored on this PHYSICAL volume (all aliases). */
21286
21551
  usedBytes: number(),
21287
21552
  /** Free bytes on the location's volume; null when capacity is unknown (remote). */
21288
21553
  availableBytes: number().nullable(),
@@ -21394,6 +21659,44 @@ method(object({
21394
21659
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
21395
21660
  kind: "query",
21396
21661
  auth: "admin"
21662
+ }), method(object({
21663
+ deviceId: number(),
21664
+ aroundMs: number(),
21665
+ preRollSec: number().min(0).max(30).default(2),
21666
+ postRollSec: number().min(0).max(30).default(5),
21667
+ maxWidth: number().int().min(120).max(1280).default(480),
21668
+ fps: number().int().min(1).max(15).default(5)
21669
+ }), object({
21670
+ gifBase64: string(),
21671
+ fromMs: number(),
21672
+ toMs: number()
21673
+ }), {
21674
+ kind: "mutation",
21675
+ auth: "admin"
21676
+ }), method(object({
21677
+ deviceId: number(),
21678
+ aroundMs: number(),
21679
+ preRollSec: number().min(0).max(30).default(3),
21680
+ postRollSec: number().min(0).max(30).default(7),
21681
+ maxWidth: number().int().min(160).max(1920).default(640)
21682
+ }), object({
21683
+ clipBase64: string(),
21684
+ mime: string(),
21685
+ fromMs: number(),
21686
+ toMs: number(),
21687
+ bytes: number().int()
21688
+ }), {
21689
+ kind: "mutation",
21690
+ auth: "admin"
21691
+ }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
21692
+ kind: "mutation",
21693
+ auth: "admin"
21694
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
21695
+ kind: "query",
21696
+ auth: "admin"
21697
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
21698
+ kind: "mutation",
21699
+ auth: "admin"
21397
21700
  });
21398
21701
  /**
21399
21702
  * `recordingExport` cap — render a footage time range into a single downloadable
@@ -22985,6 +23288,12 @@ Object.freeze({
22985
23288
  addonId: null,
22986
23289
  access: "view"
22987
23290
  },
23291
+ "deviceManager.getDeviceStatusAggregateBatch": {
23292
+ capName: "device-manager",
23293
+ capScope: "system",
23294
+ addonId: null,
23295
+ access: "view"
23296
+ },
22988
23297
  "deviceManager.getLinkedDevices": {
22989
23298
  capName: "device-manager",
22990
23299
  capScope: "system",
@@ -23879,6 +24188,12 @@ Object.freeze({
23879
24188
  addonId: null,
23880
24189
  access: "view"
23881
24190
  },
24191
+ "localNetwork.getNotificationEndpoint": {
24192
+ capName: "local-network",
24193
+ capScope: "system",
24194
+ addonId: null,
24195
+ access: "view"
24196
+ },
23882
24197
  "localNetwork.getPreferred": {
23883
24198
  capName: "local-network",
23884
24199
  capScope: "system",
@@ -23903,6 +24218,12 @@ Object.freeze({
23903
24218
  addonId: null,
23904
24219
  access: "create"
23905
24220
  },
24221
+ "localNetwork.setNotificationEndpoint": {
24222
+ capName: "local-network",
24223
+ capScope: "system",
24224
+ addonId: null,
24225
+ access: "create"
24226
+ },
23906
24227
  "lockControl.lock": {
23907
24228
  capName: "lock-control",
23908
24229
  capScope: "device",
@@ -24545,6 +24866,12 @@ Object.freeze({
24545
24866
  addonId: null,
24546
24867
  access: "create"
24547
24868
  },
24869
+ "pipelineAnalytics.cancelMediaRelocate": {
24870
+ capName: "pipeline-analytics",
24871
+ capScope: "device",
24872
+ addonId: null,
24873
+ access: "create"
24874
+ },
24548
24875
  "pipelineAnalytics.clearTracks": {
24549
24876
  capName: "pipeline-analytics",
24550
24877
  capScope: "device",
@@ -24599,6 +24926,12 @@ Object.freeze({
24599
24926
  addonId: null,
24600
24927
  access: "view"
24601
24928
  },
24929
+ "pipelineAnalytics.getMediaRelocateStatus": {
24930
+ capName: "pipeline-analytics",
24931
+ capScope: "device",
24932
+ addonId: null,
24933
+ access: "view"
24934
+ },
24602
24935
  "pipelineAnalytics.getMotionEvents": {
24603
24936
  capName: "pipeline-analytics",
24604
24937
  capScope: "device",
@@ -24671,6 +25004,12 @@ Object.freeze({
24671
25004
  addonId: null,
24672
25005
  access: "create"
24673
25006
  },
25007
+ "pipelineAnalytics.relocateMedia": {
25008
+ capName: "pipeline-analytics",
25009
+ capScope: "device",
25010
+ addonId: null,
25011
+ access: "create"
25012
+ },
24674
25013
  "pipelineAnalytics.searchObjectEvents": {
24675
25014
  capName: "pipeline-analytics",
24676
25015
  capScope: "device",
@@ -25433,6 +25772,12 @@ Object.freeze({
25433
25772
  addonId: null,
25434
25773
  access: "create"
25435
25774
  },
25775
+ "recording.cancelRelocate": {
25776
+ capName: "recording",
25777
+ capScope: "system",
25778
+ addonId: null,
25779
+ access: "create"
25780
+ },
25436
25781
  "recording.deleteFootprint": {
25437
25782
  capName: "recording",
25438
25783
  capScope: "system",
@@ -25463,6 +25808,12 @@ Object.freeze({
25463
25808
  addonId: null,
25464
25809
  access: "view"
25465
25810
  },
25811
+ "recording.getRelocateStatus": {
25812
+ capName: "recording",
25813
+ capScope: "system",
25814
+ addonId: null,
25815
+ access: "view"
25816
+ },
25466
25817
  "recording.getStorageUsage": {
25467
25818
  capName: "recording",
25468
25819
  capScope: "system",
@@ -25493,6 +25844,24 @@ Object.freeze({
25493
25844
  addonId: null,
25494
25845
  access: "view"
25495
25846
  },
25847
+ "recording.relocateFootage": {
25848
+ capName: "recording",
25849
+ capScope: "system",
25850
+ addonId: null,
25851
+ access: "create"
25852
+ },
25853
+ "recording.renderClip": {
25854
+ capName: "recording",
25855
+ capScope: "system",
25856
+ addonId: null,
25857
+ access: "create"
25858
+ },
25859
+ "recording.renderGif": {
25860
+ capName: "recording",
25861
+ capScope: "system",
25862
+ addonId: null,
25863
+ access: "create"
25864
+ },
25496
25865
  "recording.rescanStorage": {
25497
25866
  capName: "recording",
25498
25867
  capScope: "system",
@@ -26087,6 +26456,12 @@ Object.freeze({
26087
26456
  addonId: null,
26088
26457
  access: "create"
26089
26458
  },
26459
+ "streamBroker.renderPreBufferClip": {
26460
+ capName: "stream-broker",
26461
+ capScope: "system",
26462
+ addonId: null,
26463
+ access: "create"
26464
+ },
26090
26465
  "streamBroker.restartProfile": {
26091
26466
  capName: "stream-broker",
26092
26467
  capScope: "system",