@camstack/types 1.1.46 → 1.1.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/addon.js +2 -2
- package/dist/addon.mjs +2 -2
- package/dist/capabilities/device-manager.cap.d.ts +37 -0
- package/dist/capabilities/doorbell.cap.d.ts +21 -5
- package/dist/capabilities/index.d.ts +3 -2
- package/dist/capabilities/pipeline-analytics.cap.d.ts +370 -1
- package/dist/capabilities/recording.cap.d.ts +8 -1
- package/dist/capabilities/sensor-event-kinds.d.ts +25 -0
- package/dist/enums/event-category.d.ts +3 -0
- package/dist/enums.js +1 -1
- package/dist/enums.mjs +1 -1
- package/dist/{event-category-BXd6yeJi.js → event-category-AkBNxg_X.js} +3 -0
- package/dist/{event-category-CFZs3jI4.mjs → event-category-H4AVePnn.mjs} +3 -0
- package/dist/generated/addon-api.d.ts +586 -0
- package/dist/generated/device-proxy.d.ts +1 -1
- package/dist/generated/method-access-map.d.ts +1 -1
- package/dist/index.js +287 -12
- package/dist/index.mjs +276 -13
- package/dist/interfaces/event-bus.d.ts +16 -0
- package/dist/{sleep-Vh_bux78.js → sleep-BkhAiFKX.js} +15 -3
- package/dist/{sleep-Br7r_3fq.mjs → sleep-CK899CTS.mjs} +15 -3
- package/package.json +1 -1
|
@@ -265,7 +265,7 @@ export interface DeviceProxy {
|
|
|
265
265
|
readonly cameraPipelineConfig: Pick<InferDeviceProxyCap<typeof cameraPipelineConfigCapability>, 'getDeviceSettingsContribution' | 'getDeviceLiveContribution' | 'applyDeviceSettingsPatch'>;
|
|
266
266
|
readonly deviceAdoption: Pick<InferDeviceProxyCap<typeof deviceAdoptionCapability>, 'getStatus'>;
|
|
267
267
|
readonly deviceExport: Pick<InferDeviceProxyCap<typeof deviceExportCapability>, 'getDeviceSettingsContribution' | 'getDeviceLiveContribution' | 'applyDeviceSettingsPatch'>;
|
|
268
|
-
readonly deviceManager: Pick<InferDeviceProxyCap<typeof deviceManagerCapability>, 'loadConfig' | 'loadRuntimeState' | 'loadMeta' | 'setName' | 'setLocation' | 'setType' | 'setIntegrationId' | 'setLinkDeviceId' | 'setPrimaryChildEntityId' | 'setChildLayout' | 'setDeviceLinks' | 'setDisplay' | 'getWireableFields' | 'setRole' | 'applyInitialMeta' | 'setMetadata' | 'setDisabled' | 'getDevice' | 'getStreamSources' | 'getConfigSchema' | 'getSettingsSchema' | 'updateConfig' | 'enable' | 'disable' | 'remove' | 'getStreamProfileMap' | 'setStreamProfileMap' | 'probeStreams' | 'getBindings' | 'getAllBindings' | 'setWrapperActive' | 'getDeviceSettingsAggregate' | 'getDeviceLiveInfoAggregate' | 'getDeviceAggregate' | 'runDeviceAction' | 'updateDeviceField' | 'updateDeviceFieldsBatch' | 'testField' | 'getDeviceStatusAggregate'>;
|
|
268
|
+
readonly deviceManager: Pick<InferDeviceProxyCap<typeof deviceManagerCapability>, 'loadConfig' | 'loadRuntimeState' | 'loadMeta' | 'setName' | 'setLocation' | 'setType' | 'setIntegrationId' | 'setLinkDeviceId' | 'setPrimaryChildEntityId' | 'setChildLayout' | 'setDeviceLinks' | 'setDisplay' | 'getWireableFields' | 'setRole' | 'applyInitialMeta' | 'setMetadata' | 'setDisabled' | 'getDevice' | 'getLinkedDevices' | 'getStreamSources' | 'getConfigSchema' | 'getSettingsSchema' | 'updateConfig' | 'enable' | 'disable' | 'remove' | 'getStreamProfileMap' | 'setStreamProfileMap' | 'probeStreams' | 'getBindings' | 'getAllBindings' | 'setWrapperActive' | 'getDeviceSettingsAggregate' | 'getDeviceLiveInfoAggregate' | 'getDeviceAggregate' | 'runDeviceAction' | 'updateDeviceField' | 'updateDeviceFieldsBatch' | 'testField' | 'getDeviceStatusAggregate' | 'getDeviceSettingsContribution' | 'getDeviceLiveContribution' | 'applyDeviceSettingsPatch'>;
|
|
269
269
|
readonly deviceState: Pick<InferDeviceProxyCap<typeof deviceStateCapability>, 'getSnapshot' | 'getCapSlice' | 'setCapSlice'>;
|
|
270
270
|
readonly faceGallery: Pick<InferDeviceProxyCap<typeof faceGalleryCapability>, 'getFaceByTrack'>;
|
|
271
271
|
readonly networkQuality: Pick<InferDeviceProxyCap<typeof networkQualityCapability>, 'getDeviceStats' | 'reportClientStats'>;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* scope+access check inside `protectedProcedure` (see
|
|
7
7
|
* `server/backend/src/api/trpc/trpc.middleware.ts`).
|
|
8
8
|
*
|
|
9
|
-
* Coverage:
|
|
9
|
+
* Coverage: 789 method paths across 115 capabilities.
|
|
10
10
|
*/
|
|
11
11
|
import type { CapabilityMethodAccess } from '../capabilities/capability-definition.js';
|
|
12
12
|
export interface MethodAccessRecord {
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_sleep = require("./sleep-
|
|
3
|
-
const require_event_category = require("./event-category-
|
|
2
|
+
const require_sleep = require("./sleep-BkhAiFKX.js");
|
|
3
|
+
const require_event_category = require("./event-category-AkBNxg_X.js");
|
|
4
4
|
const require_enums = require("./enums.js");
|
|
5
5
|
const require_err_msg = require("./err-msg-COpsHMw2.js");
|
|
6
6
|
let zod = require("zod");
|
|
@@ -6487,10 +6487,23 @@ var deviceDiscoveryCapability = {
|
|
|
6487
6487
|
//#endregion
|
|
6488
6488
|
//#region src/capabilities/doorbell.cap.ts
|
|
6489
6489
|
/**
|
|
6490
|
-
* Doorbell button cap.
|
|
6491
|
-
*
|
|
6492
|
-
*
|
|
6493
|
-
*
|
|
6490
|
+
* Doorbell button cap. Two kinds of providers coexist behind this cap
|
|
6491
|
+
* name (same pattern as `snapshot`):
|
|
6492
|
+
*
|
|
6493
|
+
* - **Native** providers: registered per-device by device-driver
|
|
6494
|
+
* addons via `ctx.registerNativeCap` — either on a
|
|
6495
|
+
* `DeviceType.Button` accessory with `role: DeviceRole.Doorbell`,
|
|
6496
|
+
* or directly on the camera (Reolink registers at camera level).
|
|
6497
|
+
* Emits an `onPressed` event every time the firmware pushes a
|
|
6498
|
+
* ring; status tracks the last press and a pressCount since start
|
|
6499
|
+
* (diagnostic).
|
|
6500
|
+
*
|
|
6501
|
+
* - **Wrapper** provider: the `virtual-doorbell` system builtin
|
|
6502
|
+
* (`@camstack/system/builtins/doorbell`). Turns ANY binary-ish
|
|
6503
|
+
* device (contact / switch / event-emitter …) into a doorbell for
|
|
6504
|
+
* a camera. `defaultActive: false` — the operator explicitly binds
|
|
6505
|
+
* it per camera in the device-bindings UI, then picks the source
|
|
6506
|
+
* device + trigger in the per-device settings.
|
|
6494
6507
|
*
|
|
6495
6508
|
* The DeviceEventPropagator re-emits `onPressed` on the camera parent
|
|
6496
6509
|
* — subscribers listening at the camera level receive ring events
|
|
@@ -6511,7 +6524,10 @@ var doorbellCapability = {
|
|
|
6511
6524
|
scope: "device",
|
|
6512
6525
|
deviceNative: true,
|
|
6513
6526
|
mode: "singleton",
|
|
6514
|
-
|
|
6527
|
+
kind: "wrapper",
|
|
6528
|
+
defaultActive: false,
|
|
6529
|
+
deviceTypes: [require_sleep.DeviceType.Button, require_sleep.DeviceType.Camera],
|
|
6530
|
+
exposesDeviceSettings: true,
|
|
6515
6531
|
methods: {},
|
|
6516
6532
|
events: {
|
|
6517
6533
|
/**
|
|
@@ -16058,6 +16074,14 @@ var ConfigEntrySchema = zod.z.object({
|
|
|
16058
16074
|
value: zod.z.unknown(),
|
|
16059
16075
|
description: zod.z.string().optional()
|
|
16060
16076
|
});
|
|
16077
|
+
var DeviceLinkModeSchema = zod.z.enum(["auto", "manual"]);
|
|
16078
|
+
/** One resolved linked device — the compact projection consumers need. */
|
|
16079
|
+
var LinkedDeviceSchema = zod.z.object({
|
|
16080
|
+
deviceId: zod.z.number(),
|
|
16081
|
+
name: zod.z.string(),
|
|
16082
|
+
location: zod.z.string().nullable(),
|
|
16083
|
+
features: zod.z.array(zod.z.string())
|
|
16084
|
+
});
|
|
16061
16085
|
var SavedDeviceRowSchema = zod.z.object({
|
|
16062
16086
|
/** Numeric id reserved at allocateDeviceId time. */
|
|
16063
16087
|
id: zod.z.number(),
|
|
@@ -16165,6 +16189,7 @@ var deviceManagerCapability = {
|
|
|
16165
16189
|
name: "device-manager",
|
|
16166
16190
|
scope: "system",
|
|
16167
16191
|
mode: "singleton",
|
|
16192
|
+
exposesDeviceSettings: true,
|
|
16168
16193
|
methods: {
|
|
16169
16194
|
/** Reserve (or re-resolve) a progressive numeric id for `(addonId, stableId)`.
|
|
16170
16195
|
* Idempotent: returns the existing id if one is already persisted for the
|
|
@@ -16415,6 +16440,19 @@ var deviceManagerCapability = {
|
|
|
16415
16440
|
getDevice: require_sleep.method(zod.z.object({ deviceId: zod.z.number() }), DeviceInfoSchema.nullable()),
|
|
16416
16441
|
/** List children of a parent device (by parent numeric id). */
|
|
16417
16442
|
getChildren: require_sleep.method(zod.z.object({ parentDeviceId: zod.z.number() }), zod.z.array(DeviceInfoSchema)),
|
|
16443
|
+
/**
|
|
16444
|
+
* Resolve the devices LINKED to a camera — the single policy authority
|
|
16445
|
+
* both consumers call (viewer devices panel + pipeline-analytics event
|
|
16446
|
+
* kinds/ingest). Device-tree children are ALWAYS included; mode 'auto'
|
|
16447
|
+
* (default) adds every device sharing the camera's non-null `location`,
|
|
16448
|
+
* mode 'manual' adds the persisted manual list instead. Excludes the
|
|
16449
|
+
* camera itself; deduped. Configuration is standard per-device settings
|
|
16450
|
+
* (see the module docblock) — there are no bespoke link mutations.
|
|
16451
|
+
*/
|
|
16452
|
+
getLinkedDevices: require_sleep.method(zod.z.object({ deviceId: zod.z.number() }), zod.z.object({
|
|
16453
|
+
mode: DeviceLinkModeSchema,
|
|
16454
|
+
devices: zod.z.array(LinkedDeviceSchema)
|
|
16455
|
+
})),
|
|
16418
16456
|
/** Get stream sources for a camera device. */
|
|
16419
16457
|
getStreamSources: require_sleep.method(zod.z.object({ deviceId: zod.z.number() }), zod.z.array(require_sleep.StreamSourceEntrySchema)),
|
|
16420
16458
|
/** Get config entries (key + value + description) for a device. */
|
|
@@ -18179,6 +18217,61 @@ var EventKindSchema = zod.z.enum([
|
|
|
18179
18217
|
"object",
|
|
18180
18218
|
"audio"
|
|
18181
18219
|
]);
|
|
18220
|
+
/**
|
|
18221
|
+
* Spatial filter for `listTracks` — the rect + polygon variants of the shared
|
|
18222
|
+
* MaskShape vocabulary (see `mask-shape.ts`). Coordinates are NORMALIZED 0..1
|
|
18223
|
+
* of the camera frame (top-left origin), matching the drawing-plane editor.
|
|
18224
|
+
*/
|
|
18225
|
+
var TrackZoneFilterSchema = zod.z.discriminatedUnion("kind", [MaskRectShapeSchema, MaskPolygonShapeSchema]);
|
|
18226
|
+
/** Closed icon vocabulary so clients render a known glyph per kind. */
|
|
18227
|
+
var EventKindIconSchema = zod.z.enum([
|
|
18228
|
+
"motion",
|
|
18229
|
+
"audio",
|
|
18230
|
+
"person",
|
|
18231
|
+
"vehicle",
|
|
18232
|
+
"animal",
|
|
18233
|
+
"door",
|
|
18234
|
+
"pir",
|
|
18235
|
+
"smoke",
|
|
18236
|
+
"water",
|
|
18237
|
+
"button",
|
|
18238
|
+
"generic"
|
|
18239
|
+
]);
|
|
18240
|
+
var EventKindCategorySchema = zod.z.enum([
|
|
18241
|
+
"motion",
|
|
18242
|
+
"audio",
|
|
18243
|
+
"detection",
|
|
18244
|
+
"sensor",
|
|
18245
|
+
"custom"
|
|
18246
|
+
]);
|
|
18247
|
+
var EventKindDescriptorSchema = zod.z.object({
|
|
18248
|
+
/** Stable kind id (e.g. 'motion', 'person', 'contact'). */
|
|
18249
|
+
kind: zod.z.string(),
|
|
18250
|
+
label: zod.z.string(),
|
|
18251
|
+
/** Hex color for timeline/legend rendering. */
|
|
18252
|
+
color: zod.z.string(),
|
|
18253
|
+
icon: EventKindIconSchema,
|
|
18254
|
+
category: EventKindCategorySchema,
|
|
18255
|
+
/** Which cap + device contributes this kind. For built-ins the camera
|
|
18256
|
+
* itself; for sensor kinds the LINKED source device. */
|
|
18257
|
+
source: zod.z.object({
|
|
18258
|
+
capName: zod.z.string(),
|
|
18259
|
+
deviceId: zod.z.number()
|
|
18260
|
+
})
|
|
18261
|
+
});
|
|
18262
|
+
var SensorEventSchema = zod.z.object({
|
|
18263
|
+
id: zod.z.string(),
|
|
18264
|
+
/** The CAMERA the event is attributed to (a sensor linked to N cameras
|
|
18265
|
+
* yields N rows, one per camera). */
|
|
18266
|
+
deviceId: zod.z.number(),
|
|
18267
|
+
/** The linked sensor device whose state changed. */
|
|
18268
|
+
sourceDeviceId: zod.z.number(),
|
|
18269
|
+
/** Event kind id — matches an `EventKindDescriptor.kind`. */
|
|
18270
|
+
kind: zod.z.string(),
|
|
18271
|
+
/** Snapshot of the sensor cap's runtime-state slice at the change. */
|
|
18272
|
+
value: zod.z.record(zod.z.string(), zod.z.unknown()).nullable(),
|
|
18273
|
+
timestamp: zod.z.number()
|
|
18274
|
+
});
|
|
18182
18275
|
var TrackPositionSchema = zod.z.object({
|
|
18183
18276
|
x: zod.z.number(),
|
|
18184
18277
|
y: zod.z.number(),
|
|
@@ -18192,6 +18285,30 @@ var TrackSnapshotSchema = zod.z.object({
|
|
|
18192
18285
|
mediaKey: zod.z.string()
|
|
18193
18286
|
});
|
|
18194
18287
|
/**
|
|
18288
|
+
* Normalized 0..1 trajectory envelope (min/max over every position bbox,
|
|
18289
|
+
* divided by the track's detection-frame dims), computed at persist time.
|
|
18290
|
+
* Absent when the frame dims were unknown when the track was persisted
|
|
18291
|
+
* (legacy rows / dims-less sources) and on active (in-RAM) tracks.
|
|
18292
|
+
*/
|
|
18293
|
+
var TrackEnvelopeSchema = zod.z.object({
|
|
18294
|
+
minX: zod.z.number(),
|
|
18295
|
+
minY: zod.z.number(),
|
|
18296
|
+
maxX: zod.z.number(),
|
|
18297
|
+
maxY: zod.z.number()
|
|
18298
|
+
});
|
|
18299
|
+
/**
|
|
18300
|
+
* Row projection for track list queries. `full` (default) returns the
|
|
18301
|
+
* complete Track including the frame-rate `positions[]` history and the
|
|
18302
|
+
* `snapshots[]` references — megabytes across a page of tracks. `slim`
|
|
18303
|
+
* keeps every scalar the list surfaces actually render (ids, class(es),
|
|
18304
|
+
* label / audioLabels / importance enrichment, firstSeen/lastSeen, state,
|
|
18305
|
+
* zonesVisited, bestEventId, envelope) and returns `positions` /
|
|
18306
|
+
* `snapshots` as EMPTY arrays — detail views re-fetch the full row via
|
|
18307
|
+
* `getTrack`. Mirrors the event-store `projection` convention
|
|
18308
|
+
* (`getObjectEvents` et al.).
|
|
18309
|
+
*/
|
|
18310
|
+
var TrackProjectionSchema = zod.z.enum(["full", "slim"]);
|
|
18311
|
+
/**
|
|
18195
18312
|
* One audio-classification label heard on the track's camera while the
|
|
18196
18313
|
* track was alive, aggregated per label. An "episode" is one persisted
|
|
18197
18314
|
* audio event (the confident-classification path: score ≥ the device's
|
|
@@ -18242,7 +18359,11 @@ var TrackSchema = zod.z.object({
|
|
|
18242
18359
|
/** Audio-classification labels heard on the camera during the track's
|
|
18243
18360
|
* life (score ≥ device `classificationMinScore`), aggregated per label.
|
|
18244
18361
|
* Absent on legacy rows / tracks with no confident audio. */
|
|
18245
|
-
audioLabels: zod.z.array(TrackAudioLabelSchema).readonly().optional()
|
|
18362
|
+
audioLabels: zod.z.array(TrackAudioLabelSchema).readonly().optional(),
|
|
18363
|
+
/** Normalized 0..1 trajectory envelope (see {@link TrackEnvelopeSchema}).
|
|
18364
|
+
* Populated from the persisted envelope columns on historical reads;
|
|
18365
|
+
* absent on legacy rows, dims-less tracks and active (in-RAM) tracks. */
|
|
18366
|
+
envelope: TrackEnvelopeSchema.optional()
|
|
18246
18367
|
});
|
|
18247
18368
|
var BaseEventFields = {
|
|
18248
18369
|
id: zod.z.string(),
|
|
@@ -18352,11 +18473,13 @@ var MediaFileSchema = zod.z.object({
|
|
|
18352
18473
|
sizeBytes: zod.z.number(),
|
|
18353
18474
|
timestamp: zod.z.number()
|
|
18354
18475
|
});
|
|
18476
|
+
var DEFAULT_EVENT_QUERY_LIMIT = 1e3;
|
|
18477
|
+
var MAX_EVENT_QUERY_LIMIT = 5e3;
|
|
18355
18478
|
var DeviceEventQueryInput = zod.z.object({
|
|
18356
18479
|
deviceId: zod.z.number(),
|
|
18357
18480
|
since: zod.z.number().optional(),
|
|
18358
18481
|
until: zod.z.number().optional(),
|
|
18359
|
-
limit: zod.z.number().int().min(1).max(
|
|
18482
|
+
limit: zod.z.number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT),
|
|
18360
18483
|
/** `slim` drops heavy JSON fields (regions/bbox/zones) and carries an
|
|
18361
18484
|
* optional `mediaUrl` (populated by B5). `full` (default) keeps today's
|
|
18362
18485
|
* exact behaviour. Callers may omit this field — the store defaults to
|
|
@@ -18364,6 +18487,27 @@ var DeviceEventQueryInput = zod.z.object({
|
|
|
18364
18487
|
projection: zod.z.enum(["full", "slim"]).optional()
|
|
18365
18488
|
});
|
|
18366
18489
|
var ObjectEventQueryInput = DeviceEventQueryInput.extend({ classFilter: zod.z.string().optional() });
|
|
18490
|
+
var RecentTracksQueryInput = zod.z.object({
|
|
18491
|
+
/** Devices to merge. An empty array yields `{ tracks: [], nextCursor: null }`. */
|
|
18492
|
+
deviceIds: zod.z.array(zod.z.number()),
|
|
18493
|
+
/** Window lower bound on `lastSeen` (inclusive). */
|
|
18494
|
+
since: zod.z.number().optional(),
|
|
18495
|
+
/** Window upper bound on `lastSeen` (inclusive). */
|
|
18496
|
+
until: zod.z.number().optional(),
|
|
18497
|
+
/** Page size. Default 200, max 1000. */
|
|
18498
|
+
limit: zod.z.number().int().min(1).max(1e3).default(200),
|
|
18499
|
+
/** Opaque continuation cursor from a previous page's `nextCursor`.
|
|
18500
|
+
* Encodes the (lastSeen, trackId) sort position — treat as opaque. */
|
|
18501
|
+
cursor: zod.z.string().optional(),
|
|
18502
|
+
/** See {@link TrackProjectionSchema}. Default `full`. */
|
|
18503
|
+
projection: TrackProjectionSchema.optional()
|
|
18504
|
+
});
|
|
18505
|
+
var RecentTracksPageSchema = zod.z.object({
|
|
18506
|
+
/** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
|
|
18507
|
+
tracks: zod.z.array(TrackSchema).readonly(),
|
|
18508
|
+
/** Cursor for the next page, or null when this page is the last. */
|
|
18509
|
+
nextCursor: zod.z.string().nullable()
|
|
18510
|
+
});
|
|
18367
18511
|
var KeyEventQueryInput = zod.z.object({
|
|
18368
18512
|
deviceId: zod.z.number(),
|
|
18369
18513
|
/** Window lower bound (track firstSeen ≥ since). */
|
|
@@ -18460,8 +18604,27 @@ var pipelineAnalyticsCapability = {
|
|
|
18460
18604
|
deviceId: zod.z.number(),
|
|
18461
18605
|
since: zod.z.number().optional(),
|
|
18462
18606
|
until: zod.z.number().optional(),
|
|
18463
|
-
limit: zod.z.number().optional()
|
|
18607
|
+
limit: zod.z.number().optional(),
|
|
18608
|
+
/** Spatial filter — only tracks whose trajectory intersects the zone
|
|
18609
|
+
* (normalized 0..1 rect or polygon). SQL-prefiltered on the persisted
|
|
18610
|
+
* envelope columns, then precisely tested per position. Tracks with
|
|
18611
|
+
* an unknown envelope (no frame dims at persist time) always match. */
|
|
18612
|
+
zone: TrackZoneFilterSchema.optional(),
|
|
18613
|
+
/** See {@link TrackProjectionSchema}. Default `full` (backward
|
|
18614
|
+
* compatible — omitting the field keeps today's exact behaviour). */
|
|
18615
|
+
projection: TrackProjectionSchema.optional()
|
|
18464
18616
|
}), zod.z.array(TrackSchema).readonly()),
|
|
18617
|
+
/**
|
|
18618
|
+
* Batched cluster-wide track listing — ONE call for the events page /
|
|
18619
|
+
* reel first paint instead of a per-camera `listTracks` fan-out. Merges
|
|
18620
|
+
* the persisted completed tracks of every requested device, sorted by
|
|
18621
|
+
* `lastSeen` DESC with a stable (lastSeen, trackId) cursor. Per-device
|
|
18622
|
+
* indexed pages (`idx_tracks_device_lastSeen`) are k-way merged
|
|
18623
|
+
* provider-side; `projection: 'slim'` drops the heavy `positions[]` /
|
|
18624
|
+
* `snapshots[]` JSON (returned as empty arrays). Active in-RAM tracks
|
|
18625
|
+
* are not included (same contract as `listTracks`).
|
|
18626
|
+
*/
|
|
18627
|
+
listRecentTracks: require_sleep.method(RecentTracksQueryInput, RecentTracksPageSchema),
|
|
18465
18628
|
clearTracks: require_sleep.method(zod.z.object({ deviceId: zod.z.number() }), zod.z.void(), {
|
|
18466
18629
|
kind: "mutation",
|
|
18467
18630
|
auth: "admin"
|
|
@@ -18470,6 +18633,26 @@ var pipelineAnalyticsCapability = {
|
|
|
18470
18633
|
getObjectEvents: require_sleep.method(ObjectEventQueryInput, zod.z.array(ObjectEventSchema).readonly()),
|
|
18471
18634
|
getAudioEvents: require_sleep.method(DeviceEventQueryInput, zod.z.array(AudioEventSchema).readonly()),
|
|
18472
18635
|
/**
|
|
18636
|
+
* Every event kind the device can produce: built-ins (motion + audio),
|
|
18637
|
+
* detection classes actually observed for the device (from the track
|
|
18638
|
+
* history), and sensor kinds contributed by LINKED devices (resolved via
|
|
18639
|
+
* `device-manager.getLinkedDevices`, mapped through `EVENT_KIND_BY_CAP`).
|
|
18640
|
+
*/
|
|
18641
|
+
listEventKinds: require_sleep.method(zod.z.object({ deviceId: zod.z.number() }), zod.z.array(EventKindDescriptorSchema).readonly()),
|
|
18642
|
+
/**
|
|
18643
|
+
* Sensor-event history for a camera: state changes of LINKED sensor
|
|
18644
|
+
* devices, attributed to the camera at ingest time (one row per linked
|
|
18645
|
+
* camera). Mirrors `getAudioEvents` query semantics; `kinds` narrows to
|
|
18646
|
+
* a kind subset.
|
|
18647
|
+
*/
|
|
18648
|
+
getSensorEvents: require_sleep.method(zod.z.object({
|
|
18649
|
+
deviceId: zod.z.number(),
|
|
18650
|
+
since: zod.z.number().optional(),
|
|
18651
|
+
until: zod.z.number().optional(),
|
|
18652
|
+
kinds: zod.z.array(zod.z.string()).optional(),
|
|
18653
|
+
limit: zod.z.number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
|
|
18654
|
+
}), zod.z.array(SensorEventSchema).readonly()),
|
|
18655
|
+
/**
|
|
18473
18656
|
* Importance-ranked highlights for a device+window. Queries completed
|
|
18474
18657
|
* tracks by (deviceId, firstSeen ∈ [since,until]), scores each (or reuses
|
|
18475
18658
|
* the persisted score), filters by minImportance/classFilter, orders by
|
|
@@ -18615,6 +18798,56 @@ var pipelineAnalyticsCapability = {
|
|
|
18615
18798
|
}
|
|
18616
18799
|
};
|
|
18617
18800
|
//#endregion
|
|
18801
|
+
//#region src/capabilities/sensor-event-kinds.ts
|
|
18802
|
+
/**
|
|
18803
|
+
* Sensor cap name → static event-kind descriptor. A linked device
|
|
18804
|
+
* contributes one entry per bound cap present in this map.
|
|
18805
|
+
*/
|
|
18806
|
+
var EVENT_KIND_BY_CAP = {
|
|
18807
|
+
contact: {
|
|
18808
|
+
kind: "contact",
|
|
18809
|
+
label: "Contact",
|
|
18810
|
+
color: "#f59e0b",
|
|
18811
|
+
icon: "door",
|
|
18812
|
+
category: "sensor"
|
|
18813
|
+
},
|
|
18814
|
+
flood: {
|
|
18815
|
+
kind: "flood",
|
|
18816
|
+
label: "Water leak",
|
|
18817
|
+
color: "#3b82f6",
|
|
18818
|
+
icon: "water",
|
|
18819
|
+
category: "sensor"
|
|
18820
|
+
},
|
|
18821
|
+
gas: {
|
|
18822
|
+
kind: "gas",
|
|
18823
|
+
label: "Gas",
|
|
18824
|
+
color: "#ef4444",
|
|
18825
|
+
icon: "smoke",
|
|
18826
|
+
category: "sensor"
|
|
18827
|
+
},
|
|
18828
|
+
"carbon-monoxide": {
|
|
18829
|
+
kind: "carbon-monoxide",
|
|
18830
|
+
label: "Carbon monoxide",
|
|
18831
|
+
color: "#dc2626",
|
|
18832
|
+
icon: "smoke",
|
|
18833
|
+
category: "sensor"
|
|
18834
|
+
},
|
|
18835
|
+
"enum-sensor": {
|
|
18836
|
+
kind: "enum-sensor",
|
|
18837
|
+
label: "Sensor state",
|
|
18838
|
+
color: "#8b5cf6",
|
|
18839
|
+
icon: "generic",
|
|
18840
|
+
category: "sensor"
|
|
18841
|
+
},
|
|
18842
|
+
"event-emitter": {
|
|
18843
|
+
kind: "device-event",
|
|
18844
|
+
label: "Device event",
|
|
18845
|
+
color: "#10b981",
|
|
18846
|
+
icon: "button",
|
|
18847
|
+
category: "sensor"
|
|
18848
|
+
}
|
|
18849
|
+
};
|
|
18850
|
+
//#endregion
|
|
18618
18851
|
//#region src/capabilities/pipeline-orchestrator.cap.ts
|
|
18619
18852
|
var CameraPipelineConfigSchema = zod.z.object({
|
|
18620
18853
|
engine: PipelineEngineChoiceSchema.optional(),
|
|
@@ -23148,7 +23381,12 @@ var RecordingStorageUsageSchema = zod.z.object({
|
|
|
23148
23381
|
/**
|
|
23149
23382
|
* Result of locating footage at a wall-clock instant for one device/profile.
|
|
23150
23383
|
* `segment` carries the covering segment's window; `gap` reports the forward
|
|
23151
|
-
* nearest covered edge (`null` past the end of footage / when none exists)
|
|
23384
|
+
* nearest covered edge (`null` past the end of footage / when none exists)
|
|
23385
|
+
* and the backward covered edge `prevEndMs` (exclusive end of the nearest
|
|
23386
|
+
* footage behind the epoch; `null` when none — optional so older providers
|
|
23387
|
+
* that omit it stay valid). `prevEndMs` lets a backward frame-step hop the
|
|
23388
|
+
* small inter-segment cracks (durMs under-covers the span to the next
|
|
23389
|
+
* startMs by ~11-17 ms) instead of no-opping at a segment head.
|
|
23152
23390
|
*/
|
|
23153
23391
|
var LocateSegmentResultSchema = zod.z.discriminatedUnion("kind", [zod.z.object({
|
|
23154
23392
|
kind: zod.z.literal("segment"),
|
|
@@ -23157,7 +23395,8 @@ var LocateSegmentResultSchema = zod.z.discriminatedUnion("kind", [zod.z.object({
|
|
|
23157
23395
|
bytes: zod.z.number()
|
|
23158
23396
|
}), zod.z.object({
|
|
23159
23397
|
kind: zod.z.literal("gap"),
|
|
23160
|
-
nearestEdgeMs: zod.z.number().nullable()
|
|
23398
|
+
nearestEdgeMs: zod.z.number().nullable(),
|
|
23399
|
+
prevEndMs: zod.z.number().nullable().optional()
|
|
23161
23400
|
})]);
|
|
23162
23401
|
/** Raw bytes of one finalized footage segment (read off disk on the recording node). */
|
|
23163
23402
|
var ReadSegmentBytesResultSchema = zod.z.object({ data: zod.z.instanceof(Uint8Array) });
|
|
@@ -26073,6 +26312,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
26073
26312
|
addonId: null,
|
|
26074
26313
|
access: "view"
|
|
26075
26314
|
},
|
|
26315
|
+
"deviceManager.getLinkedDevices": {
|
|
26316
|
+
capName: "device-manager",
|
|
26317
|
+
capScope: "system",
|
|
26318
|
+
addonId: null,
|
|
26319
|
+
access: "view"
|
|
26320
|
+
},
|
|
26076
26321
|
"deviceManager.getRoleDisplayDefaults": {
|
|
26077
26322
|
capName: "device-manager",
|
|
26078
26323
|
capScope: "system",
|
|
@@ -27627,6 +27872,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
27627
27872
|
addonId: null,
|
|
27628
27873
|
access: "view"
|
|
27629
27874
|
},
|
|
27875
|
+
"pipelineAnalytics.getSensorEvents": {
|
|
27876
|
+
capName: "pipeline-analytics",
|
|
27877
|
+
capScope: "device",
|
|
27878
|
+
addonId: null,
|
|
27879
|
+
access: "view"
|
|
27880
|
+
},
|
|
27630
27881
|
"pipelineAnalytics.getTrack": {
|
|
27631
27882
|
capName: "pipeline-analytics",
|
|
27632
27883
|
capScope: "device",
|
|
@@ -27639,6 +27890,18 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
27639
27890
|
addonId: null,
|
|
27640
27891
|
access: "view"
|
|
27641
27892
|
},
|
|
27893
|
+
"pipelineAnalytics.listEventKinds": {
|
|
27894
|
+
capName: "pipeline-analytics",
|
|
27895
|
+
capScope: "device",
|
|
27896
|
+
addonId: null,
|
|
27897
|
+
access: "view"
|
|
27898
|
+
},
|
|
27899
|
+
"pipelineAnalytics.listRecentTracks": {
|
|
27900
|
+
capName: "pipeline-analytics",
|
|
27901
|
+
capScope: "device",
|
|
27902
|
+
addonId: null,
|
|
27903
|
+
access: "view"
|
|
27904
|
+
},
|
|
27642
27905
|
"pipelineAnalytics.listTracks": {
|
|
27643
27906
|
capName: "pipeline-analytics",
|
|
27644
27907
|
capScope: "device",
|
|
@@ -30585,6 +30848,7 @@ exports.DeviceExportStatusSchema = DeviceExportStatusSchema;
|
|
|
30585
30848
|
exports.DeviceExportUnexposeInputSchema = UnexposeInputSchema;
|
|
30586
30849
|
exports.DeviceFeature = require_sleep.DeviceFeature;
|
|
30587
30850
|
exports.DeviceInfoSchema = DeviceInfoSchema;
|
|
30851
|
+
exports.DeviceLinkModeSchema = DeviceLinkModeSchema;
|
|
30588
30852
|
exports.DeviceNetworkStatsSchema = DeviceNetworkStatsSchema;
|
|
30589
30853
|
exports.DeviceRole = require_sleep.DeviceRole;
|
|
30590
30854
|
exports.DeviceRuntimeState = DeviceRuntimeState;
|
|
@@ -30597,6 +30861,7 @@ exports.DiscoveredTargetSchema = DiscoveredTargetSchema;
|
|
|
30597
30861
|
exports.DisposerChain = require_sleep.DisposerChain;
|
|
30598
30862
|
exports.DoorbellPressEventSchema = DoorbellPressEventSchema;
|
|
30599
30863
|
exports.DoorbellStatusSchema = DoorbellStatusSchema;
|
|
30864
|
+
exports.EVENT_KIND_BY_CAP = EVENT_KIND_BY_CAP;
|
|
30600
30865
|
exports.EVENT_PAD_MS = EVENT_PAD_MS;
|
|
30601
30866
|
exports.EXPRESSION_BUILTINS = EXPRESSION_BUILTINS;
|
|
30602
30867
|
exports.EXPRESSION_BUILTIN_NAMES = EXPRESSION_BUILTIN_NAMES;
|
|
@@ -30615,6 +30880,9 @@ exports.EventCategory = require_event_category.EventCategory;
|
|
|
30615
30880
|
exports.EventEmitterStatusSchema = EventEmitterStatusSchema;
|
|
30616
30881
|
exports.EventFireSchema = EventFireSchema;
|
|
30617
30882
|
exports.EventItemSchema = EventItemSchema;
|
|
30883
|
+
exports.EventKindCategorySchema = EventKindCategorySchema;
|
|
30884
|
+
exports.EventKindDescriptorSchema = EventKindDescriptorSchema;
|
|
30885
|
+
exports.EventKindIconSchema = EventKindIconSchema;
|
|
30618
30886
|
exports.EventKindSchema = EventKindSchema;
|
|
30619
30887
|
exports.EventSourceType = require_enums.EventSourceType$1;
|
|
30620
30888
|
exports.ExportSetupFieldSchema = ExportSetupFieldSchema;
|
|
@@ -30659,6 +30927,7 @@ exports.KeyEventSchema = KeyEventSchema;
|
|
|
30659
30927
|
exports.LabelDefinitionSchema = LabelDefinitionSchema;
|
|
30660
30928
|
exports.LawnMowerActivitySchema = LawnMowerActivitySchema;
|
|
30661
30929
|
exports.LawnMowerControlStatusSchema = LawnMowerControlStatusSchema;
|
|
30930
|
+
exports.LinkedDeviceSchema = LinkedDeviceSchema;
|
|
30662
30931
|
exports.LlmDefaultSchema = LlmDefaultSchema;
|
|
30663
30932
|
exports.LlmDefaultSelectorSchema = LlmDefaultSelectorSchema;
|
|
30664
30933
|
exports.LlmErrorCodeSchema = LlmErrorCodeSchema;
|
|
@@ -30816,6 +31085,8 @@ exports.RawStateResultSchema = require_sleep.RawStateResultSchema;
|
|
|
30816
31085
|
exports.ReadSegmentBytesResultSchema = ReadSegmentBytesResultSchema;
|
|
30817
31086
|
exports.ReadinessRegistry = require_sleep.ReadinessRegistry;
|
|
30818
31087
|
exports.ReadinessTimeoutError = require_sleep.ReadinessTimeoutError;
|
|
31088
|
+
exports.RecentTracksPageSchema = RecentTracksPageSchema;
|
|
31089
|
+
exports.RecentTracksQueryInput = RecentTracksQueryInput;
|
|
30819
31090
|
exports.RecordingAvailabilitySchema = RecordingAvailabilitySchema;
|
|
30820
31091
|
exports.RecordingBandModeSchema = RecordingBandModeSchema;
|
|
30821
31092
|
exports.RecordingBandSchema = RecordingBandSchema;
|
|
@@ -30866,6 +31137,7 @@ exports.SearchResultSchema = SearchResultSchema;
|
|
|
30866
31137
|
exports.SendEmailInputSchema = SendEmailInputSchema;
|
|
30867
31138
|
exports.SendEmailResultSchema = SendEmailResultSchema;
|
|
30868
31139
|
exports.SendResultSchema = SendResultSchema;
|
|
31140
|
+
exports.SensorEventSchema = SensorEventSchema;
|
|
30869
31141
|
exports.ServerBootModeSchema = ServerBootModeSchema;
|
|
30870
31142
|
exports.ServerPackageStatusSchema = ServerPackageStatusSchema;
|
|
30871
31143
|
exports.ServerRollbackInfoSchema = ServerRollbackInfoSchema;
|
|
@@ -30934,8 +31206,11 @@ exports.TopologyNodeSchema = TopologyNodeSchema;
|
|
|
30934
31206
|
exports.TopologyProcessSchema = TopologyProcessSchema;
|
|
30935
31207
|
exports.TopologyServiceSchema = TopologyServiceSchema;
|
|
30936
31208
|
exports.TrackCascadeCountsSchema = TrackCascadeCountsSchema;
|
|
31209
|
+
exports.TrackEnvelopeSchema = TrackEnvelopeSchema;
|
|
31210
|
+
exports.TrackProjectionSchema = TrackProjectionSchema;
|
|
30937
31211
|
exports.TrackSchema = TrackSchema;
|
|
30938
31212
|
exports.TrackStateSchema = TrackStateSchema;
|
|
31213
|
+
exports.TrackZoneFilterSchema = TrackZoneFilterSchema;
|
|
30939
31214
|
exports.TrackedDetectionSchema = TrackedDetectionSchema;
|
|
30940
31215
|
exports.TurnServerSchema = TurnServerSchema;
|
|
30941
31216
|
exports.UNIT_TABLE = UNIT_TABLE;
|