@camera.ui/browser 0.0.83 → 0.0.85
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/server/src/api/database/types.d.ts +6 -6
- package/dist/types/server/src/api/schemas/cameras.schema.d.ts +61 -54
- package/dist/types/server/src/api/schemas/users.schema.d.ts +5 -0
- package/dist/types/server/src/api/services/cameras.service.d.ts +6 -5
- package/dist/types/server/src/api/types/index.d.ts +13 -3
- package/dist/types/server/src/api/websocket/index.d.ts +1 -0
- 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/camera/controller.d.ts +3 -1
- package/dist/types/server/src/camera/index.d.ts +3 -7
- package/dist/types/server/src/camera/interfaces/camera.d.ts +1 -1
- package/dist/types/server/src/camera/streaming/werift-session.d.ts +10 -1
- package/dist/types/server/src/camera/types.d.ts +8 -2
- package/dist/types/server/src/decoder/worker.d.ts +1 -2
- package/dist/types/server/src/nats/index.d.ts +1 -1
- package/dist/types/server/src/nats/proxy/cameraDevice.d.ts +5 -10
- package/dist/types/server/src/nats/proxy/deviceManager.d.ts +1 -1
- package/dist/types/server/src/nats/types.d.ts +12 -5
- package/dist/types/server/src/plugins/types.d.ts +10 -41
- package/dist/types/server/src/polyglot/node/plugins/cameraStorage.d.ts +9 -10
- package/dist/types/server/src/polyglot/node/plugins/pluginApi.d.ts +0 -3
- package/dist/types/server/src/polyglot/node/plugins/schema.d.ts +22 -9
- package/dist/types/server/src/polyglot/node/plugins/storageController.d.ts +3 -3
- package/dist/types/server/src/services/config/index.d.ts +10 -5
- package/dist/types/server/src/services/config/types.d.ts +1 -1
- package/dist/types/server/src/services/logger/index.d.ts +3 -9
- package/package.json +5 -5
|
@@ -139,12 +139,12 @@ export interface CameraFrameWorkerSettings {
|
|
|
139
139
|
resolution: CameraFrameWorkerResolution;
|
|
140
140
|
}
|
|
141
141
|
export interface CameraInformation {
|
|
142
|
-
model
|
|
143
|
-
manufacturer
|
|
144
|
-
hardware
|
|
145
|
-
serialNumber
|
|
146
|
-
firmwareVersion
|
|
147
|
-
supportUrl
|
|
142
|
+
model?: string;
|
|
143
|
+
manufacturer?: string;
|
|
144
|
+
hardware?: string;
|
|
145
|
+
serialNumber?: string;
|
|
146
|
+
firmwareVersion?: string;
|
|
147
|
+
supportUrl?: string;
|
|
148
148
|
}
|
|
149
149
|
export interface CameraExtensions {
|
|
150
150
|
hub?: string[];
|
|
@@ -231,26 +231,26 @@ export declare const interfaceSettingsSchema: zod.ZodObject<{
|
|
|
231
231
|
streamingMode: "webrtc" | "mse" | "webrtc/tcp" | "mjpeg" | "hls" | "mp4";
|
|
232
232
|
}>;
|
|
233
233
|
export declare const cameraInfoSchema: zod.ZodObject<{
|
|
234
|
-
model: zod.ZodString
|
|
235
|
-
manufacturer: zod.ZodString
|
|
236
|
-
hardware: zod.ZodString
|
|
237
|
-
serialNumber: zod.ZodString
|
|
238
|
-
firmwareVersion: zod.ZodString
|
|
239
|
-
supportUrl: zod.ZodString
|
|
234
|
+
model: zod.ZodOptional<zod.ZodString>;
|
|
235
|
+
manufacturer: zod.ZodOptional<zod.ZodString>;
|
|
236
|
+
hardware: zod.ZodOptional<zod.ZodString>;
|
|
237
|
+
serialNumber: zod.ZodOptional<zod.ZodString>;
|
|
238
|
+
firmwareVersion: zod.ZodOptional<zod.ZodString>;
|
|
239
|
+
supportUrl: zod.ZodOptional<zod.ZodString>;
|
|
240
240
|
}, "strip", zod.ZodTypeAny, {
|
|
241
|
-
model
|
|
242
|
-
manufacturer
|
|
243
|
-
hardware
|
|
244
|
-
serialNumber
|
|
245
|
-
firmwareVersion
|
|
246
|
-
supportUrl
|
|
241
|
+
model?: string | undefined;
|
|
242
|
+
manufacturer?: string | undefined;
|
|
243
|
+
hardware?: string | undefined;
|
|
244
|
+
serialNumber?: string | undefined;
|
|
245
|
+
firmwareVersion?: string | undefined;
|
|
246
|
+
supportUrl?: string | undefined;
|
|
247
247
|
}, {
|
|
248
|
-
model
|
|
249
|
-
manufacturer
|
|
250
|
-
hardware
|
|
251
|
-
serialNumber
|
|
252
|
-
firmwareVersion
|
|
253
|
-
supportUrl
|
|
248
|
+
model?: string | undefined;
|
|
249
|
+
manufacturer?: string | undefined;
|
|
250
|
+
hardware?: string | undefined;
|
|
251
|
+
serialNumber?: string | undefined;
|
|
252
|
+
firmwareVersion?: string | undefined;
|
|
253
|
+
supportUrl?: string | undefined;
|
|
254
254
|
}>;
|
|
255
255
|
export declare const createCameraSchema: zod.ZodObject<{
|
|
256
256
|
_id: zod.ZodEffects<zod.ZodDefault<zod.ZodString>, string, string | undefined>;
|
|
@@ -265,26 +265,26 @@ export declare const createCameraSchema: zod.ZodObject<{
|
|
|
265
265
|
hasBinarySensor: zod.ZodDefault<zod.ZodBoolean>;
|
|
266
266
|
hasBattery: zod.ZodDefault<zod.ZodBoolean>;
|
|
267
267
|
info: zod.ZodDefault<zod.ZodObject<{
|
|
268
|
-
model: zod.ZodString
|
|
269
|
-
manufacturer: zod.ZodString
|
|
270
|
-
hardware: zod.ZodString
|
|
271
|
-
serialNumber: zod.ZodString
|
|
272
|
-
firmwareVersion: zod.ZodString
|
|
273
|
-
supportUrl: zod.ZodString
|
|
268
|
+
model: zod.ZodOptional<zod.ZodString>;
|
|
269
|
+
manufacturer: zod.ZodOptional<zod.ZodString>;
|
|
270
|
+
hardware: zod.ZodOptional<zod.ZodString>;
|
|
271
|
+
serialNumber: zod.ZodOptional<zod.ZodString>;
|
|
272
|
+
firmwareVersion: zod.ZodOptional<zod.ZodString>;
|
|
273
|
+
supportUrl: zod.ZodOptional<zod.ZodString>;
|
|
274
274
|
}, "strip", zod.ZodTypeAny, {
|
|
275
|
-
model
|
|
276
|
-
manufacturer
|
|
277
|
-
hardware
|
|
278
|
-
serialNumber
|
|
279
|
-
firmwareVersion
|
|
280
|
-
supportUrl
|
|
275
|
+
model?: string | undefined;
|
|
276
|
+
manufacturer?: string | undefined;
|
|
277
|
+
hardware?: string | undefined;
|
|
278
|
+
serialNumber?: string | undefined;
|
|
279
|
+
firmwareVersion?: string | undefined;
|
|
280
|
+
supportUrl?: string | undefined;
|
|
281
281
|
}, {
|
|
282
|
-
model
|
|
283
|
-
manufacturer
|
|
284
|
-
hardware
|
|
285
|
-
serialNumber
|
|
286
|
-
firmwareVersion
|
|
287
|
-
supportUrl
|
|
282
|
+
model?: string | undefined;
|
|
283
|
+
manufacturer?: string | undefined;
|
|
284
|
+
hardware?: string | undefined;
|
|
285
|
+
serialNumber?: string | undefined;
|
|
286
|
+
firmwareVersion?: string | undefined;
|
|
287
|
+
supportUrl?: string | undefined;
|
|
288
288
|
}>>;
|
|
289
289
|
sources: zod.ZodEffects<zod.ZodArray<zod.ZodObject<{
|
|
290
290
|
_id: zod.ZodEffects<zod.ZodDefault<zod.ZodString>, string, string | undefined>;
|
|
@@ -462,12 +462,12 @@ export declare const createCameraSchema: zod.ZodObject<{
|
|
|
462
462
|
}>>;
|
|
463
463
|
}, "strict", zod.ZodTypeAny, {
|
|
464
464
|
info: {
|
|
465
|
-
model
|
|
466
|
-
manufacturer
|
|
467
|
-
hardware
|
|
468
|
-
serialNumber
|
|
469
|
-
firmwareVersion
|
|
470
|
-
supportUrl
|
|
465
|
+
model?: string | undefined;
|
|
466
|
+
manufacturer?: string | undefined;
|
|
467
|
+
hardware?: string | undefined;
|
|
468
|
+
serialNumber?: string | undefined;
|
|
469
|
+
firmwareVersion?: string | undefined;
|
|
470
|
+
supportUrl?: string | undefined;
|
|
471
471
|
};
|
|
472
472
|
name: string;
|
|
473
473
|
extensions: {
|
|
@@ -537,12 +537,12 @@ export declare const createCameraSchema: zod.ZodObject<{
|
|
|
537
537
|
_id?: string | undefined;
|
|
538
538
|
}[];
|
|
539
539
|
info?: {
|
|
540
|
-
model
|
|
541
|
-
manufacturer
|
|
542
|
-
hardware
|
|
543
|
-
serialNumber
|
|
544
|
-
firmwareVersion
|
|
545
|
-
supportUrl
|
|
540
|
+
model?: string | undefined;
|
|
541
|
+
manufacturer?: string | undefined;
|
|
542
|
+
hardware?: string | undefined;
|
|
543
|
+
serialNumber?: string | undefined;
|
|
544
|
+
firmwareVersion?: string | undefined;
|
|
545
|
+
supportUrl?: string | undefined;
|
|
546
546
|
} | undefined;
|
|
547
547
|
extensions?: {
|
|
548
548
|
plugins: string[];
|
|
@@ -602,12 +602,12 @@ export declare const patchCameraSchema: zod.ZodObject<{
|
|
|
602
602
|
type: zod.ZodOptional<zod.ZodUnion<[zod.ZodLiteral<"camera">, zod.ZodLiteral<"doorbell">]>>;
|
|
603
603
|
name: zod.ZodOptional<zod.ZodString>;
|
|
604
604
|
info: zod.ZodOptional<zod.ZodObject<{
|
|
605
|
-
model: zod.ZodOptional<zod.ZodString
|
|
606
|
-
manufacturer: zod.ZodOptional<zod.ZodString
|
|
607
|
-
hardware: zod.ZodOptional<zod.ZodString
|
|
608
|
-
serialNumber: zod.ZodOptional<zod.ZodString
|
|
609
|
-
firmwareVersion: zod.ZodOptional<zod.ZodString
|
|
610
|
-
supportUrl: zod.ZodOptional<zod.ZodString
|
|
605
|
+
model: zod.ZodOptional<zod.ZodOptional<zod.ZodString>>;
|
|
606
|
+
manufacturer: zod.ZodOptional<zod.ZodOptional<zod.ZodString>>;
|
|
607
|
+
hardware: zod.ZodOptional<zod.ZodOptional<zod.ZodString>>;
|
|
608
|
+
serialNumber: zod.ZodOptional<zod.ZodOptional<zod.ZodString>>;
|
|
609
|
+
firmwareVersion: zod.ZodOptional<zod.ZodOptional<zod.ZodString>>;
|
|
610
|
+
supportUrl: zod.ZodOptional<zod.ZodOptional<zod.ZodString>>;
|
|
611
611
|
}, "strip", zod.ZodTypeAny, {
|
|
612
612
|
model?: string | undefined;
|
|
613
613
|
manufacturer?: string | undefined;
|
|
@@ -919,6 +919,13 @@ export declare const patchCameraSchema: zod.ZodObject<{
|
|
|
919
919
|
} | undefined;
|
|
920
920
|
}>;
|
|
921
921
|
export declare const patchExtensionsSchema: zod.ZodRecord<zod.ZodString, zod.ZodAny>;
|
|
922
|
+
export declare const submitExtensionsSchema: zod.ZodObject<{
|
|
923
|
+
configPath: zod.ZodString;
|
|
924
|
+
}, "strict", zod.ZodTypeAny, {
|
|
925
|
+
configPath: string;
|
|
926
|
+
}, {
|
|
927
|
+
configPath: string;
|
|
928
|
+
}>;
|
|
922
929
|
export declare const previewCameraSchema: zod.ZodObject<{
|
|
923
930
|
url: zod.ZodString;
|
|
924
931
|
}, "strict", zod.ZodTypeAny, {
|
|
@@ -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">]>>;
|
|
@@ -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>;
|
|
@@ -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 {
|
|
@@ -165,6 +166,10 @@ export interface Go2RtcInfo {
|
|
|
165
166
|
info: ApplicationResponse;
|
|
166
167
|
auth: Partial<Go2RtcInfoAuth>;
|
|
167
168
|
}
|
|
169
|
+
export interface NatsInfo {
|
|
170
|
+
servers: string[];
|
|
171
|
+
auth: AuthConfig;
|
|
172
|
+
}
|
|
168
173
|
export interface TokenClientDataResponse {
|
|
169
174
|
pagination: Pagination;
|
|
170
175
|
result: JwtTokenClientData[];
|
|
@@ -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;
|
|
@@ -419,7 +429,7 @@ export interface INpmPerson {
|
|
|
419
429
|
export interface IPackageJson {
|
|
420
430
|
name: string;
|
|
421
431
|
displayName?: string;
|
|
422
|
-
version
|
|
432
|
+
version: string;
|
|
423
433
|
description?: string;
|
|
424
434
|
keywords?: string[];
|
|
425
435
|
homepage?: string;
|
|
@@ -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,7 +5,7 @@ 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
7
|
import type { IceServer } from '../services/config/types.js';
|
|
8
|
-
import type { BaseLogger, CameraConfigInputSettings, CameraDelegate, CameraSource, SetValues } from './types.js';
|
|
8
|
+
import type { BaseLogger, CameraConfigInputSettings, CameraDelegate, CameraSource, Container, PrebufferState, SetValues } from './types.js';
|
|
9
9
|
export declare class CameraController extends CameraDevice {
|
|
10
10
|
proxy: ProxyServer;
|
|
11
11
|
private motionTimeout?;
|
|
@@ -32,6 +32,8 @@ export declare class CameraController extends CameraDevice {
|
|
|
32
32
|
updateCameraSource(sourceId: string, source: Partial<CameraConfigInputSettings>): Promise<void>;
|
|
33
33
|
removeCameraSource(sourceId: string): Promise<void>;
|
|
34
34
|
updateCamera(updatedCamera: Camera): void;
|
|
35
|
+
updatePrebuffer(sourceId: string, container: Container, state: PrebufferState): void;
|
|
36
|
+
cameraSourcePrebufferState(sourceId: string, container: Container): PrebufferState;
|
|
35
37
|
cleanup(): void;
|
|
36
38
|
private subscribeToCameraState;
|
|
37
39
|
private subscribeToCameraSourcesState;
|
|
@@ -4,7 +4,7 @@ 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
6
|
import type { IceServer } from '../services/config/types.js';
|
|
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';
|
|
7
|
+
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
8
|
export declare abstract class BaseCameraDevice extends Subscribed {
|
|
9
9
|
protected logger: BaseLogger;
|
|
10
10
|
protected snapshotCache: LRUCache<string, ArrayBuffer, unknown>;
|
|
@@ -17,11 +17,7 @@ export declare abstract class BaseCameraDevice extends Subscribed {
|
|
|
17
17
|
protected doorbellState: BehaviorSubject<DoorbellState>;
|
|
18
18
|
protected sirenState: BehaviorSubject<SirenState>;
|
|
19
19
|
protected batteryState: BehaviorSubject<BatteryState>;
|
|
20
|
-
protected prebufferStateSubjects:
|
|
21
|
-
[sourceId: string]: {
|
|
22
|
-
[container: string]: BehaviorSubject<PrebufferState>;
|
|
23
|
-
};
|
|
24
|
-
};
|
|
20
|
+
protected prebufferStateSubjects: PrebufferSubject;
|
|
25
21
|
readonly onConnected: Observable<boolean>;
|
|
26
22
|
readonly onLightSwitched: Observable<LightState>;
|
|
27
23
|
readonly onMotionDetected: Observable<MotionState>;
|
|
@@ -66,7 +62,7 @@ export declare abstract class BaseCameraDevice extends Subscribed {
|
|
|
66
62
|
abstract getIceServers(): Promise<IceServer[]>;
|
|
67
63
|
protected abstract cleanup(): void;
|
|
68
64
|
getValue<T extends keyof StateValues>(stateName: T): StateValues[T];
|
|
69
|
-
snapshot(forceNew?: boolean): Promise<ArrayBuffer>;
|
|
65
|
+
snapshot(forceNew?: boolean): Promise<ArrayBuffer | undefined>;
|
|
70
66
|
onStateChange<T extends keyof StateValues>(stateName: T): Observable<{
|
|
71
67
|
newState: StateValues[T];
|
|
72
68
|
oldState: StateValues[T];
|
|
@@ -5,6 +5,6 @@ export declare class CameraInterface extends CameraDelegate {
|
|
|
5
5
|
private onRequest;
|
|
6
6
|
private logger;
|
|
7
7
|
constructor(onRequest: (client: any, fn: string, args?: any[], timeout?: number) => Promise<any>, logger: BaseLogger);
|
|
8
|
-
snapshot(): Promise<ArrayBuffer>;
|
|
8
|
+
snapshot(): Promise<ArrayBuffer | undefined>;
|
|
9
9
|
private _onRequest;
|
|
10
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 {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Observable } from 'rxjs';
|
|
1
|
+
import type { BehaviorSubject, Observable } from 'rxjs';
|
|
2
2
|
import type { CameraInformation, CameraInput, CameraInputSettings, Point, ZoneFilter, ZoneType } from '../api/database/types.js';
|
|
3
3
|
import type { FrameData, FrameMetadata } from '../decoder/types.js';
|
|
4
4
|
import type { CameraInterface } from './interfaces/camera.js';
|
|
@@ -171,6 +171,12 @@ export interface SetValues {
|
|
|
171
171
|
siren: SirenSetEvent;
|
|
172
172
|
battery: BatterySetEvent;
|
|
173
173
|
}
|
|
174
|
+
export interface PrebufferSubject {
|
|
175
|
+
[sourceId: string]: {
|
|
176
|
+
mp4: BehaviorSubject<PrebufferState>;
|
|
177
|
+
mpegts: BehaviorSubject<PrebufferState>;
|
|
178
|
+
};
|
|
179
|
+
}
|
|
174
180
|
export type CameraStateCallbacks = {
|
|
175
181
|
[K in keyof StateValues]: (event: StateValues[K]) => void;
|
|
176
182
|
};
|
|
@@ -178,7 +184,7 @@ export type StateValue<T extends keyof StateValues> = StateValues[T];
|
|
|
178
184
|
export type SetValue<T extends keyof SetValues> = SetValues[T];
|
|
179
185
|
export type OnChangeCallback<T extends keyof StateValues> = (newEvent: StateValues[T], oldEvent: StateValues[T]) => void;
|
|
180
186
|
export declare abstract class CameraDelegate {
|
|
181
|
-
abstract snapshot(): Promise<ArrayBuffer>;
|
|
187
|
+
abstract snapshot(): Promise<ArrayBuffer | undefined>;
|
|
182
188
|
}
|
|
183
189
|
export declare abstract class CameraPrebufferDelegate {
|
|
184
190
|
abstract getStreamInfo(sourceName: string): Promise<StreamInfo | undefined>;
|
|
@@ -3,12 +3,11 @@ import { Subscribed } from '../utils/subscribed.js';
|
|
|
3
3
|
import type { CameraController } from '../camera/controller.js';
|
|
4
4
|
import type { AuthConfig } from './types.js';
|
|
5
5
|
export declare class FrameWorker extends Subscribed {
|
|
6
|
-
|
|
6
|
+
readonly frameWorkerId: string;
|
|
7
7
|
name: string;
|
|
8
8
|
private readonly clients;
|
|
9
9
|
private subject;
|
|
10
10
|
private ipcSubject;
|
|
11
|
-
private frameWorkerId;
|
|
12
11
|
private publisher?;
|
|
13
12
|
private subscriber?;
|
|
14
13
|
private logger;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { ProxyConnection } from './connection.js';
|
|
1
2
|
import { CameraDeviceProxy } from './proxy/cameraDevice.js';
|
|
2
3
|
import { DeviceManagerProxy } from './proxy/deviceManager.js';
|
|
3
4
|
import { NatsServer } from './server.js';
|
|
4
5
|
import type { StateValues } from '../camera/types.js';
|
|
5
6
|
import type { CameraStorage } from '../polyglot/node/plugins/cameraStorage.js';
|
|
6
7
|
import type { MethodKeys, MethodType } from '../types.js';
|
|
7
|
-
import { ProxyConnection } from './connection.js';
|
|
8
8
|
import type { ProxySubscription } from './subscription.js';
|
|
9
9
|
import type { CameraDeviceListenerMessagePayload, DeviceManagerProxyEvents, PluginMap, ProxyAuth } from './types.js';
|
|
10
10
|
import type { WebsocketProxy } from './websocket.js';
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { CameraConfigInputSettings, CameraInterfaces, Container, PrebufferState, SetValues, StateValues } from '../../camera/types.js';
|
|
1
|
+
import type { CameraConfigInputSettings, CameraInterfaces, Container, PrebufferState, SetValues } from '../../camera/types.js';
|
|
3
2
|
import type { IceServer } from '../../services/config/types.js';
|
|
4
3
|
import type { MethodKeys, MethodType } from '../../types.js';
|
|
5
4
|
import type { MessageQueue } from '../messageQueue.js';
|
|
6
|
-
import type { CameraDeviceProxyMethods, ProxyMessageStructure } from '../types.js';
|
|
5
|
+
import type { CameraDeviceProxyMethods, ProxyMessageStructure, RefreshedStates } from '../types.js';
|
|
7
6
|
export declare class CameraDeviceProxy implements CameraDeviceProxyMethods {
|
|
8
7
|
private api;
|
|
9
8
|
private configService;
|
|
@@ -20,11 +19,7 @@ export declare class CameraDeviceProxy implements CameraDeviceProxyMethods {
|
|
|
20
19
|
addCameraSource(source: CameraConfigInputSettings, cameraId: string, pluginId: string): Promise<void>;
|
|
21
20
|
updateCameraSource(sourceId: string, source: Partial<CameraConfigInputSettings>, cameraId: string, pluginId: string): Promise<void>;
|
|
22
21
|
removeCameraSource(sourceId: string, cameraId: string, pluginId: string): Promise<void>;
|
|
23
|
-
refreshStates(cameraId: string):
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
cameraState: boolean;
|
|
27
|
-
};
|
|
28
|
-
onRequest<T extends keyof CameraInterfaces, K extends MethodKeys<CameraInterfaces[T]>>(cameraId: string, client: T, fn: K, ...args: Parameters<MethodType<CameraInterfaces[T], K>>): Promise<Awaited<ReturnType<MethodType<CameraInterfaces[T], K>>>>;
|
|
29
|
-
handleMessage(message: ProxyMessageStructure): Promise<void | ProxyMessageStructure>;
|
|
22
|
+
refreshStates(cameraId: string): RefreshedStates;
|
|
23
|
+
onRequest<T extends keyof CameraInterfaces, K extends MethodKeys<CameraInterfaces[T]>>(cameraId: string, client: T, fn: K, ...args: Parameters<MethodType<CameraInterfaces[T], K>>): Promise<Awaited<ReturnType<MethodType<CameraInterfaces[T], K>>> | void>;
|
|
24
|
+
requestHandler(message: ProxyMessageStructure): Promise<void | ProxyMessageStructure>;
|
|
30
25
|
}
|