@camstack/addon-mqtt-broker 1.1.23 → 1.1.24
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 +176 -12
- package/dist/mqtt-broker.addon.mjs +176 -12
- 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";
|
|
@@ -9858,7 +9861,7 @@ object({
|
|
|
9858
9861
|
deviceId: number(),
|
|
9859
9862
|
timestamp: number()
|
|
9860
9863
|
});
|
|
9861
|
-
DeviceType.Button;
|
|
9864
|
+
DeviceType.Button, DeviceType.Camera;
|
|
9862
9865
|
/**
|
|
9863
9866
|
* Enum-state sensor — a string value picked from a finite option set.
|
|
9864
9867
|
* Drives HA `sensor` entries with `state_class: enum` (HVAC action
|
|
@@ -14277,6 +14280,14 @@ var ConfigEntrySchema = object({
|
|
|
14277
14280
|
value: unknown(),
|
|
14278
14281
|
description: string().optional()
|
|
14279
14282
|
});
|
|
14283
|
+
var DeviceLinkModeSchema = _enum(["auto", "manual"]);
|
|
14284
|
+
/** One resolved linked device — the compact projection consumers need. */
|
|
14285
|
+
var LinkedDeviceSchema = object({
|
|
14286
|
+
deviceId: number(),
|
|
14287
|
+
name: string(),
|
|
14288
|
+
location: string().nullable(),
|
|
14289
|
+
features: array(string())
|
|
14290
|
+
});
|
|
14280
14291
|
var SavedDeviceRowSchema = object({
|
|
14281
14292
|
/** Numeric id reserved at allocateDeviceId time. */
|
|
14282
14293
|
id: number(),
|
|
@@ -14498,7 +14509,10 @@ method(object({
|
|
|
14498
14509
|
}), _void(), {
|
|
14499
14510
|
kind: "mutation",
|
|
14500
14511
|
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() }),
|
|
14512
|
+
}), 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({
|
|
14513
|
+
mode: DeviceLinkModeSchema,
|
|
14514
|
+
devices: array(LinkedDeviceSchema)
|
|
14515
|
+
})), method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
|
|
14502
14516
|
deviceId: number(),
|
|
14503
14517
|
values: record(string(), unknown())
|
|
14504
14518
|
}), object({ success: literal(true) }), {
|
|
@@ -15786,6 +15800,61 @@ var EventKindSchema = _enum([
|
|
|
15786
15800
|
"object",
|
|
15787
15801
|
"audio"
|
|
15788
15802
|
]);
|
|
15803
|
+
/**
|
|
15804
|
+
* Spatial filter for `listTracks` — the rect + polygon variants of the shared
|
|
15805
|
+
* MaskShape vocabulary (see `mask-shape.ts`). Coordinates are NORMALIZED 0..1
|
|
15806
|
+
* of the camera frame (top-left origin), matching the drawing-plane editor.
|
|
15807
|
+
*/
|
|
15808
|
+
var TrackZoneFilterSchema = discriminatedUnion("kind", [MaskRectShapeSchema, MaskPolygonShapeSchema]);
|
|
15809
|
+
/** Closed icon vocabulary so clients render a known glyph per kind. */
|
|
15810
|
+
var EventKindIconSchema = _enum([
|
|
15811
|
+
"motion",
|
|
15812
|
+
"audio",
|
|
15813
|
+
"person",
|
|
15814
|
+
"vehicle",
|
|
15815
|
+
"animal",
|
|
15816
|
+
"door",
|
|
15817
|
+
"pir",
|
|
15818
|
+
"smoke",
|
|
15819
|
+
"water",
|
|
15820
|
+
"button",
|
|
15821
|
+
"generic"
|
|
15822
|
+
]);
|
|
15823
|
+
var EventKindCategorySchema = _enum([
|
|
15824
|
+
"motion",
|
|
15825
|
+
"audio",
|
|
15826
|
+
"detection",
|
|
15827
|
+
"sensor",
|
|
15828
|
+
"custom"
|
|
15829
|
+
]);
|
|
15830
|
+
var EventKindDescriptorSchema = object({
|
|
15831
|
+
/** Stable kind id (e.g. 'motion', 'person', 'contact'). */
|
|
15832
|
+
kind: string(),
|
|
15833
|
+
label: string(),
|
|
15834
|
+
/** Hex color for timeline/legend rendering. */
|
|
15835
|
+
color: string(),
|
|
15836
|
+
icon: EventKindIconSchema,
|
|
15837
|
+
category: EventKindCategorySchema,
|
|
15838
|
+
/** Which cap + device contributes this kind. For built-ins the camera
|
|
15839
|
+
* itself; for sensor kinds the LINKED source device. */
|
|
15840
|
+
source: object({
|
|
15841
|
+
capName: string(),
|
|
15842
|
+
deviceId: number()
|
|
15843
|
+
})
|
|
15844
|
+
});
|
|
15845
|
+
var SensorEventSchema = object({
|
|
15846
|
+
id: string(),
|
|
15847
|
+
/** The CAMERA the event is attributed to (a sensor linked to N cameras
|
|
15848
|
+
* yields N rows, one per camera). */
|
|
15849
|
+
deviceId: number(),
|
|
15850
|
+
/** The linked sensor device whose state changed. */
|
|
15851
|
+
sourceDeviceId: number(),
|
|
15852
|
+
/** Event kind id — matches an `EventKindDescriptor.kind`. */
|
|
15853
|
+
kind: string(),
|
|
15854
|
+
/** Snapshot of the sensor cap's runtime-state slice at the change. */
|
|
15855
|
+
value: record(string(), unknown()).nullable(),
|
|
15856
|
+
timestamp: number()
|
|
15857
|
+
});
|
|
15789
15858
|
var TrackPositionSchema = object({
|
|
15790
15859
|
x: number(),
|
|
15791
15860
|
y: number(),
|
|
@@ -15799,6 +15868,30 @@ var TrackSnapshotSchema = object({
|
|
|
15799
15868
|
mediaKey: string()
|
|
15800
15869
|
});
|
|
15801
15870
|
/**
|
|
15871
|
+
* Normalized 0..1 trajectory envelope (min/max over every position bbox,
|
|
15872
|
+
* divided by the track's detection-frame dims), computed at persist time.
|
|
15873
|
+
* Absent when the frame dims were unknown when the track was persisted
|
|
15874
|
+
* (legacy rows / dims-less sources) and on active (in-RAM) tracks.
|
|
15875
|
+
*/
|
|
15876
|
+
var TrackEnvelopeSchema = object({
|
|
15877
|
+
minX: number(),
|
|
15878
|
+
minY: number(),
|
|
15879
|
+
maxX: number(),
|
|
15880
|
+
maxY: number()
|
|
15881
|
+
});
|
|
15882
|
+
/**
|
|
15883
|
+
* Row projection for track list queries. `full` (default) returns the
|
|
15884
|
+
* complete Track including the frame-rate `positions[]` history and the
|
|
15885
|
+
* `snapshots[]` references — megabytes across a page of tracks. `slim`
|
|
15886
|
+
* keeps every scalar the list surfaces actually render (ids, class(es),
|
|
15887
|
+
* label / audioLabels / importance enrichment, firstSeen/lastSeen, state,
|
|
15888
|
+
* zonesVisited, bestEventId, envelope) and returns `positions` /
|
|
15889
|
+
* `snapshots` as EMPTY arrays — detail views re-fetch the full row via
|
|
15890
|
+
* `getTrack`. Mirrors the event-store `projection` convention
|
|
15891
|
+
* (`getObjectEvents` et al.).
|
|
15892
|
+
*/
|
|
15893
|
+
var TrackProjectionSchema = _enum(["full", "slim"]);
|
|
15894
|
+
/**
|
|
15802
15895
|
* One audio-classification label heard on the track's camera while the
|
|
15803
15896
|
* track was alive, aggregated per label. An "episode" is one persisted
|
|
15804
15897
|
* audio event (the confident-classification path: score ≥ the device's
|
|
@@ -15849,7 +15942,11 @@ var TrackSchema = object({
|
|
|
15849
15942
|
/** Audio-classification labels heard on the camera during the track's
|
|
15850
15943
|
* life (score ≥ device `classificationMinScore`), aggregated per label.
|
|
15851
15944
|
* Absent on legacy rows / tracks with no confident audio. */
|
|
15852
|
-
audioLabels: array(TrackAudioLabelSchema).readonly().optional()
|
|
15945
|
+
audioLabels: array(TrackAudioLabelSchema).readonly().optional(),
|
|
15946
|
+
/** Normalized 0..1 trajectory envelope (see {@link TrackEnvelopeSchema}).
|
|
15947
|
+
* Populated from the persisted envelope columns on historical reads;
|
|
15948
|
+
* absent on legacy rows, dims-less tracks and active (in-RAM) tracks. */
|
|
15949
|
+
envelope: TrackEnvelopeSchema.optional()
|
|
15853
15950
|
});
|
|
15854
15951
|
var BaseEventFields = {
|
|
15855
15952
|
id: string(),
|
|
@@ -15959,11 +16056,13 @@ var MediaFileSchema = object({
|
|
|
15959
16056
|
sizeBytes: number(),
|
|
15960
16057
|
timestamp: number()
|
|
15961
16058
|
});
|
|
16059
|
+
var DEFAULT_EVENT_QUERY_LIMIT = 1e3;
|
|
16060
|
+
var MAX_EVENT_QUERY_LIMIT = 5e3;
|
|
15962
16061
|
var DeviceEventQueryInput = object({
|
|
15963
16062
|
deviceId: number(),
|
|
15964
16063
|
since: number().optional(),
|
|
15965
16064
|
until: number().optional(),
|
|
15966
|
-
limit: number().int().min(1).max(
|
|
16065
|
+
limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT),
|
|
15967
16066
|
/** `slim` drops heavy JSON fields (regions/bbox/zones) and carries an
|
|
15968
16067
|
* optional `mediaUrl` (populated by B5). `full` (default) keeps today's
|
|
15969
16068
|
* exact behaviour. Callers may omit this field — the store defaults to
|
|
@@ -15971,6 +16070,27 @@ var DeviceEventQueryInput = object({
|
|
|
15971
16070
|
projection: _enum(["full", "slim"]).optional()
|
|
15972
16071
|
});
|
|
15973
16072
|
var ObjectEventQueryInput = DeviceEventQueryInput.extend({ classFilter: string().optional() });
|
|
16073
|
+
var RecentTracksQueryInput = object({
|
|
16074
|
+
/** Devices to merge. An empty array yields `{ tracks: [], nextCursor: null }`. */
|
|
16075
|
+
deviceIds: array(number()),
|
|
16076
|
+
/** Window lower bound on `lastSeen` (inclusive). */
|
|
16077
|
+
since: number().optional(),
|
|
16078
|
+
/** Window upper bound on `lastSeen` (inclusive). */
|
|
16079
|
+
until: number().optional(),
|
|
16080
|
+
/** Page size. Default 200, max 1000. */
|
|
16081
|
+
limit: number().int().min(1).max(1e3).default(200),
|
|
16082
|
+
/** Opaque continuation cursor from a previous page's `nextCursor`.
|
|
16083
|
+
* Encodes the (lastSeen, trackId) sort position — treat as opaque. */
|
|
16084
|
+
cursor: string().optional(),
|
|
16085
|
+
/** See {@link TrackProjectionSchema}. Default `full`. */
|
|
16086
|
+
projection: TrackProjectionSchema.optional()
|
|
16087
|
+
});
|
|
16088
|
+
var RecentTracksPageSchema = object({
|
|
16089
|
+
/** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
|
|
16090
|
+
tracks: array(TrackSchema).readonly(),
|
|
16091
|
+
/** Cursor for the next page, or null when this page is the last. */
|
|
16092
|
+
nextCursor: string().nullable()
|
|
16093
|
+
});
|
|
15974
16094
|
var KeyEventQueryInput = object({
|
|
15975
16095
|
deviceId: number(),
|
|
15976
16096
|
/** Window lower bound (track firstSeen ≥ since). */
|
|
@@ -16053,11 +16173,25 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
16053
16173
|
deviceId: number(),
|
|
16054
16174
|
since: number().optional(),
|
|
16055
16175
|
until: number().optional(),
|
|
16056
|
-
limit: number().optional()
|
|
16057
|
-
|
|
16058
|
-
|
|
16059
|
-
|
|
16060
|
-
|
|
16176
|
+
limit: number().optional(),
|
|
16177
|
+
/** Spatial filter — only tracks whose trajectory intersects the zone
|
|
16178
|
+
* (normalized 0..1 rect or polygon). SQL-prefiltered on the persisted
|
|
16179
|
+
* envelope columns, then precisely tested per position. Tracks with
|
|
16180
|
+
* an unknown envelope (no frame dims at persist time) always match. */
|
|
16181
|
+
zone: TrackZoneFilterSchema.optional(),
|
|
16182
|
+
/** See {@link TrackProjectionSchema}. Default `full` (backward
|
|
16183
|
+
* compatible — omitting the field keeps today's exact behaviour). */
|
|
16184
|
+
projection: TrackProjectionSchema.optional()
|
|
16185
|
+
}), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
|
|
16186
|
+
kind: "mutation",
|
|
16187
|
+
auth: "admin"
|
|
16188
|
+
}), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(object({ deviceId: number() }), array(EventKindDescriptorSchema).readonly()), method(object({
|
|
16189
|
+
deviceId: number(),
|
|
16190
|
+
since: number().optional(),
|
|
16191
|
+
until: number().optional(),
|
|
16192
|
+
kinds: array(string()).optional(),
|
|
16193
|
+
limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
|
|
16194
|
+
}), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
|
|
16061
16195
|
deviceId: number(),
|
|
16062
16196
|
since: number(),
|
|
16063
16197
|
until: number(),
|
|
@@ -19258,7 +19392,12 @@ var RecordingStorageUsageSchema = object({
|
|
|
19258
19392
|
/**
|
|
19259
19393
|
* Result of locating footage at a wall-clock instant for one device/profile.
|
|
19260
19394
|
* `segment` carries the covering segment's window; `gap` reports the forward
|
|
19261
|
-
* nearest covered edge (`null` past the end of footage / when none exists)
|
|
19395
|
+
* nearest covered edge (`null` past the end of footage / when none exists)
|
|
19396
|
+
* and the backward covered edge `prevEndMs` (exclusive end of the nearest
|
|
19397
|
+
* footage behind the epoch; `null` when none — optional so older providers
|
|
19398
|
+
* that omit it stay valid). `prevEndMs` lets a backward frame-step hop the
|
|
19399
|
+
* small inter-segment cracks (durMs under-covers the span to the next
|
|
19400
|
+
* startMs by ~11-17 ms) instead of no-opping at a segment head.
|
|
19262
19401
|
*/
|
|
19263
19402
|
var LocateSegmentResultSchema = discriminatedUnion("kind", [object({
|
|
19264
19403
|
kind: literal("segment"),
|
|
@@ -19267,7 +19406,8 @@ var LocateSegmentResultSchema = discriminatedUnion("kind", [object({
|
|
|
19267
19406
|
bytes: number()
|
|
19268
19407
|
}), object({
|
|
19269
19408
|
kind: literal("gap"),
|
|
19270
|
-
nearestEdgeMs: number().nullable()
|
|
19409
|
+
nearestEdgeMs: number().nullable(),
|
|
19410
|
+
prevEndMs: number().nullable().optional()
|
|
19271
19411
|
})]);
|
|
19272
19412
|
/** Raw bytes of one finalized footage segment (read off disk on the recording node). */
|
|
19273
19413
|
var ReadSegmentBytesResultSchema = object({ data: _instanceof(Uint8Array) });
|
|
@@ -20836,6 +20976,12 @@ Object.freeze({
|
|
|
20836
20976
|
addonId: null,
|
|
20837
20977
|
access: "view"
|
|
20838
20978
|
},
|
|
20979
|
+
"deviceManager.getLinkedDevices": {
|
|
20980
|
+
capName: "device-manager",
|
|
20981
|
+
capScope: "system",
|
|
20982
|
+
addonId: null,
|
|
20983
|
+
access: "view"
|
|
20984
|
+
},
|
|
20839
20985
|
"deviceManager.getRoleDisplayDefaults": {
|
|
20840
20986
|
capName: "device-manager",
|
|
20841
20987
|
capScope: "system",
|
|
@@ -22390,6 +22536,12 @@ Object.freeze({
|
|
|
22390
22536
|
addonId: null,
|
|
22391
22537
|
access: "view"
|
|
22392
22538
|
},
|
|
22539
|
+
"pipelineAnalytics.getSensorEvents": {
|
|
22540
|
+
capName: "pipeline-analytics",
|
|
22541
|
+
capScope: "device",
|
|
22542
|
+
addonId: null,
|
|
22543
|
+
access: "view"
|
|
22544
|
+
},
|
|
22393
22545
|
"pipelineAnalytics.getTrack": {
|
|
22394
22546
|
capName: "pipeline-analytics",
|
|
22395
22547
|
capScope: "device",
|
|
@@ -22402,6 +22554,18 @@ Object.freeze({
|
|
|
22402
22554
|
addonId: null,
|
|
22403
22555
|
access: "view"
|
|
22404
22556
|
},
|
|
22557
|
+
"pipelineAnalytics.listEventKinds": {
|
|
22558
|
+
capName: "pipeline-analytics",
|
|
22559
|
+
capScope: "device",
|
|
22560
|
+
addonId: null,
|
|
22561
|
+
access: "view"
|
|
22562
|
+
},
|
|
22563
|
+
"pipelineAnalytics.listRecentTracks": {
|
|
22564
|
+
capName: "pipeline-analytics",
|
|
22565
|
+
capScope: "device",
|
|
22566
|
+
addonId: null,
|
|
22567
|
+
access: "view"
|
|
22568
|
+
},
|
|
22405
22569
|
"pipelineAnalytics.listTracks": {
|
|
22406
22570
|
capName: "pipeline-analytics",
|
|
22407
22571
|
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";
|
|
@@ -9853,7 +9856,7 @@ object({
|
|
|
9853
9856
|
deviceId: number(),
|
|
9854
9857
|
timestamp: number()
|
|
9855
9858
|
});
|
|
9856
|
-
DeviceType.Button;
|
|
9859
|
+
DeviceType.Button, DeviceType.Camera;
|
|
9857
9860
|
/**
|
|
9858
9861
|
* Enum-state sensor — a string value picked from a finite option set.
|
|
9859
9862
|
* Drives HA `sensor` entries with `state_class: enum` (HVAC action
|
|
@@ -14272,6 +14275,14 @@ var ConfigEntrySchema = object({
|
|
|
14272
14275
|
value: unknown(),
|
|
14273
14276
|
description: string().optional()
|
|
14274
14277
|
});
|
|
14278
|
+
var DeviceLinkModeSchema = _enum(["auto", "manual"]);
|
|
14279
|
+
/** One resolved linked device — the compact projection consumers need. */
|
|
14280
|
+
var LinkedDeviceSchema = object({
|
|
14281
|
+
deviceId: number(),
|
|
14282
|
+
name: string(),
|
|
14283
|
+
location: string().nullable(),
|
|
14284
|
+
features: array(string())
|
|
14285
|
+
});
|
|
14275
14286
|
var SavedDeviceRowSchema = object({
|
|
14276
14287
|
/** Numeric id reserved at allocateDeviceId time. */
|
|
14277
14288
|
id: number(),
|
|
@@ -14493,7 +14504,10 @@ method(object({
|
|
|
14493
14504
|
}), _void(), {
|
|
14494
14505
|
kind: "mutation",
|
|
14495
14506
|
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() }),
|
|
14507
|
+
}), 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({
|
|
14508
|
+
mode: DeviceLinkModeSchema,
|
|
14509
|
+
devices: array(LinkedDeviceSchema)
|
|
14510
|
+
})), method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
|
|
14497
14511
|
deviceId: number(),
|
|
14498
14512
|
values: record(string(), unknown())
|
|
14499
14513
|
}), object({ success: literal(true) }), {
|
|
@@ -15781,6 +15795,61 @@ var EventKindSchema = _enum([
|
|
|
15781
15795
|
"object",
|
|
15782
15796
|
"audio"
|
|
15783
15797
|
]);
|
|
15798
|
+
/**
|
|
15799
|
+
* Spatial filter for `listTracks` — the rect + polygon variants of the shared
|
|
15800
|
+
* MaskShape vocabulary (see `mask-shape.ts`). Coordinates are NORMALIZED 0..1
|
|
15801
|
+
* of the camera frame (top-left origin), matching the drawing-plane editor.
|
|
15802
|
+
*/
|
|
15803
|
+
var TrackZoneFilterSchema = discriminatedUnion("kind", [MaskRectShapeSchema, MaskPolygonShapeSchema]);
|
|
15804
|
+
/** Closed icon vocabulary so clients render a known glyph per kind. */
|
|
15805
|
+
var EventKindIconSchema = _enum([
|
|
15806
|
+
"motion",
|
|
15807
|
+
"audio",
|
|
15808
|
+
"person",
|
|
15809
|
+
"vehicle",
|
|
15810
|
+
"animal",
|
|
15811
|
+
"door",
|
|
15812
|
+
"pir",
|
|
15813
|
+
"smoke",
|
|
15814
|
+
"water",
|
|
15815
|
+
"button",
|
|
15816
|
+
"generic"
|
|
15817
|
+
]);
|
|
15818
|
+
var EventKindCategorySchema = _enum([
|
|
15819
|
+
"motion",
|
|
15820
|
+
"audio",
|
|
15821
|
+
"detection",
|
|
15822
|
+
"sensor",
|
|
15823
|
+
"custom"
|
|
15824
|
+
]);
|
|
15825
|
+
var EventKindDescriptorSchema = object({
|
|
15826
|
+
/** Stable kind id (e.g. 'motion', 'person', 'contact'). */
|
|
15827
|
+
kind: string(),
|
|
15828
|
+
label: string(),
|
|
15829
|
+
/** Hex color for timeline/legend rendering. */
|
|
15830
|
+
color: string(),
|
|
15831
|
+
icon: EventKindIconSchema,
|
|
15832
|
+
category: EventKindCategorySchema,
|
|
15833
|
+
/** Which cap + device contributes this kind. For built-ins the camera
|
|
15834
|
+
* itself; for sensor kinds the LINKED source device. */
|
|
15835
|
+
source: object({
|
|
15836
|
+
capName: string(),
|
|
15837
|
+
deviceId: number()
|
|
15838
|
+
})
|
|
15839
|
+
});
|
|
15840
|
+
var SensorEventSchema = object({
|
|
15841
|
+
id: string(),
|
|
15842
|
+
/** The CAMERA the event is attributed to (a sensor linked to N cameras
|
|
15843
|
+
* yields N rows, one per camera). */
|
|
15844
|
+
deviceId: number(),
|
|
15845
|
+
/** The linked sensor device whose state changed. */
|
|
15846
|
+
sourceDeviceId: number(),
|
|
15847
|
+
/** Event kind id — matches an `EventKindDescriptor.kind`. */
|
|
15848
|
+
kind: string(),
|
|
15849
|
+
/** Snapshot of the sensor cap's runtime-state slice at the change. */
|
|
15850
|
+
value: record(string(), unknown()).nullable(),
|
|
15851
|
+
timestamp: number()
|
|
15852
|
+
});
|
|
15784
15853
|
var TrackPositionSchema = object({
|
|
15785
15854
|
x: number(),
|
|
15786
15855
|
y: number(),
|
|
@@ -15794,6 +15863,30 @@ var TrackSnapshotSchema = object({
|
|
|
15794
15863
|
mediaKey: string()
|
|
15795
15864
|
});
|
|
15796
15865
|
/**
|
|
15866
|
+
* Normalized 0..1 trajectory envelope (min/max over every position bbox,
|
|
15867
|
+
* divided by the track's detection-frame dims), computed at persist time.
|
|
15868
|
+
* Absent when the frame dims were unknown when the track was persisted
|
|
15869
|
+
* (legacy rows / dims-less sources) and on active (in-RAM) tracks.
|
|
15870
|
+
*/
|
|
15871
|
+
var TrackEnvelopeSchema = object({
|
|
15872
|
+
minX: number(),
|
|
15873
|
+
minY: number(),
|
|
15874
|
+
maxX: number(),
|
|
15875
|
+
maxY: number()
|
|
15876
|
+
});
|
|
15877
|
+
/**
|
|
15878
|
+
* Row projection for track list queries. `full` (default) returns the
|
|
15879
|
+
* complete Track including the frame-rate `positions[]` history and the
|
|
15880
|
+
* `snapshots[]` references — megabytes across a page of tracks. `slim`
|
|
15881
|
+
* keeps every scalar the list surfaces actually render (ids, class(es),
|
|
15882
|
+
* label / audioLabels / importance enrichment, firstSeen/lastSeen, state,
|
|
15883
|
+
* zonesVisited, bestEventId, envelope) and returns `positions` /
|
|
15884
|
+
* `snapshots` as EMPTY arrays — detail views re-fetch the full row via
|
|
15885
|
+
* `getTrack`. Mirrors the event-store `projection` convention
|
|
15886
|
+
* (`getObjectEvents` et al.).
|
|
15887
|
+
*/
|
|
15888
|
+
var TrackProjectionSchema = _enum(["full", "slim"]);
|
|
15889
|
+
/**
|
|
15797
15890
|
* One audio-classification label heard on the track's camera while the
|
|
15798
15891
|
* track was alive, aggregated per label. An "episode" is one persisted
|
|
15799
15892
|
* audio event (the confident-classification path: score ≥ the device's
|
|
@@ -15844,7 +15937,11 @@ var TrackSchema = object({
|
|
|
15844
15937
|
/** Audio-classification labels heard on the camera during the track's
|
|
15845
15938
|
* life (score ≥ device `classificationMinScore`), aggregated per label.
|
|
15846
15939
|
* Absent on legacy rows / tracks with no confident audio. */
|
|
15847
|
-
audioLabels: array(TrackAudioLabelSchema).readonly().optional()
|
|
15940
|
+
audioLabels: array(TrackAudioLabelSchema).readonly().optional(),
|
|
15941
|
+
/** Normalized 0..1 trajectory envelope (see {@link TrackEnvelopeSchema}).
|
|
15942
|
+
* Populated from the persisted envelope columns on historical reads;
|
|
15943
|
+
* absent on legacy rows, dims-less tracks and active (in-RAM) tracks. */
|
|
15944
|
+
envelope: TrackEnvelopeSchema.optional()
|
|
15848
15945
|
});
|
|
15849
15946
|
var BaseEventFields = {
|
|
15850
15947
|
id: string(),
|
|
@@ -15954,11 +16051,13 @@ var MediaFileSchema = object({
|
|
|
15954
16051
|
sizeBytes: number(),
|
|
15955
16052
|
timestamp: number()
|
|
15956
16053
|
});
|
|
16054
|
+
var DEFAULT_EVENT_QUERY_LIMIT = 1e3;
|
|
16055
|
+
var MAX_EVENT_QUERY_LIMIT = 5e3;
|
|
15957
16056
|
var DeviceEventQueryInput = object({
|
|
15958
16057
|
deviceId: number(),
|
|
15959
16058
|
since: number().optional(),
|
|
15960
16059
|
until: number().optional(),
|
|
15961
|
-
limit: number().int().min(1).max(
|
|
16060
|
+
limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT),
|
|
15962
16061
|
/** `slim` drops heavy JSON fields (regions/bbox/zones) and carries an
|
|
15963
16062
|
* optional `mediaUrl` (populated by B5). `full` (default) keeps today's
|
|
15964
16063
|
* exact behaviour. Callers may omit this field — the store defaults to
|
|
@@ -15966,6 +16065,27 @@ var DeviceEventQueryInput = object({
|
|
|
15966
16065
|
projection: _enum(["full", "slim"]).optional()
|
|
15967
16066
|
});
|
|
15968
16067
|
var ObjectEventQueryInput = DeviceEventQueryInput.extend({ classFilter: string().optional() });
|
|
16068
|
+
var RecentTracksQueryInput = object({
|
|
16069
|
+
/** Devices to merge. An empty array yields `{ tracks: [], nextCursor: null }`. */
|
|
16070
|
+
deviceIds: array(number()),
|
|
16071
|
+
/** Window lower bound on `lastSeen` (inclusive). */
|
|
16072
|
+
since: number().optional(),
|
|
16073
|
+
/** Window upper bound on `lastSeen` (inclusive). */
|
|
16074
|
+
until: number().optional(),
|
|
16075
|
+
/** Page size. Default 200, max 1000. */
|
|
16076
|
+
limit: number().int().min(1).max(1e3).default(200),
|
|
16077
|
+
/** Opaque continuation cursor from a previous page's `nextCursor`.
|
|
16078
|
+
* Encodes the (lastSeen, trackId) sort position — treat as opaque. */
|
|
16079
|
+
cursor: string().optional(),
|
|
16080
|
+
/** See {@link TrackProjectionSchema}. Default `full`. */
|
|
16081
|
+
projection: TrackProjectionSchema.optional()
|
|
16082
|
+
});
|
|
16083
|
+
var RecentTracksPageSchema = object({
|
|
16084
|
+
/** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
|
|
16085
|
+
tracks: array(TrackSchema).readonly(),
|
|
16086
|
+
/** Cursor for the next page, or null when this page is the last. */
|
|
16087
|
+
nextCursor: string().nullable()
|
|
16088
|
+
});
|
|
15969
16089
|
var KeyEventQueryInput = object({
|
|
15970
16090
|
deviceId: number(),
|
|
15971
16091
|
/** Window lower bound (track firstSeen ≥ since). */
|
|
@@ -16048,11 +16168,25 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
16048
16168
|
deviceId: number(),
|
|
16049
16169
|
since: number().optional(),
|
|
16050
16170
|
until: number().optional(),
|
|
16051
|
-
limit: number().optional()
|
|
16052
|
-
|
|
16053
|
-
|
|
16054
|
-
|
|
16055
|
-
|
|
16171
|
+
limit: number().optional(),
|
|
16172
|
+
/** Spatial filter — only tracks whose trajectory intersects the zone
|
|
16173
|
+
* (normalized 0..1 rect or polygon). SQL-prefiltered on the persisted
|
|
16174
|
+
* envelope columns, then precisely tested per position. Tracks with
|
|
16175
|
+
* an unknown envelope (no frame dims at persist time) always match. */
|
|
16176
|
+
zone: TrackZoneFilterSchema.optional(),
|
|
16177
|
+
/** See {@link TrackProjectionSchema}. Default `full` (backward
|
|
16178
|
+
* compatible — omitting the field keeps today's exact behaviour). */
|
|
16179
|
+
projection: TrackProjectionSchema.optional()
|
|
16180
|
+
}), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
|
|
16181
|
+
kind: "mutation",
|
|
16182
|
+
auth: "admin"
|
|
16183
|
+
}), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(object({ deviceId: number() }), array(EventKindDescriptorSchema).readonly()), method(object({
|
|
16184
|
+
deviceId: number(),
|
|
16185
|
+
since: number().optional(),
|
|
16186
|
+
until: number().optional(),
|
|
16187
|
+
kinds: array(string()).optional(),
|
|
16188
|
+
limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
|
|
16189
|
+
}), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
|
|
16056
16190
|
deviceId: number(),
|
|
16057
16191
|
since: number(),
|
|
16058
16192
|
until: number(),
|
|
@@ -19253,7 +19387,12 @@ var RecordingStorageUsageSchema = object({
|
|
|
19253
19387
|
/**
|
|
19254
19388
|
* Result of locating footage at a wall-clock instant for one device/profile.
|
|
19255
19389
|
* `segment` carries the covering segment's window; `gap` reports the forward
|
|
19256
|
-
* nearest covered edge (`null` past the end of footage / when none exists)
|
|
19390
|
+
* nearest covered edge (`null` past the end of footage / when none exists)
|
|
19391
|
+
* and the backward covered edge `prevEndMs` (exclusive end of the nearest
|
|
19392
|
+
* footage behind the epoch; `null` when none — optional so older providers
|
|
19393
|
+
* that omit it stay valid). `prevEndMs` lets a backward frame-step hop the
|
|
19394
|
+
* small inter-segment cracks (durMs under-covers the span to the next
|
|
19395
|
+
* startMs by ~11-17 ms) instead of no-opping at a segment head.
|
|
19257
19396
|
*/
|
|
19258
19397
|
var LocateSegmentResultSchema = discriminatedUnion("kind", [object({
|
|
19259
19398
|
kind: literal("segment"),
|
|
@@ -19262,7 +19401,8 @@ var LocateSegmentResultSchema = discriminatedUnion("kind", [object({
|
|
|
19262
19401
|
bytes: number()
|
|
19263
19402
|
}), object({
|
|
19264
19403
|
kind: literal("gap"),
|
|
19265
|
-
nearestEdgeMs: number().nullable()
|
|
19404
|
+
nearestEdgeMs: number().nullable(),
|
|
19405
|
+
prevEndMs: number().nullable().optional()
|
|
19266
19406
|
})]);
|
|
19267
19407
|
/** Raw bytes of one finalized footage segment (read off disk on the recording node). */
|
|
19268
19408
|
var ReadSegmentBytesResultSchema = object({ data: _instanceof(Uint8Array) });
|
|
@@ -20831,6 +20971,12 @@ Object.freeze({
|
|
|
20831
20971
|
addonId: null,
|
|
20832
20972
|
access: "view"
|
|
20833
20973
|
},
|
|
20974
|
+
"deviceManager.getLinkedDevices": {
|
|
20975
|
+
capName: "device-manager",
|
|
20976
|
+
capScope: "system",
|
|
20977
|
+
addonId: null,
|
|
20978
|
+
access: "view"
|
|
20979
|
+
},
|
|
20834
20980
|
"deviceManager.getRoleDisplayDefaults": {
|
|
20835
20981
|
capName: "device-manager",
|
|
20836
20982
|
capScope: "system",
|
|
@@ -22385,6 +22531,12 @@ Object.freeze({
|
|
|
22385
22531
|
addonId: null,
|
|
22386
22532
|
access: "view"
|
|
22387
22533
|
},
|
|
22534
|
+
"pipelineAnalytics.getSensorEvents": {
|
|
22535
|
+
capName: "pipeline-analytics",
|
|
22536
|
+
capScope: "device",
|
|
22537
|
+
addonId: null,
|
|
22538
|
+
access: "view"
|
|
22539
|
+
},
|
|
22388
22540
|
"pipelineAnalytics.getTrack": {
|
|
22389
22541
|
capName: "pipeline-analytics",
|
|
22390
22542
|
capScope: "device",
|
|
@@ -22397,6 +22549,18 @@ Object.freeze({
|
|
|
22397
22549
|
addonId: null,
|
|
22398
22550
|
access: "view"
|
|
22399
22551
|
},
|
|
22552
|
+
"pipelineAnalytics.listEventKinds": {
|
|
22553
|
+
capName: "pipeline-analytics",
|
|
22554
|
+
capScope: "device",
|
|
22555
|
+
addonId: null,
|
|
22556
|
+
access: "view"
|
|
22557
|
+
},
|
|
22558
|
+
"pipelineAnalytics.listRecentTracks": {
|
|
22559
|
+
capName: "pipeline-analytics",
|
|
22560
|
+
capScope: "device",
|
|
22561
|
+
addonId: null,
|
|
22562
|
+
access: "view"
|
|
22563
|
+
},
|
|
22400
22564
|
"pipelineAnalytics.listTracks": {
|
|
22401
22565
|
capName: "pipeline-analytics",
|
|
22402
22566
|
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.24",
|
|
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",
|