@camera.ui/browser 0.0.106 → 0.0.108
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 +0 -2
- package/dist/types/packages/client/browser/src/streaming/go2rts-session.d.ts +16 -3
- package/dist/types/packages/client/browser/src/types.d.ts +3 -2
- package/dist/types/packages/plugineer/src/polyglot/node/camera/index.d.ts +2 -3
- package/dist/types/packages/plugineer/src/polyglot/node/camera/types.d.ts +5 -2
- package/dist/types/packages/plugineer/src/polyglot/node/plugins/schema.d.ts +2 -229
- package/dist/types/packages/plugineer/src/polyglot/node/plugins/types.d.ts +4 -10
- package/dist/types/packages/types/src/index.d.ts +33 -17
- package/dist/types/server/src/api/database/index.d.ts +1 -2
- package/dist/types/server/src/api/database/migration.d.ts +9 -7
- package/dist/types/server/src/api/database/types.d.ts +2 -10
- package/dist/types/server/src/api/schemas/cameras.schema.d.ts +48 -48
- package/dist/types/server/src/api/schemas/config.schema.d.ts +6 -6
- package/dist/types/server/src/api/schemas/go2rtc.schema.d.ts +84 -84
- package/dist/types/server/src/api/types/index.d.ts +1 -1
- package/dist/types/server/src/api/websocket/go2rtc.d.ts +21 -0
- package/dist/types/server/src/{nats/websocket.d.ts → api/websocket/nsp/proxy.d.ts} +2 -2
- package/dist/types/server/src/api.d.ts +1 -0
- package/dist/types/server/src/camera/controller.d.ts +5 -3
- package/dist/types/server/src/camera/frameWorker.d.ts +3 -0
- package/dist/types/server/src/nats/index.d.ts +2 -2
- package/dist/types/server/src/nats/types.d.ts +1 -1
- package/dist/types/server/src/plugins/index.d.ts +3 -0
- package/dist/types/server/src/plugins/plugin.d.ts +0 -1
- package/dist/types/server/src/plugins/schema.d.ts +34 -0
- package/dist/types/shared/types/index.d.ts +1 -0
- package/package.json +5 -5
- package/dist/types/packages/plugineer/src/polyglot/node/camera/interfaces/prebuffer.d.ts +0 -8
|
@@ -17,37 +17,37 @@ export declare const logSchema: zod.ZodObject<{
|
|
|
17
17
|
streams: zod.ZodUnion<[zod.ZodLiteral<"info">, zod.ZodLiteral<"debug">, zod.ZodLiteral<"trace">, zod.ZodLiteral<"warn">, zod.ZodLiteral<"error">, zod.ZodLiteral<"fatal">]>;
|
|
18
18
|
webrtc: zod.ZodUnion<[zod.ZodLiteral<"info">, zod.ZodLiteral<"debug">, zod.ZodLiteral<"trace">, zod.ZodLiteral<"warn">, zod.ZodLiteral<"error">, zod.ZodLiteral<"fatal">]>;
|
|
19
19
|
}, "strict", zod.ZodTypeAny, {
|
|
20
|
-
|
|
21
|
-
level: "error" | "info" | "debug" | "warn" | "trace" | "fatal";
|
|
20
|
+
level: "info" | "error" | "debug" | "warn" | "trace" | "fatal";
|
|
22
21
|
format: string;
|
|
23
|
-
mjpeg: "
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
22
|
+
mjpeg: "info" | "error" | "debug" | "warn" | "trace" | "fatal";
|
|
23
|
+
mp4: "info" | "error" | "debug" | "warn" | "trace" | "fatal";
|
|
24
|
+
rtsp: "info" | "error" | "debug" | "warn" | "trace" | "fatal";
|
|
25
|
+
webrtc: "info" | "error" | "debug" | "warn" | "trace" | "fatal";
|
|
26
|
+
hls: "info" | "error" | "debug" | "warn" | "trace" | "fatal";
|
|
27
|
+
api: "info" | "error" | "debug" | "warn" | "trace" | "fatal";
|
|
28
|
+
exec: "info" | "error" | "debug" | "warn" | "trace" | "fatal";
|
|
29
|
+
ngrok: "info" | "error" | "debug" | "warn" | "trace" | "fatal";
|
|
30
|
+
rtmp: "info" | "error" | "debug" | "warn" | "trace" | "fatal";
|
|
31
|
+
homekit: "info" | "error" | "debug" | "warn" | "trace" | "fatal";
|
|
32
|
+
webtorrent: "info" | "error" | "debug" | "warn" | "trace" | "fatal";
|
|
33
|
+
hass: "info" | "error" | "debug" | "warn" | "trace" | "fatal";
|
|
34
|
+
streams: "info" | "error" | "debug" | "warn" | "trace" | "fatal";
|
|
35
35
|
}, {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
rtsp: "
|
|
39
|
-
webrtc: "
|
|
40
|
-
hls: "
|
|
41
|
-
api: "
|
|
42
|
-
exec: "
|
|
43
|
-
ngrok: "
|
|
44
|
-
rtmp: "
|
|
45
|
-
homekit: "
|
|
46
|
-
webtorrent: "
|
|
47
|
-
streams: "
|
|
48
|
-
level?: "
|
|
36
|
+
mjpeg: "info" | "error" | "debug" | "warn" | "trace" | "fatal";
|
|
37
|
+
mp4: "info" | "error" | "debug" | "warn" | "trace" | "fatal";
|
|
38
|
+
rtsp: "info" | "error" | "debug" | "warn" | "trace" | "fatal";
|
|
39
|
+
webrtc: "info" | "error" | "debug" | "warn" | "trace" | "fatal";
|
|
40
|
+
hls: "info" | "error" | "debug" | "warn" | "trace" | "fatal";
|
|
41
|
+
api: "info" | "error" | "debug" | "warn" | "trace" | "fatal";
|
|
42
|
+
exec: "info" | "error" | "debug" | "warn" | "trace" | "fatal";
|
|
43
|
+
ngrok: "info" | "error" | "debug" | "warn" | "trace" | "fatal";
|
|
44
|
+
rtmp: "info" | "error" | "debug" | "warn" | "trace" | "fatal";
|
|
45
|
+
homekit: "info" | "error" | "debug" | "warn" | "trace" | "fatal";
|
|
46
|
+
webtorrent: "info" | "error" | "debug" | "warn" | "trace" | "fatal";
|
|
47
|
+
streams: "info" | "error" | "debug" | "warn" | "trace" | "fatal";
|
|
48
|
+
level?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
49
49
|
format?: string | undefined;
|
|
50
|
-
hass?: "
|
|
50
|
+
hass?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
51
51
|
}>;
|
|
52
52
|
export declare const apiSchema: zod.ZodObject<{
|
|
53
53
|
listen: zod.ZodDefault<zod.ZodString>;
|
|
@@ -322,37 +322,37 @@ export declare const patchGo2RtcSchema: zod.ZodObject<{
|
|
|
322
322
|
streams: zod.ZodOptional<zod.ZodUnion<[zod.ZodLiteral<"info">, zod.ZodLiteral<"debug">, zod.ZodLiteral<"trace">, zod.ZodLiteral<"warn">, zod.ZodLiteral<"error">, zod.ZodLiteral<"fatal">]>>;
|
|
323
323
|
webrtc: zod.ZodOptional<zod.ZodUnion<[zod.ZodLiteral<"info">, zod.ZodLiteral<"debug">, zod.ZodLiteral<"trace">, zod.ZodLiteral<"warn">, zod.ZodLiteral<"error">, zod.ZodLiteral<"fatal">]>>;
|
|
324
324
|
}, "strict", zod.ZodTypeAny, {
|
|
325
|
-
|
|
326
|
-
level?: "error" | "info" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
325
|
+
level?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
327
326
|
format?: string | undefined;
|
|
328
|
-
mjpeg?: "
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
327
|
+
mjpeg?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
328
|
+
mp4?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
329
|
+
rtsp?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
330
|
+
webrtc?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
331
|
+
hls?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
332
|
+
api?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
333
|
+
exec?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
334
|
+
ngrok?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
335
|
+
rtmp?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
336
|
+
homekit?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
337
|
+
webtorrent?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
338
|
+
hass?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
339
|
+
streams?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
340
340
|
}, {
|
|
341
|
-
|
|
342
|
-
level?: "error" | "info" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
341
|
+
level?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
343
342
|
format?: string | undefined;
|
|
344
|
-
mjpeg?: "
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
343
|
+
mjpeg?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
344
|
+
mp4?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
345
|
+
rtsp?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
346
|
+
webrtc?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
347
|
+
hls?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
348
|
+
api?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
349
|
+
exec?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
350
|
+
ngrok?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
351
|
+
rtmp?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
352
|
+
homekit?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
353
|
+
webtorrent?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
354
|
+
hass?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
355
|
+
streams?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
356
356
|
}>>;
|
|
357
357
|
api: zod.ZodDefault<zod.ZodObject<{
|
|
358
358
|
listen: zod.ZodDefault<zod.ZodString>;
|
|
@@ -582,21 +582,21 @@ export declare const patchGo2RtcSchema: zod.ZodObject<{
|
|
|
582
582
|
output: string;
|
|
583
583
|
};
|
|
584
584
|
log: {
|
|
585
|
-
|
|
586
|
-
level?: "error" | "info" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
585
|
+
level?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
587
586
|
format?: string | undefined;
|
|
588
|
-
mjpeg?: "
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
587
|
+
mjpeg?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
588
|
+
mp4?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
589
|
+
rtsp?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
590
|
+
webrtc?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
591
|
+
hls?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
592
|
+
api?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
593
|
+
exec?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
594
|
+
ngrok?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
595
|
+
rtmp?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
596
|
+
homekit?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
597
|
+
webtorrent?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
598
|
+
hass?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
599
|
+
streams?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
600
600
|
};
|
|
601
601
|
srtp: {
|
|
602
602
|
listen: string;
|
|
@@ -680,21 +680,21 @@ export declare const patchGo2RtcSchema: zod.ZodObject<{
|
|
|
680
680
|
output?: string | undefined;
|
|
681
681
|
}) | undefined;
|
|
682
682
|
log?: {
|
|
683
|
-
|
|
684
|
-
level?: "error" | "info" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
683
|
+
level?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
685
684
|
format?: string | undefined;
|
|
686
|
-
mjpeg?: "
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
685
|
+
mjpeg?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
686
|
+
mp4?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
687
|
+
rtsp?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
688
|
+
webrtc?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
689
|
+
hls?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
690
|
+
api?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
691
|
+
exec?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
692
|
+
ngrok?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
693
|
+
rtmp?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
694
|
+
homekit?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
695
|
+
webtorrent?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
696
|
+
hass?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
697
|
+
streams?: "info" | "error" | "debug" | "warn" | "trace" | "fatal" | undefined;
|
|
698
698
|
} | undefined;
|
|
699
699
|
srtp?: {
|
|
700
700
|
listen?: string | undefined;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { WebSocket } from 'ws';
|
|
2
|
+
import type { Socket } from 'socket.io';
|
|
3
|
+
import type { StreamPayload } from '../../nats/types.js';
|
|
4
|
+
import type { LoggerService } from '../../services/logger/index.js';
|
|
5
|
+
import type { VideoStreamingMode } from '../database/types.js';
|
|
6
|
+
export declare class Go2RTCBridge {
|
|
7
|
+
private logger;
|
|
8
|
+
private socket;
|
|
9
|
+
private go2rtcApi;
|
|
10
|
+
id: string;
|
|
11
|
+
url: string;
|
|
12
|
+
sourceName: string;
|
|
13
|
+
ws?: WebSocket;
|
|
14
|
+
mode?: VideoStreamingMode;
|
|
15
|
+
constructor(id: string, sourceName: string, url: string, socket: Socket, logger: LoggerService);
|
|
16
|
+
connect(): void;
|
|
17
|
+
reconnect(): void;
|
|
18
|
+
close(destroy?: boolean): void;
|
|
19
|
+
send(data: StreamPayload): void;
|
|
20
|
+
sendStreamInfo(): Promise<any>;
|
|
21
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { CameraDeviceListenerMessagePayload } from '@camera.ui/plugineer';
|
|
2
2
|
import type { StateValues } from '@camera.ui/types';
|
|
3
3
|
import type { Namespace, Server } from 'socket.io';
|
|
4
|
-
import type { SocketNsp } from '../
|
|
5
|
-
export declare class
|
|
4
|
+
import type { SocketNsp } from '../types.js';
|
|
5
|
+
export declare class CameraUiProxy {
|
|
6
6
|
nsp: Namespace;
|
|
7
7
|
nspName: SocketNsp;
|
|
8
8
|
private logger;
|
|
@@ -20,6 +20,7 @@ export declare class CameraUiAPI extends EventEmitter {
|
|
|
20
20
|
addCamera(camera: Camera): Promise<CameraController>;
|
|
21
21
|
getCamera(cameraIdOrName: string): CameraController | undefined;
|
|
22
22
|
getCameras(pluginId?: string): CameraController[];
|
|
23
|
+
resetCameraState(cameraId: string, extension: CameraExtension): void;
|
|
23
24
|
updateCamera(camera: Camera): void;
|
|
24
25
|
removeCamera(camera: Camera, extensions: CameraExtensions): Promise<void>;
|
|
25
26
|
selectCamera(pluginId: string, camera: Camera, extension: CameraExtension): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CameraDevice,
|
|
1
|
+
import { CameraDevice, CameraPTZInterface } from '@camera.ui/plugineer';
|
|
2
2
|
import { FrameWorker } from './frameWorker.js';
|
|
3
3
|
import type { Logger } from '@camera.ui/common/logger';
|
|
4
4
|
import type { Camera, CameraConfigInputSettings, CameraDelegate, CameraDeviceInternalSource, CameraDeviceSource, MotionFrame, ProbeConfig, ProbeStream, SetValues, VideoFrame } from '@camera.ui/types';
|
|
@@ -12,6 +12,7 @@ export declare class CameraController extends CameraDevice {
|
|
|
12
12
|
private objectTimeoutDuration;
|
|
13
13
|
private audioTimeout?;
|
|
14
14
|
private audioTimeoutDuration;
|
|
15
|
+
private blockMotionResetEvents;
|
|
15
16
|
private proxyServer;
|
|
16
17
|
private go2rtcApi;
|
|
17
18
|
private configService;
|
|
@@ -20,7 +21,6 @@ export declare class CameraController extends CameraDevice {
|
|
|
20
21
|
private truncateIntervalMs;
|
|
21
22
|
protected cameraDelegate: CameraDelegate;
|
|
22
23
|
protected ptzDelegate: CameraPTZInterface;
|
|
23
|
-
protected prebufferDelegate: CameraPrebufferInterface;
|
|
24
24
|
get logPath(): string;
|
|
25
25
|
get streamSource(): CameraDeviceSource;
|
|
26
26
|
get camera(): Camera;
|
|
@@ -32,13 +32,14 @@ export declare class CameraController extends CameraDevice {
|
|
|
32
32
|
getMotionFrames(): AsyncIterableIterator<MotionFrame>;
|
|
33
33
|
connect(): Promise<void>;
|
|
34
34
|
disconnect(): Promise<void>;
|
|
35
|
-
updateState<T extends keyof SetValues>(stateName: T, eventData: SetValues[T]): Promise<void>;
|
|
35
|
+
updateState<T extends keyof SetValues>(stateName: T, eventData: SetValues[T], frame?: undefined, override?: boolean): Promise<void>;
|
|
36
36
|
probeStream(sourceId: string, probeConfig?: ProbeConfig, refresh?: boolean): Promise<ProbeStream | undefined>;
|
|
37
37
|
addCameraSource(source: CameraConfigInputSettings): Promise<void>;
|
|
38
38
|
updateCameraSource(sourceId: string, source: Partial<CameraConfigInputSettings>): Promise<void>;
|
|
39
39
|
removeCameraSource(sourceId: string): Promise<void>;
|
|
40
40
|
updateCamera(updatedCamera: Camera): void;
|
|
41
41
|
cleanup(): void;
|
|
42
|
+
stop(): void;
|
|
42
43
|
writeLog(...args: any[]): void;
|
|
43
44
|
private subscribeToCameraState;
|
|
44
45
|
private subscribeToCameraChanges;
|
|
@@ -52,6 +53,7 @@ export declare class CameraController extends CameraDevice {
|
|
|
52
53
|
private isCameraEvent;
|
|
53
54
|
private generateAudioStreamInfo;
|
|
54
55
|
private generateVideoStreamInfo;
|
|
56
|
+
private clearTimers;
|
|
55
57
|
private writeHeader;
|
|
56
58
|
private closeLogStream;
|
|
57
59
|
private removeLogStream;
|
|
@@ -16,6 +16,7 @@ export declare class FrameWorker extends Subscribed {
|
|
|
16
16
|
private configService;
|
|
17
17
|
private socketService;
|
|
18
18
|
private cameraController;
|
|
19
|
+
private logBuffer;
|
|
19
20
|
private frameWorker?;
|
|
20
21
|
private initialized;
|
|
21
22
|
private stopped;
|
|
@@ -39,4 +40,6 @@ export declare class FrameWorker extends Subscribed {
|
|
|
39
40
|
private onChildMessage;
|
|
40
41
|
private setStatus;
|
|
41
42
|
private createPythonPath;
|
|
43
|
+
private handleLogData;
|
|
44
|
+
private writeProcessLog;
|
|
42
45
|
}
|
|
@@ -6,16 +6,16 @@ import { NatsServer } from './server.js';
|
|
|
6
6
|
import type { ProxySubscription } from '@camera.ui/common';
|
|
7
7
|
import type { CameraDeviceListenerMessagePayload, CoreManagerProxyEvents, DeviceManagerProxyEvents } from '@camera.ui/plugineer';
|
|
8
8
|
import type { CameraStorage, StateValues } from '@camera.ui/types';
|
|
9
|
+
import type { CameraUiProxy } from '../api/websocket/nsp/proxy.js';
|
|
9
10
|
import type { MethodKeys, MethodType } from '../types.js';
|
|
10
11
|
import type { PluginMap, ProxyAuth } from './types.js';
|
|
11
|
-
import type { WebsocketProxy } from './websocket.js';
|
|
12
12
|
export declare class ProxyServer {
|
|
13
13
|
private api;
|
|
14
14
|
private logger;
|
|
15
15
|
coreManagerProxy?: CoreManagerProxy;
|
|
16
16
|
deviceManagerProxy?: DeviceManagerProxy;
|
|
17
17
|
cameraDeviceProxy?: CameraDeviceProxy;
|
|
18
|
-
websocketProxy?:
|
|
18
|
+
websocketProxy?: CameraUiProxy;
|
|
19
19
|
server: NatsServer;
|
|
20
20
|
publisher?: ProxyConnection;
|
|
21
21
|
subscriber?: ProxySubscription;
|
|
@@ -7,7 +7,7 @@ export interface ProxyAuth {
|
|
|
7
7
|
}
|
|
8
8
|
export type WebsocketClientProxyEvent = 'updateDevice' | 'updateState';
|
|
9
9
|
export interface StreamPayload {
|
|
10
|
-
type: Exclude<VideoStreamingMode, 'webrtc' | 'webrtc/tcp'> | 'webrtc/offer' | 'webrtc/candidate';
|
|
10
|
+
type: Exclude<VideoStreamingMode, 'auto' | 'webrtc' | 'webrtc/tcp'> | 'webrtc/offer' | 'webrtc/candidate';
|
|
11
11
|
value: string;
|
|
12
12
|
}
|
|
13
13
|
export interface PluginMap {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import 'reflect-metadata';
|
|
2
2
|
import { Plugin } from './plugin.js';
|
|
3
|
+
import type { PluginContract } from '@camera.ui/plugineer';
|
|
3
4
|
import type { IPackageJson } from '../api/types/index.js';
|
|
4
5
|
export declare class PluginManager {
|
|
5
6
|
private logger;
|
|
@@ -11,10 +12,12 @@ export declare class PluginManager {
|
|
|
11
12
|
pluginIdentifiers: Set<string>;
|
|
12
13
|
constructor();
|
|
13
14
|
static isQualifiedPluginIdentifier(pluginName: string): boolean;
|
|
15
|
+
static isQualifiedPluginContract(contract?: Partial<PluginContract>): boolean;
|
|
14
16
|
static extractPluginScope(pluginName: string): string | undefined;
|
|
15
17
|
static extractPluginName(pluginName: string): string;
|
|
16
18
|
static transformDisplaName(pluginName: string): string;
|
|
17
19
|
static loadPackageJSON(installPath: string): IPackageJson;
|
|
20
|
+
static parseContract(pjson: IPackageJson): PluginContract;
|
|
18
21
|
initializeInstalledPlugins(): Promise<void>;
|
|
19
22
|
initializeInstalledPlugin(plugin: Plugin): Promise<void>;
|
|
20
23
|
loadPlugin(absolutePath: string, oldId?: string): Promise<Plugin>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { JsonSchema, JsonSchemaArray, JsonSchemaBoolean, JsonSchemaEnum, JsonSchemaForm, JsonSchemaNumber, JsonSchemaObject, JsonSchemaObjectButton, JsonSchemaObjectWithButtons, JsonSchemaString, RootSchema } from '@camera.ui/types';
|
|
3
|
+
import type { ZodTypeAny } from 'zod';
|
|
4
|
+
type RootZodSchema = z.ZodObject<Record<string, ZodTypeAny>, 'strict', ZodTypeAny, Record<string, any>, Record<string, any>>;
|
|
5
|
+
type OptionalZodString = z.ZodOptional<z.ZodString> | z.ZodString | z.ZodOptional<z.ZodEffects<z.ZodString, string, string>> | z.ZodEffects<z.ZodString, string, string>;
|
|
6
|
+
type OptionalZodNumber = z.ZodOptional<z.ZodNumber> | z.ZodNumber | z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>> | z.ZodEffects<z.ZodNumber, number, number>;
|
|
7
|
+
type OptionalZodBoolean = z.ZodOptional<z.ZodBoolean> | z.ZodBoolean;
|
|
8
|
+
type OptionalZodZobject = z.ZodOptional<z.ZodObject<Record<string, z.ZodTypeAny>, 'strict', z.ZodTypeAny, Record<string, any>, Record<string, any>>> | z.ZodObject<Record<string, z.ZodTypeAny>, 'strict', z.ZodTypeAny, Record<string, any>, Record<string, any>> | z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>> | z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
9
|
+
type OptionalZodArray = z.ZodOptional<z.ZodType<any, any, any>> | z.ZodType<any, any, any>;
|
|
10
|
+
type OptionalZodEnum = z.ZodOptional<z.ZodUnion<[z.ZodTypeAny, z.ZodTypeAny, ...z.ZodTypeAny[]]>> | z.ZodUnion<[z.ZodTypeAny, z.ZodTypeAny, ...z.ZodTypeAny[]]> | z.ZodEffects<z.ZodAny, any, any> | z.ZodUnion<any>;
|
|
11
|
+
type OptionalZodEnumMultiple = z.ZodOptional<z.ZodArray<z.ZodUnion<[ZodTypeAny, ZodTypeAny, ...ZodTypeAny[]]>, 'many'>> | z.ZodArray<z.ZodUnion<[ZodTypeAny, ZodTypeAny, ...ZodTypeAny[]]>, 'many'> | z.ZodEffects<z.ZodAny, any, any> | z.ZodUnion<any>;
|
|
12
|
+
type ZodAny = z.ZodType<any, any, any>;
|
|
13
|
+
export declare const generateSchema: (value: any) => JsonSchema;
|
|
14
|
+
export declare const generateRootSchema: (value: Record<string, any>) => RootSchema;
|
|
15
|
+
export declare const generateJsonFromSchemaWithConfig: (jsonSchema: JsonSchema, config: Record<string, any>, path?: string) => any;
|
|
16
|
+
export declare const generateStorableConfig: (jsonSchema: JsonSchemaForm | JsonSchema, config: Record<string, any>) => Record<string, any>;
|
|
17
|
+
export declare const schemaIsReadonly: (jsonSchema: JsonSchema, group?: string) => boolean;
|
|
18
|
+
export declare const schemaIsStorable: (jsonSchema: JsonSchema, group?: string) => boolean;
|
|
19
|
+
export declare const generateZodSchemaFromRoot: (rootSchema: RootSchema) => RootZodSchema;
|
|
20
|
+
export declare const generateZodSchema: (jsonSchema: JsonSchema) => ZodAny;
|
|
21
|
+
export declare const generateNumberSchema: () => JsonSchemaNumber;
|
|
22
|
+
export declare const genereateBooleanSchema: () => JsonSchemaBoolean;
|
|
23
|
+
export declare const generateStringSchema: (value: string) => JsonSchemaString;
|
|
24
|
+
export declare const generateEnumSchema: (value: (string | number | boolean)[]) => JsonSchemaEnum;
|
|
25
|
+
export declare const generateObjectSchema: (value: Record<string, any>) => JsonSchemaObject;
|
|
26
|
+
export declare const generateObjectSchemaWithButtons: (value: Record<string, any>, buttons: JsonSchemaObjectButton[]) => JsonSchemaObjectWithButtons;
|
|
27
|
+
export declare const generateArraySchema: (array: string[] | number[] | boolean[] | Record<string, any>[]) => JsonSchemaArray;
|
|
28
|
+
export declare const createZodStringSchema: (jsonSchema: JsonSchemaString) => OptionalZodString;
|
|
29
|
+
export declare const createZodNumberSchema: (jsonSchema: JsonSchemaNumber) => OptionalZodNumber;
|
|
30
|
+
export declare const createZodBooleanSchema: (jsonSchema: JsonSchemaBoolean) => OptionalZodBoolean;
|
|
31
|
+
export declare const createEnumSchema: (jsonSchema: JsonSchemaEnum) => OptionalZodEnum | OptionalZodEnumMultiple;
|
|
32
|
+
export declare const createZodObjectSchema: (jsonSchema: JsonSchemaObject) => OptionalZodZobject;
|
|
33
|
+
export declare const createZodArraySchema: (jsonSchema: JsonSchemaArray) => OptionalZodArray;
|
|
34
|
+
export {};
|
|
@@ -15,6 +15,7 @@ export type * from '../../server/src/api/websocket/types.js';
|
|
|
15
15
|
export type * from '../../server/src/camera/types.js';
|
|
16
16
|
export * from '../../server/src/go2rtc/types.js';
|
|
17
17
|
export type * from '../../server/src/nats/types.js';
|
|
18
|
+
export * from '../../server/src/plugins/schema.js';
|
|
18
19
|
export * from '../../server/src/plugins/types.js';
|
|
19
20
|
export * from '../../server/src/services/config/types.js';
|
|
20
21
|
export type * from '../../server/src/types.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camera.ui/browser",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.108",
|
|
4
4
|
"description": "camera.ui browser client",
|
|
5
5
|
"author": "seydx (https://github.com/seydx/camera.ui)",
|
|
6
6
|
"exports": {
|
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
"socket.io-client": "^4.8.1"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@stylistic/eslint-plugin": "^2.
|
|
34
|
-
"@typescript-eslint/parser": "^8.
|
|
35
|
-
"eslint": "^9.
|
|
33
|
+
"@stylistic/eslint-plugin": "^2.11.0",
|
|
34
|
+
"@typescript-eslint/parser": "^8.15.0",
|
|
35
|
+
"eslint": "^9.15.0",
|
|
36
36
|
"globals": "^15.12.0",
|
|
37
37
|
"prettier": "^3.3.3",
|
|
38
|
-
"typescript-eslint": "^8.
|
|
38
|
+
"typescript-eslint": "^8.15.0",
|
|
39
39
|
"@swc/register": "^0.1.10",
|
|
40
40
|
"@types/webrtc": "^0.0.44",
|
|
41
41
|
"bufferutil": "^4.0.8",
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { CameraPrebufferDelegate, Container, PrebufferState } from '@camera.ui/types';
|
|
2
|
-
export declare class CameraPrebufferInterface implements CameraPrebufferDelegate {
|
|
3
|
-
delegate?: CameraPrebufferDelegate;
|
|
4
|
-
private onRequest;
|
|
5
|
-
constructor(onRequest: (client: any, fn: string, args?: any[], timeout?: number) => Promise<any>);
|
|
6
|
-
getPrebufferingState(sourceName: string, container: Container): Promise<PrebufferState | undefined>;
|
|
7
|
-
private _onRequest;
|
|
8
|
-
}
|