@camera.ui/browser 0.0.35 → 0.0.36
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/client/node/src/proxy/cameraDevice/cameraDevice.browser.d.ts +13 -11
- package/dist/client/node/src/proxy/cameraDevice/cameraDevice.node.d.ts +12 -7
- package/dist/src/api/database/types.d.ts +7 -25
- package/dist/src/api/schemas/cameras.schema.d.ts +112 -6
- package/dist/src/api/schemas/config.schema.d.ts +9 -9
- package/dist/src/api/services/cameras.service.d.ts +1 -2
- package/dist/src/api/ws/nsp/status.d.ts +10 -2
- package/dist/src/api/ws/nsp/streams.d.ts +0 -15
- package/dist/src/api/ws/types.d.ts +14 -0
- package/dist/src/api.d.ts +3 -2
- package/dist/src/camera/index.d.ts +18 -16
- package/dist/src/camera/streaming/peer-connection.d.ts +5 -7
- package/dist/src/camera/streaming/streaming-session.d.ts +3 -3
- package/dist/src/camera/streaming/webrtc-connection.d.ts +4 -4
- package/dist/src/camera/types.d.ts +50 -12
- package/dist/src/go2rtc/index.d.ts +1 -0
- package/dist/src/plugins/cameraStorage.d.ts +1 -0
- package/dist/src/plugins/schema.d.ts +3 -3
- package/dist/src/plugins/types.d.ts +8 -8
- package/dist/src/proxy/client/cameraDevice.d.ts +15 -10
- package/dist/src/proxy/client/deviceManager.d.ts +1 -1
- package/dist/src/proxy/client/pluginsManager.d.ts +1 -1
- package/dist/src/proxy/client/queue.d.ts +2 -0
- package/dist/src/proxy/client/systemManager.d.ts +1 -1
- package/dist/src/proxy/index.d.ts +2 -2
- package/dist/src/proxy/proxies/camera.d.ts +42 -34
- package/dist/src/proxy/queue.d.ts +2 -0
- package/dist/src/proxy/types.d.ts +30 -26
- package/dist/src/services/config/types.d.ts +1 -1
- package/dist/src/services/logger/index.d.ts +5 -4
- package/package.json +4 -4
- /package/dist/src/camera/{subscribed.d.ts → utils/subscribed.d.ts} +0 -0
|
@@ -1,34 +1,38 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
2
|
import type { SocketService } from '../../socket';
|
|
3
|
-
import type { Camera, CameraDevice, StateValue, StateValues, OnSetEvent,
|
|
3
|
+
import type { Camera, CameraDevice, StateValue, StateValues, OnSetEvent, LightState, MotionState, AudioState, ObjectState, DoorbellState, SirenState, BatteryState, BaseLogger, FfmpegOptions, CameraDelegate, CameraZone, CameraSource, CameraPublicProperties, CameraType, CameraInformation, CameraPrebufferDelegate } from '../../../../../shared/types';
|
|
4
4
|
export declare class CameraDeviceClient implements CameraDevice {
|
|
5
|
+
private log;
|
|
5
6
|
private socketService;
|
|
6
7
|
private cameraSubject;
|
|
7
|
-
private prebufferSubject;
|
|
8
8
|
private lightState;
|
|
9
9
|
private motionState;
|
|
10
10
|
private audioState;
|
|
11
11
|
private objectState;
|
|
12
12
|
private doorbellState;
|
|
13
13
|
private sirenState;
|
|
14
|
-
|
|
14
|
+
private batteryState;
|
|
15
|
+
onLightSwitched: Observable<LightState>;
|
|
15
16
|
onMotionDetected: Observable<MotionState>;
|
|
16
17
|
onAudioDetected: Observable<AudioState>;
|
|
17
18
|
onObjectDetected: Observable<ObjectState>;
|
|
18
19
|
onDoorbellPressed: Observable<DoorbellState>;
|
|
19
20
|
onSirenDetected: Observable<SirenState>;
|
|
20
|
-
|
|
21
|
+
onBatteryChanged: Observable<BatteryState>;
|
|
21
22
|
delegate?: CameraDelegate;
|
|
23
|
+
prebufferDelegate?: CameraPrebufferDelegate;
|
|
22
24
|
get id(): string;
|
|
23
25
|
get nativeId(): string | undefined;
|
|
24
26
|
get pluginId(): string;
|
|
25
27
|
get disabled(): boolean;
|
|
26
28
|
get name(): string;
|
|
27
|
-
get type():
|
|
28
|
-
get
|
|
29
|
+
get type(): CameraType;
|
|
30
|
+
get info(): CameraInformation;
|
|
29
31
|
get isCloud(): boolean;
|
|
30
32
|
get hasLight(): boolean;
|
|
31
33
|
get hasSiren(): boolean;
|
|
34
|
+
get hasBinarySensor(): boolean;
|
|
35
|
+
get hasBattery(): boolean;
|
|
32
36
|
get hasMotionDetector(): boolean;
|
|
33
37
|
get hasAudioDetector(): boolean;
|
|
34
38
|
get hasObjectDetector(): boolean;
|
|
@@ -37,15 +41,14 @@ export declare class CameraDeviceClient implements CameraDevice {
|
|
|
37
41
|
get objectZones(): CameraZone[];
|
|
38
42
|
get sources(): CameraSource[];
|
|
39
43
|
constructor(camera: Camera, socketService: SocketService, logger: BaseLogger);
|
|
44
|
+
reboot(): Promise<void>;
|
|
40
45
|
getStreamSource(): CameraSource;
|
|
41
46
|
getSnapshotSource(): CameraSource;
|
|
42
47
|
getRecordingSource(): CameraSource;
|
|
43
48
|
getDetectionSource(): CameraSource;
|
|
44
49
|
configureDelegate(delegate: CameraDelegate): void;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
removePrebufferSource(sourceIdOrName: string, type: 'recording' | 'stream'): Promise<void>;
|
|
48
|
-
removePrebufferSources(): Promise<void>;
|
|
50
|
+
configurePrebufferDelegate(delegate: CameraPrebufferDelegate): void;
|
|
51
|
+
snapshot(forceNew?: boolean): Promise<ArrayBuffer>;
|
|
49
52
|
getFfmpegPath(): Promise<string>;
|
|
50
53
|
getIceServers(): Promise<RTCIceServer[]>;
|
|
51
54
|
createSession(): Promise<any>;
|
|
@@ -64,7 +67,6 @@ export declare class CameraDeviceClient implements CameraDevice {
|
|
|
64
67
|
removeAllListeners(): void;
|
|
65
68
|
refreshStates(): Promise<void>;
|
|
66
69
|
private updateCamera;
|
|
67
|
-
private updatePrebufferSources;
|
|
68
70
|
private unsubscribe;
|
|
69
71
|
private createStateObservable;
|
|
70
72
|
private listenToChanges;
|
|
@@ -1,16 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CameraController } from '../../../../../src/camera';
|
|
2
|
+
import { StreamingSession } from '../../../../../src/camera/streaming/streaming-session';
|
|
2
3
|
import type { SocketService } from '../../socket';
|
|
3
|
-
import type { Camera, StateValues, OnSetEvent, BaseLogger, IceServer,
|
|
4
|
-
export declare class CameraDeviceClient extends
|
|
4
|
+
import type { Camera, StateValues, OnSetEvent, BaseLogger, IceServer, StreamingConnectionOptions, FfmpegOptions, CameraSource } from '../../../../../shared/types';
|
|
5
|
+
export declare class CameraDeviceClient extends CameraController {
|
|
5
6
|
private socketService;
|
|
7
|
+
private logger;
|
|
8
|
+
get sources(): CameraSource[];
|
|
6
9
|
constructor(camera: Camera, socketService: SocketService, logger: BaseLogger);
|
|
7
|
-
|
|
8
|
-
removePrebufferSource(sourceName: string, type: 'recording' | 'stream'): Promise<void>;
|
|
9
|
-
removePrebufferSources(): Promise<void>;
|
|
10
|
+
reboot(): Promise<void>;
|
|
10
11
|
getFfmpegPath(): Promise<string>;
|
|
11
12
|
getIceServers(): Promise<IceServer[]>;
|
|
13
|
+
snapshot(forceNew?: boolean | undefined): Promise<ArrayBuffer>;
|
|
14
|
+
createSession(sourceName: string, options?: StreamingConnectionOptions): Promise<StreamingSession>;
|
|
15
|
+
streamVideo(sourceName: string, options: FfmpegOptions): Promise<StreamingSession>;
|
|
16
|
+
recordToFile(sourceName: string, outputPath: string, duration?: number): Promise<void>;
|
|
12
17
|
updateState<T extends keyof StateValues>(stateName: T, eventData: OnSetEvent<T>): Promise<void>;
|
|
13
18
|
refreshStates(): Promise<void>;
|
|
14
|
-
|
|
19
|
+
private close;
|
|
15
20
|
private listenToChanges;
|
|
16
21
|
}
|
|
@@ -76,7 +76,9 @@ export interface BaseCamera {
|
|
|
76
76
|
isCloud: boolean;
|
|
77
77
|
hasLight: boolean;
|
|
78
78
|
hasSiren: boolean;
|
|
79
|
-
|
|
79
|
+
hasBinarySensor: boolean;
|
|
80
|
+
hasBattery: boolean;
|
|
81
|
+
info: CameraInformation;
|
|
80
82
|
type: CameraType;
|
|
81
83
|
motionZones: CameraZone[];
|
|
82
84
|
objectZones: CameraZone[];
|
|
@@ -106,11 +108,11 @@ export interface ZoneCoord {
|
|
|
106
108
|
_id: string;
|
|
107
109
|
points: [number, number];
|
|
108
110
|
}
|
|
109
|
-
export type CameraPrivateProperties = '_id' | 'nativeId' | 'pluginId'
|
|
111
|
+
export type CameraPrivateProperties = '_id' | 'nativeId' | 'pluginId';
|
|
110
112
|
export interface CameraPublicProperties extends Omit<Camera, CameraPrivateProperties> {
|
|
111
113
|
}
|
|
112
114
|
export type CameraType = 'camera' | 'doorbell';
|
|
113
|
-
export interface
|
|
115
|
+
export interface CameraInformation {
|
|
114
116
|
model: string;
|
|
115
117
|
manufacturer: string;
|
|
116
118
|
hardware: string;
|
|
@@ -157,16 +159,8 @@ export interface Go2RtcEndpoint {
|
|
|
157
159
|
mjpegHtml: string;
|
|
158
160
|
}
|
|
159
161
|
export interface Go2RtcFFMPEGSource {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
}
|
|
163
|
-
export interface PrebufferSource {
|
|
164
|
-
url: string;
|
|
165
|
-
snapshotUrl: string;
|
|
166
|
-
}
|
|
167
|
-
export interface Go2RtcPrebufferSource {
|
|
168
|
-
mpegts: PrebufferSource;
|
|
169
|
-
mp4: PrebufferSource;
|
|
162
|
+
aac: string;
|
|
163
|
+
opus: string;
|
|
170
164
|
}
|
|
171
165
|
export interface Go2RtcWSSource {
|
|
172
166
|
webrtc: string;
|
|
@@ -175,7 +169,6 @@ export interface StreamUrls {
|
|
|
175
169
|
ws: Go2RtcWSSource;
|
|
176
170
|
rtsp: Go2RtcRTSPSource;
|
|
177
171
|
transcoded: Go2RtcFFMPEGSource;
|
|
178
|
-
prebuffer: Go2RtcPrebufferSource;
|
|
179
172
|
www: Go2RtcEndpoint;
|
|
180
173
|
}
|
|
181
174
|
export interface CameraInput {
|
|
@@ -184,17 +177,6 @@ export interface CameraInput {
|
|
|
184
177
|
roles: CameraRoles[];
|
|
185
178
|
urls: StreamUrls;
|
|
186
179
|
}
|
|
187
|
-
export interface CameraPrebufferInput {
|
|
188
|
-
readonly _id: string;
|
|
189
|
-
stream: PrebufferState;
|
|
190
|
-
recording: PrebufferState;
|
|
191
|
-
}
|
|
192
|
-
export interface CameraSource extends CameraInput, CameraPrebufferInput {
|
|
193
|
-
}
|
|
194
|
-
export interface PrebufferState {
|
|
195
|
-
rawUrl?: string;
|
|
196
|
-
isPrebuffering: boolean;
|
|
197
|
-
}
|
|
198
180
|
export type CameraRoles = 'detect' | 'record' | 'stream' | 'snapshot' | 'none';
|
|
199
181
|
export interface CameraUiSettings {
|
|
200
182
|
streamingModes: VideoStreamingMode[];
|
|
@@ -105,10 +105,12 @@ export declare const inputSchema: zod.ZodObject<{
|
|
|
105
105
|
_id?: string | undefined;
|
|
106
106
|
}>;
|
|
107
107
|
export declare const patchInputSchema: zod.ZodObject<{
|
|
108
|
+
_id: zod.ZodEffects<zod.ZodDefault<zod.ZodString>, string, string | undefined>;
|
|
108
109
|
name: zod.ZodEffects<zod.ZodString, string, string>;
|
|
109
110
|
roles: zod.ZodEffects<zod.ZodArray<zod.ZodUnion<[zod.ZodLiteral<"detect">, zod.ZodLiteral<"record">, zod.ZodLiteral<"stream">, zod.ZodLiteral<"snapshot">, zod.ZodLiteral<"none">]>, "many">, ("detect" | "record" | "stream" | "snapshot" | "none")[], ("detect" | "record" | "stream" | "snapshot" | "none")[]>;
|
|
110
111
|
urls: zod.ZodArray<zod.ZodString, "many">;
|
|
111
112
|
}, "strict", zod.ZodTypeAny, {
|
|
113
|
+
_id: string;
|
|
112
114
|
name: string;
|
|
113
115
|
roles: ("detect" | "record" | "stream" | "snapshot" | "none")[];
|
|
114
116
|
urls: string[];
|
|
@@ -116,6 +118,7 @@ export declare const patchInputSchema: zod.ZodObject<{
|
|
|
116
118
|
name: string;
|
|
117
119
|
roles: ("detect" | "record" | "stream" | "snapshot" | "none")[];
|
|
118
120
|
urls: string[];
|
|
121
|
+
_id?: string | undefined;
|
|
119
122
|
}>;
|
|
120
123
|
export declare const extensionsSettingsSchema: zod.ZodObject<{
|
|
121
124
|
hub: zod.ZodOptional<zod.ZodArray<zod.ZodString, "many">>;
|
|
@@ -151,6 +154,28 @@ export declare const interfaceSettingsSchema: zod.ZodObject<{
|
|
|
151
154
|
}, {
|
|
152
155
|
streamingModes: ("mse" | "webrtc" | "webrtc/tcp" | "mjpeg" | "hls" | "mp4")[];
|
|
153
156
|
}>;
|
|
157
|
+
export declare const cameraInfoSchema: zod.ZodObject<{
|
|
158
|
+
model: zod.ZodString;
|
|
159
|
+
manufacturer: zod.ZodString;
|
|
160
|
+
hardware: zod.ZodString;
|
|
161
|
+
serialNumber: zod.ZodString;
|
|
162
|
+
firmwareVersion: zod.ZodString;
|
|
163
|
+
supportUrl: zod.ZodString;
|
|
164
|
+
}, "strip", zod.ZodTypeAny, {
|
|
165
|
+
model: string;
|
|
166
|
+
manufacturer: string;
|
|
167
|
+
hardware: string;
|
|
168
|
+
serialNumber: string;
|
|
169
|
+
firmwareVersion: string;
|
|
170
|
+
supportUrl: string;
|
|
171
|
+
}, {
|
|
172
|
+
model: string;
|
|
173
|
+
manufacturer: string;
|
|
174
|
+
hardware: string;
|
|
175
|
+
serialNumber: string;
|
|
176
|
+
firmwareVersion: string;
|
|
177
|
+
supportUrl: string;
|
|
178
|
+
}>;
|
|
154
179
|
export declare const createCameraSchema: zod.ZodObject<{
|
|
155
180
|
_id: zod.ZodEffects<zod.ZodDefault<zod.ZodString>, string, string | undefined>;
|
|
156
181
|
nativeId: zod.ZodOptional<zod.ZodString>;
|
|
@@ -161,7 +186,30 @@ export declare const createCameraSchema: zod.ZodObject<{
|
|
|
161
186
|
isCloud: zod.ZodDefault<zod.ZodBoolean>;
|
|
162
187
|
hasLight: zod.ZodDefault<zod.ZodBoolean>;
|
|
163
188
|
hasSiren: zod.ZodDefault<zod.ZodBoolean>;
|
|
164
|
-
|
|
189
|
+
hasBinarySensor: zod.ZodDefault<zod.ZodBoolean>;
|
|
190
|
+
hasBattery: zod.ZodDefault<zod.ZodBoolean>;
|
|
191
|
+
info: zod.ZodDefault<zod.ZodObject<{
|
|
192
|
+
model: zod.ZodString;
|
|
193
|
+
manufacturer: zod.ZodString;
|
|
194
|
+
hardware: zod.ZodString;
|
|
195
|
+
serialNumber: zod.ZodString;
|
|
196
|
+
firmwareVersion: zod.ZodString;
|
|
197
|
+
supportUrl: zod.ZodString;
|
|
198
|
+
}, "strip", zod.ZodTypeAny, {
|
|
199
|
+
model: string;
|
|
200
|
+
manufacturer: string;
|
|
201
|
+
hardware: string;
|
|
202
|
+
serialNumber: string;
|
|
203
|
+
firmwareVersion: string;
|
|
204
|
+
supportUrl: string;
|
|
205
|
+
}, {
|
|
206
|
+
model: string;
|
|
207
|
+
manufacturer: string;
|
|
208
|
+
hardware: string;
|
|
209
|
+
serialNumber: string;
|
|
210
|
+
firmwareVersion: string;
|
|
211
|
+
supportUrl: string;
|
|
212
|
+
}>>;
|
|
165
213
|
sources: zod.ZodArray<zod.ZodObject<{
|
|
166
214
|
_id: zod.ZodEffects<zod.ZodDefault<zod.ZodString>, string, string | undefined>;
|
|
167
215
|
name: zod.ZodEffects<zod.ZodString, string, string>;
|
|
@@ -318,7 +366,16 @@ export declare const createCameraSchema: zod.ZodObject<{
|
|
|
318
366
|
isCloud: boolean;
|
|
319
367
|
hasLight: boolean;
|
|
320
368
|
hasSiren: boolean;
|
|
321
|
-
|
|
369
|
+
hasBinarySensor: boolean;
|
|
370
|
+
hasBattery: boolean;
|
|
371
|
+
info: {
|
|
372
|
+
model: string;
|
|
373
|
+
manufacturer: string;
|
|
374
|
+
hardware: string;
|
|
375
|
+
serialNumber: string;
|
|
376
|
+
firmwareVersion: string;
|
|
377
|
+
supportUrl: string;
|
|
378
|
+
};
|
|
322
379
|
sources: {
|
|
323
380
|
_id: string;
|
|
324
381
|
name: string;
|
|
@@ -377,7 +434,16 @@ export declare const createCameraSchema: zod.ZodObject<{
|
|
|
377
434
|
isCloud?: boolean | undefined;
|
|
378
435
|
hasLight?: boolean | undefined;
|
|
379
436
|
hasSiren?: boolean | undefined;
|
|
380
|
-
|
|
437
|
+
hasBinarySensor?: boolean | undefined;
|
|
438
|
+
hasBattery?: boolean | undefined;
|
|
439
|
+
info?: {
|
|
440
|
+
model: string;
|
|
441
|
+
manufacturer: string;
|
|
442
|
+
hardware: string;
|
|
443
|
+
serialNumber: string;
|
|
444
|
+
firmwareVersion: string;
|
|
445
|
+
supportUrl: string;
|
|
446
|
+
} | undefined;
|
|
381
447
|
extensions?: {
|
|
382
448
|
plugins: string[];
|
|
383
449
|
hub?: string[] | undefined;
|
|
@@ -416,14 +482,37 @@ export declare const createCameraSchema: zod.ZodObject<{
|
|
|
416
482
|
}>;
|
|
417
483
|
export declare const patchCameraSchema: zod.ZodObject<{
|
|
418
484
|
disabled: zod.ZodOptional<zod.ZodBoolean>;
|
|
419
|
-
model: zod.ZodOptional<zod.ZodString>;
|
|
420
485
|
type: zod.ZodOptional<zod.ZodUnion<[zod.ZodLiteral<"camera">, zod.ZodLiteral<"doorbell">]>>;
|
|
421
486
|
name: zod.ZodOptional<zod.ZodString>;
|
|
487
|
+
info: zod.ZodOptional<zod.ZodObject<{
|
|
488
|
+
model: zod.ZodOptional<zod.ZodString>;
|
|
489
|
+
manufacturer: zod.ZodOptional<zod.ZodString>;
|
|
490
|
+
hardware: zod.ZodOptional<zod.ZodString>;
|
|
491
|
+
serialNumber: zod.ZodOptional<zod.ZodString>;
|
|
492
|
+
firmwareVersion: zod.ZodOptional<zod.ZodString>;
|
|
493
|
+
supportUrl: zod.ZodOptional<zod.ZodString>;
|
|
494
|
+
}, "strip", zod.ZodTypeAny, {
|
|
495
|
+
model?: string | undefined;
|
|
496
|
+
manufacturer?: string | undefined;
|
|
497
|
+
hardware?: string | undefined;
|
|
498
|
+
serialNumber?: string | undefined;
|
|
499
|
+
firmwareVersion?: string | undefined;
|
|
500
|
+
supportUrl?: string | undefined;
|
|
501
|
+
}, {
|
|
502
|
+
model?: string | undefined;
|
|
503
|
+
manufacturer?: string | undefined;
|
|
504
|
+
hardware?: string | undefined;
|
|
505
|
+
serialNumber?: string | undefined;
|
|
506
|
+
firmwareVersion?: string | undefined;
|
|
507
|
+
supportUrl?: string | undefined;
|
|
508
|
+
}>>;
|
|
422
509
|
sources: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
|
|
510
|
+
_id: zod.ZodEffects<zod.ZodDefault<zod.ZodString>, string, string | undefined>;
|
|
423
511
|
name: zod.ZodEffects<zod.ZodString, string, string>;
|
|
424
512
|
roles: zod.ZodEffects<zod.ZodArray<zod.ZodUnion<[zod.ZodLiteral<"detect">, zod.ZodLiteral<"record">, zod.ZodLiteral<"stream">, zod.ZodLiteral<"snapshot">, zod.ZodLiteral<"none">]>, "many">, ("detect" | "record" | "stream" | "snapshot" | "none")[], ("detect" | "record" | "stream" | "snapshot" | "none")[]>;
|
|
425
513
|
urls: zod.ZodArray<zod.ZodString, "many">;
|
|
426
514
|
}, "strict", zod.ZodTypeAny, {
|
|
515
|
+
_id: string;
|
|
427
516
|
name: string;
|
|
428
517
|
roles: ("detect" | "record" | "stream" | "snapshot" | "none")[];
|
|
429
518
|
urls: string[];
|
|
@@ -431,6 +520,7 @@ export declare const patchCameraSchema: zod.ZodObject<{
|
|
|
431
520
|
name: string;
|
|
432
521
|
roles: ("detect" | "record" | "stream" | "snapshot" | "none")[];
|
|
433
522
|
urls: string[];
|
|
523
|
+
_id?: string | undefined;
|
|
434
524
|
}>, "many">>;
|
|
435
525
|
extensions: zod.ZodOptional<zod.ZodObject<{
|
|
436
526
|
hub: zod.ZodOptional<zod.ZodOptional<zod.ZodArray<zod.ZodString, "many">>>;
|
|
@@ -565,10 +655,18 @@ export declare const patchCameraSchema: zod.ZodObject<{
|
|
|
565
655
|
}>, "many">>;
|
|
566
656
|
}, "strict", zod.ZodTypeAny, {
|
|
567
657
|
disabled?: boolean | undefined;
|
|
568
|
-
model?: string | undefined;
|
|
569
658
|
type?: "camera" | "doorbell" | undefined;
|
|
570
659
|
name?: string | undefined;
|
|
660
|
+
info?: {
|
|
661
|
+
model?: string | undefined;
|
|
662
|
+
manufacturer?: string | undefined;
|
|
663
|
+
hardware?: string | undefined;
|
|
664
|
+
serialNumber?: string | undefined;
|
|
665
|
+
firmwareVersion?: string | undefined;
|
|
666
|
+
supportUrl?: string | undefined;
|
|
667
|
+
} | undefined;
|
|
571
668
|
sources?: {
|
|
669
|
+
_id: string;
|
|
572
670
|
name: string;
|
|
573
671
|
roles: ("detect" | "record" | "stream" | "snapshot" | "none")[];
|
|
574
672
|
urls: string[];
|
|
@@ -610,13 +708,21 @@ export declare const patchCameraSchema: zod.ZodObject<{
|
|
|
610
708
|
}[] | undefined;
|
|
611
709
|
}, {
|
|
612
710
|
disabled?: boolean | undefined;
|
|
613
|
-
model?: string | undefined;
|
|
614
711
|
type?: "camera" | "doorbell" | undefined;
|
|
615
712
|
name?: string | undefined;
|
|
713
|
+
info?: {
|
|
714
|
+
model?: string | undefined;
|
|
715
|
+
manufacturer?: string | undefined;
|
|
716
|
+
hardware?: string | undefined;
|
|
717
|
+
serialNumber?: string | undefined;
|
|
718
|
+
firmwareVersion?: string | undefined;
|
|
719
|
+
supportUrl?: string | undefined;
|
|
720
|
+
} | undefined;
|
|
616
721
|
sources?: {
|
|
617
722
|
name: string;
|
|
618
723
|
roles: ("detect" | "record" | "stream" | "snapshot" | "none")[];
|
|
619
724
|
urls: string[];
|
|
725
|
+
_id?: string | undefined;
|
|
620
726
|
}[] | undefined;
|
|
621
727
|
extensions?: {
|
|
622
728
|
hub?: string[] | undefined;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as zod from 'zod';
|
|
2
|
-
export declare const logLevelSchema: zod.ZodUnion<[zod.ZodLiteral<"info">, zod.ZodLiteral<"debug">, zod.ZodLiteral<"warn">, zod.ZodLiteral<"error">, zod.ZodLiteral<"
|
|
2
|
+
export declare const logLevelSchema: zod.ZodUnion<[zod.ZodLiteral<"info">, zod.ZodLiteral<"debug">, zod.ZodLiteral<"warn">, zod.ZodLiteral<"error">, zod.ZodLiteral<"trace">]>;
|
|
3
3
|
export declare const loggerSchema: zod.ZodObject<{
|
|
4
|
-
level: zod.ZodDefault<zod.ZodOptional<zod.ZodUnion<[zod.ZodLiteral<"info">, zod.ZodLiteral<"debug">, zod.ZodLiteral<"warn">, zod.ZodLiteral<"error">, zod.ZodLiteral<"
|
|
4
|
+
level: zod.ZodDefault<zod.ZodOptional<zod.ZodUnion<[zod.ZodLiteral<"info">, zod.ZodLiteral<"debug">, zod.ZodLiteral<"warn">, zod.ZodLiteral<"error">, zod.ZodLiteral<"trace">]>>>;
|
|
5
5
|
disableTimestamps: zod.ZodDefault<zod.ZodOptional<zod.ZodBoolean>>;
|
|
6
6
|
}, "strict", zod.ZodTypeAny, {
|
|
7
|
-
level: "error" | "info" | "debug" | "warn" | "
|
|
7
|
+
level: "error" | "info" | "debug" | "warn" | "trace";
|
|
8
8
|
disableTimestamps: boolean;
|
|
9
9
|
}, {
|
|
10
|
-
level?: "error" | "info" | "debug" | "warn" | "
|
|
10
|
+
level?: "error" | "info" | "debug" | "warn" | "trace" | undefined;
|
|
11
11
|
disableTimestamps?: boolean | undefined;
|
|
12
12
|
}>;
|
|
13
13
|
export declare const mqttTLSSchema: zod.ZodEffects<zod.ZodObject<{
|
|
@@ -135,13 +135,13 @@ export declare const patchConfigSchema: zod.ZodObject<{
|
|
|
135
135
|
addresses?: string[] | undefined;
|
|
136
136
|
}>;
|
|
137
137
|
logger: zod.ZodObject<{
|
|
138
|
-
level: zod.ZodDefault<zod.ZodOptional<zod.ZodUnion<[zod.ZodLiteral<"info">, zod.ZodLiteral<"debug">, zod.ZodLiteral<"warn">, zod.ZodLiteral<"error">, zod.ZodLiteral<"
|
|
138
|
+
level: zod.ZodDefault<zod.ZodOptional<zod.ZodUnion<[zod.ZodLiteral<"info">, zod.ZodLiteral<"debug">, zod.ZodLiteral<"warn">, zod.ZodLiteral<"error">, zod.ZodLiteral<"trace">]>>>;
|
|
139
139
|
disableTimestamps: zod.ZodDefault<zod.ZodOptional<zod.ZodBoolean>>;
|
|
140
140
|
}, "strict", zod.ZodTypeAny, {
|
|
141
|
-
level: "error" | "info" | "debug" | "warn" | "
|
|
141
|
+
level: "error" | "info" | "debug" | "warn" | "trace";
|
|
142
142
|
disableTimestamps: boolean;
|
|
143
143
|
}, {
|
|
144
|
-
level?: "error" | "info" | "debug" | "warn" | "
|
|
144
|
+
level?: "error" | "info" | "debug" | "warn" | "trace" | undefined;
|
|
145
145
|
disableTimestamps?: boolean | undefined;
|
|
146
146
|
}>;
|
|
147
147
|
plugins: zod.ZodDefault<zod.ZodObject<{
|
|
@@ -174,7 +174,7 @@ export declare const patchConfigSchema: zod.ZodObject<{
|
|
|
174
174
|
addresses: string[];
|
|
175
175
|
};
|
|
176
176
|
logger: {
|
|
177
|
-
level: "error" | "info" | "debug" | "warn" | "
|
|
177
|
+
level: "error" | "info" | "debug" | "warn" | "trace";
|
|
178
178
|
disableTimestamps: boolean;
|
|
179
179
|
};
|
|
180
180
|
settings: {
|
|
@@ -188,7 +188,7 @@ export declare const patchConfigSchema: zod.ZodObject<{
|
|
|
188
188
|
addresses?: string[] | undefined;
|
|
189
189
|
};
|
|
190
190
|
logger: {
|
|
191
|
-
level?: "error" | "info" | "debug" | "warn" | "
|
|
191
|
+
level?: "error" | "info" | "debug" | "warn" | "trace" | undefined;
|
|
192
192
|
disableTimestamps?: boolean | undefined;
|
|
193
193
|
};
|
|
194
194
|
port?: number | undefined;
|
|
@@ -46,11 +46,10 @@ export default class CamerasService {
|
|
|
46
46
|
cameraSourcesChanged(oldCamera: DBCamera, newCamera: DBCamera): boolean;
|
|
47
47
|
private addCameraSources;
|
|
48
48
|
private removeCameraSources;
|
|
49
|
-
private arraysEqual;
|
|
50
49
|
private generateWsUrls;
|
|
51
50
|
private generateRTSPUrls;
|
|
52
51
|
private generateFFmpegUrls;
|
|
53
|
-
private generatePrebufferUrls;
|
|
54
52
|
private generateWWWUrls;
|
|
53
|
+
private extensionIsEnabled;
|
|
55
54
|
}
|
|
56
55
|
export {};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { RUNTIME_STATUS } from '../../../services/config/types';
|
|
2
|
+
import { PLUGIN_STATUS } from '../../../plugins/types';
|
|
1
3
|
import type { Server, Namespace, Socket } from 'socket.io';
|
|
2
4
|
import type { SocketNsp } from '../types';
|
|
3
5
|
export declare class Status {
|
|
@@ -7,6 +9,12 @@ export declare class Status {
|
|
|
7
9
|
private pluginManager;
|
|
8
10
|
private go2rtc;
|
|
9
11
|
constructor(io: Server);
|
|
10
|
-
watchStats(socket: Socket):
|
|
11
|
-
|
|
12
|
+
watchStats(socket: Socket, payload: any, callback?: Function): {
|
|
13
|
+
name: string;
|
|
14
|
+
status: RUNTIME_STATUS;
|
|
15
|
+
}[];
|
|
16
|
+
watchPluginStats(socket: Socket, payload: any, callback?: Function): {
|
|
17
|
+
name: string;
|
|
18
|
+
status: PLUGIN_STATUS;
|
|
19
|
+
}[];
|
|
12
20
|
}
|
|
@@ -1,20 +1,5 @@
|
|
|
1
|
-
import ws from 'ws';
|
|
2
1
|
import type { Server, Namespace } from 'socket.io';
|
|
3
2
|
import type { SocketNsp } from '../types';
|
|
4
|
-
import type { VideoStreamingMode } from '../../database/types';
|
|
5
|
-
export interface StreamPayload {
|
|
6
|
-
type: VideoStreamingMode;
|
|
7
|
-
value: string;
|
|
8
|
-
}
|
|
9
|
-
export type Go2RtcWsState = 'open' | 'closed' | 'connecting';
|
|
10
|
-
export interface Go2RtcWs {
|
|
11
|
-
id: string;
|
|
12
|
-
ws?: ws;
|
|
13
|
-
state: Go2RtcWsState;
|
|
14
|
-
connect: () => void;
|
|
15
|
-
reconnect: () => void;
|
|
16
|
-
close: (destroy?: boolean) => void;
|
|
17
|
-
}
|
|
18
3
|
export declare class Streams {
|
|
19
4
|
nsp: Namespace;
|
|
20
5
|
nspName: SocketNsp;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { PLUGIN_STATUS } from '../../plugins/types';
|
|
2
2
|
import type { Namespace } from 'socket.io';
|
|
3
|
+
import type { WebSocket } from 'ws';
|
|
4
|
+
import type { VideoStreamingMode } from '../database/types';
|
|
3
5
|
export type SocketNsp = '/camera.ui' | '/metrics' | '/logs' | '/status' | '/notifications' | '/streams' | '/plugins' | '/proxy';
|
|
4
6
|
export interface SocketNspMap {
|
|
5
7
|
nsp: Namespace;
|
|
@@ -80,3 +82,15 @@ export interface PluginRuntime {
|
|
|
80
82
|
name: string;
|
|
81
83
|
status: PLUGIN_STATUS;
|
|
82
84
|
}
|
|
85
|
+
export interface StreamPayload {
|
|
86
|
+
type: Exclude<VideoStreamingMode, 'webrtc' | 'webrtc/tcp'> | 'webrtc/offer' | 'webrtc/candidate';
|
|
87
|
+
value: string;
|
|
88
|
+
}
|
|
89
|
+
export interface Go2RtcWs {
|
|
90
|
+
id: string;
|
|
91
|
+
ws?: WebSocket;
|
|
92
|
+
connect: () => void;
|
|
93
|
+
reconnect: () => void;
|
|
94
|
+
close: (destroy?: boolean) => void;
|
|
95
|
+
send: (data: StreamPayload) => void;
|
|
96
|
+
}
|
package/dist/src/api.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import EventEmitter from 'events';
|
|
3
|
-
import {
|
|
3
|
+
import { CameraController } from './camera';
|
|
4
4
|
import type { PluginLogger } from './services/logger';
|
|
5
5
|
import type { PluginContract } from './plugins/types';
|
|
6
6
|
import type { PluginConfigService } from './plugins/config';
|
|
@@ -54,7 +54,8 @@ export declare class CameraUiAPI extends EventEmitter implements API {
|
|
|
54
54
|
constructor();
|
|
55
55
|
configureCameras(): Promise<void>;
|
|
56
56
|
addCamera(camera: Camera): void;
|
|
57
|
-
getCamera(cameraId: string):
|
|
57
|
+
getCamera(cameraId: string): CameraController | undefined;
|
|
58
|
+
getCameras(): CameraController[];
|
|
58
59
|
updateCamera(cameraData: Camera): void;
|
|
59
60
|
removeCamera(cameraId: string): Promise<void>;
|
|
60
61
|
}
|
|
@@ -1,38 +1,43 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
2
|
import { StreamingSession } from './streaming/streaming-session';
|
|
3
|
-
import type { Camera,
|
|
3
|
+
import type { Camera, CameraPublicProperties, CameraZone, CameraType, CameraInformation } from '../api/database/types';
|
|
4
4
|
import type { ProxyServer } from '../proxy';
|
|
5
|
-
import type { CameraDevice, BaseLogger, CameraDelegate } from './types';
|
|
5
|
+
import type { CameraDevice, BaseLogger, CameraDelegate, CameraPrebufferDelegate } from './types';
|
|
6
6
|
import type { IceServer } from '../services/config/types';
|
|
7
|
-
import type { StateValues, OnSetEvent, LightState, MotionState, AudioState, ObjectState, DoorbellState, SirenState, StreamingConnectionOptions, FfmpegOptions,
|
|
8
|
-
export declare class
|
|
7
|
+
import type { StateValues, OnSetEvent, LightState, MotionState, AudioState, ObjectState, DoorbellState, SirenState, BatteryState, StreamingConnectionOptions, FfmpegOptions, CameraSource } from './types';
|
|
8
|
+
export declare class CameraController implements CameraDevice {
|
|
9
|
+
private log;
|
|
9
10
|
private proxy?;
|
|
10
11
|
private cameraSubject;
|
|
11
|
-
private prebufferSubject;
|
|
12
12
|
private lightState;
|
|
13
13
|
private motionState;
|
|
14
14
|
private audioState;
|
|
15
15
|
private objectState;
|
|
16
16
|
private doorbellState;
|
|
17
17
|
private sirenState;
|
|
18
|
-
|
|
18
|
+
private batteryState;
|
|
19
|
+
private snapshotCache;
|
|
20
|
+
onLightSwitched: Observable<LightState>;
|
|
19
21
|
onMotionDetected: Observable<MotionState>;
|
|
20
22
|
onAudioDetected: Observable<AudioState>;
|
|
21
23
|
onObjectDetected: Observable<ObjectState>;
|
|
22
24
|
onDoorbellPressed: Observable<DoorbellState>;
|
|
23
25
|
onSirenDetected: Observable<SirenState>;
|
|
24
|
-
|
|
26
|
+
onBatteryChanged: Observable<BatteryState>;
|
|
25
27
|
delegate?: CameraDelegate;
|
|
28
|
+
prebufferDelegate?: CameraPrebufferDelegate;
|
|
26
29
|
get id(): string;
|
|
27
30
|
get nativeId(): string | undefined;
|
|
28
31
|
get pluginId(): string;
|
|
29
32
|
get disabled(): boolean;
|
|
30
33
|
get name(): string;
|
|
31
|
-
get type():
|
|
32
|
-
get
|
|
34
|
+
get type(): CameraType;
|
|
35
|
+
get info(): CameraInformation;
|
|
33
36
|
get isCloud(): boolean;
|
|
34
37
|
get hasLight(): boolean;
|
|
35
38
|
get hasSiren(): boolean;
|
|
39
|
+
get hasBinarySensor(): boolean;
|
|
40
|
+
get hasBattery(): boolean;
|
|
36
41
|
get hasMotionDetector(): boolean;
|
|
37
42
|
get hasAudioDetector(): boolean;
|
|
38
43
|
get hasObjectDetector(): boolean;
|
|
@@ -40,16 +45,15 @@ export declare class CameraDeviceHub implements CameraDevice {
|
|
|
40
45
|
get motionZones(): CameraZone[];
|
|
41
46
|
get objectZones(): CameraZone[];
|
|
42
47
|
get sources(): CameraSource[];
|
|
43
|
-
constructor(camera: Camera, logger
|
|
48
|
+
constructor(camera: Camera, logger: BaseLogger, proxy?: ProxyServer);
|
|
49
|
+
reboot(): Promise<void>;
|
|
44
50
|
getStreamSource(): CameraSource;
|
|
45
51
|
getSnapshotSource(): CameraSource;
|
|
46
52
|
getRecordingSource(): CameraSource;
|
|
47
53
|
getDetectionSource(): CameraSource;
|
|
48
54
|
configureDelegate(delegate: CameraDelegate): void;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
removePrebufferSource(sourceIdOrName: string, type: 'recording' | 'stream'): Promise<void>;
|
|
52
|
-
removePrebufferSources(): Promise<void>;
|
|
55
|
+
configurePrebufferDelegate(delegate: CameraPrebufferDelegate): void;
|
|
56
|
+
snapshot(forceNew?: boolean): Promise<ArrayBuffer>;
|
|
53
57
|
getFfmpegPath(): Promise<string>;
|
|
54
58
|
getIceServers(): Promise<IceServer[]>;
|
|
55
59
|
createSession(sourceName: string, options?: StreamingConnectionOptions): Promise<StreamingSession>;
|
|
@@ -66,12 +70,10 @@ export declare class CameraDeviceHub implements CameraDevice {
|
|
|
66
70
|
newData: Camera[T];
|
|
67
71
|
}>;
|
|
68
72
|
updateCamera(updatedCamera: Camera): void;
|
|
69
|
-
updatePrebufferSources(sources: CameraPrebufferInput[]): void;
|
|
70
73
|
removeCamera(): void;
|
|
71
74
|
removeAllListeners(): void;
|
|
72
75
|
private createStateObservable;
|
|
73
76
|
private subscribeToCameraChanges;
|
|
74
|
-
private subscribeToSourceChanges;
|
|
75
77
|
private subscribeToStateChanges;
|
|
76
78
|
private triggerProxyEvent;
|
|
77
79
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { ReplaySubject, Subject } from 'rxjs';
|
|
2
2
|
import { MediaStreamTrack, RTCSessionDescription } from 'werift';
|
|
3
|
-
import { Subscribed } from '../subscribed';
|
|
4
|
-
import type { WebSocket } from 'ws';
|
|
3
|
+
import { Subscribed } from '../utils/subscribed';
|
|
5
4
|
import type { RtpPacket, RtcpPacket, RTCIceCandidate } from 'werift';
|
|
6
|
-
import type { BasicPeerConnection, CameraDevice } from '../types';
|
|
5
|
+
import type { BasicPeerConnection, BaseLogger, CameraDevice } from '../types';
|
|
7
6
|
import type { IceServer } from '../../services/config/types';
|
|
8
7
|
export declare class WeriftPeerConnection extends Subscribed implements BasicPeerConnection {
|
|
9
8
|
onAudioRtp: Subject<RtpPacket>;
|
|
@@ -13,12 +12,11 @@ export declare class WeriftPeerConnection extends Subscribed implements BasicPee
|
|
|
13
12
|
onIceCandidate: Subject<RTCIceCandidate>;
|
|
14
13
|
onConnectionState: ReplaySubject<"closed" | "failed" | "disconnected" | "new" | "connecting" | "connected">;
|
|
15
14
|
returnAudioTrack: MediaStreamTrack;
|
|
16
|
-
private
|
|
17
|
-
private ws?;
|
|
15
|
+
private onRequestKeyFrame;
|
|
18
16
|
private cameraDevice;
|
|
19
17
|
private logger;
|
|
20
|
-
private
|
|
21
|
-
constructor(cameraDevice: CameraDevice, iceServers: IceServer[],
|
|
18
|
+
private pc;
|
|
19
|
+
constructor(cameraDevice: CameraDevice, iceServers: IceServer[], logger: BaseLogger);
|
|
22
20
|
createOffer(): Promise<RTCSessionDescription>;
|
|
23
21
|
acceptAnswer(answer: {
|
|
24
22
|
type: 'answer';
|