@camera.ui/browser 0.0.6 → 0.0.32
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 -0
- package/dist/client/node/src/client.d.ts +0 -1
- package/dist/client/node/src/proxy/cameraDevice/cameraDevice.browser.d.ts +19 -9
- package/dist/client/node/src/proxy/cameraDevice/cameraDevice.node.d.ts +4 -2
- package/dist/client/node/src/proxy/cameraDevice/index.d.ts +0 -4
- package/dist/client/node/src/proxy/deviceManager.d.ts +1 -2
- package/dist/client/node/src/socket.d.ts +5 -1
- package/dist/client/node/src/types.d.ts +5 -3
- package/dist/shared/types/index.d.ts +2 -2
- package/dist/src/api/database/types.d.ts +20 -5
- package/dist/src/api/go2rtc/api/application.d.ts +2 -2
- package/dist/src/api/go2rtc/api/snapshot.d.ts +3 -2
- package/dist/src/api/go2rtc/api/streams.d.ts +6 -5
- package/dist/src/api/go2rtc/types.d.ts +14 -0
- package/dist/src/api/schemas/cameras.schema.d.ts +25 -29
- package/dist/src/api/schemas/config.schema.d.ts +2 -2
- package/dist/src/api/services/cameras.service.d.ts +4 -1
- package/dist/src/api/utils/constants.d.ts +15 -0
- package/dist/src/api.d.ts +4 -4
- package/dist/src/camera/index.d.ts +25 -13
- package/dist/src/camera/streaming/peer-connection.d.ts +6 -5
- package/dist/src/camera/streaming/streaming-session.d.ts +5 -6
- package/dist/src/camera/streaming/webrtc-connection.d.ts +7 -8
- package/dist/src/camera/types.d.ts +28 -8
- package/dist/src/plugins/base.d.ts +1 -1
- package/dist/src/plugins/index.d.ts +7 -2
- package/dist/src/plugins/plugin.d.ts +5 -2
- package/dist/src/plugins/types.d.ts +5 -1
- package/dist/src/plugins/worker.d.ts +1 -0
- package/dist/src/proxy/client/cameraDevice.d.ts +9 -14
- package/dist/src/proxy/client/deviceManager.d.ts +4 -12
- package/dist/src/proxy/client/pluginsManager.d.ts +3 -11
- package/dist/src/proxy/client/queue.d.ts +11 -0
- package/dist/src/proxy/client/systemManager.d.ts +3 -11
- package/dist/src/proxy/constants.d.ts +7 -0
- package/dist/src/proxy/index.d.ts +12 -6
- package/dist/src/proxy/proxies/camera.d.ts +40 -9
- package/dist/src/proxy/proxies/plugin.d.ts +3 -23
- package/dist/src/proxy/proxies/server.d.ts +6 -6
- package/dist/src/proxy/queue.d.ts +15 -0
- package/dist/src/proxy/types.d.ts +67 -6
- package/dist/src/proxy/ws/index.d.ts +0 -9
- package/dist/src/services/config/constants.d.ts +6 -0
- package/dist/src/services/config/index.d.ts +1 -1
- package/dist/src/services/logger/index.d.ts +2 -0
- package/package.json +8 -7
- package/webpack.config.ts +43 -0
- package/dist/bundle.browser.js +0 -1
- package/dist/src/api/utils/cert.d.ts +0 -17
- /package/dist/src/plugins/{storage.d.ts → storageController.d.ts} +0 -0
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
2
|
import type { SocketService } from '../../socket';
|
|
3
|
-
import type { Camera, CameraDevice, StateValue, StateValues, OnSetEvent,
|
|
4
|
-
export declare interface CameraDeviceClient {
|
|
5
|
-
createSession(cameraInput: CameraInput, options?: {}): Promise<any>;
|
|
6
|
-
streamVideo(cameraInput: CameraInput, options: {}): Promise<any>;
|
|
7
|
-
recordToFile(cameraInput: CameraInput, outputPath: string, duration?: number): Promise<void>;
|
|
8
|
-
}
|
|
3
|
+
import type { Camera, CameraDevice, StateValue, StateValues, OnSetEvent, PrebufferType, LightState, MotionState, AudioState, ObjectState, DoorbellState, SirenState, BaseLogger, FfmpegOptions, Input } from '../../../../../shared/types';
|
|
9
4
|
export declare class CameraDeviceClient implements CameraDevice {
|
|
10
5
|
private socketService;
|
|
11
|
-
private logger;
|
|
12
6
|
private cameraSubject;
|
|
13
7
|
private lightState;
|
|
14
8
|
private motionState;
|
|
@@ -22,15 +16,30 @@ export declare class CameraDeviceClient implements CameraDevice {
|
|
|
22
16
|
onObjectDetected: Observable<ObjectState>;
|
|
23
17
|
onDoorbellPressed: Observable<DoorbellState>;
|
|
24
18
|
onSirenDetected: Observable<SirenState>;
|
|
19
|
+
logger: BaseLogger;
|
|
25
20
|
get id(): string;
|
|
26
21
|
get nativeId(): string | undefined;
|
|
27
|
-
get
|
|
22
|
+
get disabled(): boolean;
|
|
28
23
|
get name(): string;
|
|
29
24
|
get type(): string;
|
|
30
25
|
get model(): string;
|
|
31
|
-
get
|
|
26
|
+
get isCloud(): boolean;
|
|
27
|
+
get hasLight(): boolean;
|
|
28
|
+
get hasSiren(): boolean;
|
|
29
|
+
get hasMotionDetector(): boolean;
|
|
30
|
+
get hasAudioDetector(): boolean;
|
|
31
|
+
get hasObjectDetector(): boolean;
|
|
32
|
+
get hasPtz(): boolean;
|
|
33
|
+
get sources(): Input[];
|
|
32
34
|
constructor(camera: Camera, socketService: SocketService, logger: BaseLogger);
|
|
35
|
+
snapshot(sourceName?: string): Promise<ArrayBuffer>;
|
|
36
|
+
setPrebufferSource(sourceName: string, address: string | null, type: PrebufferType, fromCamera?: boolean): Promise<void>;
|
|
37
|
+
getFfmpegPath(): Promise<string>;
|
|
38
|
+
getIceServers(): Promise<RTCIceServer[]>;
|
|
33
39
|
getValue<T extends keyof StateValues>(stateName: T): StateValue<T>;
|
|
40
|
+
createSession(): Promise<any>;
|
|
41
|
+
streamVideo(sourceName: string, options: FfmpegOptions): Promise<any>;
|
|
42
|
+
recordToFile(sourceName: string, outputPath: string, duration?: number): Promise<void>;
|
|
34
43
|
updateState<T extends keyof StateValues>(stateName: T, eventData: OnSetEvent<T>, isRemote?: boolean): Promise<void>;
|
|
35
44
|
onStateChange<T extends keyof StateValues>(stateName: T): Observable<{
|
|
36
45
|
newState: StateValues[T];
|
|
@@ -43,6 +52,7 @@ export declare class CameraDeviceClient implements CameraDevice {
|
|
|
43
52
|
removeAllListeners(): void;
|
|
44
53
|
refreshStates(): Promise<void>;
|
|
45
54
|
private updateCamera;
|
|
55
|
+
private updateSources;
|
|
46
56
|
private unsubscribe;
|
|
47
57
|
private createStateObservable;
|
|
48
58
|
private listenToChanges;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { CameraDeviceHub } from '../../../../../src/camera';
|
|
2
2
|
import type { SocketService } from '../../socket';
|
|
3
|
-
import type { Camera, StateValues, OnSetEvent, BaseLogger } from '../../../../../shared/types';
|
|
3
|
+
import type { Camera, StateValues, OnSetEvent, BaseLogger, IceServer } from '../../../../../shared/types';
|
|
4
4
|
export declare class CameraDeviceClient extends CameraDeviceHub {
|
|
5
5
|
private socketService;
|
|
6
|
-
constructor(camera: Camera, socketService: SocketService, logger: BaseLogger
|
|
6
|
+
constructor(camera: Camera, socketService: SocketService, logger: BaseLogger);
|
|
7
|
+
getFfmpegPath(): Promise<string>;
|
|
8
|
+
getIceServers(): Promise<IceServer[]>;
|
|
7
9
|
updateState<T extends keyof StateValues>(stateName: T, eventData: OnSetEvent<T>): Promise<void>;
|
|
8
10
|
refreshStates(): Promise<void>;
|
|
9
11
|
removeAllListeners(): void;
|
|
@@ -4,8 +4,7 @@ export declare class DeviceManagerClient implements DeviceManagerProxyMethods {
|
|
|
4
4
|
private socketService;
|
|
5
5
|
private devices;
|
|
6
6
|
private logger;
|
|
7
|
-
|
|
8
|
-
constructor(socketService: SocketService, logger: BaseLogger, ffmpegPath: string);
|
|
7
|
+
constructor(socketService: SocketService, logger: BaseLogger);
|
|
9
8
|
getCameraByName(name: string): Promise<CameraDevice | undefined>;
|
|
10
9
|
getCameraById(id: string): Promise<CameraDevice | undefined>;
|
|
11
10
|
createCamera(camera: CameraConfig): Promise<CameraDevice>;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { Manager, type Socket } from 'socket.io-client';
|
|
2
|
+
import type { CameraDeviceProxyMethodNames, DeviceManagerProxyMethodNames, PluginsManagerProxyMethodNames, SystemManagerProxyMethodNames } from '../../../shared/types';
|
|
3
|
+
type ManagerMethodNames = DeviceManagerProxyMethodNames | SystemManagerProxyMethodNames | PluginsManagerProxyMethodNames;
|
|
4
|
+
type MethodNames<T> = T extends 'manager' ? ManagerMethodNames : T extends 'cameraDevice' ? CameraDeviceProxyMethodNames : never;
|
|
2
5
|
export declare class SocketService {
|
|
3
6
|
manager: Manager;
|
|
4
7
|
private token;
|
|
5
8
|
constructor(endpoint: string, token: string);
|
|
6
|
-
sendRequest(managerType:
|
|
9
|
+
sendRequest<T extends 'manager' | 'cameraDevice'>(managerType: T, methodName: MethodNames<T>, args: any[]): Promise<any>;
|
|
7
10
|
getSocket(): Socket;
|
|
8
11
|
close(): void;
|
|
9
12
|
}
|
|
13
|
+
export {};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { DeviceManagerClient, PluginsManagerClient, SystemManagerClient } from './proxy';
|
|
2
|
-
import type { BaseLogger } from '../../../shared/types';
|
|
3
|
-
export type { BaseLogger, BasicPeerConnection, CameraConfig, CameraDevice, Camera, CameraInput, Go2RtcIceCandidateMessage, Go2RtcOfferMessage, Go2RtcAnswerMessage, Go2RtcIncomingMessage, Go2RtcOutgoingMessage, LightState, MotionState, AudioState, ObjectState, DoorbellState, SirenState, } from '../../../shared/types';
|
|
2
|
+
import type { BaseLogger, CameraDevice } from '../../../shared/types';
|
|
3
|
+
export type { BaseLogger, BasicPeerConnection, CameraConfig, CameraDevice, Camera, CameraInput, FfmpegOptions, Go2RtcIceCandidateMessage, Go2RtcOfferMessage, Go2RtcAnswerMessage, Go2RtcIncomingMessage, Go2RtcOutgoingMessage, LightState, MotionState, AudioState, ObjectState, DoorbellState, SirenState, } from '../../../shared/types';
|
|
4
|
+
export interface ICameraDeviceClient extends CameraDevice {
|
|
5
|
+
refreshStates(): Promise<void>;
|
|
6
|
+
}
|
|
4
7
|
export type CameraUiClientConfig = WithCredentials | WithToken;
|
|
5
8
|
export interface API {
|
|
6
9
|
deviceManager: DeviceManagerClient;
|
|
@@ -11,7 +14,6 @@ interface BaseConfig {
|
|
|
11
14
|
endpoint: string;
|
|
12
15
|
skipCheck?: boolean;
|
|
13
16
|
logger?: BaseLogger;
|
|
14
|
-
ffmpegPath?: string;
|
|
15
17
|
}
|
|
16
18
|
interface WithCredentials extends BaseConfig {
|
|
17
19
|
username: string;
|
|
@@ -4,5 +4,5 @@ export * from '../../src/api/database/types';
|
|
|
4
4
|
export * from '../../src/plugins/types';
|
|
5
5
|
export * from '../../src/api/ws/types';
|
|
6
6
|
export * from '../../src/go2rtc/types';
|
|
7
|
-
export
|
|
8
|
-
export
|
|
7
|
+
export * from '../../src/camera/types';
|
|
8
|
+
export * from '../../src/proxy/types';
|
|
@@ -73,6 +73,9 @@ export interface BaseCamera {
|
|
|
73
73
|
pluginId: string;
|
|
74
74
|
name: string;
|
|
75
75
|
disabled: boolean;
|
|
76
|
+
isCloud: boolean;
|
|
77
|
+
hasLight: boolean;
|
|
78
|
+
hasSiren: boolean;
|
|
76
79
|
model: string;
|
|
77
80
|
type: CameraType;
|
|
78
81
|
}
|
|
@@ -83,8 +86,15 @@ export interface DBCamera extends BaseCamera {
|
|
|
83
86
|
recording: CameraRecordingSettings;
|
|
84
87
|
}
|
|
85
88
|
export interface Camera extends BaseCamera {
|
|
89
|
+
hasAudioDetector: boolean;
|
|
90
|
+
hasMotionDetector: boolean;
|
|
91
|
+
hasObjectDetector: boolean;
|
|
92
|
+
hasPtz: boolean;
|
|
86
93
|
sources: CameraInput[];
|
|
87
94
|
}
|
|
95
|
+
export type CameraPrivateProperties = '_id' | 'nativeId' | 'pluginId' | 'hasLight' | 'hasSiren' | 'isCloud';
|
|
96
|
+
export interface CameraPublicProperties extends Omit<Camera, CameraPrivateProperties> {
|
|
97
|
+
}
|
|
88
98
|
export type CameraType = 'camera' | 'doorbell';
|
|
89
99
|
export interface CameraBranding {
|
|
90
100
|
model: string;
|
|
@@ -98,7 +108,7 @@ export interface CameraExtensions {
|
|
|
98
108
|
hub?: string[];
|
|
99
109
|
prebuffer?: string;
|
|
100
110
|
motionDetection?: string;
|
|
101
|
-
|
|
111
|
+
audioDetection?: string;
|
|
102
112
|
objectDetection?: string;
|
|
103
113
|
intercom?: string;
|
|
104
114
|
ptz?: string;
|
|
@@ -135,16 +145,21 @@ export interface Go2RtcFFMPEGSource {
|
|
|
135
145
|
aac: string;
|
|
136
146
|
opus: string;
|
|
137
147
|
}
|
|
138
|
-
export interface
|
|
148
|
+
export interface Go2RtcPrebufferSource {
|
|
149
|
+
stream?: string;
|
|
150
|
+
recording?: string;
|
|
151
|
+
}
|
|
152
|
+
export interface StreamSources {
|
|
139
153
|
webrtc: string;
|
|
140
154
|
rtsp: Go2RtcRTSPSource;
|
|
141
|
-
|
|
142
|
-
|
|
155
|
+
transcoded: Go2RtcFFMPEGSource;
|
|
156
|
+
prebuffer: Go2RtcPrebufferSource;
|
|
157
|
+
endpoints: Go2RtcEndpoint;
|
|
143
158
|
}
|
|
144
159
|
export interface CameraInput {
|
|
145
160
|
name: string;
|
|
146
161
|
roles: CameraRoles[];
|
|
147
|
-
sources:
|
|
162
|
+
sources: StreamSources;
|
|
148
163
|
}
|
|
149
164
|
export type CameraRoles = 'detect' | 'record' | 'stream' | 'snapshot' | 'none';
|
|
150
165
|
export interface CameraUiSettings {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ApplicationResponse } from '../types';
|
|
1
|
+
import type { ApplicationResponse, ExitData } from '../types';
|
|
2
2
|
declare class ApplicationService {
|
|
3
|
-
close(
|
|
3
|
+
close(data: ExitData): Promise<void>;
|
|
4
4
|
info(): Promise<ApplicationResponse>;
|
|
5
5
|
restart(): Promise<void>;
|
|
6
6
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { SourceData } from '../types';
|
|
1
2
|
declare class SnapshotService {
|
|
2
|
-
jpeg(data:
|
|
3
|
-
mp4(data:
|
|
3
|
+
jpeg(data: SourceData): Promise<string>;
|
|
4
|
+
mp4(data: SourceData): Promise<string>;
|
|
4
5
|
}
|
|
5
6
|
declare const _default: SnapshotService;
|
|
6
7
|
export default _default;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { AxiosResponse } from 'axios';
|
|
2
|
+
import type { StreamData, SourceData, IntercomData } from '../types';
|
|
2
3
|
declare class StreamsService {
|
|
3
|
-
createStream(data:
|
|
4
|
-
deleteStream(data:
|
|
5
|
-
getStreamInfo(data:
|
|
6
|
-
sendStreamToDst(data:
|
|
7
|
-
updateStreamSource(data:
|
|
4
|
+
createStream(data: StreamData): Promise<AxiosResponse>;
|
|
5
|
+
deleteStream(data: SourceData): Promise<AxiosResponse>;
|
|
6
|
+
getStreamInfo(data: SourceData): Promise<AxiosResponse>;
|
|
7
|
+
sendStreamToDst(data: IntercomData): Promise<AxiosResponse>;
|
|
8
|
+
updateStreamSource(data: StreamData): Promise<AxiosResponse>;
|
|
8
9
|
}
|
|
9
10
|
declare const _default: StreamsService;
|
|
10
11
|
export default _default;
|
|
@@ -41,3 +41,17 @@ export interface OnvifSource {
|
|
|
41
41
|
name: string;
|
|
42
42
|
url: string;
|
|
43
43
|
}
|
|
44
|
+
export interface ExitData {
|
|
45
|
+
code: number;
|
|
46
|
+
}
|
|
47
|
+
export interface SourceData {
|
|
48
|
+
src: string;
|
|
49
|
+
}
|
|
50
|
+
export interface StreamData {
|
|
51
|
+
src: string;
|
|
52
|
+
name: string;
|
|
53
|
+
}
|
|
54
|
+
export interface IntercomData {
|
|
55
|
+
src: string;
|
|
56
|
+
dst: string;
|
|
57
|
+
}
|
|
@@ -34,9 +34,8 @@ export declare const extensionsSettingsSchema: zod.ZodObject<{
|
|
|
34
34
|
hub: zod.ZodOptional<zod.ZodArray<zod.ZodString, "many">>;
|
|
35
35
|
prebuffer: zod.ZodOptional<zod.ZodString>;
|
|
36
36
|
motionDetection: zod.ZodOptional<zod.ZodString>;
|
|
37
|
-
|
|
37
|
+
audioDetection: zod.ZodOptional<zod.ZodString>;
|
|
38
38
|
objectDetection: zod.ZodOptional<zod.ZodString>;
|
|
39
|
-
intercom: zod.ZodOptional<zod.ZodString>;
|
|
40
39
|
ptz: zod.ZodOptional<zod.ZodString>;
|
|
41
40
|
plugins: zod.ZodArray<zod.ZodString, "many">;
|
|
42
41
|
}, "strict", zod.ZodTypeAny, {
|
|
@@ -44,18 +43,16 @@ export declare const extensionsSettingsSchema: zod.ZodObject<{
|
|
|
44
43
|
hub?: string[] | undefined;
|
|
45
44
|
prebuffer?: string | undefined;
|
|
46
45
|
motionDetection?: string | undefined;
|
|
47
|
-
|
|
46
|
+
audioDetection?: string | undefined;
|
|
48
47
|
objectDetection?: string | undefined;
|
|
49
|
-
intercom?: string | undefined;
|
|
50
48
|
ptz?: string | undefined;
|
|
51
49
|
}, {
|
|
52
50
|
plugins: string[];
|
|
53
51
|
hub?: string[] | undefined;
|
|
54
52
|
prebuffer?: string | undefined;
|
|
55
53
|
motionDetection?: string | undefined;
|
|
56
|
-
|
|
54
|
+
audioDetection?: string | undefined;
|
|
57
55
|
objectDetection?: string | undefined;
|
|
58
|
-
intercom?: string | undefined;
|
|
59
56
|
ptz?: string | undefined;
|
|
60
57
|
}>;
|
|
61
58
|
export declare const streamingModeSchema: zod.ZodUnion<[zod.ZodLiteral<"mse">, zod.ZodLiteral<"webrtc">, zod.ZodLiteral<"webrtc/tcp">, zod.ZodLiteral<"mjpeg">, zod.ZodLiteral<"hls">, zod.ZodLiteral<"mp4">]>;
|
|
@@ -72,9 +69,12 @@ export declare const createCameraSchema: zod.ZodObject<{
|
|
|
72
69
|
nativeId: zod.ZodOptional<zod.ZodString>;
|
|
73
70
|
pluginId: zod.ZodDefault<zod.ZodString>;
|
|
74
71
|
disabled: zod.ZodDefault<zod.ZodBoolean>;
|
|
75
|
-
model: zod.ZodDefault<zod.ZodOptional<zod.ZodString>>;
|
|
76
|
-
type: zod.ZodDefault<zod.ZodUnion<[zod.ZodLiteral<"camera">, zod.ZodLiteral<"doorbell">]>>;
|
|
77
72
|
name: zod.ZodString;
|
|
73
|
+
type: zod.ZodDefault<zod.ZodUnion<[zod.ZodLiteral<"camera">, zod.ZodLiteral<"doorbell">]>>;
|
|
74
|
+
isCloud: zod.ZodDefault<zod.ZodBoolean>;
|
|
75
|
+
hasLight: zod.ZodDefault<zod.ZodBoolean>;
|
|
76
|
+
hasSiren: zod.ZodDefault<zod.ZodBoolean>;
|
|
77
|
+
model: zod.ZodDefault<zod.ZodOptional<zod.ZodString>>;
|
|
78
78
|
sources: zod.ZodArray<zod.ZodObject<{
|
|
79
79
|
name: zod.ZodEffects<zod.ZodString, string, string>;
|
|
80
80
|
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")[]>;
|
|
@@ -92,9 +92,8 @@ export declare const createCameraSchema: zod.ZodObject<{
|
|
|
92
92
|
hub: zod.ZodOptional<zod.ZodArray<zod.ZodString, "many">>;
|
|
93
93
|
prebuffer: zod.ZodOptional<zod.ZodString>;
|
|
94
94
|
motionDetection: zod.ZodOptional<zod.ZodString>;
|
|
95
|
-
|
|
95
|
+
audioDetection: zod.ZodOptional<zod.ZodString>;
|
|
96
96
|
objectDetection: zod.ZodOptional<zod.ZodString>;
|
|
97
|
-
intercom: zod.ZodOptional<zod.ZodString>;
|
|
98
97
|
ptz: zod.ZodOptional<zod.ZodString>;
|
|
99
98
|
plugins: zod.ZodArray<zod.ZodString, "many">;
|
|
100
99
|
}, "strict", zod.ZodTypeAny, {
|
|
@@ -102,18 +101,16 @@ export declare const createCameraSchema: zod.ZodObject<{
|
|
|
102
101
|
hub?: string[] | undefined;
|
|
103
102
|
prebuffer?: string | undefined;
|
|
104
103
|
motionDetection?: string | undefined;
|
|
105
|
-
|
|
104
|
+
audioDetection?: string | undefined;
|
|
106
105
|
objectDetection?: string | undefined;
|
|
107
|
-
intercom?: string | undefined;
|
|
108
106
|
ptz?: string | undefined;
|
|
109
107
|
}, {
|
|
110
108
|
plugins: string[];
|
|
111
109
|
hub?: string[] | undefined;
|
|
112
110
|
prebuffer?: string | undefined;
|
|
113
111
|
motionDetection?: string | undefined;
|
|
114
|
-
|
|
112
|
+
audioDetection?: string | undefined;
|
|
115
113
|
objectDetection?: string | undefined;
|
|
116
|
-
intercom?: string | undefined;
|
|
117
114
|
ptz?: string | undefined;
|
|
118
115
|
}>>;
|
|
119
116
|
recording: zod.ZodDefault<zod.ZodObject<{
|
|
@@ -136,6 +133,9 @@ export declare const createCameraSchema: zod.ZodObject<{
|
|
|
136
133
|
type: "camera" | "doorbell";
|
|
137
134
|
pluginId: string;
|
|
138
135
|
disabled: boolean;
|
|
136
|
+
isCloud: boolean;
|
|
137
|
+
hasLight: boolean;
|
|
138
|
+
hasSiren: boolean;
|
|
139
139
|
model: string;
|
|
140
140
|
sources: {
|
|
141
141
|
name: string;
|
|
@@ -147,9 +147,8 @@ export declare const createCameraSchema: zod.ZodObject<{
|
|
|
147
147
|
hub?: string[] | undefined;
|
|
148
148
|
prebuffer?: string | undefined;
|
|
149
149
|
motionDetection?: string | undefined;
|
|
150
|
-
|
|
150
|
+
audioDetection?: string | undefined;
|
|
151
151
|
objectDetection?: string | undefined;
|
|
152
|
-
intercom?: string | undefined;
|
|
153
152
|
ptz?: string | undefined;
|
|
154
153
|
};
|
|
155
154
|
recording: {
|
|
@@ -170,16 +169,18 @@ export declare const createCameraSchema: zod.ZodObject<{
|
|
|
170
169
|
nativeId?: string | undefined;
|
|
171
170
|
pluginId?: string | undefined;
|
|
172
171
|
disabled?: boolean | undefined;
|
|
173
|
-
model?: string | undefined;
|
|
174
172
|
type?: "camera" | "doorbell" | undefined;
|
|
173
|
+
isCloud?: boolean | undefined;
|
|
174
|
+
hasLight?: boolean | undefined;
|
|
175
|
+
hasSiren?: boolean | undefined;
|
|
176
|
+
model?: string | undefined;
|
|
175
177
|
extensions?: {
|
|
176
178
|
plugins: string[];
|
|
177
179
|
hub?: string[] | undefined;
|
|
178
180
|
prebuffer?: string | undefined;
|
|
179
181
|
motionDetection?: string | undefined;
|
|
180
|
-
|
|
182
|
+
audioDetection?: string | undefined;
|
|
181
183
|
objectDetection?: string | undefined;
|
|
182
|
-
intercom?: string | undefined;
|
|
183
184
|
ptz?: string | undefined;
|
|
184
185
|
} | undefined;
|
|
185
186
|
recording?: {
|
|
@@ -211,27 +212,24 @@ export declare const patchCameraSchema: zod.ZodObject<{
|
|
|
211
212
|
hub: zod.ZodOptional<zod.ZodOptional<zod.ZodArray<zod.ZodString, "many">>>;
|
|
212
213
|
prebuffer: zod.ZodOptional<zod.ZodOptional<zod.ZodString>>;
|
|
213
214
|
motionDetection: zod.ZodOptional<zod.ZodOptional<zod.ZodString>>;
|
|
214
|
-
|
|
215
|
+
audioDetection: zod.ZodOptional<zod.ZodOptional<zod.ZodString>>;
|
|
215
216
|
objectDetection: zod.ZodOptional<zod.ZodOptional<zod.ZodString>>;
|
|
216
|
-
intercom: zod.ZodOptional<zod.ZodOptional<zod.ZodString>>;
|
|
217
217
|
ptz: zod.ZodOptional<zod.ZodOptional<zod.ZodString>>;
|
|
218
218
|
plugins: zod.ZodOptional<zod.ZodArray<zod.ZodString, "many">>;
|
|
219
219
|
}, "strict", zod.ZodTypeAny, {
|
|
220
220
|
hub?: string[] | undefined;
|
|
221
221
|
prebuffer?: string | undefined;
|
|
222
222
|
motionDetection?: string | undefined;
|
|
223
|
-
|
|
223
|
+
audioDetection?: string | undefined;
|
|
224
224
|
objectDetection?: string | undefined;
|
|
225
|
-
intercom?: string | undefined;
|
|
226
225
|
ptz?: string | undefined;
|
|
227
226
|
plugins?: string[] | undefined;
|
|
228
227
|
}, {
|
|
229
228
|
hub?: string[] | undefined;
|
|
230
229
|
prebuffer?: string | undefined;
|
|
231
230
|
motionDetection?: string | undefined;
|
|
232
|
-
|
|
231
|
+
audioDetection?: string | undefined;
|
|
233
232
|
objectDetection?: string | undefined;
|
|
234
|
-
intercom?: string | undefined;
|
|
235
233
|
ptz?: string | undefined;
|
|
236
234
|
plugins?: string[] | undefined;
|
|
237
235
|
}>>;
|
|
@@ -263,9 +261,8 @@ export declare const patchCameraSchema: zod.ZodObject<{
|
|
|
263
261
|
hub?: string[] | undefined;
|
|
264
262
|
prebuffer?: string | undefined;
|
|
265
263
|
motionDetection?: string | undefined;
|
|
266
|
-
|
|
264
|
+
audioDetection?: string | undefined;
|
|
267
265
|
objectDetection?: string | undefined;
|
|
268
|
-
intercom?: string | undefined;
|
|
269
266
|
ptz?: string | undefined;
|
|
270
267
|
plugins?: string[] | undefined;
|
|
271
268
|
} | undefined;
|
|
@@ -289,9 +286,8 @@ export declare const patchCameraSchema: zod.ZodObject<{
|
|
|
289
286
|
hub?: string[] | undefined;
|
|
290
287
|
prebuffer?: string | undefined;
|
|
291
288
|
motionDetection?: string | undefined;
|
|
292
|
-
|
|
289
|
+
audioDetection?: string | undefined;
|
|
293
290
|
objectDetection?: string | undefined;
|
|
294
|
-
intercom?: string | undefined;
|
|
295
291
|
ptz?: string | undefined;
|
|
296
292
|
plugins?: string[] | undefined;
|
|
297
293
|
} | undefined;
|
|
@@ -61,9 +61,9 @@ export declare const mqttSchema: zod.ZodObject<{
|
|
|
61
61
|
key?: string | undefined;
|
|
62
62
|
}>>>;
|
|
63
63
|
}, "strict", zod.ZodTypeAny, {
|
|
64
|
+
enabled: boolean;
|
|
64
65
|
host: string;
|
|
65
66
|
port: number;
|
|
66
|
-
enabled: boolean;
|
|
67
67
|
topicPrefix: string;
|
|
68
68
|
clientId: string;
|
|
69
69
|
tls: {
|
|
@@ -161,11 +161,11 @@ export declare const patchConfigSchema: zod.ZodObject<{
|
|
|
161
161
|
snapshotCache?: number | undefined;
|
|
162
162
|
}>>;
|
|
163
163
|
}, "strict", zod.ZodTypeAny, {
|
|
164
|
-
port: number;
|
|
165
164
|
plugins: {
|
|
166
165
|
sudo?: boolean | undefined;
|
|
167
166
|
disabledPlugins?: string[] | undefined;
|
|
168
167
|
};
|
|
168
|
+
port: number;
|
|
169
169
|
ssl: {
|
|
170
170
|
certFile: string;
|
|
171
171
|
keyFile: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { DBCamera, Camera } from '../database/types';
|
|
2
2
|
import { type CameraExtension } from '../../plugins/types';
|
|
3
|
+
import type { PrebufferType } from '../../camera/types';
|
|
3
4
|
type DeepPartial<T> = T extends object ? {
|
|
4
5
|
[P in keyof T]?: DeepPartial<T[P]>;
|
|
5
6
|
} : T;
|
|
@@ -12,6 +13,7 @@ export default class CamerasService {
|
|
|
12
13
|
private pluginsService;
|
|
13
14
|
constructor();
|
|
14
15
|
createCamera(cameraData: DBCamera): Promise<DBCamera>;
|
|
16
|
+
createCameraSource(cameraName: string, sourceName: string, address: string | null, type: PrebufferType): Promise<string>;
|
|
15
17
|
createTransformedCamera(cameraData: DBCamera): Promise<Camera>;
|
|
16
18
|
list(): Promise<DBCamera[]>;
|
|
17
19
|
listTransformed(): Promise<Camera[]>;
|
|
@@ -30,11 +32,12 @@ export default class CamerasService {
|
|
|
30
32
|
disableExtensionByName(cameraname: string, pluginName: string, type?: CameraExtension): Promise<DBCamera | undefined>;
|
|
31
33
|
addExtensionByName(cameraname: string, pluginName: string): Promise<DBCamera | undefined>;
|
|
32
34
|
removeExtensionByName(cameraname: string, pluginName: string): Promise<DBCamera | undefined>;
|
|
35
|
+
removeExtension(pluginName: string): Promise<void>;
|
|
33
36
|
removeByName(cameraname: string): Promise<void>;
|
|
34
37
|
removeById(id: string): Promise<void>;
|
|
35
38
|
removeByPluginId(pluginId: string): Promise<void>;
|
|
36
39
|
removeByPluginIdAndName(cameraname: string, pluginId: string): Promise<void>;
|
|
37
40
|
removeAll(): Promise<void>;
|
|
38
|
-
transformCamera
|
|
41
|
+
private transformCamera;
|
|
39
42
|
}
|
|
40
43
|
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const HOST_CERT_FILENAME = "camera.ui.cert.pem";
|
|
2
|
+
export declare const HOST_KEY_FILENAME = "camera.ui.key.pem";
|
|
3
|
+
export declare const ROOT_CERT_FILENAME = "camera.ui.root.cert.pem";
|
|
4
|
+
export declare const ROOT_KEY_FILENAME = "camera.ui.root.key.pem";
|
|
5
|
+
export declare const P12_FILENAME = "camera.ui.p12";
|
|
6
|
+
export declare const P12_PASSWORD = "camera.ui";
|
|
7
|
+
export declare const DEFAULTS: {
|
|
8
|
+
C: string;
|
|
9
|
+
ST: string;
|
|
10
|
+
L: string;
|
|
11
|
+
O: string;
|
|
12
|
+
OU: string;
|
|
13
|
+
CN: string;
|
|
14
|
+
ROOT_CN: string;
|
|
15
|
+
};
|
package/dist/src/api.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import EventEmitter from 'events';
|
|
3
|
+
import { CameraDeviceHub } from './camera';
|
|
3
4
|
import type { PluginLogger } from './services/logger';
|
|
4
5
|
import type { PluginContract } from './plugins/types';
|
|
5
6
|
import type { PluginConfigService } from './plugins/config';
|
|
6
7
|
import type { BasePlugin } from './plugins/base';
|
|
7
|
-
import type { Storage } from './plugins/
|
|
8
|
+
import type { Storage } from './plugins/storageController';
|
|
8
9
|
import type { Camera } from './api/database/types';
|
|
9
10
|
import type { DeviceManager, PluginsManager, SystemManager } from './proxy/client';
|
|
10
|
-
import type { CameraDevice } from './camera/types';
|
|
11
11
|
export interface PluginInitializer {
|
|
12
12
|
(api: API): void | Promise<void>;
|
|
13
13
|
}
|
|
@@ -54,7 +54,7 @@ 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):
|
|
58
|
-
updateCamera(cameraData: Camera):
|
|
57
|
+
getCamera(cameraId: string): CameraDeviceHub | undefined;
|
|
58
|
+
updateCamera(cameraData: Camera): void;
|
|
59
59
|
removeCamera(cameraId: string): Promise<void>;
|
|
60
60
|
}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
2
|
import { StreamingSession } from './streaming/streaming-session';
|
|
3
|
-
import type { Camera, CameraInput } from '../api/database/types';
|
|
3
|
+
import type { Camera, CameraInput, CameraPublicProperties } from '../api/database/types';
|
|
4
4
|
import type { ProxyServer } from '../proxy';
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
5
|
+
import type { CameraDevice, BaseLogger, Input } from './types';
|
|
6
|
+
import type { IceServer } from '../services/config/types';
|
|
7
|
+
import type { StateValues, OnSetEvent, LightState, MotionState, AudioState, ObjectState, DoorbellState, SirenState, StreamingConnectionOptions, FfmpegOptions, PrebufferType } from './types';
|
|
7
8
|
export declare class CameraDeviceHub implements CameraDevice {
|
|
8
|
-
private ffmpegPath;
|
|
9
|
-
private logger;
|
|
10
9
|
private proxy?;
|
|
11
10
|
private cameraSubject;
|
|
12
11
|
private lightState;
|
|
@@ -21,28 +20,41 @@ export declare class CameraDeviceHub implements CameraDevice {
|
|
|
21
20
|
onObjectDetected: Observable<ObjectState>;
|
|
22
21
|
onDoorbellPressed: Observable<DoorbellState>;
|
|
23
22
|
onSirenDetected: Observable<SirenState>;
|
|
23
|
+
logger: BaseLogger;
|
|
24
24
|
get id(): string;
|
|
25
25
|
get nativeId(): string | undefined;
|
|
26
|
-
get
|
|
26
|
+
get disabled(): boolean;
|
|
27
27
|
get name(): string;
|
|
28
28
|
get type(): string;
|
|
29
29
|
get model(): string;
|
|
30
|
-
get
|
|
31
|
-
|
|
30
|
+
get isCloud(): boolean;
|
|
31
|
+
get hasLight(): boolean;
|
|
32
|
+
get hasSiren(): boolean;
|
|
33
|
+
get hasMotionDetector(): boolean;
|
|
34
|
+
get hasAudioDetector(): boolean;
|
|
35
|
+
get hasObjectDetector(): boolean;
|
|
36
|
+
get hasPtz(): boolean;
|
|
37
|
+
get sources(): Input[];
|
|
38
|
+
constructor(camera: Camera, logger?: BaseLogger, proxy?: ProxyServer);
|
|
39
|
+
snapshot(sourceName?: string): Promise<ArrayBuffer>;
|
|
40
|
+
setPrebufferSource(sourceName: string, address: string | null, type: PrebufferType, fromCamera?: boolean): Promise<void>;
|
|
41
|
+
getFfmpegPath(): Promise<string>;
|
|
42
|
+
getIceServers(): Promise<IceServer[]>;
|
|
32
43
|
getValue<T extends keyof StateValues>(stateName: T): StateValues[T];
|
|
33
|
-
createSession(
|
|
34
|
-
streamVideo(
|
|
35
|
-
recordToFile(
|
|
36
|
-
updateState<T extends keyof StateValues>(stateName: T, eventData: OnSetEvent<T>): void
|
|
44
|
+
createSession(sourceName: string, options?: StreamingConnectionOptions): Promise<StreamingSession>;
|
|
45
|
+
streamVideo(sourceName: string, options: FfmpegOptions): Promise<StreamingSession>;
|
|
46
|
+
recordToFile(sourceName: string, outputPath: string, duration?: number): Promise<void>;
|
|
47
|
+
updateState<T extends keyof StateValues>(stateName: T, eventData: OnSetEvent<T>): Promise<void>;
|
|
37
48
|
onStateChange<T extends keyof StateValues>(stateName: T): Observable<{
|
|
38
49
|
newState: StateValues[T];
|
|
39
50
|
oldState: StateValues[T];
|
|
40
51
|
}>;
|
|
41
|
-
onPropertyChange<T extends keyof
|
|
52
|
+
onPropertyChange<T extends keyof CameraPublicProperties>(property: T): Observable<{
|
|
42
53
|
oldState: Camera[T];
|
|
43
54
|
newState: Camera[T];
|
|
44
55
|
}>;
|
|
45
56
|
updateCamera(camera: Camera): void;
|
|
57
|
+
updateSources(sources: CameraInput[]): void;
|
|
46
58
|
removeCamera(): void;
|
|
47
59
|
removeAllListeners(): void;
|
|
48
60
|
private createStateObservable;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { ReplaySubject, Subject } from 'rxjs';
|
|
2
|
-
import { MediaStreamTrack } from 'werift';
|
|
2
|
+
import { MediaStreamTrack, RTCSessionDescription } from 'werift';
|
|
3
3
|
import { Subscribed } from '../subscribed';
|
|
4
4
|
import type { WebSocket } from 'ws';
|
|
5
5
|
import type { RtpPacket, RtcpPacket, RTCIceCandidate } from 'werift';
|
|
6
|
-
import type { BasicPeerConnection,
|
|
6
|
+
import type { BasicPeerConnection, CameraDevice } from '../types';
|
|
7
|
+
import type { IceServer } from '../../services/config/types';
|
|
7
8
|
export declare class WeriftPeerConnection extends Subscribed implements BasicPeerConnection {
|
|
8
9
|
onAudioRtp: Subject<RtpPacket>;
|
|
9
10
|
onAudioRtcp: Subject<RtcpPacket>;
|
|
@@ -14,11 +15,11 @@ export declare class WeriftPeerConnection extends Subscribed implements BasicPee
|
|
|
14
15
|
returnAudioTrack: MediaStreamTrack;
|
|
15
16
|
private pc;
|
|
16
17
|
private ws?;
|
|
17
|
-
private
|
|
18
|
+
private cameraDevice;
|
|
18
19
|
private logger;
|
|
19
20
|
private onRequestKeyFrame;
|
|
20
|
-
constructor(
|
|
21
|
-
createOffer(): Promise<
|
|
21
|
+
constructor(cameraDevice: CameraDevice, iceServers: IceServer[], ws?: WebSocket);
|
|
22
|
+
createOffer(): Promise<RTCSessionDescription>;
|
|
22
23
|
acceptAnswer(answer: {
|
|
23
24
|
type: 'answer';
|
|
24
25
|
sdp: string;
|