@camstack/addon-provider-amcrest 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
@@ -4,7 +4,7 @@ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).expor
4
4
  //#endregion
5
5
  let node_crypto = require("node:crypto");
6
6
  let node_os = require("node:os");
7
- //#region ../types/dist/event-category-BLcNejAE.mjs
7
+ //#region ../types/dist/event-category-Bz24uP1U.mjs
8
8
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
9
9
  EventCategory["SystemBoot"] = "system.boot";
10
10
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -275,6 +275,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
275
275
  */
276
276
  EventCategory["DeviceStateChanged"] = "device.state-changed";
277
277
  /**
278
+ * Frame occupancy for a camera CHANGED — a tracked object was gained or
279
+ * lost. Carries `{ deviceId, totalObjects, byClass, zones }`.
280
+ *
281
+ * Emitted only on a change, so a steady scene is silent. It exists so a
282
+ * client can stop polling `zoneAnalytics.getCurrentSnapshot`: that was the
283
+ * one live badge with no push signal at all, and it cost a request every
284
+ * four seconds per visible camera.
285
+ *
286
+ * Like every event it is telemetry and may be dropped ([D8]) — a consumer
287
+ * keeps a slow reconcile rather than trusting it alone.
288
+ */
289
+ EventCategory["ZoneAnalyticsOccupancyChanged"] = "zone-analytics.occupancy-changed";
290
+ /**
278
291
  * Cap event fired by every device that registers the `battery`
279
292
  * capability. Mirrors the cap definition's `onStatusChanged`. Carries
280
293
  * `{ deviceId, status: BatteryStatus }`. Subscribers (alert center,
@@ -7192,35 +7205,22 @@ var ConvertResultSchema = object({
7192
7205
  */
7193
7206
  var RecordingWeekdaySchema = number().int().min(0).max(6);
7194
7207
  var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
7195
- var RecordingScheduleSchema = discriminatedUnion("kind", [object({ kind: literal("always") }), object({
7196
- kind: literal("timeOfDay"),
7197
- start: string().regex(HHMM),
7198
- end: string().regex(HHMM),
7199
- /** Restrict to these weekdays; omit = every day. */
7200
- days: array(RecordingWeekdaySchema).optional()
7201
- })]);
7202
- var RecordingModeSchema = _enum([
7203
- "continuous",
7204
- "onMotion",
7205
- "onAudioThreshold"
7206
- ]);
7207
7208
  /**
7208
- * First-class, authoritative per-camera storage mode — the explicit choice the
7209
- * UI reads directly (never inferred from `rules`):
7210
- * - `off` — not recording.
7211
- * - `events` — record only around triggers (motion / audio threshold),
7212
- * with pre/post-buffer.
7213
- * - `continuous` — record 24/7 within the schedule.
7209
+ * DERIVED per-camera storage summary — the single field cheap consumers read
7210
+ * (the viewer's status dot, the camera list) instead of walking `bands`:
7211
+ * - `off` — no band covers the camera (or it is disabled).
7212
+ * - `events` — every band records around triggers only.
7213
+ * - `continuous` — at least one band records continuously.
7214
7214
  *
7215
- * `mode` compiles one-way to the internal `rules[]` consumed by the policy
7216
- * engine (see `compileRules`); `rules[]` is never authored directly anymore.
7215
+ * NEVER authored: the recorder stamps it from the authoritative `bands` on
7216
+ * every save (`activeModeForConfig`). Writing it has no effect.
7217
7217
  */
7218
7218
  var RecordingStorageModeSchema = _enum([
7219
7219
  "off",
7220
7220
  "events",
7221
7221
  "continuous"
7222
7222
  ]);
7223
- /** Which detectors trigger an `events`-mode recording. */
7223
+ /** Which detectors trigger an `events`-mode band. */
7224
7224
  var RecordingTriggersSchema = object({
7225
7225
  motion: boolean().optional(),
7226
7226
  audioThresholdDbfs: number().optional()
@@ -7256,18 +7256,6 @@ var RecordingBandSchema = object({
7256
7256
  preBufferSec: number().min(0).optional(),
7257
7257
  postBufferSec: number().min(0).optional()
7258
7258
  });
7259
- var RecordingRuleSchema = object({
7260
- schedule: RecordingScheduleSchema,
7261
- mode: RecordingModeSchema,
7262
- /** Seconds of footage to retain BEFORE a trigger (applied at keep/discard). */
7263
- preBufferSec: number().min(0).default(0),
7264
- /** Keep recording until this many seconds after the last trigger. */
7265
- postBufferSec: number().min(0).default(0),
7266
- /** Each new trigger restarts the post-buffer window. */
7267
- resetTimeoutOnNewEvent: boolean().default(true),
7268
- /** onAudioThreshold only — dBFS level that counts as a trigger. */
7269
- thresholdDbfs: number().optional()
7270
- });
7271
7259
  /**
7272
7260
  * Per-device retention overrides. Every field is optional; an unset or `0`
7273
7261
  * value inherits the node-wide recorder default. Only footage-lifetime limits
@@ -7301,40 +7289,28 @@ var ScrubThumbnailPresetSchema = _enum([
7301
7289
  /**
7302
7290
  * The full per-camera recording intent — the wire shape of a RecordingTarget.
7303
7291
  *
7304
- * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
7305
- * are its mode-specific parameters. `rules` is a DEPRECATED authoring input kept
7306
- * only for transition + migration (`migrateRulesToMode`); the policy engine
7307
- * consumes the compiled output of `compileRules(config)`, never `rules` directly.
7292
+ * `bands` is the ONLY authored recording intent: what to record, when, and on
7293
+ * which trigger. `mode` is a derived summary the recorder stamps on save; every
7294
+ * other field is a storage knob (profiles, segment length, retention, scrub).
7295
+ *
7296
+ * STRICT on purpose: the legacy authoring surface (`schedule`/`schedules`/
7297
+ * `triggers`/`preBufferSec`/`postBufferSec`/`rules`) was retired 2026-07-30.
7298
+ * A stale caller must fail loudly — silently stripping its legacy intent would
7299
+ * persist a band-less config, i.e. silently stop recording the camera.
7308
7300
  */
7309
7301
  var RecordingConfigSchema = object({
7310
7302
  enabled: boolean(),
7311
- /** Authoritative storage mode. Absent on legacy targets derived once via
7312
- * `migrateRulesToMode`, then persisted. */
7303
+ /** DERIVED summary of `bands`, stamped by the recorder on every save.
7304
+ * Authoring it has no effect — see {@link RecordingStorageModeSchema}. */
7313
7305
  mode: RecordingStorageModeSchema.optional(),
7314
7306
  profiles: array(CamProfileSchema).optional(),
7315
7307
  segmentSeconds: number().int().positive().optional(),
7316
- /** Shared recording time-bands for `events` & `continuous` — record only when
7317
- * the wall-clock falls inside one of these windows. Omit or empty = always.
7318
- * `continuous` compiles to one rule per band; `events` to band × trigger. */
7319
- schedules: array(RecordingScheduleSchema).optional(),
7320
- /** Legacy single-band predecessor of `schedules`. Read-compat only — it is
7321
- * normalized into `schedules` on read and never written going forward. (Not
7322
- * tagged `@deprecated`: the normalization paths must read it cast-free.) */
7323
- schedule: RecordingScheduleSchema.optional(),
7324
- /** `events`-mode only — which detectors trigger a recording. */
7325
- triggers: RecordingTriggersSchema.optional(),
7326
- /** `events`-mode only — seconds retained before / after a trigger. */
7327
- preBufferSec: number().min(0).optional(),
7328
- postBufferSec: number().min(0).optional(),
7329
- /** DEPRECATED authoring input; retained for migration/transition. */
7330
- rules: array(RecordingRuleSchema).optional(),
7331
7308
  /**
7332
- * AUTHORITATIVE mode-per-band recording model (recorder). When present it
7333
- * is the single source of truth; the legacy `mode`/`schedules`/`schedule`/
7334
- * `triggers`/`rules` fields above are kept for READ-COMPAT only and are
7335
- * derived into bands once via `migrateConfigToBands`.
7309
+ * AUTHORITATIVE mode-per-band recording model the single source of truth
7310
+ * the recorder's band engine consumes. An empty array = record nothing;
7311
+ * "off" is the absence of a covering band, never a band value.
7336
7312
  */
7337
- bands: array(RecordingBandSchema).optional(),
7313
+ bands: array(RecordingBandSchema).default([]),
7338
7314
  retention: RecordingRetentionSchema.optional(),
7339
7315
  /**
7340
7316
  * Per-camera scrub-thumbnail fidelity preset (resolution + JPEG quality for
@@ -7342,8 +7318,15 @@ var RecordingConfigSchema = object({
7342
7318
  * windows only — existing sheets are immutable, and each window's index
7343
7319
  * carries its own tile dims so mixed-preset history renders correctly.
7344
7320
  */
7345
- scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7346
- });
7321
+ scrubThumbnails: ScrubThumbnailPresetSchema.optional(),
7322
+ /**
7323
+ * OPT-IN thumbnail-strip generation for this camera: every keyframe of the
7324
+ * low recording saved as a JPEG (the fast-drag scrub depth), a derived
7325
+ * cache that eviction reclaims with the footage. Absent/false = no strips
7326
+ * are written and scrub reads exact keyframes at every velocity.
7327
+ */
7328
+ stripsEnabled: boolean().optional()
7329
+ }).strict();
7347
7330
  /**
7348
7331
  * Ops-log — the durable, append-only operations audit shared by the
7349
7332
  * recordings and events management surfaces.
@@ -7362,7 +7345,8 @@ var OpsLogOpSchema = _enum([
7362
7345
  "prune",
7363
7346
  "manual-delete",
7364
7347
  "rescan",
7365
- "retention-run"
7348
+ "retention-run",
7349
+ "relocate"
7366
7350
  ]);
7367
7351
  /** Why the operation ran. */
7368
7352
  var OpsLogReasonSchema = _enum([
@@ -7401,6 +7385,55 @@ var OpsLogQueryInputSchema = object({
7401
7385
  limit: number().int().min(1).max(1e3).optional()
7402
7386
  });
7403
7387
  /**
7388
+ * Entity-relocation job state (storage entity-routing spec, Phase 4).
7389
+ *
7390
+ * One shape shared by the recorder's `relocateFootage` (segments + strips) and
7391
+ * pipeline-analytics' `relocateMedia` (event media blobs) so the admin Data
7392
+ * page renders both movers with one component. Jobs are in-RAM (a restart
7393
+ * forgets them — re-running is safe by construction: copy-if-absent, delete
7394
+ * after verify) and each completed/failed run also lands one durable ops-log
7395
+ * row on the owning addon's surface.
7396
+ */
7397
+ var RelocateJobStateSchema = _enum([
7398
+ "running",
7399
+ "done",
7400
+ "failed",
7401
+ "cancelled"
7402
+ ]);
7403
+ var RelocateJobSchema = object({
7404
+ jobId: string(),
7405
+ state: RelocateJobStateSchema,
7406
+ /** Source location — for media relocation this is informational ('*': rows
7407
+ * move from wherever they are to the target). */
7408
+ fromLocationId: string(),
7409
+ toLocationId: string(),
7410
+ /** Scoped device, or null = every device. */
7411
+ deviceId: number().nullable(),
7412
+ /** What the job moves (owner-addon specific: segments/strips or media). */
7413
+ entities: array(string()),
7414
+ filesMoved: number().int(),
7415
+ bytesMoved: number().int(),
7416
+ /** Total files discovered up front; null while (or when) unknown. */
7417
+ filesTotal: number().int().nullable(),
7418
+ startedAt: number(),
7419
+ finishedAt: number().nullable(),
7420
+ error: string().nullable()
7421
+ });
7422
+ var RelocateFootageInputSchema = object({
7423
+ deviceId: number().optional(),
7424
+ fromLocationId: string(),
7425
+ toLocationId: string(),
7426
+ entities: array(_enum(["segments", "strips"])).optional(),
7427
+ /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7428
+ * never allowed to starve live writers. */
7429
+ throttleMbps: number().min(1).max(1e3).optional()
7430
+ });
7431
+ var RelocateMediaInputSchema = object({
7432
+ deviceId: number().optional(),
7433
+ toLocationId: string(),
7434
+ throttleMbps: number().min(1).max(1e3).optional()
7435
+ });
7436
+ /**
7404
7437
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
7405
7438
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
7406
7439
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -7450,6 +7483,13 @@ var StorageLocationSchema = object({
7450
7483
  nodeId: string().optional(),
7451
7484
  isDefault: boolean().default(false),
7452
7485
  isSystem: boolean().default(false),
7486
+ /** COMPUTED at read time by the orchestrator (statfs of the backing volume
7487
+ * for node-local locations it can reach) — never persisted, absent when the
7488
+ * volume is remote/unreachable. The single capacity truth every UI reads. */
7489
+ capacity: object({
7490
+ totalBytes: number(),
7491
+ availableBytes: number()
7492
+ }).nullable().optional(),
7453
7493
  createdAt: number(),
7454
7494
  updatedAt: number()
7455
7495
  });
@@ -8217,7 +8257,8 @@ var NcTaxonomyEntrySchema = object({
8217
8257
  /** Macro/category parent for grouping ('car' → 'vehicle'); null for a top. */
8218
8258
  parentKind: string().nullable()
8219
8259
  });
8220
- object({
8260
+ /** The complete NC picker taxonomy — three grouped buckets. */
8261
+ var NcTaxonomySchema = object({
8221
8262
  videoClasses: array(NcTaxonomyEntrySchema),
8222
8263
  audioKinds: array(NcTaxonomyEntrySchema),
8223
8264
  labels: array(NcTaxonomyEntrySchema)
@@ -9210,6 +9251,7 @@ function startReachabilityPoll(options) {
9210
9251
  timer = void 0;
9211
9252
  } };
9212
9253
  }
9254
+ new Set(["devices", "classes"]);
9213
9255
  /**
9214
9256
  * Shared geometry vocabulary for on-frame shape caps — privacy-mask,
9215
9257
  * motion-zones, and the detection zones/lines editor all speak this one
@@ -9368,6 +9410,29 @@ var NcOccupancyConditionSchema = object({
9368
9410
  count: number().int().min(0).default(1),
9369
9411
  sustainSeconds: number().int().min(0).max(3600).default(15)
9370
9412
  });
9413
+ /**
9414
+ * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
9415
+ *
9416
+ * The values are not symmetric, and deliberately so — the absent value has to
9417
+ * mean exactly what every rule authored before this condition existed already
9418
+ * does:
9419
+ * - `enter` — entries and every NON-crossing record (movement state,
9420
+ * package, sensor). Exits are rejected. **This is the absent behaviour**:
9421
+ * an operator who never asked for exits must not start receiving them.
9422
+ * - `exit` — ONLY an exit crossing. A record that is not a crossing at all
9423
+ * fails closed, because "the car left the drive" is a question about a
9424
+ * boundary, not about a detection.
9425
+ * - `any` — no direction filter; entries, exits and non-crossings alike.
9426
+ *
9427
+ * A rule asking for a direction should normally also scope `zones`, which the
9428
+ * engine evaluates against the crossed zone as well as the current membership
9429
+ * (an exit's membership no longer contains the zone it just left).
9430
+ */
9431
+ var NcCrossingSchema = _enum([
9432
+ "enter",
9433
+ "exit",
9434
+ "any"
9435
+ ]);
9371
9436
  /** Admin-zone membership condition (zone IDs as stamped by the ZoneEngine). */
9372
9437
  var NcZoneConditionSchema = object({
9373
9438
  ids: array(string().min(1)).min(1),
@@ -9392,6 +9457,13 @@ var NcConditionsSchema = object({
9392
9457
  /** Veto zones — any hit fails the rule. */
9393
9458
  zonesExclude: array(string().min(1)).optional(),
9394
9459
  /**
9460
+ * Zone-crossing direction. IMMEDIATE only — a crossing is a per-event fact
9461
+ * and a closed track carries none, so a `track-end` rule asking for one
9462
+ * fails closed (use `zones`, which tests `zonesVisited`). ABSENT = `enter`,
9463
+ * which is exactly today's behaviour. See {@link NcCrossingSchema}.
9464
+ */
9465
+ crossing: NcCrossingSchema.optional(),
9466
+ /**
9395
9467
  * Exact (case-insensitive) match on the record's collapsed `label`
9396
9468
  * (identity name / plate text / subclass).
9397
9469
  */
@@ -9526,17 +9598,85 @@ var NcRuleTargetSchema = object({
9526
9598
  * - `keyFrame` — the clean scene frame (no subject box).
9527
9599
  * - `none` — no attachment.
9528
9600
  */
9529
- var NcMediaPolicySchema = object({ attach: _enum([
9530
- "best",
9531
- "best-matching",
9532
- "keyFrame",
9533
- "none"
9534
- ]).default("best") });
9601
+ /**
9602
+ * WHAT THE PICTURE SHOWS — chosen explicitly, because the implicit ladders
9603
+ * conflate it with the selection strategy and betray the request: asking for
9604
+ * the clean scene frame on an object-event owner used to start at
9605
+ * `fullFrameBoxed`, i.e. the annotated frame (2026-07-30).
9606
+ * - `cropped` — the subject, tight. What "who is at the door" wants.
9607
+ * - `full` — the clean scene, no annotation. What "what is going on" wants.
9608
+ * - `boxed` — the scene WITH the detection boxes drawn, for verifying what
9609
+ * the pipeline actually saw.
9610
+ */
9611
+ var NcMediaFrameSchema = _enum([
9612
+ "cropped",
9613
+ "full",
9614
+ "boxed"
9615
+ ]);
9616
+ var NcMediaPolicySchema = object({
9617
+ attach: _enum([
9618
+ "best",
9619
+ "best-matching",
9620
+ "keyFrame",
9621
+ "none"
9622
+ ]).default("best"),
9623
+ /** What the still shows. Absent = `cropped` (the historical `best` shape). */
9624
+ frame: NcMediaFrameSchema.optional(),
9625
+ /** Crop the attached still to the rule's condition-zone bbox (padded) —
9626
+ * "show me the ZONE", not the whole scene or the subject crop. */
9627
+ zoneCrop: boolean().optional(),
9628
+ /**
9629
+ * Also attach a short GIF cut from the stream broker's clip ring around the
9630
+ * event — NOT from the recording, so the camera does not have to be
9631
+ * recording, and the window sits AROUND the moment instead of a segment
9632
+ * behind it. Fail-closed: a window the ring does not cover contributes no
9633
+ * gif, never a failed notification.
9634
+ */
9635
+ gif: boolean().optional(),
9636
+ /**
9637
+ * Also attach a short MP4 CLIP of the same cut. Same source and the same
9638
+ * fail-closed rule as `gif`. Prefer it where the backend takes video
9639
+ * (telegram, discord, zentik, webhook); backends that do not are handled by
9640
+ * the degrade engine, which drops the video and keeps the still.
9641
+ */
9642
+ clip: boolean().optional(),
9643
+ /** Seconds of footage BEFORE / AFTER the event instant. Defaults 3 / 7. */
9644
+ clipPreRollSec: number().int().min(0).max(30).optional(),
9645
+ clipPostRollSec: number().int().min(0).max(30).optional(),
9646
+ /**
9647
+ * Which stream profile the footage is cut from. Absent = the CHEAPEST
9648
+ * assigned profile: a notification is watched on a phone, so the 4K
9649
+ * rendition would burn CPU to produce a file the client downscales anyway.
9650
+ * A profile that is not assigned falls back to the cheapest, and the render
9651
+ * reports which one actually ran.
9652
+ */
9653
+ profile: CamProfileSchema.optional()
9654
+ });
9655
+ /**
9656
+ * Cooldown GRANULARITY over the subject's class — how much a fired
9657
+ * notification suppresses.
9658
+ * - `shared` (default, and the absent value) — one window for the whole
9659
+ * rule/scope: a cat silences the next dog for `cooldownSec`.
9660
+ * - `per-class` — an independent window per detected class, so cat→dog fires
9661
+ * at once and cat→cat still waits.
9662
+ *
9663
+ * AUDIO subjects are ALWAYS per-class regardless of this setting: a scream
9664
+ * must not be swallowed by a bark's window (the precedent this generalizes —
9665
+ * see `cooldownKey` in the rule engine).
9666
+ */
9667
+ var NcThrottleGranularitySchema = _enum(["shared", "per-class"]);
9535
9668
  /** Throttle — cooldown survives restarts (rebuilt from the outbox on boot). */
9536
9669
  var NcThrottleSchema = object({
9537
9670
  cooldownSec: number().int().min(0).max(86400).default(60),
9538
9671
  /** `rule` = one shared cooldown; `rule-device` = per-camera cooldown. */
9539
- scope: _enum(["rule", "rule-device"]).default("rule-device")
9672
+ scope: _enum(["rule", "rule-device"]).default("rule-device"),
9673
+ /**
9674
+ * Class granularity of the cooldown key. Optional rather than defaulted:
9675
+ * a Zod default does NOT run on the addon→addon cap path, so a persisted
9676
+ * rule authored before this field simply carries none — and the engine
9677
+ * reads absent as `shared`, the pre-existing behaviour.
9678
+ */
9679
+ granularity: NcThrottleGranularitySchema.optional()
9540
9680
  });
9541
9681
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
9542
9682
  var NcRuleInputSchema = object({
@@ -9545,7 +9685,19 @@ var NcRuleInputSchema = object({
9545
9685
  delivery: NcDeliverySchema,
9546
9686
  conditions: NcConditionsSchema.default({}),
9547
9687
  schedule: NcScheduleSchema.optional(),
9548
- targets: array(NcRuleTargetSchema).min(1),
9688
+ /** May be empty when `targetUsers` addresses at least one user — the
9689
+ * "at least one addressee" invariant is enforced by the provider, because
9690
+ * a cross-field refine here would break `NcRulePatchSchema.partial()`. */
9691
+ targets: array(NcRuleTargetSchema),
9692
+ /**
9693
+ * USERS this rule addresses in addition to `targets` (Phase 4). At fire
9694
+ * time each user fans out to the personal targets they own
9695
+ * (`config.ownerUserId`), filtered by that user's `allowedDevices` for the
9696
+ * firing camera — a user is never notified about a device they cannot open.
9697
+ * Per-user opt-outs (`disabledTargetIds`) still apply to the fanned-out
9698
+ * targets.
9699
+ */
9700
+ targetUsers: array(string()).optional(),
9549
9701
  media: NcMediaPolicySchema.default({ attach: "best" }),
9550
9702
  throttle: NcThrottleSchema.default({
9551
9703
  cooldownSec: 60,
@@ -9632,6 +9784,7 @@ var NcConditionDescriptorSchema = object({
9632
9784
  "schedule",
9633
9785
  "plateMatcher",
9634
9786
  "packagePhase",
9787
+ "crossingSelect",
9635
9788
  "polygonDraw",
9636
9789
  "occupancy"
9637
9790
  ]),
@@ -9758,7 +9911,10 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
9758
9911
  }), object({ results: array(NcTestResultSchema) }), {
9759
9912
  kind: "mutation",
9760
9913
  auth: "admin"
9761
- }), method(object({}), object({ catalog: array(NcConditionDescriptorSchema) })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" });
9914
+ }), method(object({}), object({
9915
+ catalog: array(NcConditionDescriptorSchema),
9916
+ taxonomy: NcTaxonomySchema.optional()
9917
+ })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" });
9762
9918
  /**
9763
9919
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
9764
9920
  *
@@ -10767,6 +10923,28 @@ method(object({
10767
10923
  }), object({ success: literal(true) }), {
10768
10924
  kind: "mutation",
10769
10925
  auth: "admin"
10926
+ }), method(object({
10927
+ deviceId: number(),
10928
+ /** Absent = the LOWEST assigned profile — a notification attachment is
10929
+ * watched on a phone, and the cheap rendition is the right default. */
10930
+ profile: CamProfileSchema.optional(),
10931
+ aroundMs: number(),
10932
+ preRollSec: number().min(0).max(20).default(3),
10933
+ postRollSec: number().min(0).max(20).default(5),
10934
+ format: _enum(["gif", "mp4"]).default("gif"),
10935
+ maxWidth: number().int().min(120).max(1920).default(480),
10936
+ /** GIF only — MP4 keeps the source cadence. */
10937
+ fps: number().int().min(1).max(15).default(5)
10938
+ }), object({
10939
+ base64: string(),
10940
+ mime: string(),
10941
+ bytes: number().int(),
10942
+ /** The profile actually rendered (what the default resolved to). */
10943
+ profile: CamProfileSchema,
10944
+ durationMs: number()
10945
+ }), {
10946
+ kind: "mutation",
10947
+ auth: "admin"
10770
10948
  }), method(_void(), array(CameraStreamSchema).readonly()), method(_void(), array(ProfileSlotSchema).readonly()), method(object({ brokerId: string() }), BrokerStatsSchema), method(object({ brokerId: string() }), object({
10771
10949
  probed: boolean(),
10772
10950
  summary: string()
@@ -18829,7 +19007,10 @@ method(object({
18829
19007
  }), method(object({
18830
19008
  deviceId: number(),
18831
19009
  caps: array(string()).readonly().optional()
18832
- }), record(string(), unknown().nullable()));
19010
+ }), record(string(), unknown().nullable())), method(object({
19011
+ deviceIds: array(number()).readonly(),
19012
+ caps: array(string()).readonly().optional()
19013
+ }), record(string(), record(string(), unknown().nullable())));
18833
19014
  method(object({ deviceId: number() }), record(string(), record(string(), unknown()))), method(object({
18834
19015
  deviceId: number(),
18835
19016
  capName: string()
@@ -19760,6 +19941,36 @@ var TargetKindSchema = object({
19760
19941
  icon: string(),
19761
19942
  /** Stamped by each provider so the concat-fanned catalog stays routable. */
19762
19943
  addonId: string(),
19944
+ /**
19945
+ * URL of the kind's bundled BRAND icon, served by the providing addon over
19946
+ * its own `addon-routes` surface (`/addon/<addonId>/icons/<kind>`). Absent
19947
+ * when the addon bundles no icon for that kind — the client then falls back
19948
+ * to a neutral glyph rather than rendering the raw `icon` NAME as text.
19949
+ *
19950
+ * Root-relative on purpose: it resolves against whatever origin serves a web
19951
+ * client, and a native client joins it onto its own hub base.
19952
+ *
19953
+ * DECLARED here deliberately. It used to travel as an undeclared passthrough
19954
+ * field that survived only because the runtime cap-router forwards provider
19955
+ * output verbatim — so every consumer had to re-declare it by hand to stop
19956
+ * its own Zod parse from stripping it, and the whole arrangement would have
19957
+ * broken silently the moment output validation was tightened anywhere.
19958
+ */
19959
+ iconUrl: string().optional(),
19960
+ /**
19961
+ * Media type of {@link iconUrl} (`image/svg+xml`, `image/png`, …).
19962
+ *
19963
+ * The server knows this and therefore says it, because the client cannot
19964
+ * safely guess: a React-Native client renders SVG and raster through two
19965
+ * DIFFERENT components (`react-native-svg` vs `expo-image` — expo-image does
19966
+ * not decode SVG on iOS/Android), so without this it silently fell back to a
19967
+ * placeholder glyph for every vector icon while the web build looked fine.
19968
+ *
19969
+ * Absent when {@link iconUrl} is absent, or for a legacy provider that has
19970
+ * not been updated — a client that cannot determine the type should prefer
19971
+ * its raster path, which is the safe default for an unknown image.
19972
+ */
19973
+ iconMediaType: string().optional(),
19763
19974
  configSchema: ConfigSchemaPassthrough,
19764
19975
  supportsDiscovery: boolean(),
19765
19976
  caps: TargetKindCapsSchema
@@ -20207,6 +20418,29 @@ var MotionEventSchema = object({
20207
20418
  * Absent on legacy rows ⇒ treat as `pipeline`.
20208
20419
  */
20209
20420
  var DetectionSourceSchema = _enum(["pipeline", "onboard"]);
20421
+ /**
20422
+ * The confirmed zone crossing that produced an object event. Present ONLY on
20423
+ * an event emitted BY a crossing (`zone.enter` / `zone.exit`); a movement-state
20424
+ * event (`object.entering` / `leaving` / `stationary` / `loitering`) and an
20425
+ * appearance event carry none, so a rule asking for a direction fails closed
20426
+ * on them.
20427
+ *
20428
+ * Exactly ONE crossing per event: the emitter turns each confirmed crossing
20429
+ * into its own event, so a frame in which a track enters A while leaving B
20430
+ * produces two events with two directions — never one ambiguous row.
20431
+ *
20432
+ * `zoneId` is load-bearing for an EXIT: the event's `zones` list is the
20433
+ * membership the box has NOW, and by definition it no longer contains the zone
20434
+ * that was just left. Without the id here, a zone-scoped rule could never match
20435
+ * the exit it asked for.
20436
+ */
20437
+ var ZoneCrossingSchema = object({
20438
+ direction: _enum(["enter", "exit"]),
20439
+ /** Admin zone id crossed. */
20440
+ zoneId: string(),
20441
+ /** Zone display name at crossing time (falls back to the id). */
20442
+ zoneName: string().optional()
20443
+ });
20210
20444
  var ObjectEventSchema = object({
20211
20445
  ...BaseEventFields,
20212
20446
  kind: literal("object"),
@@ -20233,6 +20467,12 @@ var ObjectEventSchema = object({
20233
20467
  zones: array(string()).readonly().optional(),
20234
20468
  /** Omitted in slim projection. */
20235
20469
  state: TrackStateSchema.optional(),
20470
+ /**
20471
+ * The zone crossing this event IS, when it is one. Absent on every other
20472
+ * event kind (movement state, appearance, package) — see
20473
+ * {@link ZoneCrossingSchema}. Omitted in slim projection.
20474
+ */
20475
+ zoneCrossing: ZoneCrossingSchema.optional(),
20236
20476
  /** Detection-frame dimensions in pixels — let consumers normalize the
20237
20477
  * pixel-space `bbox` onto a displayed image. Omitted in slim projection. */
20238
20478
  frameWidth: number().optional(),
@@ -20491,6 +20731,15 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20491
20731
  }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
20492
20732
  kind: "mutation",
20493
20733
  auth: "admin"
20734
+ }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
20735
+ kind: "mutation",
20736
+ auth: "admin"
20737
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
20738
+ kind: "query",
20739
+ auth: "admin"
20740
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
20741
+ kind: "mutation",
20742
+ auth: "admin"
20494
20743
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
20495
20744
  kind: "query",
20496
20745
  auth: "admin"
@@ -23021,6 +23270,17 @@ var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
23021
23270
  */
23022
23271
  priority: number()
23023
23272
  })).readonly() });
23273
+ /**
23274
+ * The chosen outbound endpoint for notification artifacts. `baseUrl: null` =
23275
+ * AUTO (resolved from the candidate ranking at send time); `resolved` reports
23276
+ * what AUTO currently picks, so the UI can show the effective value either way.
23277
+ */
23278
+ var NotificationEndpointSchema = object({
23279
+ /** The operator's explicit choice, or null for AUTO. */
23280
+ baseUrl: string().nullable(),
23281
+ /** What the ranking currently resolves to (null when nothing is reachable). */
23282
+ resolved: string().nullable()
23283
+ });
23024
23284
  var AllowedAddressesSchema = object({
23025
23285
  /**
23026
23286
  * Allowlist of interface addresses operators have explicitly opted
@@ -23043,7 +23303,7 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
23043
23303
  * to avoid mixed-content blocks in the browser. The public
23044
23304
  * tunnel always emits `https://` regardless. */
23045
23305
  scheme: _enum(["http", "https"]).optional()
23046
- }), GetConnectionEndpointsResultSchema), method(_void(), AllowedAddressesSchema), method(AllowedAddressesSchema, object({ success: literal(true) }), { kind: "mutation" }), method(_void(), AllowedAddressesSchema, { kind: "mutation" });
23306
+ }), 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" });
23047
23307
  /**
23048
23308
  * mesh-network — collection cap for mesh-VPN providers.
23049
23309
  *
@@ -23930,7 +24190,12 @@ var RecordingDeviceUsageSchema = object({
23930
24190
  var RecordingLocationUsageSchema = object({
23931
24191
  /** StorageLocation id; null for the legacy/degraded single-root fallback. */
23932
24192
  locationId: string().nullable(),
23933
- /** Bytes of recordings stored on this location. */
24193
+ /** Every location id sharing this row's PHYSICAL volume (aliases). One row
24194
+ * is emitted per physical disk (2026-07-29): two locations on one root
24195
+ * previously rendered as two identical "disks" with a nonsensical used
24196
+ * split — hydrate attribution across aliases is arbitrary by nature. */
24197
+ locationIds: array(string()).optional(),
24198
+ /** Bytes of recordings stored on this PHYSICAL volume (all aliases). */
23934
24199
  usedBytes: number(),
23935
24200
  /** Free bytes on the location's volume; null when capacity is unknown (remote). */
23936
24201
  availableBytes: number().nullable(),
@@ -24042,6 +24307,44 @@ method(object({
24042
24307
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
24043
24308
  kind: "query",
24044
24309
  auth: "admin"
24310
+ }), method(object({
24311
+ deviceId: number(),
24312
+ aroundMs: number(),
24313
+ preRollSec: number().min(0).max(30).default(2),
24314
+ postRollSec: number().min(0).max(30).default(5),
24315
+ maxWidth: number().int().min(120).max(1280).default(480),
24316
+ fps: number().int().min(1).max(15).default(5)
24317
+ }), object({
24318
+ gifBase64: string(),
24319
+ fromMs: number(),
24320
+ toMs: number()
24321
+ }), {
24322
+ kind: "mutation",
24323
+ auth: "admin"
24324
+ }), method(object({
24325
+ deviceId: number(),
24326
+ aroundMs: number(),
24327
+ preRollSec: number().min(0).max(30).default(3),
24328
+ postRollSec: number().min(0).max(30).default(7),
24329
+ maxWidth: number().int().min(160).max(1920).default(640)
24330
+ }), object({
24331
+ clipBase64: string(),
24332
+ mime: string(),
24333
+ fromMs: number(),
24334
+ toMs: number(),
24335
+ bytes: number().int()
24336
+ }), {
24337
+ kind: "mutation",
24338
+ auth: "admin"
24339
+ }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
24340
+ kind: "mutation",
24341
+ auth: "admin"
24342
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
24343
+ kind: "query",
24344
+ auth: "admin"
24345
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
24346
+ kind: "mutation",
24347
+ auth: "admin"
24045
24348
  });
24046
24349
  /**
24047
24350
  * `recordingExport` cap — render a footage time range into a single downloadable
@@ -25844,6 +26147,12 @@ Object.freeze({
25844
26147
  addonId: null,
25845
26148
  access: "view"
25846
26149
  },
26150
+ "deviceManager.getDeviceStatusAggregateBatch": {
26151
+ capName: "device-manager",
26152
+ capScope: "system",
26153
+ addonId: null,
26154
+ access: "view"
26155
+ },
25847
26156
  "deviceManager.getLinkedDevices": {
25848
26157
  capName: "device-manager",
25849
26158
  capScope: "system",
@@ -26738,6 +27047,12 @@ Object.freeze({
26738
27047
  addonId: null,
26739
27048
  access: "view"
26740
27049
  },
27050
+ "localNetwork.getNotificationEndpoint": {
27051
+ capName: "local-network",
27052
+ capScope: "system",
27053
+ addonId: null,
27054
+ access: "view"
27055
+ },
26741
27056
  "localNetwork.getPreferred": {
26742
27057
  capName: "local-network",
26743
27058
  capScope: "system",
@@ -26762,6 +27077,12 @@ Object.freeze({
26762
27077
  addonId: null,
26763
27078
  access: "create"
26764
27079
  },
27080
+ "localNetwork.setNotificationEndpoint": {
27081
+ capName: "local-network",
27082
+ capScope: "system",
27083
+ addonId: null,
27084
+ access: "create"
27085
+ },
26765
27086
  "lockControl.lock": {
26766
27087
  capName: "lock-control",
26767
27088
  capScope: "device",
@@ -27404,6 +27725,12 @@ Object.freeze({
27404
27725
  addonId: null,
27405
27726
  access: "create"
27406
27727
  },
27728
+ "pipelineAnalytics.cancelMediaRelocate": {
27729
+ capName: "pipeline-analytics",
27730
+ capScope: "device",
27731
+ addonId: null,
27732
+ access: "create"
27733
+ },
27407
27734
  "pipelineAnalytics.clearTracks": {
27408
27735
  capName: "pipeline-analytics",
27409
27736
  capScope: "device",
@@ -27458,6 +27785,12 @@ Object.freeze({
27458
27785
  addonId: null,
27459
27786
  access: "view"
27460
27787
  },
27788
+ "pipelineAnalytics.getMediaRelocateStatus": {
27789
+ capName: "pipeline-analytics",
27790
+ capScope: "device",
27791
+ addonId: null,
27792
+ access: "view"
27793
+ },
27461
27794
  "pipelineAnalytics.getMotionEvents": {
27462
27795
  capName: "pipeline-analytics",
27463
27796
  capScope: "device",
@@ -27530,6 +27863,12 @@ Object.freeze({
27530
27863
  addonId: null,
27531
27864
  access: "create"
27532
27865
  },
27866
+ "pipelineAnalytics.relocateMedia": {
27867
+ capName: "pipeline-analytics",
27868
+ capScope: "device",
27869
+ addonId: null,
27870
+ access: "create"
27871
+ },
27533
27872
  "pipelineAnalytics.searchObjectEvents": {
27534
27873
  capName: "pipeline-analytics",
27535
27874
  capScope: "device",
@@ -28292,6 +28631,12 @@ Object.freeze({
28292
28631
  addonId: null,
28293
28632
  access: "create"
28294
28633
  },
28634
+ "recording.cancelRelocate": {
28635
+ capName: "recording",
28636
+ capScope: "system",
28637
+ addonId: null,
28638
+ access: "create"
28639
+ },
28295
28640
  "recording.deleteFootprint": {
28296
28641
  capName: "recording",
28297
28642
  capScope: "system",
@@ -28322,6 +28667,12 @@ Object.freeze({
28322
28667
  addonId: null,
28323
28668
  access: "view"
28324
28669
  },
28670
+ "recording.getRelocateStatus": {
28671
+ capName: "recording",
28672
+ capScope: "system",
28673
+ addonId: null,
28674
+ access: "view"
28675
+ },
28325
28676
  "recording.getStorageUsage": {
28326
28677
  capName: "recording",
28327
28678
  capScope: "system",
@@ -28352,6 +28703,24 @@ Object.freeze({
28352
28703
  addonId: null,
28353
28704
  access: "view"
28354
28705
  },
28706
+ "recording.relocateFootage": {
28707
+ capName: "recording",
28708
+ capScope: "system",
28709
+ addonId: null,
28710
+ access: "create"
28711
+ },
28712
+ "recording.renderClip": {
28713
+ capName: "recording",
28714
+ capScope: "system",
28715
+ addonId: null,
28716
+ access: "create"
28717
+ },
28718
+ "recording.renderGif": {
28719
+ capName: "recording",
28720
+ capScope: "system",
28721
+ addonId: null,
28722
+ access: "create"
28723
+ },
28355
28724
  "recording.rescanStorage": {
28356
28725
  capName: "recording",
28357
28726
  capScope: "system",
@@ -28946,6 +29315,12 @@ Object.freeze({
28946
29315
  addonId: null,
28947
29316
  access: "create"
28948
29317
  },
29318
+ "streamBroker.renderPreBufferClip": {
29319
+ capName: "stream-broker",
29320
+ capScope: "system",
29321
+ addonId: null,
29322
+ access: "create"
29323
+ },
28949
29324
  "streamBroker.restartProfile": {
28950
29325
  capName: "stream-broker",
28951
29326
  capScope: "system",