@camera.ui/browser 0.0.82 → 0.0.84
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/proxy/cameraDevice.d.ts +3 -7
- package/dist/types/server/src/api/database/types.d.ts +7 -7
- package/dist/types/server/src/api/go2rtc/api/streams.d.ts +4 -4
- package/dist/types/server/src/api/go2rtc/types.d.ts +6 -2
- package/dist/types/server/src/api/schemas/backup.schema.d.ts +3 -3
- package/dist/types/server/src/api/schemas/cameras.schema.d.ts +115 -88
- package/dist/types/server/src/api/schemas/plugins.schema.d.ts +29 -32
- package/dist/types/server/src/api/schemas/users.schema.d.ts +11 -6
- package/dist/types/server/src/api/services/cameras.service.d.ts +7 -5
- package/dist/types/server/src/api/types/index.d.ts +13 -3
- package/dist/types/server/src/api/websocket/nsp/metrics.d.ts +4 -22
- package/dist/types/server/src/api/websocket/nsp/status.d.ts +4 -15
- package/dist/types/server/src/api/websocket/types.d.ts +25 -64
- package/dist/types/server/src/api.d.ts +2 -2
- package/dist/types/server/src/camera/controller.d.ts +9 -4
- package/dist/types/server/src/camera/device.d.ts +15 -3
- package/dist/types/server/src/camera/index.d.ts +18 -39
- package/dist/types/server/src/camera/interfaces/camera.d.ts +0 -1
- package/dist/types/server/src/camera/streaming/werift-session.d.ts +10 -1
- package/dist/types/server/src/camera/types.d.ts +1 -3
- package/dist/types/server/src/camera/videoFrame.d.ts +3 -3
- package/dist/types/server/src/decoder/types.d.ts +5 -12
- package/dist/types/server/src/decoder/worker.d.ts +4 -7
- package/dist/types/server/src/nats/connection.d.ts +17 -0
- package/dist/types/server/src/nats/error.d.ts +9 -0
- package/dist/types/server/src/nats/index.d.ts +6 -4
- package/dist/types/server/src/nats/messageQueue.d.ts +7 -4
- package/dist/types/server/src/nats/proxy/cameraDevice.d.ts +1 -1
- package/dist/types/server/src/nats/proxy/deviceManager.d.ts +3 -3
- package/dist/types/server/src/nats/server.d.ts +0 -1
- package/dist/types/server/src/nats/subscription.d.ts +12 -0
- package/dist/types/server/src/nats/types.d.ts +25 -40
- package/dist/types/server/src/nats/utils.d.ts +2 -4
- package/dist/types/server/src/plugins/index.d.ts +3 -5
- package/dist/types/server/src/plugins/plugin.d.ts +4 -13
- package/dist/types/server/src/plugins/types.d.ts +14 -41
- package/dist/types/server/src/plugins/worker.d.ts +1 -1
- package/dist/types/server/src/polyglot/node/plugins/cameraStorage.d.ts +10 -11
- package/dist/types/server/src/polyglot/node/plugins/{api.d.ts → pluginApi.d.ts} +9 -12
- package/dist/types/server/src/polyglot/node/plugins/{logger.d.ts → pluginLogger.d.ts} +2 -0
- package/dist/types/server/src/polyglot/node/plugins/proxy/cameraDevice.d.ts +8 -11
- package/dist/types/server/src/polyglot/node/plugins/proxy/deviceManager.d.ts +6 -8
- package/dist/types/server/src/polyglot/node/plugins/schema.d.ts +22 -9
- package/dist/types/server/src/polyglot/node/plugins/storageController.d.ts +5 -5
- package/dist/types/server/src/services/config/index.d.ts +9 -6
- package/dist/types/server/src/services/config/types.d.ts +5 -5
- package/dist/types/server/src/services/logger/index.d.ts +2 -0
- package/dist/types/server/src/utils/ffmpeg.d.ts +2 -0
- package/dist/types/server/src/utils/pythonInstaller.d.ts +1 -1
- package/dist/types/server/src/utils/subscribed.d.ts +4 -4
- package/package.json +5 -5
- package/dist/types/server/src/api/controllers/api.controller.d.ts +0 -6
- package/dist/types/server/src/api/controllers/auth.controller.d.ts +0 -20
- package/dist/types/server/src/api/controllers/backup.controller.d.ts +0 -10
- package/dist/types/server/src/api/controllers/cameras.controller.d.ts +0 -34
- package/dist/types/server/src/api/controllers/config.controller.d.ts +0 -14
- package/dist/types/server/src/api/controllers/files.controller.d.ts +0 -8
- package/dist/types/server/src/api/controllers/frameWorkers.controller.d.ts +0 -16
- package/dist/types/server/src/api/controllers/plugins.controller.d.ts +0 -59
- package/dist/types/server/src/api/controllers/system.controller.d.ts +0 -14
- package/dist/types/server/src/api/controllers/users.controller.d.ts +0 -28
- package/dist/types/server/src/api/index.d.ts +0 -21
- package/dist/types/server/src/api/middlewares/authPermission.middleware.d.ts +0 -5
- package/dist/types/server/src/api/middlewares/authValidation.middleware.d.ts +0 -4
- package/dist/types/server/src/api/middlewares/pagination.middleware.d.ts +0 -3
- package/dist/types/server/src/api/plugins/cameraui.plugin.d.ts +0 -11
- package/dist/types/server/src/api/plugins/database.plugin.d.ts +0 -11
- package/dist/types/server/src/api/plugins/go2rtc.plugin.d.ts +0 -11
- package/dist/types/server/src/api/plugins/logger.plugin.d.ts +0 -7
- package/dist/types/server/src/api/plugins/socket.plugin.d.ts +0 -11
- package/dist/types/server/src/api/plugins/system.plugin.d.ts +0 -21
- package/dist/types/server/src/api/plugins/useragent.plugin.d.ts +0 -8
- package/dist/types/server/src/api/routes/api.routes.d.ts +0 -2
- package/dist/types/server/src/api/routes/auth.routes.d.ts +0 -2
- package/dist/types/server/src/api/routes/backup.routes.d.ts +0 -2
- package/dist/types/server/src/api/routes/cameras.routes.d.ts +0 -2
- package/dist/types/server/src/api/routes/config.routes.d.ts +0 -2
- package/dist/types/server/src/api/routes/files.routes.d.ts +0 -2
- package/dist/types/server/src/api/routes/frameWorkers.routes.d.ts +0 -2
- package/dist/types/server/src/api/routes/index.d.ts +0 -6
- package/dist/types/server/src/api/routes/plugins.routes.d.ts +0 -2
- package/dist/types/server/src/api/routes/system.routes.d.ts +0 -2
- package/dist/types/server/src/api/routes/users.routes.d.ts +0 -2
- package/dist/types/server/src/api/services/backup.service.d.ts +0 -11
- package/dist/types/server/src/api/utils/cert.d.ts +0 -11
- package/dist/types/server/src/api/utils/fetch.d.ts +0 -2
- package/dist/types/server/src/api/utils/moveFiles.d.ts +0 -1
- package/dist/types/server/src/api/utils/parse.d.ts +0 -2
- package/dist/types/server/src/decoder/ffmpeg.d.ts +0 -2
- package/dist/types/server/src/main.d.ts +0 -21
- package/dist/types/server/src/nats/proxy/index.d.ts +0 -2
- package/dist/types/server/src/polyglot/node/plugins/proxy/index.d.ts +0 -2
- package/dist/types/server/src/polyglot/node/plugins/proxy/messageQueue.d.ts +0 -20
- /package/dist/types/server/src/polyglot/node/plugins/{config.d.ts → configService.d.ts} +0 -0
|
@@ -138,7 +138,7 @@ export declare const userPreferencesCameraShortcutLayout: zod.ZodObject<{
|
|
|
138
138
|
_id: zod.ZodEffects<zod.ZodDefault<zod.ZodString>, string, string | undefined>;
|
|
139
139
|
cameraId: zod.ZodString;
|
|
140
140
|
coords: zod.ZodObject<{
|
|
141
|
-
_id: zod.ZodDefault<zod.ZodString>;
|
|
141
|
+
_id: zod.ZodEffects<zod.ZodDefault<zod.ZodString>, string, string | undefined>;
|
|
142
142
|
points: zod.ZodTuple<[zod.ZodNumber, zod.ZodNumber], null>;
|
|
143
143
|
}, "strip", zod.ZodTypeAny, {
|
|
144
144
|
_id: string;
|
|
@@ -165,7 +165,7 @@ export declare const userPreferencesCameraShortcutLayout: zod.ZodObject<{
|
|
|
165
165
|
export declare const patchPreferencesCameraShortcutLayout: zod.ZodOptional<zod.ZodObject<{
|
|
166
166
|
cameraId: zod.ZodOptional<zod.ZodString>;
|
|
167
167
|
coords: zod.ZodOptional<zod.ZodObject<{
|
|
168
|
-
_id: zod.ZodDefault<zod.ZodString>;
|
|
168
|
+
_id: zod.ZodEffects<zod.ZodDefault<zod.ZodString>, string, string | undefined>;
|
|
169
169
|
points: zod.ZodTuple<[zod.ZodNumber, zod.ZodNumber], null>;
|
|
170
170
|
}, "strip", zod.ZodTypeAny, {
|
|
171
171
|
_id: string;
|
|
@@ -192,7 +192,7 @@ export declare const userPreferencesCameras: zod.ZodObject<{
|
|
|
192
192
|
_id: zod.ZodEffects<zod.ZodDefault<zod.ZodString>, string, string | undefined>;
|
|
193
193
|
cameraId: zod.ZodString;
|
|
194
194
|
coords: zod.ZodObject<{
|
|
195
|
-
_id: zod.ZodDefault<zod.ZodString>;
|
|
195
|
+
_id: zod.ZodEffects<zod.ZodDefault<zod.ZodString>, string, string | undefined>;
|
|
196
196
|
points: zod.ZodTuple<[zod.ZodNumber, zod.ZodNumber], null>;
|
|
197
197
|
}, "strip", zod.ZodTypeAny, {
|
|
198
198
|
_id: string;
|
|
@@ -299,7 +299,7 @@ export declare const userPreferences: zod.ZodObject<{
|
|
|
299
299
|
_id: zod.ZodEffects<zod.ZodDefault<zod.ZodString>, string, string | undefined>;
|
|
300
300
|
cameraId: zod.ZodString;
|
|
301
301
|
coords: zod.ZodObject<{
|
|
302
|
-
_id: zod.ZodDefault<zod.ZodString>;
|
|
302
|
+
_id: zod.ZodEffects<zod.ZodDefault<zod.ZodString>, string, string | undefined>;
|
|
303
303
|
points: zod.ZodTuple<[zod.ZodNumber, zod.ZodNumber], null>;
|
|
304
304
|
}, "strip", zod.ZodTypeAny, {
|
|
305
305
|
_id: string;
|
|
@@ -463,7 +463,7 @@ export declare const createUserSchema: zod.ZodEffects<zod.ZodObject<{
|
|
|
463
463
|
_id: zod.ZodEffects<zod.ZodDefault<zod.ZodString>, string, string | undefined>;
|
|
464
464
|
cameraId: zod.ZodString;
|
|
465
465
|
coords: zod.ZodObject<{
|
|
466
|
-
_id: zod.ZodDefault<zod.ZodString>;
|
|
466
|
+
_id: zod.ZodEffects<zod.ZodDefault<zod.ZodString>, string, string | undefined>;
|
|
467
467
|
points: zod.ZodTuple<[zod.ZodNumber, zod.ZodNumber], null>;
|
|
468
468
|
}, "strip", zod.ZodTypeAny, {
|
|
469
469
|
_id: string;
|
|
@@ -704,6 +704,7 @@ export declare const loginUserSchema: zod.ZodObject<{
|
|
|
704
704
|
rememberMe?: boolean | undefined;
|
|
705
705
|
}>;
|
|
706
706
|
export declare const patchUserSchema: zod.ZodEffects<zod.ZodObject<{
|
|
707
|
+
username: zod.ZodOptional<zod.ZodString>;
|
|
707
708
|
password: zod.ZodOptional<zod.ZodString>;
|
|
708
709
|
passwordConfirm: zod.ZodOptional<zod.ZodString>;
|
|
709
710
|
role: zod.ZodOptional<zod.ZodUnion<[zod.ZodLiteral<"admin">, zod.ZodLiteral<"user">]>>;
|
|
@@ -776,7 +777,7 @@ export declare const patchUserSchema: zod.ZodEffects<zod.ZodObject<{
|
|
|
776
777
|
_id: zod.ZodEffects<zod.ZodDefault<zod.ZodString>, string, string | undefined>;
|
|
777
778
|
cameraId: zod.ZodString;
|
|
778
779
|
coords: zod.ZodObject<{
|
|
779
|
-
_id: zod.ZodDefault<zod.ZodString>;
|
|
780
|
+
_id: zod.ZodEffects<zod.ZodDefault<zod.ZodString>, string, string | undefined>;
|
|
780
781
|
points: zod.ZodTuple<[zod.ZodNumber, zod.ZodNumber], null>;
|
|
781
782
|
}, "strip", zod.ZodTypeAny, {
|
|
782
783
|
_id: string;
|
|
@@ -869,6 +870,7 @@ export declare const patchUserSchema: zod.ZodEffects<zod.ZodObject<{
|
|
|
869
870
|
}, "strict", zod.ZodTypeAny, {
|
|
870
871
|
password?: string | undefined;
|
|
871
872
|
upload?: MultipartFile | File | undefined;
|
|
873
|
+
username?: string | undefined;
|
|
872
874
|
passwordConfirm?: string | undefined;
|
|
873
875
|
role?: "user" | "admin" | undefined;
|
|
874
876
|
sessionTimer?: number | undefined;
|
|
@@ -902,6 +904,7 @@ export declare const patchUserSchema: zod.ZodEffects<zod.ZodObject<{
|
|
|
902
904
|
}, {
|
|
903
905
|
password?: string | undefined;
|
|
904
906
|
upload?: MultipartFile | File | undefined;
|
|
907
|
+
username?: string | undefined;
|
|
905
908
|
passwordConfirm?: string | undefined;
|
|
906
909
|
role?: "user" | "admin" | undefined;
|
|
907
910
|
sessionTimer?: number | undefined;
|
|
@@ -935,6 +938,7 @@ export declare const patchUserSchema: zod.ZodEffects<zod.ZodObject<{
|
|
|
935
938
|
}>, {
|
|
936
939
|
password?: string | undefined;
|
|
937
940
|
upload?: MultipartFile | File | undefined;
|
|
941
|
+
username?: string | undefined;
|
|
938
942
|
passwordConfirm?: string | undefined;
|
|
939
943
|
role?: "user" | "admin" | undefined;
|
|
940
944
|
sessionTimer?: number | undefined;
|
|
@@ -968,6 +972,7 @@ export declare const patchUserSchema: zod.ZodEffects<zod.ZodObject<{
|
|
|
968
972
|
}, {
|
|
969
973
|
password?: string | undefined;
|
|
970
974
|
upload?: MultipartFile | File | undefined;
|
|
975
|
+
username?: string | undefined;
|
|
971
976
|
passwordConfirm?: string | undefined;
|
|
972
977
|
role?: "user" | "admin" | undefined;
|
|
973
978
|
sessionTimer?: number | undefined;
|
|
@@ -29,13 +29,14 @@ export declare class CamerasService {
|
|
|
29
29
|
findByPluginAndName(cameraname: string, pluginId: string): DBCamera | undefined;
|
|
30
30
|
findTransformedByPluginAndName(cameraname: string, pluginId: string): Camera | undefined;
|
|
31
31
|
patchCameraByName(cameraname: string, cameraData: DeepPartial<DBCamera>): Promise<DBCamera | undefined>;
|
|
32
|
-
enableExtensionByName(cameraname: string,
|
|
33
|
-
disableExtensionByName(cameraname: string,
|
|
34
|
-
addExtensionByName(cameraname: string,
|
|
35
|
-
removeExtensionByName(cameraname: string,
|
|
36
|
-
removeExtension(
|
|
32
|
+
enableExtensionByName(cameraname: string, pluginNameOrId: string, extensionType: CameraExtension): Promise<DBCamera | undefined>;
|
|
33
|
+
disableExtensionByName(cameraname: string, pluginNameOrId: string, extensionType: CameraExtension): Promise<DBCamera | undefined>;
|
|
34
|
+
addExtensionByName(cameraname: string, pluginNameOrId: string): Promise<DBCamera | undefined>;
|
|
35
|
+
removeExtensionByName(cameraname: string, pluginNameOrId: string): Promise<DBCamera | undefined>;
|
|
36
|
+
removeExtension(pluginNameOrId: string): Promise<void>;
|
|
37
37
|
removeByName(cameraname: string): Promise<void>;
|
|
38
38
|
removeById(id: string): Promise<void>;
|
|
39
|
+
removeByPluginName(pluginName: string): Promise<void>;
|
|
39
40
|
removeByPluginId(pluginId: string): Promise<void>;
|
|
40
41
|
removeByPluginIdAndName(cameraname: string, pluginId: string): Promise<void>;
|
|
41
42
|
removeAll(): Promise<void>;
|
|
@@ -49,6 +50,7 @@ export declare class CamerasService {
|
|
|
49
50
|
private generateFFmpegUrls;
|
|
50
51
|
private generateWWWUrls;
|
|
51
52
|
private extensionIsEnabled;
|
|
53
|
+
private defaultZone;
|
|
52
54
|
private convertToDetectionZones;
|
|
53
55
|
}
|
|
54
56
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Readable } from 'node:stream';
|
|
2
|
-
import type {
|
|
2
|
+
import type { AuthConfig } from '../../decoder/types.js';
|
|
3
|
+
import type { CameraExtension, PLUGIN_STATUS, PluginContract, RootSchema } from '../../plugins/types.js';
|
|
3
4
|
import type { LoggingLevel } from '../../services/config/types.js';
|
|
4
5
|
import type { CameraExtensions, CameraZone, DBCamera, DBCamviewLayout, DBRoles, DBUser } from '../database/types.js';
|
|
5
6
|
import type { ApplicationResponse } from '../go2rtc/types.js';
|
|
@@ -131,7 +132,7 @@ export interface PluginExtension {
|
|
|
131
132
|
externPlugin?: boolean;
|
|
132
133
|
}
|
|
133
134
|
export interface PluginExtensionConfig extends PluginExtension {
|
|
134
|
-
rootSchema?:
|
|
135
|
+
rootSchema?: RootSchema;
|
|
135
136
|
config?: Record<string, any>;
|
|
136
137
|
}
|
|
137
138
|
export interface ExtensionsResponse {
|
|
@@ -163,7 +164,11 @@ export interface Go2RtcInfo {
|
|
|
163
164
|
wsURL: string;
|
|
164
165
|
port: number;
|
|
165
166
|
info: ApplicationResponse;
|
|
166
|
-
auth: Go2RtcInfoAuth
|
|
167
|
+
auth: Partial<Go2RtcInfoAuth>;
|
|
168
|
+
}
|
|
169
|
+
export interface NatsInfo {
|
|
170
|
+
servers: string[];
|
|
171
|
+
auth: AuthConfig;
|
|
167
172
|
}
|
|
168
173
|
export interface TokenClientDataResponse {
|
|
169
174
|
pagination: Pagination;
|
|
@@ -250,6 +255,11 @@ export type CamerasPatchRequest = {
|
|
|
250
255
|
export type ExtensionsPatchRequest = {
|
|
251
256
|
Body: Record<string, any>;
|
|
252
257
|
};
|
|
258
|
+
export type ExtensionsSubmitRequest = {
|
|
259
|
+
Body: {
|
|
260
|
+
configPath: string;
|
|
261
|
+
};
|
|
262
|
+
};
|
|
253
263
|
export type ConfigRequest = {
|
|
254
264
|
Querystring: {
|
|
255
265
|
json?: boolean;
|
|
@@ -1,38 +1,20 @@
|
|
|
1
1
|
import type { Namespace, Server } from 'socket.io';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ServerProcesses, SocketNsp, WorkerProcesses } from '../types.js';
|
|
3
3
|
export declare class MetricsNamespace {
|
|
4
4
|
nsp: Namespace;
|
|
5
5
|
nspName: SocketNsp;
|
|
6
|
-
private logger;
|
|
7
|
-
private configService;
|
|
8
6
|
private pluginManager;
|
|
9
7
|
private frameManager;
|
|
10
8
|
private go2rtc;
|
|
11
9
|
private natsServer;
|
|
12
|
-
private cpuHistory;
|
|
13
|
-
private cpuTempHistory;
|
|
14
|
-
private memHistory;
|
|
15
|
-
private networkHistory;
|
|
16
10
|
private processServerHistory;
|
|
17
11
|
private processGo2RtcHistory;
|
|
18
12
|
private processNatHistory;
|
|
19
13
|
private processPluginsHistory;
|
|
20
14
|
private processFrameWorkerHistory;
|
|
21
|
-
private memoryInfo?;
|
|
22
15
|
constructor(io: Server);
|
|
23
|
-
|
|
24
|
-
getPluginsProcessesInfo(payload: any, callback?: Function): Promise<
|
|
25
|
-
getFrameWorkerProcessesInfo(payload: any, callback?: Function): Promise<
|
|
26
|
-
getServerCpuInfo(payload?: any, callback?: Function): Promise<CpuInfo>;
|
|
27
|
-
getServerMemoryInfo(payload?: any, callback?: Function): Promise<MemoryInfo>;
|
|
28
|
-
getCpuTempInfo(payload?: any, callback?: Function): Promise<CpuTempInfo>;
|
|
29
|
-
getNetworkUsageInfo(payload?: any, callback?: Function): Promise<NetworkInfo>;
|
|
30
|
-
private getCpuTemp;
|
|
16
|
+
getServerProcessesInfos(payload: any, callback?: Function): Promise<ServerProcesses>;
|
|
17
|
+
getPluginsProcessesInfo(payload: any, callback?: Function): Promise<WorkerProcesses>;
|
|
18
|
+
getFrameWorkerProcessesInfo(payload: any, callback?: Function): Promise<WorkerProcesses>;
|
|
31
19
|
private getProcesses;
|
|
32
|
-
private getCpuLoad;
|
|
33
|
-
private getCpuLoadAlt;
|
|
34
|
-
private getCpuTempLegacy;
|
|
35
|
-
private getCpuTempAlt;
|
|
36
|
-
private getMemoryUsage;
|
|
37
|
-
private getCurrentNetworkUsage;
|
|
38
20
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { RUNTIME_STATUS } from '../../../services/config/types.js';
|
|
2
1
|
import type { Namespace, Server, Socket } from 'socket.io';
|
|
3
|
-
import type {
|
|
4
|
-
import type { SocketNsp } from '../types.js';
|
|
2
|
+
import type { ServerRuntime, SocketNsp, WorkerRuntime } from '../types.js';
|
|
5
3
|
export declare class StatusNamespace {
|
|
6
4
|
nsp: Namespace;
|
|
7
5
|
nspName: SocketNsp;
|
|
@@ -11,16 +9,7 @@ export declare class StatusNamespace {
|
|
|
11
9
|
private go2rtc;
|
|
12
10
|
private natsServer;
|
|
13
11
|
constructor(io: Server);
|
|
14
|
-
watchStats(socket: Socket, payload: any, callback?: Function):
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}[];
|
|
18
|
-
watchPluginStats(socket: Socket, payload: any, callback?: Function): {
|
|
19
|
-
name: string;
|
|
20
|
-
status: PLUGIN_STATUS;
|
|
21
|
-
}[];
|
|
22
|
-
watchFrameWorkerStats(socket: Socket, payload: any, callback?: Function): {
|
|
23
|
-
name: string;
|
|
24
|
-
status: PLUGIN_STATUS;
|
|
25
|
-
}[];
|
|
12
|
+
watchStats(socket: Socket, payload: any, callback?: Function): ServerRuntime;
|
|
13
|
+
watchPluginStats(socket: Socket, payload: any, callback?: Function): WorkerRuntime;
|
|
14
|
+
watchFrameWorkerStats(socket: Socket, payload: any, callback?: Function): WorkerRuntime;
|
|
26
15
|
}
|
|
@@ -1,86 +1,47 @@
|
|
|
1
1
|
import type { Namespace } from 'socket.io';
|
|
2
2
|
import type { PLUGIN_STATUS } from '../../plugins/types.js';
|
|
3
|
+
import type { RuntimeInfo } from '../../services/config/types.js';
|
|
3
4
|
export type SocketNsp = '/camera.ui' | '/metrics' | '/logs' | '/status' | '/notifications' | '/plugins' | '/proxy' | '/frame' | '/frameWorker';
|
|
4
5
|
export interface SocketNspMap {
|
|
5
6
|
nsp: Namespace;
|
|
6
7
|
[key: string]: any;
|
|
7
8
|
}
|
|
8
|
-
export interface CpuTemperatureData {
|
|
9
|
-
main: number;
|
|
10
|
-
cores: number[];
|
|
11
|
-
max: number;
|
|
12
|
-
socket?: number[];
|
|
13
|
-
chipset?: number;
|
|
14
|
-
}
|
|
15
|
-
export interface MemData {
|
|
16
|
-
total: number;
|
|
17
|
-
free: number;
|
|
18
|
-
used: number;
|
|
19
|
-
active: number;
|
|
20
|
-
available: number;
|
|
21
|
-
buffcache: number;
|
|
22
|
-
buffers: number;
|
|
23
|
-
cached: number;
|
|
24
|
-
slab: number;
|
|
25
|
-
swaptotal: number;
|
|
26
|
-
swapused: number;
|
|
27
|
-
swapfree: number;
|
|
28
|
-
writeback: number | null;
|
|
29
|
-
dirty: number | null;
|
|
30
|
-
}
|
|
31
|
-
export interface NetworkStatsData {
|
|
32
|
-
iface: string;
|
|
33
|
-
operstate: string;
|
|
34
|
-
rx_bytes: number;
|
|
35
|
-
rx_dropped: number;
|
|
36
|
-
rx_errors: number;
|
|
37
|
-
tx_bytes: number;
|
|
38
|
-
tx_dropped: number;
|
|
39
|
-
tx_errors: number;
|
|
40
|
-
rx_sec: number;
|
|
41
|
-
tx_sec: number;
|
|
42
|
-
ms: number;
|
|
43
|
-
}
|
|
44
9
|
export interface ProcessInfo {
|
|
45
10
|
name: string;
|
|
46
11
|
pid?: number;
|
|
47
|
-
cpuLoad:
|
|
48
|
-
memLoad:
|
|
12
|
+
cpuLoad: string;
|
|
13
|
+
memLoad: string;
|
|
14
|
+
timestamp: number;
|
|
49
15
|
}
|
|
50
|
-
export interface
|
|
16
|
+
export interface ServerProcessInfo {
|
|
51
17
|
server: ProcessInfo;
|
|
52
18
|
go2rtc: ProcessInfo;
|
|
53
19
|
nats: ProcessInfo;
|
|
54
20
|
}
|
|
55
|
-
export interface
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
worker: ProcessInfo[];
|
|
60
|
-
}
|
|
61
|
-
export interface AllProcessesInfo extends ProcessesInfo, PluginProcessesInfo, FrameWorkerProcessesInfo {
|
|
21
|
+
export interface ServerProcesses {
|
|
22
|
+
server: ProcessInfo[];
|
|
23
|
+
go2rtc: ProcessInfo[];
|
|
24
|
+
nats: ProcessInfo[];
|
|
62
25
|
}
|
|
63
|
-
export interface
|
|
64
|
-
|
|
65
|
-
cpuHistory: number[];
|
|
26
|
+
export interface WorkerProcessInfo {
|
|
27
|
+
[key: string]: ProcessInfo;
|
|
66
28
|
}
|
|
67
|
-
export interface
|
|
68
|
-
|
|
69
|
-
cpuTempHistory: CpuTemperatureData[];
|
|
29
|
+
export interface WorkerProcesses {
|
|
30
|
+
[key: string]: ProcessInfo[];
|
|
70
31
|
}
|
|
71
|
-
export interface
|
|
72
|
-
|
|
73
|
-
|
|
32
|
+
export interface AllProcesses extends ServerProcessInfo {
|
|
33
|
+
plugins: WorkerProcessInfo;
|
|
34
|
+
workers: WorkerProcessInfo;
|
|
74
35
|
}
|
|
75
|
-
export interface
|
|
76
|
-
net: NetworkStatsData;
|
|
77
|
-
point: number;
|
|
78
|
-
}
|
|
79
|
-
export interface NetworkInfo {
|
|
80
|
-
currentNetworkLoad: NetworkData;
|
|
81
|
-
networkHistory: NetworkData[];
|
|
82
|
-
}
|
|
83
|
-
export interface PluginRuntime {
|
|
36
|
+
export interface PluginRuntimeInfo {
|
|
84
37
|
name: string;
|
|
85
38
|
status: PLUGIN_STATUS;
|
|
86
39
|
}
|
|
40
|
+
export interface ServerRuntime {
|
|
41
|
+
server?: RuntimeInfo;
|
|
42
|
+
go2rtc?: RuntimeInfo;
|
|
43
|
+
nats?: RuntimeInfo;
|
|
44
|
+
}
|
|
45
|
+
export interface WorkerRuntime {
|
|
46
|
+
[key: string]: PluginRuntimeInfo;
|
|
47
|
+
}
|
|
@@ -5,8 +5,8 @@ import type { Camera, CameraExtensions } from './api/database/types.js';
|
|
|
5
5
|
import type { FrameWorker } from './decoder/worker.js';
|
|
6
6
|
import type { BasePlugin } from './plugins/interfaces/base.js';
|
|
7
7
|
import type { CameraExtension } from './plugins/types.js';
|
|
8
|
-
import type { API } from './polyglot/node/plugins/
|
|
9
|
-
import type { PluginLogger } from './polyglot/node/plugins/
|
|
8
|
+
import type { API } from './polyglot/node/plugins/pluginApi.js';
|
|
9
|
+
import type { PluginLogger } from './polyglot/node/plugins/pluginLogger.js';
|
|
10
10
|
export interface PluginConstructor {
|
|
11
11
|
new (logger: PluginLogger, api: API): BasePlugin;
|
|
12
12
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CameraDevice } from './device.js';
|
|
2
2
|
import { CameraPrebufferInterface } from './interfaces/prebuffer.js';
|
|
3
3
|
import { CameraPTZInterface } from './interfaces/ptz.js';
|
|
4
4
|
import type { Camera } from '../api/database/types.js';
|
|
5
|
+
import type { MotionFrame, VideoFrame } from '../decoder/types.js';
|
|
5
6
|
import type { ProxyServer } from '../nats/index.js';
|
|
6
7
|
import type { IceServer } from '../services/config/types.js';
|
|
7
8
|
import type { BaseLogger, CameraConfigInputSettings, CameraDelegate, CameraSource, SetValues } from './types.js';
|
|
8
|
-
export declare class CameraController extends
|
|
9
|
+
export declare class CameraController extends CameraDevice {
|
|
9
10
|
proxy: ProxyServer;
|
|
10
11
|
private motionTimeout?;
|
|
11
12
|
private objectTimeout?;
|
|
@@ -13,12 +14,16 @@ export declare class CameraController extends BaseCameraDevice {
|
|
|
13
14
|
private doorbellTimeout?;
|
|
14
15
|
private doorbellTimeoutDuration;
|
|
15
16
|
private prebufferStateSubscriptions;
|
|
16
|
-
cameraDelegate: CameraDelegate;
|
|
17
|
+
protected cameraDelegate: CameraDelegate;
|
|
18
|
+
protected ptzDelegate: CameraPTZInterface;
|
|
17
19
|
protected prebufferDelegate: CameraPrebufferInterface;
|
|
18
|
-
ptzDelegate: CameraPTZInterface;
|
|
19
20
|
get camera(): Camera;
|
|
20
21
|
get sources(): CameraSource[];
|
|
21
22
|
constructor(camera: Camera, logger: BaseLogger, proxy: ProxyServer);
|
|
23
|
+
setDelegate(): void;
|
|
24
|
+
getFfmpegPath(): Promise<string>;
|
|
25
|
+
getFrames(): AsyncIterableIterator<VideoFrame>;
|
|
26
|
+
getMotionFrames(): AsyncIterableIterator<MotionFrame>;
|
|
22
27
|
connect(): Promise<void>;
|
|
23
28
|
disconnect(): Promise<void>;
|
|
24
29
|
getIceServers(): Promise<IceServer[]>;
|
|
@@ -4,15 +4,27 @@ import { WeriftSession } from './streaming/werift-session.js';
|
|
|
4
4
|
import type { Observable } from 'rxjs';
|
|
5
5
|
import type { MotionFrame, VideoFrame } from '../decoder/types.js';
|
|
6
6
|
import type { StreamingConnectionOptions } from './streaming/peer-connection.js';
|
|
7
|
-
import type { CameraDelegates, FrameState } from './types.js';
|
|
7
|
+
import type { AudioSetEvent, BatterySetEvent, CameraConfigInputSettings, CameraDelegates, DoorbellSetEvent, FrameState, LightSetEvent, MotionSetEvent, ObjectSetEvent, SirenSetEvent } from './types.js';
|
|
8
8
|
export declare abstract class CameraDevice extends BaseCameraDevice {
|
|
9
9
|
protected readonly frameState: BehaviorSubject<FrameState>;
|
|
10
10
|
protected readonly onFrame: Observable<FrameState>;
|
|
11
11
|
abstract setDelegate<T extends keyof CameraDelegates>(name: T, delegate: CameraDelegates[T]): void;
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
abstract connect(): Promise<void>;
|
|
13
|
+
abstract disconnect(): Promise<void>;
|
|
14
14
|
abstract getFrames(prebufferDuration?: number): AsyncIterableIterator<VideoFrame>;
|
|
15
15
|
abstract getMotionFrames(): AsyncIterableIterator<MotionFrame>;
|
|
16
16
|
abstract getFfmpegPath(): Promise<string>;
|
|
17
|
+
abstract updateState(stateName: 'light', eventData: LightSetEvent): Promise<void>;
|
|
18
|
+
abstract updateState(stateName: 'motion', eventData: MotionSetEvent, frame?: VideoFrame): Promise<void>;
|
|
19
|
+
abstract updateState(stateName: 'audio', eventData: AudioSetEvent): Promise<void>;
|
|
20
|
+
abstract updateState(stateName: 'object', eventData: ObjectSetEvent): Promise<void>;
|
|
21
|
+
abstract updateState(stateName: 'doorbell', eventData: DoorbellSetEvent): Promise<void>;
|
|
22
|
+
abstract updateState(stateName: 'siren', eventData: SirenSetEvent): Promise<void>;
|
|
23
|
+
abstract updateState(stateName: 'battery', eventData: BatterySetEvent): Promise<void>;
|
|
24
|
+
abstract addCameraSource(source: CameraConfigInputSettings): Promise<void>;
|
|
25
|
+
abstract updateCameraSource(sourceId: string, source: Partial<CameraConfigInputSettings>): Promise<void>;
|
|
26
|
+
abstract removeCameraSource(sourceId: string): Promise<void>;
|
|
27
|
+
createSession(sourceName: string, options?: StreamingConnectionOptions): Promise<WeriftSession>;
|
|
28
|
+
protected removeAllListeners(): void;
|
|
17
29
|
private createMotionFrameObservable;
|
|
18
30
|
}
|
|
@@ -1,18 +1,10 @@
|
|
|
1
1
|
import { LRUCache } from 'lru-cache';
|
|
2
2
|
import { BehaviorSubject } from 'rxjs';
|
|
3
|
-
import
|
|
3
|
+
import { Subscribed } from '../utils/subscribed.js';
|
|
4
|
+
import type { Observable } from 'rxjs';
|
|
4
5
|
import type { Camera, CameraActivitySettings, CameraFrameWorkerSettings, CameraInformation, CameraType } from '../api/database/types.js';
|
|
5
|
-
import type { VideoFrame } from '../decoder/types.js';
|
|
6
6
|
import type { IceServer } from '../services/config/types.js';
|
|
7
|
-
import type { AudioSetEvent, AudioState, BaseLogger, BatterySetEvent, BatteryState,
|
|
8
|
-
declare class Subscribed {
|
|
9
|
-
private readonly subscriptions;
|
|
10
|
-
private readonly additionalSubscriptions;
|
|
11
|
-
protected addSubscriptions(...subscriptions: Subscription[]): void;
|
|
12
|
-
protected addAdditionalSubscriptions(...subscriptions: Subscription[]): void;
|
|
13
|
-
protected unsubscribe(): void;
|
|
14
|
-
protected unsubscribeAdditional(): void;
|
|
15
|
-
}
|
|
7
|
+
import type { AudioSetEvent, AudioState, BaseLogger, BatterySetEvent, BatteryState, CameraDelegate, CameraPTZDelegate, CameraPrebufferDelegate, CameraSource, Container, DetectionZone, DoorbellSetEvent, DoorbellState, LightSetEvent, LightState, MotionSetEvent, MotionState, ObjectSetEvent, ObjectState, PrebufferState, SetValues, SirenSetEvent, SirenState, StateValues } from './types.js';
|
|
16
8
|
export declare abstract class BaseCameraDevice extends Subscribed {
|
|
17
9
|
protected logger: BaseLogger;
|
|
18
10
|
protected snapshotCache: LRUCache<string, ArrayBuffer, unknown>;
|
|
@@ -38,9 +30,9 @@ export declare abstract class BaseCameraDevice extends Subscribed {
|
|
|
38
30
|
readonly onDoorbellPressed: Observable<DoorbellState>;
|
|
39
31
|
readonly onSirenDetected: Observable<SirenState>;
|
|
40
32
|
readonly onBatteryChanged: Observable<BatteryState>;
|
|
41
|
-
abstract cameraDelegate: CameraDelegate;
|
|
33
|
+
protected abstract cameraDelegate: CameraDelegate;
|
|
34
|
+
protected abstract ptzDelegate: CameraPTZDelegate;
|
|
42
35
|
protected abstract prebufferDelegate: CameraPrebufferDelegate;
|
|
43
|
-
abstract ptzDelegate: CameraPTZDelegate;
|
|
44
36
|
protected get cameraObject(): Camera;
|
|
45
37
|
get id(): string;
|
|
46
38
|
get nativeId(): string | undefined;
|
|
@@ -63,44 +55,39 @@ export declare abstract class BaseCameraDevice extends Subscribed {
|
|
|
63
55
|
get activityZones(): DetectionZone[];
|
|
64
56
|
get activitySettings(): CameraActivitySettings;
|
|
65
57
|
get frameWorkerSettings(): CameraFrameWorkerSettings;
|
|
66
|
-
get sources(): CameraSource[];
|
|
67
58
|
get streamSource(): CameraSource;
|
|
68
59
|
get snapshotSource(): CameraSource | undefined;
|
|
69
60
|
get highResolutionSource(): CameraSource | undefined;
|
|
70
61
|
get midResolutionSource(): CameraSource | undefined;
|
|
71
62
|
get lowResolutionSource(): CameraSource | undefined;
|
|
63
|
+
get ptz(): CameraPTZDelegate;
|
|
64
|
+
abstract get sources(): CameraSource[];
|
|
72
65
|
constructor(camera: Camera, logger: BaseLogger);
|
|
66
|
+
abstract getIceServers(): Promise<IceServer[]>;
|
|
67
|
+
protected abstract cleanup(): void;
|
|
73
68
|
getValue<T extends keyof StateValues>(stateName: T): StateValues[T];
|
|
74
69
|
snapshot(forceNew?: boolean): Promise<ArrayBuffer>;
|
|
75
70
|
onStateChange<T extends keyof StateValues>(stateName: T): Observable<{
|
|
76
71
|
newState: StateValues[T];
|
|
77
72
|
oldState: StateValues[T];
|
|
78
73
|
}>;
|
|
79
|
-
abstract connect(): Promise<void>;
|
|
80
|
-
abstract disconnect(): Promise<void>;
|
|
81
|
-
abstract getIceServers(): Promise<IceServer[]>;
|
|
82
|
-
abstract updateState(stateName: 'light', eventData: LightSetEvent): Promise<void>;
|
|
83
|
-
abstract updateState(stateName: 'motion', eventData: MotionSetEvent, frame?: VideoFrame): Promise<void>;
|
|
84
|
-
abstract updateState(stateName: 'audio', eventData: AudioSetEvent): Promise<void>;
|
|
85
|
-
abstract updateState(stateName: 'object', eventData: ObjectSetEvent): Promise<void>;
|
|
86
|
-
abstract updateState(stateName: 'doorbell', eventData: DoorbellSetEvent): Promise<void>;
|
|
87
|
-
abstract updateState(stateName: 'siren', eventData: SirenSetEvent): Promise<void>;
|
|
88
|
-
abstract updateState(stateName: 'battery', eventData: BatterySetEvent): Promise<void>;
|
|
89
|
-
abstract addCameraSource(source: CameraConfigInputSettings): Promise<void>;
|
|
90
|
-
abstract updateCameraSource(sourceId: string, source: Partial<CameraConfigInputSettings>): Promise<void>;
|
|
91
|
-
abstract removeCameraSource(sourceId: string): Promise<void>;
|
|
92
|
-
protected abstract cleanup(): void;
|
|
93
|
-
protected updateStateInternal<T extends keyof SetValues>(stateName: T, eventData: SetValues[T], skipCheck?: boolean): void;
|
|
94
74
|
onPropertyChange<T extends keyof Camera>(property: T | T[]): Observable<{
|
|
95
75
|
property: T;
|
|
96
76
|
oldData: Camera[T];
|
|
97
77
|
newData: Camera[T];
|
|
98
78
|
}>;
|
|
99
|
-
removeAllListeners(): void;
|
|
79
|
+
protected removeAllListeners(): void;
|
|
80
|
+
protected updateCamera(updatedCamera: Camera): void;
|
|
81
|
+
protected updateCameraState(state: boolean): void;
|
|
82
|
+
protected updatePrebuffer(sourceId: string, container: Container, state: PrebufferState): void;
|
|
83
|
+
protected updateStateInternal<T extends keyof SetValues>(stateName: T, eventData: SetValues[T], skipCheck?: boolean): void;
|
|
100
84
|
protected checkStateInternal<T extends keyof SetValues>(stateName: T, event: SetValues[T]): {
|
|
101
85
|
changed: boolean;
|
|
102
86
|
event: StateValues[T];
|
|
103
87
|
};
|
|
88
|
+
protected cameraSourcePrebufferState(sourceId: string, container: Container): PrebufferState;
|
|
89
|
+
protected createPrebufferStateObservable(sourceId: string, container: Container): Observable<PrebufferState>;
|
|
90
|
+
protected stateChanged<T extends keyof SetValues>(oldState?: SetValues[T], newState?: SetValues[T], type?: keyof StateValues): boolean;
|
|
104
91
|
protected getAudioState(event: AudioSetEvent, ignoreLastEvet?: boolean): AudioState;
|
|
105
92
|
protected getMotionState(event: MotionSetEvent, ignoreLastEvet?: boolean): MotionState;
|
|
106
93
|
protected getObjectState(event: ObjectSetEvent, ignoreLastEvet?: boolean): ObjectState;
|
|
@@ -108,14 +95,6 @@ export declare abstract class BaseCameraDevice extends Subscribed {
|
|
|
108
95
|
protected getLightState(event: LightSetEvent, ignoreLastEvet?: boolean): LightState;
|
|
109
96
|
protected getSirenState(event: SirenSetEvent, ignoreLastEvet?: boolean): SirenState;
|
|
110
97
|
protected getBatteryState(event: BatterySetEvent, ignoreLastEvet?: boolean): BatteryState;
|
|
111
|
-
|
|
112
|
-
protected updatePrebuffer(sourceId: string, container: Container, state: PrebufferState): Promise<void>;
|
|
113
|
-
protected updateCameraSourcesState(): void;
|
|
114
|
-
protected updateCameraState(state: boolean): void;
|
|
115
|
-
protected cameraSourcePrebufferState(sourceId: string, container: Container): PrebufferState;
|
|
98
|
+
private isStateEvent;
|
|
116
99
|
private createStateObservable;
|
|
117
|
-
protected createPrebufferStateObservable(sourceId: string, container: Container): Observable<PrebufferState>;
|
|
118
|
-
protected stateChanged<T extends keyof SetValues>(oldState?: SetValues[T], newState?: SetValues[T], type?: keyof StateValues): boolean;
|
|
119
|
-
protected isStateEvent(state: States | Sets): state is States;
|
|
120
100
|
}
|
|
121
|
-
export {};
|
|
@@ -6,6 +6,5 @@ export declare class CameraInterface extends CameraDelegate {
|
|
|
6
6
|
private logger;
|
|
7
7
|
constructor(onRequest: (client: any, fn: string, args?: any[], timeout?: number) => Promise<any>, logger: BaseLogger);
|
|
8
8
|
snapshot(): Promise<ArrayBuffer>;
|
|
9
|
-
reboot(): Promise<void>;
|
|
10
9
|
private _onRequest;
|
|
11
10
|
}
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
+
import type { Subscription } from 'rxjs';
|
|
1
2
|
import { ReplaySubject, Subject } from 'rxjs';
|
|
2
3
|
import { RtpPacket } from 'werift';
|
|
3
|
-
import { Subscribed } from '../../utils/subscribed.js';
|
|
4
4
|
import type { CameraDevice } from '../device.js';
|
|
5
5
|
import type { BaseLogger, FfmpegOptions, SpawnInput } from '../types.js';
|
|
6
6
|
import type { WebrtcConnection } from './webrtc-connection.js';
|
|
7
|
+
declare class Subscribed {
|
|
8
|
+
private readonly subscriptions;
|
|
9
|
+
private readonly additionalSubscriptions;
|
|
10
|
+
addSubscriptions(...subscriptions: Subscription[]): void;
|
|
11
|
+
addAdditionalSubscriptions(...subscriptions: Subscription[]): void;
|
|
12
|
+
unsubscribe(): void;
|
|
13
|
+
unsubscribeAdditional(): void;
|
|
14
|
+
}
|
|
7
15
|
export declare class WeriftSession extends Subscribed {
|
|
8
16
|
readonly onCallEnded: ReplaySubject<void>;
|
|
9
17
|
readonly onVideoRtp: Subject<RtpPacket>;
|
|
@@ -29,3 +37,4 @@ export declare class WeriftSession extends Subscribed {
|
|
|
29
37
|
private bindToConnection;
|
|
30
38
|
private callEnded;
|
|
31
39
|
}
|
|
40
|
+
export {};
|
|
@@ -21,8 +21,7 @@ export interface FfmpegOptions {
|
|
|
21
21
|
}
|
|
22
22
|
export type Container = 'mp4' | 'mpegts';
|
|
23
23
|
export interface BasePrebufferState {
|
|
24
|
-
|
|
25
|
-
availableDuration: number;
|
|
24
|
+
duration: number;
|
|
26
25
|
}
|
|
27
26
|
export interface PrebufferStateTrue extends BasePrebufferState {
|
|
28
27
|
state: true;
|
|
@@ -180,7 +179,6 @@ export type SetValue<T extends keyof SetValues> = SetValues[T];
|
|
|
180
179
|
export type OnChangeCallback<T extends keyof StateValues> = (newEvent: StateValues[T], oldEvent: StateValues[T]) => void;
|
|
181
180
|
export declare abstract class CameraDelegate {
|
|
182
181
|
abstract snapshot(): Promise<ArrayBuffer>;
|
|
183
|
-
abstract reboot(): Promise<void>;
|
|
184
182
|
}
|
|
185
183
|
export declare abstract class CameraPrebufferDelegate {
|
|
186
184
|
abstract getStreamInfo(sourceName: string): Promise<StreamInfo | undefined>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { NatsConnection } from 'nats';
|
|
2
1
|
import type { DecoderFormat, FrameBuffer, FrameData, FrameImage, FrameMetadata, ImageOptions, MotionFrame as MotionFrameMethods, VideoFrame as VideoFrameMethods } from '../decoder/types.js';
|
|
2
|
+
import type { ProxyConnection } from '../nats/connection.js';
|
|
3
3
|
import type { MotionState } from './types.js';
|
|
4
4
|
export declare class VideoFrame implements VideoFrameMethods {
|
|
5
5
|
readonly frameData: FrameData;
|
|
@@ -10,7 +10,7 @@ export declare class VideoFrame implements VideoFrameMethods {
|
|
|
10
10
|
get inputWidth(): number;
|
|
11
11
|
get inputHeight(): number;
|
|
12
12
|
get inputFormat(): DecoderFormat;
|
|
13
|
-
constructor(cameraId: string, publisher:
|
|
13
|
+
constructor(cameraId: string, publisher: ProxyConnection, frameData: FrameData, metadata: FrameMetadata, prebufferDuration: number);
|
|
14
14
|
toBuffer(options?: ImageOptions): Promise<FrameBuffer>;
|
|
15
15
|
toImage(options?: ImageOptions): Promise<FrameImage>;
|
|
16
16
|
save(path: string, options?: ImageOptions): Promise<void>;
|
|
@@ -20,5 +20,5 @@ export declare class VideoFrame implements VideoFrameMethods {
|
|
|
20
20
|
}
|
|
21
21
|
export declare class MotionFrame extends VideoFrame implements MotionFrameMethods {
|
|
22
22
|
readonly motion: MotionState;
|
|
23
|
-
constructor(cameraId: string, publisher:
|
|
23
|
+
constructor(cameraId: string, publisher: ProxyConnection, frameData: FrameData, motionState: MotionState, metadata: FrameMetadata);
|
|
24
24
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { ChildProcess } from 'node:child_process';
|
|
2
1
|
import type { Sharp } from 'sharp';
|
|
3
2
|
import type { MotionState } from '../camera/types.js';
|
|
4
3
|
export type DecoderFormat = 'yuv' | 'rgb';
|
|
@@ -7,9 +6,7 @@ export interface ImageMetadata {
|
|
|
7
6
|
height: number;
|
|
8
7
|
}
|
|
9
8
|
export interface AudioMetadata {
|
|
10
|
-
|
|
11
|
-
sampleRate: number;
|
|
12
|
-
format: string;
|
|
9
|
+
mimeType: 'audio/mpeg' | 'audio/wav' | 'audio/ogg';
|
|
13
10
|
}
|
|
14
11
|
export interface FrameMetadata {
|
|
15
12
|
format: DecoderFormat;
|
|
@@ -72,10 +69,9 @@ export interface VideoFrame {
|
|
|
72
69
|
export interface MotionFrame extends VideoFrame {
|
|
73
70
|
motion: MotionState;
|
|
74
71
|
}
|
|
75
|
-
export interface
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
cp: ChildProcess;
|
|
72
|
+
export interface AuthConfig {
|
|
73
|
+
user: string;
|
|
74
|
+
password: string;
|
|
79
75
|
}
|
|
80
76
|
export interface BaseFrameWorkerConfig {
|
|
81
77
|
frameWorkerId: string;
|
|
@@ -84,10 +80,7 @@ export interface BaseFrameWorkerConfig {
|
|
|
84
80
|
ffmpegPath: string;
|
|
85
81
|
logLevel: string;
|
|
86
82
|
disableTimestamps: boolean;
|
|
87
|
-
auth:
|
|
88
|
-
user: string;
|
|
89
|
-
pass: string;
|
|
90
|
-
};
|
|
83
|
+
auth: AuthConfig;
|
|
91
84
|
proxyEndpoints: string[];
|
|
92
85
|
fps: number;
|
|
93
86
|
resolution: number;
|