@camera.ui/browser 0.0.85 → 0.0.87

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.
Files changed (40) hide show
  1. package/dist/bundle.js +1 -1
  2. package/dist/types/packages/client/browser/src/client.d.ts +3 -1
  3. package/dist/types/packages/client/browser/src/proxy/cameraDevice.d.ts +1 -2
  4. package/dist/types/packages/client/browser/src/proxy/coreManager.d.ts +14 -0
  5. package/dist/types/packages/client/browser/src/proxy/index.d.ts +1 -0
  6. package/dist/types/packages/client/browser/src/streaming/go2rts-session.d.ts +0 -1
  7. package/dist/types/packages/client/browser/src/utils.d.ts +1 -1
  8. package/dist/types/server/src/api/database/index.d.ts +9 -3
  9. package/dist/types/server/src/api/database/types.d.ts +12 -0
  10. package/dist/types/server/src/api/schemas/cameras.schema.d.ts +5 -4
  11. package/dist/types/server/src/api/schemas/system.schema.d.ts +9 -0
  12. package/dist/types/server/src/api/schemas/users.schema.d.ts +36 -36
  13. package/dist/types/server/src/api/services/system.service.d.ts +7 -0
  14. package/dist/types/server/src/api/types/index.d.ts +4 -0
  15. package/dist/types/server/src/api/utils/fetch.d.ts +2 -0
  16. package/dist/types/server/src/api/websocket/nsp/main.d.ts +7 -0
  17. package/dist/types/server/src/api/websocket/nsp/notifications.d.ts +5 -4
  18. package/dist/types/server/src/api/websocket/nsp/server.d.ts +14 -2
  19. package/dist/types/server/src/api/websocket/types.d.ts +1 -1
  20. package/dist/types/server/src/camera/controller.d.ts +0 -3
  21. package/dist/types/server/src/camera/device.d.ts +0 -1
  22. package/dist/types/server/src/camera/index.d.ts +0 -2
  23. package/dist/types/server/src/camera/streaming/peer-connection.d.ts +2 -1
  24. package/dist/types/server/src/camera/streaming/webrtc-connection.d.ts +1 -2
  25. package/dist/types/server/src/camera/streaming/werift-session.d.ts +1 -0
  26. package/dist/types/server/src/camera/types.d.ts +1 -0
  27. package/dist/types/server/src/nats/index.d.ts +4 -1
  28. package/dist/types/server/src/nats/proxy/cameraDevice.d.ts +0 -3
  29. package/dist/types/server/src/nats/proxy/coreManager.d.ts +14 -0
  30. package/dist/types/server/src/nats/types.d.ts +25 -6
  31. package/dist/types/server/src/polyglot/node/plugins/pluginApi.d.ts +3 -0
  32. package/dist/types/server/src/polyglot/node/plugins/proxy/cameraDevice.d.ts +0 -3
  33. package/dist/types/server/src/polyglot/node/plugins/proxy/coreManager.d.ts +40 -0
  34. package/dist/types/server/src/services/config/index.d.ts +1 -0
  35. package/dist/types/server/src/services/logger/index.d.ts +2 -3
  36. package/dist/types/server/src/utils/network.d.ts +12 -0
  37. package/dist/types/server/src/utils/npm.d.ts +1 -0
  38. package/dist/types/shared/types/index.d.ts +1 -0
  39. package/package.json +3 -3
  40. package/dist/types/server/src/api/websocket/nsp/frameWorker.d.ts +0 -13
@@ -1,6 +1,7 @@
1
- import { DeviceManager } from './proxy/index.js';
1
+ import { CoreManager, DeviceManager } from './proxy/index.js';
2
2
  import type { CameraUiClientConfig } from './types.js';
3
3
  export interface API {
4
+ coreManager: CoreManager;
4
5
  deviceManager: DeviceManager;
5
6
  }
6
7
  export declare class CameraUiClient {
@@ -10,6 +11,7 @@ export declare class CameraUiClient {
10
11
  private logger;
11
12
  private token?;
12
13
  private deviceManager?;
14
+ private coreManager?;
13
15
  constructor(config: CameraUiClientConfig);
14
16
  connect(): Promise<API>;
15
17
  disconnect(): Promise<void>;
@@ -3,7 +3,7 @@ import { CameraInterface } from '../../../../../server/src/camera/interfaces/cam
3
3
  import { CameraPrebufferInterface } from '../../../../../server/src/camera/interfaces/prebuffer.js';
4
4
  import { CameraPTZInterface } from '../../../../../server/src/camera/interfaces/ptz.js';
5
5
  import { Go2RTCSession } from '../streaming/go2rts-session.js';
6
- import type { BaseLogger, Camera, CameraSource, IceServer } from '../../../../../shared/types/index.js';
6
+ import type { BaseLogger, Camera, CameraSource } from '../../../../../shared/types/index.js';
7
7
  import type { SocketService } from '../socket.js';
8
8
  import type { CameraDevice, Go2RTCSessionOptions } from '../types.js';
9
9
  export declare class CameraDeviceProxy extends BaseCameraDevice implements CameraDevice {
@@ -23,7 +23,6 @@ export declare class CameraDeviceProxy extends BaseCameraDevice implements Camer
23
23
  close(): void;
24
24
  connect(): Promise<void>;
25
25
  disconnect(): Promise<void>;
26
- getIceServers(): Promise<IceServer[]>;
27
26
  createSession(options: Go2RTCSessionOptions): Go2RTCSession;
28
27
  refreshStates(): Promise<void>;
29
28
  cleanup(): Promise<void>;
@@ -0,0 +1,14 @@
1
+ import type { BaseLogger, CoreManagerProxyMethods, IceServer } from '../../../../../shared/types/index.js';
2
+ import type { SocketService } from '../socket.js';
3
+ export declare class CoreManager implements CoreManagerProxyMethods {
4
+ private socketService;
5
+ private socket;
6
+ private logger;
7
+ private pluginName;
8
+ private subject;
9
+ constructor(socketService: SocketService, logger: BaseLogger);
10
+ getFFmpegPath(): Promise<string>;
11
+ getServerAddresses(): Promise<string[]>;
12
+ getIceServers(): Promise<IceServer[]>;
13
+ private onRequest;
14
+ }
@@ -1,2 +1,3 @@
1
1
  export * from './cameraDevice.js';
2
+ export * from './coreManager.js';
2
3
  export * from './deviceManager.js';
@@ -52,5 +52,4 @@ export declare class Go2RTCSession extends EventTarget {
52
52
  private createCodecsList;
53
53
  private parseCodecs;
54
54
  private btoaBinary;
55
- private uuidv4;
56
55
  }
@@ -9,4 +9,4 @@ export declare const safariVersion: () => RegExpMatchArray | null;
9
9
  export declare const isFirefox: () => boolean;
10
10
  export declare const isChrome: () => boolean;
11
11
  export declare const isTouch: () => boolean;
12
- export declare const uuidv4: () => string;
12
+ export declare const generateUUID: () => string;
@@ -1,7 +1,7 @@
1
1
  import type { FastifyInstance } from 'fastify';
2
2
  import type { Database as DB, RootDatabase as RootDB } from 'lmdb';
3
3
  import type { Plugin } from '../../plugins/plugin.js';
4
- import type { DBAuth, DBCamera, DBPlugin, DBSettings, DBUser } from './types.js';
4
+ import type { DBAuth, DBCamera, DBPlugin, DBSettings, DBSystem, DBUser } from './types.js';
5
5
  export declare class Database {
6
6
  static readonly VERSION = "1.0.0";
7
7
  static readonly CAMERAS_ID = "cameras";
@@ -10,13 +10,14 @@ export declare class Database {
10
10
  static readonly USER_PLUGINS_ID = "user-plugins";
11
11
  static readonly SETTINGS_ID = "settings";
12
12
  static readonly USERS_ID = "users";
13
+ static readonly SYSTEM_ID = "system";
13
14
  static readonly TOKENS_ID = "tokens";
14
15
  authDB: RootDB<DBAuth, 'auth'>;
15
16
  camerasDB: DB<DBCamera[], 'cameras'>;
16
17
  pluginsDB: DB<DBPlugin[], 'plugins'>;
17
18
  settingsDB: DB<DBSettings, 'settings'>;
18
19
  usersDB: DB<DBUser[], 'users'>;
19
- private initialized;
20
+ systemDB: DB<DBSystem, 'system'>;
20
21
  private lowdb;
21
22
  private databaseMigration;
22
23
  private databases;
@@ -26,9 +27,14 @@ export declare class Database {
26
27
  constructor(app: FastifyInstance);
27
28
  initialize(): Promise<void>;
28
29
  close(): Promise<void>;
30
+ getRootAdminId(): Promise<string | null>;
29
31
  updateCameras(): Promise<void>;
30
32
  createPluginDatabase(plugin: Plugin): Promise<void>;
31
33
  private ensureDatabases;
32
- private updateConfig;
34
+ private ensureAdmin;
35
+ private initializeRootAdmin;
36
+ private removeOldRootAdmin;
33
37
  private generateAdmin;
38
+ private saveRootAdminSecret;
39
+ private updateConfig;
34
40
  }
@@ -1,5 +1,6 @@
1
1
  import type { Database as DB } from 'lmdb';
2
2
  import type { DetectionZone, ObjectClass } from '../../camera/types.js';
3
+ import type { UsableNetworkAddress } from '../../utils/network.js';
3
4
  import type { CamviewSettingsLayoutMode, ClientData, JwtTokenEncoded } from '../types/index.js';
4
5
  import type { Database } from './index.js';
5
6
  export interface CameraUiDatabase {
@@ -38,6 +39,9 @@ export interface DBUser {
38
39
  firstLogin: boolean;
39
40
  preferences: DBUserPreferences;
40
41
  }
42
+ export interface DBSystem {
43
+ serverAddresses: string[];
44
+ }
41
45
  export type DBRoles = 'admin' | 'user';
42
46
  export interface DBCameraShortcut {
43
47
  readonly _id: string;
@@ -207,3 +211,11 @@ export interface CameraUiSettings {
207
211
  streamingMode: VideoStreamingMode;
208
212
  }
209
213
  export type VideoStreamingMode = 'webrtc' | 'mse' | 'webrtc/tcp' | 'mjpeg' | 'hls' | 'mp4';
214
+ export interface SystemInfo extends DBSystem {
215
+ networkAddresses: UsableNetworkAddress[];
216
+ }
217
+ export interface PluginData {
218
+ pluginName: string;
219
+ id?: string;
220
+ version?: string;
221
+ }
@@ -151,11 +151,12 @@ export declare const activitySettingsSchema: zod.ZodObject<{
151
151
  };
152
152
  }>;
153
153
  export declare const inputRoleSchema: zod.ZodUnion<[zod.ZodLiteral<"high-resolution">, zod.ZodLiteral<"mid-resolution">, zod.ZodLiteral<"low-resolution">, zod.ZodLiteral<"snapshot">]>;
154
+ export declare const inputProtocolSchema: zod.ZodUnion<[zod.ZodLiteral<"bubble://">, zod.ZodLiteral<"dvrip://">, zod.ZodLiteral<"echo:">, zod.ZodLiteral<"exec:">, zod.ZodLiteral<"expr:">, zod.ZodLiteral<"ffmpeg:">, zod.ZodLiteral<"gopro://">, zod.ZodLiteral<"hass:">, zod.ZodLiteral<"homekit://">, zod.ZodLiteral<"http://">, zod.ZodLiteral<"https://">, zod.ZodLiteral<"httpx://">, zod.ZodLiteral<"isapi://">, zod.ZodLiteral<"ivideon:">, zod.ZodLiteral<"kasa://">, zod.ZodLiteral<"nest:">, zod.ZodLiteral<"onvif://">, zod.ZodLiteral<"roborock://">, zod.ZodLiteral<"rtmp://">, zod.ZodLiteral<"rtsp://">, zod.ZodLiteral<"rtspx://">, zod.ZodLiteral<"tapo://">, zod.ZodLiteral<"tcp://">, zod.ZodLiteral<"webrtc:">, zod.ZodLiteral<"webtorrent:">]>;
154
155
  export declare const inputSchema: zod.ZodObject<{
155
156
  _id: zod.ZodEffects<zod.ZodDefault<zod.ZodString>, string, string | undefined>;
156
157
  name: zod.ZodEffects<zod.ZodString, string, string>;
157
158
  roles: zod.ZodArray<zod.ZodUnion<[zod.ZodLiteral<"high-resolution">, zod.ZodLiteral<"mid-resolution">, zod.ZodLiteral<"low-resolution">, zod.ZodLiteral<"snapshot">]>, "many">;
158
- urls: zod.ZodArray<zod.ZodString, "many">;
159
+ urls: zod.ZodArray<zod.ZodEffects<zod.ZodString, string, string>, "many">;
159
160
  }, "strict", zod.ZodTypeAny, {
160
161
  name: string;
161
162
  _id: string;
@@ -171,7 +172,7 @@ export declare const patchInputSchema: zod.ZodObject<{
171
172
  _id: zod.ZodEffects<zod.ZodDefault<zod.ZodString>, string, string | undefined>;
172
173
  name: zod.ZodEffects<zod.ZodString, string, string>;
173
174
  roles: zod.ZodArray<zod.ZodUnion<[zod.ZodLiteral<"high-resolution">, zod.ZodLiteral<"mid-resolution">, zod.ZodLiteral<"low-resolution">, zod.ZodLiteral<"snapshot">]>, "many">;
174
- urls: zod.ZodArray<zod.ZodString, "many">;
175
+ urls: zod.ZodArray<zod.ZodEffects<zod.ZodString, string, string>, "many">;
175
176
  }, "strict", zod.ZodTypeAny, {
176
177
  name: string;
177
178
  _id: string;
@@ -290,7 +291,7 @@ export declare const createCameraSchema: zod.ZodObject<{
290
291
  _id: zod.ZodEffects<zod.ZodDefault<zod.ZodString>, string, string | undefined>;
291
292
  name: zod.ZodEffects<zod.ZodString, string, string>;
292
293
  roles: zod.ZodArray<zod.ZodUnion<[zod.ZodLiteral<"high-resolution">, zod.ZodLiteral<"mid-resolution">, zod.ZodLiteral<"low-resolution">, zod.ZodLiteral<"snapshot">]>, "many">;
293
- urls: zod.ZodArray<zod.ZodString, "many">;
294
+ urls: zod.ZodArray<zod.ZodEffects<zod.ZodString, string, string>, "many">;
294
295
  }, "strict", zod.ZodTypeAny, {
295
296
  name: string;
296
297
  _id: string;
@@ -627,7 +628,7 @@ export declare const patchCameraSchema: zod.ZodObject<{
627
628
  _id: zod.ZodEffects<zod.ZodDefault<zod.ZodString>, string, string | undefined>;
628
629
  name: zod.ZodEffects<zod.ZodString, string, string>;
629
630
  roles: zod.ZodArray<zod.ZodUnion<[zod.ZodLiteral<"high-resolution">, zod.ZodLiteral<"mid-resolution">, zod.ZodLiteral<"low-resolution">, zod.ZodLiteral<"snapshot">]>, "many">;
630
- urls: zod.ZodArray<zod.ZodString, "many">;
631
+ urls: zod.ZodArray<zod.ZodEffects<zod.ZodString, string, string>, "many">;
631
632
  }, "strict", zod.ZodTypeAny, {
632
633
  name: string;
633
634
  _id: string;
@@ -0,0 +1,9 @@
1
+ import zod from 'zod';
2
+ export declare const patchSystemSchema: zod.ZodObject<{
3
+ serverAddresses: zod.ZodOptional<zod.ZodArray<zod.ZodString, "many">>;
4
+ }, "strict", zod.ZodTypeAny, {
5
+ serverAddresses?: string[] | undefined;
6
+ }, {
7
+ serverAddresses?: string[] | undefined;
8
+ }>;
9
+ export type PatchSystemInput = zod.TypeOf<typeof patchSystemSchema>;
@@ -33,7 +33,7 @@ export declare const userPreferencesCamviewViewsLayout: zod.ZodObject<{
33
33
  name: string;
34
34
  type: "dnd" | "view";
35
35
  _id: string;
36
- viewSize: 1 | 4 | 6 | 7 | 20 | 12 | 10 | 9 | 13 | 15 | 16 | 26;
36
+ viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
37
37
  cameras: {
38
38
  cameraId: string;
39
39
  index: number;
@@ -41,7 +41,7 @@ export declare const userPreferencesCamviewViewsLayout: zod.ZodObject<{
41
41
  }, {
42
42
  name: string;
43
43
  type: "dnd" | "view";
44
- viewSize: 1 | 4 | 6 | 7 | 20 | 12 | 10 | 9 | 13 | 15 | 16 | 26;
44
+ viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
45
45
  cameras: {
46
46
  cameraId: string;
47
47
  index: number;
@@ -63,14 +63,14 @@ export declare const patchPreferencesCamviewViewsLayout: zod.ZodOptional<zod.Zod
63
63
  }>, "many">>;
64
64
  }, "strip", zod.ZodTypeAny, {
65
65
  name?: string | undefined;
66
- viewSize?: 1 | 4 | 6 | 7 | 20 | 12 | 10 | 9 | 13 | 15 | 16 | 26 | undefined;
66
+ viewSize?: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26 | undefined;
67
67
  cameras?: {
68
68
  cameraId: string;
69
69
  index: number;
70
70
  }[] | undefined;
71
71
  }, {
72
72
  name?: string | undefined;
73
- viewSize?: 1 | 4 | 6 | 7 | 20 | 12 | 10 | 9 | 13 | 15 | 16 | 26 | undefined;
73
+ viewSize?: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26 | undefined;
74
74
  cameras?: {
75
75
  cameraId: string;
76
76
  index: number;
@@ -96,7 +96,7 @@ export declare const userPreferencesCamview: zod.ZodObject<{
96
96
  name: string;
97
97
  type: "dnd" | "view";
98
98
  _id: string;
99
- viewSize: 1 | 4 | 6 | 7 | 20 | 12 | 10 | 9 | 13 | 15 | 16 | 26;
99
+ viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
100
100
  cameras: {
101
101
  cameraId: string;
102
102
  index: number;
@@ -104,7 +104,7 @@ export declare const userPreferencesCamview: zod.ZodObject<{
104
104
  }, {
105
105
  name: string;
106
106
  type: "dnd" | "view";
107
- viewSize: 1 | 4 | 6 | 7 | 20 | 12 | 10 | 9 | 13 | 15 | 16 | 26;
107
+ viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
108
108
  cameras: {
109
109
  cameraId: string;
110
110
  index: number;
@@ -116,7 +116,7 @@ export declare const userPreferencesCamview: zod.ZodObject<{
116
116
  name: string;
117
117
  type: "dnd" | "view";
118
118
  _id: string;
119
- viewSize: 1 | 4 | 6 | 7 | 20 | 12 | 10 | 9 | 13 | 15 | 16 | 26;
119
+ viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
120
120
  cameras: {
121
121
  cameraId: string;
122
122
  index: number;
@@ -126,7 +126,7 @@ export declare const userPreferencesCamview: zod.ZodObject<{
126
126
  views: {
127
127
  name: string;
128
128
  type: "dnd" | "view";
129
- viewSize: 1 | 4 | 6 | 7 | 20 | 12 | 10 | 9 | 13 | 15 | 16 | 26;
129
+ viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
130
130
  cameras: {
131
131
  cameraId: string;
132
132
  index: number;
@@ -256,7 +256,7 @@ export declare const userPreferences: zod.ZodObject<{
256
256
  name: string;
257
257
  type: "dnd" | "view";
258
258
  _id: string;
259
- viewSize: 1 | 4 | 6 | 7 | 20 | 12 | 10 | 9 | 13 | 15 | 16 | 26;
259
+ viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
260
260
  cameras: {
261
261
  cameraId: string;
262
262
  index: number;
@@ -264,7 +264,7 @@ export declare const userPreferences: zod.ZodObject<{
264
264
  }, {
265
265
  name: string;
266
266
  type: "dnd" | "view";
267
- viewSize: 1 | 4 | 6 | 7 | 20 | 12 | 10 | 9 | 13 | 15 | 16 | 26;
267
+ viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
268
268
  cameras: {
269
269
  cameraId: string;
270
270
  index: number;
@@ -276,7 +276,7 @@ export declare const userPreferences: zod.ZodObject<{
276
276
  name: string;
277
277
  type: "dnd" | "view";
278
278
  _id: string;
279
- viewSize: 1 | 4 | 6 | 7 | 20 | 12 | 10 | 9 | 13 | 15 | 16 | 26;
279
+ viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
280
280
  cameras: {
281
281
  cameraId: string;
282
282
  index: number;
@@ -286,7 +286,7 @@ export declare const userPreferences: zod.ZodObject<{
286
286
  views: {
287
287
  name: string;
288
288
  type: "dnd" | "view";
289
- viewSize: 1 | 4 | 6 | 7 | 20 | 12 | 10 | 9 | 13 | 15 | 16 | 26;
289
+ viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
290
290
  cameras: {
291
291
  cameraId: string;
292
292
  index: number;
@@ -358,7 +358,7 @@ export declare const userPreferences: zod.ZodObject<{
358
358
  name: string;
359
359
  type: "dnd" | "view";
360
360
  _id: string;
361
- viewSize: 1 | 4 | 6 | 7 | 20 | 12 | 10 | 9 | 13 | 15 | 16 | 26;
361
+ viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
362
362
  cameras: {
363
363
  cameraId: string;
364
364
  index: number;
@@ -380,7 +380,7 @@ export declare const userPreferences: zod.ZodObject<{
380
380
  views: {
381
381
  name: string;
382
382
  type: "dnd" | "view";
383
- viewSize: 1 | 4 | 6 | 7 | 20 | 12 | 10 | 9 | 13 | 15 | 16 | 26;
383
+ viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
384
384
  cameras: {
385
385
  cameraId: string;
386
386
  index: number;
@@ -391,7 +391,7 @@ export declare const userPreferences: zod.ZodObject<{
391
391
  }>;
392
392
  export declare const createUserSchema: zod.ZodEffects<zod.ZodObject<{
393
393
  _id: zod.ZodEffects<zod.ZodDefault<zod.ZodString>, string, string | undefined>;
394
- username: zod.ZodString;
394
+ username: zod.ZodEffects<zod.ZodString, string, string>;
395
395
  password: zod.ZodString;
396
396
  passwordConfirm: zod.ZodString;
397
397
  role: zod.ZodUnion<[zod.ZodLiteral<"admin">, zod.ZodLiteral<"user">]>;
@@ -420,7 +420,7 @@ export declare const createUserSchema: zod.ZodEffects<zod.ZodObject<{
420
420
  name: string;
421
421
  type: "dnd" | "view";
422
422
  _id: string;
423
- viewSize: 1 | 4 | 6 | 7 | 20 | 12 | 10 | 9 | 13 | 15 | 16 | 26;
423
+ viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
424
424
  cameras: {
425
425
  cameraId: string;
426
426
  index: number;
@@ -428,7 +428,7 @@ export declare const createUserSchema: zod.ZodEffects<zod.ZodObject<{
428
428
  }, {
429
429
  name: string;
430
430
  type: "dnd" | "view";
431
- viewSize: 1 | 4 | 6 | 7 | 20 | 12 | 10 | 9 | 13 | 15 | 16 | 26;
431
+ viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
432
432
  cameras: {
433
433
  cameraId: string;
434
434
  index: number;
@@ -440,7 +440,7 @@ export declare const createUserSchema: zod.ZodEffects<zod.ZodObject<{
440
440
  name: string;
441
441
  type: "dnd" | "view";
442
442
  _id: string;
443
- viewSize: 1 | 4 | 6 | 7 | 20 | 12 | 10 | 9 | 13 | 15 | 16 | 26;
443
+ viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
444
444
  cameras: {
445
445
  cameraId: string;
446
446
  index: number;
@@ -450,7 +450,7 @@ export declare const createUserSchema: zod.ZodEffects<zod.ZodObject<{
450
450
  views: {
451
451
  name: string;
452
452
  type: "dnd" | "view";
453
- viewSize: 1 | 4 | 6 | 7 | 20 | 12 | 10 | 9 | 13 | 15 | 16 | 26;
453
+ viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
454
454
  cameras: {
455
455
  cameraId: string;
456
456
  index: number;
@@ -522,7 +522,7 @@ export declare const createUserSchema: zod.ZodEffects<zod.ZodObject<{
522
522
  name: string;
523
523
  type: "dnd" | "view";
524
524
  _id: string;
525
- viewSize: 1 | 4 | 6 | 7 | 20 | 12 | 10 | 9 | 13 | 15 | 16 | 26;
525
+ viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
526
526
  cameras: {
527
527
  cameraId: string;
528
528
  index: number;
@@ -544,7 +544,7 @@ export declare const createUserSchema: zod.ZodEffects<zod.ZodObject<{
544
544
  views: {
545
545
  name: string;
546
546
  type: "dnd" | "view";
547
- viewSize: 1 | 4 | 6 | 7 | 20 | 12 | 10 | 9 | 13 | 15 | 16 | 26;
547
+ viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
548
548
  cameras: {
549
549
  cameraId: string;
550
550
  index: number;
@@ -579,7 +579,7 @@ export declare const createUserSchema: zod.ZodEffects<zod.ZodObject<{
579
579
  name: string;
580
580
  type: "dnd" | "view";
581
581
  _id: string;
582
- viewSize: 1 | 4 | 6 | 7 | 20 | 12 | 10 | 9 | 13 | 15 | 16 | 26;
582
+ viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
583
583
  cameras: {
584
584
  cameraId: string;
585
585
  index: number;
@@ -612,7 +612,7 @@ export declare const createUserSchema: zod.ZodEffects<zod.ZodObject<{
612
612
  views: {
613
613
  name: string;
614
614
  type: "dnd" | "view";
615
- viewSize: 1 | 4 | 6 | 7 | 20 | 12 | 10 | 9 | 13 | 15 | 16 | 26;
615
+ viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
616
616
  cameras: {
617
617
  cameraId: string;
618
618
  index: number;
@@ -647,7 +647,7 @@ export declare const createUserSchema: zod.ZodEffects<zod.ZodObject<{
647
647
  name: string;
648
648
  type: "dnd" | "view";
649
649
  _id: string;
650
- viewSize: 1 | 4 | 6 | 7 | 20 | 12 | 10 | 9 | 13 | 15 | 16 | 26;
650
+ viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
651
651
  cameras: {
652
652
  cameraId: string;
653
653
  index: number;
@@ -680,7 +680,7 @@ export declare const createUserSchema: zod.ZodEffects<zod.ZodObject<{
680
680
  views: {
681
681
  name: string;
682
682
  type: "dnd" | "view";
683
- viewSize: 1 | 4 | 6 | 7 | 20 | 12 | 10 | 9 | 13 | 15 | 16 | 26;
683
+ viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
684
684
  cameras: {
685
685
  cameraId: string;
686
686
  index: number;
@@ -704,7 +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
+ username: zod.ZodEffects<zod.ZodOptional<zod.ZodString>, string | undefined, string | undefined>;
708
708
  password: zod.ZodOptional<zod.ZodString>;
709
709
  passwordConfirm: zod.ZodOptional<zod.ZodString>;
710
710
  role: zod.ZodOptional<zod.ZodUnion<[zod.ZodLiteral<"admin">, zod.ZodLiteral<"user">]>>;
@@ -734,7 +734,7 @@ export declare const patchUserSchema: zod.ZodEffects<zod.ZodObject<{
734
734
  name: string;
735
735
  type: "dnd" | "view";
736
736
  _id: string;
737
- viewSize: 1 | 4 | 6 | 7 | 20 | 12 | 10 | 9 | 13 | 15 | 16 | 26;
737
+ viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
738
738
  cameras: {
739
739
  cameraId: string;
740
740
  index: number;
@@ -742,7 +742,7 @@ export declare const patchUserSchema: zod.ZodEffects<zod.ZodObject<{
742
742
  }, {
743
743
  name: string;
744
744
  type: "dnd" | "view";
745
- viewSize: 1 | 4 | 6 | 7 | 20 | 12 | 10 | 9 | 13 | 15 | 16 | 26;
745
+ viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
746
746
  cameras: {
747
747
  cameraId: string;
748
748
  index: number;
@@ -754,7 +754,7 @@ export declare const patchUserSchema: zod.ZodEffects<zod.ZodObject<{
754
754
  name: string;
755
755
  type: "dnd" | "view";
756
756
  _id: string;
757
- viewSize: 1 | 4 | 6 | 7 | 20 | 12 | 10 | 9 | 13 | 15 | 16 | 26;
757
+ viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
758
758
  cameras: {
759
759
  cameraId: string;
760
760
  index: number;
@@ -764,7 +764,7 @@ export declare const patchUserSchema: zod.ZodEffects<zod.ZodObject<{
764
764
  views: {
765
765
  name: string;
766
766
  type: "dnd" | "view";
767
- viewSize: 1 | 4 | 6 | 7 | 20 | 12 | 10 | 9 | 13 | 15 | 16 | 26;
767
+ viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
768
768
  cameras: {
769
769
  cameraId: string;
770
770
  index: number;
@@ -836,7 +836,7 @@ export declare const patchUserSchema: zod.ZodEffects<zod.ZodObject<{
836
836
  name: string;
837
837
  type: "dnd" | "view";
838
838
  _id: string;
839
- viewSize: 1 | 4 | 6 | 7 | 20 | 12 | 10 | 9 | 13 | 15 | 16 | 26;
839
+ viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
840
840
  cameras: {
841
841
  cameraId: string;
842
842
  index: number;
@@ -858,7 +858,7 @@ export declare const patchUserSchema: zod.ZodEffects<zod.ZodObject<{
858
858
  views: {
859
859
  name: string;
860
860
  type: "dnd" | "view";
861
- viewSize: 1 | 4 | 6 | 7 | 20 | 12 | 10 | 9 | 13 | 15 | 16 | 26;
861
+ viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
862
862
  cameras: {
863
863
  cameraId: string;
864
864
  index: number;
@@ -893,7 +893,7 @@ export declare const patchUserSchema: zod.ZodEffects<zod.ZodObject<{
893
893
  name: string;
894
894
  type: "dnd" | "view";
895
895
  _id: string;
896
- viewSize: 1 | 4 | 6 | 7 | 20 | 12 | 10 | 9 | 13 | 15 | 16 | 26;
896
+ viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
897
897
  cameras: {
898
898
  cameraId: string;
899
899
  index: number;
@@ -926,7 +926,7 @@ export declare const patchUserSchema: zod.ZodEffects<zod.ZodObject<{
926
926
  views: {
927
927
  name: string;
928
928
  type: "dnd" | "view";
929
- viewSize: 1 | 4 | 6 | 7 | 20 | 12 | 10 | 9 | 13 | 15 | 16 | 26;
929
+ viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
930
930
  cameras: {
931
931
  cameraId: string;
932
932
  index: number;
@@ -961,7 +961,7 @@ export declare const patchUserSchema: zod.ZodEffects<zod.ZodObject<{
961
961
  name: string;
962
962
  type: "dnd" | "view";
963
963
  _id: string;
964
- viewSize: 1 | 4 | 6 | 7 | 20 | 12 | 10 | 9 | 13 | 15 | 16 | 26;
964
+ viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
965
965
  cameras: {
966
966
  cameraId: string;
967
967
  index: number;
@@ -994,7 +994,7 @@ export declare const patchUserSchema: zod.ZodEffects<zod.ZodObject<{
994
994
  views: {
995
995
  name: string;
996
996
  type: "dnd" | "view";
997
- viewSize: 1 | 4 | 6 | 7 | 20 | 12 | 10 | 9 | 13 | 15 | 16 | 26;
997
+ viewSize: 1 | 4 | 6 | 7 | 16 | 10 | 12 | 9 | 13 | 15 | 20 | 26;
998
998
  cameras: {
999
999
  cameraId: string;
1000
1000
  index: number;
@@ -0,0 +1,7 @@
1
+ import type { DBSystem } from '../database/types.js';
2
+ export declare class SystemService {
3
+ private dbs;
4
+ constructor();
5
+ info(): DBSystem;
6
+ patch(infoData?: Partial<DBSystem>): Promise<DBSystem>;
7
+ }
@@ -9,6 +9,7 @@ import type { CreateCameraInput, PatchCameraInput, PreviewCameraInput } from '..
9
9
  import type { PatchConfigInput } from '../schemas/config.schema.js';
10
10
  import type { PatchGo2RtcConfigInput } from '../schemas/go2rtc.schema.js';
11
11
  import type { DetectAudioInput, DetectMotionInput, DetectObjectInput } from '../schemas/plugins.schema.js';
12
+ import type { PatchSystemInput } from '../schemas/system.schema.js';
12
13
  import type { CreateShortcutInput, CreateUserInput, CreateViewInput, LoginUserInput, PatchShortcutInput, PatchUserInput, PatchViewInput } from '../schemas/users.schema.js';
13
14
  export interface BusboyFileStream extends Readable {
14
15
  truncated: boolean;
@@ -351,6 +352,9 @@ export type UsersPatchRequest = {
351
352
  avatar: string;
352
353
  };
353
354
  };
355
+ export type SystemPatchRequest = {
356
+ Body: PatchSystemInput;
357
+ };
354
358
  export type ViewsParamsRequest = {
355
359
  Params: {
356
360
  viewid: string;
@@ -0,0 +1,2 @@
1
+ declare const fetchWithTimeout: (url: string, options?: RequestInit) => Promise<Response>;
2
+ export default fetchWithTimeout;
@@ -0,0 +1,7 @@
1
+ import type { Namespace, Server } from 'socket.io';
2
+ import type { SocketNsp } from '../types.js';
3
+ export declare class MainNamespace {
4
+ nsp: Namespace;
5
+ nspName: SocketNsp;
6
+ constructor(io: Server);
7
+ }
@@ -1,11 +1,12 @@
1
- import type { Namespace, Server, Socket } from 'socket.io';
1
+ import type { Namespace, Server } from 'socket.io';
2
+ import type { UiNotification } from '../../types/index.js';
2
3
  import type { SocketNsp } from '../types.js';
3
4
  export declare class NotificationsNamespace {
4
5
  nsp: Namespace;
5
6
  nspName: SocketNsp;
6
7
  private logger;
7
8
  constructor(io: Server);
8
- clearNotifications(): Promise<void>;
9
- getNotifications(socket: Socket): Promise<void>;
10
- removeNotification(id?: string): Promise<void>;
9
+ clearNotifications(): void;
10
+ getNotifications(payload: any, callback?: Function): UiNotification[];
11
+ removeNotification(id?: string): void;
11
12
  }
@@ -1,9 +1,21 @@
1
- import type { Namespace, Server, Socket } from 'socket.io';
1
+ import type { Namespace, Server } from 'socket.io';
2
+ import type { INpmPluginState } from '../../types/index.js';
2
3
  import type { SocketNsp } from '../types.js';
3
4
  export declare class ServerNamespace {
4
5
  nsp: Namespace;
5
6
  nspName: SocketNsp;
6
7
  private logger;
8
+ private pluginsService;
9
+ private serverUpdate;
10
+ private pluginUpdates;
7
11
  constructor(io: Server);
8
- checkUpdate(socket?: Socket): Promise<void>;
12
+ getUpdates(payload: any, callback?: Function): {
13
+ server?: INpmPluginState;
14
+ plugins: INpmPluginState[];
15
+ };
16
+ checkUpdate(): Promise<void>;
17
+ checkServerUpdate(): Promise<void>;
18
+ checkPluginUpdates(): Promise<void>;
19
+ private getPluginFromNpm;
20
+ private getAvailablePluginVersions;
9
21
  }
@@ -1,7 +1,7 @@
1
1
  import type { Namespace } from 'socket.io';
2
2
  import type { PLUGIN_STATUS } from '../../plugins/types.js';
3
3
  import type { RuntimeInfo } from '../../services/config/types.js';
4
- export type SocketNsp = '/camera.ui' | '/metrics' | '/logs' | '/status' | '/notifications' | '/plugins' | '/proxy' | '/frame' | '/frameWorker';
4
+ export type SocketNsp = '/camera.ui' | '/metrics' | '/logs' | '/status' | '/notifications' | '/plugins' | '/proxy' | '/server';
5
5
  export interface SocketNspMap {
6
6
  nsp: Namespace;
7
7
  [key: string]: any;
@@ -4,7 +4,6 @@ import { CameraPTZInterface } from './interfaces/ptz.js';
4
4
  import type { Camera } from '../api/database/types.js';
5
5
  import type { MotionFrame, VideoFrame } from '../decoder/types.js';
6
6
  import type { ProxyServer } from '../nats/index.js';
7
- import type { IceServer } from '../services/config/types.js';
8
7
  import type { BaseLogger, CameraConfigInputSettings, CameraDelegate, CameraSource, Container, PrebufferState, SetValues } from './types.js';
9
8
  export declare class CameraController extends CameraDevice {
10
9
  proxy: ProxyServer;
@@ -21,12 +20,10 @@ export declare class CameraController extends CameraDevice {
21
20
  get sources(): CameraSource[];
22
21
  constructor(camera: Camera, logger: BaseLogger, proxy: ProxyServer);
23
22
  setDelegate(): void;
24
- getFfmpegPath(): Promise<string>;
25
23
  getFrames(): AsyncIterableIterator<VideoFrame>;
26
24
  getMotionFrames(): AsyncIterableIterator<MotionFrame>;
27
25
  connect(): Promise<void>;
28
26
  disconnect(): Promise<void>;
29
- getIceServers(): Promise<IceServer[]>;
30
27
  updateState<T extends keyof SetValues>(stateName: T, eventData: SetValues[T]): Promise<void>;
31
28
  addCameraSource(source: CameraConfigInputSettings): Promise<void>;
32
29
  updateCameraSource(sourceId: string, source: Partial<CameraConfigInputSettings>): Promise<void>;
@@ -13,7 +13,6 @@ export declare abstract class CameraDevice extends BaseCameraDevice {
13
13
  abstract disconnect(): Promise<void>;
14
14
  abstract getFrames(prebufferDuration?: number): AsyncIterableIterator<VideoFrame>;
15
15
  abstract getMotionFrames(): AsyncIterableIterator<MotionFrame>;
16
- abstract getFfmpegPath(): Promise<string>;
17
16
  abstract updateState(stateName: 'light', eventData: LightSetEvent): Promise<void>;
18
17
  abstract updateState(stateName: 'motion', eventData: MotionSetEvent, frame?: VideoFrame): Promise<void>;
19
18
  abstract updateState(stateName: 'audio', eventData: AudioSetEvent): Promise<void>;