@camera.ui/browser 0.0.105 → 0.0.107

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.
@@ -12,8 +12,8 @@ export declare class Go2RTCSession extends EventTarget {
12
12
  hasBackchannel: boolean;
13
13
  hasAudio: boolean;
14
14
  closed: boolean;
15
- micTransceiver: RTCRtpTransceiver | null;
16
15
  private pc;
16
+ private micTransceiver;
17
17
  private buf;
18
18
  private mediaSource;
19
19
  private sourceBuffer;
@@ -22,18 +22,25 @@ export declare class Go2RTCSession extends EventTarget {
22
22
  private videoPlayerMp4?;
23
23
  private media;
24
24
  private codecList;
25
- private reconnectTimeout?;
25
+ private wsReconnectTimeout?;
26
+ private webrtcConnectTimeout?;
27
+ private webrtcReconnectTimeout?;
28
+ private wsReconnectTimer?;
29
+ private webrtcReconnectTimer;
30
+ private webrtcTimeoutTimer;
26
31
  private _finishLoading;
27
32
  private _firstFrameReceived;
28
33
  private animationFrameId?;
34
+ private isAutoSwitching;
29
35
  get mode(): VideoStreamingMode;
30
- private webrtcReconnectTimeout?;
36
+ private get logPrefix();
31
37
  constructor(cameraDevice: CameraDevice, socketService: SocketService, logger: BaseLogger, options: Go2RTCSessionOptions);
32
38
  connect(customMode?: VideoStreamingMode): void;
33
39
  disconnect(): void;
34
40
  reconnect(customMode?: VideoStreamingMode): Promise<void>;
35
41
  reset(): void;
36
42
  close(): void;
43
+ toggleMicrophone(track: MediaStreamTrack | null): Promise<void>;
37
44
  private onWsOpen;
38
45
  private onWsClose;
39
46
  private onWsMessage;
@@ -42,16 +49,22 @@ export declare class Go2RTCSession extends EventTarget {
42
49
  private requestMse;
43
50
  private onMseData;
44
51
  private onMseBuffer;
52
+ private requestAuto;
45
53
  private requestMjpeg;
46
54
  private onMjpegBuffer;
47
55
  private requestMp4;
48
56
  private onMp4Buffer;
49
57
  private requestHls;
50
58
  private onHlsData;
59
+ private handleAutoMode;
60
+ private evaluateStreamQuality;
61
+ private evaluateMSEQuality;
51
62
  private onStreamInfo;
52
63
  private play;
64
+ private onFirstFrameWebrtc;
53
65
  private onFirstFrame;
54
66
  private onFinishLoading;
67
+ private setMode;
55
68
  private createCodecsList;
56
69
  private parseCodecs;
57
70
  private btoaBinary;
@@ -29,7 +29,8 @@ export interface Go2RTCSessionOptions {
29
29
  sourceName: string;
30
30
  mode: VideoStreamingMode;
31
31
  videoElement: HTMLVideoElement;
32
- reconnectInterval?: number;
32
+ wsReconnectTimeout?: number;
33
+ webrtcConnectTimeout?: number;
33
34
  }
34
35
  export interface BaseLogger {
35
36
  log: (...args: any[]) => void;
@@ -180,7 +180,7 @@ export interface BaseState<T extends LightState | AudioState | MotionState | Obj
180
180
  lastEvent?: Omit<T, 'lastEvent'>;
181
181
  }
182
182
  export interface MotionSetEvent {
183
- state?: boolean;
183
+ state: boolean;
184
184
  detections: Detection[];
185
185
  }
186
186
  export interface AudioSetEvent {
@@ -381,6 +381,7 @@ export interface RTSPSession extends Subscribed {
381
381
  readonly onVideoRtp: Subject<RtpPacket>;
382
382
  readonly onAudioRtp: Subject<RtpPacket>;
383
383
  reservePort(bufferPorts?: number): Promise<number>;
384
+ startStream(): Promise<void>;
384
385
  startTranscoding(ffmpegOptions: FfmpegOptions): Promise<void>;
385
386
  transcodeReturnAudio(ffmpegOptions: ReturnAudioFFmpegOptions): Promise<void>;
386
387
  stop(): void;
@@ -587,10 +588,12 @@ export interface JsonSchemaArray extends JsonBaseSchema {
587
588
  }
588
589
  export interface JsonSchemaButton extends JsonBaseSchema {
589
590
  type: 'button';
591
+ color?: string;
590
592
  }
591
593
  export interface JsonSchemaObjectButton {
592
594
  label: string;
593
595
  onSubmit: string;
596
+ color?: string;
594
597
  }
595
598
  export interface JsonSchemaObjectWithButtons extends JsonSchemaObject {
596
599
  buttons: JsonSchemaObjectButton[];
@@ -1,7 +1,7 @@
1
1
  import type { Database as DB, RootDatabase as RootDB } from 'lmdb';
2
2
  import type { DBAuth, DBCamera, DBPlugin, DBSettings, DBSystem, DBUser } from './types.js';
3
3
  export declare class Database {
4
- static readonly VERSION = "1.0.7";
4
+ static readonly VERSION = "1.0.9";
5
5
  authDB: RootDB<DBAuth, 'auth'>;
6
6
  camerasDB: DB<DBCamera[], 'cameras'>;
7
7
  pluginsDB: DB<DBPlugin[], 'plugins'>;
@@ -11,7 +11,6 @@ export declare class Database {
11
11
  private lowdb;
12
12
  private databaseMigration;
13
13
  private selfCheck;
14
- private databases;
15
14
  private configService;
16
15
  private logger;
17
16
  private api;
@@ -1,13 +1,15 @@
1
- import type { CameraUiDatabase } from './types.js';
1
+ import type { Database as DB, RootDatabase as RootDB } from 'lmdb';
2
+ import type { DBAuth, DBCamera, DBPlugin, DBSettings, DBSystem, DBUser } from './types.js';
2
3
  export declare class DatabaseMigrationTable {
3
- private db;
4
+ private authDB;
5
+ private camerasDB;
6
+ private pluginsDB;
7
+ private settingsDB;
8
+ private usersDB;
9
+ private systemDB;
4
10
  private logger;
5
11
  private configService;
6
- private get camerasDB();
7
- private get pluginsDB();
8
- private get settingsDB();
9
- private get usersDB();
10
- constructor(db: CameraUiDatabase);
12
+ constructor(authDB: RootDB<DBAuth, 'auth'>, camerasDB: DB<DBCamera[], 'cameras'>, pluginsDB: DB<DBPlugin[], 'plugins'>, settingsDB: DB<DBSettings, 'settings'>, usersDB: DB<DBUser[], 'users'>, systemDB: DB<DBSystem, 'system'>);
11
13
  migrate(): Promise<void>;
12
14
  private getMigrations;
13
15
  }
@@ -1,14 +1,6 @@
1
1
  import type { UsableNetworkAddress } from '@camera.ui/common/network';
2
2
  import type { BaseCamera, CameraInputSettings, CameraRoles, ZoneCoord } from '@camera.ui/types';
3
- import type { Database as DB } from 'lmdb';
4
3
  import type { CamviewSettingsLayoutMode, ClientData, JwtTokenEncoded } from '../types/index.js';
5
- import type { CAMERAS_ID, PLUGINS_ID, SETTINGS_ID, USERS_ID } from './constants.js';
6
- export interface CameraUiDatabase {
7
- [CAMERAS_ID]: DB<DBCamera[], 'cameras'>;
8
- [PLUGINS_ID]: DB<DBPlugin[], 'plugins'>;
9
- [SETTINGS_ID]: DB<DBSettings, 'settings'>;
10
- [USERS_ID]: DB<DBUser[], 'users'>;
11
- }
12
4
  export interface DBAuth {
13
5
  tokens: JwtTokenEncoded[];
14
6
  clients: ClientData[];
@@ -85,7 +77,7 @@ export interface CameraUiSettings {
85
77
  streamingMode: VideoStreamingMode;
86
78
  streamingSource: Exclude<CameraRoles, 'snapshot'>;
87
79
  }
88
- export type VideoStreamingMode = 'webrtc' | 'mse' | 'webrtc/tcp' | 'mjpeg' | 'hls' | 'mp4';
80
+ export type VideoStreamingMode = 'auto' | 'webrtc' | 'mse' | 'webrtc/tcp' | 'mjpeg' | 'hls' | 'mp4';
89
81
  export interface SystemInfo extends DBSystem {
90
82
  networkAddresses: UsableNetworkAddress[];
91
83
  }
@@ -216,7 +216,7 @@ export declare const extensionsSettingsSchema: zod.ZodObject<{
216
216
  audioDetection?: string | undefined;
217
217
  ptz?: string | undefined;
218
218
  }>;
219
- export declare const streamingModeSchema: zod.ZodUnion<[zod.ZodLiteral<"mse">, zod.ZodLiteral<"webrtc">, zod.ZodLiteral<"webrtc/tcp">, zod.ZodLiteral<"mjpeg">, zod.ZodLiteral<"hls">, zod.ZodLiteral<"mp4">]>;
219
+ export declare const streamingModeSchema: zod.ZodUnion<[zod.ZodLiteral<"auto">, zod.ZodLiteral<"mse">, zod.ZodLiteral<"webrtc">, zod.ZodLiteral<"webrtc/tcp">, zod.ZodLiteral<"mjpeg">, zod.ZodLiteral<"hls">, zod.ZodLiteral<"mp4">]>;
220
220
  export declare const frameWorkerSettingsSchema: zod.ZodObject<{
221
221
  decoder: zod.ZodUnion<[zod.ZodLiteral<"pillow">, zod.ZodLiteral<"wasm">, zod.ZodLiteral<"rust">]>;
222
222
  fps: zod.ZodNumber;
@@ -232,13 +232,13 @@ export declare const frameWorkerSettingsSchema: zod.ZodObject<{
232
232
  }>;
233
233
  export declare const cameraTypeSchema: zod.ZodUnion<[zod.ZodLiteral<"camera">, zod.ZodLiteral<"doorbell">]>;
234
234
  export declare const interfaceSettingsSchema: zod.ZodObject<{
235
- streamingMode: zod.ZodUnion<[zod.ZodLiteral<"mse">, zod.ZodLiteral<"webrtc">, zod.ZodLiteral<"webrtc/tcp">, zod.ZodLiteral<"mjpeg">, zod.ZodLiteral<"hls">, zod.ZodLiteral<"mp4">]>;
235
+ streamingMode: zod.ZodUnion<[zod.ZodLiteral<"auto">, zod.ZodLiteral<"mse">, zod.ZodLiteral<"webrtc">, zod.ZodLiteral<"webrtc/tcp">, zod.ZodLiteral<"mjpeg">, zod.ZodLiteral<"hls">, zod.ZodLiteral<"mp4">]>;
236
236
  streamingSource: zod.ZodUnion<[zod.ZodLiteral<"high-resolution">, zod.ZodLiteral<"mid-resolution">, zod.ZodLiteral<"low-resolution">]>;
237
237
  }, "strip", zod.ZodTypeAny, {
238
- streamingMode: "mp4" | "mjpeg" | "mse" | "webrtc" | "webrtc/tcp" | "hls";
238
+ streamingMode: "mp4" | "mjpeg" | "auto" | "mse" | "webrtc" | "webrtc/tcp" | "hls";
239
239
  streamingSource: "high-resolution" | "mid-resolution" | "low-resolution";
240
240
  }, {
241
- streamingMode: "mp4" | "mjpeg" | "mse" | "webrtc" | "webrtc/tcp" | "hls";
241
+ streamingMode: "mp4" | "mjpeg" | "auto" | "mse" | "webrtc" | "webrtc/tcp" | "hls";
242
242
  streamingSource: "high-resolution" | "mid-resolution" | "low-resolution";
243
243
  }>;
244
244
  export declare const cameraInfoSchema: zod.ZodObject<{
@@ -362,13 +362,13 @@ export declare const createCameraSchema: zod.ZodObject<{
362
362
  enabled?: boolean | undefined;
363
363
  }>>;
364
364
  interface: zod.ZodDefault<zod.ZodObject<{
365
- streamingMode: zod.ZodUnion<[zod.ZodLiteral<"mse">, zod.ZodLiteral<"webrtc">, zod.ZodLiteral<"webrtc/tcp">, zod.ZodLiteral<"mjpeg">, zod.ZodLiteral<"hls">, zod.ZodLiteral<"mp4">]>;
365
+ streamingMode: zod.ZodUnion<[zod.ZodLiteral<"auto">, zod.ZodLiteral<"mse">, zod.ZodLiteral<"webrtc">, zod.ZodLiteral<"webrtc/tcp">, zod.ZodLiteral<"mjpeg">, zod.ZodLiteral<"hls">, zod.ZodLiteral<"mp4">]>;
366
366
  streamingSource: zod.ZodUnion<[zod.ZodLiteral<"high-resolution">, zod.ZodLiteral<"mid-resolution">, zod.ZodLiteral<"low-resolution">]>;
367
367
  }, "strip", zod.ZodTypeAny, {
368
- streamingMode: "mp4" | "mjpeg" | "mse" | "webrtc" | "webrtc/tcp" | "hls";
368
+ streamingMode: "mp4" | "mjpeg" | "auto" | "mse" | "webrtc" | "webrtc/tcp" | "hls";
369
369
  streamingSource: "high-resolution" | "mid-resolution" | "low-resolution";
370
370
  }, {
371
- streamingMode: "mp4" | "mjpeg" | "mse" | "webrtc" | "webrtc/tcp" | "hls";
371
+ streamingMode: "mp4" | "mjpeg" | "auto" | "mse" | "webrtc" | "webrtc/tcp" | "hls";
372
372
  streamingSource: "high-resolution" | "mid-resolution" | "low-resolution";
373
373
  }>>;
374
374
  activityZones: zod.ZodDefault<zod.ZodArray<zod.ZodObject<{
@@ -535,7 +535,7 @@ export declare const createCameraSchema: zod.ZodObject<{
535
535
  urls: string[];
536
536
  }[];
537
537
  interface: {
538
- streamingMode: "mp4" | "mjpeg" | "mse" | "webrtc" | "webrtc/tcp" | "hls";
538
+ streamingMode: "mp4" | "mjpeg" | "auto" | "mse" | "webrtc" | "webrtc/tcp" | "hls";
539
539
  streamingSource: "high-resolution" | "mid-resolution" | "low-resolution";
540
540
  };
541
541
  extensions: {
@@ -607,7 +607,7 @@ export declare const createCameraSchema: zod.ZodObject<{
607
607
  resolution: "3840x2160" | "3072x1728" | "2560x1440" | "1920x1080" | "1440x1080" | "1280x720" | "960x540" | "640x480" | "640x360" | "320x240" | "320x180";
608
608
  } | undefined;
609
609
  interface?: {
610
- streamingMode: "mp4" | "mjpeg" | "mse" | "webrtc" | "webrtc/tcp" | "hls";
610
+ streamingMode: "mp4" | "mjpeg" | "auto" | "mse" | "webrtc" | "webrtc/tcp" | "hls";
611
611
  streamingSource: "high-resolution" | "mid-resolution" | "low-resolution";
612
612
  } | undefined;
613
613
  extensions?: {
@@ -707,13 +707,13 @@ export declare const patchCameraSchema: zod.ZodObject<{
707
707
  plugins?: string[] | undefined;
708
708
  }>>;
709
709
  interface: zod.ZodOptional<zod.ZodObject<{
710
- streamingMode: zod.ZodOptional<zod.ZodUnion<[zod.ZodLiteral<"mse">, zod.ZodLiteral<"webrtc">, zod.ZodLiteral<"webrtc/tcp">, zod.ZodLiteral<"mjpeg">, zod.ZodLiteral<"hls">, zod.ZodLiteral<"mp4">]>>;
710
+ streamingMode: zod.ZodOptional<zod.ZodUnion<[zod.ZodLiteral<"auto">, zod.ZodLiteral<"mse">, zod.ZodLiteral<"webrtc">, zod.ZodLiteral<"webrtc/tcp">, zod.ZodLiteral<"mjpeg">, zod.ZodLiteral<"hls">, zod.ZodLiteral<"mp4">]>>;
711
711
  streamingSource: zod.ZodOptional<zod.ZodUnion<[zod.ZodLiteral<"high-resolution">, zod.ZodLiteral<"mid-resolution">, zod.ZodLiteral<"low-resolution">]>>;
712
712
  }, "strip", zod.ZodTypeAny, {
713
- streamingMode?: "mp4" | "mjpeg" | "mse" | "webrtc" | "webrtc/tcp" | "hls" | undefined;
713
+ streamingMode?: "mp4" | "mjpeg" | "auto" | "mse" | "webrtc" | "webrtc/tcp" | "hls" | undefined;
714
714
  streamingSource?: "high-resolution" | "mid-resolution" | "low-resolution" | undefined;
715
715
  }, {
716
- streamingMode?: "mp4" | "mjpeg" | "mse" | "webrtc" | "webrtc/tcp" | "hls" | undefined;
716
+ streamingMode?: "mp4" | "mjpeg" | "auto" | "mse" | "webrtc" | "webrtc/tcp" | "hls" | undefined;
717
717
  streamingSource?: "high-resolution" | "mid-resolution" | "low-resolution" | undefined;
718
718
  }>>;
719
719
  recording: zod.ZodOptional<zod.ZodObject<{
@@ -880,7 +880,7 @@ export declare const patchCameraSchema: zod.ZodObject<{
880
880
  urls: string[];
881
881
  }[] | undefined;
882
882
  interface?: {
883
- streamingMode?: "mp4" | "mjpeg" | "mse" | "webrtc" | "webrtc/tcp" | "hls" | undefined;
883
+ streamingMode?: "mp4" | "mjpeg" | "auto" | "mse" | "webrtc" | "webrtc/tcp" | "hls" | undefined;
884
884
  streamingSource?: "high-resolution" | "mid-resolution" | "low-resolution" | undefined;
885
885
  } | undefined;
886
886
  extensions?: {
@@ -943,7 +943,7 @@ export declare const patchCameraSchema: zod.ZodObject<{
943
943
  internal?: boolean | undefined;
944
944
  }[] | undefined;
945
945
  interface?: {
946
- streamingMode?: "mp4" | "mjpeg" | "mse" | "webrtc" | "webrtc/tcp" | "hls" | undefined;
946
+ streamingMode?: "mp4" | "mjpeg" | "auto" | "mse" | "webrtc" | "webrtc/tcp" | "hls" | undefined;
947
947
  streamingSource?: "high-resolution" | "mid-resolution" | "low-resolution" | undefined;
948
948
  } | undefined;
949
949
  extensions?: {
@@ -37,7 +37,7 @@ export declare const userPreferencesCamviewViewsLayout: zod.ZodObject<{
37
37
  cameraId: string;
38
38
  index: number;
39
39
  }[];
40
- viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
40
+ viewSize: 4 | 6 | 1 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
41
41
  }, {
42
42
  name: string;
43
43
  type: "dnd" | "view";
@@ -45,7 +45,7 @@ export declare const userPreferencesCamviewViewsLayout: zod.ZodObject<{
45
45
  cameraId: string;
46
46
  index: number;
47
47
  }[];
48
- viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
48
+ viewSize: 4 | 6 | 1 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
49
49
  _id?: string | undefined;
50
50
  }>;
51
51
  export declare const patchPreferencesCamviewViewsLayout: zod.ZodOptional<zod.ZodObject<{
@@ -67,14 +67,14 @@ export declare const patchPreferencesCamviewViewsLayout: zod.ZodOptional<zod.Zod
67
67
  cameraId: string;
68
68
  index: number;
69
69
  }[] | undefined;
70
- viewSize?: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26 | undefined;
70
+ viewSize?: 4 | 6 | 1 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26 | undefined;
71
71
  }, {
72
72
  name?: string | undefined;
73
73
  cameras?: {
74
74
  cameraId: string;
75
75
  index: number;
76
76
  }[] | undefined;
77
- viewSize?: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26 | undefined;
77
+ viewSize?: 4 | 6 | 1 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26 | undefined;
78
78
  }>>;
79
79
  export declare const userPreferencesCamview: zod.ZodObject<{
80
80
  views: zod.ZodArray<zod.ZodObject<{
@@ -100,7 +100,7 @@ export declare const userPreferencesCamview: zod.ZodObject<{
100
100
  cameraId: string;
101
101
  index: number;
102
102
  }[];
103
- viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
103
+ viewSize: 4 | 6 | 1 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
104
104
  }, {
105
105
  name: string;
106
106
  type: "dnd" | "view";
@@ -108,7 +108,7 @@ export declare const userPreferencesCamview: zod.ZodObject<{
108
108
  cameraId: string;
109
109
  index: number;
110
110
  }[];
111
- viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
111
+ viewSize: 4 | 6 | 1 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
112
112
  _id?: string | undefined;
113
113
  }>, "many">;
114
114
  }, "strip", zod.ZodTypeAny, {
@@ -120,7 +120,7 @@ export declare const userPreferencesCamview: zod.ZodObject<{
120
120
  cameraId: string;
121
121
  index: number;
122
122
  }[];
123
- viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
123
+ viewSize: 4 | 6 | 1 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
124
124
  }[];
125
125
  }, {
126
126
  views: {
@@ -130,7 +130,7 @@ export declare const userPreferencesCamview: zod.ZodObject<{
130
130
  cameraId: string;
131
131
  index: number;
132
132
  }[];
133
- viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
133
+ viewSize: 4 | 6 | 1 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
134
134
  _id?: string | undefined;
135
135
  }[];
136
136
  }>;
@@ -260,7 +260,7 @@ export declare const userPreferences: zod.ZodObject<{
260
260
  cameraId: string;
261
261
  index: number;
262
262
  }[];
263
- viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
263
+ viewSize: 4 | 6 | 1 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
264
264
  }, {
265
265
  name: string;
266
266
  type: "dnd" | "view";
@@ -268,7 +268,7 @@ export declare const userPreferences: zod.ZodObject<{
268
268
  cameraId: string;
269
269
  index: number;
270
270
  }[];
271
- viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
271
+ viewSize: 4 | 6 | 1 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
272
272
  _id?: string | undefined;
273
273
  }>, "many">;
274
274
  }, "strip", zod.ZodTypeAny, {
@@ -280,7 +280,7 @@ export declare const userPreferences: zod.ZodObject<{
280
280
  cameraId: string;
281
281
  index: number;
282
282
  }[];
283
- viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
283
+ viewSize: 4 | 6 | 1 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
284
284
  }[];
285
285
  }, {
286
286
  views: {
@@ -290,7 +290,7 @@ export declare const userPreferences: zod.ZodObject<{
290
290
  cameraId: string;
291
291
  index: number;
292
292
  }[];
293
- viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
293
+ viewSize: 4 | 6 | 1 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
294
294
  _id?: string | undefined;
295
295
  }[];
296
296
  }>;
@@ -362,7 +362,7 @@ export declare const userPreferences: zod.ZodObject<{
362
362
  cameraId: string;
363
363
  index: number;
364
364
  }[];
365
- viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
365
+ viewSize: 4 | 6 | 1 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
366
366
  }[];
367
367
  };
368
368
  }, {
@@ -384,7 +384,7 @@ export declare const userPreferences: zod.ZodObject<{
384
384
  cameraId: string;
385
385
  index: number;
386
386
  }[];
387
- viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
387
+ viewSize: 4 | 6 | 1 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
388
388
  _id?: string | undefined;
389
389
  }[];
390
390
  };
@@ -424,7 +424,7 @@ export declare const createUserSchema: zod.ZodEffects<zod.ZodObject<{
424
424
  cameraId: string;
425
425
  index: number;
426
426
  }[];
427
- viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
427
+ viewSize: 4 | 6 | 1 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
428
428
  }, {
429
429
  name: string;
430
430
  type: "dnd" | "view";
@@ -432,7 +432,7 @@ export declare const createUserSchema: zod.ZodEffects<zod.ZodObject<{
432
432
  cameraId: string;
433
433
  index: number;
434
434
  }[];
435
- viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
435
+ viewSize: 4 | 6 | 1 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
436
436
  _id?: string | undefined;
437
437
  }>, "many">;
438
438
  }, "strip", zod.ZodTypeAny, {
@@ -444,7 +444,7 @@ export declare const createUserSchema: zod.ZodEffects<zod.ZodObject<{
444
444
  cameraId: string;
445
445
  index: number;
446
446
  }[];
447
- viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
447
+ viewSize: 4 | 6 | 1 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
448
448
  }[];
449
449
  }, {
450
450
  views: {
@@ -454,7 +454,7 @@ export declare const createUserSchema: zod.ZodEffects<zod.ZodObject<{
454
454
  cameraId: string;
455
455
  index: number;
456
456
  }[];
457
- viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
457
+ viewSize: 4 | 6 | 1 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
458
458
  _id?: string | undefined;
459
459
  }[];
460
460
  }>;
@@ -526,7 +526,7 @@ export declare const createUserSchema: zod.ZodEffects<zod.ZodObject<{
526
526
  cameraId: string;
527
527
  index: number;
528
528
  }[];
529
- viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
529
+ viewSize: 4 | 6 | 1 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
530
530
  }[];
531
531
  };
532
532
  }, {
@@ -548,7 +548,7 @@ export declare const createUserSchema: zod.ZodEffects<zod.ZodObject<{
548
548
  cameraId: string;
549
549
  index: number;
550
550
  }[];
551
- viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
551
+ viewSize: 4 | 6 | 1 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
552
552
  _id?: string | undefined;
553
553
  }[];
554
554
  };
@@ -583,7 +583,7 @@ export declare const createUserSchema: zod.ZodEffects<zod.ZodObject<{
583
583
  cameraId: string;
584
584
  index: number;
585
585
  }[];
586
- viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
586
+ viewSize: 4 | 6 | 1 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
587
587
  }[];
588
588
  };
589
589
  };
@@ -616,7 +616,7 @@ export declare const createUserSchema: zod.ZodEffects<zod.ZodObject<{
616
616
  cameraId: string;
617
617
  index: number;
618
618
  }[];
619
- viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
619
+ viewSize: 4 | 6 | 1 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
620
620
  _id?: string | undefined;
621
621
  }[];
622
622
  };
@@ -651,7 +651,7 @@ export declare const createUserSchema: zod.ZodEffects<zod.ZodObject<{
651
651
  cameraId: string;
652
652
  index: number;
653
653
  }[];
654
- viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
654
+ viewSize: 4 | 6 | 1 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
655
655
  }[];
656
656
  };
657
657
  };
@@ -684,7 +684,7 @@ export declare const createUserSchema: zod.ZodEffects<zod.ZodObject<{
684
684
  cameraId: string;
685
685
  index: number;
686
686
  }[];
687
- viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
687
+ viewSize: 4 | 6 | 1 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
688
688
  _id?: string | undefined;
689
689
  }[];
690
690
  };
@@ -738,7 +738,7 @@ export declare const patchUserSchema: zod.ZodEffects<zod.ZodObject<{
738
738
  cameraId: string;
739
739
  index: number;
740
740
  }[];
741
- viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
741
+ viewSize: 4 | 6 | 1 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
742
742
  }, {
743
743
  name: string;
744
744
  type: "dnd" | "view";
@@ -746,7 +746,7 @@ export declare const patchUserSchema: zod.ZodEffects<zod.ZodObject<{
746
746
  cameraId: string;
747
747
  index: number;
748
748
  }[];
749
- viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
749
+ viewSize: 4 | 6 | 1 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
750
750
  _id?: string | undefined;
751
751
  }>, "many">;
752
752
  }, "strip", zod.ZodTypeAny, {
@@ -758,7 +758,7 @@ export declare const patchUserSchema: zod.ZodEffects<zod.ZodObject<{
758
758
  cameraId: string;
759
759
  index: number;
760
760
  }[];
761
- viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
761
+ viewSize: 4 | 6 | 1 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
762
762
  }[];
763
763
  }, {
764
764
  views: {
@@ -768,7 +768,7 @@ export declare const patchUserSchema: zod.ZodEffects<zod.ZodObject<{
768
768
  cameraId: string;
769
769
  index: number;
770
770
  }[];
771
- viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
771
+ viewSize: 4 | 6 | 1 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
772
772
  _id?: string | undefined;
773
773
  }[];
774
774
  }>>;
@@ -840,7 +840,7 @@ export declare const patchUserSchema: zod.ZodEffects<zod.ZodObject<{
840
840
  cameraId: string;
841
841
  index: number;
842
842
  }[];
843
- viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
843
+ viewSize: 4 | 6 | 1 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
844
844
  }[];
845
845
  } | undefined;
846
846
  }, {
@@ -862,7 +862,7 @@ export declare const patchUserSchema: zod.ZodEffects<zod.ZodObject<{
862
862
  cameraId: string;
863
863
  index: number;
864
864
  }[];
865
- viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
865
+ viewSize: 4 | 6 | 1 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
866
866
  _id?: string | undefined;
867
867
  }[];
868
868
  } | undefined;
@@ -897,7 +897,7 @@ export declare const patchUserSchema: zod.ZodEffects<zod.ZodObject<{
897
897
  cameraId: string;
898
898
  index: number;
899
899
  }[];
900
- viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
900
+ viewSize: 4 | 6 | 1 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
901
901
  }[];
902
902
  } | undefined;
903
903
  } | undefined;
@@ -930,7 +930,7 @@ export declare const patchUserSchema: zod.ZodEffects<zod.ZodObject<{
930
930
  cameraId: string;
931
931
  index: number;
932
932
  }[];
933
- viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
933
+ viewSize: 4 | 6 | 1 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
934
934
  _id?: string | undefined;
935
935
  }[];
936
936
  } | undefined;
@@ -965,7 +965,7 @@ export declare const patchUserSchema: zod.ZodEffects<zod.ZodObject<{
965
965
  cameraId: string;
966
966
  index: number;
967
967
  }[];
968
- viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
968
+ viewSize: 4 | 6 | 1 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
969
969
  }[];
970
970
  } | undefined;
971
971
  } | undefined;
@@ -998,7 +998,7 @@ export declare const patchUserSchema: zod.ZodEffects<zod.ZodObject<{
998
998
  cameraId: string;
999
999
  index: number;
1000
1000
  }[];
1001
- viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
1001
+ viewSize: 4 | 6 | 1 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
1002
1002
  _id?: string | undefined;
1003
1003
  }[];
1004
1004
  } | 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 '../api/websocket/types.js';
5
- export declare class WebsocketProxy {
4
+ import type { SocketNsp } from '../types.js';
5
+ export declare class CameraUiProxy {
6
6
  nsp: Namespace;
7
7
  nspName: SocketNsp;
8
8
  private logger;
@@ -10,8 +10,8 @@ export declare class CameraController extends CameraDevice {
10
10
  private motionTimeout?;
11
11
  private objectTimeout?;
12
12
  private objectTimeoutDuration;
13
- private doorbellTimeout?;
14
- private doorbellTimeoutDuration;
13
+ private audioTimeout?;
14
+ private audioTimeoutDuration;
15
15
  private proxyServer;
16
16
  private go2rtcApi;
17
17
  private configService;
@@ -43,9 +43,10 @@ export declare class CameraController extends CameraDevice {
43
43
  private subscribeToCameraState;
44
44
  private subscribeToCameraChanges;
45
45
  private subscribeToStateChanges;
46
- private subscribeToMotionState;
47
- private subscribeToObjectState;
48
- private subscribeToDoorbellState;
46
+ private motionStateChange;
47
+ private objectStateChange;
48
+ private audioStateChange;
49
+ private doorbellStateChange;
49
50
  private triggerProxyEvent;
50
51
  private proxyRequest;
51
52
  private isCameraEvent;
@@ -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?: 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 {