@camstack/addon-provider-homeassistant 1.2.60 → 1.2.62
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 +1 -1
- package/dist/addon.mjs +1 -1
- package/dist/{dist-D4pIhy8v.mjs → dist-DV4Xqi_x.mjs} +318 -2
- package/dist/{dist-BN8TjCTI.js → dist-u1L6UZmY.js} +318 -2
- package/dist/ha-export/ha-export.addon.js +1 -1
- package/dist/ha-export/ha-export.addon.mjs +1 -1
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_dist = require("./dist-
|
|
2
|
+
const require_dist = require("./dist-u1L6UZmY.js");
|
|
3
3
|
let node_crypto = require("node:crypto");
|
|
4
4
|
let node_zlib = require("node:zlib");
|
|
5
5
|
//#region src/ha-device-source.ts
|
package/dist/addon.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as presenceCapability, A as controlCapability, At as EventCategory, B as humiditySensorCapability, C as buildAddonRouteProvider, Ct as number, D as colorCapability, Dt as union, E as climateControlCapability, Et as string, F as eventEmitterCapability, G as motionCapability, H as lawnMowerControlCapability, I as fanControlCapability, J as notifierCapability, K as normalizeUnit, L as floodCapability, M as deviceAdoptionCapability, O as connectivityCapability, Ot as unknown, P as enumSensorCapability, Q as prepareNotification, R as gasCapability, S as brokerCapability, St as literal, T as carbonMonoxideCapability, Tt as record, U as lockControlCapability, V as imageCapability, W as mediaPlayerCapability, Y as numericSensorCapability, Z as powerMeterCapability, _ as automationControlCapability, _t as createEvent, at as temperatureSensorCapability, b as binaryCapability, bt as array, ct as valveCapability, d as TargetSchema, dt as weatherCapability, et as pressureSensorCapability, f as accessoriesCapability, ft as errMsg, g as ambientLightSensorCapability, gt as DeviceType, h as alarmPanelCapability, ht as DeviceRole, it as tamperCapability, j as coverCapability, k as contactCapability, kt as url, lt as vibrationCapability, m as airQualitySensorCapability, mt as DeviceFeature, n as BaseDevice, nt as smokeCapability, ot as updateCapability, p as addonRoutesCapability, q as notificationOutputCapability, r as BaseDeviceProvider, rt as switchCapability, s as EnumSensorDateTimeFormatSchema, st as vacuumControlCapability, tt as scriptRunnerCapability, ut as waterHeaterCapability, v as batteryCapability, w as buttonCapability, wt as object, x as brightnessCapability, xt as discriminatedUnion, y as bestLocationMatch, yt as _enum, z as humidifierCapability } from "./dist-
|
|
1
|
+
import { $ as presenceCapability, A as controlCapability, At as EventCategory, B as humiditySensorCapability, C as buildAddonRouteProvider, Ct as number, D as colorCapability, Dt as union, E as climateControlCapability, Et as string, F as eventEmitterCapability, G as motionCapability, H as lawnMowerControlCapability, I as fanControlCapability, J as notifierCapability, K as normalizeUnit, L as floodCapability, M as deviceAdoptionCapability, O as connectivityCapability, Ot as unknown, P as enumSensorCapability, Q as prepareNotification, R as gasCapability, S as brokerCapability, St as literal, T as carbonMonoxideCapability, Tt as record, U as lockControlCapability, V as imageCapability, W as mediaPlayerCapability, Y as numericSensorCapability, Z as powerMeterCapability, _ as automationControlCapability, _t as createEvent, at as temperatureSensorCapability, b as binaryCapability, bt as array, ct as valveCapability, d as TargetSchema, dt as weatherCapability, et as pressureSensorCapability, f as accessoriesCapability, ft as errMsg, g as ambientLightSensorCapability, gt as DeviceType, h as alarmPanelCapability, ht as DeviceRole, it as tamperCapability, j as coverCapability, k as contactCapability, kt as url, lt as vibrationCapability, m as airQualitySensorCapability, mt as DeviceFeature, n as BaseDevice, nt as smokeCapability, ot as updateCapability, p as addonRoutesCapability, q as notificationOutputCapability, r as BaseDeviceProvider, rt as switchCapability, s as EnumSensorDateTimeFormatSchema, st as vacuumControlCapability, tt as scriptRunnerCapability, ut as waterHeaterCapability, v as batteryCapability, w as buttonCapability, wt as object, x as brightnessCapability, xt as discriminatedUnion, y as bestLocationMatch, yt as _enum, z as humidifierCapability } from "./dist-DV4Xqi_x.mjs";
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
3
|
import { brotliCompressSync, deflateSync, gzipSync } from "node:zlib";
|
|
4
4
|
//#region src/ha-device-source.ts
|
|
@@ -8221,6 +8221,20 @@ var RelocateJobSchema = object({
|
|
|
8221
8221
|
* in its row, not in its name, so `MediaRelocateEngine` never reconciles one.
|
|
8222
8222
|
*/
|
|
8223
8223
|
rowsReconciled: number().int().nonnegative().optional(),
|
|
8224
|
+
/**
|
|
8225
|
+
* Rows this run FORGOT because the file they name is not on disk.
|
|
8226
|
+
*
|
|
8227
|
+
* The mover derived the path from the row's own fields and `stat`ed it; an
|
|
8228
|
+
* ENOENT there is a per-path confirmation that the segment is gone (D296),
|
|
8229
|
+
* and the durable row is dropped through the same channel eviction uses. It
|
|
8230
|
+
* is reported for the same reason `rowsReconciled` is: this is a durable
|
|
8231
|
+
* mutation nobody asked for, and a migration that quietly erases hour rows is
|
|
8232
|
+
* the same failure as one that quietly skips them (D295).
|
|
8233
|
+
*
|
|
8234
|
+
* The production drain of 2026-08-30 would have reported 11 074 here — the
|
|
8235
|
+
* ledger claimed 5.65 GB of footage that no longer existed.
|
|
8236
|
+
*/
|
|
8237
|
+
rowsForgotten: number().int().nonnegative().optional(),
|
|
8224
8238
|
startedAt: number(),
|
|
8225
8239
|
finishedAt: number().nullable(),
|
|
8226
8240
|
error: string().nullable()
|
|
@@ -8584,6 +8598,91 @@ var RelocateResidueSchema = object({
|
|
|
8584
8598
|
segments: number().int().nonnegative(),
|
|
8585
8599
|
bytes: number().int().nonnegative()
|
|
8586
8600
|
}).nullable();
|
|
8601
|
+
/**
|
|
8602
|
+
* Ask one location whether its durable hour rows describe the disk — the walk
|
|
8603
|
+
* (D319).
|
|
8604
|
+
*
|
|
8605
|
+
* `apply` DEFAULTS TO FALSE and that default is the product: the operator's
|
|
8606
|
+
* missing tool is the question, and the dry run is how they sanity-check the
|
|
8607
|
+
* destructive run before authorising it.
|
|
8608
|
+
*/
|
|
8609
|
+
var LedgerWalkInputSchema = object({
|
|
8610
|
+
locationId: string().min(1),
|
|
8611
|
+
/** Forget the confirmed-absent rows, rather than only counting them. */
|
|
8612
|
+
apply: boolean().optional(),
|
|
8613
|
+
/** Narrow to one camera. */
|
|
8614
|
+
deviceId: number().int().positive().optional(),
|
|
8615
|
+
/** Narrow to these recording profiles; empty/absent = every profile. */
|
|
8616
|
+
profiles: array(string().min(1)).optional()
|
|
8617
|
+
});
|
|
8618
|
+
/** Why a whole walk did nothing. Every one leaves the ledger untouched. */
|
|
8619
|
+
var LedgerWalkRefusalSchema = _enum([
|
|
8620
|
+
"location-unknown",
|
|
8621
|
+
"source-writable",
|
|
8622
|
+
"no-ledger",
|
|
8623
|
+
"archive-unreadable",
|
|
8624
|
+
"anchor-absent",
|
|
8625
|
+
"anchor-unreadable",
|
|
8626
|
+
"anchor-moved"
|
|
8627
|
+
]);
|
|
8628
|
+
_enum([
|
|
8629
|
+
"live-tail",
|
|
8630
|
+
"listing-error",
|
|
8631
|
+
"path-mismatch",
|
|
8632
|
+
"durable-refused"
|
|
8633
|
+
]);
|
|
8634
|
+
/** Every skip reason, always present, always a number — so a reason that never
|
|
8635
|
+
* fired reports as zero rather than absent and the report shape is constant
|
|
8636
|
+
* between passes. Spelled out rather than `z.record` for exactly that. */
|
|
8637
|
+
var LedgerWalkSkipCountsSchema = object({
|
|
8638
|
+
"live-tail": number().int().nonnegative(),
|
|
8639
|
+
"listing-error": number().int().nonnegative(),
|
|
8640
|
+
"path-mismatch": number().int().nonnegative(),
|
|
8641
|
+
"durable-refused": number().int().nonnegative()
|
|
8642
|
+
});
|
|
8643
|
+
/** One camera's share of a walk, so a report names cameras and not rows. */
|
|
8644
|
+
var LedgerWalkDeviceReportSchema = object({
|
|
8645
|
+
deviceId: number().int(),
|
|
8646
|
+
hoursWalked: number().int().nonnegative(),
|
|
8647
|
+
hoursMissing: number().int().nonnegative(),
|
|
8648
|
+
ghostSegments: number().int().nonnegative(),
|
|
8649
|
+
ghostBytes: number().int().nonnegative(),
|
|
8650
|
+
forgottenSegments: number().int().nonnegative(),
|
|
8651
|
+
orphanFiles: number().int().nonnegative()
|
|
8652
|
+
});
|
|
8653
|
+
/**
|
|
8654
|
+
* What one walk claimed, listed, found and (only when armed) forgot.
|
|
8655
|
+
*
|
|
8656
|
+
* `archiveSegments` is the **M** and `segmentsClaimed` the **N** (D295), so a
|
|
8657
|
+
* walk that saw a fraction of the location is visible in its own report rather
|
|
8658
|
+
* than in the absence of one.
|
|
8659
|
+
*/
|
|
8660
|
+
var LedgerWalkReportSchema = object({
|
|
8661
|
+
locationId: string(),
|
|
8662
|
+
applied: boolean(),
|
|
8663
|
+
refused: LedgerWalkRefusalSchema.nullable(),
|
|
8664
|
+
archiveSegments: number().int().nonnegative().nullable(),
|
|
8665
|
+
archiveBytes: number().int().nonnegative().nullable(),
|
|
8666
|
+
hoursClaimed: number().int().nonnegative(),
|
|
8667
|
+
hoursWalked: number().int().nonnegative(),
|
|
8668
|
+
hoursMissing: number().int().nonnegative(),
|
|
8669
|
+
/** `readdir` calls issued — the cost, stated in the unit that is paid. */
|
|
8670
|
+
listings: number().int().nonnegative(),
|
|
8671
|
+
segmentsClaimed: number().int().nonnegative(),
|
|
8672
|
+
ghostSegments: number().int().nonnegative(),
|
|
8673
|
+
ghostBytes: number().int().nonnegative(),
|
|
8674
|
+
ghostHoursWhole: number().int().nonnegative(),
|
|
8675
|
+
forgottenSegments: number().int().nonnegative(),
|
|
8676
|
+
forgottenBytes: number().int().nonnegative(),
|
|
8677
|
+
/** Files under a claimed hour that no durable row names. Never deleted. */
|
|
8678
|
+
orphanFiles: number().int().nonnegative(),
|
|
8679
|
+
orphanSample: array(string()).readonly(),
|
|
8680
|
+
hoursSkipped: number().int().nonnegative(),
|
|
8681
|
+
skippedByReason: LedgerWalkSkipCountsSchema,
|
|
8682
|
+
/** The walk stopped at its per-pass hour bound with claims unwalked. */
|
|
8683
|
+
bounded: boolean(),
|
|
8684
|
+
byDevice: array(LedgerWalkDeviceReportSchema).readonly()
|
|
8685
|
+
});
|
|
8587
8686
|
/** How many rows a media pass would still act on against a given target — the
|
|
8588
8687
|
* media lane's denominator AND its residue, from ONE derivation so the two can
|
|
8589
8688
|
* never disagree. `null` = the count could not be taken. */
|
|
@@ -19384,13 +19483,15 @@ var ListGroupsPageSchema = object({
|
|
|
19384
19483
|
groups: array(AnalyticsGroupRecordSchema).readonly(),
|
|
19385
19484
|
nextCursor: string().nullable()
|
|
19386
19485
|
});
|
|
19486
|
+
var KEY_EVENTS_DEFAULT_LIMIT = 50;
|
|
19487
|
+
var KEY_EVENTS_MAX_LIMIT = 200;
|
|
19387
19488
|
var KeyEventQueryInput = object({
|
|
19388
19489
|
deviceId: number(),
|
|
19389
19490
|
/** Window lower bound (track firstSeen ≥ since). */
|
|
19390
19491
|
since: number(),
|
|
19391
19492
|
/** Window upper bound (track firstSeen ≤ until). */
|
|
19392
19493
|
until: number(),
|
|
19393
|
-
limit: number().int().min(1).max(
|
|
19494
|
+
limit: number().int().min(1).max(KEY_EVENTS_MAX_LIMIT).default(KEY_EVENTS_DEFAULT_LIMIT),
|
|
19394
19495
|
/** Drop tracks scoring below this importance. */
|
|
19395
19496
|
minImportance: number().min(0).max(1).optional(),
|
|
19396
19497
|
/** Restrict to a single class (e.g. 'person'). */
|
|
@@ -19412,6 +19513,32 @@ var KeyEventSchema = object({
|
|
|
19412
19513
|
...TrackFlagFields,
|
|
19413
19514
|
...TrackRetrainFields
|
|
19414
19515
|
});
|
|
19516
|
+
/** `getKeyEvents`' window and filters, asked of a SET of cameras at once. */
|
|
19517
|
+
var KeyEventBatchQueryInput = object({
|
|
19518
|
+
deviceIds: array(number()).min(1).max(200),
|
|
19519
|
+
since: number(),
|
|
19520
|
+
until: number(),
|
|
19521
|
+
/** Applied PER CAMERA, exactly as `getKeyEvents.limit` is — never a total
|
|
19522
|
+
* across the set, which would let a busy camera starve a quiet one of its
|
|
19523
|
+
* rows and change what the merged feed contains. */
|
|
19524
|
+
limit: number().int().min(1).max(KEY_EVENTS_MAX_LIMIT).default(KEY_EVENTS_DEFAULT_LIMIT),
|
|
19525
|
+
minImportance: number().min(0).max(1).optional(),
|
|
19526
|
+
classFilter: string().optional()
|
|
19527
|
+
});
|
|
19528
|
+
/**
|
|
19529
|
+
* One camera's key events in a batch answer.
|
|
19530
|
+
*
|
|
19531
|
+
* The row exists for every requested id. `getKeyEvents` degrades to `[]` on
|
|
19532
|
+
* error rather than throwing, so a camera whose store read failed and one with
|
|
19533
|
+
* no events in the window were ALREADY indistinguishable per camera — the
|
|
19534
|
+
* batch does not make that worse, and the row keeps the deviceId the single
|
|
19535
|
+
* method's output never carried (the caller used to stamp it from the fan-out
|
|
19536
|
+
* key, which only worked because there was one query per camera).
|
|
19537
|
+
*/
|
|
19538
|
+
var KeyEventsForDeviceSchema = object({
|
|
19539
|
+
deviceId: number(),
|
|
19540
|
+
events: array(KeyEventSchema).readonly()
|
|
19541
|
+
});
|
|
19415
19542
|
object({
|
|
19416
19543
|
trackId: string(),
|
|
19417
19544
|
className: string(),
|
|
@@ -19483,6 +19610,50 @@ var EventStoreFootprintSchema = object({
|
|
|
19483
19610
|
totalBytes: number().int(),
|
|
19484
19611
|
devices: array(EventStoreDeviceFootprintSchema).readonly()
|
|
19485
19612
|
});
|
|
19613
|
+
/** Event-media footprint for one {@link MediaFileKind}. */
|
|
19614
|
+
var EventMediaKindFootprintSchema = object({
|
|
19615
|
+
kind: MediaFileKindEnum,
|
|
19616
|
+
/** Media rows of this kind. */
|
|
19617
|
+
rows: number().int(),
|
|
19618
|
+
/** Bytes on disk held by those rows. */
|
|
19619
|
+
bytes: number().int()
|
|
19620
|
+
});
|
|
19621
|
+
/**
|
|
19622
|
+
* The media footprint broken down by KIND — the axis a deletion decision
|
|
19623
|
+
* actually turns on.
|
|
19624
|
+
*
|
|
19625
|
+
* A byte total says how much there is; it cannot say what is safe to remove.
|
|
19626
|
+
* The deletable set (the periodic `snapshot` filmstrip, the surplus per-edge
|
|
19627
|
+
* motion stills) and the keep set (`firstFrame`, rolling `lastFrame`,
|
|
19628
|
+
* `thumbnail`/`thumbnailSmall`, `keyFrame`/`keyFrameSmall`, the face/plate
|
|
19629
|
+
* buffers, gallery media, the CLIP `crop`) are distinguished by `kind` and by
|
|
19630
|
+
* nothing else, so sizing a deletion means summing per kind.
|
|
19631
|
+
*
|
|
19632
|
+
* ## Why `unaccounted*` exists
|
|
19633
|
+
*
|
|
19634
|
+
* `kinds` is enumerated from {@link MediaFileKindEnum} — the closed set the
|
|
19635
|
+
* writers use — and summed one kind at a time. `totalRows` / `totalBytes` come
|
|
19636
|
+
* from a SEPARATE unfiltered aggregate over the same rows, never from adding
|
|
19637
|
+
* `kinds` up. A row whose stored `kind` is not in the enum (written by a
|
|
19638
|
+
* retired code path, or by a version that knew a kind this one does not) would
|
|
19639
|
+
* otherwise vanish from the total silently, and an operator would delete
|
|
19640
|
+
* against a denominator smaller than the disk.
|
|
19641
|
+
*
|
|
19642
|
+
* `unaccountedRows` / `unaccountedBytes` are the difference. They are normally
|
|
19643
|
+
* zero; a non-zero value is a real finding and must be shown, not rounded away.
|
|
19644
|
+
*/
|
|
19645
|
+
var EventMediaKindBreakdownSchema = object({
|
|
19646
|
+
/** Every media row in scope, from one unfiltered aggregate. */
|
|
19647
|
+
totalRows: number().int(),
|
|
19648
|
+
/** Every media byte in scope, from that same aggregate. */
|
|
19649
|
+
totalBytes: number().int(),
|
|
19650
|
+
/** Per-kind footprint, ordered by bytes descending. */
|
|
19651
|
+
kinds: array(EventMediaKindFootprintSchema).readonly(),
|
|
19652
|
+
/** `totalRows` minus the summed `kinds` rows — see the schema note. */
|
|
19653
|
+
unaccountedRows: number().int(),
|
|
19654
|
+
/** `totalBytes` minus the summed `kinds` bytes — see the schema note. */
|
|
19655
|
+
unaccountedBytes: number().int()
|
|
19656
|
+
});
|
|
19486
19657
|
/** Per-kind counts returned by the event-prune / device-delete mutations. */
|
|
19487
19658
|
var EventPruneCountsSchema = object({
|
|
19488
19659
|
motion: number().int(),
|
|
@@ -19637,7 +19808,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
19637
19808
|
until: number().optional(),
|
|
19638
19809
|
kinds: array(string()).optional(),
|
|
19639
19810
|
limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
|
|
19640
|
-
}), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
|
|
19811
|
+
}), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
|
|
19641
19812
|
deviceId: number(),
|
|
19642
19813
|
since: number(),
|
|
19643
19814
|
until: number(),
|
|
@@ -19686,6 +19857,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
19686
19857
|
}), TrackFlagsSchema, { kind: "mutation" }), method(object({}), EventStoreFootprintSchema, {
|
|
19687
19858
|
kind: "query",
|
|
19688
19859
|
auth: "admin"
|
|
19860
|
+
}), method(object({ deviceId: number().int().optional() }), EventMediaKindBreakdownSchema, {
|
|
19861
|
+
kind: "query",
|
|
19862
|
+
auth: "admin"
|
|
19689
19863
|
}), method(object({
|
|
19690
19864
|
olderThanMs: number(),
|
|
19691
19865
|
reason: OpsLogReasonSchema.optional()
|
|
@@ -21637,6 +21811,20 @@ method(object({
|
|
|
21637
21811
|
error: string().optional()
|
|
21638
21812
|
}), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
|
|
21639
21813
|
providerId: string(),
|
|
21814
|
+
/**
|
|
21815
|
+
* The location this config is an UNSAVED edit of, when there is one.
|
|
21816
|
+
*
|
|
21817
|
+
* `listLocations` replaces every declared secret with the redaction
|
|
21818
|
+
* sentinel, so the edit modal's form state holds the sentinel for any
|
|
21819
|
+
* credential the operator did not retype — and posting that here
|
|
21820
|
+
* without a way to resolve it makes the provider try to authenticate
|
|
21821
|
+
* as `__camstack_redacted__` and report the operator's own working
|
|
21822
|
+
* password as wrong. Given this id, the orchestrator restores each
|
|
21823
|
+
* sentinel from the stored config (same rule as `upsertLocation`)
|
|
21824
|
+
* before dispatching. Omitted by the "Add location" wizard, where
|
|
21825
|
+
* every value was typed just now and nothing is stored yet.
|
|
21826
|
+
*/
|
|
21827
|
+
locationId: string().optional(),
|
|
21640
21828
|
config: record(string(), unknown())
|
|
21641
21829
|
}), object({
|
|
21642
21830
|
ok: boolean(),
|
|
@@ -29076,6 +29264,9 @@ method(object({
|
|
|
29076
29264
|
}), method(RelocateResidueInputSchema, RelocateResidueSchema, {
|
|
29077
29265
|
kind: "query",
|
|
29078
29266
|
auth: "admin"
|
|
29267
|
+
}), method(LedgerWalkInputSchema, LedgerWalkReportSchema, {
|
|
29268
|
+
kind: "mutation",
|
|
29269
|
+
auth: "admin"
|
|
29079
29270
|
}), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
29080
29271
|
kind: "mutation",
|
|
29081
29272
|
auth: "admin"
|
|
@@ -29467,6 +29658,25 @@ var SceneMonitorStatusSchema = object({
|
|
|
29467
29658
|
monitors: array(SceneMonitorSchema),
|
|
29468
29659
|
lastFetchedAt: number()
|
|
29469
29660
|
});
|
|
29661
|
+
/**
|
|
29662
|
+
* One camera's row in a `listScenesBatch` answer.
|
|
29663
|
+
*
|
|
29664
|
+
* `status` is NULLABLE and the nullability is the whole point. `scene-monitor`
|
|
29665
|
+
* is a `defaultActive` wrapper, so every camera is asked; a camera whose
|
|
29666
|
+
* provider is absent (pipeline-analytics not deployed, the post-processing node
|
|
29667
|
+
* down) cannot answer, and that is not the same fact as a camera with no scenes
|
|
29668
|
+
* configured. Fanned out per camera the difference was visible — one query
|
|
29669
|
+
* errored while the others resolved — and a batch that returned only the rows
|
|
29670
|
+
* it managed would have destroyed it, silently, by making an unreachable camera
|
|
29671
|
+
* indistinguishable from one that answered `monitors: []`.
|
|
29672
|
+
*
|
|
29673
|
+
* So: EVERY requested deviceId gets a row. `status: null` means "this camera
|
|
29674
|
+
* could not be read"; `status.monitors: []` means "read, and it has none".
|
|
29675
|
+
*/
|
|
29676
|
+
var SceneMonitorStatusForDeviceSchema = object({
|
|
29677
|
+
deviceId: number(),
|
|
29678
|
+
status: SceneMonitorStatusSchema.nullable()
|
|
29679
|
+
});
|
|
29470
29680
|
var sceneMonitorCapability = {
|
|
29471
29681
|
name: "scene-monitor",
|
|
29472
29682
|
scope: "device",
|
|
@@ -29476,6 +29686,22 @@ var sceneMonitorCapability = {
|
|
|
29476
29686
|
deviceTypes: [DeviceType.Camera],
|
|
29477
29687
|
methods: {
|
|
29478
29688
|
listScenes: method(object({ deviceId: number() }), SceneMonitorStatusSchema),
|
|
29689
|
+
/**
|
|
29690
|
+
* The same answer, for a SET of cameras, in one round trip.
|
|
29691
|
+
*
|
|
29692
|
+
* `/scenes` renders every camera and re-reads them on a 30s safety-net
|
|
29693
|
+
* poll behind the push slice. Fanned out client-side that was one query
|
|
29694
|
+
* per camera — 29 round trips through the browser, the hub and the
|
|
29695
|
+
* post-analysis runner every 30 seconds to read an in-memory map the
|
|
29696
|
+
* owner had already merged. The work is unchanged (`statusFor` per
|
|
29697
|
+
* device, all in-process at the owner); what collapses is the transport.
|
|
29698
|
+
*
|
|
29699
|
+
* A camera that cannot answer still gets a row, with `status: null` —
|
|
29700
|
+
* see {@link SceneMonitorStatusForDeviceSchema}. Never fewer rows than
|
|
29701
|
+
* ids: a caller that asked for twenty-nine and got twenty-seven cannot
|
|
29702
|
+
* tell which two are missing, or that any are.
|
|
29703
|
+
*/
|
|
29704
|
+
listScenesBatch: method(object({ deviceIds: array(number()).min(1).max(200) }), array(SceneMonitorStatusForDeviceSchema).readonly()),
|
|
29479
29705
|
createScene: method(object({
|
|
29480
29706
|
deviceId: number(),
|
|
29481
29707
|
label: string(),
|
|
@@ -31311,6 +31537,27 @@ var CameraOccupancySnapshotSchema = object({
|
|
|
31311
31537
|
stationaryObjects: array(StationaryObjectSchema).readonly().optional()
|
|
31312
31538
|
});
|
|
31313
31539
|
/**
|
|
31540
|
+
* One camera's row in a `getCurrentSnapshotBatch` answer.
|
|
31541
|
+
*
|
|
31542
|
+
* THREE outcomes, and the single-camera method could only express two of them
|
|
31543
|
+
* because `snapshot: null` was already spoken for:
|
|
31544
|
+
*
|
|
31545
|
+
* - `read: 'read'`, `snapshot` present — the live occupancy reading.
|
|
31546
|
+
* - `read: 'read'`, `snapshot: null` — read, and this camera has no reading
|
|
31547
|
+
* yet: no frame since boot, and no parked-object registry to hydrate from.
|
|
31548
|
+
* - `read: 'unreadable'` — the owner could not answer for this
|
|
31549
|
+
* camera. `snapshot` is null, and it does NOT mean "nothing parked here".
|
|
31550
|
+
*
|
|
31551
|
+
* Collapsing the last two is the failure this field exists to prevent: a
|
|
31552
|
+
* hydration that threw would otherwise render as an empty Stationary section,
|
|
31553
|
+
* which is a definite claim about a camera nobody could read.
|
|
31554
|
+
*/
|
|
31555
|
+
var CameraOccupancySnapshotForDeviceSchema = object({
|
|
31556
|
+
deviceId: number(),
|
|
31557
|
+
read: _enum(["read", "unreadable"]),
|
|
31558
|
+
snapshot: CameraOccupancySnapshotSchema.nullable()
|
|
31559
|
+
});
|
|
31560
|
+
/**
|
|
31314
31561
|
* Time-series resolution. The history methods return one bucket per
|
|
31315
31562
|
* step over the requested range. Smaller resolutions cost more
|
|
31316
31563
|
* memory + bandwidth; bound to discrete steps so caller cannot ask
|
|
@@ -31367,6 +31614,20 @@ var zoneAnalyticsCapability = {
|
|
|
31367
31614
|
* (no inference result emitted since boot or since binding was
|
|
31368
31615
|
* activated). */
|
|
31369
31616
|
getCurrentSnapshot: method(object({ deviceId: number() }), CameraOccupancySnapshotSchema.nullable()),
|
|
31617
|
+
/**
|
|
31618
|
+
* The same snapshot, for a SET of cameras, in one round trip.
|
|
31619
|
+
*
|
|
31620
|
+
* The Events page's Stationary section polls this every 15s for every
|
|
31621
|
+
* selected camera. Fanned out client-side that is one query per camera to
|
|
31622
|
+
* read a `Map.get` at the owner — the answer costs nothing, the round trip
|
|
31623
|
+
* costs everything. Batched, N transports become one and the per-device
|
|
31624
|
+
* work is unchanged.
|
|
31625
|
+
*
|
|
31626
|
+
* Every requested deviceId gets a row, tagged `read` — see
|
|
31627
|
+
* {@link CameraOccupancySnapshotForDeviceSchema}. A camera the owner could
|
|
31628
|
+
* not answer for is `'unreadable'`, never an empty reading.
|
|
31629
|
+
*/
|
|
31630
|
+
getCurrentSnapshotBatch: method(object({ deviceIds: array(number()).min(1).max(200) }), array(CameraOccupancySnapshotForDeviceSchema).readonly()),
|
|
31370
31631
|
/** Time-series object count inside one zone. `className` optional —
|
|
31371
31632
|
* omit to count every class in the zone. */
|
|
31372
31633
|
getZoneHistory: method(object({
|
|
@@ -35764,6 +36025,12 @@ Object.freeze({
|
|
|
35764
36025
|
addonId: null,
|
|
35765
36026
|
access: "view"
|
|
35766
36027
|
},
|
|
36028
|
+
"pipelineAnalytics.getEventMediaFootprintByKind": {
|
|
36029
|
+
capName: "pipeline-analytics",
|
|
36030
|
+
capScope: "device",
|
|
36031
|
+
addonId: null,
|
|
36032
|
+
access: "view"
|
|
36033
|
+
},
|
|
35767
36034
|
"pipelineAnalytics.getEventStoreFootprint": {
|
|
35768
36035
|
capName: "pipeline-analytics",
|
|
35769
36036
|
capScope: "device",
|
|
@@ -35782,6 +36049,12 @@ Object.freeze({
|
|
|
35782
36049
|
addonId: null,
|
|
35783
36050
|
access: "view"
|
|
35784
36051
|
},
|
|
36052
|
+
"pipelineAnalytics.getKeyEventsBatch": {
|
|
36053
|
+
capName: "pipeline-analytics",
|
|
36054
|
+
capScope: "device",
|
|
36055
|
+
addonId: null,
|
|
36056
|
+
access: "view"
|
|
36057
|
+
},
|
|
35785
36058
|
"pipelineAnalytics.getMotionEvents": {
|
|
35786
36059
|
capName: "pipeline-analytics",
|
|
35787
36060
|
capScope: "device",
|
|
@@ -36958,6 +37231,12 @@ Object.freeze({
|
|
|
36958
37231
|
addonId: null,
|
|
36959
37232
|
access: "view"
|
|
36960
37233
|
},
|
|
37234
|
+
"recording.reconcileLedgerAgainstDisk": {
|
|
37235
|
+
capName: "recording",
|
|
37236
|
+
capScope: "system",
|
|
37237
|
+
addonId: null,
|
|
37238
|
+
access: "create"
|
|
37239
|
+
},
|
|
36961
37240
|
"recording.refreshStorageLocationsForMigration": {
|
|
36962
37241
|
capName: "recording",
|
|
36963
37242
|
capScope: "system",
|
|
@@ -37084,6 +37363,12 @@ Object.freeze({
|
|
|
37084
37363
|
addonId: null,
|
|
37085
37364
|
access: "view"
|
|
37086
37365
|
},
|
|
37366
|
+
"sceneMonitor.listScenesBatch": {
|
|
37367
|
+
capName: "scene-monitor",
|
|
37368
|
+
capScope: "device",
|
|
37369
|
+
addonId: null,
|
|
37370
|
+
access: "view"
|
|
37371
|
+
},
|
|
37087
37372
|
"sceneMonitor.recheckNow": {
|
|
37088
37373
|
capName: "scene-monitor",
|
|
37089
37374
|
capScope: "device",
|
|
@@ -38440,6 +38725,12 @@ Object.freeze({
|
|
|
38440
38725
|
addonId: null,
|
|
38441
38726
|
access: "view"
|
|
38442
38727
|
},
|
|
38728
|
+
"zoneAnalytics.getCurrentSnapshotBatch": {
|
|
38729
|
+
capName: "zone-analytics",
|
|
38730
|
+
capScope: "device",
|
|
38731
|
+
addonId: null,
|
|
38732
|
+
access: "view"
|
|
38733
|
+
},
|
|
38443
38734
|
"zoneAnalytics.getUnzonedHistory": {
|
|
38444
38735
|
capName: "zone-analytics",
|
|
38445
38736
|
capScope: "device",
|
|
@@ -39429,6 +39720,11 @@ Object.freeze({
|
|
|
39429
39720
|
form: "single",
|
|
39430
39721
|
optional: false
|
|
39431
39722
|
}],
|
|
39723
|
+
"pipelineAnalytics.getEventMediaFootprintByKind": [{
|
|
39724
|
+
name: "deviceId",
|
|
39725
|
+
form: "single",
|
|
39726
|
+
optional: true
|
|
39727
|
+
}],
|
|
39432
39728
|
"pipelineAnalytics.getGroup": [{
|
|
39433
39729
|
name: "deviceId",
|
|
39434
39730
|
form: "single",
|
|
@@ -39439,6 +39735,11 @@ Object.freeze({
|
|
|
39439
39735
|
form: "single",
|
|
39440
39736
|
optional: false
|
|
39441
39737
|
}],
|
|
39738
|
+
"pipelineAnalytics.getKeyEventsBatch": [{
|
|
39739
|
+
name: "deviceIds",
|
|
39740
|
+
form: "array",
|
|
39741
|
+
optional: false
|
|
39742
|
+
}],
|
|
39442
39743
|
"pipelineAnalytics.getMotionEvents": [{
|
|
39443
39744
|
name: "deviceId",
|
|
39444
39745
|
form: "single",
|
|
@@ -39879,6 +40180,11 @@ Object.freeze({
|
|
|
39879
40180
|
form: "single",
|
|
39880
40181
|
optional: false
|
|
39881
40182
|
}],
|
|
40183
|
+
"recording.reconcileLedgerAgainstDisk": [{
|
|
40184
|
+
name: "deviceId",
|
|
40185
|
+
form: "single",
|
|
40186
|
+
optional: true
|
|
40187
|
+
}],
|
|
39882
40188
|
"recording.relocateFootage": [{
|
|
39883
40189
|
name: "deviceId",
|
|
39884
40190
|
form: "single",
|
|
@@ -39944,6 +40250,11 @@ Object.freeze({
|
|
|
39944
40250
|
form: "single",
|
|
39945
40251
|
optional: false
|
|
39946
40252
|
}],
|
|
40253
|
+
"sceneMonitor.listScenesBatch": [{
|
|
40254
|
+
name: "deviceIds",
|
|
40255
|
+
form: "array",
|
|
40256
|
+
optional: false
|
|
40257
|
+
}],
|
|
39947
40258
|
"sceneMonitor.recheckNow": [{
|
|
39948
40259
|
name: "deviceId",
|
|
39949
40260
|
form: "single",
|
|
@@ -40205,6 +40516,11 @@ Object.freeze({
|
|
|
40205
40516
|
form: "single",
|
|
40206
40517
|
optional: false
|
|
40207
40518
|
}],
|
|
40519
|
+
"zoneAnalytics.getCurrentSnapshotBatch": [{
|
|
40520
|
+
name: "deviceIds",
|
|
40521
|
+
form: "array",
|
|
40522
|
+
optional: false
|
|
40523
|
+
}],
|
|
40208
40524
|
"zoneAnalytics.getUnzonedHistory": [{
|
|
40209
40525
|
name: "deviceId",
|
|
40210
40526
|
form: "single",
|
|
@@ -8221,6 +8221,20 @@ var RelocateJobSchema = object({
|
|
|
8221
8221
|
* in its row, not in its name, so `MediaRelocateEngine` never reconciles one.
|
|
8222
8222
|
*/
|
|
8223
8223
|
rowsReconciled: number().int().nonnegative().optional(),
|
|
8224
|
+
/**
|
|
8225
|
+
* Rows this run FORGOT because the file they name is not on disk.
|
|
8226
|
+
*
|
|
8227
|
+
* The mover derived the path from the row's own fields and `stat`ed it; an
|
|
8228
|
+
* ENOENT there is a per-path confirmation that the segment is gone (D296),
|
|
8229
|
+
* and the durable row is dropped through the same channel eviction uses. It
|
|
8230
|
+
* is reported for the same reason `rowsReconciled` is: this is a durable
|
|
8231
|
+
* mutation nobody asked for, and a migration that quietly erases hour rows is
|
|
8232
|
+
* the same failure as one that quietly skips them (D295).
|
|
8233
|
+
*
|
|
8234
|
+
* The production drain of 2026-08-30 would have reported 11 074 here — the
|
|
8235
|
+
* ledger claimed 5.65 GB of footage that no longer existed.
|
|
8236
|
+
*/
|
|
8237
|
+
rowsForgotten: number().int().nonnegative().optional(),
|
|
8224
8238
|
startedAt: number(),
|
|
8225
8239
|
finishedAt: number().nullable(),
|
|
8226
8240
|
error: string().nullable()
|
|
@@ -8584,6 +8598,91 @@ var RelocateResidueSchema = object({
|
|
|
8584
8598
|
segments: number().int().nonnegative(),
|
|
8585
8599
|
bytes: number().int().nonnegative()
|
|
8586
8600
|
}).nullable();
|
|
8601
|
+
/**
|
|
8602
|
+
* Ask one location whether its durable hour rows describe the disk — the walk
|
|
8603
|
+
* (D319).
|
|
8604
|
+
*
|
|
8605
|
+
* `apply` DEFAULTS TO FALSE and that default is the product: the operator's
|
|
8606
|
+
* missing tool is the question, and the dry run is how they sanity-check the
|
|
8607
|
+
* destructive run before authorising it.
|
|
8608
|
+
*/
|
|
8609
|
+
var LedgerWalkInputSchema = object({
|
|
8610
|
+
locationId: string().min(1),
|
|
8611
|
+
/** Forget the confirmed-absent rows, rather than only counting them. */
|
|
8612
|
+
apply: boolean().optional(),
|
|
8613
|
+
/** Narrow to one camera. */
|
|
8614
|
+
deviceId: number().int().positive().optional(),
|
|
8615
|
+
/** Narrow to these recording profiles; empty/absent = every profile. */
|
|
8616
|
+
profiles: array(string().min(1)).optional()
|
|
8617
|
+
});
|
|
8618
|
+
/** Why a whole walk did nothing. Every one leaves the ledger untouched. */
|
|
8619
|
+
var LedgerWalkRefusalSchema = _enum([
|
|
8620
|
+
"location-unknown",
|
|
8621
|
+
"source-writable",
|
|
8622
|
+
"no-ledger",
|
|
8623
|
+
"archive-unreadable",
|
|
8624
|
+
"anchor-absent",
|
|
8625
|
+
"anchor-unreadable",
|
|
8626
|
+
"anchor-moved"
|
|
8627
|
+
]);
|
|
8628
|
+
_enum([
|
|
8629
|
+
"live-tail",
|
|
8630
|
+
"listing-error",
|
|
8631
|
+
"path-mismatch",
|
|
8632
|
+
"durable-refused"
|
|
8633
|
+
]);
|
|
8634
|
+
/** Every skip reason, always present, always a number — so a reason that never
|
|
8635
|
+
* fired reports as zero rather than absent and the report shape is constant
|
|
8636
|
+
* between passes. Spelled out rather than `z.record` for exactly that. */
|
|
8637
|
+
var LedgerWalkSkipCountsSchema = object({
|
|
8638
|
+
"live-tail": number().int().nonnegative(),
|
|
8639
|
+
"listing-error": number().int().nonnegative(),
|
|
8640
|
+
"path-mismatch": number().int().nonnegative(),
|
|
8641
|
+
"durable-refused": number().int().nonnegative()
|
|
8642
|
+
});
|
|
8643
|
+
/** One camera's share of a walk, so a report names cameras and not rows. */
|
|
8644
|
+
var LedgerWalkDeviceReportSchema = object({
|
|
8645
|
+
deviceId: number().int(),
|
|
8646
|
+
hoursWalked: number().int().nonnegative(),
|
|
8647
|
+
hoursMissing: number().int().nonnegative(),
|
|
8648
|
+
ghostSegments: number().int().nonnegative(),
|
|
8649
|
+
ghostBytes: number().int().nonnegative(),
|
|
8650
|
+
forgottenSegments: number().int().nonnegative(),
|
|
8651
|
+
orphanFiles: number().int().nonnegative()
|
|
8652
|
+
});
|
|
8653
|
+
/**
|
|
8654
|
+
* What one walk claimed, listed, found and (only when armed) forgot.
|
|
8655
|
+
*
|
|
8656
|
+
* `archiveSegments` is the **M** and `segmentsClaimed` the **N** (D295), so a
|
|
8657
|
+
* walk that saw a fraction of the location is visible in its own report rather
|
|
8658
|
+
* than in the absence of one.
|
|
8659
|
+
*/
|
|
8660
|
+
var LedgerWalkReportSchema = object({
|
|
8661
|
+
locationId: string(),
|
|
8662
|
+
applied: boolean(),
|
|
8663
|
+
refused: LedgerWalkRefusalSchema.nullable(),
|
|
8664
|
+
archiveSegments: number().int().nonnegative().nullable(),
|
|
8665
|
+
archiveBytes: number().int().nonnegative().nullable(),
|
|
8666
|
+
hoursClaimed: number().int().nonnegative(),
|
|
8667
|
+
hoursWalked: number().int().nonnegative(),
|
|
8668
|
+
hoursMissing: number().int().nonnegative(),
|
|
8669
|
+
/** `readdir` calls issued — the cost, stated in the unit that is paid. */
|
|
8670
|
+
listings: number().int().nonnegative(),
|
|
8671
|
+
segmentsClaimed: number().int().nonnegative(),
|
|
8672
|
+
ghostSegments: number().int().nonnegative(),
|
|
8673
|
+
ghostBytes: number().int().nonnegative(),
|
|
8674
|
+
ghostHoursWhole: number().int().nonnegative(),
|
|
8675
|
+
forgottenSegments: number().int().nonnegative(),
|
|
8676
|
+
forgottenBytes: number().int().nonnegative(),
|
|
8677
|
+
/** Files under a claimed hour that no durable row names. Never deleted. */
|
|
8678
|
+
orphanFiles: number().int().nonnegative(),
|
|
8679
|
+
orphanSample: array(string()).readonly(),
|
|
8680
|
+
hoursSkipped: number().int().nonnegative(),
|
|
8681
|
+
skippedByReason: LedgerWalkSkipCountsSchema,
|
|
8682
|
+
/** The walk stopped at its per-pass hour bound with claims unwalked. */
|
|
8683
|
+
bounded: boolean(),
|
|
8684
|
+
byDevice: array(LedgerWalkDeviceReportSchema).readonly()
|
|
8685
|
+
});
|
|
8587
8686
|
/** How many rows a media pass would still act on against a given target — the
|
|
8588
8687
|
* media lane's denominator AND its residue, from ONE derivation so the two can
|
|
8589
8688
|
* never disagree. `null` = the count could not be taken. */
|
|
@@ -19384,13 +19483,15 @@ var ListGroupsPageSchema = object({
|
|
|
19384
19483
|
groups: array(AnalyticsGroupRecordSchema).readonly(),
|
|
19385
19484
|
nextCursor: string().nullable()
|
|
19386
19485
|
});
|
|
19486
|
+
var KEY_EVENTS_DEFAULT_LIMIT = 50;
|
|
19487
|
+
var KEY_EVENTS_MAX_LIMIT = 200;
|
|
19387
19488
|
var KeyEventQueryInput = object({
|
|
19388
19489
|
deviceId: number(),
|
|
19389
19490
|
/** Window lower bound (track firstSeen ≥ since). */
|
|
19390
19491
|
since: number(),
|
|
19391
19492
|
/** Window upper bound (track firstSeen ≤ until). */
|
|
19392
19493
|
until: number(),
|
|
19393
|
-
limit: number().int().min(1).max(
|
|
19494
|
+
limit: number().int().min(1).max(KEY_EVENTS_MAX_LIMIT).default(KEY_EVENTS_DEFAULT_LIMIT),
|
|
19394
19495
|
/** Drop tracks scoring below this importance. */
|
|
19395
19496
|
minImportance: number().min(0).max(1).optional(),
|
|
19396
19497
|
/** Restrict to a single class (e.g. 'person'). */
|
|
@@ -19412,6 +19513,32 @@ var KeyEventSchema = object({
|
|
|
19412
19513
|
...TrackFlagFields,
|
|
19413
19514
|
...TrackRetrainFields
|
|
19414
19515
|
});
|
|
19516
|
+
/** `getKeyEvents`' window and filters, asked of a SET of cameras at once. */
|
|
19517
|
+
var KeyEventBatchQueryInput = object({
|
|
19518
|
+
deviceIds: array(number()).min(1).max(200),
|
|
19519
|
+
since: number(),
|
|
19520
|
+
until: number(),
|
|
19521
|
+
/** Applied PER CAMERA, exactly as `getKeyEvents.limit` is — never a total
|
|
19522
|
+
* across the set, which would let a busy camera starve a quiet one of its
|
|
19523
|
+
* rows and change what the merged feed contains. */
|
|
19524
|
+
limit: number().int().min(1).max(KEY_EVENTS_MAX_LIMIT).default(KEY_EVENTS_DEFAULT_LIMIT),
|
|
19525
|
+
minImportance: number().min(0).max(1).optional(),
|
|
19526
|
+
classFilter: string().optional()
|
|
19527
|
+
});
|
|
19528
|
+
/**
|
|
19529
|
+
* One camera's key events in a batch answer.
|
|
19530
|
+
*
|
|
19531
|
+
* The row exists for every requested id. `getKeyEvents` degrades to `[]` on
|
|
19532
|
+
* error rather than throwing, so a camera whose store read failed and one with
|
|
19533
|
+
* no events in the window were ALREADY indistinguishable per camera — the
|
|
19534
|
+
* batch does not make that worse, and the row keeps the deviceId the single
|
|
19535
|
+
* method's output never carried (the caller used to stamp it from the fan-out
|
|
19536
|
+
* key, which only worked because there was one query per camera).
|
|
19537
|
+
*/
|
|
19538
|
+
var KeyEventsForDeviceSchema = object({
|
|
19539
|
+
deviceId: number(),
|
|
19540
|
+
events: array(KeyEventSchema).readonly()
|
|
19541
|
+
});
|
|
19415
19542
|
object({
|
|
19416
19543
|
trackId: string(),
|
|
19417
19544
|
className: string(),
|
|
@@ -19483,6 +19610,50 @@ var EventStoreFootprintSchema = object({
|
|
|
19483
19610
|
totalBytes: number().int(),
|
|
19484
19611
|
devices: array(EventStoreDeviceFootprintSchema).readonly()
|
|
19485
19612
|
});
|
|
19613
|
+
/** Event-media footprint for one {@link MediaFileKind}. */
|
|
19614
|
+
var EventMediaKindFootprintSchema = object({
|
|
19615
|
+
kind: MediaFileKindEnum,
|
|
19616
|
+
/** Media rows of this kind. */
|
|
19617
|
+
rows: number().int(),
|
|
19618
|
+
/** Bytes on disk held by those rows. */
|
|
19619
|
+
bytes: number().int()
|
|
19620
|
+
});
|
|
19621
|
+
/**
|
|
19622
|
+
* The media footprint broken down by KIND — the axis a deletion decision
|
|
19623
|
+
* actually turns on.
|
|
19624
|
+
*
|
|
19625
|
+
* A byte total says how much there is; it cannot say what is safe to remove.
|
|
19626
|
+
* The deletable set (the periodic `snapshot` filmstrip, the surplus per-edge
|
|
19627
|
+
* motion stills) and the keep set (`firstFrame`, rolling `lastFrame`,
|
|
19628
|
+
* `thumbnail`/`thumbnailSmall`, `keyFrame`/`keyFrameSmall`, the face/plate
|
|
19629
|
+
* buffers, gallery media, the CLIP `crop`) are distinguished by `kind` and by
|
|
19630
|
+
* nothing else, so sizing a deletion means summing per kind.
|
|
19631
|
+
*
|
|
19632
|
+
* ## Why `unaccounted*` exists
|
|
19633
|
+
*
|
|
19634
|
+
* `kinds` is enumerated from {@link MediaFileKindEnum} — the closed set the
|
|
19635
|
+
* writers use — and summed one kind at a time. `totalRows` / `totalBytes` come
|
|
19636
|
+
* from a SEPARATE unfiltered aggregate over the same rows, never from adding
|
|
19637
|
+
* `kinds` up. A row whose stored `kind` is not in the enum (written by a
|
|
19638
|
+
* retired code path, or by a version that knew a kind this one does not) would
|
|
19639
|
+
* otherwise vanish from the total silently, and an operator would delete
|
|
19640
|
+
* against a denominator smaller than the disk.
|
|
19641
|
+
*
|
|
19642
|
+
* `unaccountedRows` / `unaccountedBytes` are the difference. They are normally
|
|
19643
|
+
* zero; a non-zero value is a real finding and must be shown, not rounded away.
|
|
19644
|
+
*/
|
|
19645
|
+
var EventMediaKindBreakdownSchema = object({
|
|
19646
|
+
/** Every media row in scope, from one unfiltered aggregate. */
|
|
19647
|
+
totalRows: number().int(),
|
|
19648
|
+
/** Every media byte in scope, from that same aggregate. */
|
|
19649
|
+
totalBytes: number().int(),
|
|
19650
|
+
/** Per-kind footprint, ordered by bytes descending. */
|
|
19651
|
+
kinds: array(EventMediaKindFootprintSchema).readonly(),
|
|
19652
|
+
/** `totalRows` minus the summed `kinds` rows — see the schema note. */
|
|
19653
|
+
unaccountedRows: number().int(),
|
|
19654
|
+
/** `totalBytes` minus the summed `kinds` bytes — see the schema note. */
|
|
19655
|
+
unaccountedBytes: number().int()
|
|
19656
|
+
});
|
|
19486
19657
|
/** Per-kind counts returned by the event-prune / device-delete mutations. */
|
|
19487
19658
|
var EventPruneCountsSchema = object({
|
|
19488
19659
|
motion: number().int(),
|
|
@@ -19637,7 +19808,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
19637
19808
|
until: number().optional(),
|
|
19638
19809
|
kinds: array(string()).optional(),
|
|
19639
19810
|
limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
|
|
19640
|
-
}), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
|
|
19811
|
+
}), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
|
|
19641
19812
|
deviceId: number(),
|
|
19642
19813
|
since: number(),
|
|
19643
19814
|
until: number(),
|
|
@@ -19686,6 +19857,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
19686
19857
|
}), TrackFlagsSchema, { kind: "mutation" }), method(object({}), EventStoreFootprintSchema, {
|
|
19687
19858
|
kind: "query",
|
|
19688
19859
|
auth: "admin"
|
|
19860
|
+
}), method(object({ deviceId: number().int().optional() }), EventMediaKindBreakdownSchema, {
|
|
19861
|
+
kind: "query",
|
|
19862
|
+
auth: "admin"
|
|
19689
19863
|
}), method(object({
|
|
19690
19864
|
olderThanMs: number(),
|
|
19691
19865
|
reason: OpsLogReasonSchema.optional()
|
|
@@ -21637,6 +21811,20 @@ method(object({
|
|
|
21637
21811
|
error: string().optional()
|
|
21638
21812
|
}), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
|
|
21639
21813
|
providerId: string(),
|
|
21814
|
+
/**
|
|
21815
|
+
* The location this config is an UNSAVED edit of, when there is one.
|
|
21816
|
+
*
|
|
21817
|
+
* `listLocations` replaces every declared secret with the redaction
|
|
21818
|
+
* sentinel, so the edit modal's form state holds the sentinel for any
|
|
21819
|
+
* credential the operator did not retype — and posting that here
|
|
21820
|
+
* without a way to resolve it makes the provider try to authenticate
|
|
21821
|
+
* as `__camstack_redacted__` and report the operator's own working
|
|
21822
|
+
* password as wrong. Given this id, the orchestrator restores each
|
|
21823
|
+
* sentinel from the stored config (same rule as `upsertLocation`)
|
|
21824
|
+
* before dispatching. Omitted by the "Add location" wizard, where
|
|
21825
|
+
* every value was typed just now and nothing is stored yet.
|
|
21826
|
+
*/
|
|
21827
|
+
locationId: string().optional(),
|
|
21640
21828
|
config: record(string(), unknown())
|
|
21641
21829
|
}), object({
|
|
21642
21830
|
ok: boolean(),
|
|
@@ -29076,6 +29264,9 @@ method(object({
|
|
|
29076
29264
|
}), method(RelocateResidueInputSchema, RelocateResidueSchema, {
|
|
29077
29265
|
kind: "query",
|
|
29078
29266
|
auth: "admin"
|
|
29267
|
+
}), method(LedgerWalkInputSchema, LedgerWalkReportSchema, {
|
|
29268
|
+
kind: "mutation",
|
|
29269
|
+
auth: "admin"
|
|
29079
29270
|
}), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
29080
29271
|
kind: "mutation",
|
|
29081
29272
|
auth: "admin"
|
|
@@ -29467,6 +29658,25 @@ var SceneMonitorStatusSchema = object({
|
|
|
29467
29658
|
monitors: array(SceneMonitorSchema),
|
|
29468
29659
|
lastFetchedAt: number()
|
|
29469
29660
|
});
|
|
29661
|
+
/**
|
|
29662
|
+
* One camera's row in a `listScenesBatch` answer.
|
|
29663
|
+
*
|
|
29664
|
+
* `status` is NULLABLE and the nullability is the whole point. `scene-monitor`
|
|
29665
|
+
* is a `defaultActive` wrapper, so every camera is asked; a camera whose
|
|
29666
|
+
* provider is absent (pipeline-analytics not deployed, the post-processing node
|
|
29667
|
+
* down) cannot answer, and that is not the same fact as a camera with no scenes
|
|
29668
|
+
* configured. Fanned out per camera the difference was visible — one query
|
|
29669
|
+
* errored while the others resolved — and a batch that returned only the rows
|
|
29670
|
+
* it managed would have destroyed it, silently, by making an unreachable camera
|
|
29671
|
+
* indistinguishable from one that answered `monitors: []`.
|
|
29672
|
+
*
|
|
29673
|
+
* So: EVERY requested deviceId gets a row. `status: null` means "this camera
|
|
29674
|
+
* could not be read"; `status.monitors: []` means "read, and it has none".
|
|
29675
|
+
*/
|
|
29676
|
+
var SceneMonitorStatusForDeviceSchema = object({
|
|
29677
|
+
deviceId: number(),
|
|
29678
|
+
status: SceneMonitorStatusSchema.nullable()
|
|
29679
|
+
});
|
|
29470
29680
|
var sceneMonitorCapability = {
|
|
29471
29681
|
name: "scene-monitor",
|
|
29472
29682
|
scope: "device",
|
|
@@ -29476,6 +29686,22 @@ var sceneMonitorCapability = {
|
|
|
29476
29686
|
deviceTypes: [DeviceType.Camera],
|
|
29477
29687
|
methods: {
|
|
29478
29688
|
listScenes: method(object({ deviceId: number() }), SceneMonitorStatusSchema),
|
|
29689
|
+
/**
|
|
29690
|
+
* The same answer, for a SET of cameras, in one round trip.
|
|
29691
|
+
*
|
|
29692
|
+
* `/scenes` renders every camera and re-reads them on a 30s safety-net
|
|
29693
|
+
* poll behind the push slice. Fanned out client-side that was one query
|
|
29694
|
+
* per camera — 29 round trips through the browser, the hub and the
|
|
29695
|
+
* post-analysis runner every 30 seconds to read an in-memory map the
|
|
29696
|
+
* owner had already merged. The work is unchanged (`statusFor` per
|
|
29697
|
+
* device, all in-process at the owner); what collapses is the transport.
|
|
29698
|
+
*
|
|
29699
|
+
* A camera that cannot answer still gets a row, with `status: null` —
|
|
29700
|
+
* see {@link SceneMonitorStatusForDeviceSchema}. Never fewer rows than
|
|
29701
|
+
* ids: a caller that asked for twenty-nine and got twenty-seven cannot
|
|
29702
|
+
* tell which two are missing, or that any are.
|
|
29703
|
+
*/
|
|
29704
|
+
listScenesBatch: method(object({ deviceIds: array(number()).min(1).max(200) }), array(SceneMonitorStatusForDeviceSchema).readonly()),
|
|
29479
29705
|
createScene: method(object({
|
|
29480
29706
|
deviceId: number(),
|
|
29481
29707
|
label: string(),
|
|
@@ -31311,6 +31537,27 @@ var CameraOccupancySnapshotSchema = object({
|
|
|
31311
31537
|
stationaryObjects: array(StationaryObjectSchema).readonly().optional()
|
|
31312
31538
|
});
|
|
31313
31539
|
/**
|
|
31540
|
+
* One camera's row in a `getCurrentSnapshotBatch` answer.
|
|
31541
|
+
*
|
|
31542
|
+
* THREE outcomes, and the single-camera method could only express two of them
|
|
31543
|
+
* because `snapshot: null` was already spoken for:
|
|
31544
|
+
*
|
|
31545
|
+
* - `read: 'read'`, `snapshot` present — the live occupancy reading.
|
|
31546
|
+
* - `read: 'read'`, `snapshot: null` — read, and this camera has no reading
|
|
31547
|
+
* yet: no frame since boot, and no parked-object registry to hydrate from.
|
|
31548
|
+
* - `read: 'unreadable'` — the owner could not answer for this
|
|
31549
|
+
* camera. `snapshot` is null, and it does NOT mean "nothing parked here".
|
|
31550
|
+
*
|
|
31551
|
+
* Collapsing the last two is the failure this field exists to prevent: a
|
|
31552
|
+
* hydration that threw would otherwise render as an empty Stationary section,
|
|
31553
|
+
* which is a definite claim about a camera nobody could read.
|
|
31554
|
+
*/
|
|
31555
|
+
var CameraOccupancySnapshotForDeviceSchema = object({
|
|
31556
|
+
deviceId: number(),
|
|
31557
|
+
read: _enum(["read", "unreadable"]),
|
|
31558
|
+
snapshot: CameraOccupancySnapshotSchema.nullable()
|
|
31559
|
+
});
|
|
31560
|
+
/**
|
|
31314
31561
|
* Time-series resolution. The history methods return one bucket per
|
|
31315
31562
|
* step over the requested range. Smaller resolutions cost more
|
|
31316
31563
|
* memory + bandwidth; bound to discrete steps so caller cannot ask
|
|
@@ -31367,6 +31614,20 @@ var zoneAnalyticsCapability = {
|
|
|
31367
31614
|
* (no inference result emitted since boot or since binding was
|
|
31368
31615
|
* activated). */
|
|
31369
31616
|
getCurrentSnapshot: method(object({ deviceId: number() }), CameraOccupancySnapshotSchema.nullable()),
|
|
31617
|
+
/**
|
|
31618
|
+
* The same snapshot, for a SET of cameras, in one round trip.
|
|
31619
|
+
*
|
|
31620
|
+
* The Events page's Stationary section polls this every 15s for every
|
|
31621
|
+
* selected camera. Fanned out client-side that is one query per camera to
|
|
31622
|
+
* read a `Map.get` at the owner — the answer costs nothing, the round trip
|
|
31623
|
+
* costs everything. Batched, N transports become one and the per-device
|
|
31624
|
+
* work is unchanged.
|
|
31625
|
+
*
|
|
31626
|
+
* Every requested deviceId gets a row, tagged `read` — see
|
|
31627
|
+
* {@link CameraOccupancySnapshotForDeviceSchema}. A camera the owner could
|
|
31628
|
+
* not answer for is `'unreadable'`, never an empty reading.
|
|
31629
|
+
*/
|
|
31630
|
+
getCurrentSnapshotBatch: method(object({ deviceIds: array(number()).min(1).max(200) }), array(CameraOccupancySnapshotForDeviceSchema).readonly()),
|
|
31370
31631
|
/** Time-series object count inside one zone. `className` optional —
|
|
31371
31632
|
* omit to count every class in the zone. */
|
|
31372
31633
|
getZoneHistory: method(object({
|
|
@@ -35764,6 +36025,12 @@ Object.freeze({
|
|
|
35764
36025
|
addonId: null,
|
|
35765
36026
|
access: "view"
|
|
35766
36027
|
},
|
|
36028
|
+
"pipelineAnalytics.getEventMediaFootprintByKind": {
|
|
36029
|
+
capName: "pipeline-analytics",
|
|
36030
|
+
capScope: "device",
|
|
36031
|
+
addonId: null,
|
|
36032
|
+
access: "view"
|
|
36033
|
+
},
|
|
35767
36034
|
"pipelineAnalytics.getEventStoreFootprint": {
|
|
35768
36035
|
capName: "pipeline-analytics",
|
|
35769
36036
|
capScope: "device",
|
|
@@ -35782,6 +36049,12 @@ Object.freeze({
|
|
|
35782
36049
|
addonId: null,
|
|
35783
36050
|
access: "view"
|
|
35784
36051
|
},
|
|
36052
|
+
"pipelineAnalytics.getKeyEventsBatch": {
|
|
36053
|
+
capName: "pipeline-analytics",
|
|
36054
|
+
capScope: "device",
|
|
36055
|
+
addonId: null,
|
|
36056
|
+
access: "view"
|
|
36057
|
+
},
|
|
35785
36058
|
"pipelineAnalytics.getMotionEvents": {
|
|
35786
36059
|
capName: "pipeline-analytics",
|
|
35787
36060
|
capScope: "device",
|
|
@@ -36958,6 +37231,12 @@ Object.freeze({
|
|
|
36958
37231
|
addonId: null,
|
|
36959
37232
|
access: "view"
|
|
36960
37233
|
},
|
|
37234
|
+
"recording.reconcileLedgerAgainstDisk": {
|
|
37235
|
+
capName: "recording",
|
|
37236
|
+
capScope: "system",
|
|
37237
|
+
addonId: null,
|
|
37238
|
+
access: "create"
|
|
37239
|
+
},
|
|
36961
37240
|
"recording.refreshStorageLocationsForMigration": {
|
|
36962
37241
|
capName: "recording",
|
|
36963
37242
|
capScope: "system",
|
|
@@ -37084,6 +37363,12 @@ Object.freeze({
|
|
|
37084
37363
|
addonId: null,
|
|
37085
37364
|
access: "view"
|
|
37086
37365
|
},
|
|
37366
|
+
"sceneMonitor.listScenesBatch": {
|
|
37367
|
+
capName: "scene-monitor",
|
|
37368
|
+
capScope: "device",
|
|
37369
|
+
addonId: null,
|
|
37370
|
+
access: "view"
|
|
37371
|
+
},
|
|
37087
37372
|
"sceneMonitor.recheckNow": {
|
|
37088
37373
|
capName: "scene-monitor",
|
|
37089
37374
|
capScope: "device",
|
|
@@ -38440,6 +38725,12 @@ Object.freeze({
|
|
|
38440
38725
|
addonId: null,
|
|
38441
38726
|
access: "view"
|
|
38442
38727
|
},
|
|
38728
|
+
"zoneAnalytics.getCurrentSnapshotBatch": {
|
|
38729
|
+
capName: "zone-analytics",
|
|
38730
|
+
capScope: "device",
|
|
38731
|
+
addonId: null,
|
|
38732
|
+
access: "view"
|
|
38733
|
+
},
|
|
38443
38734
|
"zoneAnalytics.getUnzonedHistory": {
|
|
38444
38735
|
capName: "zone-analytics",
|
|
38445
38736
|
capScope: "device",
|
|
@@ -39429,6 +39720,11 @@ Object.freeze({
|
|
|
39429
39720
|
form: "single",
|
|
39430
39721
|
optional: false
|
|
39431
39722
|
}],
|
|
39723
|
+
"pipelineAnalytics.getEventMediaFootprintByKind": [{
|
|
39724
|
+
name: "deviceId",
|
|
39725
|
+
form: "single",
|
|
39726
|
+
optional: true
|
|
39727
|
+
}],
|
|
39432
39728
|
"pipelineAnalytics.getGroup": [{
|
|
39433
39729
|
name: "deviceId",
|
|
39434
39730
|
form: "single",
|
|
@@ -39439,6 +39735,11 @@ Object.freeze({
|
|
|
39439
39735
|
form: "single",
|
|
39440
39736
|
optional: false
|
|
39441
39737
|
}],
|
|
39738
|
+
"pipelineAnalytics.getKeyEventsBatch": [{
|
|
39739
|
+
name: "deviceIds",
|
|
39740
|
+
form: "array",
|
|
39741
|
+
optional: false
|
|
39742
|
+
}],
|
|
39442
39743
|
"pipelineAnalytics.getMotionEvents": [{
|
|
39443
39744
|
name: "deviceId",
|
|
39444
39745
|
form: "single",
|
|
@@ -39879,6 +40180,11 @@ Object.freeze({
|
|
|
39879
40180
|
form: "single",
|
|
39880
40181
|
optional: false
|
|
39881
40182
|
}],
|
|
40183
|
+
"recording.reconcileLedgerAgainstDisk": [{
|
|
40184
|
+
name: "deviceId",
|
|
40185
|
+
form: "single",
|
|
40186
|
+
optional: true
|
|
40187
|
+
}],
|
|
39882
40188
|
"recording.relocateFootage": [{
|
|
39883
40189
|
name: "deviceId",
|
|
39884
40190
|
form: "single",
|
|
@@ -39944,6 +40250,11 @@ Object.freeze({
|
|
|
39944
40250
|
form: "single",
|
|
39945
40251
|
optional: false
|
|
39946
40252
|
}],
|
|
40253
|
+
"sceneMonitor.listScenesBatch": [{
|
|
40254
|
+
name: "deviceIds",
|
|
40255
|
+
form: "array",
|
|
40256
|
+
optional: false
|
|
40257
|
+
}],
|
|
39947
40258
|
"sceneMonitor.recheckNow": [{
|
|
39948
40259
|
name: "deviceId",
|
|
39949
40260
|
form: "single",
|
|
@@ -40205,6 +40516,11 @@ Object.freeze({
|
|
|
40205
40516
|
form: "single",
|
|
40206
40517
|
optional: false
|
|
40207
40518
|
}],
|
|
40519
|
+
"zoneAnalytics.getCurrentSnapshotBatch": [{
|
|
40520
|
+
name: "deviceIds",
|
|
40521
|
+
form: "array",
|
|
40522
|
+
optional: false
|
|
40523
|
+
}],
|
|
40208
40524
|
"zoneAnalytics.getUnzonedHistory": [{
|
|
40209
40525
|
name: "deviceId",
|
|
40210
40526
|
form: "single",
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
//#endregion
|
|
6
|
-
const require_dist = require("../dist-
|
|
6
|
+
const require_dist = require("../dist-u1L6UZmY.js");
|
|
7
7
|
let node_crypto = require("node:crypto");
|
|
8
8
|
//#region src/ha-export/topics.ts
|
|
9
9
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { At as EventCategory, C as buildAddonRouteProvider, Et as string, N as deviceExportCapability, X as oauthIntegrationCapability, a as COCO_TO_MACRO, c as FanDirectionSchema, i as CAMERA_SWITCH_ORDER, l as HvacModeSchema, o as CameraSwitchIdSchema, p as addonRoutesCapability, pt as BaseAddon, t as AlarmArmModeSchema, u as MediaPlayerRepeatSchema, vt as nodePin } from "../dist-
|
|
1
|
+
import { At as EventCategory, C as buildAddonRouteProvider, Et as string, N as deviceExportCapability, X as oauthIntegrationCapability, a as COCO_TO_MACRO, c as FanDirectionSchema, i as CAMERA_SWITCH_ORDER, l as HvacModeSchema, o as CameraSwitchIdSchema, p as addonRoutesCapability, pt as BaseAddon, t as AlarmArmModeSchema, u as MediaPlayerRepeatSchema, vt as nodePin } from "../dist-DV4Xqi_x.mjs";
|
|
2
2
|
import { createHmac, timingSafeEqual } from "node:crypto";
|
|
3
3
|
//#region src/ha-export/topics.ts
|
|
4
4
|
/**
|