@camera.ui/browser 0.0.109 → 0.0.111
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/bundle.js +1 -1
- package/dist/bundle.js.LICENSE.txt +11 -20
- package/dist/types/packages/client/browser/src/client.d.ts +5 -7
- package/dist/types/packages/client/browser/src/proxy/cameraDevice.d.ts +20 -24
- package/dist/types/packages/client/browser/src/proxy/coreManager.d.ts +10 -12
- package/dist/types/packages/client/browser/src/proxy/deviceManager.d.ts +10 -12
- package/dist/types/packages/client/browser/src/proxy.d.ts +7 -0
- package/dist/types/packages/client/browser/src/streaming/config.d.ts +21 -0
- package/dist/types/packages/client/browser/src/streaming/go2rts-session.d.ts +255 -40
- package/dist/types/packages/client/browser/src/streaming/types.d.ts +38 -0
- package/dist/types/packages/client/browser/src/types.d.ts +6 -8
- package/dist/types/packages/types/src/index.d.ts +304 -222
- package/dist/types/server/src/api/database/types.d.ts +17 -25
- package/dist/types/server/src/api/go2rtc/types.d.ts +66 -11
- package/dist/types/server/src/api/schemas/backup.schema.d.ts +24 -24
- package/dist/types/server/src/api/schemas/cameras.schema.d.ts +1414 -530
- package/dist/types/server/src/api/schemas/config.schema.d.ts +30 -42
- package/dist/types/server/src/api/schemas/go2rtc.schema.d.ts +186 -154
- package/dist/types/server/src/api/schemas/plugins.schema.d.ts +17 -17
- package/dist/types/server/src/api/schemas/storage.schema.d.ts +22 -0
- package/dist/types/server/src/api/schemas/system.schema.d.ts +171 -3
- package/dist/types/server/src/api/schemas/users.schema.d.ts +162 -318
- package/dist/types/server/src/api/types/index.d.ts +48 -46
- package/dist/types/server/src/api/websocket/types.d.ts +4 -2
- package/dist/types/server/src/camera/classes.d.ts +2 -0
- package/dist/types/{packages/plugineer/src/polyglot/node → server/src}/camera/index.d.ts +33 -32
- package/dist/types/server/src/camera/interfaces.d.ts +17 -0
- package/dist/types/{packages/plugineer/src/polyglot/node → server/src}/camera/polygon.d.ts +2 -2
- package/dist/types/server/src/camera/types.d.ts +16 -10
- package/dist/types/server/src/go2rtc/types.d.ts +5 -4
- package/dist/types/server/src/manager/types.d.ts +15 -0
- package/dist/types/server/src/plugins/schema.d.ts +27 -34
- package/dist/types/server/src/plugins/types.d.ts +43 -1
- package/dist/types/server/src/rpc/namespaces.d.ts +35 -0
- package/dist/types/server/src/rpc/types.d.ts +111 -0
- package/dist/types/server/src/services/config/defaults.d.ts +12 -0
- package/dist/types/server/src/services/config/types.d.ts +10 -4
- package/dist/types/server/src/types.d.ts +3 -0
- package/dist/types/shared/types/index.d.ts +9 -8
- package/package.json +19 -16
- package/dist/types/packages/client/browser/src/socket.d.ts +0 -15
- package/dist/types/packages/common/src/nats/messageQueue.d.ts +0 -48
- package/dist/types/packages/common/src/nats/nats.d.ts +0 -30
- package/dist/types/packages/common/src/nats/packer.d.ts +0 -2
- package/dist/types/packages/plugineer/src/polyglot/node/camera/interfaces/camera.d.ts +0 -8
- package/dist/types/packages/plugineer/src/polyglot/node/camera/interfaces/ptz.d.ts +0 -11
- package/dist/types/packages/plugineer/src/polyglot/node/camera/types.d.ts +0 -18
- package/dist/types/packages/plugineer/src/polyglot/node/plugins/schema.d.ts +0 -62
- package/dist/types/packages/plugineer/src/polyglot/node/plugins/types.d.ts +0 -135
- package/dist/types/packages/plugineer/src/types.d.ts +0 -4
- package/dist/types/server/src/api/controllers/api.controller.d.ts +0 -7
- package/dist/types/server/src/api/controllers/auth.controller.d.ts +0 -16
- package/dist/types/server/src/api/controllers/backup.controller.d.ts +0 -10
- package/dist/types/server/src/api/controllers/cameras.controller.d.ts +0 -38
- package/dist/types/server/src/api/controllers/config.controller.d.ts +0 -14
- package/dist/types/server/src/api/controllers/files.controller.d.ts +0 -8
- package/dist/types/server/src/api/controllers/frameWorkers.controller.d.ts +0 -11
- package/dist/types/server/src/api/controllers/plugins.controller.d.ts +0 -48
- package/dist/types/server/src/api/controllers/system.controller.d.ts +0 -23
- package/dist/types/server/src/api/controllers/users.controller.d.ts +0 -28
- package/dist/types/server/src/api/database/checks.d.ts +0 -55
- package/dist/types/server/src/api/database/constants.d.ts +0 -8
- package/dist/types/server/src/api/database/index.d.ts +0 -30
- package/dist/types/server/src/api/database/migration.d.ts +0 -15
- package/dist/types/server/src/api/database/selfcheck.d.ts +0 -48
- package/dist/types/server/src/api/go2rtc/api/application.d.ts +0 -9
- package/dist/types/server/src/api/go2rtc/api/config.d.ts +0 -8
- package/dist/types/server/src/api/go2rtc/api/index.d.ts +0 -1
- package/dist/types/server/src/api/go2rtc/api/snapshot.d.ts +0 -8
- package/dist/types/server/src/api/go2rtc/api/streams.d.ts +0 -12
- package/dist/types/server/src/api/go2rtc/index.d.ts +0 -14
- package/dist/types/server/src/api/go2rtc/queue.d.ts +0 -10
- package/dist/types/server/src/api/index.d.ts +0 -22
- package/dist/types/server/src/api/middlewares/authPermission.middleware.d.ts +0 -5
- package/dist/types/server/src/api/middlewares/authValidation.middleware.d.ts +0 -4
- package/dist/types/server/src/api/middlewares/pagination.middleware.d.ts +0 -3
- package/dist/types/server/src/api/middlewares/socketAuth.middleware.d.ts +0 -41
- package/dist/types/server/src/api/plugins/header.plugin.d.ts +0 -2
- package/dist/types/server/src/api/plugins/socket.plugin.d.ts +0 -11
- package/dist/types/server/src/api/plugins/system.plugin.d.ts +0 -20
- package/dist/types/server/src/api/plugins/useragent.plugin.d.ts +0 -8
- package/dist/types/server/src/api/routes/api.routes.d.ts +0 -2
- package/dist/types/server/src/api/routes/auth.routes.d.ts +0 -2
- package/dist/types/server/src/api/routes/backup.routes.d.ts +0 -2
- package/dist/types/server/src/api/routes/cameras.routes.d.ts +0 -2
- package/dist/types/server/src/api/routes/config.routes.d.ts +0 -2
- package/dist/types/server/src/api/routes/files.routes.d.ts +0 -2
- package/dist/types/server/src/api/routes/frameWorkers.routes.d.ts +0 -2
- package/dist/types/server/src/api/routes/index.d.ts +0 -6
- package/dist/types/server/src/api/routes/plugins.routes.d.ts +0 -2
- package/dist/types/server/src/api/routes/system.routes.d.ts +0 -2
- package/dist/types/server/src/api/routes/users.routes.d.ts +0 -2
- package/dist/types/server/src/api/services/auth.service.d.ts +0 -24
- package/dist/types/server/src/api/services/backup.service.d.ts +0 -11
- package/dist/types/server/src/api/services/cameras.service.d.ts +0 -55
- package/dist/types/server/src/api/services/plugins.service.d.ts +0 -38
- package/dist/types/server/src/api/services/system.service.d.ts +0 -13
- package/dist/types/server/src/api/services/users.service.d.ts +0 -25
- package/dist/types/server/src/api/utils/cameraSource.d.ts +0 -6
- package/dist/types/server/src/api/utils/cert.d.ts +0 -11
- package/dist/types/server/src/api/utils/constants.d.ts +0 -13
- package/dist/types/server/src/api/utils/fetch.d.ts +0 -1
- package/dist/types/server/src/api/utils/moveFiles.d.ts +0 -4
- package/dist/types/server/src/api/utils/parse.d.ts +0 -2
- package/dist/types/server/src/api/websocket/go2rtc.d.ts +0 -21
- package/dist/types/server/src/api/websocket/index.d.ts +0 -16
- package/dist/types/server/src/api/websocket/nsp/logs.d.ts +0 -19
- package/dist/types/server/src/api/websocket/nsp/main.d.ts +0 -9
- package/dist/types/server/src/api/websocket/nsp/metrics.d.ts +0 -24
- package/dist/types/server/src/api/websocket/nsp/notifications.d.ts +0 -12
- package/dist/types/server/src/api/websocket/nsp/plugins.d.ts +0 -13
- package/dist/types/server/src/api/websocket/nsp/proxy.d.ts +0 -27
- package/dist/types/server/src/api/websocket/nsp/server.d.ts +0 -26
- package/dist/types/server/src/api/websocket/nsp/status.d.ts +0 -15
- package/dist/types/server/src/api.d.ts +0 -29
- package/dist/types/server/src/camera/controller.d.ts +0 -61
- package/dist/types/server/src/camera/frameWorker.d.ts +0 -45
- package/dist/types/server/src/go2rtc/index.d.ts +0 -25
- package/dist/types/server/src/main.d.ts +0 -25
- package/dist/types/server/src/nats/index.d.ts +0 -40
- package/dist/types/server/src/nats/proxy/cameraDevice.d.ts +0 -22
- package/dist/types/server/src/nats/proxy/coreManager.d.ts +0 -14
- package/dist/types/server/src/nats/proxy/deviceManager.d.ts +0 -14
- package/dist/types/server/src/nats/server.d.ts +0 -38
- package/dist/types/server/src/nats/types.d.ts +0 -18
- package/dist/types/server/src/nats/utils.d.ts +0 -2
- package/dist/types/server/src/plugins/index.d.ts +0 -33
- package/dist/types/server/src/plugins/plugin.d.ts +0 -35
- package/dist/types/server/src/plugins/worker.d.ts +0 -55
- package/dist/types/server/src/services/config/constants.d.ts +0 -6
- package/dist/types/server/src/services/config/index.d.ts +0 -67
- package/dist/types/server/src/services/logger/index.d.ts +0 -16
- /package/dist/types/{packages/plugineer/src/polyglot/node → server/src}/camera/iou.d.ts +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Observable, ReplaySubject, Subject, Subscription } from 'rxjs';
|
|
2
2
|
import type sharp from 'sharp';
|
|
3
3
|
import type { ConnectionState, RTCIceCandidate, RTCSessionDescription, RtpPacket } from 'werift';
|
|
4
|
+
export type { Observable, ReplaySubject, Subject, Subscription } from 'rxjs';
|
|
4
5
|
export type { ConnectionState, RTCIceCandidate, RTCSessionDescription, RtpPacket, sharp };
|
|
5
6
|
export type JSONObject = Record<string, JSONValue>;
|
|
6
7
|
export interface JSONValue {
|
|
@@ -11,19 +12,23 @@ export type Path = (number | string)[] | number | string;
|
|
|
11
12
|
export type CameraType = 'camera' | 'doorbell';
|
|
12
13
|
export type ZoneType = 'intersect' | 'contain';
|
|
13
14
|
export type ZoneFilter = 'include' | 'exclude';
|
|
14
|
-
export type ObjectClass = 'person' | '
|
|
15
|
-
export type
|
|
16
|
-
export type
|
|
17
|
-
export type
|
|
15
|
+
export type ObjectClass = 'person' | 'vehicle' | 'animal' | 'other' | 'motion';
|
|
16
|
+
export type CameraRole = 'high-resolution' | 'mid-resolution' | 'low-resolution' | 'snapshot';
|
|
17
|
+
export type StreamingRole = Exclude<CameraRole, 'snapshot'>;
|
|
18
|
+
export type DecoderFormat = 'yuv420p' | 'rgb24' | 'nv12';
|
|
19
|
+
export type ImageInputFormat = 'yuv420p' | 'nv12' | 'rgb' | 'rgba' | 'gray';
|
|
18
20
|
export type ImageOutputFormat = 'rgb' | 'rgba' | 'gray';
|
|
19
21
|
export type CameraExtension = 'cameraController' | 'hub' | 'motionDetection' | 'objectDetection' | 'audioDetection' | 'ptz';
|
|
20
|
-
export type CameraFrameWorkerDecoder = 'pillow' | 'wasm' | 'rust';
|
|
21
|
-
export type CameraFrameWorkerResolution = '
|
|
22
|
-
export type AudioCodec = 'PCMU' | 'PCMA' | 'MPEG4-GENERIC' | 'opus' | 'G722' | 'MPA' | 'PCM' | 'FLAC';
|
|
22
|
+
export type CameraFrameWorkerDecoder = 'pillow' | 'wasm' | 'rust' | 'gpu';
|
|
23
|
+
export type CameraFrameWorkerResolution = '640x480' | '640x360' | '320x240' | '320x180';
|
|
24
|
+
export type AudioCodec = 'PCMU' | 'PCMA' | 'MPEG4-GENERIC' | 'opus' | 'G722' | 'MPA' | 'PCM' | 'FLAC' | 'ELD' | 'PCML' | 'L16';
|
|
23
25
|
export type AudioFFmpegCodec = 'pcm_mulaw' | 'pcm_alaw' | 'aac' | 'libopus' | 'g722' | 'mp3' | 'pcm_s16be' | 'pcm_s16le' | 'flac';
|
|
24
26
|
export type VideoCodec = 'H264' | 'H265' | 'VP8' | 'VP9' | 'AV1' | 'JPEG' | 'RAW';
|
|
25
27
|
export type VideoFFmpegCodec = 'h264' | 'hevc' | 'vp8' | 'vp9' | 'av1' | 'mjpeg' | 'rawvideo';
|
|
26
28
|
export type PythonVersion = '3.9' | '3.10' | '3.11' | '3.12';
|
|
29
|
+
export type RTSPAudioCodec = 'aac' | 'opus' | 'pcma';
|
|
30
|
+
export type ProbeAudioCodec = 'aac' | 'opus' | 'pcma';
|
|
31
|
+
export type HwAccelMethod = 'auto' | 'cuda' | 'vaapi' | 'videotoolbox' | 'qsv' | 'rkmpp' | 'v4l2m2m' | 'opencl' | 'vulkan' | 'amf' | 'jetson';
|
|
27
32
|
export interface CameraInformation {
|
|
28
33
|
model?: string;
|
|
29
34
|
manufacturer?: string;
|
|
@@ -44,22 +49,6 @@ export interface Detection {
|
|
|
44
49
|
origWidth: number;
|
|
45
50
|
origHeight: number;
|
|
46
51
|
}
|
|
47
|
-
export interface ZoneCoord {
|
|
48
|
-
_id: string;
|
|
49
|
-
points: Point;
|
|
50
|
-
}
|
|
51
|
-
export interface ZoneRegion {
|
|
52
|
-
_id: string;
|
|
53
|
-
coords: ZoneCoord[];
|
|
54
|
-
type: ZoneType;
|
|
55
|
-
filter: ZoneFilter;
|
|
56
|
-
classes: ObjectClass[];
|
|
57
|
-
isPrivacyMask: boolean;
|
|
58
|
-
}
|
|
59
|
-
export interface CameraZone {
|
|
60
|
-
name: string;
|
|
61
|
-
regions: ZoneRegion[];
|
|
62
|
-
}
|
|
63
52
|
export interface DetectionZone {
|
|
64
53
|
name: string;
|
|
65
54
|
points: Point[];
|
|
@@ -67,6 +56,7 @@ export interface DetectionZone {
|
|
|
67
56
|
filter: ZoneFilter;
|
|
68
57
|
classes: ObjectClass[];
|
|
69
58
|
isPrivacyMask: boolean;
|
|
59
|
+
color: string;
|
|
70
60
|
}
|
|
71
61
|
export interface MotionDetectionSettings {
|
|
72
62
|
timeout: number;
|
|
@@ -74,7 +64,7 @@ export interface MotionDetectionSettings {
|
|
|
74
64
|
export interface ObjectDetectionSettings {
|
|
75
65
|
confidence: number;
|
|
76
66
|
}
|
|
77
|
-
export interface
|
|
67
|
+
export interface CameraDetectionSettings {
|
|
78
68
|
motion: MotionDetectionSettings;
|
|
79
69
|
object: ObjectDetectionSettings;
|
|
80
70
|
}
|
|
@@ -86,15 +76,18 @@ export interface CameraFrameWorkerSettings {
|
|
|
86
76
|
export interface CameraInput {
|
|
87
77
|
readonly _id: string;
|
|
88
78
|
name: string;
|
|
89
|
-
|
|
79
|
+
role: CameraRole;
|
|
80
|
+
useForSnapshot: boolean;
|
|
81
|
+
hotMode: boolean;
|
|
90
82
|
urls: StreamUrls;
|
|
91
|
-
internal: boolean;
|
|
92
83
|
}
|
|
93
84
|
export interface RTPInfo {
|
|
94
85
|
payload?: number;
|
|
95
86
|
codec: string;
|
|
96
|
-
|
|
97
|
-
|
|
87
|
+
profile?: string;
|
|
88
|
+
rate?: number;
|
|
89
|
+
encoding?: number;
|
|
90
|
+
level?: number;
|
|
98
91
|
}
|
|
99
92
|
export interface FMTPInfo {
|
|
100
93
|
payload: number;
|
|
@@ -124,9 +117,9 @@ export interface VideoStreamInfo {
|
|
|
124
117
|
direction: 'sendonly' | 'recvonly' | 'sendrecv' | 'inactive';
|
|
125
118
|
}
|
|
126
119
|
export interface ProbeConfig {
|
|
127
|
-
video?:
|
|
128
|
-
audio?:
|
|
129
|
-
microphone?:
|
|
120
|
+
video?: boolean;
|
|
121
|
+
audio?: boolean | 'all' | ProbeAudioCodec[];
|
|
122
|
+
microphone?: boolean;
|
|
130
123
|
}
|
|
131
124
|
export interface ProbeStream {
|
|
132
125
|
sdp: string;
|
|
@@ -136,40 +129,25 @@ export interface ProbeStream {
|
|
|
136
129
|
export interface StreamUrls {
|
|
137
130
|
ws: Go2RtcWSSource;
|
|
138
131
|
rtsp: Go2RtcRTSPSource;
|
|
139
|
-
|
|
132
|
+
snapshot: Go2RtcSnapshotSource;
|
|
133
|
+
}
|
|
134
|
+
export interface Go2RtcWSSource {
|
|
135
|
+
webrtc: string;
|
|
136
|
+
mse: string;
|
|
140
137
|
}
|
|
141
138
|
export interface Go2RtcRTSPSource {
|
|
139
|
+
base: string;
|
|
142
140
|
default: string;
|
|
143
|
-
|
|
144
|
-
h264: string;
|
|
145
|
-
h265: string;
|
|
141
|
+
muted: string;
|
|
146
142
|
aac: string;
|
|
147
143
|
opus: string;
|
|
148
144
|
pcma: string;
|
|
149
|
-
|
|
145
|
+
onvif: string;
|
|
150
146
|
}
|
|
151
|
-
export interface
|
|
152
|
-
webrtc: string;
|
|
153
|
-
mse: string;
|
|
154
|
-
lmp4: string;
|
|
155
|
-
mmp4: string;
|
|
147
|
+
export interface Go2RtcSnapshotSource {
|
|
156
148
|
mp4: string;
|
|
157
|
-
|
|
158
|
-
jpegSnapshot: string;
|
|
159
|
-
lHlsTs: string;
|
|
160
|
-
lHlsFmp4: string;
|
|
161
|
-
mHlsFmp4: string;
|
|
149
|
+
jpeg: string;
|
|
162
150
|
mjpeg: string;
|
|
163
|
-
mjpegHtml: string;
|
|
164
|
-
}
|
|
165
|
-
export interface Go2RtcSource {
|
|
166
|
-
name: string;
|
|
167
|
-
src: string;
|
|
168
|
-
ws: string;
|
|
169
|
-
}
|
|
170
|
-
export interface Go2RtcWSSource {
|
|
171
|
-
webrtc: string;
|
|
172
|
-
mse: string;
|
|
173
151
|
}
|
|
174
152
|
export interface BaseState<T extends LightState | AudioState | MotionState | ObjectState | SirenState | BatteryState | DoorbellState> {
|
|
175
153
|
timestamp: number;
|
|
@@ -227,8 +205,10 @@ export interface SetValues {
|
|
|
227
205
|
battery: BatterySetEvent;
|
|
228
206
|
}
|
|
229
207
|
export interface FrameData {
|
|
230
|
-
|
|
208
|
+
data: Uint8Array;
|
|
231
209
|
timestamp: number;
|
|
210
|
+
metadata: FrameMetadata;
|
|
211
|
+
info: ImageInformation;
|
|
232
212
|
}
|
|
233
213
|
export interface FrameMetadata {
|
|
234
214
|
format: DecoderFormat;
|
|
@@ -241,7 +221,7 @@ export interface FrameMetadata {
|
|
|
241
221
|
export interface ImageInformation {
|
|
242
222
|
width: number;
|
|
243
223
|
height: number;
|
|
244
|
-
channels:
|
|
224
|
+
channels: number;
|
|
245
225
|
format: ImageInputFormat;
|
|
246
226
|
}
|
|
247
227
|
export interface ImageCrop {
|
|
@@ -270,83 +250,71 @@ export interface FrameBuffer {
|
|
|
270
250
|
image: Uint8Array;
|
|
271
251
|
info: ImageInformation;
|
|
272
252
|
}
|
|
253
|
+
export interface MotionDetectionFrame {
|
|
254
|
+
frame: FrameData;
|
|
255
|
+
state: MotionSetEvent;
|
|
256
|
+
}
|
|
273
257
|
export interface VideoFrame {
|
|
274
|
-
readonly
|
|
258
|
+
readonly data: Uint8Array;
|
|
275
259
|
readonly metadata: FrameMetadata;
|
|
260
|
+
readonly info: ImageInformation;
|
|
261
|
+
readonly timestamp: number;
|
|
276
262
|
readonly inputWidth: number;
|
|
277
263
|
readonly inputHeight: number;
|
|
278
264
|
readonly inputFormat: DecoderFormat;
|
|
265
|
+
readonly motion?: MotionSetEvent;
|
|
279
266
|
toBuffer(options?: ImageOptions): Promise<FrameBuffer>;
|
|
280
267
|
toImage(options?: ImageOptions): Promise<FrameImage>;
|
|
281
268
|
save(path: string, options?: ImageOptions): Promise<void>;
|
|
282
269
|
}
|
|
283
|
-
export
|
|
284
|
-
readonly motion: MotionState;
|
|
285
|
-
}
|
|
270
|
+
export type FrameType = 'stream' | 'motion';
|
|
286
271
|
export interface CameraInputSettings {
|
|
287
272
|
readonly _id: string;
|
|
288
273
|
name: string;
|
|
289
|
-
|
|
274
|
+
role: CameraRole;
|
|
275
|
+
useForSnapshot: boolean;
|
|
276
|
+
hotMode: boolean;
|
|
290
277
|
urls: string[];
|
|
291
|
-
internal: boolean;
|
|
292
278
|
}
|
|
293
|
-
export interface CameraConfigInputSettings extends Omit<CameraInputSettings, '_id' | '
|
|
279
|
+
export interface CameraConfigInputSettings extends Omit<CameraInputSettings, '_id' | 'urls'> {
|
|
280
|
+
urls?: string[];
|
|
294
281
|
}
|
|
295
282
|
export interface BaseCameraConfig {
|
|
296
283
|
name: string;
|
|
297
284
|
nativeId?: string;
|
|
298
285
|
isCloud?: boolean;
|
|
299
|
-
hasLight?: boolean;
|
|
300
|
-
hasSiren?: boolean;
|
|
301
|
-
hasBinarySensor?: boolean;
|
|
302
|
-
hasBattery?: boolean;
|
|
303
286
|
disabled?: boolean;
|
|
304
287
|
info?: Partial<CameraInformation>;
|
|
305
288
|
}
|
|
306
289
|
export type CameraConfig = BaseCameraConfig & {
|
|
307
290
|
sources: CameraConfigInputSettings[];
|
|
308
291
|
};
|
|
309
|
-
export interface
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
export interface CameraDelegates {
|
|
319
|
-
cameraDelegate: CameraDelegate;
|
|
320
|
-
ptzDelegate: CameraPTZDelegate;
|
|
321
|
-
}
|
|
322
|
-
export type InternalSourceType = 'aac' | 'opus' | 'pcma';
|
|
323
|
-
export interface CameraBaseSource extends CameraInput {
|
|
292
|
+
export interface RTSPUrlOptions {
|
|
293
|
+
video?: boolean;
|
|
294
|
+
audio?: boolean | RTSPAudioCodec | RTSPAudioCodec[];
|
|
295
|
+
audioSingleTrack?: boolean;
|
|
296
|
+
backchannel?: boolean;
|
|
297
|
+
timeout?: number;
|
|
298
|
+
}
|
|
299
|
+
export interface CameraSource extends CameraInput {
|
|
300
|
+
snapshot(forceNew?: boolean): Promise<ArrayBuffer | undefined>;
|
|
324
301
|
probeStream(probeConfig?: ProbeConfig, refresh?: boolean): Promise<ProbeStream | undefined>;
|
|
325
302
|
}
|
|
326
|
-
export interface CameraSource extends CameraBaseSource {
|
|
327
|
-
getInternalSource(type: InternalSourceType): CameraInternalSource;
|
|
328
|
-
}
|
|
329
|
-
export interface CameraInternalSource extends CameraBaseSource {
|
|
330
|
-
type: InternalSourceType;
|
|
331
|
-
}
|
|
332
303
|
export interface CameraDeviceSource extends CameraSource {
|
|
333
|
-
|
|
334
|
-
createWebRTCSession(options?: WebRTCConnectionOptions): WeriftSession;
|
|
335
|
-
createRTSPSession(options?: RTSPConnectionOptions): RTSPSession;
|
|
336
|
-
createFMP4Session(): FMP4Session;
|
|
337
|
-
}
|
|
338
|
-
export interface CameraDeviceInternalSource extends CameraBaseSource {
|
|
304
|
+
generateRTSPUrl(options?: RTSPUrlOptions): string;
|
|
339
305
|
createWebRTCSession(options?: WebRTCConnectionOptions): WeriftSession;
|
|
340
306
|
createRTSPSession(options?: RTSPConnectionOptions): RTSPSession;
|
|
341
|
-
createFMP4Session(): FMP4Session;
|
|
342
|
-
type: InternalSourceType;
|
|
307
|
+
createFMP4Session(options?: FMP4ConnectionOptions): FMP4Session;
|
|
343
308
|
}
|
|
344
309
|
export interface WebRTCConnectionOptions {
|
|
345
310
|
createPeerConnection?: () => BasicPeerConnection;
|
|
346
311
|
iceServers?: IceServer[];
|
|
347
312
|
}
|
|
348
313
|
export interface RTSPConnectionOptions {
|
|
349
|
-
|
|
314
|
+
url?: string;
|
|
315
|
+
}
|
|
316
|
+
export interface FMP4ConnectionOptions {
|
|
317
|
+
url?: string;
|
|
350
318
|
}
|
|
351
319
|
export interface Subscribed {
|
|
352
320
|
addSubscriptions(...subscriptions: Subscription[]): void;
|
|
@@ -431,6 +399,29 @@ export interface BasicPeerConnection {
|
|
|
431
399
|
close(): void;
|
|
432
400
|
requestKeyFrame?: () => void;
|
|
433
401
|
}
|
|
402
|
+
export type VideoStreamingMode = 'auto' | 'webrtc' | 'mse' | 'webrtc/tcp';
|
|
403
|
+
export type CameraAspectRatio = '16:9' | '8:3' | '4:3' | 'auto';
|
|
404
|
+
export interface CameraUiSettings {
|
|
405
|
+
streamingMode: VideoStreamingMode;
|
|
406
|
+
streamingSource: StreamingRole | 'auto';
|
|
407
|
+
aspectRatio: CameraAspectRatio;
|
|
408
|
+
}
|
|
409
|
+
export interface CameraRecordingSettings {
|
|
410
|
+
enabled: boolean;
|
|
411
|
+
}
|
|
412
|
+
export interface Extension {
|
|
413
|
+
id: string;
|
|
414
|
+
name: string;
|
|
415
|
+
}
|
|
416
|
+
export interface CameraExtensions {
|
|
417
|
+
hub?: Extension[];
|
|
418
|
+
cameraController?: Extension;
|
|
419
|
+
motionDetection?: Extension;
|
|
420
|
+
audioDetection?: Extension;
|
|
421
|
+
objectDetection?: Extension;
|
|
422
|
+
ptz?: Extension;
|
|
423
|
+
plugins: Extension[];
|
|
424
|
+
}
|
|
434
425
|
export interface BaseCamera {
|
|
435
426
|
readonly _id: string;
|
|
436
427
|
nativeId?: string;
|
|
@@ -438,58 +429,111 @@ export interface BaseCamera {
|
|
|
438
429
|
name: string;
|
|
439
430
|
disabled: boolean;
|
|
440
431
|
isCloud: boolean;
|
|
441
|
-
hasLight: boolean;
|
|
442
|
-
hasSiren: boolean;
|
|
443
|
-
hasBinarySensor: boolean;
|
|
444
|
-
hasBattery: boolean;
|
|
445
432
|
info: CameraInformation;
|
|
446
433
|
type: CameraType;
|
|
447
434
|
snapshotTTL: number;
|
|
448
|
-
|
|
449
|
-
|
|
435
|
+
detectionZones: DetectionZone[];
|
|
436
|
+
detectionSettings: CameraDetectionSettings;
|
|
450
437
|
frameWorkerSettings: CameraFrameWorkerSettings;
|
|
438
|
+
interface: CameraUiSettings;
|
|
439
|
+
recording: CameraRecordingSettings;
|
|
440
|
+
extensions: CameraExtensions;
|
|
451
441
|
}
|
|
452
|
-
export interface Camera extends
|
|
453
|
-
hasAudioDetector: boolean;
|
|
454
|
-
hasMotionDetector: boolean;
|
|
455
|
-
hasObjectDetector: boolean;
|
|
456
|
-
extendedMotionDetector: boolean;
|
|
457
|
-
hasPtz: boolean;
|
|
442
|
+
export interface Camera extends BaseCamera {
|
|
458
443
|
sources: CameraInput[];
|
|
459
|
-
|
|
444
|
+
}
|
|
445
|
+
export declare enum CameraDeviceCapability {
|
|
446
|
+
MotionSensor = "MotionSensor",
|
|
447
|
+
MotionDetector = "MotionDetector",
|
|
448
|
+
AudioSensor = "AudioSensor",
|
|
449
|
+
ObjectSensor = "ObjectSensor",
|
|
450
|
+
ObjectDetector = "ObjectDetector",
|
|
451
|
+
Light = "Light",
|
|
452
|
+
Siren = "Siren",
|
|
453
|
+
Doorbell = "Doorbell",
|
|
454
|
+
Battery = "Battery",
|
|
455
|
+
PTZ = "PTZ",
|
|
456
|
+
PTZZoom = "PTZZoom",
|
|
457
|
+
PTZHome = "PTZHome",
|
|
458
|
+
PTZPresets = "PTZPresets",
|
|
459
|
+
Snapshot = "Snapshot",
|
|
460
|
+
StreamUrl = "StreamUrl",
|
|
461
|
+
Reboot = "Reboot"
|
|
462
|
+
}
|
|
463
|
+
export type PTZMovementType = 'absolute' | 'relative' | 'continuous' | 'home' | 'preset' | 'stop';
|
|
464
|
+
export interface PTZSpeed {
|
|
465
|
+
pan?: number;
|
|
466
|
+
tilt?: number;
|
|
467
|
+
zoom?: number;
|
|
468
|
+
}
|
|
469
|
+
export interface PTZBaseCommand {
|
|
470
|
+
type: PTZMovementType;
|
|
471
|
+
speed?: PTZSpeed;
|
|
472
|
+
}
|
|
473
|
+
export interface PTZStopCommand extends PTZBaseCommand {
|
|
474
|
+
type: 'stop';
|
|
475
|
+
}
|
|
476
|
+
export interface PTZHomeCommand extends PTZBaseCommand {
|
|
477
|
+
type: 'home';
|
|
478
|
+
}
|
|
479
|
+
export interface PTZPresetCommand extends PTZBaseCommand {
|
|
480
|
+
type: 'preset';
|
|
481
|
+
preset: string;
|
|
482
|
+
}
|
|
483
|
+
export interface PTZMoveCommand extends PTZBaseCommand {
|
|
484
|
+
type: 'absolute' | 'relative';
|
|
485
|
+
pan?: number;
|
|
486
|
+
tilt?: number;
|
|
487
|
+
zoom?: number;
|
|
488
|
+
}
|
|
489
|
+
export interface PTZContinuousMoveCommand extends PTZBaseCommand {
|
|
490
|
+
type: 'continuous';
|
|
491
|
+
pan?: number;
|
|
492
|
+
tilt?: number;
|
|
493
|
+
zoom?: number;
|
|
494
|
+
timeout?: number;
|
|
495
|
+
}
|
|
496
|
+
export type PTZCommand = PTZHomeCommand | PTZPresetCommand | PTZMoveCommand | PTZContinuousMoveCommand | PTZStopCommand;
|
|
497
|
+
export interface PTZInterface {
|
|
498
|
+
ptzCommand(command: PTZCommand): Promise<void>;
|
|
499
|
+
}
|
|
500
|
+
export interface SnapshotInterface {
|
|
501
|
+
snapshot(sourceId: string, forceNew?: boolean): Promise<ArrayBuffer | undefined>;
|
|
502
|
+
}
|
|
503
|
+
export interface StreamingInterface {
|
|
504
|
+
streamUrl(sourceName: string): Promise<string>;
|
|
460
505
|
}
|
|
461
506
|
export interface CameraDevice {
|
|
462
507
|
readonly id: string;
|
|
463
508
|
readonly nativeId: string | undefined;
|
|
464
509
|
readonly pluginId: string;
|
|
465
|
-
readonly connected: boolean;
|
|
466
510
|
readonly disabled: boolean;
|
|
467
511
|
readonly name: string;
|
|
468
512
|
readonly type: CameraType;
|
|
469
513
|
readonly snapshotTTL: number;
|
|
470
514
|
readonly info: CameraInformation;
|
|
471
515
|
readonly isCloud: boolean;
|
|
516
|
+
readonly detectionZones: DetectionZone[];
|
|
517
|
+
readonly detectionSettings: CameraDetectionSettings;
|
|
518
|
+
readonly frameWorkerSettings: CameraFrameWorkerSettings;
|
|
472
519
|
readonly hasLight: boolean;
|
|
473
520
|
readonly hasSiren: boolean;
|
|
474
|
-
readonly
|
|
521
|
+
readonly hasDoorbell: boolean;
|
|
475
522
|
readonly hasBattery: boolean;
|
|
476
523
|
readonly hasMotionDetector: boolean;
|
|
477
|
-
readonly extendedMotionDetector: boolean;
|
|
478
524
|
readonly hasAudioDetector: boolean;
|
|
479
525
|
readonly hasObjectDetector: boolean;
|
|
480
526
|
readonly hasPtz: boolean;
|
|
481
|
-
readonly
|
|
482
|
-
readonly activitySettings: CameraActivitySettings;
|
|
483
|
-
readonly frameWorkerSettings: CameraFrameWorkerSettings;
|
|
484
|
-
readonly ptz: CameraPTZDelegate;
|
|
527
|
+
readonly sources: CameraDeviceSource[];
|
|
485
528
|
readonly streamSource: CameraDeviceSource;
|
|
486
529
|
readonly highResolutionSource: CameraDeviceSource | undefined;
|
|
487
530
|
readonly midResolutionSource: CameraDeviceSource | undefined;
|
|
488
531
|
readonly lowResolutionSource: CameraDeviceSource | undefined;
|
|
489
|
-
readonly snapshotSource:
|
|
490
|
-
readonly
|
|
491
|
-
readonly
|
|
532
|
+
readonly snapshotSource: CameraSource | undefined;
|
|
533
|
+
readonly connected: boolean;
|
|
534
|
+
readonly frameWorkerConnected: boolean;
|
|
492
535
|
readonly onConnected: Observable<boolean>;
|
|
536
|
+
readonly onFrameWorkerConnected: Observable<boolean>;
|
|
493
537
|
readonly onLightSwitched: Observable<LightState>;
|
|
494
538
|
readonly onMotionDetected: Observable<MotionState>;
|
|
495
539
|
readonly onAudioDetected: Observable<AudioState>;
|
|
@@ -498,7 +542,14 @@ export interface CameraDevice {
|
|
|
498
542
|
readonly onSirenDetected: Observable<SirenState>;
|
|
499
543
|
readonly onBatteryChanged: Observable<BatteryState>;
|
|
500
544
|
readonly logger: LoggerService;
|
|
501
|
-
|
|
545
|
+
extend(interfaces: PTZInterface | SnapshotInterface | StreamingInterface): void;
|
|
546
|
+
connect(): Promise<void>;
|
|
547
|
+
disconnect(): Promise<void>;
|
|
548
|
+
getFrames(type: 'stream', options?: ImageOptions): AsyncIterableIterator<VideoFrame>;
|
|
549
|
+
getFrames(type: 'motion', options?: ImageOptions): AsyncIterableIterator<VideoFrame>;
|
|
550
|
+
getValue<T extends keyof StateValues>(stateName: T): StateValues[T];
|
|
551
|
+
updateState<T extends keyof Omit<SetValues, 'motion'>>(stateName: T, eventData: SetValues[T]): Promise<void>;
|
|
552
|
+
updateState(stateName: 'motion', eventData: MotionSetEvent, frame?: VideoFrame): Promise<void>;
|
|
502
553
|
onStateChange<T extends keyof StateValues>(stateName: T): Observable<{
|
|
503
554
|
newState: StateValues[T];
|
|
504
555
|
oldState: StateValues[T];
|
|
@@ -508,24 +559,38 @@ export interface CameraDevice {
|
|
|
508
559
|
oldData: Camera[T];
|
|
509
560
|
newData: Camera[T];
|
|
510
561
|
}>;
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
562
|
+
onCapabilitiesChange(): Observable<{
|
|
563
|
+
oldCapabilities: CameraDeviceCapability[];
|
|
564
|
+
newCapabilities: CameraDeviceCapability[];
|
|
565
|
+
}>;
|
|
566
|
+
getCapabilities(): CameraDeviceCapability[];
|
|
567
|
+
hasCapability(capability: CameraDeviceCapability): boolean;
|
|
568
|
+
addCapabilities(capabilities: CameraDeviceCapability[]): void;
|
|
569
|
+
removeCapabilities(capabilities: CameraDeviceCapability[]): void;
|
|
570
|
+
}
|
|
571
|
+
export type SensorType = 'door' | 'window' | 'garage';
|
|
572
|
+
export declare enum SensorState {
|
|
573
|
+
Opened = "Opened",
|
|
574
|
+
Closed = "Closed",
|
|
575
|
+
Jammed = "Jammed",
|
|
576
|
+
Unknown = "Unknown"
|
|
577
|
+
}
|
|
578
|
+
export interface CameraDeviceSensor {
|
|
579
|
+
readonly id: string;
|
|
580
|
+
readonly type: SensorType;
|
|
581
|
+
readonly state: SensorState;
|
|
582
|
+
onStateChange(): Observable<{
|
|
583
|
+
newState: SensorState;
|
|
584
|
+
oldState: SensorState;
|
|
585
|
+
}>;
|
|
586
|
+
open(): Promise<void>;
|
|
587
|
+
close(): Promise<void>;
|
|
522
588
|
}
|
|
523
589
|
export interface DeviceManager {
|
|
524
590
|
createCamera(cameraConfig: CameraConfig): Promise<CameraDevice>;
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
removeCameraById(cameraId: string): Promise<void>;
|
|
591
|
+
updateCamera(cameraIdOrName: string, cameraConfig: Partial<CameraConfig>): Promise<CameraDevice>;
|
|
592
|
+
getCamera(cameraIdOrName: string): Promise<CameraDevice | undefined>;
|
|
593
|
+
removeCamera(cameraIdOrName: string): Promise<void>;
|
|
529
594
|
on(event: 'cameraSelected', listener: (camera: CameraDevice, extension: CameraExtension) => void): this;
|
|
530
595
|
on(event: 'cameraDeselected', listener: (cameraId: string, extension: CameraExtension) => void): this;
|
|
531
596
|
once(event: 'cameraSelected', listener: (camera: CameraDevice, extension: CameraExtension) => void): this;
|
|
@@ -537,18 +602,28 @@ export interface DeviceManager {
|
|
|
537
602
|
removeAllListeners(event?: 'cameraSelected' | 'cameraDeselected'): this;
|
|
538
603
|
}
|
|
539
604
|
export interface CoreManager {
|
|
605
|
+
connectToPlugin(pluginName: string): Promise<CuiPlugin | undefined>;
|
|
540
606
|
getFFmpegPath(): Promise<string>;
|
|
541
|
-
getHwaccelInfo(
|
|
607
|
+
getHwaccelInfo(options: HWAccelOptions): Promise<FfmpegArgs[]>;
|
|
542
608
|
getServerAddresses(): Promise<string[]>;
|
|
543
609
|
getIceServers(): Promise<IceServer[]>;
|
|
544
610
|
}
|
|
611
|
+
export interface HWAccelOptions {
|
|
612
|
+
targetCodec: 'h264' | 'h265';
|
|
613
|
+
keepOnHardware?: boolean;
|
|
614
|
+
pixelFormat?: string;
|
|
615
|
+
scale?: {
|
|
616
|
+
width: number;
|
|
617
|
+
height: number;
|
|
618
|
+
};
|
|
619
|
+
}
|
|
545
620
|
export interface FfmpegArgs {
|
|
546
621
|
codec: string;
|
|
547
|
-
hwaccel:
|
|
622
|
+
hwaccel: HwAccelMethod;
|
|
548
623
|
hwaccelArgs: string[];
|
|
549
624
|
hwaccelFilters: string[];
|
|
550
625
|
hwDeviceArgs: string[];
|
|
551
|
-
|
|
626
|
+
supported: boolean;
|
|
552
627
|
}
|
|
553
628
|
export interface IceServer {
|
|
554
629
|
urls: string[];
|
|
@@ -556,82 +631,107 @@ export interface IceServer {
|
|
|
556
631
|
credential?: string;
|
|
557
632
|
}
|
|
558
633
|
export type PluginConfig<T = Record<string, any>> = T;
|
|
559
|
-
export type JsonSchemaType = 'string' | 'number' | 'boolean' | '
|
|
560
|
-
export interface
|
|
634
|
+
export type JsonSchemaType = 'string' | 'number' | 'boolean' | 'array' | 'button' | 'submit';
|
|
635
|
+
export interface JsonFactorySchema {
|
|
561
636
|
type: JsonSchemaType;
|
|
562
|
-
key
|
|
563
|
-
title
|
|
564
|
-
description
|
|
637
|
+
key: string;
|
|
638
|
+
title: string;
|
|
639
|
+
description: string;
|
|
640
|
+
group?: string;
|
|
641
|
+
}
|
|
642
|
+
export interface JsonBaseSchmaWithoutCallbacks<T extends string | string[] | number | number[] | boolean | boolean[] = any> extends JsonFactorySchema {
|
|
643
|
+
hidden?: boolean;
|
|
565
644
|
required?: boolean;
|
|
566
645
|
readonly?: boolean;
|
|
567
646
|
placeholder?: string;
|
|
568
|
-
hidden?: boolean;
|
|
569
|
-
group?: string;
|
|
570
647
|
defaultValue?: T;
|
|
648
|
+
}
|
|
649
|
+
export interface JsonBaseSchema<T extends string | string[] | number | number[] | boolean | boolean[] = any> extends JsonBaseSchmaWithoutCallbacks<T> {
|
|
571
650
|
store?: boolean;
|
|
572
651
|
onSet?: (newValue: any, oldValue: any) => Promise<void>;
|
|
573
652
|
onGet?: () => Promise<any>;
|
|
574
653
|
}
|
|
575
|
-
export interface
|
|
654
|
+
export interface JsonStringSchema {
|
|
576
655
|
type: 'string';
|
|
577
656
|
format?: 'date-time' | 'date' | 'time' | 'email' | 'uuid' | 'ipv4' | 'ipv6' | 'password' | 'qrCode' | 'image';
|
|
578
657
|
minLength?: number;
|
|
579
658
|
maxLength?: number;
|
|
580
659
|
}
|
|
581
|
-
export interface
|
|
660
|
+
export interface JsonNumberSchema {
|
|
582
661
|
type: 'number';
|
|
583
662
|
minimum?: number;
|
|
584
663
|
maximum?: number;
|
|
585
664
|
step?: number;
|
|
586
665
|
}
|
|
587
|
-
export interface
|
|
666
|
+
export interface JsonBooleanSchema {
|
|
588
667
|
type: 'boolean';
|
|
589
668
|
}
|
|
590
|
-
export interface
|
|
669
|
+
export interface JsonEnumSchema {
|
|
591
670
|
type: 'string';
|
|
592
671
|
enum: string[];
|
|
593
672
|
multiple?: boolean;
|
|
594
673
|
}
|
|
595
|
-
export interface
|
|
596
|
-
type: 'object';
|
|
597
|
-
opened?: boolean;
|
|
598
|
-
properties?: JsonSchemaForm;
|
|
599
|
-
}
|
|
600
|
-
export interface JsonSchemaArray extends JsonBaseSchema {
|
|
674
|
+
export interface JsonArraySchema {
|
|
601
675
|
type: 'array';
|
|
602
676
|
opened?: boolean;
|
|
603
|
-
items
|
|
677
|
+
items: Omit<JsonSchemaWithoutCallbacks, 'key'>;
|
|
604
678
|
}
|
|
605
|
-
export interface
|
|
606
|
-
type: '
|
|
607
|
-
|
|
679
|
+
export interface JsonSchemaString extends JsonBaseSchema<string>, JsonStringSchema {
|
|
680
|
+
type: 'string';
|
|
681
|
+
}
|
|
682
|
+
export interface JsonSchemaStringWithoutCallbacks extends JsonBaseSchmaWithoutCallbacks<string>, JsonStringSchema {
|
|
683
|
+
type: 'string';
|
|
684
|
+
}
|
|
685
|
+
export interface JsonSchemaNumber extends JsonBaseSchema<number>, JsonNumberSchema {
|
|
686
|
+
type: 'number';
|
|
608
687
|
}
|
|
609
|
-
export interface
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
688
|
+
export interface JsonSchemaNumberWithoutCallbacks extends JsonBaseSchmaWithoutCallbacks<number>, JsonNumberSchema {
|
|
689
|
+
type: 'number';
|
|
690
|
+
}
|
|
691
|
+
export interface JsonSchemaBoolean extends JsonBaseSchema<boolean>, JsonBooleanSchema {
|
|
692
|
+
type: 'boolean';
|
|
613
693
|
}
|
|
614
|
-
export interface
|
|
615
|
-
|
|
694
|
+
export interface JsonSchemaBooleanWithoutCallbacks extends JsonBaseSchmaWithoutCallbacks<boolean>, JsonBooleanSchema {
|
|
695
|
+
type: 'boolean';
|
|
616
696
|
}
|
|
617
|
-
export
|
|
618
|
-
|
|
619
|
-
export interface RootSchema {
|
|
620
|
-
schema: JsonSchemaForm;
|
|
697
|
+
export interface JsonSchemaEnum extends JsonBaseSchema<string | string[]>, JsonEnumSchema {
|
|
698
|
+
type: 'string';
|
|
621
699
|
}
|
|
700
|
+
export interface JsonSchemaEnumWithoutCallbacks extends JsonBaseSchmaWithoutCallbacks<string | string[]>, JsonEnumSchema {
|
|
701
|
+
type: 'string';
|
|
702
|
+
}
|
|
703
|
+
export interface JsonSchemaArray extends JsonBaseSchema<string[] | number[] | boolean[]>, JsonArraySchema {
|
|
704
|
+
type: 'array';
|
|
705
|
+
}
|
|
706
|
+
export interface JsonSchemaArrayWithoutCallbacks extends JsonBaseSchmaWithoutCallbacks<string[] | number[] | boolean[]>, JsonArraySchema {
|
|
707
|
+
type: 'array';
|
|
708
|
+
}
|
|
709
|
+
export interface JsonSchemaButton extends JsonFactorySchema {
|
|
710
|
+
type: 'button';
|
|
711
|
+
color?: 'success' | 'info' | 'warn' | 'danger';
|
|
712
|
+
onSet: () => Promise<void>;
|
|
713
|
+
}
|
|
714
|
+
export interface JsonSchemaSubmit extends JsonFactorySchema {
|
|
715
|
+
type: 'submit';
|
|
716
|
+
color?: 'success' | 'info' | 'warn' | 'danger';
|
|
717
|
+
onClick: (value: any) => Promise<FormSubmitResponse | void>;
|
|
718
|
+
}
|
|
719
|
+
export type JsonSchema = JsonSchemaString | JsonSchemaNumber | JsonSchemaBoolean | JsonSchemaEnum | JsonSchemaArray | JsonSchemaButton | JsonSchemaSubmit;
|
|
720
|
+
export type JsonSchemaWithoutKey = Omit<JsonSchema, 'key'>;
|
|
721
|
+
export type JsonSchemaWithoutCallbacks = JsonSchemaStringWithoutCallbacks | JsonSchemaNumberWithoutCallbacks | JsonSchemaBooleanWithoutCallbacks | JsonSchemaEnumWithoutCallbacks | JsonSchemaArrayWithoutCallbacks;
|
|
622
722
|
export interface ToastMessage {
|
|
623
723
|
type: 'info' | 'success' | 'warning' | 'error';
|
|
624
724
|
message: string;
|
|
625
725
|
}
|
|
626
726
|
export interface FormSubmitSchema {
|
|
627
|
-
config:
|
|
727
|
+
config: Record<string, any>;
|
|
628
728
|
}
|
|
629
729
|
export interface FormSubmitResponse {
|
|
630
730
|
toast?: ToastMessage;
|
|
631
|
-
schema?:
|
|
731
|
+
schema?: JsonSchemaWithoutCallbacks[];
|
|
632
732
|
}
|
|
633
733
|
export interface SchemaConfig {
|
|
634
|
-
|
|
734
|
+
schema: JsonSchema[];
|
|
635
735
|
config: Record<string, any>;
|
|
636
736
|
}
|
|
637
737
|
export interface ImageMetadata {
|
|
@@ -642,7 +742,7 @@ export interface AudioMetadata {
|
|
|
642
742
|
mimeType: 'audio/mpeg' | 'audio/wav' | 'audio/ogg';
|
|
643
743
|
}
|
|
644
744
|
export interface MotionDetectionPluginResponse {
|
|
645
|
-
|
|
745
|
+
videoData: Buffer | Uint8Array;
|
|
646
746
|
}
|
|
647
747
|
export interface ObjectDetectionPluginResponse {
|
|
648
748
|
detections: Detection[];
|
|
@@ -650,21 +750,18 @@ export interface ObjectDetectionPluginResponse {
|
|
|
650
750
|
export interface AudioDetectionPluginResponse {
|
|
651
751
|
detected: boolean;
|
|
652
752
|
}
|
|
653
|
-
export
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
export interface AudioDetectionPlugin extends BasePlugin {
|
|
658
|
-
interfaceSchema(): RootSchema | void;
|
|
659
|
-
detectAudio(audioPath: string, metadata: AudioMetadata, config: Record<string, any>): Promise<AudioDetectionPluginResponse>;
|
|
660
|
-
}
|
|
661
|
-
export interface MotionDetectionPlugin extends BasePlugin {
|
|
662
|
-
interfaceSchema(): RootSchema | void;
|
|
663
|
-
detectMotion(videoPath: string, config: Record<string, any>): Promise<MotionDetectionPluginResponse>;
|
|
753
|
+
export declare enum CuiPluginCapability {
|
|
754
|
+
MotionDetector = "MotionDetector",
|
|
755
|
+
ObjectDetector = "ObjectDetector",
|
|
756
|
+
AudioDetector = "AudioDetector"
|
|
664
757
|
}
|
|
665
|
-
export interface
|
|
666
|
-
|
|
667
|
-
|
|
758
|
+
export interface CuiPlugin {
|
|
759
|
+
configureCameras(cameras: CameraDevice[]): Promise<void>;
|
|
760
|
+
getCapabilities(): Promise<CuiPluginCapability[]>;
|
|
761
|
+
interfaceSchema?(): Promise<JsonSchema[] | undefined>;
|
|
762
|
+
detectAudio?(audioData: Buffer | Uint8Array, metadata: AudioMetadata, config: Record<string, any>): Promise<AudioDetectionPluginResponse | undefined>;
|
|
763
|
+
detectMotion?(videoData: Buffer | Uint8Array, config: Record<string, any>): Promise<MotionDetectionPluginResponse | undefined>;
|
|
764
|
+
detectObjects?(imageData: Buffer | Uint8Array, metadata: ImageMetadata, config: Record<string, any>): Promise<ObjectDetectionPluginResponse | undefined>;
|
|
668
765
|
}
|
|
669
766
|
export interface LoggerService {
|
|
670
767
|
log: (...args: any[]) => void;
|
|
@@ -679,9 +776,7 @@ export interface PluginAPI {
|
|
|
679
776
|
readonly coreManager: CoreManager;
|
|
680
777
|
readonly deviceManager: DeviceManager;
|
|
681
778
|
readonly storageController: StorageController;
|
|
682
|
-
readonly configService: ConfigService;
|
|
683
779
|
readonly storagePath: string;
|
|
684
|
-
readonly configFile: string;
|
|
685
780
|
on(event: 'finishLaunching', listener: () => void): this;
|
|
686
781
|
on(event: 'shutdown', listener: () => void): this;
|
|
687
782
|
once(event: 'finishLaunching', listener: () => void): this;
|
|
@@ -692,39 +787,26 @@ export interface PluginAPI {
|
|
|
692
787
|
removeListener(event: 'shutdown', listener: () => void): this;
|
|
693
788
|
removeAllListeners(event?: 'shutdown' | 'finishLaunching'): this;
|
|
694
789
|
}
|
|
695
|
-
export interface
|
|
696
|
-
|
|
697
|
-
get(key: Path, defaultValue?: unknown, validate?: Function, refresh?: boolean, writeIfNotValid?: boolean): any;
|
|
698
|
-
has(key: Path, refresh?: boolean): boolean;
|
|
699
|
-
ensureExists(key: Path, defaultValue: JSONValue, write?: boolean): void;
|
|
700
|
-
set(key: Path, value: any, write?: boolean): void;
|
|
701
|
-
insert(key: Path, value: any, at?: number, write?: boolean): void;
|
|
702
|
-
push(key: Path, write?: boolean, ...items: any[]): void;
|
|
703
|
-
delete(key: Path, write?: boolean): void;
|
|
704
|
-
all(refresh?: boolean): PluginConfig;
|
|
705
|
-
replace(config: PluginConfig, write?: boolean): void;
|
|
706
|
-
updateValue(path: string, searchKey: string, searchValue: any, targetKey: string, newValue: any, write?: boolean): void;
|
|
707
|
-
replaceOrAddItem(path: string, searchKey: string, searchValue: any, newItem: any, write?: boolean): void;
|
|
708
|
-
}
|
|
709
|
-
export interface CameraStorage<T extends Record<string, any> = Record<string, any>> {
|
|
710
|
-
schema: JsonSchemaForm;
|
|
790
|
+
export interface DeviceStorage<T extends Record<string, any> = Record<string, any>> {
|
|
791
|
+
schemas: JsonSchema[];
|
|
711
792
|
values: T;
|
|
712
|
-
|
|
713
|
-
getValue<U = string>(
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
hasValue(
|
|
793
|
+
getValue<U = string>(key: string): Promise<U> | undefined;
|
|
794
|
+
getValue<U = string>(key: string, defaultValue: U): Promise<U>;
|
|
795
|
+
setValue<U = string>(key: string, newValue: U): Promise<void>;
|
|
796
|
+
submitValue(key: string, newValue: any): Promise<FormSubmitResponse | void>;
|
|
797
|
+
hasValue(key: string): boolean;
|
|
717
798
|
getConfig(): Promise<SchemaConfig>;
|
|
718
799
|
setConfig(newConfig: T): Promise<void>;
|
|
719
|
-
addSchema(schema:
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
800
|
+
addSchema(schema: JsonSchema): Promise<void>;
|
|
801
|
+
removeSchema(key: string): Promise<void>;
|
|
802
|
+
changeSchema(key: string, newSchema: Partial<JsonSchema>): Promise<void>;
|
|
803
|
+
getSchema(key: string): JsonSchema | undefined;
|
|
804
|
+
hasSchema(key: string): boolean;
|
|
805
|
+
save(): Promise<void>;
|
|
725
806
|
}
|
|
726
807
|
export interface StorageController {
|
|
727
|
-
createCameraStorage<T extends Record<string, any> = Record<string, any>>(instance: any, cameraId: string,
|
|
728
|
-
|
|
729
|
-
|
|
808
|
+
createCameraStorage<T extends Record<string, any> = Record<string, any>>(instance: any, cameraId: string, schemas?: JsonSchema[]): DeviceStorage<T>;
|
|
809
|
+
createPluginStorage<T extends Record<string, any> = Record<string, any>>(instance: any, schemas?: JsonSchema[]): DeviceStorage<T>;
|
|
810
|
+
getCameraStorage<T extends Record<string, any> = Record<string, any>>(cameraId: string): DeviceStorage<T> | undefined;
|
|
811
|
+
getPluginStorage<T extends Record<string, any> = Record<string, any>>(): DeviceStorage<T> | undefined;
|
|
730
812
|
}
|