@camstack/addon-export-hap 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/export-hap.addon.js +176 -12
- package/dist/export-hap.addon.mjs +176 -12
- package/package.json +1 -1
package/dist/export-hap.addon.js
CHANGED
|
@@ -35,7 +35,7 @@ let node_fs_promises = require("node:fs/promises");
|
|
|
35
35
|
node_fs_promises = __toESM(node_fs_promises);
|
|
36
36
|
let node_dgram = require("node:dgram");
|
|
37
37
|
let node_os = require("node:os");
|
|
38
|
-
//#region ../types/dist/event-category-
|
|
38
|
+
//#region ../types/dist/event-category-H4AVePnn.mjs
|
|
39
39
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
40
40
|
EventCategory["SystemBoot"] = "system.boot";
|
|
41
41
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -185,6 +185,9 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
185
185
|
EventCategory["RecordingSegmentWritten"] = "recording.segment.written";
|
|
186
186
|
EventCategory["RecordingPolicyFallback"] = "recording.policy.fallback";
|
|
187
187
|
EventCategory["RecordingRetentionCompleted"] = "recording.retention.completed";
|
|
188
|
+
/** Runner-sampled scrub thumbnail (~1/5 s/camera). Telemetry (D8): a lost
|
|
189
|
+
* thumb is a scrub gap the recorder's keyframe backfill covers. */
|
|
190
|
+
EventCategory["RecordingThumbSampled"] = "recording.thumb-sampled";
|
|
188
191
|
EventCategory["DetectionEvent"] = "detection.event";
|
|
189
192
|
EventCategory["SessionTrackNew"] = "session.track.new";
|
|
190
193
|
EventCategory["SessionTrackExpired"] = "session.track.expired";
|
|
@@ -9903,7 +9906,7 @@ object({
|
|
|
9903
9906
|
deviceId: number(),
|
|
9904
9907
|
timestamp: number()
|
|
9905
9908
|
});
|
|
9906
|
-
DeviceType.Button;
|
|
9909
|
+
DeviceType.Button, DeviceType.Camera;
|
|
9907
9910
|
/**
|
|
9908
9911
|
* Enum-state sensor — a string value picked from a finite option set.
|
|
9909
9912
|
* Drives HA `sensor` entries with `state_class: enum` (HVAC action
|
|
@@ -14298,6 +14301,14 @@ var ConfigEntrySchema = object({
|
|
|
14298
14301
|
value: unknown(),
|
|
14299
14302
|
description: string().optional()
|
|
14300
14303
|
});
|
|
14304
|
+
var DeviceLinkModeSchema = _enum(["auto", "manual"]);
|
|
14305
|
+
/** One resolved linked device — the compact projection consumers need. */
|
|
14306
|
+
var LinkedDeviceSchema = object({
|
|
14307
|
+
deviceId: number(),
|
|
14308
|
+
name: string(),
|
|
14309
|
+
location: string().nullable(),
|
|
14310
|
+
features: array(string())
|
|
14311
|
+
});
|
|
14301
14312
|
var SavedDeviceRowSchema = object({
|
|
14302
14313
|
/** Numeric id reserved at allocateDeviceId time. */
|
|
14303
14314
|
id: number(),
|
|
@@ -14519,7 +14530,10 @@ method(object({
|
|
|
14519
14530
|
}), _void(), {
|
|
14520
14531
|
kind: "mutation",
|
|
14521
14532
|
auth: "admin"
|
|
14522
|
-
}), 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() }),
|
|
14533
|
+
}), 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({
|
|
14534
|
+
mode: DeviceLinkModeSchema,
|
|
14535
|
+
devices: array(LinkedDeviceSchema)
|
|
14536
|
+
})), method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
|
|
14523
14537
|
deviceId: number(),
|
|
14524
14538
|
values: record(string(), unknown())
|
|
14525
14539
|
}), object({ success: literal(true) }), {
|
|
@@ -15788,6 +15802,61 @@ var EventKindSchema = _enum([
|
|
|
15788
15802
|
"object",
|
|
15789
15803
|
"audio"
|
|
15790
15804
|
]);
|
|
15805
|
+
/**
|
|
15806
|
+
* Spatial filter for `listTracks` — the rect + polygon variants of the shared
|
|
15807
|
+
* MaskShape vocabulary (see `mask-shape.ts`). Coordinates are NORMALIZED 0..1
|
|
15808
|
+
* of the camera frame (top-left origin), matching the drawing-plane editor.
|
|
15809
|
+
*/
|
|
15810
|
+
var TrackZoneFilterSchema = discriminatedUnion("kind", [MaskRectShapeSchema, MaskPolygonShapeSchema]);
|
|
15811
|
+
/** Closed icon vocabulary so clients render a known glyph per kind. */
|
|
15812
|
+
var EventKindIconSchema = _enum([
|
|
15813
|
+
"motion",
|
|
15814
|
+
"audio",
|
|
15815
|
+
"person",
|
|
15816
|
+
"vehicle",
|
|
15817
|
+
"animal",
|
|
15818
|
+
"door",
|
|
15819
|
+
"pir",
|
|
15820
|
+
"smoke",
|
|
15821
|
+
"water",
|
|
15822
|
+
"button",
|
|
15823
|
+
"generic"
|
|
15824
|
+
]);
|
|
15825
|
+
var EventKindCategorySchema = _enum([
|
|
15826
|
+
"motion",
|
|
15827
|
+
"audio",
|
|
15828
|
+
"detection",
|
|
15829
|
+
"sensor",
|
|
15830
|
+
"custom"
|
|
15831
|
+
]);
|
|
15832
|
+
var EventKindDescriptorSchema = object({
|
|
15833
|
+
/** Stable kind id (e.g. 'motion', 'person', 'contact'). */
|
|
15834
|
+
kind: string(),
|
|
15835
|
+
label: string(),
|
|
15836
|
+
/** Hex color for timeline/legend rendering. */
|
|
15837
|
+
color: string(),
|
|
15838
|
+
icon: EventKindIconSchema,
|
|
15839
|
+
category: EventKindCategorySchema,
|
|
15840
|
+
/** Which cap + device contributes this kind. For built-ins the camera
|
|
15841
|
+
* itself; for sensor kinds the LINKED source device. */
|
|
15842
|
+
source: object({
|
|
15843
|
+
capName: string(),
|
|
15844
|
+
deviceId: number()
|
|
15845
|
+
})
|
|
15846
|
+
});
|
|
15847
|
+
var SensorEventSchema = object({
|
|
15848
|
+
id: string(),
|
|
15849
|
+
/** The CAMERA the event is attributed to (a sensor linked to N cameras
|
|
15850
|
+
* yields N rows, one per camera). */
|
|
15851
|
+
deviceId: number(),
|
|
15852
|
+
/** The linked sensor device whose state changed. */
|
|
15853
|
+
sourceDeviceId: number(),
|
|
15854
|
+
/** Event kind id — matches an `EventKindDescriptor.kind`. */
|
|
15855
|
+
kind: string(),
|
|
15856
|
+
/** Snapshot of the sensor cap's runtime-state slice at the change. */
|
|
15857
|
+
value: record(string(), unknown()).nullable(),
|
|
15858
|
+
timestamp: number()
|
|
15859
|
+
});
|
|
15791
15860
|
var TrackPositionSchema = object({
|
|
15792
15861
|
x: number(),
|
|
15793
15862
|
y: number(),
|
|
@@ -15801,6 +15870,30 @@ var TrackSnapshotSchema = object({
|
|
|
15801
15870
|
mediaKey: string()
|
|
15802
15871
|
});
|
|
15803
15872
|
/**
|
|
15873
|
+
* Normalized 0..1 trajectory envelope (min/max over every position bbox,
|
|
15874
|
+
* divided by the track's detection-frame dims), computed at persist time.
|
|
15875
|
+
* Absent when the frame dims were unknown when the track was persisted
|
|
15876
|
+
* (legacy rows / dims-less sources) and on active (in-RAM) tracks.
|
|
15877
|
+
*/
|
|
15878
|
+
var TrackEnvelopeSchema = object({
|
|
15879
|
+
minX: number(),
|
|
15880
|
+
minY: number(),
|
|
15881
|
+
maxX: number(),
|
|
15882
|
+
maxY: number()
|
|
15883
|
+
});
|
|
15884
|
+
/**
|
|
15885
|
+
* Row projection for track list queries. `full` (default) returns the
|
|
15886
|
+
* complete Track including the frame-rate `positions[]` history and the
|
|
15887
|
+
* `snapshots[]` references — megabytes across a page of tracks. `slim`
|
|
15888
|
+
* keeps every scalar the list surfaces actually render (ids, class(es),
|
|
15889
|
+
* label / audioLabels / importance enrichment, firstSeen/lastSeen, state,
|
|
15890
|
+
* zonesVisited, bestEventId, envelope) and returns `positions` /
|
|
15891
|
+
* `snapshots` as EMPTY arrays — detail views re-fetch the full row via
|
|
15892
|
+
* `getTrack`. Mirrors the event-store `projection` convention
|
|
15893
|
+
* (`getObjectEvents` et al.).
|
|
15894
|
+
*/
|
|
15895
|
+
var TrackProjectionSchema = _enum(["full", "slim"]);
|
|
15896
|
+
/**
|
|
15804
15897
|
* One audio-classification label heard on the track's camera while the
|
|
15805
15898
|
* track was alive, aggregated per label. An "episode" is one persisted
|
|
15806
15899
|
* audio event (the confident-classification path: score ≥ the device's
|
|
@@ -15851,7 +15944,11 @@ var TrackSchema = object({
|
|
|
15851
15944
|
/** Audio-classification labels heard on the camera during the track's
|
|
15852
15945
|
* life (score ≥ device `classificationMinScore`), aggregated per label.
|
|
15853
15946
|
* Absent on legacy rows / tracks with no confident audio. */
|
|
15854
|
-
audioLabels: array(TrackAudioLabelSchema).readonly().optional()
|
|
15947
|
+
audioLabels: array(TrackAudioLabelSchema).readonly().optional(),
|
|
15948
|
+
/** Normalized 0..1 trajectory envelope (see {@link TrackEnvelopeSchema}).
|
|
15949
|
+
* Populated from the persisted envelope columns on historical reads;
|
|
15950
|
+
* absent on legacy rows, dims-less tracks and active (in-RAM) tracks. */
|
|
15951
|
+
envelope: TrackEnvelopeSchema.optional()
|
|
15855
15952
|
});
|
|
15856
15953
|
var BaseEventFields = {
|
|
15857
15954
|
id: string(),
|
|
@@ -15961,11 +16058,13 @@ var MediaFileSchema = object({
|
|
|
15961
16058
|
sizeBytes: number(),
|
|
15962
16059
|
timestamp: number()
|
|
15963
16060
|
});
|
|
16061
|
+
var DEFAULT_EVENT_QUERY_LIMIT = 1e3;
|
|
16062
|
+
var MAX_EVENT_QUERY_LIMIT = 5e3;
|
|
15964
16063
|
var DeviceEventQueryInput = object({
|
|
15965
16064
|
deviceId: number(),
|
|
15966
16065
|
since: number().optional(),
|
|
15967
16066
|
until: number().optional(),
|
|
15968
|
-
limit: number().int().min(1).max(
|
|
16067
|
+
limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT),
|
|
15969
16068
|
/** `slim` drops heavy JSON fields (regions/bbox/zones) and carries an
|
|
15970
16069
|
* optional `mediaUrl` (populated by B5). `full` (default) keeps today's
|
|
15971
16070
|
* exact behaviour. Callers may omit this field — the store defaults to
|
|
@@ -15973,6 +16072,27 @@ var DeviceEventQueryInput = object({
|
|
|
15973
16072
|
projection: _enum(["full", "slim"]).optional()
|
|
15974
16073
|
});
|
|
15975
16074
|
var ObjectEventQueryInput = DeviceEventQueryInput.extend({ classFilter: string().optional() });
|
|
16075
|
+
var RecentTracksQueryInput = object({
|
|
16076
|
+
/** Devices to merge. An empty array yields `{ tracks: [], nextCursor: null }`. */
|
|
16077
|
+
deviceIds: array(number()),
|
|
16078
|
+
/** Window lower bound on `lastSeen` (inclusive). */
|
|
16079
|
+
since: number().optional(),
|
|
16080
|
+
/** Window upper bound on `lastSeen` (inclusive). */
|
|
16081
|
+
until: number().optional(),
|
|
16082
|
+
/** Page size. Default 200, max 1000. */
|
|
16083
|
+
limit: number().int().min(1).max(1e3).default(200),
|
|
16084
|
+
/** Opaque continuation cursor from a previous page's `nextCursor`.
|
|
16085
|
+
* Encodes the (lastSeen, trackId) sort position — treat as opaque. */
|
|
16086
|
+
cursor: string().optional(),
|
|
16087
|
+
/** See {@link TrackProjectionSchema}. Default `full`. */
|
|
16088
|
+
projection: TrackProjectionSchema.optional()
|
|
16089
|
+
});
|
|
16090
|
+
var RecentTracksPageSchema = object({
|
|
16091
|
+
/** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
|
|
16092
|
+
tracks: array(TrackSchema).readonly(),
|
|
16093
|
+
/** Cursor for the next page, or null when this page is the last. */
|
|
16094
|
+
nextCursor: string().nullable()
|
|
16095
|
+
});
|
|
15976
16096
|
var KeyEventQueryInput = object({
|
|
15977
16097
|
deviceId: number(),
|
|
15978
16098
|
/** Window lower bound (track firstSeen ≥ since). */
|
|
@@ -16055,11 +16175,25 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
16055
16175
|
deviceId: number(),
|
|
16056
16176
|
since: number().optional(),
|
|
16057
16177
|
until: number().optional(),
|
|
16058
|
-
limit: number().optional()
|
|
16059
|
-
|
|
16060
|
-
|
|
16061
|
-
|
|
16062
|
-
|
|
16178
|
+
limit: number().optional(),
|
|
16179
|
+
/** Spatial filter — only tracks whose trajectory intersects the zone
|
|
16180
|
+
* (normalized 0..1 rect or polygon). SQL-prefiltered on the persisted
|
|
16181
|
+
* envelope columns, then precisely tested per position. Tracks with
|
|
16182
|
+
* an unknown envelope (no frame dims at persist time) always match. */
|
|
16183
|
+
zone: TrackZoneFilterSchema.optional(),
|
|
16184
|
+
/** See {@link TrackProjectionSchema}. Default `full` (backward
|
|
16185
|
+
* compatible — omitting the field keeps today's exact behaviour). */
|
|
16186
|
+
projection: TrackProjectionSchema.optional()
|
|
16187
|
+
}), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
|
|
16188
|
+
kind: "mutation",
|
|
16189
|
+
auth: "admin"
|
|
16190
|
+
}), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(object({ deviceId: number() }), array(EventKindDescriptorSchema).readonly()), method(object({
|
|
16191
|
+
deviceId: number(),
|
|
16192
|
+
since: number().optional(),
|
|
16193
|
+
until: number().optional(),
|
|
16194
|
+
kinds: array(string()).optional(),
|
|
16195
|
+
limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
|
|
16196
|
+
}), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
|
|
16063
16197
|
deviceId: number(),
|
|
16064
16198
|
since: number(),
|
|
16065
16199
|
until: number(),
|
|
@@ -19260,7 +19394,12 @@ var RecordingStorageUsageSchema = object({
|
|
|
19260
19394
|
/**
|
|
19261
19395
|
* Result of locating footage at a wall-clock instant for one device/profile.
|
|
19262
19396
|
* `segment` carries the covering segment's window; `gap` reports the forward
|
|
19263
|
-
* nearest covered edge (`null` past the end of footage / when none exists)
|
|
19397
|
+
* nearest covered edge (`null` past the end of footage / when none exists)
|
|
19398
|
+
* and the backward covered edge `prevEndMs` (exclusive end of the nearest
|
|
19399
|
+
* footage behind the epoch; `null` when none — optional so older providers
|
|
19400
|
+
* that omit it stay valid). `prevEndMs` lets a backward frame-step hop the
|
|
19401
|
+
* small inter-segment cracks (durMs under-covers the span to the next
|
|
19402
|
+
* startMs by ~11-17 ms) instead of no-opping at a segment head.
|
|
19264
19403
|
*/
|
|
19265
19404
|
var LocateSegmentResultSchema = discriminatedUnion("kind", [object({
|
|
19266
19405
|
kind: literal("segment"),
|
|
@@ -19269,7 +19408,8 @@ var LocateSegmentResultSchema = discriminatedUnion("kind", [object({
|
|
|
19269
19408
|
bytes: number()
|
|
19270
19409
|
}), object({
|
|
19271
19410
|
kind: literal("gap"),
|
|
19272
|
-
nearestEdgeMs: number().nullable()
|
|
19411
|
+
nearestEdgeMs: number().nullable(),
|
|
19412
|
+
prevEndMs: number().nullable().optional()
|
|
19273
19413
|
})]);
|
|
19274
19414
|
/** Raw bytes of one finalized footage segment (read off disk on the recording node). */
|
|
19275
19415
|
var ReadSegmentBytesResultSchema = object({ data: _instanceof(Uint8Array) });
|
|
@@ -20838,6 +20978,12 @@ Object.freeze({
|
|
|
20838
20978
|
addonId: null,
|
|
20839
20979
|
access: "view"
|
|
20840
20980
|
},
|
|
20981
|
+
"deviceManager.getLinkedDevices": {
|
|
20982
|
+
capName: "device-manager",
|
|
20983
|
+
capScope: "system",
|
|
20984
|
+
addonId: null,
|
|
20985
|
+
access: "view"
|
|
20986
|
+
},
|
|
20841
20987
|
"deviceManager.getRoleDisplayDefaults": {
|
|
20842
20988
|
capName: "device-manager",
|
|
20843
20989
|
capScope: "system",
|
|
@@ -22392,6 +22538,12 @@ Object.freeze({
|
|
|
22392
22538
|
addonId: null,
|
|
22393
22539
|
access: "view"
|
|
22394
22540
|
},
|
|
22541
|
+
"pipelineAnalytics.getSensorEvents": {
|
|
22542
|
+
capName: "pipeline-analytics",
|
|
22543
|
+
capScope: "device",
|
|
22544
|
+
addonId: null,
|
|
22545
|
+
access: "view"
|
|
22546
|
+
},
|
|
22395
22547
|
"pipelineAnalytics.getTrack": {
|
|
22396
22548
|
capName: "pipeline-analytics",
|
|
22397
22549
|
capScope: "device",
|
|
@@ -22404,6 +22556,18 @@ Object.freeze({
|
|
|
22404
22556
|
addonId: null,
|
|
22405
22557
|
access: "view"
|
|
22406
22558
|
},
|
|
22559
|
+
"pipelineAnalytics.listEventKinds": {
|
|
22560
|
+
capName: "pipeline-analytics",
|
|
22561
|
+
capScope: "device",
|
|
22562
|
+
addonId: null,
|
|
22563
|
+
access: "view"
|
|
22564
|
+
},
|
|
22565
|
+
"pipelineAnalytics.listRecentTracks": {
|
|
22566
|
+
capName: "pipeline-analytics",
|
|
22567
|
+
capScope: "device",
|
|
22568
|
+
addonId: null,
|
|
22569
|
+
access: "view"
|
|
22570
|
+
},
|
|
22407
22571
|
"pipelineAnalytics.listTracks": {
|
|
22408
22572
|
capName: "pipeline-analytics",
|
|
22409
22573
|
capScope: "device",
|
|
@@ -10,7 +10,7 @@ import { networkInterfaces } from "node:os";
|
|
|
10
10
|
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
11
11
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
12
12
|
//#endregion
|
|
13
|
-
//#region ../types/dist/event-category-
|
|
13
|
+
//#region ../types/dist/event-category-H4AVePnn.mjs
|
|
14
14
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
15
15
|
EventCategory["SystemBoot"] = "system.boot";
|
|
16
16
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -160,6 +160,9 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
160
160
|
EventCategory["RecordingSegmentWritten"] = "recording.segment.written";
|
|
161
161
|
EventCategory["RecordingPolicyFallback"] = "recording.policy.fallback";
|
|
162
162
|
EventCategory["RecordingRetentionCompleted"] = "recording.retention.completed";
|
|
163
|
+
/** Runner-sampled scrub thumbnail (~1/5 s/camera). Telemetry (D8): a lost
|
|
164
|
+
* thumb is a scrub gap the recorder's keyframe backfill covers. */
|
|
165
|
+
EventCategory["RecordingThumbSampled"] = "recording.thumb-sampled";
|
|
163
166
|
EventCategory["DetectionEvent"] = "detection.event";
|
|
164
167
|
EventCategory["SessionTrackNew"] = "session.track.new";
|
|
165
168
|
EventCategory["SessionTrackExpired"] = "session.track.expired";
|
|
@@ -9878,7 +9881,7 @@ object({
|
|
|
9878
9881
|
deviceId: number(),
|
|
9879
9882
|
timestamp: number()
|
|
9880
9883
|
});
|
|
9881
|
-
DeviceType.Button;
|
|
9884
|
+
DeviceType.Button, DeviceType.Camera;
|
|
9882
9885
|
/**
|
|
9883
9886
|
* Enum-state sensor — a string value picked from a finite option set.
|
|
9884
9887
|
* Drives HA `sensor` entries with `state_class: enum` (HVAC action
|
|
@@ -14273,6 +14276,14 @@ var ConfigEntrySchema = object({
|
|
|
14273
14276
|
value: unknown(),
|
|
14274
14277
|
description: string().optional()
|
|
14275
14278
|
});
|
|
14279
|
+
var DeviceLinkModeSchema = _enum(["auto", "manual"]);
|
|
14280
|
+
/** One resolved linked device — the compact projection consumers need. */
|
|
14281
|
+
var LinkedDeviceSchema = object({
|
|
14282
|
+
deviceId: number(),
|
|
14283
|
+
name: string(),
|
|
14284
|
+
location: string().nullable(),
|
|
14285
|
+
features: array(string())
|
|
14286
|
+
});
|
|
14276
14287
|
var SavedDeviceRowSchema = object({
|
|
14277
14288
|
/** Numeric id reserved at allocateDeviceId time. */
|
|
14278
14289
|
id: number(),
|
|
@@ -14494,7 +14505,10 @@ method(object({
|
|
|
14494
14505
|
}), _void(), {
|
|
14495
14506
|
kind: "mutation",
|
|
14496
14507
|
auth: "admin"
|
|
14497
|
-
}), 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() }),
|
|
14508
|
+
}), 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({
|
|
14509
|
+
mode: DeviceLinkModeSchema,
|
|
14510
|
+
devices: array(LinkedDeviceSchema)
|
|
14511
|
+
})), method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
|
|
14498
14512
|
deviceId: number(),
|
|
14499
14513
|
values: record(string(), unknown())
|
|
14500
14514
|
}), object({ success: literal(true) }), {
|
|
@@ -15763,6 +15777,61 @@ var EventKindSchema = _enum([
|
|
|
15763
15777
|
"object",
|
|
15764
15778
|
"audio"
|
|
15765
15779
|
]);
|
|
15780
|
+
/**
|
|
15781
|
+
* Spatial filter for `listTracks` — the rect + polygon variants of the shared
|
|
15782
|
+
* MaskShape vocabulary (see `mask-shape.ts`). Coordinates are NORMALIZED 0..1
|
|
15783
|
+
* of the camera frame (top-left origin), matching the drawing-plane editor.
|
|
15784
|
+
*/
|
|
15785
|
+
var TrackZoneFilterSchema = discriminatedUnion("kind", [MaskRectShapeSchema, MaskPolygonShapeSchema]);
|
|
15786
|
+
/** Closed icon vocabulary so clients render a known glyph per kind. */
|
|
15787
|
+
var EventKindIconSchema = _enum([
|
|
15788
|
+
"motion",
|
|
15789
|
+
"audio",
|
|
15790
|
+
"person",
|
|
15791
|
+
"vehicle",
|
|
15792
|
+
"animal",
|
|
15793
|
+
"door",
|
|
15794
|
+
"pir",
|
|
15795
|
+
"smoke",
|
|
15796
|
+
"water",
|
|
15797
|
+
"button",
|
|
15798
|
+
"generic"
|
|
15799
|
+
]);
|
|
15800
|
+
var EventKindCategorySchema = _enum([
|
|
15801
|
+
"motion",
|
|
15802
|
+
"audio",
|
|
15803
|
+
"detection",
|
|
15804
|
+
"sensor",
|
|
15805
|
+
"custom"
|
|
15806
|
+
]);
|
|
15807
|
+
var EventKindDescriptorSchema = object({
|
|
15808
|
+
/** Stable kind id (e.g. 'motion', 'person', 'contact'). */
|
|
15809
|
+
kind: string(),
|
|
15810
|
+
label: string(),
|
|
15811
|
+
/** Hex color for timeline/legend rendering. */
|
|
15812
|
+
color: string(),
|
|
15813
|
+
icon: EventKindIconSchema,
|
|
15814
|
+
category: EventKindCategorySchema,
|
|
15815
|
+
/** Which cap + device contributes this kind. For built-ins the camera
|
|
15816
|
+
* itself; for sensor kinds the LINKED source device. */
|
|
15817
|
+
source: object({
|
|
15818
|
+
capName: string(),
|
|
15819
|
+
deviceId: number()
|
|
15820
|
+
})
|
|
15821
|
+
});
|
|
15822
|
+
var SensorEventSchema = object({
|
|
15823
|
+
id: string(),
|
|
15824
|
+
/** The CAMERA the event is attributed to (a sensor linked to N cameras
|
|
15825
|
+
* yields N rows, one per camera). */
|
|
15826
|
+
deviceId: number(),
|
|
15827
|
+
/** The linked sensor device whose state changed. */
|
|
15828
|
+
sourceDeviceId: number(),
|
|
15829
|
+
/** Event kind id — matches an `EventKindDescriptor.kind`. */
|
|
15830
|
+
kind: string(),
|
|
15831
|
+
/** Snapshot of the sensor cap's runtime-state slice at the change. */
|
|
15832
|
+
value: record(string(), unknown()).nullable(),
|
|
15833
|
+
timestamp: number()
|
|
15834
|
+
});
|
|
15766
15835
|
var TrackPositionSchema = object({
|
|
15767
15836
|
x: number(),
|
|
15768
15837
|
y: number(),
|
|
@@ -15776,6 +15845,30 @@ var TrackSnapshotSchema = object({
|
|
|
15776
15845
|
mediaKey: string()
|
|
15777
15846
|
});
|
|
15778
15847
|
/**
|
|
15848
|
+
* Normalized 0..1 trajectory envelope (min/max over every position bbox,
|
|
15849
|
+
* divided by the track's detection-frame dims), computed at persist time.
|
|
15850
|
+
* Absent when the frame dims were unknown when the track was persisted
|
|
15851
|
+
* (legacy rows / dims-less sources) and on active (in-RAM) tracks.
|
|
15852
|
+
*/
|
|
15853
|
+
var TrackEnvelopeSchema = object({
|
|
15854
|
+
minX: number(),
|
|
15855
|
+
minY: number(),
|
|
15856
|
+
maxX: number(),
|
|
15857
|
+
maxY: number()
|
|
15858
|
+
});
|
|
15859
|
+
/**
|
|
15860
|
+
* Row projection for track list queries. `full` (default) returns the
|
|
15861
|
+
* complete Track including the frame-rate `positions[]` history and the
|
|
15862
|
+
* `snapshots[]` references — megabytes across a page of tracks. `slim`
|
|
15863
|
+
* keeps every scalar the list surfaces actually render (ids, class(es),
|
|
15864
|
+
* label / audioLabels / importance enrichment, firstSeen/lastSeen, state,
|
|
15865
|
+
* zonesVisited, bestEventId, envelope) and returns `positions` /
|
|
15866
|
+
* `snapshots` as EMPTY arrays — detail views re-fetch the full row via
|
|
15867
|
+
* `getTrack`. Mirrors the event-store `projection` convention
|
|
15868
|
+
* (`getObjectEvents` et al.).
|
|
15869
|
+
*/
|
|
15870
|
+
var TrackProjectionSchema = _enum(["full", "slim"]);
|
|
15871
|
+
/**
|
|
15779
15872
|
* One audio-classification label heard on the track's camera while the
|
|
15780
15873
|
* track was alive, aggregated per label. An "episode" is one persisted
|
|
15781
15874
|
* audio event (the confident-classification path: score ≥ the device's
|
|
@@ -15826,7 +15919,11 @@ var TrackSchema = object({
|
|
|
15826
15919
|
/** Audio-classification labels heard on the camera during the track's
|
|
15827
15920
|
* life (score ≥ device `classificationMinScore`), aggregated per label.
|
|
15828
15921
|
* Absent on legacy rows / tracks with no confident audio. */
|
|
15829
|
-
audioLabels: array(TrackAudioLabelSchema).readonly().optional()
|
|
15922
|
+
audioLabels: array(TrackAudioLabelSchema).readonly().optional(),
|
|
15923
|
+
/** Normalized 0..1 trajectory envelope (see {@link TrackEnvelopeSchema}).
|
|
15924
|
+
* Populated from the persisted envelope columns on historical reads;
|
|
15925
|
+
* absent on legacy rows, dims-less tracks and active (in-RAM) tracks. */
|
|
15926
|
+
envelope: TrackEnvelopeSchema.optional()
|
|
15830
15927
|
});
|
|
15831
15928
|
var BaseEventFields = {
|
|
15832
15929
|
id: string(),
|
|
@@ -15936,11 +16033,13 @@ var MediaFileSchema = object({
|
|
|
15936
16033
|
sizeBytes: number(),
|
|
15937
16034
|
timestamp: number()
|
|
15938
16035
|
});
|
|
16036
|
+
var DEFAULT_EVENT_QUERY_LIMIT = 1e3;
|
|
16037
|
+
var MAX_EVENT_QUERY_LIMIT = 5e3;
|
|
15939
16038
|
var DeviceEventQueryInput = object({
|
|
15940
16039
|
deviceId: number(),
|
|
15941
16040
|
since: number().optional(),
|
|
15942
16041
|
until: number().optional(),
|
|
15943
|
-
limit: number().int().min(1).max(
|
|
16042
|
+
limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT),
|
|
15944
16043
|
/** `slim` drops heavy JSON fields (regions/bbox/zones) and carries an
|
|
15945
16044
|
* optional `mediaUrl` (populated by B5). `full` (default) keeps today's
|
|
15946
16045
|
* exact behaviour. Callers may omit this field — the store defaults to
|
|
@@ -15948,6 +16047,27 @@ var DeviceEventQueryInput = object({
|
|
|
15948
16047
|
projection: _enum(["full", "slim"]).optional()
|
|
15949
16048
|
});
|
|
15950
16049
|
var ObjectEventQueryInput = DeviceEventQueryInput.extend({ classFilter: string().optional() });
|
|
16050
|
+
var RecentTracksQueryInput = object({
|
|
16051
|
+
/** Devices to merge. An empty array yields `{ tracks: [], nextCursor: null }`. */
|
|
16052
|
+
deviceIds: array(number()),
|
|
16053
|
+
/** Window lower bound on `lastSeen` (inclusive). */
|
|
16054
|
+
since: number().optional(),
|
|
16055
|
+
/** Window upper bound on `lastSeen` (inclusive). */
|
|
16056
|
+
until: number().optional(),
|
|
16057
|
+
/** Page size. Default 200, max 1000. */
|
|
16058
|
+
limit: number().int().min(1).max(1e3).default(200),
|
|
16059
|
+
/** Opaque continuation cursor from a previous page's `nextCursor`.
|
|
16060
|
+
* Encodes the (lastSeen, trackId) sort position — treat as opaque. */
|
|
16061
|
+
cursor: string().optional(),
|
|
16062
|
+
/** See {@link TrackProjectionSchema}. Default `full`. */
|
|
16063
|
+
projection: TrackProjectionSchema.optional()
|
|
16064
|
+
});
|
|
16065
|
+
var RecentTracksPageSchema = object({
|
|
16066
|
+
/** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
|
|
16067
|
+
tracks: array(TrackSchema).readonly(),
|
|
16068
|
+
/** Cursor for the next page, or null when this page is the last. */
|
|
16069
|
+
nextCursor: string().nullable()
|
|
16070
|
+
});
|
|
15951
16071
|
var KeyEventQueryInput = object({
|
|
15952
16072
|
deviceId: number(),
|
|
15953
16073
|
/** Window lower bound (track firstSeen ≥ since). */
|
|
@@ -16030,11 +16150,25 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
16030
16150
|
deviceId: number(),
|
|
16031
16151
|
since: number().optional(),
|
|
16032
16152
|
until: number().optional(),
|
|
16033
|
-
limit: number().optional()
|
|
16034
|
-
|
|
16035
|
-
|
|
16036
|
-
|
|
16037
|
-
|
|
16153
|
+
limit: number().optional(),
|
|
16154
|
+
/** Spatial filter — only tracks whose trajectory intersects the zone
|
|
16155
|
+
* (normalized 0..1 rect or polygon). SQL-prefiltered on the persisted
|
|
16156
|
+
* envelope columns, then precisely tested per position. Tracks with
|
|
16157
|
+
* an unknown envelope (no frame dims at persist time) always match. */
|
|
16158
|
+
zone: TrackZoneFilterSchema.optional(),
|
|
16159
|
+
/** See {@link TrackProjectionSchema}. Default `full` (backward
|
|
16160
|
+
* compatible — omitting the field keeps today's exact behaviour). */
|
|
16161
|
+
projection: TrackProjectionSchema.optional()
|
|
16162
|
+
}), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
|
|
16163
|
+
kind: "mutation",
|
|
16164
|
+
auth: "admin"
|
|
16165
|
+
}), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(object({ deviceId: number() }), array(EventKindDescriptorSchema).readonly()), method(object({
|
|
16166
|
+
deviceId: number(),
|
|
16167
|
+
since: number().optional(),
|
|
16168
|
+
until: number().optional(),
|
|
16169
|
+
kinds: array(string()).optional(),
|
|
16170
|
+
limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
|
|
16171
|
+
}), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
|
|
16038
16172
|
deviceId: number(),
|
|
16039
16173
|
since: number(),
|
|
16040
16174
|
until: number(),
|
|
@@ -19235,7 +19369,12 @@ var RecordingStorageUsageSchema = object({
|
|
|
19235
19369
|
/**
|
|
19236
19370
|
* Result of locating footage at a wall-clock instant for one device/profile.
|
|
19237
19371
|
* `segment` carries the covering segment's window; `gap` reports the forward
|
|
19238
|
-
* nearest covered edge (`null` past the end of footage / when none exists)
|
|
19372
|
+
* nearest covered edge (`null` past the end of footage / when none exists)
|
|
19373
|
+
* and the backward covered edge `prevEndMs` (exclusive end of the nearest
|
|
19374
|
+
* footage behind the epoch; `null` when none — optional so older providers
|
|
19375
|
+
* that omit it stay valid). `prevEndMs` lets a backward frame-step hop the
|
|
19376
|
+
* small inter-segment cracks (durMs under-covers the span to the next
|
|
19377
|
+
* startMs by ~11-17 ms) instead of no-opping at a segment head.
|
|
19239
19378
|
*/
|
|
19240
19379
|
var LocateSegmentResultSchema = discriminatedUnion("kind", [object({
|
|
19241
19380
|
kind: literal("segment"),
|
|
@@ -19244,7 +19383,8 @@ var LocateSegmentResultSchema = discriminatedUnion("kind", [object({
|
|
|
19244
19383
|
bytes: number()
|
|
19245
19384
|
}), object({
|
|
19246
19385
|
kind: literal("gap"),
|
|
19247
|
-
nearestEdgeMs: number().nullable()
|
|
19386
|
+
nearestEdgeMs: number().nullable(),
|
|
19387
|
+
prevEndMs: number().nullable().optional()
|
|
19248
19388
|
})]);
|
|
19249
19389
|
/** Raw bytes of one finalized footage segment (read off disk on the recording node). */
|
|
19250
19390
|
var ReadSegmentBytesResultSchema = object({ data: _instanceof(Uint8Array) });
|
|
@@ -20813,6 +20953,12 @@ Object.freeze({
|
|
|
20813
20953
|
addonId: null,
|
|
20814
20954
|
access: "view"
|
|
20815
20955
|
},
|
|
20956
|
+
"deviceManager.getLinkedDevices": {
|
|
20957
|
+
capName: "device-manager",
|
|
20958
|
+
capScope: "system",
|
|
20959
|
+
addonId: null,
|
|
20960
|
+
access: "view"
|
|
20961
|
+
},
|
|
20816
20962
|
"deviceManager.getRoleDisplayDefaults": {
|
|
20817
20963
|
capName: "device-manager",
|
|
20818
20964
|
capScope: "system",
|
|
@@ -22367,6 +22513,12 @@ Object.freeze({
|
|
|
22367
22513
|
addonId: null,
|
|
22368
22514
|
access: "view"
|
|
22369
22515
|
},
|
|
22516
|
+
"pipelineAnalytics.getSensorEvents": {
|
|
22517
|
+
capName: "pipeline-analytics",
|
|
22518
|
+
capScope: "device",
|
|
22519
|
+
addonId: null,
|
|
22520
|
+
access: "view"
|
|
22521
|
+
},
|
|
22370
22522
|
"pipelineAnalytics.getTrack": {
|
|
22371
22523
|
capName: "pipeline-analytics",
|
|
22372
22524
|
capScope: "device",
|
|
@@ -22379,6 +22531,18 @@ Object.freeze({
|
|
|
22379
22531
|
addonId: null,
|
|
22380
22532
|
access: "view"
|
|
22381
22533
|
},
|
|
22534
|
+
"pipelineAnalytics.listEventKinds": {
|
|
22535
|
+
capName: "pipeline-analytics",
|
|
22536
|
+
capScope: "device",
|
|
22537
|
+
addonId: null,
|
|
22538
|
+
access: "view"
|
|
22539
|
+
},
|
|
22540
|
+
"pipelineAnalytics.listRecentTracks": {
|
|
22541
|
+
capName: "pipeline-analytics",
|
|
22542
|
+
capScope: "device",
|
|
22543
|
+
addonId: null,
|
|
22544
|
+
access: "view"
|
|
22545
|
+
},
|
|
22382
22546
|
"pipelineAnalytics.listTracks": {
|
|
22383
22547
|
capName: "pipeline-analytics",
|
|
22384
22548
|
capScope: "device",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-export-hap",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.24",
|
|
4
4
|
"description": "HomeKit (HAP) bridge exporter for CamStack devices. Publishes a bridged accessory per exposed device — MotionSensor in this MVP; Camera/Doorbell/Switch/Light follow.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|