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