@camera.ui/browser 0.0.33 → 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 +21 -9
- package/dist/client/node/src/proxy/cameraDevice/cameraDevice.node.d.ts +4 -1
- package/dist/src/api/database/types.d.ts +51 -17
- package/dist/src/api/go2rtc/api/application.d.ts +4 -3
- package/dist/src/api/go2rtc/api/config.d.ts +9 -0
- package/dist/src/api/go2rtc/api/snapshot.d.ts +6 -5
- package/dist/src/api/go2rtc/api/streams.d.ts +5 -5
- package/dist/src/api/go2rtc/index.d.ts +13 -3
- 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/schemas/go2rtc.schema.d.ts +2 -2
- package/dist/src/api/services/cameras.service.d.ts +20 -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 +23 -10
- package/dist/src/camera/types.d.ts +35 -17
- package/dist/src/plugins/cameraStorage.d.ts +24 -15
- 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 +11 -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 +9 -6
- package/dist/src/proxy/client/systemManager.d.ts +9 -9
- package/dist/src/proxy/index.d.ts +13 -10
- package/dist/src/proxy/proxies/camera.d.ts +52 -21
- 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 +9 -10
- package/dist/src/proxy/types.d.ts +70 -87
- package/dist/src/services/config/index.d.ts +2 -2
- package/dist/src/services/config/types.d.ts +2 -1
- package/package.json +2 -2
|
@@ -1,57 +1,88 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="pouchdb-core" />
|
|
2
|
+
/// <reference types="node" />
|
|
2
3
|
import type { OnSetEvent, StateValues } from '../../camera/types';
|
|
3
4
|
import type { IceServer } from '../../services/config/types';
|
|
4
|
-
import type { FfmpegOptions, PrebufferType } from '../../camera/types';
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
5
|
+
import type { FfmpegOptions, PrebufferType, CameraDelegate } from '../../camera/types';
|
|
6
|
+
import type { CameraDeviceProxyMethods, ProxyMessageStructure } from '../types';
|
|
7
|
+
import type { MessageQueue } from '../queue';
|
|
8
|
+
import type { CameraDeviceHub } from '../../camera';
|
|
9
|
+
import type { Camera } from '../../api/database/types';
|
|
7
10
|
export declare class CameraDeviceProxy implements CameraDeviceProxyMethods {
|
|
8
11
|
private api;
|
|
9
12
|
private configService;
|
|
10
13
|
private camerasService;
|
|
11
14
|
private pluginsService;
|
|
12
|
-
private
|
|
13
|
-
constructor(
|
|
15
|
+
private messageQueue;
|
|
16
|
+
constructor(messageQueue: MessageQueue);
|
|
14
17
|
snapshot(data: {
|
|
15
|
-
|
|
18
|
+
prebuffer?: boolean;
|
|
16
19
|
cameraId: string;
|
|
17
20
|
pluginId: string;
|
|
21
|
+
ws?: boolean;
|
|
18
22
|
}): Promise<ArrayBuffer>;
|
|
19
23
|
setPrebufferSource(data: {
|
|
20
24
|
sourceName: string;
|
|
21
|
-
address: string
|
|
25
|
+
address: string;
|
|
26
|
+
type: PrebufferType;
|
|
27
|
+
cameraId: string;
|
|
28
|
+
pluginId: string;
|
|
29
|
+
ws?: boolean;
|
|
30
|
+
}): Promise<void>;
|
|
31
|
+
removePrebufferSource(data: {
|
|
32
|
+
sourceName: string;
|
|
22
33
|
type: PrebufferType;
|
|
23
34
|
cameraId: string;
|
|
24
35
|
pluginId: string;
|
|
36
|
+
ws?: boolean;
|
|
25
37
|
}): Promise<void>;
|
|
26
|
-
|
|
27
|
-
|
|
38
|
+
removePrebufferSources(data: {
|
|
39
|
+
cameraId: string;
|
|
40
|
+
pluginId: string;
|
|
41
|
+
ws?: boolean;
|
|
42
|
+
}): Promise<void>;
|
|
43
|
+
getFffmpegPath(data: {
|
|
44
|
+
cameraId: string;
|
|
45
|
+
pluginId: string;
|
|
46
|
+
ws?: boolean;
|
|
47
|
+
}): string;
|
|
48
|
+
getIceServers(data: {
|
|
49
|
+
cameraId: string;
|
|
50
|
+
pluginId: string;
|
|
51
|
+
ws?: boolean;
|
|
52
|
+
}): IceServer[];
|
|
28
53
|
updateState<T extends keyof StateValues>(data: {
|
|
29
54
|
stateName: T;
|
|
30
55
|
eventData: OnSetEvent<T>;
|
|
31
56
|
cameraId: string;
|
|
32
|
-
|
|
57
|
+
pluginId: string;
|
|
58
|
+
ws?: boolean;
|
|
59
|
+
}): Promise<void>;
|
|
33
60
|
refreshStates(data: {
|
|
34
61
|
cameraId: string;
|
|
35
|
-
|
|
36
|
-
|
|
62
|
+
pluginId: string;
|
|
63
|
+
ws?: boolean;
|
|
64
|
+
}): Promise<{
|
|
65
|
+
camera: Camera;
|
|
37
66
|
states: StateValues;
|
|
38
|
-
}
|
|
67
|
+
}>;
|
|
39
68
|
streamVideo(data: {
|
|
40
69
|
sourceName: string;
|
|
41
70
|
options: FfmpegOptions;
|
|
42
71
|
cameraId: string;
|
|
72
|
+
pluginId: string;
|
|
73
|
+
ws?: boolean;
|
|
43
74
|
}): Promise<void>;
|
|
44
75
|
recordToFile(data: {
|
|
45
76
|
sourceName: string;
|
|
46
77
|
outputPath: string;
|
|
47
78
|
duration?: number;
|
|
48
79
|
cameraId: string;
|
|
80
|
+
pluginId: string;
|
|
81
|
+
ws?: boolean;
|
|
49
82
|
}): Promise<void>;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
publishCameraMessage(cameraId: CameraId, type: CameraDeviceListenerMessagePayload['type'], data?: any): Promise<void>;
|
|
56
|
-
private isCameraState;
|
|
83
|
+
onRequestSnapshotRequest(cameraDevice: CameraDeviceHub, ...args: Parameters<CameraDelegate['snapshotRequest']>): Promise<Buffer>;
|
|
84
|
+
onRequestPrepareStream(cameraDevice: CameraDeviceHub, ...args: Parameters<CameraDelegate['prepareStream']>): Promise<void>;
|
|
85
|
+
onRequestWebRTCOffer(cameraDevice: CameraDeviceHub, ...args: Parameters<CameraDelegate['onOffer']>): Promise<string>;
|
|
86
|
+
onRequestWebRTCIceCandidates(cameraDevice: CameraDeviceHub, ...args: Parameters<CameraDelegate['onCandidates']>): Promise<void>;
|
|
87
|
+
handleMessage(message: ProxyMessageStructure): Promise<void>;
|
|
57
88
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { type CameraStorage, type BasePlugin } from '../../plugins/types';
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
2
|
+
import type { MethodKeys, ProxyMessageStructure } from '../types';
|
|
3
|
+
import type { MessageQueue } from '../queue';
|
|
4
4
|
export declare class PluginProxy {
|
|
5
5
|
private pluginsService;
|
|
6
|
-
private
|
|
7
|
-
constructor(
|
|
6
|
+
private messageQueue;
|
|
7
|
+
constructor(messageQueue: MessageQueue);
|
|
8
8
|
onRequestPluginFn<K extends Exclude<MethodKeys<BasePlugin>, 'configureCameras'>>(pluginId: string, fn: K, ...args: Parameters<BasePlugin[K]>): Promise<ReturnType<BasePlugin[K]>>;
|
|
9
9
|
onRequestStorageFn<K extends MethodKeys<CameraStorage>>(pluginId: string, cameraId: string, fn: K, ...args: Parameters<CameraStorage[K]>): Promise<ReturnType<CameraStorage[K]>>;
|
|
10
|
+
handleMessage(message: ProxyMessageStructure): Promise<void>;
|
|
10
11
|
}
|
|
@@ -1,17 +1,12 @@
|
|
|
1
|
-
import type { ProxyServer } from '..';
|
|
2
1
|
import type { ApiProxyMethods, ProxyMessageStructure } from '../types';
|
|
3
2
|
import type { Camera } from '../../api/database/types';
|
|
4
3
|
import type { CameraConfig } from '../../camera/types';
|
|
5
|
-
|
|
6
|
-
listen(): any;
|
|
7
|
-
removeListener(): any;
|
|
8
|
-
removeAllListeners(): any;
|
|
9
|
-
}
|
|
4
|
+
import type { MessageQueue } from '../queue';
|
|
10
5
|
export declare class ServerProxy implements ApiProxyMethods {
|
|
11
6
|
private camerasService;
|
|
12
7
|
private pluginsService;
|
|
13
|
-
private
|
|
14
|
-
constructor(
|
|
8
|
+
private messageQueue;
|
|
9
|
+
constructor(messageQueue: MessageQueue);
|
|
15
10
|
getCameraByName(data: {
|
|
16
11
|
name: string;
|
|
17
12
|
}): Promise<Camera | undefined>;
|
|
@@ -30,5 +25,5 @@ export declare class ServerProxy implements ApiProxyMethods {
|
|
|
30
25
|
id: string;
|
|
31
26
|
pluginId: string;
|
|
32
27
|
}): Promise<void>;
|
|
33
|
-
handleMessage(
|
|
28
|
+
handleMessage(message: ProxyMessageStructure): Promise<void>;
|
|
34
29
|
}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { ProxyMessageStructure } from './types';
|
|
2
|
+
import type { ProxyServer } from '.';
|
|
3
3
|
export declare class MessageQueue {
|
|
4
|
-
private
|
|
4
|
+
private logger;
|
|
5
|
+
private proxyServer;
|
|
6
|
+
private router;
|
|
5
7
|
private isProcessing;
|
|
8
|
+
private queue;
|
|
6
9
|
private pendingResponses;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
constructor(reqServer: Reply, router: Router);
|
|
10
|
-
addToQueue(item: QueueItem): Promise<void>;
|
|
11
|
-
receiveResponse(requestId: string, response: any): void;
|
|
12
|
-
receiveError(requestId: string, error: Error): void;
|
|
10
|
+
constructor(proxyServer: ProxyServer);
|
|
11
|
+
enqueue(message: ProxyMessageStructure): Promise<any>;
|
|
13
12
|
private processQueue;
|
|
14
|
-
private
|
|
13
|
+
private listenToDealer;
|
|
15
14
|
}
|
|
@@ -1,81 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
import type {
|
|
3
|
-
import type { BasePlugin, CameraStorage } from '../plugins/types';
|
|
1
|
+
import type { Camera } from '../api/database/types';
|
|
2
|
+
import type { CameraExtension } from '../plugins/types';
|
|
4
3
|
import type { CameraConfig, OnSetEvent, StateValues, CameraDevice, FfmpegOptions, PrebufferType } from '../camera/types';
|
|
5
4
|
import type { IceServer } from '../services/config/types';
|
|
6
5
|
export type MethodKeys<T> = {
|
|
7
6
|
[K in keyof T]: T[K] extends Function ? K : never;
|
|
8
7
|
}[keyof T];
|
|
9
|
-
export interface
|
|
10
|
-
|
|
11
|
-
message: any;
|
|
8
|
+
export interface QueueItem {
|
|
9
|
+
message: ProxyMessageStructure;
|
|
12
10
|
resolve: (response: any) => void;
|
|
13
11
|
reject: (error: Error) => void;
|
|
14
|
-
timeout: number;
|
|
15
|
-
}
|
|
16
|
-
export interface QueueItem {
|
|
17
|
-
requestType: 'router' | 'request';
|
|
18
|
-
targetId: string;
|
|
19
|
-
requestId: string;
|
|
20
|
-
message: any;
|
|
21
|
-
timeout?: number;
|
|
22
|
-
onResponse?: (response: any) => void;
|
|
23
|
-
onError?: (error: Error) => void;
|
|
24
|
-
}
|
|
25
|
-
export interface RequestPayload {
|
|
26
|
-
fn: string;
|
|
27
|
-
data: Record<string, any>;
|
|
28
|
-
requestId: string;
|
|
29
12
|
}
|
|
30
|
-
export interface
|
|
31
|
-
payload: CameraDeviceProxyMessageStructure | ProxyMessageStructure;
|
|
32
|
-
resolve: (value: any) => void;
|
|
33
|
-
reject: (reason?: any) => void;
|
|
34
|
-
timeout: NodeJS.Timeout;
|
|
35
|
-
}
|
|
36
|
-
export interface RouterDealerPayload {
|
|
37
|
-
fn: keyof BasePlugin | keyof CameraStorage;
|
|
38
|
-
args: any[];
|
|
13
|
+
export interface ProxyMessageStructure {
|
|
39
14
|
requestId: string;
|
|
40
|
-
targetId: string;
|
|
41
|
-
pluginId: string;
|
|
42
15
|
cameraId?: string;
|
|
43
|
-
}
|
|
44
|
-
export interface PluginRouterDealePayload extends RouterDealerPayload {
|
|
45
|
-
fn: keyof BasePlugin;
|
|
46
|
-
}
|
|
47
|
-
export interface StorageRouterDealerPayload extends RouterDealerPayload {
|
|
48
|
-
fn: keyof CameraStorage;
|
|
49
|
-
}
|
|
50
|
-
export interface QueueRouterDealerItem {
|
|
51
|
-
payload: RouterDealerPayload;
|
|
52
|
-
resolve: (value: any) => void;
|
|
53
|
-
reject: (reason?: any) => void;
|
|
54
|
-
timeout: NodeJS.Timeout;
|
|
55
|
-
}
|
|
56
|
-
export type CameraId = string;
|
|
57
|
-
export type PluginId = string;
|
|
58
|
-
export type TargetID = CameraId | PluginId | 'all';
|
|
59
|
-
export interface PendingMessagePayload {
|
|
60
|
-
requestId: string;
|
|
61
|
-
response?: any;
|
|
62
|
-
}
|
|
63
|
-
export interface ListenerMessagePayload {
|
|
64
|
-
type: keyof ProxyEventCallbacks;
|
|
65
|
-
data: any;
|
|
66
|
-
}
|
|
67
|
-
export interface ProxyMessageStructure {
|
|
68
16
|
targetId: string;
|
|
69
|
-
targetName
|
|
17
|
+
targetName?: string;
|
|
70
18
|
pluginId: string;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
19
|
+
type: 'request' | 'reply';
|
|
20
|
+
proxy: 'system' | 'device' | 'plugins' | 'camera';
|
|
21
|
+
client: 'pluginFn' | 'pluginStorage' | 'cameraFn' | 'cameraDelegate' | 'device' | 'system';
|
|
22
|
+
fn: string;
|
|
23
|
+
args: any;
|
|
24
|
+
timeout: number;
|
|
75
25
|
timestamp: number;
|
|
26
|
+
response?: any;
|
|
27
|
+
error?: any;
|
|
28
|
+
}
|
|
29
|
+
export interface WsManagerClientMessage {
|
|
30
|
+
method: ProxyMethodNames;
|
|
31
|
+
args: any[];
|
|
76
32
|
}
|
|
77
|
-
export type ProxyEvents = SystemManagerProxyEvents & DeviceManagerProxyEvents;
|
|
78
|
-
export type ProxyEventCallbacks = SystemManagerProxyEventCallbacks & DeviceManagerProxyEventCallbacks;
|
|
79
33
|
export type ProxyMethodNames = SystemManagerProxyMethodNames | DeviceManagerProxyMethodNames;
|
|
80
34
|
export interface ApiProxyMethods {
|
|
81
35
|
createCamera(data: {
|
|
@@ -99,10 +53,6 @@ export interface ApiProxyMethods {
|
|
|
99
53
|
pluginId: string;
|
|
100
54
|
}): Promise<void>;
|
|
101
55
|
}
|
|
102
|
-
export interface WsManagerClientMessage {
|
|
103
|
-
method: ProxyMethodNames;
|
|
104
|
-
args: any[];
|
|
105
|
-
}
|
|
106
56
|
export interface DeviceManagerListenerMessagePayload {
|
|
107
57
|
type: keyof DeviceManagerProxyEventCallbacks;
|
|
108
58
|
data: any;
|
|
@@ -113,20 +63,38 @@ export interface DeviceManagerProxyMethods {
|
|
|
113
63
|
getCameraById(id: string): Promise<CameraDevice | undefined>;
|
|
114
64
|
removeCameraByName(name: string): Promise<void>;
|
|
115
65
|
removeCameraById(id: string): Promise<void>;
|
|
66
|
+
}
|
|
67
|
+
export interface DeviceManagerProxyMethodsListener {
|
|
116
68
|
listen<E extends keyof DeviceManagerProxyEventCallbacks>(eventType: E, callback: DeviceManagerProxyEventCallbacks[E]): void;
|
|
117
69
|
removeListener<E extends keyof DeviceManagerProxyEventCallbacks>(eventType: E, callbackToRemove: DeviceManagerProxyEventCallbacks[E]): void;
|
|
118
70
|
removeAllListeners<E extends keyof DeviceManagerProxyEventCallbacks>(eventType?: E): void;
|
|
119
71
|
}
|
|
120
72
|
export type DeviceManagerProxyMethodNames = MethodKeys<DeviceManagerProxyMethods>;
|
|
121
73
|
export interface DeviceManagerProxyEvents {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
74
|
+
cameraSelected: {
|
|
75
|
+
camera: Camera;
|
|
76
|
+
extension: CameraExtension;
|
|
77
|
+
};
|
|
78
|
+
cameraDeselected: {
|
|
79
|
+
camera: Camera;
|
|
80
|
+
extension: CameraExtension;
|
|
81
|
+
};
|
|
82
|
+
cameraAdded: {
|
|
83
|
+
camera: Camera;
|
|
84
|
+
};
|
|
85
|
+
cameraRemoved: {
|
|
86
|
+
camera: Camera;
|
|
87
|
+
};
|
|
88
|
+
cameraUpdated: {
|
|
89
|
+
camera: Camera;
|
|
90
|
+
};
|
|
125
91
|
}
|
|
126
92
|
export type DeviceManagerProxyEventCallbacks = {
|
|
93
|
+
cameraSelected: (camera: CameraDevice, extension: CameraExtension) => void;
|
|
94
|
+
cameraDeselected: (cameraId: string, extension: CameraExtension) => void;
|
|
127
95
|
cameraAdded: (camera: CameraDevice) => void;
|
|
128
|
-
cameraUpdated: (cameraId: string, camera: CameraDevice) => void;
|
|
129
96
|
cameraRemoved: (cameraId: string) => void;
|
|
97
|
+
cameraUpdated: (cameraId: string, camera: CameraDevice) => void;
|
|
130
98
|
};
|
|
131
99
|
export interface DeviceManagerProxyGenericEvent<K extends keyof DeviceManagerProxyEvents> {
|
|
132
100
|
type: K;
|
|
@@ -137,6 +105,8 @@ export interface SystemManagerListenerMessagePayload {
|
|
|
137
105
|
data: any;
|
|
138
106
|
}
|
|
139
107
|
export interface SystemManagerProxyMethods {
|
|
108
|
+
}
|
|
109
|
+
export interface SystemManagerProxyMethodsListener {
|
|
140
110
|
listen<E extends keyof SystemManagerProxyEventCallbacks>(eventType: E, callback: SystemManagerProxyEventCallbacks[E]): void;
|
|
141
111
|
removeListener<E extends keyof SystemManagerProxyEventCallbacks>(eventType: E, callbackToRemove: SystemManagerProxyEventCallbacks[E]): void;
|
|
142
112
|
removeAllListeners<E extends keyof SystemManagerProxyEventCallbacks>(eventType?: E): void;
|
|
@@ -154,6 +124,8 @@ export interface PluginsManagerListenerMessagePayload {
|
|
|
154
124
|
data: any;
|
|
155
125
|
}
|
|
156
126
|
export interface PluginsManagerProxyMethods {
|
|
127
|
+
}
|
|
128
|
+
export interface PluginsManagerProxyMethodsListener {
|
|
157
129
|
listen<E extends keyof PluginsManagerProxyEventCallbacks>(eventType: E, callback: PluginsManagerProxyEventCallbacks[E]): void;
|
|
158
130
|
removeListener<E extends keyof PluginsManagerProxyEventCallbacks>(eventType: E, callbackToRemove: PluginsManagerProxyEventCallbacks[E]): void;
|
|
159
131
|
removeAllListeners<E extends keyof PluginsManagerProxyEventCallbacks>(eventType?: E): void;
|
|
@@ -175,58 +147,68 @@ export interface CameraDeviceListenerStatePayload<K extends keyof StateValues> {
|
|
|
175
147
|
};
|
|
176
148
|
}
|
|
177
149
|
export interface CameraDeviceListenerMessagePayload {
|
|
178
|
-
type: 'removed' | 'updated';
|
|
150
|
+
type: 'removed' | 'updated' | 'updatedSources';
|
|
179
151
|
data?: any;
|
|
180
152
|
}
|
|
181
|
-
export interface CameraDeviceProxyMessageStructure {
|
|
182
|
-
targetId: string;
|
|
183
|
-
targetName: string;
|
|
184
|
-
pluginId: string;
|
|
185
|
-
cameraId?: string;
|
|
186
|
-
requestId: string;
|
|
187
|
-
fn: CameraDeviceProxyMethodNames;
|
|
188
|
-
data: any;
|
|
189
|
-
timestamp: number;
|
|
190
|
-
}
|
|
191
153
|
export interface CameraDeviceProxyMethods {
|
|
192
154
|
snapshot(data: {
|
|
193
155
|
sourceName: string;
|
|
156
|
+
prebuffer?: boolean;
|
|
194
157
|
cameraId: string;
|
|
195
158
|
pluginId: string;
|
|
159
|
+
ws?: boolean;
|
|
196
160
|
}): Promise<ArrayBuffer>;
|
|
197
161
|
setPrebufferSource(data: {
|
|
198
162
|
sourceName: string;
|
|
199
|
-
address: string
|
|
163
|
+
address: string;
|
|
200
164
|
type: PrebufferType;
|
|
201
165
|
cameraId: string;
|
|
202
166
|
pluginId: string;
|
|
167
|
+
ws?: boolean;
|
|
168
|
+
}): Promise<void>;
|
|
169
|
+
removePrebufferSource(data: {
|
|
170
|
+
sourceName: string;
|
|
171
|
+
type: PrebufferType;
|
|
172
|
+
cameraId: string;
|
|
173
|
+
pluginId: string;
|
|
174
|
+
ws?: boolean;
|
|
175
|
+
}): Promise<void>;
|
|
176
|
+
removePrebufferSources(data: {
|
|
177
|
+
cameraId: string;
|
|
178
|
+
pluginId: string;
|
|
179
|
+
ws?: boolean;
|
|
203
180
|
}): Promise<void>;
|
|
204
181
|
getFffmpegPath(data: {
|
|
205
182
|
cameraId: string;
|
|
206
183
|
pluginId: string;
|
|
184
|
+
ws?: boolean;
|
|
207
185
|
}): string;
|
|
208
186
|
getIceServers(data: {
|
|
209
187
|
cameraId: string;
|
|
210
188
|
pluginId: string;
|
|
189
|
+
ws?: boolean;
|
|
211
190
|
}): IceServer[];
|
|
212
191
|
updateState<T extends keyof StateValues>(data: {
|
|
213
192
|
stateName: T;
|
|
214
193
|
eventData: OnSetEvent<T>;
|
|
215
194
|
cameraId: string;
|
|
216
195
|
pluginId: string;
|
|
196
|
+
ws?: boolean;
|
|
217
197
|
}): void;
|
|
218
198
|
refreshStates(data: {
|
|
219
199
|
cameraId: string;
|
|
220
200
|
pluginId: string;
|
|
221
|
-
|
|
222
|
-
|
|
201
|
+
ws?: boolean;
|
|
202
|
+
}): Promise<{
|
|
203
|
+
camera: Camera;
|
|
223
204
|
states: StateValues;
|
|
224
|
-
}
|
|
205
|
+
}>;
|
|
225
206
|
streamVideo(data: {
|
|
226
207
|
sourceName: string;
|
|
227
208
|
options: FfmpegOptions;
|
|
228
209
|
cameraId: string;
|
|
229
210
|
pluginId: string;
|
|
211
|
+
ws?: boolean;
|
|
230
212
|
}): Promise<void>;
|
|
231
213
|
recordToFile(data: {
|
|
232
214
|
sourceName: string;
|
|
@@ -234,6 +216,7 @@ export interface CameraDeviceProxyMethods {
|
|
|
234
216
|
duration?: number;
|
|
235
217
|
cameraId: string;
|
|
236
218
|
pluginId: string;
|
|
219
|
+
ws?: boolean;
|
|
237
220
|
}): Promise<void>;
|
|
238
221
|
}
|
|
239
222
|
export type CameraDeviceProxyMethodNames = MethodKeys<CameraDeviceProxyMethods>;
|
|
@@ -37,7 +37,6 @@ export declare class ConfigService {
|
|
|
37
37
|
UI_PORT: number;
|
|
38
38
|
UI_ELECTRON_PORT: number;
|
|
39
39
|
PROXY_ROUTER_ADDRESS: string;
|
|
40
|
-
PROXY_REQ_ADDRESS: string;
|
|
41
40
|
PROXY_PUB_ADDRESS: string;
|
|
42
41
|
PROXY_PUBLIC_KEY: string;
|
|
43
42
|
get config(): IConfig;
|
|
@@ -47,7 +46,8 @@ export declare class ConfigService {
|
|
|
47
46
|
constructor();
|
|
48
47
|
read(): void;
|
|
49
48
|
writeConfig(newConfig?: IConfig): void;
|
|
50
|
-
|
|
49
|
+
writeGo2RtcConfigFile(newConfig?: Go2RtcConfig): void;
|
|
50
|
+
writeGo2RtcConfigApi(newConfig?: Go2RtcConfig): Promise<void>;
|
|
51
51
|
mergeGo2RtcConfig(): Promise<void>;
|
|
52
52
|
private defaultConfig;
|
|
53
53
|
private defaultGo2RtcConfig;
|
|
@@ -23,6 +23,7 @@ export interface PluginsSettings {
|
|
|
23
23
|
}
|
|
24
24
|
export interface IConfig {
|
|
25
25
|
port: number;
|
|
26
|
+
insecurePort: number;
|
|
26
27
|
tempFile?: string;
|
|
27
28
|
ssl: IConfigSSL;
|
|
28
29
|
logger: Logger;
|
|
@@ -61,8 +62,8 @@ export interface Go2RtcConfig {
|
|
|
61
62
|
srtp: SRTP;
|
|
62
63
|
rtmp: RTMP;
|
|
63
64
|
webrtc: Webrtc;
|
|
64
|
-
streams: Partial<Streams>;
|
|
65
65
|
ffmpeg: Ffmpeg;
|
|
66
|
+
streams?: Partial<Streams>;
|
|
66
67
|
homekit?: Partial<HomeKit>;
|
|
67
68
|
hass?: Partial<Hass>;
|
|
68
69
|
webtorrent?: Partial<Webtorrent>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camera.ui/browser",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.35",
|
|
4
4
|
"description": "camera.ui browser client",
|
|
5
5
|
"author": "seydx (https://github.com/seydx/camera.ui)",
|
|
6
6
|
"main": "./dist/bundle.js",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"typescript": "^5.3.3",
|
|
32
32
|
"updates": "^15.1.1",
|
|
33
33
|
"utf-8-validate": "^6.0.3",
|
|
34
|
-
"webpack": "^5.
|
|
34
|
+
"webpack": "^5.90.0",
|
|
35
35
|
"webpack-cli": "^5.1.4"
|
|
36
36
|
},
|
|
37
37
|
"bugs": {
|