@camera.ui/browser 0.0.91 → 0.0.92

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 (64) hide show
  1. package/dist/bundle.js +1 -1
  2. package/dist/types/packages/client/browser/src/proxy/cameraDevice.d.ts +6 -6
  3. package/dist/types/packages/client/browser/src/proxy/coreManager.d.ts +2 -1
  4. package/dist/types/packages/client/browser/src/proxy/deviceManager.d.ts +1 -2
  5. package/dist/types/packages/client/browser/src/types.d.ts +11 -3
  6. package/dist/types/packages/common/src/messaging/index.d.ts +48 -0
  7. package/dist/types/packages/common/src/nats/index.d.ts +30 -0
  8. package/dist/types/{server/src → packages/plugineer/src/polyglot/node}/camera/index.d.ts +4 -5
  9. package/dist/types/packages/plugineer/src/polyglot/node/camera/interfaces/camera.d.ts +8 -0
  10. package/dist/types/{server/src → packages/plugineer/src/polyglot/node}/camera/interfaces/prebuffer.d.ts +3 -5
  11. package/dist/types/{server/src → packages/plugineer/src/polyglot/node}/camera/interfaces/ptz.d.ts +3 -5
  12. package/dist/types/{server/src → packages/plugineer/src/polyglot/node}/camera/iou.d.ts +1 -1
  13. package/dist/types/{server/src → packages/plugineer/src/polyglot/node}/camera/polygon.d.ts +1 -2
  14. package/dist/types/{server → packages/plugineer}/src/polyglot/node/plugins/schema.d.ts +1 -1
  15. package/dist/types/server/src/api/database/constants.d.ts +8 -0
  16. package/dist/types/server/src/api/database/index.d.ts +0 -8
  17. package/dist/types/server/src/api/database/types.d.ts +6 -6
  18. package/dist/types/server/src/api/schemas/cameras.schema.d.ts +117 -117
  19. package/dist/types/server/src/api/schemas/config.schema.d.ts +6 -6
  20. package/dist/types/server/src/api/schemas/go2rtc.schema.d.ts +84 -84
  21. package/dist/types/server/src/api/schemas/users.schema.d.ts +150 -150
  22. package/dist/types/server/src/api/types/index.d.ts +1 -1
  23. package/dist/types/server/src/api.d.ts +1 -7
  24. package/dist/types/server/src/camera/controller.d.ts +4 -5
  25. package/dist/types/server/src/camera/types.d.ts +24 -11
  26. package/dist/types/server/src/decoder/worker.d.ts +1 -1
  27. package/dist/types/server/src/nats/index.d.ts +3 -4
  28. package/dist/types/server/src/nats/proxy/cameraDevice.d.ts +2 -2
  29. package/dist/types/server/src/nats/proxy/coreManager.d.ts +3 -3
  30. package/dist/types/server/src/nats/proxy/deviceManager.d.ts +5 -5
  31. package/dist/types/server/src/nats/types.d.ts +5 -34
  32. package/dist/types/server/src/plugins/interfaces/base.d.ts +1 -1
  33. package/dist/types/server/src/plugins/plugin.d.ts +1 -1
  34. package/dist/types/server/src/plugins/types.d.ts +36 -3
  35. package/dist/types/server/src/services/config/index.d.ts +2 -0
  36. package/dist/types/server/src/services/logger/index.d.ts +4 -16
  37. package/dist/types/shared/types/index.d.ts +5 -3
  38. package/package.json +1 -1
  39. package/dist/types/server/src/camera/device.d.ts +0 -29
  40. package/dist/types/server/src/camera/interfaces/camera.d.ts +0 -10
  41. package/dist/types/server/src/camera/streaming/peer-connection.d.ts +0 -55
  42. package/dist/types/server/src/camera/streaming/webrtc-connection.d.ts +0 -35
  43. package/dist/types/server/src/camera/streaming/werift-session.d.ts +0 -41
  44. package/dist/types/server/src/camera/videoFrame.d.ts +0 -24
  45. package/dist/types/server/src/nats/connection.d.ts +0 -17
  46. package/dist/types/server/src/nats/constants.d.ts +0 -1
  47. package/dist/types/server/src/nats/error.d.ts +0 -9
  48. package/dist/types/server/src/nats/messageQueue.d.ts +0 -20
  49. package/dist/types/server/src/nats/subscription.d.ts +0 -12
  50. package/dist/types/server/src/polyglot/node/plugins/cameraStorage.d.ts +0 -107
  51. package/dist/types/server/src/polyglot/node/plugins/configService.d.ts +0 -104
  52. package/dist/types/server/src/polyglot/node/plugins/pluginApi.d.ts +0 -35
  53. package/dist/types/server/src/polyglot/node/plugins/pluginLogger.d.ts +0 -18
  54. package/dist/types/server/src/polyglot/node/plugins/proxy/cameraDevice.d.ts +0 -69
  55. package/dist/types/server/src/polyglot/node/plugins/proxy/coreManager.d.ts +0 -40
  56. package/dist/types/server/src/polyglot/node/plugins/proxy/deviceManager.d.ts +0 -47
  57. package/dist/types/server/src/polyglot/node/plugins/storageController.d.ts +0 -30
  58. package/dist/types/server/src/utils/ffmpeg.d.ts +0 -2
  59. package/dist/types/server/src/utils/network.d.ts +0 -12
  60. package/dist/types/server/src/utils/npm.d.ts +0 -4
  61. package/dist/types/server/src/utils/pythonInstaller.d.ts +0 -48
  62. package/dist/types/server/src/utils/utils.d.ts +0 -10
  63. /package/dist/types/{server/src/utils/packer.d.ts → packages/common/src/packer/index.d.ts} +0 -0
  64. /package/dist/types/{server → packages/common}/src/utils/subscribed.d.ts +0 -0
@@ -1,12 +0,0 @@
1
- import { EventEmitter } from 'events';
2
- import type { Msg, Subscription as NatsSubscription } from 'nats';
3
- export declare interface ProxySubscription {
4
- on(event: 'message', listener: (message: Msg) => void): this;
5
- emit(event: 'message', message: Msg): boolean;
6
- }
7
- export declare class ProxySubscription extends EventEmitter implements ProxySubscription {
8
- readonly subscriber: NatsSubscription;
9
- constructor(subscriber: NatsSubscription);
10
- listen(): Promise<void>;
11
- close(): void;
12
- }
@@ -1,107 +0,0 @@
1
- import type { RootDatabase } from 'lmdb';
2
- import type { JsonSchema, JsonSchemaForm, SchemaConfig } from '../../../plugins/types.js';
3
- import type { API } from './pluginApi.js';
4
- export declare class CameraStorage<T extends Record<string, any> = Record<string, any>> {
5
- private cameraId;
6
- private instance;
7
- private api;
8
- private pluginDb;
9
- schema: JsonSchemaForm;
10
- values: T;
11
- constructor(api: API, pluginDb: RootDatabase<Record<string, any>, 'config'>, instance: any, cameraId: string, schema?: JsonSchemaForm);
12
- /**
13
- * Initialize the storage.
14
- * This will load the configuration from the database.
15
- */
16
- initializeStorage(): void;
17
- /**
18
- * Get a value from the configuration by its key/path.
19
- * If the schema has an onGet function, the onGet function will be called.
20
- * If the onGet functions is undefined, the value from the configuration will be returned.
21
- * If the schema has a default value, and the configuration value is undefined, the default value will be returned.
22
- *
23
- * @param path - The path to the configuration value.
24
- * @returns The value from the configuration.
25
- */
26
- getValue<T = string>(path: string): Promise<T> | undefined;
27
- getValue<T = string>(path: string, defaultValue: T): Promise<T>;
28
- /**
29
- * Set a new value for a given key/path in the configuration.
30
- * If the schema of the value has an onSet function, and the value has changed, the onSet function will be called.
31
- * If the schema of the value is declared as storable, the value will be saved to the database.
32
- *
33
- * @param path - The path to the configuration value.
34
- * @param newValue - The new value to set.
35
- */
36
- setValue<T = string>(path: string, newValue: T): Promise<void>;
37
- /**
38
- * Check if a value exists by its config path/key.
39
- *
40
- * @param path - The path to the value to check.
41
- * @returns True if the value exists, false otherwise.
42
- */
43
- hasValue(path: string): boolean;
44
- /**
45
- * Get the root schema and configuration.
46
- * This will also call the onGet functions for the schema.
47
- *
48
- * @returns The root schema and configuration.
49
- */
50
- getConfig(): Promise<SchemaConfig>;
51
- /**
52
- * Set a new configuration.
53
- * If the schema of a value which has been changed has an onSet function, the onSet function will be called.
54
- *
55
- * @param newConfig - The new configuration to set.
56
- */
57
- setConfig(newConfig: T): Promise<void>;
58
- /**
59
- * Add a new schema to the existing schema.
60
- * It will also add the value to the configuration.
61
- * If the schema is declared as storable, the value will be saved to the database.
62
- *
63
- * @param schema - The new schema to add.
64
- * @param path - The path to the schema to add.
65
- */
66
- addSchema(schema: JsonSchemaForm): Promise<void>;
67
- addSchema(path: string, schema: JsonSchema): Promise<void>;
68
- /**
69
- * Remove a schema by its config path/key from the existing schema.
70
- * It will also remove the value from the configuration.
71
- * If the schema is declared as storable, the value will be removed from the database.
72
- *
73
- * @param path - The path to the schema to remove.
74
- */
75
- removeSchema(path: string): void;
76
- /**
77
- * Change a schema by its config path/key from the existing schema.
78
- * It will also change the value from the configuration.
79
- * If the schema is declared as storable, the value will be saved to the database.
80
- *
81
- * @param path - The path to the schema to change.
82
- * @param schema - The new schema to set.
83
- */
84
- changeSchema(path: string, newSchema: Partial<JsonSchema>): Promise<void>;
85
- /**
86
- * Get a schema by its config path/key.
87
- *
88
- * @param path - The path to the schema to get.
89
- * @returns The schema.
90
- */
91
- getSchema<T>(path: string): T | undefined;
92
- /**
93
- * Check if a schema exists by its config path/key.
94
- *
95
- * @param path - The path to the schema to check.
96
- * @returns True if the schema exists, false otherwise.
97
- */
98
- hasSchema(path: string): boolean;
99
- private resolveOnGetFunctions;
100
- private resolveOnGetFunctionsForObject;
101
- private resolveOnGetFunctionsForSchema;
102
- private triggerOnSetForChanges;
103
- private filterStorableValues;
104
- private containsStorableSchema;
105
- private saveDb;
106
- private close;
107
- }
@@ -1,104 +0,0 @@
1
- import type { Path } from 'object-path';
2
- import type { JSONValue, PluginConfig } from '../../../plugins/types.js';
3
- export declare class PluginConfigService {
4
- private config;
5
- private configFile;
6
- constructor(configFile: string);
7
- /**
8
- * Get key (Path) from config.json
9
- *
10
- * @param key - Key to lookup for
11
- * @param defaultValue - Default value if `key` not exist
12
- * @param validate - Validate the value of the `key` and replace with `defaultValue` if it is not valid
13
- * @param refresh - Re-Read config.json before lookup for the `key`
14
- * @param writeIfNotValid - Optional parameter, if true, the changes will be written to the file, if the value of the `key` is not valid and is replaced by the `defaultValue`
15
- *
16
- * @returns `value` for the given `key` or `defaultValue`
17
- */
18
- get(key: Path, defaultValue: JSONValue, validate: Function, refresh?: boolean, writeIfNotValid?: boolean): any;
19
- get(key: Path, defaultValue?: unknown, validate?: Function, refresh?: boolean, writeIfNotValid?: boolean): any;
20
- /**
21
- * Test key (Path) existence
22
- *
23
- * @param key - Key to lookup for
24
- * @param refresh - Re-Read config.json before lookup for the `key`
25
- */
26
- has(key: Path, refresh?: boolean): boolean;
27
- /**
28
- * Set a value if it doesn't exist, do nothing if it does
29
- *
30
- * @param key - Key whose existence is to be checked
31
- * @param defaultValue - Default value if `key` not exist
32
- * @param write - Optional parameter, if true, the changes will be written to the file.
33
- */
34
- ensureExists(key: Path, defaultValue: JSONValue, write?: boolean): void;
35
- /**
36
- * Set a key (Path) to a value
37
- *
38
- * @param key - Key
39
- * @param value - Value to set for they given `key`
40
- * @param write - Optional parameter, if true, the changes will be written to the file.
41
- */
42
- set(key: Path, value: any, write?: boolean): void;
43
- /**
44
- * Insert an item in an array path
45
- *
46
- * @param key - Key to the array
47
- * @param value - Value to insert in the array
48
- * @param at - Index
49
- * @param write - Optional parameter, if true, the changes will be written to the file.
50
- */
51
- insert(key: Path, value: any, at?: number, write?: boolean): void;
52
- /**
53
- * Create (if path isn't an array) and push the value to it. Can push unlimited number of values
54
- *
55
- * @param key - Key to the array
56
- * @param write - Optional parameter, if true, the changes will be written to the file.
57
- * @param items - Values to push in to the array
58
- */
59
- push(key: Path, write?: boolean, ...items: any[]): void;
60
- /**
61
- * Deletes a member from object or array
62
- *
63
- * @param key - Key to lookup for
64
- * @param write - Optional parameter, if true, the changes will be written to the file.
65
- */
66
- delete(key: Path, write?: boolean): void;
67
- /**
68
- * @param refresh - Re-Read config.json
69
- *
70
- * @returns config.json
71
- */
72
- all(refresh?: boolean): PluginConfig;
73
- /**
74
- * @param config - New config.json
75
- * @param write - Optional parameter, if true, the changes will be written to the file.
76
- */
77
- replace(config: PluginConfig, write?: boolean): void;
78
- /**
79
- * Updates a specific value in a nested object structure by a given path and key.
80
- *
81
- * @param path - The path to the nested object.
82
- * @param searchKey - The key to search for.
83
- * @param searchValue - The value to match the searchKey.
84
- * @param targetKey - The key of the value to be updated.
85
- * @param newValue - The new value to be set.
86
- * @param write - Optional parameter, if true, the changes will be written to the file.
87
- */
88
- updateValue(path: string, searchKey: string, searchValue: any, targetKey: string, newValue: any, write?: boolean): void;
89
- /**
90
- * Replaces a specific item in a nested object structure by a given path and key.
91
- * If the item does not exist, it will be added.
92
- * If the path does not exist, it will be created.
93
- *
94
- * @param path - The path to the nested object.
95
- * @param searchKey - The key to search for.
96
- * @param searchValue - The value to match the searchKey.
97
- * @param newItem - The new item to replace the old one. If the item does not exist, it will be added.
98
- * @param write - Optional parameter, if true, the changes will be written to the file.
99
- */
100
- replaceOrAddItem(path: string, searchKey: string, searchValue: any, newItem: any, write?: boolean): void;
101
- private init;
102
- private read;
103
- private write;
104
- }
@@ -1,35 +0,0 @@
1
- import { EventEmitter } from 'node:events';
2
- import { PluginConfigService } from './configService.js';
3
- import { StorageController } from './storageController.js';
4
- import type { RootDatabase } from 'lmdb';
5
- import type { AuthConfig } from '../../../decoder/types.js';
6
- import type { PluginInfo } from '../../../plugins/types.js';
7
- import type { PluginLogger } from './pluginLogger.js';
8
- import type { CoreManager } from './proxy/coreManager.js';
9
- import type { DeviceManager } from './proxy/deviceManager.js';
10
- export declare interface PluginAPI {
11
- on(event: 'finishLaunching', listener: () => void): this;
12
- on(event: 'shutdown', listener: () => void): this;
13
- once(event: 'finishLaunching', listener: () => void): this;
14
- once(event: 'shutdown', listener: () => void): this;
15
- off(event: 'finishLaunching', listener: () => void): this;
16
- off(event: 'shutdown', listener: () => void): this;
17
- removeListener(event: 'finishLaunching', listener: () => void): this;
18
- removeListener(event: 'shutdown', listener: () => void): this;
19
- removeAllListeners(event?: string): this;
20
- readonly coreManager: CoreManager;
21
- readonly deviceManager: DeviceManager;
22
- readonly storageController: StorageController;
23
- readonly configService: PluginConfigService;
24
- readonly storagePath: string;
25
- readonly configFile: string;
26
- }
27
- export declare class API extends EventEmitter implements PluginAPI {
28
- readonly coreManager: CoreManager;
29
- readonly deviceManager: DeviceManager;
30
- readonly storageController: StorageController;
31
- readonly configService: PluginConfigService;
32
- readonly storagePath: string;
33
- readonly configFile: string;
34
- constructor(plugin: PluginInfo, storagePath: string, configFile: string, logger: PluginLogger, proxyEndpoints: string[], auth: AuthConfig, pluginDb: RootDatabase<Record<string, any>, 'config'>);
35
- }
@@ -1,18 +0,0 @@
1
- export declare class PluginLogger {
2
- private _prefix;
3
- private _loggerPrefix;
4
- private _disableTimestamps;
5
- debugEnabled: boolean;
6
- traceEnabled: boolean;
7
- private get prefix();
8
- constructor(prefix: string, disableTimestamps: boolean);
9
- log(...args: any[]): void;
10
- error(...args: any[]): void;
11
- warn(...args: any[]): void;
12
- attention(...args: any[]): void;
13
- debug(...args: any[]): void;
14
- trace(...args: any[]): void;
15
- private formatMessage;
16
- private formattedArgs;
17
- private formatDateTime;
18
- }
@@ -1,69 +0,0 @@
1
- import { CameraDevice } from '../../../../camera/device.js';
2
- import { CameraInterface } from '../../../../camera/interfaces/camera.js';
3
- import { CameraPrebufferInterface } from '../../../../camera/interfaces/prebuffer.js';
4
- import { CameraPTZInterface } from '../../../../camera/interfaces/ptz.js';
5
- import { MotionFrame, VideoFrame } from '../../../../camera/videoFrame.js';
6
- import type { Camera } from '../../../../api/database/types.js';
7
- import type { CameraConfigInputSettings, CameraDelegates, CameraSource, SetValues } from '../../../../camera/types.js';
8
- import type { AuthConfig, VideoFrame as VideoFrameImp } from '../../../../decoder/types.js';
9
- import type { CameraDeviceProxyMethods } from '../../../../nats/types.js';
10
- import type { PluginInfo } from '../../../../plugins/types.js';
11
- import type { MethodKeys, MethodType } from '../../../../types.js';
12
- import type { API } from '../pluginApi.js';
13
- import type { PluginLogger } from '../pluginLogger.js';
14
- export declare class CameraDeviceProxy extends CameraDevice {
15
- private api;
16
- private initialized;
17
- private subject;
18
- private cameraSubscriberSubject;
19
- private cameraPluginSubscriberSubject;
20
- private frameSubject;
21
- private motionFrameSubject;
22
- private signalingSubject;
23
- private signalingTargetSubject;
24
- private publisher?;
25
- private cameraPublisher?;
26
- private framePublisher?;
27
- private motionFramePublisher?;
28
- private signalingPublisher?;
29
- private subscriber?;
30
- private cameraSubscriber?;
31
- private cameraPluginSubscriber?;
32
- private signalingSubscriber?;
33
- private frameSubscribers;
34
- private motionFrameSubscribers;
35
- private messageQueue?;
36
- private activeRequests;
37
- private activeMotionRequests;
38
- private auth;
39
- private proxyEndpoints;
40
- private plugin;
41
- protected cameraDelegate: CameraInterface;
42
- protected ptzDelegate: CameraPTZInterface;
43
- protected prebufferDelegate: CameraPrebufferInterface;
44
- get sources(): CameraSource[];
45
- constructor(api: API, logger: PluginLogger, camera: Camera, plugin: PluginInfo, proxyEndpoints: string[], auth: AuthConfig);
46
- init(): Promise<void>;
47
- setDelegate<T extends keyof CameraDelegates>(name: T, delegate: CameraDelegates[T]): void;
48
- connect(): Promise<void>;
49
- disconnect(): Promise<void>;
50
- getFrames(prebufferDuration?: number): AsyncIterableIterator<VideoFrame>;
51
- getMotionFrames(): AsyncIterableIterator<MotionFrame>;
52
- updateState<T extends keyof SetValues>(stateName: T, eventData: SetValues[T], frame?: VideoFrameImp): Promise<void>;
53
- addCameraSource(source: CameraConfigInputSettings): Promise<void>;
54
- updateCameraSource(sourceId: string, source: Partial<CameraConfigInputSettings>): Promise<void>;
55
- removeCameraSource(sourceId: string): Promise<void>;
56
- refreshStates(): Promise<void>;
57
- cleanup(): Promise<void>;
58
- private onMotionFrame;
59
- private connectToDecoder;
60
- private getMetadata;
61
- private disconnectFromDecoder;
62
- private closeFrameSubscribers;
63
- private closeMotionFrameSubscibers;
64
- private requestHandler;
65
- private onProxyMessage;
66
- private onSignalingMessage;
67
- onRequest<T extends MethodKeys<CameraDeviceProxyMethods>>(client: 'cameraFn', fn: T, args?: Parameters<MethodType<CameraDeviceProxyMethods, T>>, timeout?: number): Promise<Awaited<ReturnType<MethodType<CameraDeviceProxyMethods, T>>>>;
68
- onRequest<T extends keyof CameraDelegates, K extends MethodKeys<CameraDelegates[T]>>(client: T, fn: K, args: Parameters<MethodType<CameraDelegates[T], K>>, timeout?: number): Promise<Awaited<ReturnType<MethodType<CameraDelegates[T], K>>>>;
69
- }
@@ -1,40 +0,0 @@
1
- import { EventEmitter } from 'node:events';
2
- import type { AuthConfig } from '../../../../decoder/types.js';
3
- import type { CoreManagerProxyEventCallbacks, CoreManagerProxyMethods } from '../../../../nats/types.js';
4
- import type { PluginInfo } from '../../../../plugins/types.js';
5
- import type { IceServer } from '../../../../services/config/types.js';
6
- import type { API } from '../pluginApi.js';
7
- import type { PluginLogger } from '../pluginLogger.js';
8
- export declare interface CoreManager extends CoreManagerProxyMethods {
9
- on<E extends keyof CoreManagerProxyEventCallbacks>(event: E, listener: CoreManagerProxyEventCallbacks[E]): this;
10
- once<E extends keyof CoreManagerProxyEventCallbacks>(event: E, listener: CoreManagerProxyEventCallbacks[E]): this;
11
- off<E extends keyof CoreManagerProxyEventCallbacks>(event: E, listener: CoreManagerProxyEventCallbacks[E]): this;
12
- removeListener<E extends keyof CoreManagerProxyEventCallbacks>(event: E, listener: CoreManagerProxyEventCallbacks[E]): this;
13
- removeAllListeners<E extends keyof CoreManagerProxyEventCallbacks>(event?: E): this;
14
- }
15
- export declare class CoreManagerProxy extends EventEmitter implements CoreManager {
16
- private api;
17
- private logger;
18
- private initialized;
19
- private subject;
20
- private cmSubject;
21
- private publisher?;
22
- private dmPublisher?;
23
- private subscriber?;
24
- private dmSubscriber?;
25
- private messageQueue?;
26
- private auth;
27
- private proxyEndpoints;
28
- private plugin;
29
- constructor(api: API, logger: PluginLogger, plugin: PluginInfo, proxyEndpoints: string[], auth: AuthConfig);
30
- init(): Promise<void>;
31
- getFFmpegPath(): Promise<string>;
32
- getServerAddresses(): Promise<string[]>;
33
- getIceServers(): Promise<IceServer[]>;
34
- emit(): boolean;
35
- private requestHandler;
36
- private emitEvent;
37
- private onProxyMessage;
38
- private onRequest;
39
- private close;
40
- }
@@ -1,47 +0,0 @@
1
- import { EventEmitter } from 'node:events';
2
- import { CameraDeviceProxy } from './cameraDevice.js';
3
- import type { CameraDevice } from '../../../../camera/device.js';
4
- import type { CameraConfig } from '../../../../camera/types.js';
5
- import type { AuthConfig } from '../../../../decoder/types.js';
6
- import type { DeviceManagerProxyEventCallbacks, DeviceManagerProxyMethods } from '../../../../nats/types.js';
7
- import type { PluginInfo } from '../../../../plugins/types.js';
8
- import type { API } from '../pluginApi.js';
9
- import type { PluginLogger } from '../pluginLogger.js';
10
- export declare interface DeviceManager extends DeviceManagerProxyMethods {
11
- on<E extends keyof DeviceManagerProxyEventCallbacks>(event: E, listener: DeviceManagerProxyEventCallbacks[E]): this;
12
- once<E extends keyof DeviceManagerProxyEventCallbacks>(event: E, listener: DeviceManagerProxyEventCallbacks[E]): this;
13
- off<E extends keyof DeviceManagerProxyEventCallbacks>(event: E, listener: DeviceManagerProxyEventCallbacks[E]): this;
14
- removeListener<E extends keyof DeviceManagerProxyEventCallbacks>(event: E, listener: DeviceManagerProxyEventCallbacks[E]): this;
15
- removeAllListeners<E extends keyof DeviceManagerProxyEventCallbacks>(event?: E): this;
16
- }
17
- export declare class DeviceManagerProxy extends EventEmitter implements DeviceManager {
18
- private api;
19
- private logger;
20
- private initialized;
21
- private subject;
22
- private dmSubject;
23
- private publisher?;
24
- private dmPublisher?;
25
- private subscriber?;
26
- private dmSubscriber?;
27
- private messageQueue?;
28
- private auth;
29
- private proxyEndpoints;
30
- private plugin;
31
- private devices;
32
- constructor(api: API, logger: PluginLogger, plugin: PluginInfo, proxyEndpoints: string[], auth: AuthConfig);
33
- init(): Promise<void>;
34
- getCameraById(id: string): Promise<CameraDevice | undefined>;
35
- getCameraByName(name: string): Promise<CameraDevice | undefined>;
36
- createCamera(cameraConfig: CameraConfig): Promise<CameraDevice>;
37
- removeCameraByName(name: string): Promise<void>;
38
- removeCameraById(id: string): Promise<void>;
39
- emit(): boolean;
40
- configureCameras(cameraDevices: CameraDeviceProxy[]): void;
41
- private requestHandler;
42
- private emitEvent;
43
- private onProxyMessage;
44
- private onRequest;
45
- private addOrGetCamera;
46
- private close;
47
- }
@@ -1,30 +0,0 @@
1
- import { CameraStorage } from './cameraStorage.js';
2
- import type { RootDatabase } from 'lmdb';
3
- import type { JsonSchemaForm } from '../../../plugins/types.js';
4
- import type { API } from './pluginApi.js';
5
- export declare class StorageController {
6
- private api;
7
- private pluginDb;
8
- private cameraStorages;
9
- constructor(api: API, pluginDb: RootDatabase<Record<string, any>, 'config'>);
10
- /**
11
- * Create a camera storage instance
12
- *
13
- * @param instance - The plugin instance
14
- * @param cameraId - The camera id
15
- * @param schema - The plugin schema
16
- */
17
- createCameraStorage<T extends Record<string, any> = Record<string, any>>(instance: any, cameraId: string, schema?: JsonSchemaForm): CameraStorage<T>;
18
- /**
19
- * Get a camera storage instance
20
- *
21
- * @param cameraId - The camera id
22
- */
23
- getCameraStorage<T extends Record<string, any> = Record<string, any>>(cameraId: string): CameraStorage<T> | undefined;
24
- /**
25
- * Remove a camera storage instance
26
- *
27
- * @param cameraId - The camera id
28
- */
29
- removeCameraStorage(cameraId: string): void;
30
- }
@@ -1,2 +0,0 @@
1
- import type { FfmpegArgs } from '../decoder/types.js';
2
- export declare const getHwaccelInfo: (go2rtApiPort: number) => Promise<FfmpegArgs>;
@@ -1,12 +0,0 @@
1
- import type { Systeminformation } from 'systeminformation';
2
- export type IPVersion = 'ipv4' | 'ipv6';
3
- export interface UsableNetworkAddress {
4
- address: string;
5
- isPrivate: boolean;
6
- }
7
- export declare const isIPv4EmbeddedIPv6: (ip: string) => boolean;
8
- export declare const extractPureIPAddress: (address: string) => string;
9
- export declare const isValidNetworkAddress: (ip: string) => boolean;
10
- export declare const isInternalNetworkAddress: (ip: string) => boolean;
11
- export declare const fetchViableNetworkAddresses: () => UsableNetworkAddress[];
12
- export declare const getSystemNetworkInterfaces: () => Promise<Systeminformation.NetworkInterfacesData[]>;
@@ -1,4 +0,0 @@
1
- export declare function getNpmPath(): string[];
2
- export declare function getNpmGlobalModulesDirectory(): string | null;
3
- export declare function getInstallDir(currentDir: string, moduleName: string): string;
4
- export declare function getUserHomeDir(asUser?: string): string;
@@ -1,48 +0,0 @@
1
- import { PortablePython } from '@bjia56/portable-python';
2
- import { PluginLogger } from '../polyglot/node/plugins/pluginLogger.js';
3
- export declare const SERVER_PY_VERSION = "3.11";
4
- export declare class PythonInstaller {
5
- static readonly versions: string[];
6
- logger: PluginLogger;
7
- readonly python: PortablePython;
8
- readonly venvPath?: string;
9
- readonly installPath: string;
10
- private identifier;
11
- private configService;
12
- private needsUpdate;
13
- get isInstalled(): boolean;
14
- get pluginPythonPath(): string;
15
- get serverPythonPath(): string;
16
- get pluginPackagesPath(): string;
17
- get serverPackagesPath(): string;
18
- get version(): string;
19
- private get logPrefix();
20
- constructor(identifier: string, venvDir?: string, version?: string);
21
- install(type: 'plugin' | 'server'): Promise<void>;
22
- installPluginPython(): Promise<void>;
23
- uninstall(): Promise<void>;
24
- updatePluginDependencies(requirementsPath: string): Promise<void>;
25
- updateServerDependencies(): Promise<void>;
26
- installPluginPackages(pkgs: string[]): Promise<string>;
27
- installServerPackages(pkgs: string[]): Promise<string>;
28
- reinstallPluginPackes(pkgs: string[]): Promise<string>;
29
- reinstallServerPackages(pkgs: string[]): Promise<string>;
30
- uninstallPluginPackages(pkgs: string[]): Promise<string>;
31
- uninstallServerPackages(pkgs: string[]): Promise<string>;
32
- private installPluginRequirements;
33
- private installServerRequirements;
34
- private updateRequirements;
35
- private analyzeDependencies;
36
- private updateDependencies;
37
- private installRequirements;
38
- private installPackages;
39
- private uninstallPackages;
40
- private reinstallPackages;
41
- private ensureVenv;
42
- private createVenv;
43
- private removeVenv;
44
- private removeOldVersions;
45
- private getMajorMinorVersion;
46
- private cleanPackageName;
47
- private difference;
48
- }
@@ -1,10 +0,0 @@
1
- export type Customizer<TObject, TSource> = (objValue: any, srcValue: any, key: string, object: TObject, source: TSource, stack: any[]) => any;
2
- export declare const toQuery: (data: any) => string;
3
- export declare const toData: (query: string) => Record<string, any>;
4
- export declare const isJson: (str: any) => boolean;
5
- export declare const sleep: (ms: number) => Promise<void>;
6
- export declare const isEqual: (first: any, second: any, ignoreOrder?: boolean) => boolean;
7
- export declare const mergeWith: <TObject, TSource>(object: TObject, source: TSource, customizer: Customizer<TObject, TSource>, stack?: any[]) => TObject & TSource;
8
- export declare const orderBy: (array: any[], keys: string[], orders: ("asc" | "desc")[]) => any[];
9
- export declare const structuredClone: <T>(obj: T) => T;
10
- export declare const createSourceName: (cameraName: string, sourceName: string) => string;