@camera.ui/browser 0.0.1
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/CHANGELOG.md +8 -0
- package/LICENSE.md +22 -0
- package/README.md +1 -0
- package/dist/bundle.browser.js +1 -0
- package/dist/client/node/src/api.d.ts +5 -0
- package/dist/client/node/src/api.js +27 -0
- package/dist/client/node/src/api.js.map +1 -0
- package/dist/client/node/src/client.d.ts +20 -0
- package/dist/client/node/src/client.js +106 -0
- package/dist/client/node/src/client.js.map +1 -0
- package/dist/client/node/src/index.d.ts +2 -0
- package/dist/client/node/src/index.js +19 -0
- package/dist/client/node/src/index.js.map +1 -0
- package/dist/client/node/src/proxy/cameraDevice/cameraDevice.browser.d.ts +48 -0
- package/dist/client/node/src/proxy/cameraDevice/cameraDevice.browser.js +176 -0
- package/dist/client/node/src/proxy/cameraDevice/cameraDevice.browser.js.map +1 -0
- package/dist/client/node/src/proxy/cameraDevice/cameraDevice.mock.d.ts +1 -0
- package/dist/client/node/src/proxy/cameraDevice/cameraDevice.mock.js +3 -0
- package/dist/client/node/src/proxy/cameraDevice/cameraDevice.mock.js.map +1 -0
- package/dist/client/node/src/proxy/cameraDevice/cameraDevice.node.d.ts +11 -0
- package/dist/client/node/src/proxy/cameraDevice/cameraDevice.node.js +51 -0
- package/dist/client/node/src/proxy/cameraDevice/cameraDevice.node.js.map +1 -0
- package/dist/client/node/src/proxy/cameraDevice/index.d.ts +6 -0
- package/dist/client/node/src/proxy/cameraDevice/index.js +11 -0
- package/dist/client/node/src/proxy/cameraDevice/index.js.map +1 -0
- package/dist/client/node/src/proxy/deviceManager.d.ts +15 -0
- package/dist/client/node/src/proxy/deviceManager.js +67 -0
- package/dist/client/node/src/proxy/deviceManager.js.map +1 -0
- package/dist/client/node/src/proxy/index.d.ts +4 -0
- package/dist/client/node/src/proxy/index.js +21 -0
- package/dist/client/node/src/proxy/index.js.map +1 -0
- package/dist/client/node/src/proxy/pluginsManager.d.ts +9 -0
- package/dist/client/node/src/proxy/pluginsManager.js +25 -0
- package/dist/client/node/src/proxy/pluginsManager.js.map +1 -0
- package/dist/client/node/src/proxy/systemManager.d.ts +9 -0
- package/dist/client/node/src/proxy/systemManager.js +25 -0
- package/dist/client/node/src/proxy/systemManager.js.map +1 -0
- package/dist/client/node/src/socket.d.ts +9 -0
- package/dist/client/node/src/socket.js +45 -0
- package/dist/client/node/src/socket.js.map +1 -0
- package/dist/client/node/src/types.d.ts +22 -0
- package/dist/client/node/src/types.js +3 -0
- package/dist/client/node/src/types.js.map +1 -0
- package/dist/package.json +149 -0
- package/dist/shared/common/utils.d.ts +6 -0
- package/dist/shared/common/utils.js +66 -0
- package/dist/shared/common/utils.js.map +1 -0
- package/dist/shared/types/index.d.ts +8 -0
- package/dist/shared/types/index.js +23 -0
- package/dist/shared/types/index.js.map +1 -0
- package/dist/src/api/database/index.d.ts +25 -0
- package/dist/src/api/database/index.js +203 -0
- package/dist/src/api/database/index.js.map +1 -0
- package/dist/src/api/database/types.d.ts +153 -0
- package/dist/src/api/database/types.js +3 -0
- package/dist/src/api/database/types.js.map +1 -0
- package/dist/src/api/go2rtc/api/application.d.ts +8 -0
- package/dist/src/api/go2rtc/api/application.js +32 -0
- package/dist/src/api/go2rtc/api/application.js.map +1 -0
- package/dist/src/api/go2rtc/api/index.d.ts +3 -0
- package/dist/src/api/go2rtc/api/index.js +33 -0
- package/dist/src/api/go2rtc/api/index.js.map +1 -0
- package/dist/src/api/go2rtc/api/snapshot.d.ts +6 -0
- package/dist/src/api/go2rtc/api/snapshot.js +22 -0
- package/dist/src/api/go2rtc/api/snapshot.js.map +1 -0
- package/dist/src/api/go2rtc/api/streams.d.ts +10 -0
- package/dist/src/api/go2rtc/api/streams.js +32 -0
- package/dist/src/api/go2rtc/api/streams.js.map +1 -0
- package/dist/src/api/go2rtc/index.d.ts +3 -0
- package/dist/src/api/go2rtc/index.js +13 -0
- package/dist/src/api/go2rtc/index.js.map +1 -0
- package/dist/src/api/go2rtc/types.d.ts +43 -0
- package/dist/src/api/go2rtc/types.js +3 -0
- package/dist/src/api/go2rtc/types.js.map +1 -0
- package/dist/src/api/middlewares/socketAuth.middleware.d.ts +41 -0
- package/dist/src/api/middlewares/socketAuth.middleware.js +90 -0
- package/dist/src/api/middlewares/socketAuth.middleware.js.map +1 -0
- package/dist/src/api/schemas/backup.schema.d.ts +220 -0
- package/dist/src/api/schemas/backup.schema.js +94 -0
- package/dist/src/api/schemas/backup.schema.js.map +1 -0
- package/dist/src/api/schemas/cameras.schema.d.ts +316 -0
- package/dist/src/api/schemas/cameras.schema.js +124 -0
- package/dist/src/api/schemas/cameras.schema.js.map +1 -0
- package/dist/src/api/schemas/config.schema.d.ts +202 -0
- package/dist/src/api/schemas/config.schema.js +94 -0
- package/dist/src/api/schemas/config.schema.js.map +1 -0
- package/dist/src/api/schemas/go2rtc.schema.d.ts +604 -0
- package/dist/src/api/schemas/go2rtc.schema.js +204 -0
- package/dist/src/api/schemas/go2rtc.schema.js.map +1 -0
- package/dist/src/api/schemas/users.schema.d.ts +515 -0
- package/dist/src/api/schemas/users.schema.js +131 -0
- package/dist/src/api/schemas/users.schema.js.map +1 -0
- package/dist/src/api/services/auth.service.d.ts +20 -0
- package/dist/src/api/services/auth.service.js +104 -0
- package/dist/src/api/services/auth.service.js.map +1 -0
- package/dist/src/api/services/cameras.service.d.ts +40 -0
- package/dist/src/api/services/cameras.service.js +535 -0
- package/dist/src/api/services/cameras.service.js.map +1 -0
- package/dist/src/api/services/plugins.service.d.ts +23 -0
- package/dist/src/api/services/plugins.service.js +115 -0
- package/dist/src/api/services/plugins.service.js.map +1 -0
- package/dist/src/api/services/users.service.d.ts +13 -0
- package/dist/src/api/services/users.service.js +54 -0
- package/dist/src/api/services/users.service.js.map +1 -0
- package/dist/src/api/types/index.d.ts +522 -0
- package/dist/src/api/types/index.js +12 -0
- package/dist/src/api/types/index.js.map +1 -0
- package/dist/src/api/utils/cert.d.ts +17 -0
- package/dist/src/api/utils/cert.js +437 -0
- package/dist/src/api/utils/cert.js.map +1 -0
- package/dist/src/api/ws/index.d.ts +15 -0
- package/dist/src/api/ws/index.js +89 -0
- package/dist/src/api/ws/index.js.map +1 -0
- package/dist/src/api/ws/nsp/logs.d.ts +11 -0
- package/dist/src/api/ws/nsp/logs.js +121 -0
- package/dist/src/api/ws/nsp/logs.js.map +1 -0
- package/dist/src/api/ws/nsp/main.d.ts +9 -0
- package/dist/src/api/ws/nsp/main.js +49 -0
- package/dist/src/api/ws/nsp/main.js.map +1 -0
- package/dist/src/api/ws/nsp/metrics.d.ts +33 -0
- package/dist/src/api/ws/nsp/metrics.js +225 -0
- package/dist/src/api/ws/nsp/metrics.js.map +1 -0
- package/dist/src/api/ws/nsp/notifications.d.ts +11 -0
- package/dist/src/api/ws/nsp/notifications.js +39 -0
- package/dist/src/api/ws/nsp/notifications.js.map +1 -0
- package/dist/src/api/ws/nsp/plugins.d.ts +13 -0
- package/dist/src/api/ws/nsp/plugins.js +33 -0
- package/dist/src/api/ws/nsp/plugins.js.map +1 -0
- package/dist/src/api/ws/nsp/status.d.ts +12 -0
- package/dist/src/api/ws/nsp/status.js +41 -0
- package/dist/src/api/ws/nsp/status.js.map +1 -0
- package/dist/src/api/ws/nsp/streams.d.ts +30 -0
- package/dist/src/api/ws/nsp/streams.js +140 -0
- package/dist/src/api/ws/nsp/streams.js.map +1 -0
- package/dist/src/api/ws/types.d.ts +82 -0
- package/dist/src/api/ws/types.js +3 -0
- package/dist/src/api/ws/types.js.map +1 -0
- package/dist/src/api.d.ts +60 -0
- package/dist/src/api.js +66 -0
- package/dist/src/api.js.map +1 -0
- package/dist/src/camera/index.d.ts +54 -0
- package/dist/src/camera/index.js +210 -0
- package/dist/src/camera/index.js.map +1 -0
- package/dist/src/camera/streaming/peer-connection.d.ts +31 -0
- package/dist/src/camera/streaming/peer-connection.js +157 -0
- package/dist/src/camera/streaming/peer-connection.js.map +1 -0
- package/dist/src/camera/streaming/streaming-session.d.ts +32 -0
- package/dist/src/camera/streaming/streaming-session.js +172 -0
- package/dist/src/camera/streaming/streaming-session.js.map +1 -0
- package/dist/src/camera/streaming/webrtc-connection.d.ts +33 -0
- package/dist/src/camera/streaming/webrtc-connection.js +156 -0
- package/dist/src/camera/streaming/webrtc-connection.js.map +1 -0
- package/dist/src/camera/subscribed.d.ts +6 -0
- package/dist/src/camera/subscribed.js +14 -0
- package/dist/src/camera/subscribed.js.map +1 -0
- package/dist/src/camera/types.d.ts +130 -0
- package/dist/src/camera/types.js +3 -0
- package/dist/src/camera/types.js.map +1 -0
- package/dist/src/go2rtc/index.d.ts +24 -0
- package/dist/src/go2rtc/index.js +220 -0
- package/dist/src/go2rtc/index.js.map +1 -0
- package/dist/src/go2rtc/types.d.ts +14 -0
- package/dist/src/go2rtc/types.js +76 -0
- package/dist/src/go2rtc/types.js.map +1 -0
- package/dist/src/plugins/base.d.ts +19 -0
- package/dist/src/plugins/base.js +26 -0
- package/dist/src/plugins/base.js.map +1 -0
- package/dist/src/plugins/cameraStorage.d.ts +97 -0
- package/dist/src/plugins/cameraStorage.js +290 -0
- package/dist/src/plugins/cameraStorage.js.map +1 -0
- package/dist/src/plugins/child.d.ts +18 -0
- package/dist/src/plugins/child.js +140 -0
- package/dist/src/plugins/child.js.map +1 -0
- package/dist/src/plugins/config.d.ts +113 -0
- package/dist/src/plugins/config.js +234 -0
- package/dist/src/plugins/config.js.map +1 -0
- package/dist/src/plugins/index.d.ts +36 -0
- package/dist/src/plugins/index.js +328 -0
- package/dist/src/plugins/index.js.map +1 -0
- package/dist/src/plugins/plugin.d.ts +47 -0
- package/dist/src/plugins/plugin.js +215 -0
- package/dist/src/plugins/plugin.js.map +1 -0
- package/dist/src/plugins/schema.d.ts +268 -0
- package/dist/src/plugins/schema.js +717 -0
- package/dist/src/plugins/schema.js.map +1 -0
- package/dist/src/plugins/storage.d.ts +28 -0
- package/dist/src/plugins/storage.js +45 -0
- package/dist/src/plugins/storage.js.map +1 -0
- package/dist/src/plugins/types.d.ts +162 -0
- package/dist/src/plugins/types.js +21 -0
- package/dist/src/plugins/types.js.map +1 -0
- package/dist/src/plugins/worker.d.ts +27 -0
- package/dist/src/plugins/worker.js +236 -0
- package/dist/src/plugins/worker.js.map +1 -0
- package/dist/src/proxy/client/cameraDevice.d.ts +29 -0
- package/dist/src/proxy/client/cameraDevice.js +171 -0
- package/dist/src/proxy/client/cameraDevice.js.map +1 -0
- package/dist/src/proxy/client/deviceManager.d.ts +40 -0
- package/dist/src/proxy/client/deviceManager.js +239 -0
- package/dist/src/proxy/client/deviceManager.js.map +1 -0
- package/dist/src/proxy/client/index.d.ts +4 -0
- package/dist/src/proxy/client/index.js +21 -0
- package/dist/src/proxy/client/index.js.map +1 -0
- package/dist/src/proxy/client/pluginsManager.d.ts +35 -0
- package/dist/src/proxy/client/pluginsManager.js +237 -0
- package/dist/src/proxy/client/pluginsManager.js.map +1 -0
- package/dist/src/proxy/client/systemManager.d.ts +29 -0
- package/dist/src/proxy/client/systemManager.js +163 -0
- package/dist/src/proxy/client/systemManager.js.map +1 -0
- package/dist/src/proxy/index.d.ts +20 -0
- package/dist/src/proxy/index.js +98 -0
- package/dist/src/proxy/index.js.map +1 -0
- package/dist/src/proxy/proxies/camera.d.ts +26 -0
- package/dist/src/proxy/proxies/camera.js +72 -0
- package/dist/src/proxy/proxies/camera.js.map +1 -0
- package/dist/src/proxy/proxies/plugin.d.ts +30 -0
- package/dist/src/proxy/proxies/plugin.js +110 -0
- package/dist/src/proxy/proxies/plugin.js.map +1 -0
- package/dist/src/proxy/proxies/server.d.ts +34 -0
- package/dist/src/proxy/proxies/server.js +92 -0
- package/dist/src/proxy/proxies/server.js.map +1 -0
- package/dist/src/proxy/types.d.ts +189 -0
- package/dist/src/proxy/types.js +3 -0
- package/dist/src/proxy/types.js.map +1 -0
- package/dist/src/proxy/utils/generateKeys.d.ts +5 -0
- package/dist/src/proxy/utils/generateKeys.js +13 -0
- package/dist/src/proxy/utils/generateKeys.js.map +1 -0
- package/dist/src/proxy/ws/index.d.ts +21 -0
- package/dist/src/proxy/ws/index.js +75 -0
- package/dist/src/proxy/ws/index.js.map +1 -0
- package/dist/src/services/config/index.d.ts +60 -0
- package/dist/src/services/config/index.js +319 -0
- package/dist/src/services/config/index.js.map +1 -0
- package/dist/src/services/config/types.d.ts +153 -0
- package/dist/src/services/config/types.js +13 -0
- package/dist/src/services/config/types.js.map +1 -0
- package/dist/src/services/logger/index.d.ts +37 -0
- package/dist/src/services/logger/index.js +181 -0
- package/dist/src/services/logger/index.js.map +1 -0
- package/package.json +46 -0
- package/webpack.config.js +29 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Subscribed = void 0;
|
|
4
|
+
class Subscribed {
|
|
5
|
+
subscriptions = [];
|
|
6
|
+
addSubscriptions(...subscriptions) {
|
|
7
|
+
this.subscriptions.push(...subscriptions);
|
|
8
|
+
}
|
|
9
|
+
unsubscribe() {
|
|
10
|
+
this.subscriptions.forEach((subscription) => subscription.unsubscribe());
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.Subscribed = Subscribed;
|
|
14
|
+
//# sourceMappingURL=subscribed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscribed.js","sourceRoot":"","sources":["../../../../../src/camera/subscribed.ts"],"names":[],"mappings":";;;AAEA,MAAa,UAAU;IACJ,aAAa,GAAmB,EAAE,CAAC;IAE7C,gBAAgB,CAAC,GAAG,aAA6B;QACtD,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,CAAC;IAC5C,CAAC;IAES,WAAW;QACnB,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC,CAAC;IAC3E,CAAC;CACF;AAVD,gCAUC"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import type { Observable, Subject } from 'rxjs';
|
|
2
|
+
import type { ConnectionState, RTCIceCandidate } from 'werift';
|
|
3
|
+
import type { CameraInputSettings, CameraInput, Camera } from '../api/database/types';
|
|
4
|
+
import type { StreamingSession } from './streaming/streaming-session';
|
|
5
|
+
export type SpawnInput = string | number;
|
|
6
|
+
export interface FfmpegOptions {
|
|
7
|
+
input?: SpawnInput[];
|
|
8
|
+
video?: SpawnInput[] | false;
|
|
9
|
+
audio?: SpawnInput[];
|
|
10
|
+
output: SpawnInput[];
|
|
11
|
+
}
|
|
12
|
+
export interface StreamingConnectionOptions {
|
|
13
|
+
createPeerConnection?: () => BasicPeerConnection;
|
|
14
|
+
}
|
|
15
|
+
export interface BasicPeerConnection {
|
|
16
|
+
createOffer(): Promise<{
|
|
17
|
+
sdp: string;
|
|
18
|
+
}>;
|
|
19
|
+
acceptAnswer(answer: {
|
|
20
|
+
type: 'answer';
|
|
21
|
+
sdp: string;
|
|
22
|
+
}): Promise<void>;
|
|
23
|
+
addIceCandidate(candidate: Partial<RTCIceCandidate>): Promise<void>;
|
|
24
|
+
onIceCandidate: Subject<RTCIceCandidate>;
|
|
25
|
+
onConnectionState: Observable<ConnectionState>;
|
|
26
|
+
close(): void;
|
|
27
|
+
requestKeyFrame?: () => void;
|
|
28
|
+
}
|
|
29
|
+
export interface CameraDevice {
|
|
30
|
+
id: string;
|
|
31
|
+
name: string;
|
|
32
|
+
pluginId: string;
|
|
33
|
+
nativeId?: string;
|
|
34
|
+
type: string;
|
|
35
|
+
model: string;
|
|
36
|
+
sources: CameraInput[];
|
|
37
|
+
onLightDetected: Observable<LightState>;
|
|
38
|
+
onMotionDetected: Observable<MotionState>;
|
|
39
|
+
onAudioDetected: Observable<AudioState>;
|
|
40
|
+
onObjectDetected: Observable<ObjectState>;
|
|
41
|
+
onDoorbellPressed: Observable<DoorbellState>;
|
|
42
|
+
onSirenDetected: Observable<SirenState>;
|
|
43
|
+
getValue<T extends keyof StateValues>(stateName: T): StateValue<T>;
|
|
44
|
+
createSession(cameraInput: CameraInput, options?: StreamingConnectionOptions): Promise<StreamingSession>;
|
|
45
|
+
streamVideo(cameraInput: CameraInput, options: FfmpegOptions): Promise<StreamingSession>;
|
|
46
|
+
recordToFile(cameraInput: CameraInput, outputPath: string, duration?: number): Promise<void>;
|
|
47
|
+
updateState<T extends keyof StateValues>(stateName: T, eventData: OnSetEvent<T>): void;
|
|
48
|
+
onStateChange<T extends keyof StateValues>(stateName: T): Observable<{
|
|
49
|
+
newState: StateValues[T];
|
|
50
|
+
oldState: StateValues[T];
|
|
51
|
+
}>;
|
|
52
|
+
onPropertyChange<T extends keyof Camera>(property: T): Observable<{
|
|
53
|
+
oldState: Camera[T];
|
|
54
|
+
newState: Camera[T];
|
|
55
|
+
}>;
|
|
56
|
+
removeAllListeners(): void;
|
|
57
|
+
}
|
|
58
|
+
export type Sdp = string;
|
|
59
|
+
export type IceCandiate = string;
|
|
60
|
+
export interface Go2RtcOfferMessage {
|
|
61
|
+
type: 'webrtc/offer';
|
|
62
|
+
value: Sdp;
|
|
63
|
+
}
|
|
64
|
+
export interface Go2RtcAnswerMessage {
|
|
65
|
+
type: 'webrtc/answer';
|
|
66
|
+
value: Sdp;
|
|
67
|
+
}
|
|
68
|
+
export interface Go2RtcIceCandidateMessage {
|
|
69
|
+
type: 'webrtc/candidate';
|
|
70
|
+
value: IceCandiate;
|
|
71
|
+
}
|
|
72
|
+
export interface ErrorMessage {
|
|
73
|
+
type: 'error';
|
|
74
|
+
value: string;
|
|
75
|
+
}
|
|
76
|
+
export type Go2RtcIncomingMessage = Go2RtcAnswerMessage | Go2RtcIceCandidateMessage | ErrorMessage;
|
|
77
|
+
export type Go2RtcOutgoingMessage = Go2RtcOfferMessage | Go2RtcIceCandidateMessage;
|
|
78
|
+
export interface CameraConfig {
|
|
79
|
+
name: string;
|
|
80
|
+
nativeId?: string;
|
|
81
|
+
disabled?: boolean;
|
|
82
|
+
model?: string;
|
|
83
|
+
sources: CameraInputSettings[];
|
|
84
|
+
}
|
|
85
|
+
export interface BaseState {
|
|
86
|
+
timestamp: number;
|
|
87
|
+
lastTriggered: number;
|
|
88
|
+
}
|
|
89
|
+
export interface MotionSetEvent {
|
|
90
|
+
state: boolean;
|
|
91
|
+
}
|
|
92
|
+
export interface AudioSetEvent {
|
|
93
|
+
state: boolean;
|
|
94
|
+
}
|
|
95
|
+
export interface ObjectSetEvent {
|
|
96
|
+
state: boolean;
|
|
97
|
+
detections: string[];
|
|
98
|
+
}
|
|
99
|
+
export interface LightSetEvent {
|
|
100
|
+
state: boolean;
|
|
101
|
+
}
|
|
102
|
+
export interface DoorbellSetEvent {
|
|
103
|
+
state: boolean;
|
|
104
|
+
}
|
|
105
|
+
export interface SirenSetEvent {
|
|
106
|
+
state: boolean;
|
|
107
|
+
}
|
|
108
|
+
export interface DeviceSetEvent {
|
|
109
|
+
}
|
|
110
|
+
export type LightState = BaseState & LightSetEvent;
|
|
111
|
+
export type MotionState = BaseState & MotionSetEvent;
|
|
112
|
+
export type AudioState = BaseState & AudioSetEvent;
|
|
113
|
+
export type DoorbellState = BaseState & DoorbellSetEvent;
|
|
114
|
+
export type SirenState = BaseState & SirenSetEvent;
|
|
115
|
+
export type ObjectState = BaseState & ObjectSetEvent;
|
|
116
|
+
export type State = LightState | MotionState | AudioState | ObjectState | DoorbellState | SirenState;
|
|
117
|
+
export interface StateValues {
|
|
118
|
+
light: LightState;
|
|
119
|
+
motion: MotionState;
|
|
120
|
+
audio: AudioState;
|
|
121
|
+
object: ObjectState;
|
|
122
|
+
doorbell: DoorbellState;
|
|
123
|
+
siren: SirenState;
|
|
124
|
+
}
|
|
125
|
+
export type CameraStateCallbacks = {
|
|
126
|
+
[K in keyof StateValues]: (event: StateValues[K]) => void;
|
|
127
|
+
};
|
|
128
|
+
export type StateValue<T extends keyof StateValues> = StateValues[T];
|
|
129
|
+
export type OnSetEvent<T extends keyof StateValues> = T extends 'light' ? LightSetEvent : T extends 'motion' ? MotionSetEvent : T extends 'audio' ? AudioSetEvent : T extends 'doorbell' ? DoorbellSetEvent : T extends 'siren' ? SirenSetEvent : ObjectSetEvent;
|
|
130
|
+
export type OnChangeCallback<T extends keyof StateValues> = (newEvent: StateValues[T], oldEvent: StateValues[T]) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/camera/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { RUNTIME_STATUS } from '../services/config/types';
|
|
2
|
+
export declare class Go2Rtc {
|
|
3
|
+
private go2rtcProcess?;
|
|
4
|
+
private logger;
|
|
5
|
+
private configService;
|
|
6
|
+
version?: string;
|
|
7
|
+
os?: string;
|
|
8
|
+
private started;
|
|
9
|
+
private restarting;
|
|
10
|
+
private manuallyKilled;
|
|
11
|
+
private shuttingDown;
|
|
12
|
+
private _status;
|
|
13
|
+
get status(): RUNTIME_STATUS;
|
|
14
|
+
constructor();
|
|
15
|
+
start(): Promise<void>;
|
|
16
|
+
stop(): Promise<void>;
|
|
17
|
+
teardown(): Promise<void>;
|
|
18
|
+
restart(): Promise<void>;
|
|
19
|
+
getPID(): number;
|
|
20
|
+
private kill;
|
|
21
|
+
private handleClose;
|
|
22
|
+
private setStatus;
|
|
23
|
+
private processLogger;
|
|
24
|
+
}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.Go2Rtc = void 0;
|
|
16
|
+
const child_process_1 = require("child_process");
|
|
17
|
+
const readline_1 = require("readline");
|
|
18
|
+
const ansi_parser_1 = __importDefault(require("ansi-parser"));
|
|
19
|
+
const tsyringe_1 = require("tsyringe");
|
|
20
|
+
const ws_1 = require("../api/ws");
|
|
21
|
+
const logger_1 = require("../services/logger");
|
|
22
|
+
const utils_1 = require("../../shared/common/utils");
|
|
23
|
+
let Go2Rtc = class Go2Rtc {
|
|
24
|
+
go2rtcProcess;
|
|
25
|
+
logger;
|
|
26
|
+
configService;
|
|
27
|
+
version;
|
|
28
|
+
os;
|
|
29
|
+
started = false;
|
|
30
|
+
restarting = false;
|
|
31
|
+
manuallyKilled = false;
|
|
32
|
+
shuttingDown = false;
|
|
33
|
+
_status = "unknown" /* RUNTIME_STATUS.UNKNOWN */;
|
|
34
|
+
get status() {
|
|
35
|
+
return this._status;
|
|
36
|
+
}
|
|
37
|
+
constructor() {
|
|
38
|
+
this.logger = new logger_1.PluginLogger('go2rtc');
|
|
39
|
+
this.configService = tsyringe_1.container.resolve('configService');
|
|
40
|
+
tsyringe_1.container.register('go2rtc', { useValue: this });
|
|
41
|
+
}
|
|
42
|
+
async start() {
|
|
43
|
+
if (this.started) {
|
|
44
|
+
this.logger.warn('Go2RTC already running!');
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const options = ['-config', this.configService.GO2RTC_CONFIG_FILE];
|
|
48
|
+
// const options = ['-config', JSON.stringify(this.configService.config.go2rtc)];
|
|
49
|
+
this.logger.debug(`Starting go2rtc with following command: ${this.configService.GO2RTC_BINARY} -config ${options.join(' ')}`);
|
|
50
|
+
this.started = true;
|
|
51
|
+
this.manuallyKilled = false;
|
|
52
|
+
this.setStatus("starting" /* RUNTIME_STATUS.STARTING */);
|
|
53
|
+
return new Promise((resolve, reject) => {
|
|
54
|
+
let resolved = false;
|
|
55
|
+
this.go2rtcProcess = (0, child_process_1.spawn)(this.configService.GO2RTC_BINARY, options, {
|
|
56
|
+
env: Object.assign({}, process.env),
|
|
57
|
+
cwd: '.',
|
|
58
|
+
stdio: 'pipe',
|
|
59
|
+
});
|
|
60
|
+
this.go2rtcProcess.on('spawn', async () => {
|
|
61
|
+
this.logger.log(`Initializing go2rtc with PID: ${this.go2rtcProcess?.pid}`);
|
|
62
|
+
await (0, utils_1.sleep)(1000);
|
|
63
|
+
this.setStatus("started" /* RUNTIME_STATUS.STARTED */);
|
|
64
|
+
if (!resolved) {
|
|
65
|
+
resolved = true;
|
|
66
|
+
resolve();
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
this.go2rtcProcess.on('error', (error) => {
|
|
70
|
+
this.started = false;
|
|
71
|
+
this.logger.warn('The go2rtc process failed to start/stop!');
|
|
72
|
+
this.logger.error(error);
|
|
73
|
+
this.setStatus("error" /* RUNTIME_STATUS.ERROR */);
|
|
74
|
+
if (!resolved) {
|
|
75
|
+
resolved = true;
|
|
76
|
+
reject(error);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
this.go2rtcProcess.on('exit', async () => {
|
|
80
|
+
setTimeout(() => {
|
|
81
|
+
this.started = false;
|
|
82
|
+
this.setStatus("stopped" /* RUNTIME_STATUS.STOPPED */);
|
|
83
|
+
this.handleClose();
|
|
84
|
+
if (!resolved) {
|
|
85
|
+
resolved = true;
|
|
86
|
+
resolve();
|
|
87
|
+
}
|
|
88
|
+
}, 100);
|
|
89
|
+
});
|
|
90
|
+
const stdoutLine = (0, readline_1.createInterface)({
|
|
91
|
+
input: this.go2rtcProcess.stdout,
|
|
92
|
+
terminal: false,
|
|
93
|
+
});
|
|
94
|
+
const stderrLine = (0, readline_1.createInterface)({
|
|
95
|
+
input: this.go2rtcProcess.stderr,
|
|
96
|
+
terminal: false,
|
|
97
|
+
});
|
|
98
|
+
this.logger.log('---');
|
|
99
|
+
stdoutLine.on('line', this.processLogger.bind(this));
|
|
100
|
+
stderrLine.on('line', this.processLogger.bind(this));
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
async stop() {
|
|
104
|
+
this.logger.log('Stopping go2rtc...');
|
|
105
|
+
await this.kill();
|
|
106
|
+
}
|
|
107
|
+
async teardown() {
|
|
108
|
+
this.logger.log('Killing go2rtc process...');
|
|
109
|
+
this.manuallyKilled = true;
|
|
110
|
+
await this.kill();
|
|
111
|
+
}
|
|
112
|
+
async restart() {
|
|
113
|
+
this.restarting = true;
|
|
114
|
+
await this.teardown();
|
|
115
|
+
await (0, utils_1.sleep)(1000);
|
|
116
|
+
await this.start();
|
|
117
|
+
this.restarting = false;
|
|
118
|
+
}
|
|
119
|
+
getPID() {
|
|
120
|
+
return this.go2rtcProcess?.pid || 0;
|
|
121
|
+
}
|
|
122
|
+
async kill() {
|
|
123
|
+
return new Promise((resolve) => {
|
|
124
|
+
let resolved = false;
|
|
125
|
+
const res = () => {
|
|
126
|
+
clearTimeout(killTimeout);
|
|
127
|
+
if (!resolved) {
|
|
128
|
+
resolved = true;
|
|
129
|
+
resolve();
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
this.go2rtcProcess?.once('exit', () => res());
|
|
133
|
+
this.go2rtcProcess?.kill('SIGTERM');
|
|
134
|
+
const killTimeout = setTimeout(() => res(), 3000);
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
handleClose() {
|
|
138
|
+
if (!this.shuttingDown && !this.manuallyKilled) {
|
|
139
|
+
this.logger.log('Restarting go2rtc in 5s...');
|
|
140
|
+
setTimeout(() => {
|
|
141
|
+
this.start();
|
|
142
|
+
}, 5000);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
setStatus(status) {
|
|
146
|
+
this._status = status;
|
|
147
|
+
const socketService = tsyringe_1.container.resolve('socketService');
|
|
148
|
+
socketService.io?.of('/status').emit('process-status', [
|
|
149
|
+
{
|
|
150
|
+
name: 'go2rtc',
|
|
151
|
+
status: status,
|
|
152
|
+
},
|
|
153
|
+
]);
|
|
154
|
+
}
|
|
155
|
+
processLogger(line) {
|
|
156
|
+
const blankLine = ansi_parser_1.default.removeAnsi(line.replace(/([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])(:|\.)\d{3} /, ''));
|
|
157
|
+
if (blankLine.includes('WRN')) {
|
|
158
|
+
this.logger.warn(blankLine);
|
|
159
|
+
}
|
|
160
|
+
else if (blankLine.includes('FTL') || blankLine.includes('ERR') || (!blankLine.includes('DBG') && blankLine.toLowerCase().includes('error'))) {
|
|
161
|
+
this.logger.error(blankLine);
|
|
162
|
+
}
|
|
163
|
+
else if (!blankLine.includes('exit with signal')) {
|
|
164
|
+
this.logger.debug(blankLine);
|
|
165
|
+
}
|
|
166
|
+
if (blankLine.includes('go2rtc version')) {
|
|
167
|
+
if (!this.version) {
|
|
168
|
+
this.version = blankLine.split('version')[1].match(/\d+(\.\d+)+/)?.[0] || '0.0.0';
|
|
169
|
+
}
|
|
170
|
+
if (!this.os) {
|
|
171
|
+
this.os = blankLine.split(this.version)[1]?.trim() || 'unknown';
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
if (blankLine.includes('listen addr=')) {
|
|
175
|
+
const go2rtcAdress = blankLine.split('listen addr=')[1];
|
|
176
|
+
let go2rtcModule;
|
|
177
|
+
if (blankLine.includes('[api]')) {
|
|
178
|
+
if (!this.started) {
|
|
179
|
+
this.started = true;
|
|
180
|
+
}
|
|
181
|
+
else if (!this.restarting) {
|
|
182
|
+
this.configService.mergeGo2RtcConfig();
|
|
183
|
+
}
|
|
184
|
+
go2rtcModule = 'api';
|
|
185
|
+
}
|
|
186
|
+
if (blankLine.includes('[rtsp]')) {
|
|
187
|
+
go2rtcModule = 'rtsp';
|
|
188
|
+
}
|
|
189
|
+
if (blankLine.includes('[webrtc]')) {
|
|
190
|
+
go2rtcModule = 'webrtc';
|
|
191
|
+
}
|
|
192
|
+
if (blankLine.includes('[rtmp]')) {
|
|
193
|
+
go2rtcModule = 'rtmp';
|
|
194
|
+
}
|
|
195
|
+
// not logged through gortc?
|
|
196
|
+
if (blankLine.includes('[srtp]')) {
|
|
197
|
+
go2rtcModule = 'srtp';
|
|
198
|
+
}
|
|
199
|
+
if (go2rtcAdress && go2rtcModule) {
|
|
200
|
+
this.logger.log(`go2rtc v${this.version} (${this.os}) is listening on ${go2rtcAdress} (${go2rtcModule})`);
|
|
201
|
+
if (go2rtcModule === 'api') {
|
|
202
|
+
// srtp is not logged through go2rtc, log manually
|
|
203
|
+
this.logger.log(`go2rtc v${this.version} (${this.os}) is listening on ${this.configService.go2rtcConfig.srtp.listen} (srtp)`);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
exports.Go2Rtc = Go2Rtc;
|
|
210
|
+
exports.Go2Rtc = Go2Rtc = __decorate([
|
|
211
|
+
(0, tsyringe_1.registry)([
|
|
212
|
+
{
|
|
213
|
+
token: 'socketService',
|
|
214
|
+
useValue: (0, tsyringe_1.delay)(() => ws_1.SocketService),
|
|
215
|
+
},
|
|
216
|
+
]),
|
|
217
|
+
(0, tsyringe_1.scoped)(tsyringe_1.Lifecycle.ContainerScoped),
|
|
218
|
+
__metadata("design:paramtypes", [])
|
|
219
|
+
], Go2Rtc);
|
|
220
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/go2rtc/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,iDAAoD;AACpD,uCAA2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CAAC,WAAW,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,EAAE,qBAAqB,YAAY,KAAK,YAAY,GAAG,CAAC,CAAC;gBAE1G,IAAI,YAAY,KAAK,KAAK,EAAE,CAAC;oBAC3B,kDAAkD;oBAClD,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,EAAE,qBAAqB,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,SAAS,CAAC,CAAC;gBAChI,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAA;AA7OY,wBAAM;iBAAN,MAAM;IAPlB,IAAA,mBAAQ,EAAC;QACR;YACE,KAAK,EAAE,eAAe;YACtB,QAAQ,EAAE,IAAA,gBAAK,EAAC,GAAG,EAAE,CAAC,kBAAa,CAAC;SACrC;KACF,CAAC;IACD,IAAA,iBAAM,EAAC,oBAAS,CAAC,eAAe,CAAC;;GACrB,MAAM,CA6OlB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const sourcePrefixes: readonly ["bubble://", "dvrip://", "echo:", "exec:", "expr:", "ffmpeg:", "gopro://", "hass:", "homekit://", "http://", "https://", "httpx://", "isapi://", "ivideon:", "kasa://", "nest:", "onvif://", "roborock://", "rtmp://", "rtsp://", "rtspx://", "tapo://", "tcp://", "webrtc:", "webtorrent:"];
|
|
2
|
+
export declare const rtspPresets: readonly ["#backchannel=0", "#header=", "#media=audio", "#media=video", "#timeout=10", "#timeout=20", "#timeout=30", "#transport="];
|
|
3
|
+
export declare const ffmpegPresets: readonly ["#audio=aac", "#audio=aac/16000", "#audio=mp3", "#audio=opus", "#audio=pcm", "#audio=pcm/8000", "#audio=pcm/16000", "#audio=pcm/48000", "#audio=pcma", "#audio=pcma/8000", "#audio=pcma/16000", "#audio=pcma/48000", "#audio=pcml", "#audio=pcml/8000", "#audio=pcml/44100", "#audio=pcmu", "#audio=pcmu/8000", "#audio=pcmu/16000", "#audio=pcmu/48000", "#drawtext", "#hardware", "#hardware=cuda", "#hardware=dxva2", "#hardware=rkmpp", "#hardware=v4l2m2m", "#hardware=vaapi", "#hardware=videotoolbox", "#height=", "#raw=", "#rotate=-90", "#rotate=90", "#rotate=180", "#rotate=270", "#video=copy", "#video=h264", "#video=h265", "#video=mjpeg", "#width="];
|
|
4
|
+
export declare const homekitPresets: readonly ["client_id=", "client_private=", "device_id=", "device_public="];
|
|
5
|
+
export declare const httpPresets: readonly ["#header="];
|
|
6
|
+
export declare const nestPresets: readonly ["client_id=", "client_secret=", "refresh_token=", "project_id=", "device_id="];
|
|
7
|
+
export declare const webrtcPreset: readonly ["#client_id=", "#format=openipc", "#format=wyze", "#format=kinesis", "#ice_servers="];
|
|
8
|
+
export type SourcePrefixes = (typeof sourcePrefixes)[number];
|
|
9
|
+
export type RtspPresets = (typeof rtspPresets)[number];
|
|
10
|
+
export type FFmpegPresets = (typeof ffmpegPresets)[number];
|
|
11
|
+
export type HomekitPresets = (typeof homekitPresets)[number];
|
|
12
|
+
export type HttpPresets = (typeof httpPresets)[number];
|
|
13
|
+
export type NestPresets = (typeof nestPresets)[number];
|
|
14
|
+
export type WebrtcPresets = (typeof webrtcPreset)[number];
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.webrtcPreset = exports.nestPresets = exports.httpPresets = exports.homekitPresets = exports.ffmpegPresets = exports.rtspPresets = exports.sourcePrefixes = void 0;
|
|
4
|
+
exports.sourcePrefixes = [
|
|
5
|
+
'bubble://',
|
|
6
|
+
'dvrip://',
|
|
7
|
+
'echo:',
|
|
8
|
+
'exec:',
|
|
9
|
+
'expr:',
|
|
10
|
+
'ffmpeg:',
|
|
11
|
+
'gopro://',
|
|
12
|
+
'hass:',
|
|
13
|
+
'homekit://',
|
|
14
|
+
'http://',
|
|
15
|
+
'https://',
|
|
16
|
+
'httpx://',
|
|
17
|
+
'isapi://',
|
|
18
|
+
'ivideon:',
|
|
19
|
+
'kasa://',
|
|
20
|
+
'nest:',
|
|
21
|
+
'onvif://',
|
|
22
|
+
'roborock://',
|
|
23
|
+
'rtmp://',
|
|
24
|
+
'rtsp://',
|
|
25
|
+
'rtspx://',
|
|
26
|
+
'tapo://',
|
|
27
|
+
'tcp://',
|
|
28
|
+
'webrtc:',
|
|
29
|
+
'webtorrent:',
|
|
30
|
+
];
|
|
31
|
+
exports.rtspPresets = ['#backchannel=0', '#header=', '#media=audio', '#media=video', '#timeout=10', '#timeout=20', '#timeout=30', '#transport='];
|
|
32
|
+
exports.ffmpegPresets = [
|
|
33
|
+
'#audio=aac',
|
|
34
|
+
'#audio=aac/16000',
|
|
35
|
+
'#audio=mp3',
|
|
36
|
+
'#audio=opus',
|
|
37
|
+
'#audio=pcm',
|
|
38
|
+
'#audio=pcm/8000',
|
|
39
|
+
'#audio=pcm/16000',
|
|
40
|
+
'#audio=pcm/48000',
|
|
41
|
+
'#audio=pcma',
|
|
42
|
+
'#audio=pcma/8000',
|
|
43
|
+
'#audio=pcma/16000',
|
|
44
|
+
'#audio=pcma/48000',
|
|
45
|
+
'#audio=pcml',
|
|
46
|
+
'#audio=pcml/8000',
|
|
47
|
+
'#audio=pcml/44100',
|
|
48
|
+
'#audio=pcmu',
|
|
49
|
+
'#audio=pcmu/8000',
|
|
50
|
+
'#audio=pcmu/16000',
|
|
51
|
+
'#audio=pcmu/48000',
|
|
52
|
+
'#drawtext',
|
|
53
|
+
'#hardware',
|
|
54
|
+
'#hardware=cuda',
|
|
55
|
+
'#hardware=dxva2',
|
|
56
|
+
'#hardware=rkmpp',
|
|
57
|
+
'#hardware=v4l2m2m',
|
|
58
|
+
'#hardware=vaapi',
|
|
59
|
+
'#hardware=videotoolbox',
|
|
60
|
+
'#height=',
|
|
61
|
+
'#raw=',
|
|
62
|
+
'#rotate=-90',
|
|
63
|
+
'#rotate=90',
|
|
64
|
+
'#rotate=180',
|
|
65
|
+
'#rotate=270',
|
|
66
|
+
'#video=copy',
|
|
67
|
+
'#video=h264',
|
|
68
|
+
'#video=h265',
|
|
69
|
+
'#video=mjpeg',
|
|
70
|
+
'#width=',
|
|
71
|
+
];
|
|
72
|
+
exports.homekitPresets = ['client_id=', 'client_private=', 'device_id=', 'device_public='];
|
|
73
|
+
exports.httpPresets = ['#header='];
|
|
74
|
+
exports.nestPresets = ['client_id=', 'client_secret=', 'refresh_token=', 'project_id=', 'device_id='];
|
|
75
|
+
exports.webrtcPreset = ['#client_id=', '#format=openipc', '#format=wyze', '#format=kinesis', '#ice_servers='];
|
|
76
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/go2rtc/types.ts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GAAG;IAC5B,WAAW;IACX,UAAU;IACV,OAAO;IACP,OAAO;IACP,OAAO;IACP,SAAS;IACT,UAAU;IACV,OAAO;IACP,YAAY;IACZ,SAAS;IACT,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,SAAS;IACT,OAAO;IACP,UAAU;IACV,aAAa;IACb,SAAS;IACT,SAAS;IACT,UAAU;IACV,SAAS;IACT,QAAQ;IACR,SAAS;IACT,aAAa;CACL,CAAC;AAEE,QAAA,WAAW,GAAG,CAAC,gBAAgB,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,CAAU,CAAC;AAElJ,QAAA,aAAa,GAAG;IAC3B,YAAY;IACZ,kBAAkB;IAClB,YAAY;IACZ,aAAa;IACb,YAAY;IACZ,iBAAiB;IACjB,kBAAkB;IAClB,kBAAkB;IAClB,aAAa;IACb,kBAAkB;IAClB,mBAAmB;IACnB,mBAAmB;IACnB,aAAa;IACb,kBAAkB;IAClB,mBAAmB;IACnB,aAAa;IACb,kBAAkB;IAClB,mBAAmB;IACnB,mBAAmB;IACnB,WAAW;IACX,WAAW;IACX,gBAAgB;IAChB,iBAAiB;IACjB,iBAAiB;IACjB,mBAAmB;IACnB,iBAAiB;IACjB,wBAAwB;IACxB,UAAU;IACV,OAAO;IACP,aAAa;IACb,YAAY;IACZ,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,cAAc;IACd,SAAS;CACD,CAAC;AAEE,QAAA,cAAc,GAAG,CAAC,YAAY,EAAE,iBAAiB,EAAE,YAAY,EAAE,gBAAgB,CAAU,CAAC;AAE5F,QAAA,WAAW,GAAG,CAAC,UAAU,CAAU,CAAC;AAEpC,QAAA,WAAW,GAAG,CAAC,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,aAAa,EAAE,YAAY,CAAU,CAAC;AAEvG,QAAA,YAAY,GAAG,CAAC,aAAa,EAAE,iBAAiB,EAAE,cAAc,EAAE,iBAAiB,EAAE,eAAe,CAAU,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { API } from '../api';
|
|
2
|
+
import type { CameraDevice } from '../camera/types';
|
|
3
|
+
import type { PluginLogger } from '../services/logger';
|
|
4
|
+
import type { PluginConfigService } from './config';
|
|
5
|
+
import type { BasePlugin as BasePluginMethods } from './types';
|
|
6
|
+
import type { Storage } from './storage';
|
|
7
|
+
export declare class BasePlugin implements BasePluginMethods {
|
|
8
|
+
id: string;
|
|
9
|
+
api: API;
|
|
10
|
+
configService: PluginConfigService;
|
|
11
|
+
logger: PluginLogger;
|
|
12
|
+
storage: Storage;
|
|
13
|
+
cameras: Map<string, CameraDevice>;
|
|
14
|
+
constructor(pluginId: string, log: PluginLogger, configService: PluginConfigService, storage: Storage, api: API);
|
|
15
|
+
onFormSubmit(actionId: string, payload: any): Promise<{
|
|
16
|
+
toast?: string;
|
|
17
|
+
} | void>;
|
|
18
|
+
configureCameras(cameras: CameraDevice[]): void;
|
|
19
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BasePlugin = void 0;
|
|
4
|
+
class BasePlugin {
|
|
5
|
+
id;
|
|
6
|
+
api;
|
|
7
|
+
configService;
|
|
8
|
+
logger;
|
|
9
|
+
storage;
|
|
10
|
+
cameras = new Map();
|
|
11
|
+
constructor(pluginId, log, configService, storage, api) {
|
|
12
|
+
this.id = pluginId;
|
|
13
|
+
this.api = api;
|
|
14
|
+
this.configService = configService;
|
|
15
|
+
this.logger = log;
|
|
16
|
+
this.storage = storage;
|
|
17
|
+
}
|
|
18
|
+
async onFormSubmit(actionId, payload) { }
|
|
19
|
+
configureCameras(cameras) {
|
|
20
|
+
for (const camera of cameras) {
|
|
21
|
+
this.cameras.set(camera.id, camera);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.BasePlugin = BasePlugin;
|
|
26
|
+
//# sourceMappingURL=base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../../../../src/plugins/base.ts"],"names":[],"mappings":";;;AASA,MAAa,UAAU;IACd,EAAE,CAAS;IACX,GAAG,CAAM;IACT,aAAa,CAAsB;IACnC,MAAM,CAAe;IACrB,OAAO,CAAU;IAEjB,OAAO,GAAG,IAAI,GAAG,EAAwB,CAAC;IAEjD,YAAY,QAAgB,EAAE,GAAiB,EAAE,aAAkC,EAAE,OAAgB,EAAE,GAAQ;QAC7G,IAAI,CAAC,EAAE,GAAG,QAAQ,CAAC;QACnB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;QAClB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAEM,KAAK,CAAC,YAAY,CAAC,QAAgB,EAAE,OAAY,IAAuC,CAAC;IAEzF,gBAAgB,CAAC,OAAuB;QAC7C,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;YAC7B,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QACtC,CAAC;IACH,CAAC;CACF;AAxBD,gCAwBC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type { API } from '../api';
|
|
2
|
+
import type { PluginJsonSchemaForm, PluginJsonSchema, CameraStorage as CameraStorageMethods, SchemaConfig } from './types';
|
|
3
|
+
export declare class CameraStorage implements CameraStorageMethods {
|
|
4
|
+
schema: PluginJsonSchemaForm;
|
|
5
|
+
private cameraId;
|
|
6
|
+
private instance;
|
|
7
|
+
private api;
|
|
8
|
+
private db;
|
|
9
|
+
private _values;
|
|
10
|
+
constructor(api: API, instance: any, cameraId: string, schema?: PluginJsonSchemaForm);
|
|
11
|
+
/**
|
|
12
|
+
* Initialize the storage.
|
|
13
|
+
* This will load the configuration from the database.
|
|
14
|
+
*/
|
|
15
|
+
initializeStorage(): Promise<void>;
|
|
16
|
+
/**
|
|
17
|
+
* Set a new value for a given key/path in the configuration.
|
|
18
|
+
* If the schema of the value has an onSet function, and the value has changed, the onSet function will be called.
|
|
19
|
+
* If the schema of the value is declared as storable, the value will be saved to the database.
|
|
20
|
+
*
|
|
21
|
+
* @param path - The path to the configuration value.
|
|
22
|
+
* @param newValue - The new value to set.
|
|
23
|
+
*/
|
|
24
|
+
setValue<T = string>(path: string, newValue: T): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Get a value from the configuration by its key/path.
|
|
27
|
+
* If the schema has an onGet function, the onGet function will be called.
|
|
28
|
+
* If the onGet functions is undefined, the value from the configuration will be returned.
|
|
29
|
+
* If the schema has a default value, and the configuration value is undefined, the default value will be returned.
|
|
30
|
+
*
|
|
31
|
+
* @param path - The path to the configuration value.
|
|
32
|
+
* @returns The value from the configuration.
|
|
33
|
+
*/
|
|
34
|
+
getValue<T = string>(path: string): T | Promise<T> | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* Get the root schema and configuration.
|
|
37
|
+
* This will also call the onGet functions for the schema.
|
|
38
|
+
*
|
|
39
|
+
* @returns The root schema and configuration.
|
|
40
|
+
*/
|
|
41
|
+
getConfig(): Promise<SchemaConfig>;
|
|
42
|
+
/**
|
|
43
|
+
* Set a new configuration.
|
|
44
|
+
* If the schema of a value which has been changed has an onSet function, the onSet function will be called.
|
|
45
|
+
*
|
|
46
|
+
* @param newConfig - The new configuration to set.
|
|
47
|
+
*/
|
|
48
|
+
setConfig(newConfig: Record<string, any>): Promise<void>;
|
|
49
|
+
/**
|
|
50
|
+
* Add a new schema to the existing schema.
|
|
51
|
+
* It will also add the value to the configuration.
|
|
52
|
+
* If the schema is declared as storable, the value will be saved to the database.
|
|
53
|
+
*
|
|
54
|
+
* @param schema - The new schema to add.
|
|
55
|
+
* @param path - The path to the schema to add.
|
|
56
|
+
*/
|
|
57
|
+
addSchema(schema: PluginJsonSchemaForm): Promise<void>;
|
|
58
|
+
addSchema(path: string, schema: PluginJsonSchema): Promise<void>;
|
|
59
|
+
/**
|
|
60
|
+
* Remove a schema by its config path/key from the existing schema.
|
|
61
|
+
* It will also remove the value from the configuration.
|
|
62
|
+
* If the schema is declared as storable, the value will be removed from the database.
|
|
63
|
+
*
|
|
64
|
+
* @param path - The path to the schema to remove.
|
|
65
|
+
*/
|
|
66
|
+
removeSchema(path: string): Promise<void>;
|
|
67
|
+
/**
|
|
68
|
+
* Change a schema by its config path/key from the existing schema.
|
|
69
|
+
* It will also change the value from the configuration.
|
|
70
|
+
* If the schema is declared as storable, the value will be saved to the database.
|
|
71
|
+
*
|
|
72
|
+
* @param path - The path to the schema to change.
|
|
73
|
+
* @param schema - The new schema to set.
|
|
74
|
+
*/
|
|
75
|
+
changeSchema(path: string, newSchema: Partial<PluginJsonSchema>): Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* Check if a schema exists by its config path/key.
|
|
78
|
+
*
|
|
79
|
+
* @param path - The path to the schema to check.
|
|
80
|
+
* @returns True if the schema exists, false otherwise.
|
|
81
|
+
*/
|
|
82
|
+
hasSchema(path: string): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Check if a value exists by its config path/key.
|
|
85
|
+
*
|
|
86
|
+
* @param path - The path to the value to check.
|
|
87
|
+
* @returns True if the value exists, false otherwise.
|
|
88
|
+
*/
|
|
89
|
+
hasValue(path: string): boolean;
|
|
90
|
+
private resolveOnGetFunctions;
|
|
91
|
+
private resolveOnGetFunctionsForObject;
|
|
92
|
+
private resolveOnGetFunctionsForSchema;
|
|
93
|
+
private triggerOnSetForChanges;
|
|
94
|
+
private filterStorableValues;
|
|
95
|
+
private containsStorableSchema;
|
|
96
|
+
private saveDb;
|
|
97
|
+
}
|