@camera.ui/browser 0.0.34 → 0.0.35
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 +20 -10
- package/dist/src/api/database/types.d.ts +49 -21
- package/dist/src/api/go2rtc/api/application.d.ts +4 -3
- package/dist/src/api/go2rtc/api/config.d.ts +4 -3
- package/dist/src/api/go2rtc/api/snapshot.d.ts +4 -3
- package/dist/src/api/go2rtc/api/streams.d.ts +5 -5
- package/dist/src/api/go2rtc/index.d.ts +13 -4
- package/dist/src/api/go2rtc/queue.d.ts +10 -0
- package/dist/src/api/schemas/cameras.schema.d.ts +363 -7
- package/dist/src/api/schemas/config.schema.d.ts +3 -0
- package/dist/src/api/services/cameras.service.d.ts +17 -7
- package/dist/src/api/services/plugins.service.d.ts +2 -0
- package/dist/src/api/types/index.d.ts +22 -3
- package/dist/src/camera/index.d.ts +22 -11
- package/dist/src/camera/types.d.ts +32 -12
- package/dist/src/plugins/cameraStorage.d.ts +3 -1
- package/dist/src/plugins/index.d.ts +0 -3
- package/dist/src/plugins/plugin.d.ts +1 -1
- package/dist/src/plugins/types.d.ts +16 -6
- package/dist/src/proxy/client/cameraDevice.d.ts +9 -8
- package/dist/src/proxy/client/deviceManager.d.ts +13 -12
- package/dist/src/proxy/client/pluginsManager.d.ts +9 -12
- package/dist/src/proxy/client/queue.d.ts +8 -7
- package/dist/src/proxy/client/systemManager.d.ts +9 -9
- package/dist/src/proxy/index.d.ts +13 -7
- package/dist/src/proxy/proxies/camera.d.ts +40 -20
- package/dist/src/proxy/proxies/plugin.d.ts +5 -4
- package/dist/src/proxy/proxies/server.d.ts +4 -9
- package/dist/src/proxy/queue.d.ts +6 -9
- package/dist/src/proxy/types.d.ts +58 -87
- package/dist/src/services/config/index.d.ts +0 -1
- package/dist/src/services/config/types.d.ts +1 -0
- package/package.json +2 -2
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
2
|
import type { SocketService } from '../../socket';
|
|
3
|
-
import type { Camera, CameraDevice, StateValue, StateValues, OnSetEvent, PrebufferType, LightState, MotionState, AudioState, ObjectState, DoorbellState, SirenState, BaseLogger, FfmpegOptions,
|
|
3
|
+
import type { Camera, CameraDevice, StateValue, StateValues, OnSetEvent, PrebufferType, LightState, MotionState, AudioState, ObjectState, DoorbellState, SirenState, BaseLogger, FfmpegOptions, CameraDelegate, CameraZone, CameraSource, CameraPublicProperties } from '../../../../../shared/types';
|
|
4
4
|
export declare class CameraDeviceClient implements CameraDevice {
|
|
5
5
|
private socketService;
|
|
6
6
|
private cameraSubject;
|
|
7
|
+
private prebufferSubject;
|
|
7
8
|
private lightState;
|
|
8
9
|
private motionState;
|
|
9
10
|
private audioState;
|
|
@@ -17,8 +18,10 @@ export declare class CameraDeviceClient implements CameraDevice {
|
|
|
17
18
|
onDoorbellPressed: Observable<DoorbellState>;
|
|
18
19
|
onSirenDetected: Observable<SirenState>;
|
|
19
20
|
logger: BaseLogger;
|
|
21
|
+
delegate?: CameraDelegate;
|
|
20
22
|
get id(): string;
|
|
21
23
|
get nativeId(): string | undefined;
|
|
24
|
+
get pluginId(): string;
|
|
22
25
|
get disabled(): boolean;
|
|
23
26
|
get name(): string;
|
|
24
27
|
get type(): string;
|
|
@@ -30,31 +33,38 @@ export declare class CameraDeviceClient implements CameraDevice {
|
|
|
30
33
|
get hasAudioDetector(): boolean;
|
|
31
34
|
get hasObjectDetector(): boolean;
|
|
32
35
|
get hasPtz(): boolean;
|
|
33
|
-
get
|
|
36
|
+
get motionZones(): CameraZone[];
|
|
37
|
+
get objectZones(): CameraZone[];
|
|
38
|
+
get sources(): CameraSource[];
|
|
34
39
|
constructor(camera: Camera, socketService: SocketService, logger: BaseLogger);
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
40
|
+
getStreamSource(): CameraSource;
|
|
41
|
+
getSnapshotSource(): CameraSource;
|
|
42
|
+
getRecordingSource(): CameraSource;
|
|
43
|
+
getDetectionSource(): CameraSource;
|
|
44
|
+
configureDelegate(delegate: CameraDelegate): void;
|
|
45
|
+
snapshot(prebuffer?: boolean): Promise<ArrayBuffer>;
|
|
46
|
+
setPrebufferSource(sourceIdOrName: string, address: string, type: PrebufferType): Promise<void>;
|
|
47
|
+
removePrebufferSource(sourceIdOrName: string, type: 'recording' | 'stream'): Promise<void>;
|
|
38
48
|
removePrebufferSources(): Promise<void>;
|
|
39
49
|
getFfmpegPath(): Promise<string>;
|
|
40
50
|
getIceServers(): Promise<RTCIceServer[]>;
|
|
41
|
-
getValue<T extends keyof StateValues>(stateName: T): StateValue<T>;
|
|
42
51
|
createSession(): Promise<any>;
|
|
43
52
|
streamVideo(sourceName: string, options: FfmpegOptions): Promise<any>;
|
|
44
53
|
recordToFile(sourceName: string, outputPath: string, duration?: number): Promise<void>;
|
|
54
|
+
getValue<T extends keyof StateValues>(stateName: T): StateValue<T>;
|
|
45
55
|
updateState<T extends keyof StateValues>(stateName: T, eventData: OnSetEvent<T>, isRemote?: boolean): Promise<void>;
|
|
46
56
|
onStateChange<T extends keyof StateValues>(stateName: T): Observable<{
|
|
47
57
|
newState: StateValues[T];
|
|
48
58
|
oldState: StateValues[T];
|
|
49
59
|
}>;
|
|
50
|
-
onPropertyChange<T extends keyof
|
|
51
|
-
|
|
52
|
-
|
|
60
|
+
onPropertyChange<T extends keyof CameraPublicProperties>(property: T): Observable<{
|
|
61
|
+
oldData: Camera[T];
|
|
62
|
+
newData: Camera[T];
|
|
53
63
|
}>;
|
|
54
64
|
removeAllListeners(): void;
|
|
55
65
|
refreshStates(): Promise<void>;
|
|
56
66
|
private updateCamera;
|
|
57
|
-
private
|
|
67
|
+
private updatePrebufferSources;
|
|
58
68
|
private unsubscribe;
|
|
59
69
|
private createStateObservable;
|
|
60
70
|
private listenToChanges;
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import type { JwtTokenEncoded, ClientData } from '../types';
|
|
2
2
|
export interface DBSettings {
|
|
3
|
-
_id: string;
|
|
3
|
+
readonly _id: string;
|
|
4
4
|
_rev?: string;
|
|
5
5
|
settings: DBSetting;
|
|
6
6
|
}
|
|
7
7
|
export interface DBSetting {
|
|
8
8
|
}
|
|
9
9
|
export interface DBTokens {
|
|
10
|
-
_id: string;
|
|
10
|
+
readonly _id: string;
|
|
11
11
|
_rev?: string;
|
|
12
12
|
tokens: JwtTokenEncoded[];
|
|
13
13
|
clients: ClientData[];
|
|
14
14
|
}
|
|
15
15
|
export interface DBUsers {
|
|
16
|
-
_id: string;
|
|
16
|
+
readonly _id: string;
|
|
17
17
|
_rev?: string;
|
|
18
18
|
users: DBUser[];
|
|
19
19
|
}
|
|
20
20
|
export interface DBUser {
|
|
21
|
-
_id: string;
|
|
21
|
+
readonly _id: string;
|
|
22
22
|
avatar: string;
|
|
23
23
|
username: string;
|
|
24
24
|
password: string;
|
|
@@ -36,21 +36,21 @@ export interface DBUserPreferences {
|
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
38
|
export interface DBCamviewLayout {
|
|
39
|
-
_id: string;
|
|
39
|
+
readonly _id: string;
|
|
40
40
|
name: string;
|
|
41
41
|
cameras: DBCamviewLayoutCamera[];
|
|
42
42
|
}
|
|
43
43
|
export interface DBCamviewLayoutCamera {
|
|
44
|
-
_id: string;
|
|
44
|
+
readonly _id: string;
|
|
45
45
|
name: string;
|
|
46
46
|
}
|
|
47
47
|
export interface DBPlugins {
|
|
48
|
-
_id: string;
|
|
48
|
+
readonly _id: string;
|
|
49
49
|
_rev?: string;
|
|
50
50
|
plugins: DBPlugin[];
|
|
51
51
|
}
|
|
52
52
|
export interface DBPlugin {
|
|
53
|
-
_id: string;
|
|
53
|
+
readonly _id: string;
|
|
54
54
|
pluginName: string;
|
|
55
55
|
storage: DBPluginStorage;
|
|
56
56
|
}
|
|
@@ -63,12 +63,12 @@ export interface DBPluginStorageValue {
|
|
|
63
63
|
[key: string]: any;
|
|
64
64
|
}
|
|
65
65
|
export interface DBCameras {
|
|
66
|
-
_id: string;
|
|
66
|
+
readonly _id: string;
|
|
67
67
|
_rev?: string;
|
|
68
68
|
cameras: DBCamera[];
|
|
69
69
|
}
|
|
70
70
|
export interface BaseCamera {
|
|
71
|
-
_id: string;
|
|
71
|
+
readonly _id: string;
|
|
72
72
|
nativeId?: string;
|
|
73
73
|
pluginId: string;
|
|
74
74
|
name: string;
|
|
@@ -78,6 +78,8 @@ export interface BaseCamera {
|
|
|
78
78
|
hasSiren: boolean;
|
|
79
79
|
model: string;
|
|
80
80
|
type: CameraType;
|
|
81
|
+
motionZones: CameraZone[];
|
|
82
|
+
objectZones: CameraZone[];
|
|
81
83
|
}
|
|
82
84
|
export interface DBCamera extends BaseCamera {
|
|
83
85
|
sources: CameraInputSettings[];
|
|
@@ -92,6 +94,18 @@ export interface Camera extends BaseCamera {
|
|
|
92
94
|
hasPtz: boolean;
|
|
93
95
|
sources: CameraInput[];
|
|
94
96
|
}
|
|
97
|
+
export interface CameraZone {
|
|
98
|
+
name: string;
|
|
99
|
+
regions: ZoneRegion[];
|
|
100
|
+
}
|
|
101
|
+
export interface ZoneRegion {
|
|
102
|
+
_id: string;
|
|
103
|
+
coords: ZoneCoord[];
|
|
104
|
+
}
|
|
105
|
+
export interface ZoneCoord {
|
|
106
|
+
_id: string;
|
|
107
|
+
points: [number, number];
|
|
108
|
+
}
|
|
95
109
|
export type CameraPrivateProperties = '_id' | 'nativeId' | 'pluginId' | 'hasLight' | 'hasSiren' | 'isCloud';
|
|
96
110
|
export interface CameraPublicProperties extends Omit<Camera, CameraPrivateProperties> {
|
|
97
111
|
}
|
|
@@ -118,6 +132,7 @@ export interface CameraRecordingSettings {
|
|
|
118
132
|
enabled: boolean;
|
|
119
133
|
}
|
|
120
134
|
export interface CameraInputSettings {
|
|
135
|
+
readonly _id: string;
|
|
121
136
|
name: string;
|
|
122
137
|
roles: CameraRoles[];
|
|
123
138
|
urls: string[];
|
|
@@ -142,30 +157,43 @@ export interface Go2RtcEndpoint {
|
|
|
142
157
|
mjpegHtml: string;
|
|
143
158
|
}
|
|
144
159
|
export interface Go2RtcFFMPEGSource {
|
|
145
|
-
|
|
146
|
-
|
|
160
|
+
h264AAC: string;
|
|
161
|
+
h264OPUS: string;
|
|
147
162
|
}
|
|
148
|
-
export interface
|
|
149
|
-
|
|
150
|
-
rawUrl?: string | string[] | null;
|
|
163
|
+
export interface PrebufferSource {
|
|
164
|
+
url: string;
|
|
151
165
|
snapshotUrl: string;
|
|
152
|
-
prebuffering?: boolean;
|
|
153
166
|
}
|
|
154
167
|
export interface Go2RtcPrebufferSource {
|
|
155
|
-
|
|
156
|
-
|
|
168
|
+
mpegts: PrebufferSource;
|
|
169
|
+
mp4: PrebufferSource;
|
|
157
170
|
}
|
|
158
|
-
export interface
|
|
171
|
+
export interface Go2RtcWSSource {
|
|
159
172
|
webrtc: string;
|
|
173
|
+
}
|
|
174
|
+
export interface StreamUrls {
|
|
175
|
+
ws: Go2RtcWSSource;
|
|
160
176
|
rtsp: Go2RtcRTSPSource;
|
|
161
177
|
transcoded: Go2RtcFFMPEGSource;
|
|
162
178
|
prebuffer: Go2RtcPrebufferSource;
|
|
163
|
-
|
|
179
|
+
www: Go2RtcEndpoint;
|
|
164
180
|
}
|
|
165
181
|
export interface CameraInput {
|
|
182
|
+
readonly _id: string;
|
|
166
183
|
name: string;
|
|
167
184
|
roles: CameraRoles[];
|
|
168
|
-
|
|
185
|
+
urls: StreamUrls;
|
|
186
|
+
}
|
|
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;
|
|
169
197
|
}
|
|
170
198
|
export type CameraRoles = 'detect' | 'record' | 'stream' | 'snapshot' | 'none';
|
|
171
199
|
export interface CameraUiSettings {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { RequestQueue } from '../queue';
|
|
1
2
|
import type { ApplicationResponse, ExitData } from '../types';
|
|
2
|
-
declare class ApplicationApi {
|
|
3
|
+
export declare class ApplicationApi {
|
|
4
|
+
private requestQueue;
|
|
5
|
+
constructor(requestQueue: RequestQueue);
|
|
3
6
|
close(data: ExitData): Promise<void>;
|
|
4
7
|
info(): Promise<ApplicationResponse>;
|
|
5
8
|
restart(): Promise<void>;
|
|
6
9
|
}
|
|
7
|
-
declare const _default: ApplicationApi;
|
|
8
|
-
export default _default;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { RequestQueue } from '../queue';
|
|
1
2
|
import type { AxiosResponse } from 'axios';
|
|
2
|
-
declare class ConfigApi {
|
|
3
|
+
export declare class ConfigApi {
|
|
4
|
+
private requestQueue;
|
|
5
|
+
constructor(requestQueue: RequestQueue);
|
|
3
6
|
getConfig(): Promise<AxiosResponse>;
|
|
4
7
|
rewriteConfig(data: Record<string, any>): Promise<AxiosResponse>;
|
|
5
8
|
mergeConfig(data: Record<string, any>): Promise<AxiosResponse>;
|
|
6
9
|
}
|
|
7
|
-
declare const _default: ConfigApi;
|
|
8
|
-
export default _default;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { RequestQueue } from '../queue';
|
|
1
2
|
import type { SourceData } from '../types';
|
|
2
|
-
declare class SnapshotApi {
|
|
3
|
+
export declare class SnapshotApi {
|
|
4
|
+
private requestQueue;
|
|
5
|
+
constructor(requestQueue: RequestQueue);
|
|
3
6
|
jpeg(data: SourceData): Promise<ArrayBuffer>;
|
|
4
7
|
mp4(data: SourceData): Promise<ArrayBuffer>;
|
|
5
8
|
}
|
|
6
|
-
declare const _default: SnapshotApi;
|
|
7
|
-
export default _default;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { RequestQueue } from '../queue';
|
|
1
2
|
import type { AxiosResponse } from 'axios';
|
|
2
|
-
import type { StreamData, SourceData
|
|
3
|
-
declare class StreamsApi {
|
|
3
|
+
import type { StreamData, SourceData } from '../types';
|
|
4
|
+
export declare class StreamsApi {
|
|
5
|
+
private requestQueue;
|
|
6
|
+
constructor(requestQueue: RequestQueue);
|
|
4
7
|
createStream(data: StreamData): Promise<AxiosResponse>;
|
|
5
8
|
deleteStream(data: SourceData): Promise<AxiosResponse>;
|
|
6
9
|
getStreamInfo(data: SourceData): Promise<AxiosResponse>;
|
|
7
|
-
sendStreamToDst(data: IntercomData): Promise<AxiosResponse>;
|
|
8
10
|
updateStreamSource(data: StreamData): Promise<AxiosResponse>;
|
|
9
11
|
}
|
|
10
|
-
declare const _default: StreamsApi;
|
|
11
|
-
export default _default;
|
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { ApplicationApi } from './api/application';
|
|
2
|
+
import { ConfigApi } from './api/config';
|
|
3
|
+
import { SnapshotApi } from './api/snapshot';
|
|
4
|
+
import { StreamsApi } from './api/streams';
|
|
5
|
+
export declare class Go2RtcApi {
|
|
6
|
+
private requestQueue;
|
|
7
|
+
applicationApi: ApplicationApi;
|
|
8
|
+
configApi: ConfigApi;
|
|
9
|
+
snapshotApi: SnapshotApi;
|
|
10
|
+
streamsApi: StreamsApi;
|
|
11
|
+
constructor();
|
|
12
|
+
clear(): void;
|
|
13
|
+
}
|