@camstack/addon-provider-vesync 0.2.6 → 0.2.7

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.js CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- //#region ../types/dist/event-category-BLcNejAE.mjs
2
+ //#region ../types/dist/event-category-Bz24uP1U.mjs
3
3
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4
4
  EventCategory["SystemBoot"] = "system.boot";
5
5
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -270,6 +270,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
270
270
  */
271
271
  EventCategory["DeviceStateChanged"] = "device.state-changed";
272
272
  /**
273
+ * Frame occupancy for a camera CHANGED — a tracked object was gained or
274
+ * lost. Carries `{ deviceId, totalObjects, byClass, zones }`.
275
+ *
276
+ * Emitted only on a change, so a steady scene is silent. It exists so a
277
+ * client can stop polling `zoneAnalytics.getCurrentSnapshot`: that was the
278
+ * one live badge with no push signal at all, and it cost a request every
279
+ * four seconds per visible camera.
280
+ *
281
+ * Like every event it is telemetry and may be dropped ([D8]) — a consumer
282
+ * keeps a slow reconcile rather than trusting it alone.
283
+ */
284
+ EventCategory["ZoneAnalyticsOccupancyChanged"] = "zone-analytics.occupancy-changed";
285
+ /**
273
286
  * Cap event fired by every device that registers the `battery`
274
287
  * capability. Mirrors the cap definition's `onStatusChanged`. Carries
275
288
  * `{ deviceId, status: BatteryStatus }`. Subscribers (alert center,
@@ -7213,35 +7226,22 @@ var ConvertResultSchema = object({
7213
7226
  */
7214
7227
  var RecordingWeekdaySchema = number().int().min(0).max(6);
7215
7228
  var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
7216
- var RecordingScheduleSchema = discriminatedUnion("kind", [object({ kind: literal("always") }), object({
7217
- kind: literal("timeOfDay"),
7218
- start: string().regex(HHMM),
7219
- end: string().regex(HHMM),
7220
- /** Restrict to these weekdays; omit = every day. */
7221
- days: array(RecordingWeekdaySchema).optional()
7222
- })]);
7223
- var RecordingModeSchema = _enum([
7224
- "continuous",
7225
- "onMotion",
7226
- "onAudioThreshold"
7227
- ]);
7228
7229
  /**
7229
- * First-class, authoritative per-camera storage mode — the explicit choice the
7230
- * UI reads directly (never inferred from `rules`):
7231
- * - `off` — not recording.
7232
- * - `events` — record only around triggers (motion / audio threshold),
7233
- * with pre/post-buffer.
7234
- * - `continuous` — record 24/7 within the schedule.
7230
+ * DERIVED per-camera storage summary — the single field cheap consumers read
7231
+ * (the viewer's status dot, the camera list) instead of walking `bands`:
7232
+ * - `off` — no band covers the camera (or it is disabled).
7233
+ * - `events` — every band records around triggers only.
7234
+ * - `continuous` — at least one band records continuously.
7235
7235
  *
7236
- * `mode` compiles one-way to the internal `rules[]` consumed by the policy
7237
- * engine (see `compileRules`); `rules[]` is never authored directly anymore.
7236
+ * NEVER authored: the recorder stamps it from the authoritative `bands` on
7237
+ * every save (`activeModeForConfig`). Writing it has no effect.
7238
7238
  */
7239
7239
  var RecordingStorageModeSchema = _enum([
7240
7240
  "off",
7241
7241
  "events",
7242
7242
  "continuous"
7243
7243
  ]);
7244
- /** Which detectors trigger an `events`-mode recording. */
7244
+ /** Which detectors trigger an `events`-mode band. */
7245
7245
  var RecordingTriggersSchema = object({
7246
7246
  motion: boolean().optional(),
7247
7247
  audioThresholdDbfs: number().optional()
@@ -7277,18 +7277,6 @@ var RecordingBandSchema = object({
7277
7277
  preBufferSec: number().min(0).optional(),
7278
7278
  postBufferSec: number().min(0).optional()
7279
7279
  });
7280
- var RecordingRuleSchema = object({
7281
- schedule: RecordingScheduleSchema,
7282
- mode: RecordingModeSchema,
7283
- /** Seconds of footage to retain BEFORE a trigger (applied at keep/discard). */
7284
- preBufferSec: number().min(0).default(0),
7285
- /** Keep recording until this many seconds after the last trigger. */
7286
- postBufferSec: number().min(0).default(0),
7287
- /** Each new trigger restarts the post-buffer window. */
7288
- resetTimeoutOnNewEvent: boolean().default(true),
7289
- /** onAudioThreshold only — dBFS level that counts as a trigger. */
7290
- thresholdDbfs: number().optional()
7291
- });
7292
7280
  /**
7293
7281
  * Per-device retention overrides. Every field is optional; an unset or `0`
7294
7282
  * value inherits the node-wide recorder default. Only footage-lifetime limits
@@ -7322,40 +7310,28 @@ var ScrubThumbnailPresetSchema = _enum([
7322
7310
  /**
7323
7311
  * The full per-camera recording intent — the wire shape of a RecordingTarget.
7324
7312
  *
7325
- * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
7326
- * are its mode-specific parameters. `rules` is a DEPRECATED authoring input kept
7327
- * only for transition + migration (`migrateRulesToMode`); the policy engine
7328
- * consumes the compiled output of `compileRules(config)`, never `rules` directly.
7313
+ * `bands` is the ONLY authored recording intent: what to record, when, and on
7314
+ * which trigger. `mode` is a derived summary the recorder stamps on save; every
7315
+ * other field is a storage knob (profiles, segment length, retention, scrub).
7316
+ *
7317
+ * STRICT on purpose: the legacy authoring surface (`schedule`/`schedules`/
7318
+ * `triggers`/`preBufferSec`/`postBufferSec`/`rules`) was retired 2026-07-30.
7319
+ * A stale caller must fail loudly — silently stripping its legacy intent would
7320
+ * persist a band-less config, i.e. silently stop recording the camera.
7329
7321
  */
7330
7322
  var RecordingConfigSchema = object({
7331
7323
  enabled: boolean(),
7332
- /** Authoritative storage mode. Absent on legacy targets derived once via
7333
- * `migrateRulesToMode`, then persisted. */
7324
+ /** DERIVED summary of `bands`, stamped by the recorder on every save.
7325
+ * Authoring it has no effect — see {@link RecordingStorageModeSchema}. */
7334
7326
  mode: RecordingStorageModeSchema.optional(),
7335
7327
  profiles: array(CamProfileSchema).optional(),
7336
7328
  segmentSeconds: number().int().positive().optional(),
7337
- /** Shared recording time-bands for `events` & `continuous` — record only when
7338
- * the wall-clock falls inside one of these windows. Omit or empty = always.
7339
- * `continuous` compiles to one rule per band; `events` to band × trigger. */
7340
- schedules: array(RecordingScheduleSchema).optional(),
7341
- /** Legacy single-band predecessor of `schedules`. Read-compat only — it is
7342
- * normalized into `schedules` on read and never written going forward. (Not
7343
- * tagged `@deprecated`: the normalization paths must read it cast-free.) */
7344
- schedule: RecordingScheduleSchema.optional(),
7345
- /** `events`-mode only — which detectors trigger a recording. */
7346
- triggers: RecordingTriggersSchema.optional(),
7347
- /** `events`-mode only — seconds retained before / after a trigger. */
7348
- preBufferSec: number().min(0).optional(),
7349
- postBufferSec: number().min(0).optional(),
7350
- /** DEPRECATED authoring input; retained for migration/transition. */
7351
- rules: array(RecordingRuleSchema).optional(),
7352
7329
  /**
7353
- * AUTHORITATIVE mode-per-band recording model (recorder). When present it
7354
- * is the single source of truth; the legacy `mode`/`schedules`/`schedule`/
7355
- * `triggers`/`rules` fields above are kept for READ-COMPAT only and are
7356
- * derived into bands once via `migrateConfigToBands`.
7330
+ * AUTHORITATIVE mode-per-band recording model the single source of truth
7331
+ * the recorder's band engine consumes. An empty array = record nothing;
7332
+ * "off" is the absence of a covering band, never a band value.
7357
7333
  */
7358
- bands: array(RecordingBandSchema).optional(),
7334
+ bands: array(RecordingBandSchema).default([]),
7359
7335
  retention: RecordingRetentionSchema.optional(),
7360
7336
  /**
7361
7337
  * Per-camera scrub-thumbnail fidelity preset (resolution + JPEG quality for
@@ -7363,8 +7339,15 @@ var RecordingConfigSchema = object({
7363
7339
  * windows only — existing sheets are immutable, and each window's index
7364
7340
  * carries its own tile dims so mixed-preset history renders correctly.
7365
7341
  */
7366
- scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7367
- });
7342
+ scrubThumbnails: ScrubThumbnailPresetSchema.optional(),
7343
+ /**
7344
+ * OPT-IN thumbnail-strip generation for this camera: every keyframe of the
7345
+ * low recording saved as a JPEG (the fast-drag scrub depth), a derived
7346
+ * cache that eviction reclaims with the footage. Absent/false = no strips
7347
+ * are written and scrub reads exact keyframes at every velocity.
7348
+ */
7349
+ stripsEnabled: boolean().optional()
7350
+ }).strict();
7368
7351
  /**
7369
7352
  * Ops-log — the durable, append-only operations audit shared by the
7370
7353
  * recordings and events management surfaces.
@@ -7383,7 +7366,8 @@ var OpsLogOpSchema = _enum([
7383
7366
  "prune",
7384
7367
  "manual-delete",
7385
7368
  "rescan",
7386
- "retention-run"
7369
+ "retention-run",
7370
+ "relocate"
7387
7371
  ]);
7388
7372
  /** Why the operation ran. */
7389
7373
  var OpsLogReasonSchema = _enum([
@@ -7422,6 +7406,55 @@ var OpsLogQueryInputSchema = object({
7422
7406
  limit: number().int().min(1).max(1e3).optional()
7423
7407
  });
7424
7408
  /**
7409
+ * Entity-relocation job state (storage entity-routing spec, Phase 4).
7410
+ *
7411
+ * One shape shared by the recorder's `relocateFootage` (segments + strips) and
7412
+ * pipeline-analytics' `relocateMedia` (event media blobs) so the admin Data
7413
+ * page renders both movers with one component. Jobs are in-RAM (a restart
7414
+ * forgets them — re-running is safe by construction: copy-if-absent, delete
7415
+ * after verify) and each completed/failed run also lands one durable ops-log
7416
+ * row on the owning addon's surface.
7417
+ */
7418
+ var RelocateJobStateSchema = _enum([
7419
+ "running",
7420
+ "done",
7421
+ "failed",
7422
+ "cancelled"
7423
+ ]);
7424
+ var RelocateJobSchema = object({
7425
+ jobId: string(),
7426
+ state: RelocateJobStateSchema,
7427
+ /** Source location — for media relocation this is informational ('*': rows
7428
+ * move from wherever they are to the target). */
7429
+ fromLocationId: string(),
7430
+ toLocationId: string(),
7431
+ /** Scoped device, or null = every device. */
7432
+ deviceId: number().nullable(),
7433
+ /** What the job moves (owner-addon specific: segments/strips or media). */
7434
+ entities: array(string()),
7435
+ filesMoved: number().int(),
7436
+ bytesMoved: number().int(),
7437
+ /** Total files discovered up front; null while (or when) unknown. */
7438
+ filesTotal: number().int().nullable(),
7439
+ startedAt: number(),
7440
+ finishedAt: number().nullable(),
7441
+ error: string().nullable()
7442
+ });
7443
+ var RelocateFootageInputSchema = object({
7444
+ deviceId: number().optional(),
7445
+ fromLocationId: string(),
7446
+ toLocationId: string(),
7447
+ entities: array(_enum(["segments", "strips"])).optional(),
7448
+ /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7449
+ * never allowed to starve live writers. */
7450
+ throttleMbps: number().min(1).max(1e3).optional()
7451
+ });
7452
+ var RelocateMediaInputSchema = object({
7453
+ deviceId: number().optional(),
7454
+ toLocationId: string(),
7455
+ throttleMbps: number().min(1).max(1e3).optional()
7456
+ });
7457
+ /**
7425
7458
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
7426
7459
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
7427
7460
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -7471,6 +7504,13 @@ var StorageLocationSchema = object({
7471
7504
  nodeId: string().optional(),
7472
7505
  isDefault: boolean().default(false),
7473
7506
  isSystem: boolean().default(false),
7507
+ /** COMPUTED at read time by the orchestrator (statfs of the backing volume
7508
+ * for node-local locations it can reach) — never persisted, absent when the
7509
+ * volume is remote/unreachable. The single capacity truth every UI reads. */
7510
+ capacity: object({
7511
+ totalBytes: number(),
7512
+ availableBytes: number()
7513
+ }).nullable().optional(),
7474
7514
  createdAt: number(),
7475
7515
  updatedAt: number()
7476
7516
  });
@@ -8238,7 +8278,8 @@ var NcTaxonomyEntrySchema = object({
8238
8278
  /** Macro/category parent for grouping ('car' → 'vehicle'); null for a top. */
8239
8279
  parentKind: string().nullable()
8240
8280
  });
8241
- object({
8281
+ /** The complete NC picker taxonomy — three grouped buckets. */
8282
+ var NcTaxonomySchema = object({
8242
8283
  videoClasses: array(NcTaxonomyEntrySchema),
8243
8284
  audioKinds: array(NcTaxonomyEntrySchema),
8244
8285
  labels: array(NcTaxonomyEntrySchema)
@@ -9141,6 +9182,7 @@ function shallowEqual(a, b) {
9141
9182
  for (const k of ak) if (a[k] !== b[k]) return false;
9142
9183
  return true;
9143
9184
  }
9185
+ new Set(["devices", "classes"]);
9144
9186
  /**
9145
9187
  * Shared geometry vocabulary for on-frame shape caps — privacy-mask,
9146
9188
  * motion-zones, and the detection zones/lines editor all speak this one
@@ -9299,6 +9341,29 @@ var NcOccupancyConditionSchema = object({
9299
9341
  count: number().int().min(0).default(1),
9300
9342
  sustainSeconds: number().int().min(0).max(3600).default(15)
9301
9343
  });
9344
+ /**
9345
+ * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
9346
+ *
9347
+ * The values are not symmetric, and deliberately so — the absent value has to
9348
+ * mean exactly what every rule authored before this condition existed already
9349
+ * does:
9350
+ * - `enter` — entries and every NON-crossing record (movement state,
9351
+ * package, sensor). Exits are rejected. **This is the absent behaviour**:
9352
+ * an operator who never asked for exits must not start receiving them.
9353
+ * - `exit` — ONLY an exit crossing. A record that is not a crossing at all
9354
+ * fails closed, because "the car left the drive" is a question about a
9355
+ * boundary, not about a detection.
9356
+ * - `any` — no direction filter; entries, exits and non-crossings alike.
9357
+ *
9358
+ * A rule asking for a direction should normally also scope `zones`, which the
9359
+ * engine evaluates against the crossed zone as well as the current membership
9360
+ * (an exit's membership no longer contains the zone it just left).
9361
+ */
9362
+ var NcCrossingSchema = _enum([
9363
+ "enter",
9364
+ "exit",
9365
+ "any"
9366
+ ]);
9302
9367
  /** Admin-zone membership condition (zone IDs as stamped by the ZoneEngine). */
9303
9368
  var NcZoneConditionSchema = object({
9304
9369
  ids: array(string().min(1)).min(1),
@@ -9323,6 +9388,13 @@ var NcConditionsSchema = object({
9323
9388
  /** Veto zones — any hit fails the rule. */
9324
9389
  zonesExclude: array(string().min(1)).optional(),
9325
9390
  /**
9391
+ * Zone-crossing direction. IMMEDIATE only — a crossing is a per-event fact
9392
+ * and a closed track carries none, so a `track-end` rule asking for one
9393
+ * fails closed (use `zones`, which tests `zonesVisited`). ABSENT = `enter`,
9394
+ * which is exactly today's behaviour. See {@link NcCrossingSchema}.
9395
+ */
9396
+ crossing: NcCrossingSchema.optional(),
9397
+ /**
9326
9398
  * Exact (case-insensitive) match on the record's collapsed `label`
9327
9399
  * (identity name / plate text / subclass).
9328
9400
  */
@@ -9457,17 +9529,85 @@ var NcRuleTargetSchema = object({
9457
9529
  * - `keyFrame` — the clean scene frame (no subject box).
9458
9530
  * - `none` — no attachment.
9459
9531
  */
9460
- var NcMediaPolicySchema = object({ attach: _enum([
9461
- "best",
9462
- "best-matching",
9463
- "keyFrame",
9464
- "none"
9465
- ]).default("best") });
9532
+ /**
9533
+ * WHAT THE PICTURE SHOWS — chosen explicitly, because the implicit ladders
9534
+ * conflate it with the selection strategy and betray the request: asking for
9535
+ * the clean scene frame on an object-event owner used to start at
9536
+ * `fullFrameBoxed`, i.e. the annotated frame (2026-07-30).
9537
+ * - `cropped` — the subject, tight. What "who is at the door" wants.
9538
+ * - `full` — the clean scene, no annotation. What "what is going on" wants.
9539
+ * - `boxed` — the scene WITH the detection boxes drawn, for verifying what
9540
+ * the pipeline actually saw.
9541
+ */
9542
+ var NcMediaFrameSchema = _enum([
9543
+ "cropped",
9544
+ "full",
9545
+ "boxed"
9546
+ ]);
9547
+ var NcMediaPolicySchema = object({
9548
+ attach: _enum([
9549
+ "best",
9550
+ "best-matching",
9551
+ "keyFrame",
9552
+ "none"
9553
+ ]).default("best"),
9554
+ /** What the still shows. Absent = `cropped` (the historical `best` shape). */
9555
+ frame: NcMediaFrameSchema.optional(),
9556
+ /** Crop the attached still to the rule's condition-zone bbox (padded) —
9557
+ * "show me the ZONE", not the whole scene or the subject crop. */
9558
+ zoneCrop: boolean().optional(),
9559
+ /**
9560
+ * Also attach a short GIF cut from the stream broker's clip ring around the
9561
+ * event — NOT from the recording, so the camera does not have to be
9562
+ * recording, and the window sits AROUND the moment instead of a segment
9563
+ * behind it. Fail-closed: a window the ring does not cover contributes no
9564
+ * gif, never a failed notification.
9565
+ */
9566
+ gif: boolean().optional(),
9567
+ /**
9568
+ * Also attach a short MP4 CLIP of the same cut. Same source and the same
9569
+ * fail-closed rule as `gif`. Prefer it where the backend takes video
9570
+ * (telegram, discord, zentik, webhook); backends that do not are handled by
9571
+ * the degrade engine, which drops the video and keeps the still.
9572
+ */
9573
+ clip: boolean().optional(),
9574
+ /** Seconds of footage BEFORE / AFTER the event instant. Defaults 3 / 7. */
9575
+ clipPreRollSec: number().int().min(0).max(30).optional(),
9576
+ clipPostRollSec: number().int().min(0).max(30).optional(),
9577
+ /**
9578
+ * Which stream profile the footage is cut from. Absent = the CHEAPEST
9579
+ * assigned profile: a notification is watched on a phone, so the 4K
9580
+ * rendition would burn CPU to produce a file the client downscales anyway.
9581
+ * A profile that is not assigned falls back to the cheapest, and the render
9582
+ * reports which one actually ran.
9583
+ */
9584
+ profile: CamProfileSchema.optional()
9585
+ });
9586
+ /**
9587
+ * Cooldown GRANULARITY over the subject's class — how much a fired
9588
+ * notification suppresses.
9589
+ * - `shared` (default, and the absent value) — one window for the whole
9590
+ * rule/scope: a cat silences the next dog for `cooldownSec`.
9591
+ * - `per-class` — an independent window per detected class, so cat→dog fires
9592
+ * at once and cat→cat still waits.
9593
+ *
9594
+ * AUDIO subjects are ALWAYS per-class regardless of this setting: a scream
9595
+ * must not be swallowed by a bark's window (the precedent this generalizes —
9596
+ * see `cooldownKey` in the rule engine).
9597
+ */
9598
+ var NcThrottleGranularitySchema = _enum(["shared", "per-class"]);
9466
9599
  /** Throttle — cooldown survives restarts (rebuilt from the outbox on boot). */
9467
9600
  var NcThrottleSchema = object({
9468
9601
  cooldownSec: number().int().min(0).max(86400).default(60),
9469
9602
  /** `rule` = one shared cooldown; `rule-device` = per-camera cooldown. */
9470
- scope: _enum(["rule", "rule-device"]).default("rule-device")
9603
+ scope: _enum(["rule", "rule-device"]).default("rule-device"),
9604
+ /**
9605
+ * Class granularity of the cooldown key. Optional rather than defaulted:
9606
+ * a Zod default does NOT run on the addon→addon cap path, so a persisted
9607
+ * rule authored before this field simply carries none — and the engine
9608
+ * reads absent as `shared`, the pre-existing behaviour.
9609
+ */
9610
+ granularity: NcThrottleGranularitySchema.optional()
9471
9611
  });
9472
9612
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
9473
9613
  var NcRuleInputSchema = object({
@@ -9476,7 +9616,19 @@ var NcRuleInputSchema = object({
9476
9616
  delivery: NcDeliverySchema,
9477
9617
  conditions: NcConditionsSchema.default({}),
9478
9618
  schedule: NcScheduleSchema.optional(),
9479
- targets: array(NcRuleTargetSchema).min(1),
9619
+ /** May be empty when `targetUsers` addresses at least one user — the
9620
+ * "at least one addressee" invariant is enforced by the provider, because
9621
+ * a cross-field refine here would break `NcRulePatchSchema.partial()`. */
9622
+ targets: array(NcRuleTargetSchema),
9623
+ /**
9624
+ * USERS this rule addresses in addition to `targets` (Phase 4). At fire
9625
+ * time each user fans out to the personal targets they own
9626
+ * (`config.ownerUserId`), filtered by that user's `allowedDevices` for the
9627
+ * firing camera — a user is never notified about a device they cannot open.
9628
+ * Per-user opt-outs (`disabledTargetIds`) still apply to the fanned-out
9629
+ * targets.
9630
+ */
9631
+ targetUsers: array(string()).optional(),
9480
9632
  media: NcMediaPolicySchema.default({ attach: "best" }),
9481
9633
  throttle: NcThrottleSchema.default({
9482
9634
  cooldownSec: 60,
@@ -9563,6 +9715,7 @@ var NcConditionDescriptorSchema = object({
9563
9715
  "schedule",
9564
9716
  "plateMatcher",
9565
9717
  "packagePhase",
9718
+ "crossingSelect",
9566
9719
  "polygonDraw",
9567
9720
  "occupancy"
9568
9721
  ]),
@@ -9689,7 +9842,10 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
9689
9842
  }), object({ results: array(NcTestResultSchema) }), {
9690
9843
  kind: "mutation",
9691
9844
  auth: "admin"
9692
- }), method(object({}), object({ catalog: array(NcConditionDescriptorSchema) })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" });
9845
+ }), method(object({}), object({
9846
+ catalog: array(NcConditionDescriptorSchema),
9847
+ taxonomy: NcTaxonomySchema.optional()
9848
+ })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" });
9693
9849
  /**
9694
9850
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
9695
9851
  *
@@ -10698,6 +10854,28 @@ method(object({
10698
10854
  }), object({ success: literal(true) }), {
10699
10855
  kind: "mutation",
10700
10856
  auth: "admin"
10857
+ }), method(object({
10858
+ deviceId: number(),
10859
+ /** Absent = the LOWEST assigned profile — a notification attachment is
10860
+ * watched on a phone, and the cheap rendition is the right default. */
10861
+ profile: CamProfileSchema.optional(),
10862
+ aroundMs: number(),
10863
+ preRollSec: number().min(0).max(20).default(3),
10864
+ postRollSec: number().min(0).max(20).default(5),
10865
+ format: _enum(["gif", "mp4"]).default("gif"),
10866
+ maxWidth: number().int().min(120).max(1920).default(480),
10867
+ /** GIF only — MP4 keeps the source cadence. */
10868
+ fps: number().int().min(1).max(15).default(5)
10869
+ }), object({
10870
+ base64: string(),
10871
+ mime: string(),
10872
+ bytes: number().int(),
10873
+ /** The profile actually rendered (what the default resolved to). */
10874
+ profile: CamProfileSchema,
10875
+ durationMs: number()
10876
+ }), {
10877
+ kind: "mutation",
10878
+ auth: "admin"
10701
10879
  }), method(_void(), array(CameraStreamSchema).readonly()), method(_void(), array(ProfileSlotSchema).readonly()), method(object({ brokerId: string() }), BrokerStatsSchema), method(object({ brokerId: string() }), object({
10702
10880
  probed: boolean(),
10703
10881
  summary: string()
@@ -18760,7 +18938,10 @@ method(object({
18760
18938
  }), method(object({
18761
18939
  deviceId: number(),
18762
18940
  caps: array(string()).readonly().optional()
18763
- }), record(string(), unknown().nullable()));
18941
+ }), record(string(), unknown().nullable())), method(object({
18942
+ deviceIds: array(number()).readonly(),
18943
+ caps: array(string()).readonly().optional()
18944
+ }), record(string(), record(string(), unknown().nullable())));
18764
18945
  method(object({ deviceId: number() }), record(string(), record(string(), unknown()))), method(object({
18765
18946
  deviceId: number(),
18766
18947
  capName: string()
@@ -19691,6 +19872,36 @@ var TargetKindSchema = object({
19691
19872
  icon: string(),
19692
19873
  /** Stamped by each provider so the concat-fanned catalog stays routable. */
19693
19874
  addonId: string(),
19875
+ /**
19876
+ * URL of the kind's bundled BRAND icon, served by the providing addon over
19877
+ * its own `addon-routes` surface (`/addon/<addonId>/icons/<kind>`). Absent
19878
+ * when the addon bundles no icon for that kind — the client then falls back
19879
+ * to a neutral glyph rather than rendering the raw `icon` NAME as text.
19880
+ *
19881
+ * Root-relative on purpose: it resolves against whatever origin serves a web
19882
+ * client, and a native client joins it onto its own hub base.
19883
+ *
19884
+ * DECLARED here deliberately. It used to travel as an undeclared passthrough
19885
+ * field that survived only because the runtime cap-router forwards provider
19886
+ * output verbatim — so every consumer had to re-declare it by hand to stop
19887
+ * its own Zod parse from stripping it, and the whole arrangement would have
19888
+ * broken silently the moment output validation was tightened anywhere.
19889
+ */
19890
+ iconUrl: string().optional(),
19891
+ /**
19892
+ * Media type of {@link iconUrl} (`image/svg+xml`, `image/png`, …).
19893
+ *
19894
+ * The server knows this and therefore says it, because the client cannot
19895
+ * safely guess: a React-Native client renders SVG and raster through two
19896
+ * DIFFERENT components (`react-native-svg` vs `expo-image` — expo-image does
19897
+ * not decode SVG on iOS/Android), so without this it silently fell back to a
19898
+ * placeholder glyph for every vector icon while the web build looked fine.
19899
+ *
19900
+ * Absent when {@link iconUrl} is absent, or for a legacy provider that has
19901
+ * not been updated — a client that cannot determine the type should prefer
19902
+ * its raster path, which is the safe default for an unknown image.
19903
+ */
19904
+ iconMediaType: string().optional(),
19694
19905
  configSchema: ConfigSchemaPassthrough,
19695
19906
  supportsDiscovery: boolean(),
19696
19907
  caps: TargetKindCapsSchema
@@ -20138,6 +20349,29 @@ var MotionEventSchema = object({
20138
20349
  * Absent on legacy rows ⇒ treat as `pipeline`.
20139
20350
  */
20140
20351
  var DetectionSourceSchema = _enum(["pipeline", "onboard"]);
20352
+ /**
20353
+ * The confirmed zone crossing that produced an object event. Present ONLY on
20354
+ * an event emitted BY a crossing (`zone.enter` / `zone.exit`); a movement-state
20355
+ * event (`object.entering` / `leaving` / `stationary` / `loitering`) and an
20356
+ * appearance event carry none, so a rule asking for a direction fails closed
20357
+ * on them.
20358
+ *
20359
+ * Exactly ONE crossing per event: the emitter turns each confirmed crossing
20360
+ * into its own event, so a frame in which a track enters A while leaving B
20361
+ * produces two events with two directions — never one ambiguous row.
20362
+ *
20363
+ * `zoneId` is load-bearing for an EXIT: the event's `zones` list is the
20364
+ * membership the box has NOW, and by definition it no longer contains the zone
20365
+ * that was just left. Without the id here, a zone-scoped rule could never match
20366
+ * the exit it asked for.
20367
+ */
20368
+ var ZoneCrossingSchema = object({
20369
+ direction: _enum(["enter", "exit"]),
20370
+ /** Admin zone id crossed. */
20371
+ zoneId: string(),
20372
+ /** Zone display name at crossing time (falls back to the id). */
20373
+ zoneName: string().optional()
20374
+ });
20141
20375
  var ObjectEventSchema = object({
20142
20376
  ...BaseEventFields,
20143
20377
  kind: literal("object"),
@@ -20164,6 +20398,12 @@ var ObjectEventSchema = object({
20164
20398
  zones: array(string()).readonly().optional(),
20165
20399
  /** Omitted in slim projection. */
20166
20400
  state: TrackStateSchema.optional(),
20401
+ /**
20402
+ * The zone crossing this event IS, when it is one. Absent on every other
20403
+ * event kind (movement state, appearance, package) — see
20404
+ * {@link ZoneCrossingSchema}. Omitted in slim projection.
20405
+ */
20406
+ zoneCrossing: ZoneCrossingSchema.optional(),
20167
20407
  /** Detection-frame dimensions in pixels — let consumers normalize the
20168
20408
  * pixel-space `bbox` onto a displayed image. Omitted in slim projection. */
20169
20409
  frameWidth: number().optional(),
@@ -20422,6 +20662,15 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20422
20662
  }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
20423
20663
  kind: "mutation",
20424
20664
  auth: "admin"
20665
+ }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
20666
+ kind: "mutation",
20667
+ auth: "admin"
20668
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
20669
+ kind: "query",
20670
+ auth: "admin"
20671
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
20672
+ kind: "mutation",
20673
+ auth: "admin"
20425
20674
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
20426
20675
  kind: "query",
20427
20676
  auth: "admin"
@@ -22901,6 +23150,17 @@ var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
22901
23150
  */
22902
23151
  priority: number()
22903
23152
  })).readonly() });
23153
+ /**
23154
+ * The chosen outbound endpoint for notification artifacts. `baseUrl: null` =
23155
+ * AUTO (resolved from the candidate ranking at send time); `resolved` reports
23156
+ * what AUTO currently picks, so the UI can show the effective value either way.
23157
+ */
23158
+ var NotificationEndpointSchema = object({
23159
+ /** The operator's explicit choice, or null for AUTO. */
23160
+ baseUrl: string().nullable(),
23161
+ /** What the ranking currently resolves to (null when nothing is reachable). */
23162
+ resolved: string().nullable()
23163
+ });
22904
23164
  var AllowedAddressesSchema = object({
22905
23165
  /**
22906
23166
  * Allowlist of interface addresses operators have explicitly opted
@@ -22923,7 +23183,7 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
22923
23183
  * to avoid mixed-content blocks in the browser. The public
22924
23184
  * tunnel always emits `https://` regardless. */
22925
23185
  scheme: _enum(["http", "https"]).optional()
22926
- }), GetConnectionEndpointsResultSchema), method(_void(), AllowedAddressesSchema), method(AllowedAddressesSchema, object({ success: literal(true) }), { kind: "mutation" }), method(_void(), AllowedAddressesSchema, { kind: "mutation" });
23186
+ }), 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" });
22927
23187
  /**
22928
23188
  * mesh-network — collection cap for mesh-VPN providers.
22929
23189
  *
@@ -23722,7 +23982,12 @@ var RecordingDeviceUsageSchema = object({
23722
23982
  var RecordingLocationUsageSchema = object({
23723
23983
  /** StorageLocation id; null for the legacy/degraded single-root fallback. */
23724
23984
  locationId: string().nullable(),
23725
- /** Bytes of recordings stored on this location. */
23985
+ /** Every location id sharing this row's PHYSICAL volume (aliases). One row
23986
+ * is emitted per physical disk (2026-07-29): two locations on one root
23987
+ * previously rendered as two identical "disks" with a nonsensical used
23988
+ * split — hydrate attribution across aliases is arbitrary by nature. */
23989
+ locationIds: array(string()).optional(),
23990
+ /** Bytes of recordings stored on this PHYSICAL volume (all aliases). */
23726
23991
  usedBytes: number(),
23727
23992
  /** Free bytes on the location's volume; null when capacity is unknown (remote). */
23728
23993
  availableBytes: number().nullable(),
@@ -23834,6 +24099,44 @@ method(object({
23834
24099
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
23835
24100
  kind: "query",
23836
24101
  auth: "admin"
24102
+ }), method(object({
24103
+ deviceId: number(),
24104
+ aroundMs: number(),
24105
+ preRollSec: number().min(0).max(30).default(2),
24106
+ postRollSec: number().min(0).max(30).default(5),
24107
+ maxWidth: number().int().min(120).max(1280).default(480),
24108
+ fps: number().int().min(1).max(15).default(5)
24109
+ }), object({
24110
+ gifBase64: string(),
24111
+ fromMs: number(),
24112
+ toMs: number()
24113
+ }), {
24114
+ kind: "mutation",
24115
+ auth: "admin"
24116
+ }), method(object({
24117
+ deviceId: number(),
24118
+ aroundMs: number(),
24119
+ preRollSec: number().min(0).max(30).default(3),
24120
+ postRollSec: number().min(0).max(30).default(7),
24121
+ maxWidth: number().int().min(160).max(1920).default(640)
24122
+ }), object({
24123
+ clipBase64: string(),
24124
+ mime: string(),
24125
+ fromMs: number(),
24126
+ toMs: number(),
24127
+ bytes: number().int()
24128
+ }), {
24129
+ kind: "mutation",
24130
+ auth: "admin"
24131
+ }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
24132
+ kind: "mutation",
24133
+ auth: "admin"
24134
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
24135
+ kind: "query",
24136
+ auth: "admin"
24137
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
24138
+ kind: "mutation",
24139
+ auth: "admin"
23837
24140
  });
23838
24141
  /**
23839
24142
  * `recordingExport` cap — render a footage time range into a single downloadable
@@ -25425,6 +25728,12 @@ Object.freeze({
25425
25728
  addonId: null,
25426
25729
  access: "view"
25427
25730
  },
25731
+ "deviceManager.getDeviceStatusAggregateBatch": {
25732
+ capName: "device-manager",
25733
+ capScope: "system",
25734
+ addonId: null,
25735
+ access: "view"
25736
+ },
25428
25737
  "deviceManager.getLinkedDevices": {
25429
25738
  capName: "device-manager",
25430
25739
  capScope: "system",
@@ -26319,6 +26628,12 @@ Object.freeze({
26319
26628
  addonId: null,
26320
26629
  access: "view"
26321
26630
  },
26631
+ "localNetwork.getNotificationEndpoint": {
26632
+ capName: "local-network",
26633
+ capScope: "system",
26634
+ addonId: null,
26635
+ access: "view"
26636
+ },
26322
26637
  "localNetwork.getPreferred": {
26323
26638
  capName: "local-network",
26324
26639
  capScope: "system",
@@ -26343,6 +26658,12 @@ Object.freeze({
26343
26658
  addonId: null,
26344
26659
  access: "create"
26345
26660
  },
26661
+ "localNetwork.setNotificationEndpoint": {
26662
+ capName: "local-network",
26663
+ capScope: "system",
26664
+ addonId: null,
26665
+ access: "create"
26666
+ },
26346
26667
  "lockControl.lock": {
26347
26668
  capName: "lock-control",
26348
26669
  capScope: "device",
@@ -26985,6 +27306,12 @@ Object.freeze({
26985
27306
  addonId: null,
26986
27307
  access: "create"
26987
27308
  },
27309
+ "pipelineAnalytics.cancelMediaRelocate": {
27310
+ capName: "pipeline-analytics",
27311
+ capScope: "device",
27312
+ addonId: null,
27313
+ access: "create"
27314
+ },
26988
27315
  "pipelineAnalytics.clearTracks": {
26989
27316
  capName: "pipeline-analytics",
26990
27317
  capScope: "device",
@@ -27039,6 +27366,12 @@ Object.freeze({
27039
27366
  addonId: null,
27040
27367
  access: "view"
27041
27368
  },
27369
+ "pipelineAnalytics.getMediaRelocateStatus": {
27370
+ capName: "pipeline-analytics",
27371
+ capScope: "device",
27372
+ addonId: null,
27373
+ access: "view"
27374
+ },
27042
27375
  "pipelineAnalytics.getMotionEvents": {
27043
27376
  capName: "pipeline-analytics",
27044
27377
  capScope: "device",
@@ -27111,6 +27444,12 @@ Object.freeze({
27111
27444
  addonId: null,
27112
27445
  access: "create"
27113
27446
  },
27447
+ "pipelineAnalytics.relocateMedia": {
27448
+ capName: "pipeline-analytics",
27449
+ capScope: "device",
27450
+ addonId: null,
27451
+ access: "create"
27452
+ },
27114
27453
  "pipelineAnalytics.searchObjectEvents": {
27115
27454
  capName: "pipeline-analytics",
27116
27455
  capScope: "device",
@@ -27873,6 +28212,12 @@ Object.freeze({
27873
28212
  addonId: null,
27874
28213
  access: "create"
27875
28214
  },
28215
+ "recording.cancelRelocate": {
28216
+ capName: "recording",
28217
+ capScope: "system",
28218
+ addonId: null,
28219
+ access: "create"
28220
+ },
27876
28221
  "recording.deleteFootprint": {
27877
28222
  capName: "recording",
27878
28223
  capScope: "system",
@@ -27903,6 +28248,12 @@ Object.freeze({
27903
28248
  addonId: null,
27904
28249
  access: "view"
27905
28250
  },
28251
+ "recording.getRelocateStatus": {
28252
+ capName: "recording",
28253
+ capScope: "system",
28254
+ addonId: null,
28255
+ access: "view"
28256
+ },
27906
28257
  "recording.getStorageUsage": {
27907
28258
  capName: "recording",
27908
28259
  capScope: "system",
@@ -27933,6 +28284,24 @@ Object.freeze({
27933
28284
  addonId: null,
27934
28285
  access: "view"
27935
28286
  },
28287
+ "recording.relocateFootage": {
28288
+ capName: "recording",
28289
+ capScope: "system",
28290
+ addonId: null,
28291
+ access: "create"
28292
+ },
28293
+ "recording.renderClip": {
28294
+ capName: "recording",
28295
+ capScope: "system",
28296
+ addonId: null,
28297
+ access: "create"
28298
+ },
28299
+ "recording.renderGif": {
28300
+ capName: "recording",
28301
+ capScope: "system",
28302
+ addonId: null,
28303
+ access: "create"
28304
+ },
27936
28305
  "recording.rescanStorage": {
27937
28306
  capName: "recording",
27938
28307
  capScope: "system",
@@ -28527,6 +28896,12 @@ Object.freeze({
28527
28896
  addonId: null,
28528
28897
  access: "create"
28529
28898
  },
28899
+ "streamBroker.renderPreBufferClip": {
28900
+ capName: "stream-broker",
28901
+ capScope: "system",
28902
+ addonId: null,
28903
+ access: "create"
28904
+ },
28530
28905
  "streamBroker.restartProfile": {
28531
28906
  capName: "stream-broker",
28532
28907
  capScope: "system",