@camstack/addon-decoder-nodeav 1.1.13 → 1.1.14
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/index.js +176 -12
- package/dist/index.mjs +176 -12
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
let node_crypto = require("node:crypto");
|
|
6
|
-
//#region ../types/dist/event-category-
|
|
6
|
+
//#region ../types/dist/event-category-H4AVePnn.mjs
|
|
7
7
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
8
8
|
EventCategory["SystemBoot"] = "system.boot";
|
|
9
9
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -153,6 +153,9 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
153
153
|
EventCategory["RecordingSegmentWritten"] = "recording.segment.written";
|
|
154
154
|
EventCategory["RecordingPolicyFallback"] = "recording.policy.fallback";
|
|
155
155
|
EventCategory["RecordingRetentionCompleted"] = "recording.retention.completed";
|
|
156
|
+
/** Runner-sampled scrub thumbnail (~1/5 s/camera). Telemetry (D8): a lost
|
|
157
|
+
* thumb is a scrub gap the recorder's keyframe backfill covers. */
|
|
158
|
+
EventCategory["RecordingThumbSampled"] = "recording.thumb-sampled";
|
|
156
159
|
EventCategory["DetectionEvent"] = "detection.event";
|
|
157
160
|
EventCategory["SessionTrackNew"] = "session.track.new";
|
|
158
161
|
EventCategory["SessionTrackExpired"] = "session.track.expired";
|
|
@@ -9829,7 +9832,7 @@ object({
|
|
|
9829
9832
|
deviceId: number(),
|
|
9830
9833
|
timestamp: number()
|
|
9831
9834
|
});
|
|
9832
|
-
DeviceType.Button;
|
|
9835
|
+
DeviceType.Button, DeviceType.Camera;
|
|
9833
9836
|
/**
|
|
9834
9837
|
* Enum-state sensor — a string value picked from a finite option set.
|
|
9835
9838
|
* Drives HA `sensor` entries with `state_class: enum` (HVAC action
|
|
@@ -14329,6 +14332,14 @@ var ConfigEntrySchema = object({
|
|
|
14329
14332
|
value: unknown(),
|
|
14330
14333
|
description: string().optional()
|
|
14331
14334
|
});
|
|
14335
|
+
var DeviceLinkModeSchema = _enum(["auto", "manual"]);
|
|
14336
|
+
/** One resolved linked device — the compact projection consumers need. */
|
|
14337
|
+
var LinkedDeviceSchema = object({
|
|
14338
|
+
deviceId: number(),
|
|
14339
|
+
name: string(),
|
|
14340
|
+
location: string().nullable(),
|
|
14341
|
+
features: array(string())
|
|
14342
|
+
});
|
|
14332
14343
|
var SavedDeviceRowSchema = object({
|
|
14333
14344
|
/** Numeric id reserved at allocateDeviceId time. */
|
|
14334
14345
|
id: number(),
|
|
@@ -14550,7 +14561,10 @@ method(object({
|
|
|
14550
14561
|
}), _void(), {
|
|
14551
14562
|
kind: "mutation",
|
|
14552
14563
|
auth: "admin"
|
|
14553
|
-
}), 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() }),
|
|
14564
|
+
}), 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({
|
|
14565
|
+
mode: DeviceLinkModeSchema,
|
|
14566
|
+
devices: array(LinkedDeviceSchema)
|
|
14567
|
+
})), method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
|
|
14554
14568
|
deviceId: number(),
|
|
14555
14569
|
values: record(string(), unknown())
|
|
14556
14570
|
}), object({ success: literal(true) }), {
|
|
@@ -15819,6 +15833,61 @@ var EventKindSchema = _enum([
|
|
|
15819
15833
|
"object",
|
|
15820
15834
|
"audio"
|
|
15821
15835
|
]);
|
|
15836
|
+
/**
|
|
15837
|
+
* Spatial filter for `listTracks` — the rect + polygon variants of the shared
|
|
15838
|
+
* MaskShape vocabulary (see `mask-shape.ts`). Coordinates are NORMALIZED 0..1
|
|
15839
|
+
* of the camera frame (top-left origin), matching the drawing-plane editor.
|
|
15840
|
+
*/
|
|
15841
|
+
var TrackZoneFilterSchema = discriminatedUnion("kind", [MaskRectShapeSchema, MaskPolygonShapeSchema]);
|
|
15842
|
+
/** Closed icon vocabulary so clients render a known glyph per kind. */
|
|
15843
|
+
var EventKindIconSchema = _enum([
|
|
15844
|
+
"motion",
|
|
15845
|
+
"audio",
|
|
15846
|
+
"person",
|
|
15847
|
+
"vehicle",
|
|
15848
|
+
"animal",
|
|
15849
|
+
"door",
|
|
15850
|
+
"pir",
|
|
15851
|
+
"smoke",
|
|
15852
|
+
"water",
|
|
15853
|
+
"button",
|
|
15854
|
+
"generic"
|
|
15855
|
+
]);
|
|
15856
|
+
var EventKindCategorySchema = _enum([
|
|
15857
|
+
"motion",
|
|
15858
|
+
"audio",
|
|
15859
|
+
"detection",
|
|
15860
|
+
"sensor",
|
|
15861
|
+
"custom"
|
|
15862
|
+
]);
|
|
15863
|
+
var EventKindDescriptorSchema = object({
|
|
15864
|
+
/** Stable kind id (e.g. 'motion', 'person', 'contact'). */
|
|
15865
|
+
kind: string(),
|
|
15866
|
+
label: string(),
|
|
15867
|
+
/** Hex color for timeline/legend rendering. */
|
|
15868
|
+
color: string(),
|
|
15869
|
+
icon: EventKindIconSchema,
|
|
15870
|
+
category: EventKindCategorySchema,
|
|
15871
|
+
/** Which cap + device contributes this kind. For built-ins the camera
|
|
15872
|
+
* itself; for sensor kinds the LINKED source device. */
|
|
15873
|
+
source: object({
|
|
15874
|
+
capName: string(),
|
|
15875
|
+
deviceId: number()
|
|
15876
|
+
})
|
|
15877
|
+
});
|
|
15878
|
+
var SensorEventSchema = object({
|
|
15879
|
+
id: string(),
|
|
15880
|
+
/** The CAMERA the event is attributed to (a sensor linked to N cameras
|
|
15881
|
+
* yields N rows, one per camera). */
|
|
15882
|
+
deviceId: number(),
|
|
15883
|
+
/** The linked sensor device whose state changed. */
|
|
15884
|
+
sourceDeviceId: number(),
|
|
15885
|
+
/** Event kind id — matches an `EventKindDescriptor.kind`. */
|
|
15886
|
+
kind: string(),
|
|
15887
|
+
/** Snapshot of the sensor cap's runtime-state slice at the change. */
|
|
15888
|
+
value: record(string(), unknown()).nullable(),
|
|
15889
|
+
timestamp: number()
|
|
15890
|
+
});
|
|
15822
15891
|
var TrackPositionSchema = object({
|
|
15823
15892
|
x: number(),
|
|
15824
15893
|
y: number(),
|
|
@@ -15832,6 +15901,30 @@ var TrackSnapshotSchema = object({
|
|
|
15832
15901
|
mediaKey: string()
|
|
15833
15902
|
});
|
|
15834
15903
|
/**
|
|
15904
|
+
* Normalized 0..1 trajectory envelope (min/max over every position bbox,
|
|
15905
|
+
* divided by the track's detection-frame dims), computed at persist time.
|
|
15906
|
+
* Absent when the frame dims were unknown when the track was persisted
|
|
15907
|
+
* (legacy rows / dims-less sources) and on active (in-RAM) tracks.
|
|
15908
|
+
*/
|
|
15909
|
+
var TrackEnvelopeSchema = object({
|
|
15910
|
+
minX: number(),
|
|
15911
|
+
minY: number(),
|
|
15912
|
+
maxX: number(),
|
|
15913
|
+
maxY: number()
|
|
15914
|
+
});
|
|
15915
|
+
/**
|
|
15916
|
+
* Row projection for track list queries. `full` (default) returns the
|
|
15917
|
+
* complete Track including the frame-rate `positions[]` history and the
|
|
15918
|
+
* `snapshots[]` references — megabytes across a page of tracks. `slim`
|
|
15919
|
+
* keeps every scalar the list surfaces actually render (ids, class(es),
|
|
15920
|
+
* label / audioLabels / importance enrichment, firstSeen/lastSeen, state,
|
|
15921
|
+
* zonesVisited, bestEventId, envelope) and returns `positions` /
|
|
15922
|
+
* `snapshots` as EMPTY arrays — detail views re-fetch the full row via
|
|
15923
|
+
* `getTrack`. Mirrors the event-store `projection` convention
|
|
15924
|
+
* (`getObjectEvents` et al.).
|
|
15925
|
+
*/
|
|
15926
|
+
var TrackProjectionSchema = _enum(["full", "slim"]);
|
|
15927
|
+
/**
|
|
15835
15928
|
* One audio-classification label heard on the track's camera while the
|
|
15836
15929
|
* track was alive, aggregated per label. An "episode" is one persisted
|
|
15837
15930
|
* audio event (the confident-classification path: score ≥ the device's
|
|
@@ -15882,7 +15975,11 @@ var TrackSchema = object({
|
|
|
15882
15975
|
/** Audio-classification labels heard on the camera during the track's
|
|
15883
15976
|
* life (score ≥ device `classificationMinScore`), aggregated per label.
|
|
15884
15977
|
* Absent on legacy rows / tracks with no confident audio. */
|
|
15885
|
-
audioLabels: array(TrackAudioLabelSchema).readonly().optional()
|
|
15978
|
+
audioLabels: array(TrackAudioLabelSchema).readonly().optional(),
|
|
15979
|
+
/** Normalized 0..1 trajectory envelope (see {@link TrackEnvelopeSchema}).
|
|
15980
|
+
* Populated from the persisted envelope columns on historical reads;
|
|
15981
|
+
* absent on legacy rows, dims-less tracks and active (in-RAM) tracks. */
|
|
15982
|
+
envelope: TrackEnvelopeSchema.optional()
|
|
15886
15983
|
});
|
|
15887
15984
|
var BaseEventFields = {
|
|
15888
15985
|
id: string(),
|
|
@@ -15992,11 +16089,13 @@ var MediaFileSchema = object({
|
|
|
15992
16089
|
sizeBytes: number(),
|
|
15993
16090
|
timestamp: number()
|
|
15994
16091
|
});
|
|
16092
|
+
var DEFAULT_EVENT_QUERY_LIMIT = 1e3;
|
|
16093
|
+
var MAX_EVENT_QUERY_LIMIT = 5e3;
|
|
15995
16094
|
var DeviceEventQueryInput = object({
|
|
15996
16095
|
deviceId: number(),
|
|
15997
16096
|
since: number().optional(),
|
|
15998
16097
|
until: number().optional(),
|
|
15999
|
-
limit: number().int().min(1).max(
|
|
16098
|
+
limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT),
|
|
16000
16099
|
/** `slim` drops heavy JSON fields (regions/bbox/zones) and carries an
|
|
16001
16100
|
* optional `mediaUrl` (populated by B5). `full` (default) keeps today's
|
|
16002
16101
|
* exact behaviour. Callers may omit this field — the store defaults to
|
|
@@ -16004,6 +16103,27 @@ var DeviceEventQueryInput = object({
|
|
|
16004
16103
|
projection: _enum(["full", "slim"]).optional()
|
|
16005
16104
|
});
|
|
16006
16105
|
var ObjectEventQueryInput = DeviceEventQueryInput.extend({ classFilter: string().optional() });
|
|
16106
|
+
var RecentTracksQueryInput = object({
|
|
16107
|
+
/** Devices to merge. An empty array yields `{ tracks: [], nextCursor: null }`. */
|
|
16108
|
+
deviceIds: array(number()),
|
|
16109
|
+
/** Window lower bound on `lastSeen` (inclusive). */
|
|
16110
|
+
since: number().optional(),
|
|
16111
|
+
/** Window upper bound on `lastSeen` (inclusive). */
|
|
16112
|
+
until: number().optional(),
|
|
16113
|
+
/** Page size. Default 200, max 1000. */
|
|
16114
|
+
limit: number().int().min(1).max(1e3).default(200),
|
|
16115
|
+
/** Opaque continuation cursor from a previous page's `nextCursor`.
|
|
16116
|
+
* Encodes the (lastSeen, trackId) sort position — treat as opaque. */
|
|
16117
|
+
cursor: string().optional(),
|
|
16118
|
+
/** See {@link TrackProjectionSchema}. Default `full`. */
|
|
16119
|
+
projection: TrackProjectionSchema.optional()
|
|
16120
|
+
});
|
|
16121
|
+
var RecentTracksPageSchema = object({
|
|
16122
|
+
/** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
|
|
16123
|
+
tracks: array(TrackSchema).readonly(),
|
|
16124
|
+
/** Cursor for the next page, or null when this page is the last. */
|
|
16125
|
+
nextCursor: string().nullable()
|
|
16126
|
+
});
|
|
16007
16127
|
var KeyEventQueryInput = object({
|
|
16008
16128
|
deviceId: number(),
|
|
16009
16129
|
/** Window lower bound (track firstSeen ≥ since). */
|
|
@@ -16086,11 +16206,25 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
16086
16206
|
deviceId: number(),
|
|
16087
16207
|
since: number().optional(),
|
|
16088
16208
|
until: number().optional(),
|
|
16089
|
-
limit: number().optional()
|
|
16090
|
-
|
|
16091
|
-
|
|
16092
|
-
|
|
16093
|
-
|
|
16209
|
+
limit: number().optional(),
|
|
16210
|
+
/** Spatial filter — only tracks whose trajectory intersects the zone
|
|
16211
|
+
* (normalized 0..1 rect or polygon). SQL-prefiltered on the persisted
|
|
16212
|
+
* envelope columns, then precisely tested per position. Tracks with
|
|
16213
|
+
* an unknown envelope (no frame dims at persist time) always match. */
|
|
16214
|
+
zone: TrackZoneFilterSchema.optional(),
|
|
16215
|
+
/** See {@link TrackProjectionSchema}. Default `full` (backward
|
|
16216
|
+
* compatible — omitting the field keeps today's exact behaviour). */
|
|
16217
|
+
projection: TrackProjectionSchema.optional()
|
|
16218
|
+
}), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
|
|
16219
|
+
kind: "mutation",
|
|
16220
|
+
auth: "admin"
|
|
16221
|
+
}), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(object({ deviceId: number() }), array(EventKindDescriptorSchema).readonly()), method(object({
|
|
16222
|
+
deviceId: number(),
|
|
16223
|
+
since: number().optional(),
|
|
16224
|
+
until: number().optional(),
|
|
16225
|
+
kinds: array(string()).optional(),
|
|
16226
|
+
limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
|
|
16227
|
+
}), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
|
|
16094
16228
|
deviceId: number(),
|
|
16095
16229
|
since: number(),
|
|
16096
16230
|
until: number(),
|
|
@@ -19291,7 +19425,12 @@ var RecordingStorageUsageSchema = object({
|
|
|
19291
19425
|
/**
|
|
19292
19426
|
* Result of locating footage at a wall-clock instant for one device/profile.
|
|
19293
19427
|
* `segment` carries the covering segment's window; `gap` reports the forward
|
|
19294
|
-
* nearest covered edge (`null` past the end of footage / when none exists)
|
|
19428
|
+
* nearest covered edge (`null` past the end of footage / when none exists)
|
|
19429
|
+
* and the backward covered edge `prevEndMs` (exclusive end of the nearest
|
|
19430
|
+
* footage behind the epoch; `null` when none — optional so older providers
|
|
19431
|
+
* that omit it stay valid). `prevEndMs` lets a backward frame-step hop the
|
|
19432
|
+
* small inter-segment cracks (durMs under-covers the span to the next
|
|
19433
|
+
* startMs by ~11-17 ms) instead of no-opping at a segment head.
|
|
19295
19434
|
*/
|
|
19296
19435
|
var LocateSegmentResultSchema = discriminatedUnion("kind", [object({
|
|
19297
19436
|
kind: literal("segment"),
|
|
@@ -19300,7 +19439,8 @@ var LocateSegmentResultSchema = discriminatedUnion("kind", [object({
|
|
|
19300
19439
|
bytes: number()
|
|
19301
19440
|
}), object({
|
|
19302
19441
|
kind: literal("gap"),
|
|
19303
|
-
nearestEdgeMs: number().nullable()
|
|
19442
|
+
nearestEdgeMs: number().nullable(),
|
|
19443
|
+
prevEndMs: number().nullable().optional()
|
|
19304
19444
|
})]);
|
|
19305
19445
|
/** Raw bytes of one finalized footage segment (read off disk on the recording node). */
|
|
19306
19446
|
var ReadSegmentBytesResultSchema = object({ data: _instanceof(Uint8Array) });
|
|
@@ -20869,6 +21009,12 @@ Object.freeze({
|
|
|
20869
21009
|
addonId: null,
|
|
20870
21010
|
access: "view"
|
|
20871
21011
|
},
|
|
21012
|
+
"deviceManager.getLinkedDevices": {
|
|
21013
|
+
capName: "device-manager",
|
|
21014
|
+
capScope: "system",
|
|
21015
|
+
addonId: null,
|
|
21016
|
+
access: "view"
|
|
21017
|
+
},
|
|
20872
21018
|
"deviceManager.getRoleDisplayDefaults": {
|
|
20873
21019
|
capName: "device-manager",
|
|
20874
21020
|
capScope: "system",
|
|
@@ -22423,6 +22569,12 @@ Object.freeze({
|
|
|
22423
22569
|
addonId: null,
|
|
22424
22570
|
access: "view"
|
|
22425
22571
|
},
|
|
22572
|
+
"pipelineAnalytics.getSensorEvents": {
|
|
22573
|
+
capName: "pipeline-analytics",
|
|
22574
|
+
capScope: "device",
|
|
22575
|
+
addonId: null,
|
|
22576
|
+
access: "view"
|
|
22577
|
+
},
|
|
22426
22578
|
"pipelineAnalytics.getTrack": {
|
|
22427
22579
|
capName: "pipeline-analytics",
|
|
22428
22580
|
capScope: "device",
|
|
@@ -22435,6 +22587,18 @@ Object.freeze({
|
|
|
22435
22587
|
addonId: null,
|
|
22436
22588
|
access: "view"
|
|
22437
22589
|
},
|
|
22590
|
+
"pipelineAnalytics.listEventKinds": {
|
|
22591
|
+
capName: "pipeline-analytics",
|
|
22592
|
+
capScope: "device",
|
|
22593
|
+
addonId: null,
|
|
22594
|
+
access: "view"
|
|
22595
|
+
},
|
|
22596
|
+
"pipelineAnalytics.listRecentTracks": {
|
|
22597
|
+
capName: "pipeline-analytics",
|
|
22598
|
+
capScope: "device",
|
|
22599
|
+
addonId: null,
|
|
22600
|
+
access: "view"
|
|
22601
|
+
},
|
|
22438
22602
|
"pipelineAnalytics.listTracks": {
|
|
22439
22603
|
capName: "pipeline-analytics",
|
|
22440
22604
|
capScope: "device",
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { randomUUID } from "node:crypto";
|
|
2
|
-
//#region ../types/dist/event-category-
|
|
2
|
+
//#region ../types/dist/event-category-H4AVePnn.mjs
|
|
3
3
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
4
4
|
EventCategory["SystemBoot"] = "system.boot";
|
|
5
5
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -149,6 +149,9 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
149
149
|
EventCategory["RecordingSegmentWritten"] = "recording.segment.written";
|
|
150
150
|
EventCategory["RecordingPolicyFallback"] = "recording.policy.fallback";
|
|
151
151
|
EventCategory["RecordingRetentionCompleted"] = "recording.retention.completed";
|
|
152
|
+
/** Runner-sampled scrub thumbnail (~1/5 s/camera). Telemetry (D8): a lost
|
|
153
|
+
* thumb is a scrub gap the recorder's keyframe backfill covers. */
|
|
154
|
+
EventCategory["RecordingThumbSampled"] = "recording.thumb-sampled";
|
|
152
155
|
EventCategory["DetectionEvent"] = "detection.event";
|
|
153
156
|
EventCategory["SessionTrackNew"] = "session.track.new";
|
|
154
157
|
EventCategory["SessionTrackExpired"] = "session.track.expired";
|
|
@@ -9825,7 +9828,7 @@ object({
|
|
|
9825
9828
|
deviceId: number(),
|
|
9826
9829
|
timestamp: number()
|
|
9827
9830
|
});
|
|
9828
|
-
DeviceType.Button;
|
|
9831
|
+
DeviceType.Button, DeviceType.Camera;
|
|
9829
9832
|
/**
|
|
9830
9833
|
* Enum-state sensor — a string value picked from a finite option set.
|
|
9831
9834
|
* Drives HA `sensor` entries with `state_class: enum` (HVAC action
|
|
@@ -14325,6 +14328,14 @@ var ConfigEntrySchema = object({
|
|
|
14325
14328
|
value: unknown(),
|
|
14326
14329
|
description: string().optional()
|
|
14327
14330
|
});
|
|
14331
|
+
var DeviceLinkModeSchema = _enum(["auto", "manual"]);
|
|
14332
|
+
/** One resolved linked device — the compact projection consumers need. */
|
|
14333
|
+
var LinkedDeviceSchema = object({
|
|
14334
|
+
deviceId: number(),
|
|
14335
|
+
name: string(),
|
|
14336
|
+
location: string().nullable(),
|
|
14337
|
+
features: array(string())
|
|
14338
|
+
});
|
|
14328
14339
|
var SavedDeviceRowSchema = object({
|
|
14329
14340
|
/** Numeric id reserved at allocateDeviceId time. */
|
|
14330
14341
|
id: number(),
|
|
@@ -14546,7 +14557,10 @@ method(object({
|
|
|
14546
14557
|
}), _void(), {
|
|
14547
14558
|
kind: "mutation",
|
|
14548
14559
|
auth: "admin"
|
|
14549
|
-
}), 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() }),
|
|
14560
|
+
}), 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({
|
|
14561
|
+
mode: DeviceLinkModeSchema,
|
|
14562
|
+
devices: array(LinkedDeviceSchema)
|
|
14563
|
+
})), method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
|
|
14550
14564
|
deviceId: number(),
|
|
14551
14565
|
values: record(string(), unknown())
|
|
14552
14566
|
}), object({ success: literal(true) }), {
|
|
@@ -15815,6 +15829,61 @@ var EventKindSchema = _enum([
|
|
|
15815
15829
|
"object",
|
|
15816
15830
|
"audio"
|
|
15817
15831
|
]);
|
|
15832
|
+
/**
|
|
15833
|
+
* Spatial filter for `listTracks` — the rect + polygon variants of the shared
|
|
15834
|
+
* MaskShape vocabulary (see `mask-shape.ts`). Coordinates are NORMALIZED 0..1
|
|
15835
|
+
* of the camera frame (top-left origin), matching the drawing-plane editor.
|
|
15836
|
+
*/
|
|
15837
|
+
var TrackZoneFilterSchema = discriminatedUnion("kind", [MaskRectShapeSchema, MaskPolygonShapeSchema]);
|
|
15838
|
+
/** Closed icon vocabulary so clients render a known glyph per kind. */
|
|
15839
|
+
var EventKindIconSchema = _enum([
|
|
15840
|
+
"motion",
|
|
15841
|
+
"audio",
|
|
15842
|
+
"person",
|
|
15843
|
+
"vehicle",
|
|
15844
|
+
"animal",
|
|
15845
|
+
"door",
|
|
15846
|
+
"pir",
|
|
15847
|
+
"smoke",
|
|
15848
|
+
"water",
|
|
15849
|
+
"button",
|
|
15850
|
+
"generic"
|
|
15851
|
+
]);
|
|
15852
|
+
var EventKindCategorySchema = _enum([
|
|
15853
|
+
"motion",
|
|
15854
|
+
"audio",
|
|
15855
|
+
"detection",
|
|
15856
|
+
"sensor",
|
|
15857
|
+
"custom"
|
|
15858
|
+
]);
|
|
15859
|
+
var EventKindDescriptorSchema = object({
|
|
15860
|
+
/** Stable kind id (e.g. 'motion', 'person', 'contact'). */
|
|
15861
|
+
kind: string(),
|
|
15862
|
+
label: string(),
|
|
15863
|
+
/** Hex color for timeline/legend rendering. */
|
|
15864
|
+
color: string(),
|
|
15865
|
+
icon: EventKindIconSchema,
|
|
15866
|
+
category: EventKindCategorySchema,
|
|
15867
|
+
/** Which cap + device contributes this kind. For built-ins the camera
|
|
15868
|
+
* itself; for sensor kinds the LINKED source device. */
|
|
15869
|
+
source: object({
|
|
15870
|
+
capName: string(),
|
|
15871
|
+
deviceId: number()
|
|
15872
|
+
})
|
|
15873
|
+
});
|
|
15874
|
+
var SensorEventSchema = object({
|
|
15875
|
+
id: string(),
|
|
15876
|
+
/** The CAMERA the event is attributed to (a sensor linked to N cameras
|
|
15877
|
+
* yields N rows, one per camera). */
|
|
15878
|
+
deviceId: number(),
|
|
15879
|
+
/** The linked sensor device whose state changed. */
|
|
15880
|
+
sourceDeviceId: number(),
|
|
15881
|
+
/** Event kind id — matches an `EventKindDescriptor.kind`. */
|
|
15882
|
+
kind: string(),
|
|
15883
|
+
/** Snapshot of the sensor cap's runtime-state slice at the change. */
|
|
15884
|
+
value: record(string(), unknown()).nullable(),
|
|
15885
|
+
timestamp: number()
|
|
15886
|
+
});
|
|
15818
15887
|
var TrackPositionSchema = object({
|
|
15819
15888
|
x: number(),
|
|
15820
15889
|
y: number(),
|
|
@@ -15828,6 +15897,30 @@ var TrackSnapshotSchema = object({
|
|
|
15828
15897
|
mediaKey: string()
|
|
15829
15898
|
});
|
|
15830
15899
|
/**
|
|
15900
|
+
* Normalized 0..1 trajectory envelope (min/max over every position bbox,
|
|
15901
|
+
* divided by the track's detection-frame dims), computed at persist time.
|
|
15902
|
+
* Absent when the frame dims were unknown when the track was persisted
|
|
15903
|
+
* (legacy rows / dims-less sources) and on active (in-RAM) tracks.
|
|
15904
|
+
*/
|
|
15905
|
+
var TrackEnvelopeSchema = object({
|
|
15906
|
+
minX: number(),
|
|
15907
|
+
minY: number(),
|
|
15908
|
+
maxX: number(),
|
|
15909
|
+
maxY: number()
|
|
15910
|
+
});
|
|
15911
|
+
/**
|
|
15912
|
+
* Row projection for track list queries. `full` (default) returns the
|
|
15913
|
+
* complete Track including the frame-rate `positions[]` history and the
|
|
15914
|
+
* `snapshots[]` references — megabytes across a page of tracks. `slim`
|
|
15915
|
+
* keeps every scalar the list surfaces actually render (ids, class(es),
|
|
15916
|
+
* label / audioLabels / importance enrichment, firstSeen/lastSeen, state,
|
|
15917
|
+
* zonesVisited, bestEventId, envelope) and returns `positions` /
|
|
15918
|
+
* `snapshots` as EMPTY arrays — detail views re-fetch the full row via
|
|
15919
|
+
* `getTrack`. Mirrors the event-store `projection` convention
|
|
15920
|
+
* (`getObjectEvents` et al.).
|
|
15921
|
+
*/
|
|
15922
|
+
var TrackProjectionSchema = _enum(["full", "slim"]);
|
|
15923
|
+
/**
|
|
15831
15924
|
* One audio-classification label heard on the track's camera while the
|
|
15832
15925
|
* track was alive, aggregated per label. An "episode" is one persisted
|
|
15833
15926
|
* audio event (the confident-classification path: score ≥ the device's
|
|
@@ -15878,7 +15971,11 @@ var TrackSchema = object({
|
|
|
15878
15971
|
/** Audio-classification labels heard on the camera during the track's
|
|
15879
15972
|
* life (score ≥ device `classificationMinScore`), aggregated per label.
|
|
15880
15973
|
* Absent on legacy rows / tracks with no confident audio. */
|
|
15881
|
-
audioLabels: array(TrackAudioLabelSchema).readonly().optional()
|
|
15974
|
+
audioLabels: array(TrackAudioLabelSchema).readonly().optional(),
|
|
15975
|
+
/** Normalized 0..1 trajectory envelope (see {@link TrackEnvelopeSchema}).
|
|
15976
|
+
* Populated from the persisted envelope columns on historical reads;
|
|
15977
|
+
* absent on legacy rows, dims-less tracks and active (in-RAM) tracks. */
|
|
15978
|
+
envelope: TrackEnvelopeSchema.optional()
|
|
15882
15979
|
});
|
|
15883
15980
|
var BaseEventFields = {
|
|
15884
15981
|
id: string(),
|
|
@@ -15988,11 +16085,13 @@ var MediaFileSchema = object({
|
|
|
15988
16085
|
sizeBytes: number(),
|
|
15989
16086
|
timestamp: number()
|
|
15990
16087
|
});
|
|
16088
|
+
var DEFAULT_EVENT_QUERY_LIMIT = 1e3;
|
|
16089
|
+
var MAX_EVENT_QUERY_LIMIT = 5e3;
|
|
15991
16090
|
var DeviceEventQueryInput = object({
|
|
15992
16091
|
deviceId: number(),
|
|
15993
16092
|
since: number().optional(),
|
|
15994
16093
|
until: number().optional(),
|
|
15995
|
-
limit: number().int().min(1).max(
|
|
16094
|
+
limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT),
|
|
15996
16095
|
/** `slim` drops heavy JSON fields (regions/bbox/zones) and carries an
|
|
15997
16096
|
* optional `mediaUrl` (populated by B5). `full` (default) keeps today's
|
|
15998
16097
|
* exact behaviour. Callers may omit this field — the store defaults to
|
|
@@ -16000,6 +16099,27 @@ var DeviceEventQueryInput = object({
|
|
|
16000
16099
|
projection: _enum(["full", "slim"]).optional()
|
|
16001
16100
|
});
|
|
16002
16101
|
var ObjectEventQueryInput = DeviceEventQueryInput.extend({ classFilter: string().optional() });
|
|
16102
|
+
var RecentTracksQueryInput = object({
|
|
16103
|
+
/** Devices to merge. An empty array yields `{ tracks: [], nextCursor: null }`. */
|
|
16104
|
+
deviceIds: array(number()),
|
|
16105
|
+
/** Window lower bound on `lastSeen` (inclusive). */
|
|
16106
|
+
since: number().optional(),
|
|
16107
|
+
/** Window upper bound on `lastSeen` (inclusive). */
|
|
16108
|
+
until: number().optional(),
|
|
16109
|
+
/** Page size. Default 200, max 1000. */
|
|
16110
|
+
limit: number().int().min(1).max(1e3).default(200),
|
|
16111
|
+
/** Opaque continuation cursor from a previous page's `nextCursor`.
|
|
16112
|
+
* Encodes the (lastSeen, trackId) sort position — treat as opaque. */
|
|
16113
|
+
cursor: string().optional(),
|
|
16114
|
+
/** See {@link TrackProjectionSchema}. Default `full`. */
|
|
16115
|
+
projection: TrackProjectionSchema.optional()
|
|
16116
|
+
});
|
|
16117
|
+
var RecentTracksPageSchema = object({
|
|
16118
|
+
/** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
|
|
16119
|
+
tracks: array(TrackSchema).readonly(),
|
|
16120
|
+
/** Cursor for the next page, or null when this page is the last. */
|
|
16121
|
+
nextCursor: string().nullable()
|
|
16122
|
+
});
|
|
16003
16123
|
var KeyEventQueryInput = object({
|
|
16004
16124
|
deviceId: number(),
|
|
16005
16125
|
/** Window lower bound (track firstSeen ≥ since). */
|
|
@@ -16082,11 +16202,25 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
16082
16202
|
deviceId: number(),
|
|
16083
16203
|
since: number().optional(),
|
|
16084
16204
|
until: number().optional(),
|
|
16085
|
-
limit: number().optional()
|
|
16086
|
-
|
|
16087
|
-
|
|
16088
|
-
|
|
16089
|
-
|
|
16205
|
+
limit: number().optional(),
|
|
16206
|
+
/** Spatial filter — only tracks whose trajectory intersects the zone
|
|
16207
|
+
* (normalized 0..1 rect or polygon). SQL-prefiltered on the persisted
|
|
16208
|
+
* envelope columns, then precisely tested per position. Tracks with
|
|
16209
|
+
* an unknown envelope (no frame dims at persist time) always match. */
|
|
16210
|
+
zone: TrackZoneFilterSchema.optional(),
|
|
16211
|
+
/** See {@link TrackProjectionSchema}. Default `full` (backward
|
|
16212
|
+
* compatible — omitting the field keeps today's exact behaviour). */
|
|
16213
|
+
projection: TrackProjectionSchema.optional()
|
|
16214
|
+
}), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
|
|
16215
|
+
kind: "mutation",
|
|
16216
|
+
auth: "admin"
|
|
16217
|
+
}), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(object({ deviceId: number() }), array(EventKindDescriptorSchema).readonly()), method(object({
|
|
16218
|
+
deviceId: number(),
|
|
16219
|
+
since: number().optional(),
|
|
16220
|
+
until: number().optional(),
|
|
16221
|
+
kinds: array(string()).optional(),
|
|
16222
|
+
limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
|
|
16223
|
+
}), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
|
|
16090
16224
|
deviceId: number(),
|
|
16091
16225
|
since: number(),
|
|
16092
16226
|
until: number(),
|
|
@@ -19287,7 +19421,12 @@ var RecordingStorageUsageSchema = object({
|
|
|
19287
19421
|
/**
|
|
19288
19422
|
* Result of locating footage at a wall-clock instant for one device/profile.
|
|
19289
19423
|
* `segment` carries the covering segment's window; `gap` reports the forward
|
|
19290
|
-
* nearest covered edge (`null` past the end of footage / when none exists)
|
|
19424
|
+
* nearest covered edge (`null` past the end of footage / when none exists)
|
|
19425
|
+
* and the backward covered edge `prevEndMs` (exclusive end of the nearest
|
|
19426
|
+
* footage behind the epoch; `null` when none — optional so older providers
|
|
19427
|
+
* that omit it stay valid). `prevEndMs` lets a backward frame-step hop the
|
|
19428
|
+
* small inter-segment cracks (durMs under-covers the span to the next
|
|
19429
|
+
* startMs by ~11-17 ms) instead of no-opping at a segment head.
|
|
19291
19430
|
*/
|
|
19292
19431
|
var LocateSegmentResultSchema = discriminatedUnion("kind", [object({
|
|
19293
19432
|
kind: literal("segment"),
|
|
@@ -19296,7 +19435,8 @@ var LocateSegmentResultSchema = discriminatedUnion("kind", [object({
|
|
|
19296
19435
|
bytes: number()
|
|
19297
19436
|
}), object({
|
|
19298
19437
|
kind: literal("gap"),
|
|
19299
|
-
nearestEdgeMs: number().nullable()
|
|
19438
|
+
nearestEdgeMs: number().nullable(),
|
|
19439
|
+
prevEndMs: number().nullable().optional()
|
|
19300
19440
|
})]);
|
|
19301
19441
|
/** Raw bytes of one finalized footage segment (read off disk on the recording node). */
|
|
19302
19442
|
var ReadSegmentBytesResultSchema = object({ data: _instanceof(Uint8Array) });
|
|
@@ -20865,6 +21005,12 @@ Object.freeze({
|
|
|
20865
21005
|
addonId: null,
|
|
20866
21006
|
access: "view"
|
|
20867
21007
|
},
|
|
21008
|
+
"deviceManager.getLinkedDevices": {
|
|
21009
|
+
capName: "device-manager",
|
|
21010
|
+
capScope: "system",
|
|
21011
|
+
addonId: null,
|
|
21012
|
+
access: "view"
|
|
21013
|
+
},
|
|
20868
21014
|
"deviceManager.getRoleDisplayDefaults": {
|
|
20869
21015
|
capName: "device-manager",
|
|
20870
21016
|
capScope: "system",
|
|
@@ -22419,6 +22565,12 @@ Object.freeze({
|
|
|
22419
22565
|
addonId: null,
|
|
22420
22566
|
access: "view"
|
|
22421
22567
|
},
|
|
22568
|
+
"pipelineAnalytics.getSensorEvents": {
|
|
22569
|
+
capName: "pipeline-analytics",
|
|
22570
|
+
capScope: "device",
|
|
22571
|
+
addonId: null,
|
|
22572
|
+
access: "view"
|
|
22573
|
+
},
|
|
22422
22574
|
"pipelineAnalytics.getTrack": {
|
|
22423
22575
|
capName: "pipeline-analytics",
|
|
22424
22576
|
capScope: "device",
|
|
@@ -22431,6 +22583,18 @@ Object.freeze({
|
|
|
22431
22583
|
addonId: null,
|
|
22432
22584
|
access: "view"
|
|
22433
22585
|
},
|
|
22586
|
+
"pipelineAnalytics.listEventKinds": {
|
|
22587
|
+
capName: "pipeline-analytics",
|
|
22588
|
+
capScope: "device",
|
|
22589
|
+
addonId: null,
|
|
22590
|
+
access: "view"
|
|
22591
|
+
},
|
|
22592
|
+
"pipelineAnalytics.listRecentTracks": {
|
|
22593
|
+
capName: "pipeline-analytics",
|
|
22594
|
+
capScope: "device",
|
|
22595
|
+
addonId: null,
|
|
22596
|
+
access: "view"
|
|
22597
|
+
},
|
|
22434
22598
|
"pipelineAnalytics.listTracks": {
|
|
22435
22599
|
capName: "pipeline-analytics",
|
|
22436
22600
|
capScope: "device",
|