@camera.ui/browser 0.0.86 → 0.0.88
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/types/packages/client/browser/src/client.d.ts +3 -1
- package/dist/types/packages/client/browser/src/proxy/cameraDevice.d.ts +1 -2
- package/dist/types/packages/client/browser/src/proxy/coreManager.d.ts +14 -0
- package/dist/types/packages/client/browser/src/proxy/index.d.ts +1 -0
- package/dist/types/packages/client/browser/src/streaming/go2rts-session.d.ts +0 -1
- package/dist/types/server/src/api/database/index.d.ts +3 -1
- package/dist/types/server/src/api/database/types.d.ts +12 -0
- package/dist/types/server/src/api/schemas/config.schema.d.ts +0 -8
- package/dist/types/server/src/api/schemas/system.schema.d.ts +9 -0
- package/dist/types/server/src/api/schemas/users.schema.d.ts +34 -34
- package/dist/types/server/src/api/services/system.service.d.ts +7 -0
- package/dist/types/server/src/api/types/index.d.ts +4 -0
- package/dist/types/server/src/camera/controller.d.ts +0 -3
- package/dist/types/server/src/camera/device.d.ts +0 -1
- package/dist/types/server/src/camera/index.d.ts +0 -2
- package/dist/types/server/src/camera/streaming/peer-connection.d.ts +2 -1
- package/dist/types/server/src/camera/streaming/webrtc-connection.d.ts +1 -2
- package/dist/types/server/src/camera/streaming/werift-session.d.ts +1 -0
- package/dist/types/server/src/camera/types.d.ts +1 -0
- package/dist/types/server/src/nats/index.d.ts +4 -1
- package/dist/types/server/src/nats/proxy/cameraDevice.d.ts +0 -3
- package/dist/types/server/src/nats/proxy/coreManager.d.ts +14 -0
- package/dist/types/server/src/nats/types.d.ts +25 -6
- package/dist/types/server/src/polyglot/node/plugins/pluginApi.d.ts +3 -0
- package/dist/types/server/src/polyglot/node/plugins/proxy/cameraDevice.d.ts +0 -3
- package/dist/types/server/src/polyglot/node/plugins/proxy/coreManager.d.ts +40 -0
- package/dist/types/server/src/services/config/index.d.ts +0 -2
- package/dist/types/server/src/services/config/types.d.ts +0 -1
- package/dist/types/server/src/utils/network.d.ts +12 -0
- package/dist/types/shared/types/index.d.ts +1 -0
- package/package.json +3 -3
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { DeviceManager } from './proxy/index.js';
|
|
1
|
+
import { CoreManager, DeviceManager } from './proxy/index.js';
|
|
2
2
|
import type { CameraUiClientConfig } from './types.js';
|
|
3
3
|
export interface API {
|
|
4
|
+
coreManager: CoreManager;
|
|
4
5
|
deviceManager: DeviceManager;
|
|
5
6
|
}
|
|
6
7
|
export declare class CameraUiClient {
|
|
@@ -10,6 +11,7 @@ export declare class CameraUiClient {
|
|
|
10
11
|
private logger;
|
|
11
12
|
private token?;
|
|
12
13
|
private deviceManager?;
|
|
14
|
+
private coreManager?;
|
|
13
15
|
constructor(config: CameraUiClientConfig);
|
|
14
16
|
connect(): Promise<API>;
|
|
15
17
|
disconnect(): Promise<void>;
|
|
@@ -3,7 +3,7 @@ import { CameraInterface } from '../../../../../server/src/camera/interfaces/cam
|
|
|
3
3
|
import { CameraPrebufferInterface } from '../../../../../server/src/camera/interfaces/prebuffer.js';
|
|
4
4
|
import { CameraPTZInterface } from '../../../../../server/src/camera/interfaces/ptz.js';
|
|
5
5
|
import { Go2RTCSession } from '../streaming/go2rts-session.js';
|
|
6
|
-
import type { BaseLogger, Camera, CameraSource
|
|
6
|
+
import type { BaseLogger, Camera, CameraSource } from '../../../../../shared/types/index.js';
|
|
7
7
|
import type { SocketService } from '../socket.js';
|
|
8
8
|
import type { CameraDevice, Go2RTCSessionOptions } from '../types.js';
|
|
9
9
|
export declare class CameraDeviceProxy extends BaseCameraDevice implements CameraDevice {
|
|
@@ -23,7 +23,6 @@ export declare class CameraDeviceProxy extends BaseCameraDevice implements Camer
|
|
|
23
23
|
close(): void;
|
|
24
24
|
connect(): Promise<void>;
|
|
25
25
|
disconnect(): Promise<void>;
|
|
26
|
-
getIceServers(): Promise<IceServer[]>;
|
|
27
26
|
createSession(options: Go2RTCSessionOptions): Go2RTCSession;
|
|
28
27
|
refreshStates(): Promise<void>;
|
|
29
28
|
cleanup(): Promise<void>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { BaseLogger, CoreManagerProxyMethods, IceServer } from '../../../../../shared/types/index.js';
|
|
2
|
+
import type { SocketService } from '../socket.js';
|
|
3
|
+
export declare class CoreManager implements CoreManagerProxyMethods {
|
|
4
|
+
private socketService;
|
|
5
|
+
private socket;
|
|
6
|
+
private logger;
|
|
7
|
+
private pluginName;
|
|
8
|
+
private subject;
|
|
9
|
+
constructor(socketService: SocketService, logger: BaseLogger);
|
|
10
|
+
getFFmpegPath(): Promise<string>;
|
|
11
|
+
getServerAddresses(): Promise<string[]>;
|
|
12
|
+
getIceServers(): Promise<IceServer[]>;
|
|
13
|
+
private onRequest;
|
|
14
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { FastifyInstance } from 'fastify';
|
|
2
2
|
import type { Database as DB, RootDatabase as RootDB } from 'lmdb';
|
|
3
3
|
import type { Plugin } from '../../plugins/plugin.js';
|
|
4
|
-
import type { DBAuth, DBCamera, DBPlugin, DBSettings, DBUser } from './types.js';
|
|
4
|
+
import type { DBAuth, DBCamera, DBPlugin, DBSettings, DBSystem, DBUser } from './types.js';
|
|
5
5
|
export declare class Database {
|
|
6
6
|
static readonly VERSION = "1.0.0";
|
|
7
7
|
static readonly CAMERAS_ID = "cameras";
|
|
@@ -10,12 +10,14 @@ export declare class Database {
|
|
|
10
10
|
static readonly USER_PLUGINS_ID = "user-plugins";
|
|
11
11
|
static readonly SETTINGS_ID = "settings";
|
|
12
12
|
static readonly USERS_ID = "users";
|
|
13
|
+
static readonly SYSTEM_ID = "system";
|
|
13
14
|
static readonly TOKENS_ID = "tokens";
|
|
14
15
|
authDB: RootDB<DBAuth, 'auth'>;
|
|
15
16
|
camerasDB: DB<DBCamera[], 'cameras'>;
|
|
16
17
|
pluginsDB: DB<DBPlugin[], 'plugins'>;
|
|
17
18
|
settingsDB: DB<DBSettings, 'settings'>;
|
|
18
19
|
usersDB: DB<DBUser[], 'users'>;
|
|
20
|
+
systemDB: DB<DBSystem, 'system'>;
|
|
19
21
|
private lowdb;
|
|
20
22
|
private databaseMigration;
|
|
21
23
|
private databases;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Database as DB } from 'lmdb';
|
|
2
2
|
import type { DetectionZone, ObjectClass } from '../../camera/types.js';
|
|
3
|
+
import type { UsableNetworkAddress } from '../../utils/network.js';
|
|
3
4
|
import type { CamviewSettingsLayoutMode, ClientData, JwtTokenEncoded } from '../types/index.js';
|
|
4
5
|
import type { Database } from './index.js';
|
|
5
6
|
export interface CameraUiDatabase {
|
|
@@ -38,6 +39,9 @@ export interface DBUser {
|
|
|
38
39
|
firstLogin: boolean;
|
|
39
40
|
preferences: DBUserPreferences;
|
|
40
41
|
}
|
|
42
|
+
export interface DBSystem {
|
|
43
|
+
serverAddresses: string[];
|
|
44
|
+
}
|
|
41
45
|
export type DBRoles = 'admin' | 'user';
|
|
42
46
|
export interface DBCameraShortcut {
|
|
43
47
|
readonly _id: string;
|
|
@@ -207,3 +211,11 @@ export interface CameraUiSettings {
|
|
|
207
211
|
streamingMode: VideoStreamingMode;
|
|
208
212
|
}
|
|
209
213
|
export type VideoStreamingMode = 'webrtc' | 'mse' | 'webrtc/tcp' | 'mjpeg' | 'hls' | 'mp4';
|
|
214
|
+
export interface SystemInfo extends DBSystem {
|
|
215
|
+
networkAddresses: UsableNetworkAddress[];
|
|
216
|
+
}
|
|
217
|
+
export interface PluginData {
|
|
218
|
+
pluginName: string;
|
|
219
|
+
id?: string;
|
|
220
|
+
version?: string;
|
|
221
|
+
}
|
|
@@ -101,13 +101,10 @@ export declare const iConfigSSLSchema: zod.ZodObject<{
|
|
|
101
101
|
addresses?: string[] | undefined;
|
|
102
102
|
}>;
|
|
103
103
|
export declare const pluginsSchema: zod.ZodObject<{
|
|
104
|
-
sudo: zod.ZodOptional<zod.ZodBoolean>;
|
|
105
104
|
disabledPlugins: zod.ZodOptional<zod.ZodArray<zod.ZodString, "many">>;
|
|
106
105
|
}, "strict", zod.ZodTypeAny, {
|
|
107
|
-
sudo?: boolean | undefined;
|
|
108
106
|
disabledPlugins?: string[] | undefined;
|
|
109
107
|
}, {
|
|
110
|
-
sudo?: boolean | undefined;
|
|
111
108
|
disabledPlugins?: string[] | undefined;
|
|
112
109
|
}>;
|
|
113
110
|
export declare const interfaceSettingsSchema: zod.ZodObject<{
|
|
@@ -144,13 +141,10 @@ export declare const patchConfigSchema: zod.ZodObject<{
|
|
|
144
141
|
disableTimestamps?: boolean | undefined;
|
|
145
142
|
}>;
|
|
146
143
|
plugins: zod.ZodDefault<zod.ZodObject<{
|
|
147
|
-
sudo: zod.ZodOptional<zod.ZodBoolean>;
|
|
148
144
|
disabledPlugins: zod.ZodOptional<zod.ZodArray<zod.ZodString, "many">>;
|
|
149
145
|
}, "strict", zod.ZodTypeAny, {
|
|
150
|
-
sudo?: boolean | undefined;
|
|
151
146
|
disabledPlugins?: string[] | undefined;
|
|
152
147
|
}, {
|
|
153
|
-
sudo?: boolean | undefined;
|
|
154
148
|
disabledPlugins?: string[] | undefined;
|
|
155
149
|
}>>;
|
|
156
150
|
settings: zod.ZodDefault<zod.ZodObject<{
|
|
@@ -162,7 +156,6 @@ export declare const patchConfigSchema: zod.ZodObject<{
|
|
|
162
156
|
}>>;
|
|
163
157
|
}, "strict", zod.ZodTypeAny, {
|
|
164
158
|
plugins: {
|
|
165
|
-
sudo?: boolean | undefined;
|
|
166
159
|
disabledPlugins?: string[] | undefined;
|
|
167
160
|
};
|
|
168
161
|
port: number;
|
|
@@ -190,7 +183,6 @@ export declare const patchConfigSchema: zod.ZodObject<{
|
|
|
190
183
|
disableTimestamps?: boolean | undefined;
|
|
191
184
|
};
|
|
192
185
|
plugins?: {
|
|
193
|
-
sudo?: boolean | undefined;
|
|
194
186
|
disabledPlugins?: string[] | undefined;
|
|
195
187
|
} | undefined;
|
|
196
188
|
port?: number | undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import zod from 'zod';
|
|
2
|
+
export declare const patchSystemSchema: zod.ZodObject<{
|
|
3
|
+
serverAddresses: zod.ZodOptional<zod.ZodArray<zod.ZodString, "many">>;
|
|
4
|
+
}, "strict", zod.ZodTypeAny, {
|
|
5
|
+
serverAddresses?: string[] | undefined;
|
|
6
|
+
}, {
|
|
7
|
+
serverAddresses?: string[] | undefined;
|
|
8
|
+
}>;
|
|
9
|
+
export type PatchSystemInput = zod.TypeOf<typeof patchSystemSchema>;
|
|
@@ -33,7 +33,7 @@ export declare const userPreferencesCamviewViewsLayout: zod.ZodObject<{
|
|
|
33
33
|
name: string;
|
|
34
34
|
type: "dnd" | "view";
|
|
35
35
|
_id: string;
|
|
36
|
-
viewSize: 1 | 4 | 6 | 7 |
|
|
36
|
+
viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
|
|
37
37
|
cameras: {
|
|
38
38
|
cameraId: string;
|
|
39
39
|
index: number;
|
|
@@ -41,7 +41,7 @@ export declare const userPreferencesCamviewViewsLayout: zod.ZodObject<{
|
|
|
41
41
|
}, {
|
|
42
42
|
name: string;
|
|
43
43
|
type: "dnd" | "view";
|
|
44
|
-
viewSize: 1 | 4 | 6 | 7 |
|
|
44
|
+
viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
|
|
45
45
|
cameras: {
|
|
46
46
|
cameraId: string;
|
|
47
47
|
index: number;
|
|
@@ -63,14 +63,14 @@ export declare const patchPreferencesCamviewViewsLayout: zod.ZodOptional<zod.Zod
|
|
|
63
63
|
}>, "many">>;
|
|
64
64
|
}, "strip", zod.ZodTypeAny, {
|
|
65
65
|
name?: string | undefined;
|
|
66
|
-
viewSize?: 1 | 4 | 6 | 7 |
|
|
66
|
+
viewSize?: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26 | undefined;
|
|
67
67
|
cameras?: {
|
|
68
68
|
cameraId: string;
|
|
69
69
|
index: number;
|
|
70
70
|
}[] | undefined;
|
|
71
71
|
}, {
|
|
72
72
|
name?: string | undefined;
|
|
73
|
-
viewSize?: 1 | 4 | 6 | 7 |
|
|
73
|
+
viewSize?: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26 | undefined;
|
|
74
74
|
cameras?: {
|
|
75
75
|
cameraId: string;
|
|
76
76
|
index: number;
|
|
@@ -96,7 +96,7 @@ export declare const userPreferencesCamview: zod.ZodObject<{
|
|
|
96
96
|
name: string;
|
|
97
97
|
type: "dnd" | "view";
|
|
98
98
|
_id: string;
|
|
99
|
-
viewSize: 1 | 4 | 6 | 7 |
|
|
99
|
+
viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
|
|
100
100
|
cameras: {
|
|
101
101
|
cameraId: string;
|
|
102
102
|
index: number;
|
|
@@ -104,7 +104,7 @@ export declare const userPreferencesCamview: zod.ZodObject<{
|
|
|
104
104
|
}, {
|
|
105
105
|
name: string;
|
|
106
106
|
type: "dnd" | "view";
|
|
107
|
-
viewSize: 1 | 4 | 6 | 7 |
|
|
107
|
+
viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
|
|
108
108
|
cameras: {
|
|
109
109
|
cameraId: string;
|
|
110
110
|
index: number;
|
|
@@ -116,7 +116,7 @@ export declare const userPreferencesCamview: zod.ZodObject<{
|
|
|
116
116
|
name: string;
|
|
117
117
|
type: "dnd" | "view";
|
|
118
118
|
_id: string;
|
|
119
|
-
viewSize: 1 | 4 | 6 | 7 |
|
|
119
|
+
viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
|
|
120
120
|
cameras: {
|
|
121
121
|
cameraId: string;
|
|
122
122
|
index: number;
|
|
@@ -126,7 +126,7 @@ export declare const userPreferencesCamview: zod.ZodObject<{
|
|
|
126
126
|
views: {
|
|
127
127
|
name: string;
|
|
128
128
|
type: "dnd" | "view";
|
|
129
|
-
viewSize: 1 | 4 | 6 | 7 |
|
|
129
|
+
viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
|
|
130
130
|
cameras: {
|
|
131
131
|
cameraId: string;
|
|
132
132
|
index: number;
|
|
@@ -256,7 +256,7 @@ export declare const userPreferences: zod.ZodObject<{
|
|
|
256
256
|
name: string;
|
|
257
257
|
type: "dnd" | "view";
|
|
258
258
|
_id: string;
|
|
259
|
-
viewSize: 1 | 4 | 6 | 7 |
|
|
259
|
+
viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
|
|
260
260
|
cameras: {
|
|
261
261
|
cameraId: string;
|
|
262
262
|
index: number;
|
|
@@ -264,7 +264,7 @@ export declare const userPreferences: zod.ZodObject<{
|
|
|
264
264
|
}, {
|
|
265
265
|
name: string;
|
|
266
266
|
type: "dnd" | "view";
|
|
267
|
-
viewSize: 1 | 4 | 6 | 7 |
|
|
267
|
+
viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
|
|
268
268
|
cameras: {
|
|
269
269
|
cameraId: string;
|
|
270
270
|
index: number;
|
|
@@ -276,7 +276,7 @@ export declare const userPreferences: zod.ZodObject<{
|
|
|
276
276
|
name: string;
|
|
277
277
|
type: "dnd" | "view";
|
|
278
278
|
_id: string;
|
|
279
|
-
viewSize: 1 | 4 | 6 | 7 |
|
|
279
|
+
viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
|
|
280
280
|
cameras: {
|
|
281
281
|
cameraId: string;
|
|
282
282
|
index: number;
|
|
@@ -286,7 +286,7 @@ export declare const userPreferences: zod.ZodObject<{
|
|
|
286
286
|
views: {
|
|
287
287
|
name: string;
|
|
288
288
|
type: "dnd" | "view";
|
|
289
|
-
viewSize: 1 | 4 | 6 | 7 |
|
|
289
|
+
viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
|
|
290
290
|
cameras: {
|
|
291
291
|
cameraId: string;
|
|
292
292
|
index: number;
|
|
@@ -358,7 +358,7 @@ export declare const userPreferences: zod.ZodObject<{
|
|
|
358
358
|
name: string;
|
|
359
359
|
type: "dnd" | "view";
|
|
360
360
|
_id: string;
|
|
361
|
-
viewSize: 1 | 4 | 6 | 7 |
|
|
361
|
+
viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
|
|
362
362
|
cameras: {
|
|
363
363
|
cameraId: string;
|
|
364
364
|
index: number;
|
|
@@ -380,7 +380,7 @@ export declare const userPreferences: zod.ZodObject<{
|
|
|
380
380
|
views: {
|
|
381
381
|
name: string;
|
|
382
382
|
type: "dnd" | "view";
|
|
383
|
-
viewSize: 1 | 4 | 6 | 7 |
|
|
383
|
+
viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
|
|
384
384
|
cameras: {
|
|
385
385
|
cameraId: string;
|
|
386
386
|
index: number;
|
|
@@ -420,7 +420,7 @@ export declare const createUserSchema: zod.ZodEffects<zod.ZodObject<{
|
|
|
420
420
|
name: string;
|
|
421
421
|
type: "dnd" | "view";
|
|
422
422
|
_id: string;
|
|
423
|
-
viewSize: 1 | 4 | 6 | 7 |
|
|
423
|
+
viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
|
|
424
424
|
cameras: {
|
|
425
425
|
cameraId: string;
|
|
426
426
|
index: number;
|
|
@@ -428,7 +428,7 @@ export declare const createUserSchema: zod.ZodEffects<zod.ZodObject<{
|
|
|
428
428
|
}, {
|
|
429
429
|
name: string;
|
|
430
430
|
type: "dnd" | "view";
|
|
431
|
-
viewSize: 1 | 4 | 6 | 7 |
|
|
431
|
+
viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
|
|
432
432
|
cameras: {
|
|
433
433
|
cameraId: string;
|
|
434
434
|
index: number;
|
|
@@ -440,7 +440,7 @@ export declare const createUserSchema: zod.ZodEffects<zod.ZodObject<{
|
|
|
440
440
|
name: string;
|
|
441
441
|
type: "dnd" | "view";
|
|
442
442
|
_id: string;
|
|
443
|
-
viewSize: 1 | 4 | 6 | 7 |
|
|
443
|
+
viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
|
|
444
444
|
cameras: {
|
|
445
445
|
cameraId: string;
|
|
446
446
|
index: number;
|
|
@@ -450,7 +450,7 @@ export declare const createUserSchema: zod.ZodEffects<zod.ZodObject<{
|
|
|
450
450
|
views: {
|
|
451
451
|
name: string;
|
|
452
452
|
type: "dnd" | "view";
|
|
453
|
-
viewSize: 1 | 4 | 6 | 7 |
|
|
453
|
+
viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
|
|
454
454
|
cameras: {
|
|
455
455
|
cameraId: string;
|
|
456
456
|
index: number;
|
|
@@ -522,7 +522,7 @@ export declare const createUserSchema: zod.ZodEffects<zod.ZodObject<{
|
|
|
522
522
|
name: string;
|
|
523
523
|
type: "dnd" | "view";
|
|
524
524
|
_id: string;
|
|
525
|
-
viewSize: 1 | 4 | 6 | 7 |
|
|
525
|
+
viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
|
|
526
526
|
cameras: {
|
|
527
527
|
cameraId: string;
|
|
528
528
|
index: number;
|
|
@@ -544,7 +544,7 @@ export declare const createUserSchema: zod.ZodEffects<zod.ZodObject<{
|
|
|
544
544
|
views: {
|
|
545
545
|
name: string;
|
|
546
546
|
type: "dnd" | "view";
|
|
547
|
-
viewSize: 1 | 4 | 6 | 7 |
|
|
547
|
+
viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
|
|
548
548
|
cameras: {
|
|
549
549
|
cameraId: string;
|
|
550
550
|
index: number;
|
|
@@ -579,7 +579,7 @@ export declare const createUserSchema: zod.ZodEffects<zod.ZodObject<{
|
|
|
579
579
|
name: string;
|
|
580
580
|
type: "dnd" | "view";
|
|
581
581
|
_id: string;
|
|
582
|
-
viewSize: 1 | 4 | 6 | 7 |
|
|
582
|
+
viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
|
|
583
583
|
cameras: {
|
|
584
584
|
cameraId: string;
|
|
585
585
|
index: number;
|
|
@@ -612,7 +612,7 @@ export declare const createUserSchema: zod.ZodEffects<zod.ZodObject<{
|
|
|
612
612
|
views: {
|
|
613
613
|
name: string;
|
|
614
614
|
type: "dnd" | "view";
|
|
615
|
-
viewSize: 1 | 4 | 6 | 7 |
|
|
615
|
+
viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
|
|
616
616
|
cameras: {
|
|
617
617
|
cameraId: string;
|
|
618
618
|
index: number;
|
|
@@ -647,7 +647,7 @@ export declare const createUserSchema: zod.ZodEffects<zod.ZodObject<{
|
|
|
647
647
|
name: string;
|
|
648
648
|
type: "dnd" | "view";
|
|
649
649
|
_id: string;
|
|
650
|
-
viewSize: 1 | 4 | 6 | 7 |
|
|
650
|
+
viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
|
|
651
651
|
cameras: {
|
|
652
652
|
cameraId: string;
|
|
653
653
|
index: number;
|
|
@@ -680,7 +680,7 @@ export declare const createUserSchema: zod.ZodEffects<zod.ZodObject<{
|
|
|
680
680
|
views: {
|
|
681
681
|
name: string;
|
|
682
682
|
type: "dnd" | "view";
|
|
683
|
-
viewSize: 1 | 4 | 6 | 7 |
|
|
683
|
+
viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
|
|
684
684
|
cameras: {
|
|
685
685
|
cameraId: string;
|
|
686
686
|
index: number;
|
|
@@ -734,7 +734,7 @@ export declare const patchUserSchema: zod.ZodEffects<zod.ZodObject<{
|
|
|
734
734
|
name: string;
|
|
735
735
|
type: "dnd" | "view";
|
|
736
736
|
_id: string;
|
|
737
|
-
viewSize: 1 | 4 | 6 | 7 |
|
|
737
|
+
viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
|
|
738
738
|
cameras: {
|
|
739
739
|
cameraId: string;
|
|
740
740
|
index: number;
|
|
@@ -742,7 +742,7 @@ export declare const patchUserSchema: zod.ZodEffects<zod.ZodObject<{
|
|
|
742
742
|
}, {
|
|
743
743
|
name: string;
|
|
744
744
|
type: "dnd" | "view";
|
|
745
|
-
viewSize: 1 | 4 | 6 | 7 |
|
|
745
|
+
viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
|
|
746
746
|
cameras: {
|
|
747
747
|
cameraId: string;
|
|
748
748
|
index: number;
|
|
@@ -754,7 +754,7 @@ export declare const patchUserSchema: zod.ZodEffects<zod.ZodObject<{
|
|
|
754
754
|
name: string;
|
|
755
755
|
type: "dnd" | "view";
|
|
756
756
|
_id: string;
|
|
757
|
-
viewSize: 1 | 4 | 6 | 7 |
|
|
757
|
+
viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
|
|
758
758
|
cameras: {
|
|
759
759
|
cameraId: string;
|
|
760
760
|
index: number;
|
|
@@ -764,7 +764,7 @@ export declare const patchUserSchema: zod.ZodEffects<zod.ZodObject<{
|
|
|
764
764
|
views: {
|
|
765
765
|
name: string;
|
|
766
766
|
type: "dnd" | "view";
|
|
767
|
-
viewSize: 1 | 4 | 6 | 7 |
|
|
767
|
+
viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
|
|
768
768
|
cameras: {
|
|
769
769
|
cameraId: string;
|
|
770
770
|
index: number;
|
|
@@ -836,7 +836,7 @@ export declare const patchUserSchema: zod.ZodEffects<zod.ZodObject<{
|
|
|
836
836
|
name: string;
|
|
837
837
|
type: "dnd" | "view";
|
|
838
838
|
_id: string;
|
|
839
|
-
viewSize: 1 | 4 | 6 | 7 |
|
|
839
|
+
viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
|
|
840
840
|
cameras: {
|
|
841
841
|
cameraId: string;
|
|
842
842
|
index: number;
|
|
@@ -858,7 +858,7 @@ export declare const patchUserSchema: zod.ZodEffects<zod.ZodObject<{
|
|
|
858
858
|
views: {
|
|
859
859
|
name: string;
|
|
860
860
|
type: "dnd" | "view";
|
|
861
|
-
viewSize: 1 | 4 | 6 | 7 |
|
|
861
|
+
viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
|
|
862
862
|
cameras: {
|
|
863
863
|
cameraId: string;
|
|
864
864
|
index: number;
|
|
@@ -893,7 +893,7 @@ export declare const patchUserSchema: zod.ZodEffects<zod.ZodObject<{
|
|
|
893
893
|
name: string;
|
|
894
894
|
type: "dnd" | "view";
|
|
895
895
|
_id: string;
|
|
896
|
-
viewSize: 1 | 4 | 6 | 7 |
|
|
896
|
+
viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
|
|
897
897
|
cameras: {
|
|
898
898
|
cameraId: string;
|
|
899
899
|
index: number;
|
|
@@ -926,7 +926,7 @@ export declare const patchUserSchema: zod.ZodEffects<zod.ZodObject<{
|
|
|
926
926
|
views: {
|
|
927
927
|
name: string;
|
|
928
928
|
type: "dnd" | "view";
|
|
929
|
-
viewSize: 1 | 4 | 6 | 7 |
|
|
929
|
+
viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
|
|
930
930
|
cameras: {
|
|
931
931
|
cameraId: string;
|
|
932
932
|
index: number;
|
|
@@ -961,7 +961,7 @@ export declare const patchUserSchema: zod.ZodEffects<zod.ZodObject<{
|
|
|
961
961
|
name: string;
|
|
962
962
|
type: "dnd" | "view";
|
|
963
963
|
_id: string;
|
|
964
|
-
viewSize: 1 | 4 | 6 | 7 |
|
|
964
|
+
viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
|
|
965
965
|
cameras: {
|
|
966
966
|
cameraId: string;
|
|
967
967
|
index: number;
|
|
@@ -994,7 +994,7 @@ export declare const patchUserSchema: zod.ZodEffects<zod.ZodObject<{
|
|
|
994
994
|
views: {
|
|
995
995
|
name: string;
|
|
996
996
|
type: "dnd" | "view";
|
|
997
|
-
viewSize: 1 | 4 | 6 | 7 |
|
|
997
|
+
viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
|
|
998
998
|
cameras: {
|
|
999
999
|
cameraId: string;
|
|
1000
1000
|
index: number;
|
|
@@ -9,6 +9,7 @@ import type { CreateCameraInput, PatchCameraInput, PreviewCameraInput } from '..
|
|
|
9
9
|
import type { PatchConfigInput } from '../schemas/config.schema.js';
|
|
10
10
|
import type { PatchGo2RtcConfigInput } from '../schemas/go2rtc.schema.js';
|
|
11
11
|
import type { DetectAudioInput, DetectMotionInput, DetectObjectInput } from '../schemas/plugins.schema.js';
|
|
12
|
+
import type { PatchSystemInput } from '../schemas/system.schema.js';
|
|
12
13
|
import type { CreateShortcutInput, CreateUserInput, CreateViewInput, LoginUserInput, PatchShortcutInput, PatchUserInput, PatchViewInput } from '../schemas/users.schema.js';
|
|
13
14
|
export interface BusboyFileStream extends Readable {
|
|
14
15
|
truncated: boolean;
|
|
@@ -351,6 +352,9 @@ export type UsersPatchRequest = {
|
|
|
351
352
|
avatar: string;
|
|
352
353
|
};
|
|
353
354
|
};
|
|
355
|
+
export type SystemPatchRequest = {
|
|
356
|
+
Body: PatchSystemInput;
|
|
357
|
+
};
|
|
354
358
|
export type ViewsParamsRequest = {
|
|
355
359
|
Params: {
|
|
356
360
|
viewid: string;
|
|
@@ -4,7 +4,6 @@ import { CameraPTZInterface } from './interfaces/ptz.js';
|
|
|
4
4
|
import type { Camera } from '../api/database/types.js';
|
|
5
5
|
import type { MotionFrame, VideoFrame } from '../decoder/types.js';
|
|
6
6
|
import type { ProxyServer } from '../nats/index.js';
|
|
7
|
-
import type { IceServer } from '../services/config/types.js';
|
|
8
7
|
import type { BaseLogger, CameraConfigInputSettings, CameraDelegate, CameraSource, Container, PrebufferState, SetValues } from './types.js';
|
|
9
8
|
export declare class CameraController extends CameraDevice {
|
|
10
9
|
proxy: ProxyServer;
|
|
@@ -21,12 +20,10 @@ export declare class CameraController extends CameraDevice {
|
|
|
21
20
|
get sources(): CameraSource[];
|
|
22
21
|
constructor(camera: Camera, logger: BaseLogger, proxy: ProxyServer);
|
|
23
22
|
setDelegate(): void;
|
|
24
|
-
getFfmpegPath(): Promise<string>;
|
|
25
23
|
getFrames(): AsyncIterableIterator<VideoFrame>;
|
|
26
24
|
getMotionFrames(): AsyncIterableIterator<MotionFrame>;
|
|
27
25
|
connect(): Promise<void>;
|
|
28
26
|
disconnect(): Promise<void>;
|
|
29
|
-
getIceServers(): Promise<IceServer[]>;
|
|
30
27
|
updateState<T extends keyof SetValues>(stateName: T, eventData: SetValues[T]): Promise<void>;
|
|
31
28
|
addCameraSource(source: CameraConfigInputSettings): Promise<void>;
|
|
32
29
|
updateCameraSource(sourceId: string, source: Partial<CameraConfigInputSettings>): Promise<void>;
|
|
@@ -13,7 +13,6 @@ export declare abstract class CameraDevice extends BaseCameraDevice {
|
|
|
13
13
|
abstract disconnect(): Promise<void>;
|
|
14
14
|
abstract getFrames(prebufferDuration?: number): AsyncIterableIterator<VideoFrame>;
|
|
15
15
|
abstract getMotionFrames(): AsyncIterableIterator<MotionFrame>;
|
|
16
|
-
abstract getFfmpegPath(): Promise<string>;
|
|
17
16
|
abstract updateState(stateName: 'light', eventData: LightSetEvent): Promise<void>;
|
|
18
17
|
abstract updateState(stateName: 'motion', eventData: MotionSetEvent, frame?: VideoFrame): Promise<void>;
|
|
19
18
|
abstract updateState(stateName: 'audio', eventData: AudioSetEvent): Promise<void>;
|
|
@@ -3,7 +3,6 @@ import { BehaviorSubject } from 'rxjs';
|
|
|
3
3
|
import { Subscribed } from '../utils/subscribed.js';
|
|
4
4
|
import type { Observable } from 'rxjs';
|
|
5
5
|
import type { Camera, CameraActivitySettings, CameraFrameWorkerSettings, CameraInformation, CameraType } from '../api/database/types.js';
|
|
6
|
-
import type { IceServer } from '../services/config/types.js';
|
|
7
6
|
import type { AudioSetEvent, AudioState, BaseLogger, BatterySetEvent, BatteryState, CameraDelegate, CameraPTZDelegate, CameraPrebufferDelegate, CameraSource, Container, DetectionZone, DoorbellSetEvent, DoorbellState, LightSetEvent, LightState, MotionSetEvent, MotionState, ObjectSetEvent, ObjectState, PrebufferState, PrebufferSubject, SetValues, SirenSetEvent, SirenState, StateValues } from './types.js';
|
|
8
7
|
export declare abstract class BaseCameraDevice extends Subscribed {
|
|
9
8
|
protected logger: BaseLogger;
|
|
@@ -59,7 +58,6 @@ export declare abstract class BaseCameraDevice extends Subscribed {
|
|
|
59
58
|
get ptz(): CameraPTZDelegate;
|
|
60
59
|
abstract get sources(): CameraSource[];
|
|
61
60
|
constructor(camera: Camera, logger: BaseLogger);
|
|
62
|
-
abstract getIceServers(): Promise<IceServer[]>;
|
|
63
61
|
protected abstract cleanup(): void;
|
|
64
62
|
getValue<T extends keyof StateValues>(stateName: T): StateValues[T];
|
|
65
63
|
snapshot(forceNew?: boolean): Promise<ArrayBuffer | undefined>;
|
|
@@ -20,6 +20,7 @@ export interface BasicPeerConnection {
|
|
|
20
20
|
}
|
|
21
21
|
export interface StreamingConnectionOptions {
|
|
22
22
|
createPeerConnection?: () => BasicPeerConnection;
|
|
23
|
+
iceServers?: IceServer[];
|
|
23
24
|
}
|
|
24
25
|
export declare class WeriftPeerConnection extends Subscribed implements BasicPeerConnection {
|
|
25
26
|
onAudioRtp: Subject<RtpPacket>;
|
|
@@ -33,7 +34,7 @@ export declare class WeriftPeerConnection extends Subscribed implements BasicPee
|
|
|
33
34
|
private cameraDevice;
|
|
34
35
|
private logger;
|
|
35
36
|
private pc;
|
|
36
|
-
constructor(cameraDevice: CameraDevice, iceServers: IceServer[], logger: BaseLogger);
|
|
37
|
+
constructor(cameraDevice: CameraDevice, iceServers: IceServer[] | undefined, logger: BaseLogger);
|
|
37
38
|
createOffer(): Promise<RTCSessionDescription>;
|
|
38
39
|
acceptAnswer(answer: {
|
|
39
40
|
type: 'answer';
|
|
@@ -2,7 +2,6 @@ import { ReplaySubject, Subject } from 'rxjs';
|
|
|
2
2
|
import { Subscribed } from '../../utils/subscribed.js';
|
|
3
3
|
import type { Observable } from 'rxjs';
|
|
4
4
|
import type { RtpPacket } from 'werift';
|
|
5
|
-
import type { IceServer } from '../../services/config/types.js';
|
|
6
5
|
import type { CameraDevice } from '../device.js';
|
|
7
6
|
import type { BaseLogger } from '../types.js';
|
|
8
7
|
import type { StreamingConnectionOptions } from './peer-connection.js';
|
|
@@ -23,7 +22,7 @@ export declare class WebrtcConnection extends Subscribed {
|
|
|
23
22
|
private hasEnded;
|
|
24
23
|
private cameraDevice;
|
|
25
24
|
private logger;
|
|
26
|
-
constructor(cameraDevice: CameraDevice, sourceName: string,
|
|
25
|
+
constructor(cameraDevice: CameraDevice, sourceName: string, logger: BaseLogger, options: StreamingConnectionOptions);
|
|
27
26
|
sendAudioPacket(rtp: RtpPacket): void;
|
|
28
27
|
stop(): void;
|
|
29
28
|
requestKeyFrame(): void;
|
|
@@ -29,6 +29,7 @@ export declare class WeriftSession extends Subscribed {
|
|
|
29
29
|
reservePort(bufferPorts?: number): Promise<number>;
|
|
30
30
|
startTranscoding(ffmpegOptions: FfmpegOptions): Promise<void>;
|
|
31
31
|
transcodeReturnAudio(ffmpegOptions: {
|
|
32
|
+
ffmpegPath: string;
|
|
32
33
|
input: SpawnInput[];
|
|
33
34
|
}): Promise<void>;
|
|
34
35
|
stop(): void;
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { ProxyConnection } from './connection.js';
|
|
2
2
|
import { CameraDeviceProxy } from './proxy/cameraDevice.js';
|
|
3
|
+
import { CoreManagerProxy } from './proxy/coreManager.js';
|
|
3
4
|
import { DeviceManagerProxy } from './proxy/deviceManager.js';
|
|
4
5
|
import { NatsServer } from './server.js';
|
|
5
6
|
import type { StateValues } from '../camera/types.js';
|
|
6
7
|
import type { CameraStorage } from '../polyglot/node/plugins/cameraStorage.js';
|
|
7
8
|
import type { MethodKeys, MethodType } from '../types.js';
|
|
8
9
|
import type { ProxySubscription } from './subscription.js';
|
|
9
|
-
import type { CameraDeviceListenerMessagePayload, DeviceManagerProxyEvents, PluginMap, ProxyAuth } from './types.js';
|
|
10
|
+
import type { CameraDeviceListenerMessagePayload, CoreManagerProxyEvents, DeviceManagerProxyEvents, PluginMap, ProxyAuth } from './types.js';
|
|
10
11
|
import type { WebsocketProxy } from './websocket.js';
|
|
11
12
|
export declare class ProxyServer {
|
|
12
13
|
private api;
|
|
13
14
|
private logger;
|
|
15
|
+
coreManagerProxy?: CoreManagerProxy;
|
|
14
16
|
deviceManagerProxy?: DeviceManagerProxy;
|
|
15
17
|
cameraDeviceProxy?: CameraDeviceProxy;
|
|
16
18
|
websocketProxy?: WebsocketProxy;
|
|
@@ -24,6 +26,7 @@ export declare class ProxyServer {
|
|
|
24
26
|
constructor();
|
|
25
27
|
initialize(): Promise<void>;
|
|
26
28
|
close(): Promise<void>;
|
|
29
|
+
publishCoreManagerEvent<K extends keyof CoreManagerProxyEvents>(type: K, data: CoreManagerProxyEvents[K]): void;
|
|
27
30
|
publishDeviceManagerEvent<K extends keyof DeviceManagerProxyEvents>(targetId: string, type: K, data: DeviceManagerProxyEvents[K]): void;
|
|
28
31
|
publishCameraEvent<K extends keyof StateValues>(cameraId: string, stateName: K, data: {
|
|
29
32
|
newEvent: StateValues[K];
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { CameraConfigInputSettings, CameraInterfaces, Container, PrebufferState, SetValues } from '../../camera/types.js';
|
|
2
|
-
import type { IceServer } from '../../services/config/types.js';
|
|
3
2
|
import type { MethodKeys, MethodType } from '../../types.js';
|
|
4
3
|
import type { MessageQueue } from '../messageQueue.js';
|
|
5
4
|
import type { CameraDeviceProxyMethods, ProxyMessageStructure, RefreshedStates } from '../types.js';
|
|
@@ -12,8 +11,6 @@ export declare class CameraDeviceProxy implements CameraDeviceProxyMethods {
|
|
|
12
11
|
constructor(messageQueue: MessageQueue);
|
|
13
12
|
connect(cameraId: string, pluginId: string): void;
|
|
14
13
|
disconnect(cameraId: string, pluginId: string): void;
|
|
15
|
-
getFfmpegPath(): string;
|
|
16
|
-
getIceServers(): IceServer[];
|
|
17
14
|
updateState<T extends keyof SetValues>(stateName: T, eventData: SetValues[T], cameraId: string, pluginId: string): Promise<void>;
|
|
18
15
|
updatePrebufferState(sourceId: string, container: Container, state: PrebufferState, cameraId: string, pluginId: string): Promise<void>;
|
|
19
16
|
addCameraSource(source: CameraConfigInputSettings, cameraId: string, pluginId: string): Promise<void>;
|