@camera.ui/browser 0.0.79 → 0.0.80

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 (56) hide show
  1. package/dist/bundle.js +1 -1
  2. package/dist/types/packages/client/browser/src/proxy/cameraDevice.d.ts +17 -3
  3. package/dist/types/packages/client/browser/src/proxy/deviceManager.d.ts +4 -0
  4. package/dist/types/packages/client/browser/src/socket.d.ts +2 -3
  5. package/dist/types/packages/client/browser/src/types.d.ts +0 -1
  6. package/dist/types/server/src/api/controllers/users.controller.d.ts +9 -3
  7. package/dist/types/server/src/api/database/index.d.ts +9 -2
  8. package/dist/types/server/src/api/database/types.d.ts +24 -23
  9. package/dist/types/server/src/api/go2rtc/api/streams.d.ts +2 -2
  10. package/dist/types/server/src/api/go2rtc/types.d.ts +5 -2
  11. package/dist/types/server/src/api/index.d.ts +7 -8
  12. package/dist/types/server/src/api/middlewares/pagination.middleware.d.ts +1 -1
  13. package/dist/types/server/src/api/plugins/logger.plugin.d.ts +7 -0
  14. package/dist/types/server/src/api/routes/index.d.ts +1 -2
  15. package/dist/types/server/src/api/schemas/backup.schema.d.ts +53 -155
  16. package/dist/types/server/src/api/schemas/cameras.schema.d.ts +215 -215
  17. package/dist/types/server/src/api/schemas/config.schema.d.ts +22 -22
  18. package/dist/types/server/src/api/schemas/go2rtc.schema.d.ts +66 -66
  19. package/dist/types/server/src/api/schemas/users.schema.d.ts +242 -136
  20. package/dist/types/server/src/api/services/cameras.service.d.ts +9 -7
  21. package/dist/types/server/src/api/services/users.service.d.ts +6 -2
  22. package/dist/types/server/src/api/types/index.d.ts +34 -6
  23. package/dist/types/server/src/api/websocket/nsp/status.d.ts +1 -1
  24. package/dist/types/server/src/camera/controller.d.ts +17 -10
  25. package/dist/types/server/src/camera/device.d.ts +5 -13
  26. package/dist/types/server/src/camera/index.d.ts +17 -10
  27. package/dist/types/server/src/camera/interfaces/audioDetection.d.ts +10 -0
  28. package/dist/types/server/src/camera/interfaces/camera.d.ts +19 -0
  29. package/dist/types/server/src/camera/interfaces/motionDetection.d.ts +10 -0
  30. package/dist/types/server/src/camera/interfaces/objectDetection.d.ts +10 -0
  31. package/dist/types/server/src/camera/interfaces/prebuffer.d.ts +11 -0
  32. package/dist/types/server/src/camera/interfaces/ptz.d.ts +13 -0
  33. package/dist/types/server/src/camera/streaming/webrtc-connection.d.ts +2 -1
  34. package/dist/types/server/src/camera/streaming/{streaming-session.d.ts → werift-session.d.ts} +1 -1
  35. package/dist/types/server/src/camera/types.d.ts +53 -15
  36. package/dist/types/server/src/decoder/worker.d.ts +1 -1
  37. package/dist/types/server/src/nats/index.d.ts +1 -1
  38. package/dist/types/server/src/nats/proxy/cameraDevice.d.ts +30 -34
  39. package/dist/types/server/src/nats/proxy/deviceManager.d.ts +1 -1
  40. package/dist/types/server/src/nats/proxy/pluginsManager.d.ts +1 -1
  41. package/dist/types/server/src/nats/proxy/systemManager.d.ts +1 -1
  42. package/dist/types/server/src/nats/types.d.ts +20 -45
  43. package/dist/types/server/src/nats/websocket.d.ts +1 -5
  44. package/dist/types/server/src/plugins/base.d.ts +2 -3
  45. package/dist/types/server/src/plugins/types.d.ts +22 -5
  46. package/dist/types/server/src/plugins/worker.d.ts +1 -0
  47. package/dist/types/server/src/polyglot/node/plugins/proxy/cameraDevice.d.ts +28 -6
  48. package/dist/types/server/src/polyglot/node/plugins/proxy/deviceManager.d.ts +3 -3
  49. package/dist/types/server/src/polyglot/node/plugins/proxy/pluginsManager.d.ts +3 -3
  50. package/dist/types/server/src/polyglot/node/plugins/proxy/systemManager.d.ts +3 -3
  51. package/dist/types/server/src/polyglot/node/plugins/schema.d.ts +2 -1
  52. package/dist/types/server/src/services/config/index.d.ts +29 -36
  53. package/dist/types/server/src/services/config/types.d.ts +1 -1
  54. package/dist/types/server/src/types.d.ts +4 -0
  55. package/dist/types/shared/types/index.d.ts +5 -0
  56. package/package.json +10 -10
@@ -1,13 +1,11 @@
1
1
  import type { Camera, VideoStreamingMode } from '../api/database/types.js';
2
2
  import type { CameraDevice } from '../camera/device.js';
3
- import type { CameraConfig, Container, FfmpegOptions, PrebufferState, SetValues, StateValues, StreamInfo } from '../camera/types.js';
3
+ import type { CameraConfig, CameraConfigInputSettings, CameraDelegates, Container, PrebufferState, SetValues, StateValues } from '../camera/types.js';
4
4
  import type { BasePlugin } from '../plugins/base.js';
5
5
  import type { CameraExtension } from '../plugins/types.js';
6
6
  import type { CameraStorage } from '../polyglot/node/plugins/cameraStorage.js';
7
7
  import type { IceServer } from '../services/config/types.js';
8
- export type MethodKeys<T> = {
9
- [K in keyof T]: T[K] extends Function ? K : never;
10
- }[keyof T];
8
+ import type { MethodKeys } from '../types.js';
11
9
  export interface QueueItem {
12
10
  message: ProxyMessageStructure;
13
11
  resolve: (response: any) => void;
@@ -21,9 +19,9 @@ export interface ProxyMessageStructure {
21
19
  pluginId: string;
22
20
  type: 'request' | 'reply';
23
21
  proxy: 'system' | 'device' | 'plugins' | 'camera';
24
- client: 'pluginFn' | 'pluginStorage' | 'cameraFn' | 'cameraDelegate' | 'cameraPrebufferDelegate' | 'device' | 'system';
22
+ client: 'cameraFn' | 'pluginFn' | 'pluginStorage' | 'device' | 'system' | keyof CameraDelegates;
25
23
  fn: string;
26
- args: any;
24
+ args: any[] | Record<string, any>;
27
25
  timeout: number;
28
26
  timestamp: number;
29
27
  response?: any;
@@ -39,18 +37,6 @@ export interface ProxyAuth {
39
37
  pass: string;
40
38
  };
41
39
  }
42
- export interface MethodNamesByManager {
43
- systemManager: SystemManagerProxyMethodNames;
44
- deviceManager: DeviceManagerProxyMethodNames;
45
- pluginsManager: PluginsManagerProxyMethodNames;
46
- cameraDevice: CameraDeviceProxyMethodNames;
47
- }
48
- export type ManagerNames = keyof MethodNamesByManager;
49
- export interface WebsocketClientRequest<T extends keyof MethodNamesByManager> {
50
- name: T;
51
- method: MethodNamesByManager[T];
52
- args: any[];
53
- }
54
40
  export type WebsocketClientProxyEvent = 'updateDevice' | 'updateState';
55
41
  export interface StreamPayload {
56
42
  type: Exclude<VideoStreamingMode, 'webrtc' | 'webrtc/tcp'> | 'webrtc/offer' | 'webrtc/candidate';
@@ -91,15 +77,6 @@ export interface CameraDeviceProxyMethods {
91
77
  cameraId: string;
92
78
  pluginId: string;
93
79
  }): void;
94
- reboot(data: {
95
- cameraId: string;
96
- pluginId: string;
97
- }): Promise<void>;
98
- getStreamInfo(data: {
99
- sourceName: string;
100
- cameraId: string;
101
- pluginId: string;
102
- }): Promise<StreamInfo | undefined>;
103
80
  getFfmpegPath(data: {
104
81
  cameraId: string;
105
82
  pluginId: string;
@@ -108,24 +85,6 @@ export interface CameraDeviceProxyMethods {
108
85
  cameraId: string;
109
86
  pluginId: string;
110
87
  }): IceServer[];
111
- snapshot(data: {
112
- forceNew?: boolean;
113
- cameraId: string;
114
- pluginId: string;
115
- }): Promise<ArrayBuffer>;
116
- streamVideo(data: {
117
- sourceName: string;
118
- options: FfmpegOptions;
119
- cameraId: string;
120
- pluginId: string;
121
- }): Promise<void>;
122
- recordToFile(data: {
123
- sourceName: string;
124
- outputPath: string;
125
- duration?: number;
126
- cameraId: string;
127
- pluginId: string;
128
- }): Promise<void>;
129
88
  updateState<T extends keyof SetValues>(data: {
130
89
  stateName: T;
131
90
  eventData: SetValues[T];
@@ -147,6 +106,22 @@ export interface CameraDeviceProxyMethods {
147
106
  states: StateValues;
148
107
  cameraState: boolean;
149
108
  };
109
+ addCameraSource(data: {
110
+ source: CameraConfigInputSettings;
111
+ cameraId: string;
112
+ pluginId: string;
113
+ }): Promise<void>;
114
+ updateCameraSource(data: {
115
+ id: string;
116
+ source: Partial<CameraConfigInputSettings>;
117
+ cameraId: string;
118
+ pluginId: string;
119
+ }): Promise<void>;
120
+ removeCameraSource(data: {
121
+ id: string;
122
+ cameraId: string;
123
+ pluginId: string;
124
+ }): Promise<void>;
150
125
  }
151
126
  export type CameraDeviceProxyMethodNames = MethodKeys<CameraDeviceProxyMethods>;
152
127
  export interface DeviceManagerListenerMessagePayload {
@@ -6,7 +6,7 @@ export declare class WebsocketProxy {
6
6
  nsp: Namespace;
7
7
  nspName: SocketNsp;
8
8
  private logger;
9
- private proxy;
9
+ private proxyServer;
10
10
  private configService;
11
11
  private camerasService;
12
12
  private bridges;
@@ -23,9 +23,5 @@ export declare class WebsocketProxy {
23
23
  private sendMessage;
24
24
  private onEnd;
25
25
  private onDestroy;
26
- private isSystemManagerMethod;
27
- private isDeviceManagerMethod;
28
- private isPluginsManagerMethod;
29
- private isCameraProxyMethod;
30
26
  private isCameraState;
31
27
  }
@@ -1,7 +1,6 @@
1
1
  import type { CameraDevice } from '../camera/device.js';
2
+ import type { FormSubmitResponse } from './types.js';
2
3
  export declare abstract class BasePlugin {
3
- abstract onFormSubmit(actionId: string, payload: any): Promise<{
4
- toast?: string;
5
- }>;
4
+ abstract onFormSubmit(actionId: string, payload: any): Promise<FormSubmitResponse | void>;
6
5
  abstract configureCameras(cameras: CameraDevice[]): void;
7
6
  }
@@ -11,7 +11,8 @@ export interface JSONObject {
11
11
  export type JSONArray = JSONValue[];
12
12
  export type PluginConfig = Record<string, any>;
13
13
  export declare const CAMERA_EXTENSIONS: CameraExtension[];
14
- export type CameraExtension = 'hub' | 'prebuffer' | 'motionDetection' | 'objectDetection' | 'audioDetection' | 'ptz' | 'intercom';
14
+ export type CameraExtensionWithoutHub = 'prebuffer' | 'motionDetection' | 'objectDetection' | 'audioDetection' | 'ptz';
15
+ export type CameraExtension = CameraExtensionWithoutHub | 'hub';
15
16
  type ExtensionOrSupport = {
16
17
  extension: CameraExtension;
17
18
  supportAdditionalCameras?: never;
@@ -20,7 +21,7 @@ type ExtensionOrSupport = {
20
21
  supportAdditionalCameras?: boolean;
21
22
  };
22
23
  export interface PluginContractBase {
23
- builtIns?: Exclude<CameraExtension, 'hub'>[];
24
+ builtIns?: CameraExtensionWithoutHub[];
24
25
  dependencies?: string[];
25
26
  pythonVersion?: string;
26
27
  }
@@ -44,9 +45,14 @@ export interface PluginStorage {
44
45
  storagePath: string;
45
46
  configFile: string;
46
47
  }
48
+ export interface PluginInfo {
49
+ id: string;
50
+ name: string;
51
+ contract: PluginContract;
52
+ }
47
53
  export interface ProcessLoadMessage {
48
54
  cameras: Camera[];
49
- pluginId: string;
55
+ plugin: PluginInfo;
50
56
  storage: PluginStorage;
51
57
  }
52
58
  export interface ProcessMessage {
@@ -77,7 +83,7 @@ export interface PluginJsonBaseSchema<T = any> extends JsonBaseSchema<T> {
77
83
  }
78
84
  export interface JsonSchemaString extends JsonBaseSchema<string> {
79
85
  type: 'string';
80
- format?: 'date-time' | 'date' | 'time' | 'email' | 'uuid' | 'ipv4' | 'ipv6' | 'password' | 'qrCode';
86
+ format?: 'date-time' | 'date' | 'time' | 'email' | 'uuid' | 'ipv4' | 'ipv6' | 'password' | 'qrCode' | 'image';
81
87
  minLength?: number;
82
88
  maxLength?: number;
83
89
  }
@@ -126,7 +132,7 @@ export interface PluginJsonSchemaObject extends PluginJsonBaseSchema {
126
132
  properties?: PluginJsonSchemaForm;
127
133
  }
128
134
  export interface JsonSchemaObjectWithButtons extends JsonSchemaObject {
129
- buttons?: [JsonSchemaButton, JsonSchemaButton?];
135
+ buttons: [JsonSchemaButton, JsonSchemaButton?];
130
136
  }
131
137
  export interface JsonSchemaAnyOf {
132
138
  anyOf: JsonSchema[];
@@ -154,4 +160,15 @@ export interface RootSchema {
154
160
  export interface PluginRootSchema {
155
161
  schema: PluginJsonSchemaForm;
156
162
  }
163
+ export interface ToastMessage {
164
+ type: 'info' | 'success' | 'warning' | 'error';
165
+ message: string;
166
+ }
167
+ export interface FormSubmitSchema {
168
+ config: JsonSchemaObjectWithButtons;
169
+ }
170
+ export interface FormSubmitResponse {
171
+ toast?: ToastMessage;
172
+ schema?: FormSubmitSchema;
173
+ }
157
174
  export {};
@@ -22,6 +22,7 @@ export declare class PluginWorker {
22
22
  restart(): Promise<void>;
23
23
  getPID(): number;
24
24
  isRunning(): boolean;
25
+ isReady(): boolean;
25
26
  private gatherDevices;
26
27
  private kill;
27
28
  private setStatus;
@@ -1,9 +1,17 @@
1
1
  import { CameraDevice } from '../../../../camera/device.js';
2
+ import { CameraAudioDetectionInterface } from '../../../../camera/interfaces/audioDetection.js';
3
+ import { CameraMotionDetectionInterface } from '../../../../camera/interfaces/motionDetection.js';
4
+ import { CameraObjectDetectionInterface } from '../../../../camera/interfaces/objectDetection.js';
5
+ import { CameraPrebufferInterface } from '../../../../camera/interfaces/prebuffer.js';
6
+ import { CameraPTZInterface } from '../../../../camera/interfaces/ptz.js';
2
7
  import { MotionFrame, VideoFrame } from '../../../../camera/videoFrame.js';
3
8
  import type { Camera } from '../../../../api/database/types.js';
4
- import type { CameraSource, SetValues } from '../../../../camera/types.js';
9
+ import type { CameraAudioDetectionDelegate, CameraConfigInputSettings, CameraDelegate, CameraDelegates, CameraMotionDetectionDelegate, CameraObjectDetectionDelegate, CameraPrebufferDelegate, CameraPTZDelegate, CameraSource, SetValues } from '../../../../camera/types.js';
5
10
  import type { VideoFrame as VideoFrameImp } from '../../../../decoder/types.js';
11
+ import type { CameraDeviceProxyMethods } from '../../../../nats/types.js';
12
+ import type { PluginInfo } from '../../../../plugins/types.js';
6
13
  import type { IceServer } from '../../../../services/config/types.js';
14
+ import type { MethodKeys, MethodType } from '../../../../types.js';
7
15
  import type { PluginAPI } from '../api.js';
8
16
  import type { PluginLogger } from '../logger.js';
9
17
  export declare class CameraDeviceProxy extends CameraDevice {
@@ -32,22 +40,30 @@ export declare class CameraDeviceProxy extends CameraDevice {
32
40
  private activeMotionRequests;
33
41
  private auth;
34
42
  private proxyEndpoints;
35
- private pluginID;
36
- private pluginName;
43
+ private plugin;
44
+ private cameraDelegate;
45
+ prebufferDelegate: CameraPrebufferInterface;
46
+ ptzDelegate: CameraPTZInterface;
47
+ audioDetectorDelegate: CameraAudioDetectionInterface;
48
+ motionDetectorDelegate: CameraMotionDetectionInterface;
49
+ objectDetectorDelegate: CameraObjectDetectionInterface;
37
50
  get sources(): CameraSource[];
38
- constructor(api: PluginAPI, logger: PluginLogger, camera: Camera, pluginId: string, pluginName: string, proxyEndpoints: string[], auth: {
51
+ constructor(api: PluginAPI, logger: PluginLogger, camera: Camera, plugin: PluginInfo, proxyEndpoints: string[], auth: {
39
52
  user: string;
40
53
  pass: string;
41
54
  });
42
55
  init(): Promise<void>;
56
+ setDelegate<T extends keyof CameraDelegates>(name: T, delegate: CameraDelegates[T]): void;
43
57
  connect(): Promise<void>;
44
58
  disconnect(): Promise<void>;
45
- reboot(): Promise<void>;
46
59
  getFrames(prebufferDuration?: number): AsyncIterableIterator<VideoFrame>;
47
60
  getMotionFrames(): AsyncIterableIterator<MotionFrame>;
48
61
  getFfmpegPath(): Promise<string>;
49
62
  getIceServers(): Promise<IceServer[]>;
50
63
  updateState<T extends keyof SetValues>(stateName: T, eventData: SetValues[T], frame?: VideoFrameImp): Promise<void>;
64
+ addCameraSource(source: CameraConfigInputSettings): Promise<void>;
65
+ updateCameraSource(sourceId: string, source: Partial<CameraConfigInputSettings>): Promise<void>;
66
+ removeCameraSource(sourceId: string): Promise<void>;
51
67
  refreshStates(): Promise<void>;
52
68
  cleanup(): Promise<void>;
53
69
  private onMotionFrame;
@@ -59,5 +75,11 @@ export declare class CameraDeviceProxy extends CameraDevice {
59
75
  private requestHandler;
60
76
  private listenToMessages;
61
77
  private listenToSignalingMessages;
62
- private onRequest;
78
+ onRequest<T extends keyof CameraDeviceProxyMethods>(client: 'cameraFn', fn: T, args?: Record<string, any>, timeout?: number): Promise<any>;
79
+ onRequest<T extends MethodKeys<CameraDelegate>>(client: 'cameraDelegate', fn: T, args?: Parameters<MethodType<CameraDelegate, T>>, timeout?: number): Promise<any>;
80
+ onRequest<T extends MethodKeys<CameraPrebufferDelegate>>(client: 'prebufferDelegate', fn: T, args?: Parameters<MethodType<CameraPrebufferDelegate, T>>, timeout?: number): Promise<any>;
81
+ onRequest<T extends MethodKeys<CameraPTZDelegate>>(client: 'ptzDelegate', fn: T, args?: Parameters<MethodType<CameraPTZDelegate, T>>, timeout?: number): Promise<any>;
82
+ onRequest<T extends MethodKeys<CameraMotionDetectionDelegate>>(client: 'motionDetectorDelegate', fn: T, args?: Parameters<MethodType<CameraMotionDetectionDelegate, T>>, timeout?: number): Promise<any>;
83
+ onRequest<T extends MethodKeys<CameraObjectDetectionDelegate>>(client: 'objectDetectorDelegate', fn: T, args?: Parameters<MethodType<CameraObjectDetectionDelegate, T>>, timeout?: number): Promise<any>;
84
+ onRequest<T extends MethodKeys<CameraAudioDetectionDelegate>>(client: 'audioDetectorDelegate', fn: T, args?: Parameters<MethodType<CameraAudioDetectionDelegate, T>>, timeout?: number): Promise<any>;
63
85
  }
@@ -3,6 +3,7 @@ import { CameraDeviceProxy } from './cameraDevice.js';
3
3
  import type { CameraDevice } from '../../../../camera/device.js';
4
4
  import type { CameraConfig } from '../../../../camera/types.js';
5
5
  import type { DeviceManagerProxyEventCallbacks, DeviceManagerProxyMethods } from '../../../../nats/types.js';
6
+ import type { PluginInfo } from '../../../../plugins/types.js';
6
7
  import type { PluginAPI } from '../api.js';
7
8
  import type { PluginLogger } from '../logger.js';
8
9
  export declare interface DeviceManager extends DeviceManagerProxyMethods {
@@ -25,10 +26,9 @@ export declare class DeviceManager extends EventEmitter implements DeviceManager
25
26
  private messageQueue?;
26
27
  private auth;
27
28
  private proxyEndpoints;
28
- private pluginId;
29
- private pluginName;
29
+ private plugin;
30
30
  private devices;
31
- constructor(api: PluginAPI, logger: PluginLogger, pluginId: string, pluginName: string, proxyEndpoints: string[], auth: {
31
+ constructor(api: PluginAPI, logger: PluginLogger, plugin: PluginInfo, proxyEndpoints: string[], auth: {
32
32
  user: string;
33
33
  pass: string;
34
34
  });
@@ -1,5 +1,6 @@
1
1
  import { EventEmitter } from 'node:events';
2
2
  import type { PluginsManagerProxyEventCallbacks, PluginsManagerProxyMethods } from '../../../../nats/types.js';
3
+ import type { PluginInfo } from '../../../../plugins/types.js';
3
4
  import type { PluginAPI } from '../api.js';
4
5
  import type { PluginLogger } from '../logger.js';
5
6
  export declare interface PluginsManager extends PluginsManagerProxyMethods {
@@ -22,9 +23,8 @@ export declare class PluginsManager extends EventEmitter implements PluginsManag
22
23
  private messageQueue?;
23
24
  private auth;
24
25
  private proxyEndpoints;
25
- private pluginId;
26
- private pluginName;
27
- constructor(api: PluginAPI, logger: PluginLogger, pluginId: string, pluginName: string, proxyEndpoints: string[], auth: {
26
+ private plugin;
27
+ constructor(api: PluginAPI, logger: PluginLogger, plugin: PluginInfo, proxyEndpoints: string[], auth: {
28
28
  user: string;
29
29
  pass: string;
30
30
  });
@@ -1,5 +1,6 @@
1
1
  import { EventEmitter } from 'node:events';
2
2
  import type { SystemManagerProxyEventCallbacks, SystemManagerProxyMethods } from '../../../../nats/types.js';
3
+ import type { PluginInfo } from '../../../../plugins/types.js';
3
4
  import type { PluginAPI } from '../api.js';
4
5
  import type { PluginLogger } from '../logger.js';
5
6
  export declare interface SystemManager extends SystemManagerProxyMethods {
@@ -22,9 +23,8 @@ export declare class SystemManager extends EventEmitter implements SystemManager
22
23
  private messageQueue?;
23
24
  private auth;
24
25
  private proxyEndpoints;
25
- private pluginId;
26
- private pluginName;
27
- constructor(api: PluginAPI, logger: PluginLogger, pluginId: string, pluginName: string, proxyEndpoints: string[], auth: {
26
+ private plugin;
27
+ constructor(api: PluginAPI, logger: PluginLogger, plugin: PluginInfo, proxyEndpoints: string[], auth: {
28
28
  user: string;
29
29
  pass: string;
30
30
  });
@@ -1,4 +1,5 @@
1
- import { z, type ZodTypeAny } from 'zod';
1
+ import { z } from 'zod';
2
+ import type { ZodTypeAny } from 'zod';
2
3
  import type { JsonSchema, JsonSchemaAnyOf, JsonSchemaArray, JsonSchemaBoolean, JsonSchemaButton, JsonSchemaEnum, JsonSchemaNumber, JsonSchemaObject, JsonSchemaObjectWithButtons, JsonSchemaString, PluginJsonSchema, PluginJsonSchemaForm, PluginRootSchema, RootSchema } from '../../../plugins/types.js';
3
4
  type RootZodSchema = z.ZodObject<Record<string, ZodTypeAny>, 'strict', ZodTypeAny, {
4
5
  [x: string]: any;
@@ -1,49 +1,43 @@
1
1
  import 'reflect-metadata';
2
2
  import type { Go2RtcConfig, IConfig, Secrets } from './types.js';
3
3
  export declare class ConfigService {
4
+ static readonly IS_DEV: boolean;
5
+ static readonly IS_DOCKER: boolean;
6
+ static readonly IS_ELECTRON: boolean;
7
+ static readonly IS_HA: boolean;
8
+ static readonly IS_STANDARD: boolean;
9
+ static readonly IS_SERVICE: boolean;
10
+ static readonly VERSION: string;
11
+ static readonly MIN_NODE_VERSION: string;
12
+ static readonly NODE_VERSION: string;
13
+ static readonly SERVER_PATH: string;
14
+ static readonly INTERFACE_PATH: string;
4
15
  private logger;
5
16
  private _config;
6
17
  private _go2rtcConfig;
7
- CAMERAS_ID: string;
8
- DATABASE_ID: string;
9
- PLUGINS_ID: string;
10
- USER_PLUGINS_ID: string;
11
- SETTINGS_ID: string;
12
- USERS_ID: string;
13
- SECRETS: Secrets;
14
- static IS_DEV: boolean;
15
- static IS_DOCKER: boolean;
16
- static IS_ELECTRON: boolean;
17
- static IS_HA: boolean;
18
- static IS_STANDARD: boolean;
19
- static IS_SERVICE: boolean;
20
- SERVER_PATH: string;
21
- INTERFACE_PATH: string;
22
- static VERSION: string;
23
- static MIN_NODE_VERSION: string;
24
- static NODE_VERSION: string;
25
- HOME_PATH: string;
26
- STORAGE_PATH: string;
27
- DATABASE_PATH: string;
28
- USERS_STORAGE_PATH: string;
29
- TMP_DIR: string;
30
- PLUGINS_STORAGE_PATH: string;
31
- PLUGINS_INSTALL_PATH: string;
32
- PLUGINS_PJSON_FILE: string;
33
- LOG_FILE: string;
34
- CONFIG_FILE: string;
35
- SECRETS_FILE: string;
36
- PYTHON_BINARY: string;
37
- GO2RTC_BINARY: string;
38
- GO2RTC_CONFIG_FILE: string;
39
- NATS_BINARY: string;
40
- UI_PORT: number;
41
- UI_ELECTRON_PORT: number;
18
+ readonly SECRETS: Secrets;
19
+ readonly HOME_PATH: string;
20
+ readonly STORAGE_PATH: string;
21
+ readonly DATABASE_PATH: string;
22
+ readonly USERS_STORAGE_PATH: string;
23
+ readonly TMP_DIR: string;
24
+ readonly PLUGINS_STORAGE_PATH: string;
25
+ readonly PLUGINS_INSTALL_PATH: string;
26
+ readonly PLUGINS_PJSON_FILE: string;
27
+ readonly LOG_FILE: string;
28
+ readonly CONFIG_FILE: string;
29
+ readonly SECRETS_FILE: string;
30
+ readonly GO2RTC_BINARY: string;
31
+ readonly GO2RTC_CONFIG_FILE: string;
32
+ readonly NATS_BINARY: string;
33
+ readonly UI_PORT: number;
34
+ readonly UI_ELECTRON_PORT: number;
42
35
  get config(): IConfig;
43
36
  set config(newConfig: IConfig);
44
37
  get go2rtcConfig(): Go2RtcConfig;
45
38
  set go2rtcConfig(newConfig: Go2RtcConfig);
46
39
  constructor();
40
+ static extractVersion(str: string): string | null;
47
41
  read(): void;
48
42
  writeConfig(newConfig?: IConfig): void;
49
43
  writeGo2RtcConfigFile(newConfig?: Go2RtcConfig): void;
@@ -56,5 +50,4 @@ export declare class ConfigService {
56
50
  private updateConfig;
57
51
  private updateGo2RtcConfig;
58
52
  private updateSecrets;
59
- static extractVersion(str: string): string | null;
60
53
  }
@@ -24,7 +24,7 @@ export interface PluginsSettings {
24
24
  }
25
25
  export interface IConfig {
26
26
  port: number;
27
- insecurePort: number;
27
+ localPort: number;
28
28
  tempFile?: string;
29
29
  ssl: IConfigSSL;
30
30
  logger: Logger;
@@ -0,0 +1,4 @@
1
+ export type MethodKeys<T> = keyof {
2
+ [K in keyof T as T[K] extends (...args: any) => any ? K : never]: any;
3
+ };
4
+ export type MethodType<T, K extends keyof T> = T[K] extends (...args: any) => any ? T[K] : never;
@@ -1,4 +1,7 @@
1
1
  export type * from '../../server/src/api/database/types.js';
2
+ export * from '../../server/src/api/schemas/cameras.schema.js';
3
+ export * from '../../server/src/api/schemas/plugins.schema.js';
4
+ export * from '../../server/src/api/schemas/users.schema.js';
2
5
  export type * from '../../server/src/api/types/index.js';
3
6
  export type * from '../../server/src/api/websocket/types.js';
4
7
  export * from '../../server/src/camera/polygon.js';
@@ -7,6 +10,8 @@ export type * from '../../server/src/decoder/types.js';
7
10
  export * from '../../server/src/go2rtc/types.js';
8
11
  export type * from '../../server/src/nats/types.js';
9
12
  export * from '../../server/src/plugins/types.js';
13
+ export * from '../../server/src/polyglot/node/plugins/schema.js';
10
14
  export * from '../../server/src/services/config/types.js';
15
+ export type * from '../../server/src/types.js';
11
16
  export { names as cocoLabels } from '../../server/src/utils/cocoLabels.json';
12
17
  export * from '../../server/src/utils/subscribed.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camera.ui/browser",
3
- "version": "0.0.79",
3
+ "version": "0.0.80",
4
4
  "description": "camera.ui browser client",
5
5
  "author": "seydx (https://github.com/seydx/camera.ui)",
6
6
  "module": "./dist/bundle.js",
@@ -24,7 +24,7 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "axios": "^1.7.2",
27
- "lru-cache": "^10.2.2",
27
+ "lru-cache": "^11.0.0",
28
28
  "rxjs": "^7.8.1",
29
29
  "socket.io-client": "^4.7.5"
30
30
  },
@@ -32,19 +32,19 @@
32
32
  "@rushstack/eslint-patch": "^1.10.3",
33
33
  "@swc/register": "^0.1.10",
34
34
  "@types/webrtc": "^0.0.43",
35
- "@typescript-eslint/eslint-plugin": "^7.14.1",
36
- "@typescript-eslint/parser": "^7.14.1",
35
+ "@typescript-eslint/eslint-plugin": "^7.16.1",
36
+ "@typescript-eslint/parser": "^7.16.1",
37
37
  "bufferutil": "^4.0.8",
38
38
  "eslint": "^8.57.0",
39
39
  "eslint-config-prettier": "^9.1.0",
40
- "eslint-plugin-prettier": "^5.1.3",
41
- "prettier": "^3.3.2",
42
- "rimraf": "^5.0.7",
40
+ "eslint-plugin-prettier": "^5.2.1",
41
+ "prettier": "^3.3.3",
42
+ "rimraf": "^6.0.1",
43
43
  "ts-loader": "^9.5.1",
44
- "typescript": "^5.5.2",
45
- "updates": "^16.2.0",
44
+ "typescript": "^5.5.3",
45
+ "updates": "^16.2.1",
46
46
  "utf-8-validate": "^6.0.4",
47
- "webpack": "^5.92.1",
47
+ "webpack": "^5.93.0",
48
48
  "webpack-cli": "^5.1.4"
49
49
  },
50
50
  "bugs": {