@camstack/addon-provider-onvif 1.2.46 → 1.2.48

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.
package/dist/addon.js CHANGED
@@ -8017,6 +8017,20 @@ var RelocateJobSchema = object({
8017
8017
  * in its row, not in its name, so `MediaRelocateEngine` never reconciles one.
8018
8018
  */
8019
8019
  rowsReconciled: number().int().nonnegative().optional(),
8020
+ /**
8021
+ * Rows this run FORGOT because the file they name is not on disk.
8022
+ *
8023
+ * The mover derived the path from the row's own fields and `stat`ed it; an
8024
+ * ENOENT there is a per-path confirmation that the segment is gone (D296),
8025
+ * and the durable row is dropped through the same channel eviction uses. It
8026
+ * is reported for the same reason `rowsReconciled` is: this is a durable
8027
+ * mutation nobody asked for, and a migration that quietly erases hour rows is
8028
+ * the same failure as one that quietly skips them (D295).
8029
+ *
8030
+ * The production drain of 2026-08-30 would have reported 11 074 here — the
8031
+ * ledger claimed 5.65 GB of footage that no longer existed.
8032
+ */
8033
+ rowsForgotten: number().int().nonnegative().optional(),
8020
8034
  startedAt: number(),
8021
8035
  finishedAt: number().nullable(),
8022
8036
  error: string().nullable()
@@ -8380,6 +8394,91 @@ var RelocateResidueSchema = object({
8380
8394
  segments: number().int().nonnegative(),
8381
8395
  bytes: number().int().nonnegative()
8382
8396
  }).nullable();
8397
+ /**
8398
+ * Ask one location whether its durable hour rows describe the disk — the walk
8399
+ * (D319).
8400
+ *
8401
+ * `apply` DEFAULTS TO FALSE and that default is the product: the operator's
8402
+ * missing tool is the question, and the dry run is how they sanity-check the
8403
+ * destructive run before authorising it.
8404
+ */
8405
+ var LedgerWalkInputSchema = object({
8406
+ locationId: string().min(1),
8407
+ /** Forget the confirmed-absent rows, rather than only counting them. */
8408
+ apply: boolean().optional(),
8409
+ /** Narrow to one camera. */
8410
+ deviceId: number().int().positive().optional(),
8411
+ /** Narrow to these recording profiles; empty/absent = every profile. */
8412
+ profiles: array(string().min(1)).optional()
8413
+ });
8414
+ /** Why a whole walk did nothing. Every one leaves the ledger untouched. */
8415
+ var LedgerWalkRefusalSchema = _enum([
8416
+ "location-unknown",
8417
+ "source-writable",
8418
+ "no-ledger",
8419
+ "archive-unreadable",
8420
+ "anchor-absent",
8421
+ "anchor-unreadable",
8422
+ "anchor-moved"
8423
+ ]);
8424
+ _enum([
8425
+ "live-tail",
8426
+ "listing-error",
8427
+ "path-mismatch",
8428
+ "durable-refused"
8429
+ ]);
8430
+ /** Every skip reason, always present, always a number — so a reason that never
8431
+ * fired reports as zero rather than absent and the report shape is constant
8432
+ * between passes. Spelled out rather than `z.record` for exactly that. */
8433
+ var LedgerWalkSkipCountsSchema = object({
8434
+ "live-tail": number().int().nonnegative(),
8435
+ "listing-error": number().int().nonnegative(),
8436
+ "path-mismatch": number().int().nonnegative(),
8437
+ "durable-refused": number().int().nonnegative()
8438
+ });
8439
+ /** One camera's share of a walk, so a report names cameras and not rows. */
8440
+ var LedgerWalkDeviceReportSchema = object({
8441
+ deviceId: number().int(),
8442
+ hoursWalked: number().int().nonnegative(),
8443
+ hoursMissing: number().int().nonnegative(),
8444
+ ghostSegments: number().int().nonnegative(),
8445
+ ghostBytes: number().int().nonnegative(),
8446
+ forgottenSegments: number().int().nonnegative(),
8447
+ orphanFiles: number().int().nonnegative()
8448
+ });
8449
+ /**
8450
+ * What one walk claimed, listed, found and (only when armed) forgot.
8451
+ *
8452
+ * `archiveSegments` is the **M** and `segmentsClaimed` the **N** (D295), so a
8453
+ * walk that saw a fraction of the location is visible in its own report rather
8454
+ * than in the absence of one.
8455
+ */
8456
+ var LedgerWalkReportSchema = object({
8457
+ locationId: string(),
8458
+ applied: boolean(),
8459
+ refused: LedgerWalkRefusalSchema.nullable(),
8460
+ archiveSegments: number().int().nonnegative().nullable(),
8461
+ archiveBytes: number().int().nonnegative().nullable(),
8462
+ hoursClaimed: number().int().nonnegative(),
8463
+ hoursWalked: number().int().nonnegative(),
8464
+ hoursMissing: number().int().nonnegative(),
8465
+ /** `readdir` calls issued — the cost, stated in the unit that is paid. */
8466
+ listings: number().int().nonnegative(),
8467
+ segmentsClaimed: number().int().nonnegative(),
8468
+ ghostSegments: number().int().nonnegative(),
8469
+ ghostBytes: number().int().nonnegative(),
8470
+ ghostHoursWhole: number().int().nonnegative(),
8471
+ forgottenSegments: number().int().nonnegative(),
8472
+ forgottenBytes: number().int().nonnegative(),
8473
+ /** Files under a claimed hour that no durable row names. Never deleted. */
8474
+ orphanFiles: number().int().nonnegative(),
8475
+ orphanSample: array(string()).readonly(),
8476
+ hoursSkipped: number().int().nonnegative(),
8477
+ skippedByReason: LedgerWalkSkipCountsSchema,
8478
+ /** The walk stopped at its per-pass hour bound with claims unwalked. */
8479
+ bounded: boolean(),
8480
+ byDevice: array(LedgerWalkDeviceReportSchema).readonly()
8481
+ });
8383
8482
  /** How many rows a media pass would still act on against a given target — the
8384
8483
  * media lane's denominator AND its residue, from ONE derivation so the two can
8385
8484
  * never disagree. `null` = the count could not be taken. */
@@ -18708,13 +18807,15 @@ var ListGroupsPageSchema = object({
18708
18807
  groups: array(AnalyticsGroupRecordSchema).readonly(),
18709
18808
  nextCursor: string().nullable()
18710
18809
  });
18810
+ var KEY_EVENTS_DEFAULT_LIMIT = 50;
18811
+ var KEY_EVENTS_MAX_LIMIT = 200;
18711
18812
  var KeyEventQueryInput = object({
18712
18813
  deviceId: number(),
18713
18814
  /** Window lower bound (track firstSeen ≥ since). */
18714
18815
  since: number(),
18715
18816
  /** Window upper bound (track firstSeen ≤ until). */
18716
18817
  until: number(),
18717
- limit: number().int().min(1).max(200).default(50),
18818
+ limit: number().int().min(1).max(KEY_EVENTS_MAX_LIMIT).default(KEY_EVENTS_DEFAULT_LIMIT),
18718
18819
  /** Drop tracks scoring below this importance. */
18719
18820
  minImportance: number().min(0).max(1).optional(),
18720
18821
  /** Restrict to a single class (e.g. 'person'). */
@@ -18736,6 +18837,32 @@ var KeyEventSchema = object({
18736
18837
  ...TrackFlagFields,
18737
18838
  ...TrackRetrainFields
18738
18839
  });
18840
+ /** `getKeyEvents`' window and filters, asked of a SET of cameras at once. */
18841
+ var KeyEventBatchQueryInput = object({
18842
+ deviceIds: array(number()).min(1).max(200),
18843
+ since: number(),
18844
+ until: number(),
18845
+ /** Applied PER CAMERA, exactly as `getKeyEvents.limit` is — never a total
18846
+ * across the set, which would let a busy camera starve a quiet one of its
18847
+ * rows and change what the merged feed contains. */
18848
+ limit: number().int().min(1).max(KEY_EVENTS_MAX_LIMIT).default(KEY_EVENTS_DEFAULT_LIMIT),
18849
+ minImportance: number().min(0).max(1).optional(),
18850
+ classFilter: string().optional()
18851
+ });
18852
+ /**
18853
+ * One camera's key events in a batch answer.
18854
+ *
18855
+ * The row exists for every requested id. `getKeyEvents` degrades to `[]` on
18856
+ * error rather than throwing, so a camera whose store read failed and one with
18857
+ * no events in the window were ALREADY indistinguishable per camera — the
18858
+ * batch does not make that worse, and the row keeps the deviceId the single
18859
+ * method's output never carried (the caller used to stamp it from the fan-out
18860
+ * key, which only worked because there was one query per camera).
18861
+ */
18862
+ var KeyEventsForDeviceSchema = object({
18863
+ deviceId: number(),
18864
+ events: array(KeyEventSchema).readonly()
18865
+ });
18739
18866
  object({
18740
18867
  trackId: string(),
18741
18868
  className: string(),
@@ -18807,6 +18934,50 @@ var EventStoreFootprintSchema = object({
18807
18934
  totalBytes: number().int(),
18808
18935
  devices: array(EventStoreDeviceFootprintSchema).readonly()
18809
18936
  });
18937
+ /** Event-media footprint for one {@link MediaFileKind}. */
18938
+ var EventMediaKindFootprintSchema = object({
18939
+ kind: MediaFileKindEnum,
18940
+ /** Media rows of this kind. */
18941
+ rows: number().int(),
18942
+ /** Bytes on disk held by those rows. */
18943
+ bytes: number().int()
18944
+ });
18945
+ /**
18946
+ * The media footprint broken down by KIND — the axis a deletion decision
18947
+ * actually turns on.
18948
+ *
18949
+ * A byte total says how much there is; it cannot say what is safe to remove.
18950
+ * The deletable set (the periodic `snapshot` filmstrip, the surplus per-edge
18951
+ * motion stills) and the keep set (`firstFrame`, rolling `lastFrame`,
18952
+ * `thumbnail`/`thumbnailSmall`, `keyFrame`/`keyFrameSmall`, the face/plate
18953
+ * buffers, gallery media, the CLIP `crop`) are distinguished by `kind` and by
18954
+ * nothing else, so sizing a deletion means summing per kind.
18955
+ *
18956
+ * ## Why `unaccounted*` exists
18957
+ *
18958
+ * `kinds` is enumerated from {@link MediaFileKindEnum} — the closed set the
18959
+ * writers use — and summed one kind at a time. `totalRows` / `totalBytes` come
18960
+ * from a SEPARATE unfiltered aggregate over the same rows, never from adding
18961
+ * `kinds` up. A row whose stored `kind` is not in the enum (written by a
18962
+ * retired code path, or by a version that knew a kind this one does not) would
18963
+ * otherwise vanish from the total silently, and an operator would delete
18964
+ * against a denominator smaller than the disk.
18965
+ *
18966
+ * `unaccountedRows` / `unaccountedBytes` are the difference. They are normally
18967
+ * zero; a non-zero value is a real finding and must be shown, not rounded away.
18968
+ */
18969
+ var EventMediaKindBreakdownSchema = object({
18970
+ /** Every media row in scope, from one unfiltered aggregate. */
18971
+ totalRows: number().int(),
18972
+ /** Every media byte in scope, from that same aggregate. */
18973
+ totalBytes: number().int(),
18974
+ /** Per-kind footprint, ordered by bytes descending. */
18975
+ kinds: array(EventMediaKindFootprintSchema).readonly(),
18976
+ /** `totalRows` minus the summed `kinds` rows — see the schema note. */
18977
+ unaccountedRows: number().int(),
18978
+ /** `totalBytes` minus the summed `kinds` bytes — see the schema note. */
18979
+ unaccountedBytes: number().int()
18980
+ });
18810
18981
  /** Per-kind counts returned by the event-prune / device-delete mutations. */
18811
18982
  var EventPruneCountsSchema = object({
18812
18983
  motion: number().int(),
@@ -18961,7 +19132,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
18961
19132
  until: number().optional(),
18962
19133
  kinds: array(string()).optional(),
18963
19134
  limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
18964
- }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
19135
+ }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
18965
19136
  deviceId: number(),
18966
19137
  since: number(),
18967
19138
  until: number(),
@@ -19010,6 +19181,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19010
19181
  }), TrackFlagsSchema, { kind: "mutation" }), method(object({}), EventStoreFootprintSchema, {
19011
19182
  kind: "query",
19012
19183
  auth: "admin"
19184
+ }), method(object({ deviceId: number().int().optional() }), EventMediaKindBreakdownSchema, {
19185
+ kind: "query",
19186
+ auth: "admin"
19013
19187
  }), method(object({
19014
19188
  olderThanMs: number(),
19015
19189
  reason: OpsLogReasonSchema.optional()
@@ -21065,6 +21239,20 @@ method(object({
21065
21239
  error: string().optional()
21066
21240
  }), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
21067
21241
  providerId: string(),
21242
+ /**
21243
+ * The location this config is an UNSAVED edit of, when there is one.
21244
+ *
21245
+ * `listLocations` replaces every declared secret with the redaction
21246
+ * sentinel, so the edit modal's form state holds the sentinel for any
21247
+ * credential the operator did not retype — and posting that here
21248
+ * without a way to resolve it makes the provider try to authenticate
21249
+ * as `__camstack_redacted__` and report the operator's own working
21250
+ * password as wrong. Given this id, the orchestrator restores each
21251
+ * sentinel from the stored config (same rule as `upsertLocation`)
21252
+ * before dispatching. Omitted by the "Add location" wizard, where
21253
+ * every value was typed just now and nothing is stored yet.
21254
+ */
21255
+ locationId: string().optional(),
21068
21256
  config: record(string(), unknown())
21069
21257
  }), object({
21070
21258
  ok: boolean(),
@@ -26742,6 +26930,9 @@ method(object({
26742
26930
  }), method(RelocateResidueInputSchema, RelocateResidueSchema, {
26743
26931
  kind: "query",
26744
26932
  auth: "admin"
26933
+ }), method(LedgerWalkInputSchema, LedgerWalkReportSchema, {
26934
+ kind: "mutation",
26935
+ auth: "admin"
26745
26936
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
26746
26937
  kind: "mutation",
26747
26938
  auth: "admin"
@@ -27133,7 +27324,26 @@ var SceneMonitorStatusSchema = object({
27133
27324
  monitors: array(SceneMonitorSchema),
27134
27325
  lastFetchedAt: number()
27135
27326
  });
27136
- DeviceType.Camera, method(object({ deviceId: number() }), SceneMonitorStatusSchema), method(object({
27327
+ /**
27328
+ * One camera's row in a `listScenesBatch` answer.
27329
+ *
27330
+ * `status` is NULLABLE and the nullability is the whole point. `scene-monitor`
27331
+ * is a `defaultActive` wrapper, so every camera is asked; a camera whose
27332
+ * provider is absent (pipeline-analytics not deployed, the post-processing node
27333
+ * down) cannot answer, and that is not the same fact as a camera with no scenes
27334
+ * configured. Fanned out per camera the difference was visible — one query
27335
+ * errored while the others resolved — and a batch that returned only the rows
27336
+ * it managed would have destroyed it, silently, by making an unreachable camera
27337
+ * indistinguishable from one that answered `monitors: []`.
27338
+ *
27339
+ * So: EVERY requested deviceId gets a row. `status: null` means "this camera
27340
+ * could not be read"; `status.monitors: []` means "read, and it has none".
27341
+ */
27342
+ var SceneMonitorStatusForDeviceSchema = object({
27343
+ deviceId: number(),
27344
+ status: SceneMonitorStatusSchema.nullable()
27345
+ });
27346
+ DeviceType.Camera, method(object({ deviceId: number() }), SceneMonitorStatusSchema), method(object({ deviceIds: array(number()).min(1).max(200) }), array(SceneMonitorStatusForDeviceSchema).readonly()), method(object({
27137
27347
  deviceId: number(),
27138
27348
  label: string(),
27139
27349
  roi: MaskRectShapeSchema,
@@ -28457,6 +28667,27 @@ var CameraOccupancySnapshotSchema = object({
28457
28667
  stationaryObjects: array(StationaryObjectSchema).readonly().optional()
28458
28668
  });
28459
28669
  /**
28670
+ * One camera's row in a `getCurrentSnapshotBatch` answer.
28671
+ *
28672
+ * THREE outcomes, and the single-camera method could only express two of them
28673
+ * because `snapshot: null` was already spoken for:
28674
+ *
28675
+ * - `read: 'read'`, `snapshot` present — the live occupancy reading.
28676
+ * - `read: 'read'`, `snapshot: null` — read, and this camera has no reading
28677
+ * yet: no frame since boot, and no parked-object registry to hydrate from.
28678
+ * - `read: 'unreadable'` — the owner could not answer for this
28679
+ * camera. `snapshot` is null, and it does NOT mean "nothing parked here".
28680
+ *
28681
+ * Collapsing the last two is the failure this field exists to prevent: a
28682
+ * hydration that threw would otherwise render as an empty Stationary section,
28683
+ * which is a definite claim about a camera nobody could read.
28684
+ */
28685
+ var CameraOccupancySnapshotForDeviceSchema = object({
28686
+ deviceId: number(),
28687
+ read: _enum(["read", "unreadable"]),
28688
+ snapshot: CameraOccupancySnapshotSchema.nullable()
28689
+ });
28690
+ /**
28460
28691
  * Time-series resolution. The history methods return one bucket per
28461
28692
  * step over the requested range. Smaller resolutions cost more
28462
28693
  * memory + bandwidth; bound to discrete steps so caller cannot ask
@@ -28480,7 +28711,7 @@ var HistoryPointSchema = object({
28480
28711
  /** Object count averaged over the bucket (rounded to nearest integer). */
28481
28712
  count: number().int().nonnegative()
28482
28713
  });
28483
- DeviceType.Camera, method(object({ deviceId: number() }), CameraOccupancySnapshotSchema.nullable()), method(object({
28714
+ DeviceType.Camera, method(object({ deviceId: number() }), CameraOccupancySnapshotSchema.nullable()), method(object({ deviceIds: array(number()).min(1).max(200) }), array(CameraOccupancySnapshotForDeviceSchema).readonly()), method(object({
28484
28715
  deviceId: number(),
28485
28716
  zoneId: string(),
28486
28717
  className: string().optional()
@@ -32171,6 +32402,12 @@ Object.freeze({
32171
32402
  addonId: null,
32172
32403
  access: "view"
32173
32404
  },
32405
+ "pipelineAnalytics.getEventMediaFootprintByKind": {
32406
+ capName: "pipeline-analytics",
32407
+ capScope: "device",
32408
+ addonId: null,
32409
+ access: "view"
32410
+ },
32174
32411
  "pipelineAnalytics.getEventStoreFootprint": {
32175
32412
  capName: "pipeline-analytics",
32176
32413
  capScope: "device",
@@ -32189,6 +32426,12 @@ Object.freeze({
32189
32426
  addonId: null,
32190
32427
  access: "view"
32191
32428
  },
32429
+ "pipelineAnalytics.getKeyEventsBatch": {
32430
+ capName: "pipeline-analytics",
32431
+ capScope: "device",
32432
+ addonId: null,
32433
+ access: "view"
32434
+ },
32192
32435
  "pipelineAnalytics.getMotionEvents": {
32193
32436
  capName: "pipeline-analytics",
32194
32437
  capScope: "device",
@@ -33365,6 +33608,12 @@ Object.freeze({
33365
33608
  addonId: null,
33366
33609
  access: "view"
33367
33610
  },
33611
+ "recording.reconcileLedgerAgainstDisk": {
33612
+ capName: "recording",
33613
+ capScope: "system",
33614
+ addonId: null,
33615
+ access: "create"
33616
+ },
33368
33617
  "recording.refreshStorageLocationsForMigration": {
33369
33618
  capName: "recording",
33370
33619
  capScope: "system",
@@ -33491,6 +33740,12 @@ Object.freeze({
33491
33740
  addonId: null,
33492
33741
  access: "view"
33493
33742
  },
33743
+ "sceneMonitor.listScenesBatch": {
33744
+ capName: "scene-monitor",
33745
+ capScope: "device",
33746
+ addonId: null,
33747
+ access: "view"
33748
+ },
33494
33749
  "sceneMonitor.recheckNow": {
33495
33750
  capName: "scene-monitor",
33496
33751
  capScope: "device",
@@ -34847,6 +35102,12 @@ Object.freeze({
34847
35102
  addonId: null,
34848
35103
  access: "view"
34849
35104
  },
35105
+ "zoneAnalytics.getCurrentSnapshotBatch": {
35106
+ capName: "zone-analytics",
35107
+ capScope: "device",
35108
+ addonId: null,
35109
+ access: "view"
35110
+ },
34850
35111
  "zoneAnalytics.getUnzonedHistory": {
34851
35112
  capName: "zone-analytics",
34852
35113
  capScope: "device",
@@ -35836,6 +36097,11 @@ Object.freeze({
35836
36097
  form: "single",
35837
36098
  optional: false
35838
36099
  }],
36100
+ "pipelineAnalytics.getEventMediaFootprintByKind": [{
36101
+ name: "deviceId",
36102
+ form: "single",
36103
+ optional: true
36104
+ }],
35839
36105
  "pipelineAnalytics.getGroup": [{
35840
36106
  name: "deviceId",
35841
36107
  form: "single",
@@ -35846,6 +36112,11 @@ Object.freeze({
35846
36112
  form: "single",
35847
36113
  optional: false
35848
36114
  }],
36115
+ "pipelineAnalytics.getKeyEventsBatch": [{
36116
+ name: "deviceIds",
36117
+ form: "array",
36118
+ optional: false
36119
+ }],
35849
36120
  "pipelineAnalytics.getMotionEvents": [{
35850
36121
  name: "deviceId",
35851
36122
  form: "single",
@@ -36286,6 +36557,11 @@ Object.freeze({
36286
36557
  form: "single",
36287
36558
  optional: false
36288
36559
  }],
36560
+ "recording.reconcileLedgerAgainstDisk": [{
36561
+ name: "deviceId",
36562
+ form: "single",
36563
+ optional: true
36564
+ }],
36289
36565
  "recording.relocateFootage": [{
36290
36566
  name: "deviceId",
36291
36567
  form: "single",
@@ -36351,6 +36627,11 @@ Object.freeze({
36351
36627
  form: "single",
36352
36628
  optional: false
36353
36629
  }],
36630
+ "sceneMonitor.listScenesBatch": [{
36631
+ name: "deviceIds",
36632
+ form: "array",
36633
+ optional: false
36634
+ }],
36354
36635
  "sceneMonitor.recheckNow": [{
36355
36636
  name: "deviceId",
36356
36637
  form: "single",
@@ -36612,6 +36893,11 @@ Object.freeze({
36612
36893
  form: "single",
36613
36894
  optional: false
36614
36895
  }],
36896
+ "zoneAnalytics.getCurrentSnapshotBatch": [{
36897
+ name: "deviceIds",
36898
+ form: "array",
36899
+ optional: false
36900
+ }],
36615
36901
  "zoneAnalytics.getUnzonedHistory": [{
36616
36902
  name: "deviceId",
36617
36903
  form: "single",
package/dist/addon.mjs CHANGED
@@ -8018,6 +8018,20 @@ var RelocateJobSchema = object({
8018
8018
  * in its row, not in its name, so `MediaRelocateEngine` never reconciles one.
8019
8019
  */
8020
8020
  rowsReconciled: number().int().nonnegative().optional(),
8021
+ /**
8022
+ * Rows this run FORGOT because the file they name is not on disk.
8023
+ *
8024
+ * The mover derived the path from the row's own fields and `stat`ed it; an
8025
+ * ENOENT there is a per-path confirmation that the segment is gone (D296),
8026
+ * and the durable row is dropped through the same channel eviction uses. It
8027
+ * is reported for the same reason `rowsReconciled` is: this is a durable
8028
+ * mutation nobody asked for, and a migration that quietly erases hour rows is
8029
+ * the same failure as one that quietly skips them (D295).
8030
+ *
8031
+ * The production drain of 2026-08-30 would have reported 11 074 here — the
8032
+ * ledger claimed 5.65 GB of footage that no longer existed.
8033
+ */
8034
+ rowsForgotten: number().int().nonnegative().optional(),
8021
8035
  startedAt: number(),
8022
8036
  finishedAt: number().nullable(),
8023
8037
  error: string().nullable()
@@ -8381,6 +8395,91 @@ var RelocateResidueSchema = object({
8381
8395
  segments: number().int().nonnegative(),
8382
8396
  bytes: number().int().nonnegative()
8383
8397
  }).nullable();
8398
+ /**
8399
+ * Ask one location whether its durable hour rows describe the disk — the walk
8400
+ * (D319).
8401
+ *
8402
+ * `apply` DEFAULTS TO FALSE and that default is the product: the operator's
8403
+ * missing tool is the question, and the dry run is how they sanity-check the
8404
+ * destructive run before authorising it.
8405
+ */
8406
+ var LedgerWalkInputSchema = object({
8407
+ locationId: string().min(1),
8408
+ /** Forget the confirmed-absent rows, rather than only counting them. */
8409
+ apply: boolean().optional(),
8410
+ /** Narrow to one camera. */
8411
+ deviceId: number().int().positive().optional(),
8412
+ /** Narrow to these recording profiles; empty/absent = every profile. */
8413
+ profiles: array(string().min(1)).optional()
8414
+ });
8415
+ /** Why a whole walk did nothing. Every one leaves the ledger untouched. */
8416
+ var LedgerWalkRefusalSchema = _enum([
8417
+ "location-unknown",
8418
+ "source-writable",
8419
+ "no-ledger",
8420
+ "archive-unreadable",
8421
+ "anchor-absent",
8422
+ "anchor-unreadable",
8423
+ "anchor-moved"
8424
+ ]);
8425
+ _enum([
8426
+ "live-tail",
8427
+ "listing-error",
8428
+ "path-mismatch",
8429
+ "durable-refused"
8430
+ ]);
8431
+ /** Every skip reason, always present, always a number — so a reason that never
8432
+ * fired reports as zero rather than absent and the report shape is constant
8433
+ * between passes. Spelled out rather than `z.record` for exactly that. */
8434
+ var LedgerWalkSkipCountsSchema = object({
8435
+ "live-tail": number().int().nonnegative(),
8436
+ "listing-error": number().int().nonnegative(),
8437
+ "path-mismatch": number().int().nonnegative(),
8438
+ "durable-refused": number().int().nonnegative()
8439
+ });
8440
+ /** One camera's share of a walk, so a report names cameras and not rows. */
8441
+ var LedgerWalkDeviceReportSchema = object({
8442
+ deviceId: number().int(),
8443
+ hoursWalked: number().int().nonnegative(),
8444
+ hoursMissing: number().int().nonnegative(),
8445
+ ghostSegments: number().int().nonnegative(),
8446
+ ghostBytes: number().int().nonnegative(),
8447
+ forgottenSegments: number().int().nonnegative(),
8448
+ orphanFiles: number().int().nonnegative()
8449
+ });
8450
+ /**
8451
+ * What one walk claimed, listed, found and (only when armed) forgot.
8452
+ *
8453
+ * `archiveSegments` is the **M** and `segmentsClaimed` the **N** (D295), so a
8454
+ * walk that saw a fraction of the location is visible in its own report rather
8455
+ * than in the absence of one.
8456
+ */
8457
+ var LedgerWalkReportSchema = object({
8458
+ locationId: string(),
8459
+ applied: boolean(),
8460
+ refused: LedgerWalkRefusalSchema.nullable(),
8461
+ archiveSegments: number().int().nonnegative().nullable(),
8462
+ archiveBytes: number().int().nonnegative().nullable(),
8463
+ hoursClaimed: number().int().nonnegative(),
8464
+ hoursWalked: number().int().nonnegative(),
8465
+ hoursMissing: number().int().nonnegative(),
8466
+ /** `readdir` calls issued — the cost, stated in the unit that is paid. */
8467
+ listings: number().int().nonnegative(),
8468
+ segmentsClaimed: number().int().nonnegative(),
8469
+ ghostSegments: number().int().nonnegative(),
8470
+ ghostBytes: number().int().nonnegative(),
8471
+ ghostHoursWhole: number().int().nonnegative(),
8472
+ forgottenSegments: number().int().nonnegative(),
8473
+ forgottenBytes: number().int().nonnegative(),
8474
+ /** Files under a claimed hour that no durable row names. Never deleted. */
8475
+ orphanFiles: number().int().nonnegative(),
8476
+ orphanSample: array(string()).readonly(),
8477
+ hoursSkipped: number().int().nonnegative(),
8478
+ skippedByReason: LedgerWalkSkipCountsSchema,
8479
+ /** The walk stopped at its per-pass hour bound with claims unwalked. */
8480
+ bounded: boolean(),
8481
+ byDevice: array(LedgerWalkDeviceReportSchema).readonly()
8482
+ });
8384
8483
  /** How many rows a media pass would still act on against a given target — the
8385
8484
  * media lane's denominator AND its residue, from ONE derivation so the two can
8386
8485
  * never disagree. `null` = the count could not be taken. */
@@ -18709,13 +18808,15 @@ var ListGroupsPageSchema = object({
18709
18808
  groups: array(AnalyticsGroupRecordSchema).readonly(),
18710
18809
  nextCursor: string().nullable()
18711
18810
  });
18811
+ var KEY_EVENTS_DEFAULT_LIMIT = 50;
18812
+ var KEY_EVENTS_MAX_LIMIT = 200;
18712
18813
  var KeyEventQueryInput = object({
18713
18814
  deviceId: number(),
18714
18815
  /** Window lower bound (track firstSeen ≥ since). */
18715
18816
  since: number(),
18716
18817
  /** Window upper bound (track firstSeen ≤ until). */
18717
18818
  until: number(),
18718
- limit: number().int().min(1).max(200).default(50),
18819
+ limit: number().int().min(1).max(KEY_EVENTS_MAX_LIMIT).default(KEY_EVENTS_DEFAULT_LIMIT),
18719
18820
  /** Drop tracks scoring below this importance. */
18720
18821
  minImportance: number().min(0).max(1).optional(),
18721
18822
  /** Restrict to a single class (e.g. 'person'). */
@@ -18737,6 +18838,32 @@ var KeyEventSchema = object({
18737
18838
  ...TrackFlagFields,
18738
18839
  ...TrackRetrainFields
18739
18840
  });
18841
+ /** `getKeyEvents`' window and filters, asked of a SET of cameras at once. */
18842
+ var KeyEventBatchQueryInput = object({
18843
+ deviceIds: array(number()).min(1).max(200),
18844
+ since: number(),
18845
+ until: number(),
18846
+ /** Applied PER CAMERA, exactly as `getKeyEvents.limit` is — never a total
18847
+ * across the set, which would let a busy camera starve a quiet one of its
18848
+ * rows and change what the merged feed contains. */
18849
+ limit: number().int().min(1).max(KEY_EVENTS_MAX_LIMIT).default(KEY_EVENTS_DEFAULT_LIMIT),
18850
+ minImportance: number().min(0).max(1).optional(),
18851
+ classFilter: string().optional()
18852
+ });
18853
+ /**
18854
+ * One camera's key events in a batch answer.
18855
+ *
18856
+ * The row exists for every requested id. `getKeyEvents` degrades to `[]` on
18857
+ * error rather than throwing, so a camera whose store read failed and one with
18858
+ * no events in the window were ALREADY indistinguishable per camera — the
18859
+ * batch does not make that worse, and the row keeps the deviceId the single
18860
+ * method's output never carried (the caller used to stamp it from the fan-out
18861
+ * key, which only worked because there was one query per camera).
18862
+ */
18863
+ var KeyEventsForDeviceSchema = object({
18864
+ deviceId: number(),
18865
+ events: array(KeyEventSchema).readonly()
18866
+ });
18740
18867
  object({
18741
18868
  trackId: string(),
18742
18869
  className: string(),
@@ -18808,6 +18935,50 @@ var EventStoreFootprintSchema = object({
18808
18935
  totalBytes: number().int(),
18809
18936
  devices: array(EventStoreDeviceFootprintSchema).readonly()
18810
18937
  });
18938
+ /** Event-media footprint for one {@link MediaFileKind}. */
18939
+ var EventMediaKindFootprintSchema = object({
18940
+ kind: MediaFileKindEnum,
18941
+ /** Media rows of this kind. */
18942
+ rows: number().int(),
18943
+ /** Bytes on disk held by those rows. */
18944
+ bytes: number().int()
18945
+ });
18946
+ /**
18947
+ * The media footprint broken down by KIND — the axis a deletion decision
18948
+ * actually turns on.
18949
+ *
18950
+ * A byte total says how much there is; it cannot say what is safe to remove.
18951
+ * The deletable set (the periodic `snapshot` filmstrip, the surplus per-edge
18952
+ * motion stills) and the keep set (`firstFrame`, rolling `lastFrame`,
18953
+ * `thumbnail`/`thumbnailSmall`, `keyFrame`/`keyFrameSmall`, the face/plate
18954
+ * buffers, gallery media, the CLIP `crop`) are distinguished by `kind` and by
18955
+ * nothing else, so sizing a deletion means summing per kind.
18956
+ *
18957
+ * ## Why `unaccounted*` exists
18958
+ *
18959
+ * `kinds` is enumerated from {@link MediaFileKindEnum} — the closed set the
18960
+ * writers use — and summed one kind at a time. `totalRows` / `totalBytes` come
18961
+ * from a SEPARATE unfiltered aggregate over the same rows, never from adding
18962
+ * `kinds` up. A row whose stored `kind` is not in the enum (written by a
18963
+ * retired code path, or by a version that knew a kind this one does not) would
18964
+ * otherwise vanish from the total silently, and an operator would delete
18965
+ * against a denominator smaller than the disk.
18966
+ *
18967
+ * `unaccountedRows` / `unaccountedBytes` are the difference. They are normally
18968
+ * zero; a non-zero value is a real finding and must be shown, not rounded away.
18969
+ */
18970
+ var EventMediaKindBreakdownSchema = object({
18971
+ /** Every media row in scope, from one unfiltered aggregate. */
18972
+ totalRows: number().int(),
18973
+ /** Every media byte in scope, from that same aggregate. */
18974
+ totalBytes: number().int(),
18975
+ /** Per-kind footprint, ordered by bytes descending. */
18976
+ kinds: array(EventMediaKindFootprintSchema).readonly(),
18977
+ /** `totalRows` minus the summed `kinds` rows — see the schema note. */
18978
+ unaccountedRows: number().int(),
18979
+ /** `totalBytes` minus the summed `kinds` bytes — see the schema note. */
18980
+ unaccountedBytes: number().int()
18981
+ });
18811
18982
  /** Per-kind counts returned by the event-prune / device-delete mutations. */
18812
18983
  var EventPruneCountsSchema = object({
18813
18984
  motion: number().int(),
@@ -18962,7 +19133,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
18962
19133
  until: number().optional(),
18963
19134
  kinds: array(string()).optional(),
18964
19135
  limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
18965
- }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
19136
+ }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
18966
19137
  deviceId: number(),
18967
19138
  since: number(),
18968
19139
  until: number(),
@@ -19011,6 +19182,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19011
19182
  }), TrackFlagsSchema, { kind: "mutation" }), method(object({}), EventStoreFootprintSchema, {
19012
19183
  kind: "query",
19013
19184
  auth: "admin"
19185
+ }), method(object({ deviceId: number().int().optional() }), EventMediaKindBreakdownSchema, {
19186
+ kind: "query",
19187
+ auth: "admin"
19014
19188
  }), method(object({
19015
19189
  olderThanMs: number(),
19016
19190
  reason: OpsLogReasonSchema.optional()
@@ -21066,6 +21240,20 @@ method(object({
21066
21240
  error: string().optional()
21067
21241
  }), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
21068
21242
  providerId: string(),
21243
+ /**
21244
+ * The location this config is an UNSAVED edit of, when there is one.
21245
+ *
21246
+ * `listLocations` replaces every declared secret with the redaction
21247
+ * sentinel, so the edit modal's form state holds the sentinel for any
21248
+ * credential the operator did not retype — and posting that here
21249
+ * without a way to resolve it makes the provider try to authenticate
21250
+ * as `__camstack_redacted__` and report the operator's own working
21251
+ * password as wrong. Given this id, the orchestrator restores each
21252
+ * sentinel from the stored config (same rule as `upsertLocation`)
21253
+ * before dispatching. Omitted by the "Add location" wizard, where
21254
+ * every value was typed just now and nothing is stored yet.
21255
+ */
21256
+ locationId: string().optional(),
21069
21257
  config: record(string(), unknown())
21070
21258
  }), object({
21071
21259
  ok: boolean(),
@@ -26743,6 +26931,9 @@ method(object({
26743
26931
  }), method(RelocateResidueInputSchema, RelocateResidueSchema, {
26744
26932
  kind: "query",
26745
26933
  auth: "admin"
26934
+ }), method(LedgerWalkInputSchema, LedgerWalkReportSchema, {
26935
+ kind: "mutation",
26936
+ auth: "admin"
26746
26937
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
26747
26938
  kind: "mutation",
26748
26939
  auth: "admin"
@@ -27134,7 +27325,26 @@ var SceneMonitorStatusSchema = object({
27134
27325
  monitors: array(SceneMonitorSchema),
27135
27326
  lastFetchedAt: number()
27136
27327
  });
27137
- DeviceType.Camera, method(object({ deviceId: number() }), SceneMonitorStatusSchema), method(object({
27328
+ /**
27329
+ * One camera's row in a `listScenesBatch` answer.
27330
+ *
27331
+ * `status` is NULLABLE and the nullability is the whole point. `scene-monitor`
27332
+ * is a `defaultActive` wrapper, so every camera is asked; a camera whose
27333
+ * provider is absent (pipeline-analytics not deployed, the post-processing node
27334
+ * down) cannot answer, and that is not the same fact as a camera with no scenes
27335
+ * configured. Fanned out per camera the difference was visible — one query
27336
+ * errored while the others resolved — and a batch that returned only the rows
27337
+ * it managed would have destroyed it, silently, by making an unreachable camera
27338
+ * indistinguishable from one that answered `monitors: []`.
27339
+ *
27340
+ * So: EVERY requested deviceId gets a row. `status: null` means "this camera
27341
+ * could not be read"; `status.monitors: []` means "read, and it has none".
27342
+ */
27343
+ var SceneMonitorStatusForDeviceSchema = object({
27344
+ deviceId: number(),
27345
+ status: SceneMonitorStatusSchema.nullable()
27346
+ });
27347
+ DeviceType.Camera, method(object({ deviceId: number() }), SceneMonitorStatusSchema), method(object({ deviceIds: array(number()).min(1).max(200) }), array(SceneMonitorStatusForDeviceSchema).readonly()), method(object({
27138
27348
  deviceId: number(),
27139
27349
  label: string(),
27140
27350
  roi: MaskRectShapeSchema,
@@ -28458,6 +28668,27 @@ var CameraOccupancySnapshotSchema = object({
28458
28668
  stationaryObjects: array(StationaryObjectSchema).readonly().optional()
28459
28669
  });
28460
28670
  /**
28671
+ * One camera's row in a `getCurrentSnapshotBatch` answer.
28672
+ *
28673
+ * THREE outcomes, and the single-camera method could only express two of them
28674
+ * because `snapshot: null` was already spoken for:
28675
+ *
28676
+ * - `read: 'read'`, `snapshot` present — the live occupancy reading.
28677
+ * - `read: 'read'`, `snapshot: null` — read, and this camera has no reading
28678
+ * yet: no frame since boot, and no parked-object registry to hydrate from.
28679
+ * - `read: 'unreadable'` — the owner could not answer for this
28680
+ * camera. `snapshot` is null, and it does NOT mean "nothing parked here".
28681
+ *
28682
+ * Collapsing the last two is the failure this field exists to prevent: a
28683
+ * hydration that threw would otherwise render as an empty Stationary section,
28684
+ * which is a definite claim about a camera nobody could read.
28685
+ */
28686
+ var CameraOccupancySnapshotForDeviceSchema = object({
28687
+ deviceId: number(),
28688
+ read: _enum(["read", "unreadable"]),
28689
+ snapshot: CameraOccupancySnapshotSchema.nullable()
28690
+ });
28691
+ /**
28461
28692
  * Time-series resolution. The history methods return one bucket per
28462
28693
  * step over the requested range. Smaller resolutions cost more
28463
28694
  * memory + bandwidth; bound to discrete steps so caller cannot ask
@@ -28481,7 +28712,7 @@ var HistoryPointSchema = object({
28481
28712
  /** Object count averaged over the bucket (rounded to nearest integer). */
28482
28713
  count: number().int().nonnegative()
28483
28714
  });
28484
- DeviceType.Camera, method(object({ deviceId: number() }), CameraOccupancySnapshotSchema.nullable()), method(object({
28715
+ DeviceType.Camera, method(object({ deviceId: number() }), CameraOccupancySnapshotSchema.nullable()), method(object({ deviceIds: array(number()).min(1).max(200) }), array(CameraOccupancySnapshotForDeviceSchema).readonly()), method(object({
28485
28716
  deviceId: number(),
28486
28717
  zoneId: string(),
28487
28718
  className: string().optional()
@@ -32172,6 +32403,12 @@ Object.freeze({
32172
32403
  addonId: null,
32173
32404
  access: "view"
32174
32405
  },
32406
+ "pipelineAnalytics.getEventMediaFootprintByKind": {
32407
+ capName: "pipeline-analytics",
32408
+ capScope: "device",
32409
+ addonId: null,
32410
+ access: "view"
32411
+ },
32175
32412
  "pipelineAnalytics.getEventStoreFootprint": {
32176
32413
  capName: "pipeline-analytics",
32177
32414
  capScope: "device",
@@ -32190,6 +32427,12 @@ Object.freeze({
32190
32427
  addonId: null,
32191
32428
  access: "view"
32192
32429
  },
32430
+ "pipelineAnalytics.getKeyEventsBatch": {
32431
+ capName: "pipeline-analytics",
32432
+ capScope: "device",
32433
+ addonId: null,
32434
+ access: "view"
32435
+ },
32193
32436
  "pipelineAnalytics.getMotionEvents": {
32194
32437
  capName: "pipeline-analytics",
32195
32438
  capScope: "device",
@@ -33366,6 +33609,12 @@ Object.freeze({
33366
33609
  addonId: null,
33367
33610
  access: "view"
33368
33611
  },
33612
+ "recording.reconcileLedgerAgainstDisk": {
33613
+ capName: "recording",
33614
+ capScope: "system",
33615
+ addonId: null,
33616
+ access: "create"
33617
+ },
33369
33618
  "recording.refreshStorageLocationsForMigration": {
33370
33619
  capName: "recording",
33371
33620
  capScope: "system",
@@ -33492,6 +33741,12 @@ Object.freeze({
33492
33741
  addonId: null,
33493
33742
  access: "view"
33494
33743
  },
33744
+ "sceneMonitor.listScenesBatch": {
33745
+ capName: "scene-monitor",
33746
+ capScope: "device",
33747
+ addonId: null,
33748
+ access: "view"
33749
+ },
33495
33750
  "sceneMonitor.recheckNow": {
33496
33751
  capName: "scene-monitor",
33497
33752
  capScope: "device",
@@ -34848,6 +35103,12 @@ Object.freeze({
34848
35103
  addonId: null,
34849
35104
  access: "view"
34850
35105
  },
35106
+ "zoneAnalytics.getCurrentSnapshotBatch": {
35107
+ capName: "zone-analytics",
35108
+ capScope: "device",
35109
+ addonId: null,
35110
+ access: "view"
35111
+ },
34851
35112
  "zoneAnalytics.getUnzonedHistory": {
34852
35113
  capName: "zone-analytics",
34853
35114
  capScope: "device",
@@ -35837,6 +36098,11 @@ Object.freeze({
35837
36098
  form: "single",
35838
36099
  optional: false
35839
36100
  }],
36101
+ "pipelineAnalytics.getEventMediaFootprintByKind": [{
36102
+ name: "deviceId",
36103
+ form: "single",
36104
+ optional: true
36105
+ }],
35840
36106
  "pipelineAnalytics.getGroup": [{
35841
36107
  name: "deviceId",
35842
36108
  form: "single",
@@ -35847,6 +36113,11 @@ Object.freeze({
35847
36113
  form: "single",
35848
36114
  optional: false
35849
36115
  }],
36116
+ "pipelineAnalytics.getKeyEventsBatch": [{
36117
+ name: "deviceIds",
36118
+ form: "array",
36119
+ optional: false
36120
+ }],
35850
36121
  "pipelineAnalytics.getMotionEvents": [{
35851
36122
  name: "deviceId",
35852
36123
  form: "single",
@@ -36287,6 +36558,11 @@ Object.freeze({
36287
36558
  form: "single",
36288
36559
  optional: false
36289
36560
  }],
36561
+ "recording.reconcileLedgerAgainstDisk": [{
36562
+ name: "deviceId",
36563
+ form: "single",
36564
+ optional: true
36565
+ }],
36290
36566
  "recording.relocateFootage": [{
36291
36567
  name: "deviceId",
36292
36568
  form: "single",
@@ -36352,6 +36628,11 @@ Object.freeze({
36352
36628
  form: "single",
36353
36629
  optional: false
36354
36630
  }],
36631
+ "sceneMonitor.listScenesBatch": [{
36632
+ name: "deviceIds",
36633
+ form: "array",
36634
+ optional: false
36635
+ }],
36355
36636
  "sceneMonitor.recheckNow": [{
36356
36637
  name: "deviceId",
36357
36638
  form: "single",
@@ -36613,6 +36894,11 @@ Object.freeze({
36613
36894
  form: "single",
36614
36895
  optional: false
36615
36896
  }],
36897
+ "zoneAnalytics.getCurrentSnapshotBatch": [{
36898
+ name: "deviceIds",
36899
+ form: "array",
36900
+ optional: false
36901
+ }],
36616
36902
  "zoneAnalytics.getUnzonedHistory": [{
36617
36903
  name: "deviceId",
36618
36904
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-onvif",
3
- "version": "1.2.46",
3
+ "version": "1.2.48",
4
4
  "description": "ONVIF camera device provider addon for CamStack",
5
5
  "keywords": [
6
6
  "camstack",