@camstack/addon-mqtt-broker 1.1.23 → 1.1.25
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/mqtt-broker.addon.js +202 -13
- package/dist/mqtt-broker.addon.mjs +202 -13
- package/package.json +1 -1
|
@@ -44,7 +44,7 @@ let crypto$10 = __toESM(crypto$1, 1);
|
|
|
44
44
|
crypto$1 = __toESM(crypto$1);
|
|
45
45
|
let node_fs = require("node:fs");
|
|
46
46
|
let node_path = require("node:path");
|
|
47
|
-
//#region ../types/dist/event-category-
|
|
47
|
+
//#region ../types/dist/event-category-H4AVePnn.mjs
|
|
48
48
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
49
49
|
EventCategory["SystemBoot"] = "system.boot";
|
|
50
50
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -194,6 +194,9 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
194
194
|
EventCategory["RecordingSegmentWritten"] = "recording.segment.written";
|
|
195
195
|
EventCategory["RecordingPolicyFallback"] = "recording.policy.fallback";
|
|
196
196
|
EventCategory["RecordingRetentionCompleted"] = "recording.retention.completed";
|
|
197
|
+
/** Runner-sampled scrub thumbnail (~1/5 s/camera). Telemetry (D8): a lost
|
|
198
|
+
* thumb is a scrub gap the recorder's keyframe backfill covers. */
|
|
199
|
+
EventCategory["RecordingThumbSampled"] = "recording.thumb-sampled";
|
|
197
200
|
EventCategory["DetectionEvent"] = "detection.event";
|
|
198
201
|
EventCategory["SessionTrackNew"] = "session.track.new";
|
|
199
202
|
EventCategory["SessionTrackExpired"] = "session.track.expired";
|
|
@@ -7263,6 +7266,24 @@ var RecordingRetentionSchema = object({
|
|
|
7263
7266
|
maxSizeGb: number().min(0).optional()
|
|
7264
7267
|
});
|
|
7265
7268
|
/**
|
|
7269
|
+
* Scrub-thumbnail fidelity preset — the single per-camera selector bundling the
|
|
7270
|
+
* sprite tile RESOLUTION + JPEG QUALITY the recorder packs timeline-scrub
|
|
7271
|
+
* previews at. Five graduated steps; absent on a config = `standard` (the
|
|
7272
|
+
* shipped default, matching `sheet-geometry`/`sheet-composer`).
|
|
7273
|
+
*
|
|
7274
|
+
* Existing sheets are IMMUTABLE — a changed preset applies to NEW windows only.
|
|
7275
|
+
* Each window's index sidecar carries its own tile dims, so a camera whose
|
|
7276
|
+
* preset changed over time renders every historical window at the dims it was
|
|
7277
|
+
* written with.
|
|
7278
|
+
*/
|
|
7279
|
+
var ScrubThumbnailPresetSchema = _enum([
|
|
7280
|
+
"minimal",
|
|
7281
|
+
"low",
|
|
7282
|
+
"standard",
|
|
7283
|
+
"high",
|
|
7284
|
+
"max"
|
|
7285
|
+
]);
|
|
7286
|
+
/**
|
|
7266
7287
|
* The full per-camera recording intent — the wire shape of a RecordingTarget.
|
|
7267
7288
|
*
|
|
7268
7289
|
* `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
|
|
@@ -7299,7 +7320,14 @@ var RecordingConfigSchema = object({
|
|
|
7299
7320
|
* derived into bands once via `migrateConfigToBands`.
|
|
7300
7321
|
*/
|
|
7301
7322
|
bands: array(RecordingBandSchema).optional(),
|
|
7302
|
-
retention: RecordingRetentionSchema.optional()
|
|
7323
|
+
retention: RecordingRetentionSchema.optional(),
|
|
7324
|
+
/**
|
|
7325
|
+
* Per-camera scrub-thumbnail fidelity preset (resolution + JPEG quality for
|
|
7326
|
+
* timeline-scrub sprite previews). Absent = `standard`. Applies to NEW
|
|
7327
|
+
* windows only — existing sheets are immutable, and each window's index
|
|
7328
|
+
* carries its own tile dims so mixed-preset history renders correctly.
|
|
7329
|
+
*/
|
|
7330
|
+
scrubThumbnails: ScrubThumbnailPresetSchema.optional()
|
|
7303
7331
|
});
|
|
7304
7332
|
/**
|
|
7305
7333
|
* `StorageLocationType` — an addon-declared id that identifies the *kind* of
|
|
@@ -9858,7 +9886,7 @@ object({
|
|
|
9858
9886
|
deviceId: number(),
|
|
9859
9887
|
timestamp: number()
|
|
9860
9888
|
});
|
|
9861
|
-
DeviceType.Button;
|
|
9889
|
+
DeviceType.Button, DeviceType.Camera;
|
|
9862
9890
|
/**
|
|
9863
9891
|
* Enum-state sensor — a string value picked from a finite option set.
|
|
9864
9892
|
* Drives HA `sensor` entries with `state_class: enum` (HVAC action
|
|
@@ -14277,6 +14305,14 @@ var ConfigEntrySchema = object({
|
|
|
14277
14305
|
value: unknown(),
|
|
14278
14306
|
description: string().optional()
|
|
14279
14307
|
});
|
|
14308
|
+
var DeviceLinkModeSchema = _enum(["auto", "manual"]);
|
|
14309
|
+
/** One resolved linked device — the compact projection consumers need. */
|
|
14310
|
+
var LinkedDeviceSchema = object({
|
|
14311
|
+
deviceId: number(),
|
|
14312
|
+
name: string(),
|
|
14313
|
+
location: string().nullable(),
|
|
14314
|
+
features: array(string())
|
|
14315
|
+
});
|
|
14280
14316
|
var SavedDeviceRowSchema = object({
|
|
14281
14317
|
/** Numeric id reserved at allocateDeviceId time. */
|
|
14282
14318
|
id: number(),
|
|
@@ -14498,7 +14534,10 @@ method(object({
|
|
|
14498
14534
|
}), _void(), {
|
|
14499
14535
|
kind: "mutation",
|
|
14500
14536
|
auth: "admin"
|
|
14501
|
-
}), method(object({ addonId: string() }), array(SavedDeviceRowSchema)), method(object({ addonId: string().optional() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }),
|
|
14537
|
+
}), method(object({ addonId: string() }), array(SavedDeviceRowSchema)), method(object({ addonId: string().optional() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), object({
|
|
14538
|
+
mode: DeviceLinkModeSchema,
|
|
14539
|
+
devices: array(LinkedDeviceSchema)
|
|
14540
|
+
})), method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
|
|
14502
14541
|
deviceId: number(),
|
|
14503
14542
|
values: record(string(), unknown())
|
|
14504
14543
|
}), object({ success: literal(true) }), {
|
|
@@ -15786,6 +15825,61 @@ var EventKindSchema = _enum([
|
|
|
15786
15825
|
"object",
|
|
15787
15826
|
"audio"
|
|
15788
15827
|
]);
|
|
15828
|
+
/**
|
|
15829
|
+
* Spatial filter for `listTracks` — the rect + polygon variants of the shared
|
|
15830
|
+
* MaskShape vocabulary (see `mask-shape.ts`). Coordinates are NORMALIZED 0..1
|
|
15831
|
+
* of the camera frame (top-left origin), matching the drawing-plane editor.
|
|
15832
|
+
*/
|
|
15833
|
+
var TrackZoneFilterSchema = discriminatedUnion("kind", [MaskRectShapeSchema, MaskPolygonShapeSchema]);
|
|
15834
|
+
/** Closed icon vocabulary so clients render a known glyph per kind. */
|
|
15835
|
+
var EventKindIconSchema = _enum([
|
|
15836
|
+
"motion",
|
|
15837
|
+
"audio",
|
|
15838
|
+
"person",
|
|
15839
|
+
"vehicle",
|
|
15840
|
+
"animal",
|
|
15841
|
+
"door",
|
|
15842
|
+
"pir",
|
|
15843
|
+
"smoke",
|
|
15844
|
+
"water",
|
|
15845
|
+
"button",
|
|
15846
|
+
"generic"
|
|
15847
|
+
]);
|
|
15848
|
+
var EventKindCategorySchema = _enum([
|
|
15849
|
+
"motion",
|
|
15850
|
+
"audio",
|
|
15851
|
+
"detection",
|
|
15852
|
+
"sensor",
|
|
15853
|
+
"custom"
|
|
15854
|
+
]);
|
|
15855
|
+
var EventKindDescriptorSchema = object({
|
|
15856
|
+
/** Stable kind id (e.g. 'motion', 'person', 'contact'). */
|
|
15857
|
+
kind: string(),
|
|
15858
|
+
label: string(),
|
|
15859
|
+
/** Hex color for timeline/legend rendering. */
|
|
15860
|
+
color: string(),
|
|
15861
|
+
icon: EventKindIconSchema,
|
|
15862
|
+
category: EventKindCategorySchema,
|
|
15863
|
+
/** Which cap + device contributes this kind. For built-ins the camera
|
|
15864
|
+
* itself; for sensor kinds the LINKED source device. */
|
|
15865
|
+
source: object({
|
|
15866
|
+
capName: string(),
|
|
15867
|
+
deviceId: number()
|
|
15868
|
+
})
|
|
15869
|
+
});
|
|
15870
|
+
var SensorEventSchema = object({
|
|
15871
|
+
id: string(),
|
|
15872
|
+
/** The CAMERA the event is attributed to (a sensor linked to N cameras
|
|
15873
|
+
* yields N rows, one per camera). */
|
|
15874
|
+
deviceId: number(),
|
|
15875
|
+
/** The linked sensor device whose state changed. */
|
|
15876
|
+
sourceDeviceId: number(),
|
|
15877
|
+
/** Event kind id — matches an `EventKindDescriptor.kind`. */
|
|
15878
|
+
kind: string(),
|
|
15879
|
+
/** Snapshot of the sensor cap's runtime-state slice at the change. */
|
|
15880
|
+
value: record(string(), unknown()).nullable(),
|
|
15881
|
+
timestamp: number()
|
|
15882
|
+
});
|
|
15789
15883
|
var TrackPositionSchema = object({
|
|
15790
15884
|
x: number(),
|
|
15791
15885
|
y: number(),
|
|
@@ -15799,6 +15893,30 @@ var TrackSnapshotSchema = object({
|
|
|
15799
15893
|
mediaKey: string()
|
|
15800
15894
|
});
|
|
15801
15895
|
/**
|
|
15896
|
+
* Normalized 0..1 trajectory envelope (min/max over every position bbox,
|
|
15897
|
+
* divided by the track's detection-frame dims), computed at persist time.
|
|
15898
|
+
* Absent when the frame dims were unknown when the track was persisted
|
|
15899
|
+
* (legacy rows / dims-less sources) and on active (in-RAM) tracks.
|
|
15900
|
+
*/
|
|
15901
|
+
var TrackEnvelopeSchema = object({
|
|
15902
|
+
minX: number(),
|
|
15903
|
+
minY: number(),
|
|
15904
|
+
maxX: number(),
|
|
15905
|
+
maxY: number()
|
|
15906
|
+
});
|
|
15907
|
+
/**
|
|
15908
|
+
* Row projection for track list queries. `full` (default) returns the
|
|
15909
|
+
* complete Track including the frame-rate `positions[]` history and the
|
|
15910
|
+
* `snapshots[]` references — megabytes across a page of tracks. `slim`
|
|
15911
|
+
* keeps every scalar the list surfaces actually render (ids, class(es),
|
|
15912
|
+
* label / audioLabels / importance enrichment, firstSeen/lastSeen, state,
|
|
15913
|
+
* zonesVisited, bestEventId, envelope) and returns `positions` /
|
|
15914
|
+
* `snapshots` as EMPTY arrays — detail views re-fetch the full row via
|
|
15915
|
+
* `getTrack`. Mirrors the event-store `projection` convention
|
|
15916
|
+
* (`getObjectEvents` et al.).
|
|
15917
|
+
*/
|
|
15918
|
+
var TrackProjectionSchema = _enum(["full", "slim"]);
|
|
15919
|
+
/**
|
|
15802
15920
|
* One audio-classification label heard on the track's camera while the
|
|
15803
15921
|
* track was alive, aggregated per label. An "episode" is one persisted
|
|
15804
15922
|
* audio event (the confident-classification path: score ≥ the device's
|
|
@@ -15849,7 +15967,11 @@ var TrackSchema = object({
|
|
|
15849
15967
|
/** Audio-classification labels heard on the camera during the track's
|
|
15850
15968
|
* life (score ≥ device `classificationMinScore`), aggregated per label.
|
|
15851
15969
|
* Absent on legacy rows / tracks with no confident audio. */
|
|
15852
|
-
audioLabels: array(TrackAudioLabelSchema).readonly().optional()
|
|
15970
|
+
audioLabels: array(TrackAudioLabelSchema).readonly().optional(),
|
|
15971
|
+
/** Normalized 0..1 trajectory envelope (see {@link TrackEnvelopeSchema}).
|
|
15972
|
+
* Populated from the persisted envelope columns on historical reads;
|
|
15973
|
+
* absent on legacy rows, dims-less tracks and active (in-RAM) tracks. */
|
|
15974
|
+
envelope: TrackEnvelopeSchema.optional()
|
|
15853
15975
|
});
|
|
15854
15976
|
var BaseEventFields = {
|
|
15855
15977
|
id: string(),
|
|
@@ -15959,11 +16081,13 @@ var MediaFileSchema = object({
|
|
|
15959
16081
|
sizeBytes: number(),
|
|
15960
16082
|
timestamp: number()
|
|
15961
16083
|
});
|
|
16084
|
+
var DEFAULT_EVENT_QUERY_LIMIT = 1e3;
|
|
16085
|
+
var MAX_EVENT_QUERY_LIMIT = 5e3;
|
|
15962
16086
|
var DeviceEventQueryInput = object({
|
|
15963
16087
|
deviceId: number(),
|
|
15964
16088
|
since: number().optional(),
|
|
15965
16089
|
until: number().optional(),
|
|
15966
|
-
limit: number().int().min(1).max(
|
|
16090
|
+
limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT),
|
|
15967
16091
|
/** `slim` drops heavy JSON fields (regions/bbox/zones) and carries an
|
|
15968
16092
|
* optional `mediaUrl` (populated by B5). `full` (default) keeps today's
|
|
15969
16093
|
* exact behaviour. Callers may omit this field — the store defaults to
|
|
@@ -15971,6 +16095,27 @@ var DeviceEventQueryInput = object({
|
|
|
15971
16095
|
projection: _enum(["full", "slim"]).optional()
|
|
15972
16096
|
});
|
|
15973
16097
|
var ObjectEventQueryInput = DeviceEventQueryInput.extend({ classFilter: string().optional() });
|
|
16098
|
+
var RecentTracksQueryInput = object({
|
|
16099
|
+
/** Devices to merge. An empty array yields `{ tracks: [], nextCursor: null }`. */
|
|
16100
|
+
deviceIds: array(number()),
|
|
16101
|
+
/** Window lower bound on `lastSeen` (inclusive). */
|
|
16102
|
+
since: number().optional(),
|
|
16103
|
+
/** Window upper bound on `lastSeen` (inclusive). */
|
|
16104
|
+
until: number().optional(),
|
|
16105
|
+
/** Page size. Default 200, max 1000. */
|
|
16106
|
+
limit: number().int().min(1).max(1e3).default(200),
|
|
16107
|
+
/** Opaque continuation cursor from a previous page's `nextCursor`.
|
|
16108
|
+
* Encodes the (lastSeen, trackId) sort position — treat as opaque. */
|
|
16109
|
+
cursor: string().optional(),
|
|
16110
|
+
/** See {@link TrackProjectionSchema}. Default `full`. */
|
|
16111
|
+
projection: TrackProjectionSchema.optional()
|
|
16112
|
+
});
|
|
16113
|
+
var RecentTracksPageSchema = object({
|
|
16114
|
+
/** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
|
|
16115
|
+
tracks: array(TrackSchema).readonly(),
|
|
16116
|
+
/** Cursor for the next page, or null when this page is the last. */
|
|
16117
|
+
nextCursor: string().nullable()
|
|
16118
|
+
});
|
|
15974
16119
|
var KeyEventQueryInput = object({
|
|
15975
16120
|
deviceId: number(),
|
|
15976
16121
|
/** Window lower bound (track firstSeen ≥ since). */
|
|
@@ -16053,11 +16198,25 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
16053
16198
|
deviceId: number(),
|
|
16054
16199
|
since: number().optional(),
|
|
16055
16200
|
until: number().optional(),
|
|
16056
|
-
limit: number().optional()
|
|
16057
|
-
|
|
16058
|
-
|
|
16059
|
-
|
|
16060
|
-
|
|
16201
|
+
limit: number().optional(),
|
|
16202
|
+
/** Spatial filter — only tracks whose trajectory intersects the zone
|
|
16203
|
+
* (normalized 0..1 rect or polygon). SQL-prefiltered on the persisted
|
|
16204
|
+
* envelope columns, then precisely tested per position. Tracks with
|
|
16205
|
+
* an unknown envelope (no frame dims at persist time) always match. */
|
|
16206
|
+
zone: TrackZoneFilterSchema.optional(),
|
|
16207
|
+
/** See {@link TrackProjectionSchema}. Default `full` (backward
|
|
16208
|
+
* compatible — omitting the field keeps today's exact behaviour). */
|
|
16209
|
+
projection: TrackProjectionSchema.optional()
|
|
16210
|
+
}), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
|
|
16211
|
+
kind: "mutation",
|
|
16212
|
+
auth: "admin"
|
|
16213
|
+
}), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(object({ deviceId: number() }), array(EventKindDescriptorSchema).readonly()), method(object({
|
|
16214
|
+
deviceId: number(),
|
|
16215
|
+
since: number().optional(),
|
|
16216
|
+
until: number().optional(),
|
|
16217
|
+
kinds: array(string()).optional(),
|
|
16218
|
+
limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
|
|
16219
|
+
}), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
|
|
16061
16220
|
deviceId: number(),
|
|
16062
16221
|
since: number(),
|
|
16063
16222
|
until: number(),
|
|
@@ -19258,7 +19417,12 @@ var RecordingStorageUsageSchema = object({
|
|
|
19258
19417
|
/**
|
|
19259
19418
|
* Result of locating footage at a wall-clock instant for one device/profile.
|
|
19260
19419
|
* `segment` carries the covering segment's window; `gap` reports the forward
|
|
19261
|
-
* nearest covered edge (`null` past the end of footage / when none exists)
|
|
19420
|
+
* nearest covered edge (`null` past the end of footage / when none exists)
|
|
19421
|
+
* and the backward covered edge `prevEndMs` (exclusive end of the nearest
|
|
19422
|
+
* footage behind the epoch; `null` when none — optional so older providers
|
|
19423
|
+
* that omit it stay valid). `prevEndMs` lets a backward frame-step hop the
|
|
19424
|
+
* small inter-segment cracks (durMs under-covers the span to the next
|
|
19425
|
+
* startMs by ~11-17 ms) instead of no-opping at a segment head.
|
|
19262
19426
|
*/
|
|
19263
19427
|
var LocateSegmentResultSchema = discriminatedUnion("kind", [object({
|
|
19264
19428
|
kind: literal("segment"),
|
|
@@ -19267,7 +19431,8 @@ var LocateSegmentResultSchema = discriminatedUnion("kind", [object({
|
|
|
19267
19431
|
bytes: number()
|
|
19268
19432
|
}), object({
|
|
19269
19433
|
kind: literal("gap"),
|
|
19270
|
-
nearestEdgeMs: number().nullable()
|
|
19434
|
+
nearestEdgeMs: number().nullable(),
|
|
19435
|
+
prevEndMs: number().nullable().optional()
|
|
19271
19436
|
})]);
|
|
19272
19437
|
/** Raw bytes of one finalized footage segment (read off disk on the recording node). */
|
|
19273
19438
|
var ReadSegmentBytesResultSchema = object({ data: _instanceof(Uint8Array) });
|
|
@@ -20836,6 +21001,12 @@ Object.freeze({
|
|
|
20836
21001
|
addonId: null,
|
|
20837
21002
|
access: "view"
|
|
20838
21003
|
},
|
|
21004
|
+
"deviceManager.getLinkedDevices": {
|
|
21005
|
+
capName: "device-manager",
|
|
21006
|
+
capScope: "system",
|
|
21007
|
+
addonId: null,
|
|
21008
|
+
access: "view"
|
|
21009
|
+
},
|
|
20839
21010
|
"deviceManager.getRoleDisplayDefaults": {
|
|
20840
21011
|
capName: "device-manager",
|
|
20841
21012
|
capScope: "system",
|
|
@@ -22390,6 +22561,12 @@ Object.freeze({
|
|
|
22390
22561
|
addonId: null,
|
|
22391
22562
|
access: "view"
|
|
22392
22563
|
},
|
|
22564
|
+
"pipelineAnalytics.getSensorEvents": {
|
|
22565
|
+
capName: "pipeline-analytics",
|
|
22566
|
+
capScope: "device",
|
|
22567
|
+
addonId: null,
|
|
22568
|
+
access: "view"
|
|
22569
|
+
},
|
|
22393
22570
|
"pipelineAnalytics.getTrack": {
|
|
22394
22571
|
capName: "pipeline-analytics",
|
|
22395
22572
|
capScope: "device",
|
|
@@ -22402,6 +22579,18 @@ Object.freeze({
|
|
|
22402
22579
|
addonId: null,
|
|
22403
22580
|
access: "view"
|
|
22404
22581
|
},
|
|
22582
|
+
"pipelineAnalytics.listEventKinds": {
|
|
22583
|
+
capName: "pipeline-analytics",
|
|
22584
|
+
capScope: "device",
|
|
22585
|
+
addonId: null,
|
|
22586
|
+
access: "view"
|
|
22587
|
+
},
|
|
22588
|
+
"pipelineAnalytics.listRecentTracks": {
|
|
22589
|
+
capName: "pipeline-analytics",
|
|
22590
|
+
capScope: "device",
|
|
22591
|
+
addonId: null,
|
|
22592
|
+
access: "view"
|
|
22593
|
+
},
|
|
22405
22594
|
"pipelineAnalytics.listTracks": {
|
|
22406
22595
|
capName: "pipeline-analytics",
|
|
22407
22596
|
capScope: "device",
|
|
@@ -39,7 +39,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
39
39
|
var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
40
40
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
41
41
|
//#endregion
|
|
42
|
-
//#region ../types/dist/event-category-
|
|
42
|
+
//#region ../types/dist/event-category-H4AVePnn.mjs
|
|
43
43
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
44
44
|
EventCategory["SystemBoot"] = "system.boot";
|
|
45
45
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -189,6 +189,9 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
189
189
|
EventCategory["RecordingSegmentWritten"] = "recording.segment.written";
|
|
190
190
|
EventCategory["RecordingPolicyFallback"] = "recording.policy.fallback";
|
|
191
191
|
EventCategory["RecordingRetentionCompleted"] = "recording.retention.completed";
|
|
192
|
+
/** Runner-sampled scrub thumbnail (~1/5 s/camera). Telemetry (D8): a lost
|
|
193
|
+
* thumb is a scrub gap the recorder's keyframe backfill covers. */
|
|
194
|
+
EventCategory["RecordingThumbSampled"] = "recording.thumb-sampled";
|
|
192
195
|
EventCategory["DetectionEvent"] = "detection.event";
|
|
193
196
|
EventCategory["SessionTrackNew"] = "session.track.new";
|
|
194
197
|
EventCategory["SessionTrackExpired"] = "session.track.expired";
|
|
@@ -7258,6 +7261,24 @@ var RecordingRetentionSchema = object({
|
|
|
7258
7261
|
maxSizeGb: number().min(0).optional()
|
|
7259
7262
|
});
|
|
7260
7263
|
/**
|
|
7264
|
+
* Scrub-thumbnail fidelity preset — the single per-camera selector bundling the
|
|
7265
|
+
* sprite tile RESOLUTION + JPEG QUALITY the recorder packs timeline-scrub
|
|
7266
|
+
* previews at. Five graduated steps; absent on a config = `standard` (the
|
|
7267
|
+
* shipped default, matching `sheet-geometry`/`sheet-composer`).
|
|
7268
|
+
*
|
|
7269
|
+
* Existing sheets are IMMUTABLE — a changed preset applies to NEW windows only.
|
|
7270
|
+
* Each window's index sidecar carries its own tile dims, so a camera whose
|
|
7271
|
+
* preset changed over time renders every historical window at the dims it was
|
|
7272
|
+
* written with.
|
|
7273
|
+
*/
|
|
7274
|
+
var ScrubThumbnailPresetSchema = _enum([
|
|
7275
|
+
"minimal",
|
|
7276
|
+
"low",
|
|
7277
|
+
"standard",
|
|
7278
|
+
"high",
|
|
7279
|
+
"max"
|
|
7280
|
+
]);
|
|
7281
|
+
/**
|
|
7261
7282
|
* The full per-camera recording intent — the wire shape of a RecordingTarget.
|
|
7262
7283
|
*
|
|
7263
7284
|
* `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
|
|
@@ -7294,7 +7315,14 @@ var RecordingConfigSchema = object({
|
|
|
7294
7315
|
* derived into bands once via `migrateConfigToBands`.
|
|
7295
7316
|
*/
|
|
7296
7317
|
bands: array(RecordingBandSchema).optional(),
|
|
7297
|
-
retention: RecordingRetentionSchema.optional()
|
|
7318
|
+
retention: RecordingRetentionSchema.optional(),
|
|
7319
|
+
/**
|
|
7320
|
+
* Per-camera scrub-thumbnail fidelity preset (resolution + JPEG quality for
|
|
7321
|
+
* timeline-scrub sprite previews). Absent = `standard`. Applies to NEW
|
|
7322
|
+
* windows only — existing sheets are immutable, and each window's index
|
|
7323
|
+
* carries its own tile dims so mixed-preset history renders correctly.
|
|
7324
|
+
*/
|
|
7325
|
+
scrubThumbnails: ScrubThumbnailPresetSchema.optional()
|
|
7298
7326
|
});
|
|
7299
7327
|
/**
|
|
7300
7328
|
* `StorageLocationType` — an addon-declared id that identifies the *kind* of
|
|
@@ -9853,7 +9881,7 @@ object({
|
|
|
9853
9881
|
deviceId: number(),
|
|
9854
9882
|
timestamp: number()
|
|
9855
9883
|
});
|
|
9856
|
-
DeviceType.Button;
|
|
9884
|
+
DeviceType.Button, DeviceType.Camera;
|
|
9857
9885
|
/**
|
|
9858
9886
|
* Enum-state sensor — a string value picked from a finite option set.
|
|
9859
9887
|
* Drives HA `sensor` entries with `state_class: enum` (HVAC action
|
|
@@ -14272,6 +14300,14 @@ var ConfigEntrySchema = object({
|
|
|
14272
14300
|
value: unknown(),
|
|
14273
14301
|
description: string().optional()
|
|
14274
14302
|
});
|
|
14303
|
+
var DeviceLinkModeSchema = _enum(["auto", "manual"]);
|
|
14304
|
+
/** One resolved linked device — the compact projection consumers need. */
|
|
14305
|
+
var LinkedDeviceSchema = object({
|
|
14306
|
+
deviceId: number(),
|
|
14307
|
+
name: string(),
|
|
14308
|
+
location: string().nullable(),
|
|
14309
|
+
features: array(string())
|
|
14310
|
+
});
|
|
14275
14311
|
var SavedDeviceRowSchema = object({
|
|
14276
14312
|
/** Numeric id reserved at allocateDeviceId time. */
|
|
14277
14313
|
id: number(),
|
|
@@ -14493,7 +14529,10 @@ method(object({
|
|
|
14493
14529
|
}), _void(), {
|
|
14494
14530
|
kind: "mutation",
|
|
14495
14531
|
auth: "admin"
|
|
14496
|
-
}), method(object({ addonId: string() }), array(SavedDeviceRowSchema)), method(object({ addonId: string().optional() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }),
|
|
14532
|
+
}), method(object({ addonId: string() }), array(SavedDeviceRowSchema)), method(object({ addonId: string().optional() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), object({
|
|
14533
|
+
mode: DeviceLinkModeSchema,
|
|
14534
|
+
devices: array(LinkedDeviceSchema)
|
|
14535
|
+
})), method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
|
|
14497
14536
|
deviceId: number(),
|
|
14498
14537
|
values: record(string(), unknown())
|
|
14499
14538
|
}), object({ success: literal(true) }), {
|
|
@@ -15781,6 +15820,61 @@ var EventKindSchema = _enum([
|
|
|
15781
15820
|
"object",
|
|
15782
15821
|
"audio"
|
|
15783
15822
|
]);
|
|
15823
|
+
/**
|
|
15824
|
+
* Spatial filter for `listTracks` — the rect + polygon variants of the shared
|
|
15825
|
+
* MaskShape vocabulary (see `mask-shape.ts`). Coordinates are NORMALIZED 0..1
|
|
15826
|
+
* of the camera frame (top-left origin), matching the drawing-plane editor.
|
|
15827
|
+
*/
|
|
15828
|
+
var TrackZoneFilterSchema = discriminatedUnion("kind", [MaskRectShapeSchema, MaskPolygonShapeSchema]);
|
|
15829
|
+
/** Closed icon vocabulary so clients render a known glyph per kind. */
|
|
15830
|
+
var EventKindIconSchema = _enum([
|
|
15831
|
+
"motion",
|
|
15832
|
+
"audio",
|
|
15833
|
+
"person",
|
|
15834
|
+
"vehicle",
|
|
15835
|
+
"animal",
|
|
15836
|
+
"door",
|
|
15837
|
+
"pir",
|
|
15838
|
+
"smoke",
|
|
15839
|
+
"water",
|
|
15840
|
+
"button",
|
|
15841
|
+
"generic"
|
|
15842
|
+
]);
|
|
15843
|
+
var EventKindCategorySchema = _enum([
|
|
15844
|
+
"motion",
|
|
15845
|
+
"audio",
|
|
15846
|
+
"detection",
|
|
15847
|
+
"sensor",
|
|
15848
|
+
"custom"
|
|
15849
|
+
]);
|
|
15850
|
+
var EventKindDescriptorSchema = object({
|
|
15851
|
+
/** Stable kind id (e.g. 'motion', 'person', 'contact'). */
|
|
15852
|
+
kind: string(),
|
|
15853
|
+
label: string(),
|
|
15854
|
+
/** Hex color for timeline/legend rendering. */
|
|
15855
|
+
color: string(),
|
|
15856
|
+
icon: EventKindIconSchema,
|
|
15857
|
+
category: EventKindCategorySchema,
|
|
15858
|
+
/** Which cap + device contributes this kind. For built-ins the camera
|
|
15859
|
+
* itself; for sensor kinds the LINKED source device. */
|
|
15860
|
+
source: object({
|
|
15861
|
+
capName: string(),
|
|
15862
|
+
deviceId: number()
|
|
15863
|
+
})
|
|
15864
|
+
});
|
|
15865
|
+
var SensorEventSchema = object({
|
|
15866
|
+
id: string(),
|
|
15867
|
+
/** The CAMERA the event is attributed to (a sensor linked to N cameras
|
|
15868
|
+
* yields N rows, one per camera). */
|
|
15869
|
+
deviceId: number(),
|
|
15870
|
+
/** The linked sensor device whose state changed. */
|
|
15871
|
+
sourceDeviceId: number(),
|
|
15872
|
+
/** Event kind id — matches an `EventKindDescriptor.kind`. */
|
|
15873
|
+
kind: string(),
|
|
15874
|
+
/** Snapshot of the sensor cap's runtime-state slice at the change. */
|
|
15875
|
+
value: record(string(), unknown()).nullable(),
|
|
15876
|
+
timestamp: number()
|
|
15877
|
+
});
|
|
15784
15878
|
var TrackPositionSchema = object({
|
|
15785
15879
|
x: number(),
|
|
15786
15880
|
y: number(),
|
|
@@ -15794,6 +15888,30 @@ var TrackSnapshotSchema = object({
|
|
|
15794
15888
|
mediaKey: string()
|
|
15795
15889
|
});
|
|
15796
15890
|
/**
|
|
15891
|
+
* Normalized 0..1 trajectory envelope (min/max over every position bbox,
|
|
15892
|
+
* divided by the track's detection-frame dims), computed at persist time.
|
|
15893
|
+
* Absent when the frame dims were unknown when the track was persisted
|
|
15894
|
+
* (legacy rows / dims-less sources) and on active (in-RAM) tracks.
|
|
15895
|
+
*/
|
|
15896
|
+
var TrackEnvelopeSchema = object({
|
|
15897
|
+
minX: number(),
|
|
15898
|
+
minY: number(),
|
|
15899
|
+
maxX: number(),
|
|
15900
|
+
maxY: number()
|
|
15901
|
+
});
|
|
15902
|
+
/**
|
|
15903
|
+
* Row projection for track list queries. `full` (default) returns the
|
|
15904
|
+
* complete Track including the frame-rate `positions[]` history and the
|
|
15905
|
+
* `snapshots[]` references — megabytes across a page of tracks. `slim`
|
|
15906
|
+
* keeps every scalar the list surfaces actually render (ids, class(es),
|
|
15907
|
+
* label / audioLabels / importance enrichment, firstSeen/lastSeen, state,
|
|
15908
|
+
* zonesVisited, bestEventId, envelope) and returns `positions` /
|
|
15909
|
+
* `snapshots` as EMPTY arrays — detail views re-fetch the full row via
|
|
15910
|
+
* `getTrack`. Mirrors the event-store `projection` convention
|
|
15911
|
+
* (`getObjectEvents` et al.).
|
|
15912
|
+
*/
|
|
15913
|
+
var TrackProjectionSchema = _enum(["full", "slim"]);
|
|
15914
|
+
/**
|
|
15797
15915
|
* One audio-classification label heard on the track's camera while the
|
|
15798
15916
|
* track was alive, aggregated per label. An "episode" is one persisted
|
|
15799
15917
|
* audio event (the confident-classification path: score ≥ the device's
|
|
@@ -15844,7 +15962,11 @@ var TrackSchema = object({
|
|
|
15844
15962
|
/** Audio-classification labels heard on the camera during the track's
|
|
15845
15963
|
* life (score ≥ device `classificationMinScore`), aggregated per label.
|
|
15846
15964
|
* Absent on legacy rows / tracks with no confident audio. */
|
|
15847
|
-
audioLabels: array(TrackAudioLabelSchema).readonly().optional()
|
|
15965
|
+
audioLabels: array(TrackAudioLabelSchema).readonly().optional(),
|
|
15966
|
+
/** Normalized 0..1 trajectory envelope (see {@link TrackEnvelopeSchema}).
|
|
15967
|
+
* Populated from the persisted envelope columns on historical reads;
|
|
15968
|
+
* absent on legacy rows, dims-less tracks and active (in-RAM) tracks. */
|
|
15969
|
+
envelope: TrackEnvelopeSchema.optional()
|
|
15848
15970
|
});
|
|
15849
15971
|
var BaseEventFields = {
|
|
15850
15972
|
id: string(),
|
|
@@ -15954,11 +16076,13 @@ var MediaFileSchema = object({
|
|
|
15954
16076
|
sizeBytes: number(),
|
|
15955
16077
|
timestamp: number()
|
|
15956
16078
|
});
|
|
16079
|
+
var DEFAULT_EVENT_QUERY_LIMIT = 1e3;
|
|
16080
|
+
var MAX_EVENT_QUERY_LIMIT = 5e3;
|
|
15957
16081
|
var DeviceEventQueryInput = object({
|
|
15958
16082
|
deviceId: number(),
|
|
15959
16083
|
since: number().optional(),
|
|
15960
16084
|
until: number().optional(),
|
|
15961
|
-
limit: number().int().min(1).max(
|
|
16085
|
+
limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT),
|
|
15962
16086
|
/** `slim` drops heavy JSON fields (regions/bbox/zones) and carries an
|
|
15963
16087
|
* optional `mediaUrl` (populated by B5). `full` (default) keeps today's
|
|
15964
16088
|
* exact behaviour. Callers may omit this field — the store defaults to
|
|
@@ -15966,6 +16090,27 @@ var DeviceEventQueryInput = object({
|
|
|
15966
16090
|
projection: _enum(["full", "slim"]).optional()
|
|
15967
16091
|
});
|
|
15968
16092
|
var ObjectEventQueryInput = DeviceEventQueryInput.extend({ classFilter: string().optional() });
|
|
16093
|
+
var RecentTracksQueryInput = object({
|
|
16094
|
+
/** Devices to merge. An empty array yields `{ tracks: [], nextCursor: null }`. */
|
|
16095
|
+
deviceIds: array(number()),
|
|
16096
|
+
/** Window lower bound on `lastSeen` (inclusive). */
|
|
16097
|
+
since: number().optional(),
|
|
16098
|
+
/** Window upper bound on `lastSeen` (inclusive). */
|
|
16099
|
+
until: number().optional(),
|
|
16100
|
+
/** Page size. Default 200, max 1000. */
|
|
16101
|
+
limit: number().int().min(1).max(1e3).default(200),
|
|
16102
|
+
/** Opaque continuation cursor from a previous page's `nextCursor`.
|
|
16103
|
+
* Encodes the (lastSeen, trackId) sort position — treat as opaque. */
|
|
16104
|
+
cursor: string().optional(),
|
|
16105
|
+
/** See {@link TrackProjectionSchema}. Default `full`. */
|
|
16106
|
+
projection: TrackProjectionSchema.optional()
|
|
16107
|
+
});
|
|
16108
|
+
var RecentTracksPageSchema = object({
|
|
16109
|
+
/** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
|
|
16110
|
+
tracks: array(TrackSchema).readonly(),
|
|
16111
|
+
/** Cursor for the next page, or null when this page is the last. */
|
|
16112
|
+
nextCursor: string().nullable()
|
|
16113
|
+
});
|
|
15969
16114
|
var KeyEventQueryInput = object({
|
|
15970
16115
|
deviceId: number(),
|
|
15971
16116
|
/** Window lower bound (track firstSeen ≥ since). */
|
|
@@ -16048,11 +16193,25 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
16048
16193
|
deviceId: number(),
|
|
16049
16194
|
since: number().optional(),
|
|
16050
16195
|
until: number().optional(),
|
|
16051
|
-
limit: number().optional()
|
|
16052
|
-
|
|
16053
|
-
|
|
16054
|
-
|
|
16055
|
-
|
|
16196
|
+
limit: number().optional(),
|
|
16197
|
+
/** Spatial filter — only tracks whose trajectory intersects the zone
|
|
16198
|
+
* (normalized 0..1 rect or polygon). SQL-prefiltered on the persisted
|
|
16199
|
+
* envelope columns, then precisely tested per position. Tracks with
|
|
16200
|
+
* an unknown envelope (no frame dims at persist time) always match. */
|
|
16201
|
+
zone: TrackZoneFilterSchema.optional(),
|
|
16202
|
+
/** See {@link TrackProjectionSchema}. Default `full` (backward
|
|
16203
|
+
* compatible — omitting the field keeps today's exact behaviour). */
|
|
16204
|
+
projection: TrackProjectionSchema.optional()
|
|
16205
|
+
}), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
|
|
16206
|
+
kind: "mutation",
|
|
16207
|
+
auth: "admin"
|
|
16208
|
+
}), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(object({ deviceId: number() }), array(EventKindDescriptorSchema).readonly()), method(object({
|
|
16209
|
+
deviceId: number(),
|
|
16210
|
+
since: number().optional(),
|
|
16211
|
+
until: number().optional(),
|
|
16212
|
+
kinds: array(string()).optional(),
|
|
16213
|
+
limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
|
|
16214
|
+
}), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
|
|
16056
16215
|
deviceId: number(),
|
|
16057
16216
|
since: number(),
|
|
16058
16217
|
until: number(),
|
|
@@ -19253,7 +19412,12 @@ var RecordingStorageUsageSchema = object({
|
|
|
19253
19412
|
/**
|
|
19254
19413
|
* Result of locating footage at a wall-clock instant for one device/profile.
|
|
19255
19414
|
* `segment` carries the covering segment's window; `gap` reports the forward
|
|
19256
|
-
* nearest covered edge (`null` past the end of footage / when none exists)
|
|
19415
|
+
* nearest covered edge (`null` past the end of footage / when none exists)
|
|
19416
|
+
* and the backward covered edge `prevEndMs` (exclusive end of the nearest
|
|
19417
|
+
* footage behind the epoch; `null` when none — optional so older providers
|
|
19418
|
+
* that omit it stay valid). `prevEndMs` lets a backward frame-step hop the
|
|
19419
|
+
* small inter-segment cracks (durMs under-covers the span to the next
|
|
19420
|
+
* startMs by ~11-17 ms) instead of no-opping at a segment head.
|
|
19257
19421
|
*/
|
|
19258
19422
|
var LocateSegmentResultSchema = discriminatedUnion("kind", [object({
|
|
19259
19423
|
kind: literal("segment"),
|
|
@@ -19262,7 +19426,8 @@ var LocateSegmentResultSchema = discriminatedUnion("kind", [object({
|
|
|
19262
19426
|
bytes: number()
|
|
19263
19427
|
}), object({
|
|
19264
19428
|
kind: literal("gap"),
|
|
19265
|
-
nearestEdgeMs: number().nullable()
|
|
19429
|
+
nearestEdgeMs: number().nullable(),
|
|
19430
|
+
prevEndMs: number().nullable().optional()
|
|
19266
19431
|
})]);
|
|
19267
19432
|
/** Raw bytes of one finalized footage segment (read off disk on the recording node). */
|
|
19268
19433
|
var ReadSegmentBytesResultSchema = object({ data: _instanceof(Uint8Array) });
|
|
@@ -20831,6 +20996,12 @@ Object.freeze({
|
|
|
20831
20996
|
addonId: null,
|
|
20832
20997
|
access: "view"
|
|
20833
20998
|
},
|
|
20999
|
+
"deviceManager.getLinkedDevices": {
|
|
21000
|
+
capName: "device-manager",
|
|
21001
|
+
capScope: "system",
|
|
21002
|
+
addonId: null,
|
|
21003
|
+
access: "view"
|
|
21004
|
+
},
|
|
20834
21005
|
"deviceManager.getRoleDisplayDefaults": {
|
|
20835
21006
|
capName: "device-manager",
|
|
20836
21007
|
capScope: "system",
|
|
@@ -22385,6 +22556,12 @@ Object.freeze({
|
|
|
22385
22556
|
addonId: null,
|
|
22386
22557
|
access: "view"
|
|
22387
22558
|
},
|
|
22559
|
+
"pipelineAnalytics.getSensorEvents": {
|
|
22560
|
+
capName: "pipeline-analytics",
|
|
22561
|
+
capScope: "device",
|
|
22562
|
+
addonId: null,
|
|
22563
|
+
access: "view"
|
|
22564
|
+
},
|
|
22388
22565
|
"pipelineAnalytics.getTrack": {
|
|
22389
22566
|
capName: "pipeline-analytics",
|
|
22390
22567
|
capScope: "device",
|
|
@@ -22397,6 +22574,18 @@ Object.freeze({
|
|
|
22397
22574
|
addonId: null,
|
|
22398
22575
|
access: "view"
|
|
22399
22576
|
},
|
|
22577
|
+
"pipelineAnalytics.listEventKinds": {
|
|
22578
|
+
capName: "pipeline-analytics",
|
|
22579
|
+
capScope: "device",
|
|
22580
|
+
addonId: null,
|
|
22581
|
+
access: "view"
|
|
22582
|
+
},
|
|
22583
|
+
"pipelineAnalytics.listRecentTracks": {
|
|
22584
|
+
capName: "pipeline-analytics",
|
|
22585
|
+
capScope: "device",
|
|
22586
|
+
addonId: null,
|
|
22587
|
+
access: "view"
|
|
22588
|
+
},
|
|
22400
22589
|
"pipelineAnalytics.listTracks": {
|
|
22401
22590
|
capName: "pipeline-analytics",
|
|
22402
22591
|
capScope: "device",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-mqtt-broker",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.25",
|
|
4
4
|
"description": "MQTT broker registry addon for CamStack — manages external broker entries + an optional embedded aedes broker. Consumers spin up their own `mqtt.js` clients via the `mqtt-broker` cap.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|